Skip to content

Commit

Permalink
fix compile warning (#5346)
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanFreeman authored May 31, 2024
1 parent 1c9736d commit 56a6c6c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions ext-src/swoole_odbc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ int php_swoole_odbc_minit(int module_id) {
if (zend_hash_str_find(&php_pdo_get_dbh_ce()->constants_table, ZEND_STRL("ODBC_ATTR_USE_CURSOR_LIBRARY")) ==
nullptr) {
#ifdef SQL_ATTR_CONNECTION_POOLING
char *pooling_val = NULL;
const char *pooling_val = NULL;
#endif

#ifdef SQL_ATTR_CONNECTION_POOLING
Expand All @@ -214,7 +214,7 @@ int php_swoole_odbc_minit(int module_id) {
* request without affecting others, which goes against our isolated request
* policy. So, we use cfg_get_string here to check it this once.
* */
if (FAILURE == cfg_get_string("pdo_odbc.connection_pooling", &pooling_val) || pooling_val == NULL) {
if (FAILURE == cfg_get_string("pdo_odbc.connection_pooling", (char **) &pooling_val) || pooling_val == NULL) {
pooling_val = "strict";
}
if (strcasecmp(pooling_val, "strict") == 0 || strcmp(pooling_val, "1") == 0) {
Expand Down
4 changes: 1 addition & 3 deletions src/server/thread.cc
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,8 @@ int Server::start_worker_threads() {
}

if (!user_worker_list.empty()) {
int i = 0;
for (auto worker : user_worker_list) {
for (size_t i = 0; i < user_worker_list.size(); i++) {
_factory->spawn_user_worker(task_worker_num + worker_num + i);
i++;
}
}

Expand Down
4 changes: 2 additions & 2 deletions thirdparty/php/standard/proc_open.cc
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ static descriptorspec_item *alloc_descriptor_array(HashTable *descriptorspec) {
return (descriptorspec_item *) ecalloc(sizeof(descriptorspec_item), ndescriptors);
}

static zend_string *get_string_parameter(zval *array, int index, char *param_name) {
static zend_string *get_string_parameter(zval *array, int index, const char *param_name) {
zval *array_item;
if ((array_item = zend_hash_index_find(Z_ARRVAL_P(array), index)) == NULL) {
zend_value_error("Missing %s", param_name);
Expand Down Expand Up @@ -1193,7 +1193,7 @@ PHP_FUNCTION(swoole_proc_open) {
close_descriptor(descriptors[i].childend);

if (descriptors[i].type == DESCRIPTOR_TYPE_PIPE) {
char *mode_string = NULL;
const char *mode_string = NULL;

switch (descriptors[i].mode_flags) {
#ifdef PHP_WIN32
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/php/streams/plain_wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@ static int sw_php_stdiop_set_option(php_stream *stream, int option, int value, v
if (do_fstat(data, 1) != 0) {
return PHP_STREAM_OPTION_RETURN_ERR;
}
if (range->offset > data->sb.st_size) {
if (range->offset > (size_t) data->sb.st_size) {
range->offset = data->sb.st_size;
}
if (range->length == 0 ||
Expand Down

0 comments on commit 56a6c6c

Please sign in to comment.