andrey Thu, 15 Apr 2010 15:53:58 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=298045
Log: More int/uint comparison warning fixes Changed paths: U php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_debug.c U php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_wireprotocol.c U php/php-src/trunk/ext/mysqlnd/mysqlnd_debug.c U php/php-src/trunk/ext/mysqlnd/mysqlnd_wireprotocol.c
Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_debug.c =================================================================== --- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_debug.c 2010-04-15 15:28:38 UTC (rev 298044) +++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_debug.c 2010-04-15 15:53:58 UTC (rev 298045) @@ -311,7 +311,7 @@ if ((self->flags & MYSQLND_DEBUG_DUMP_TRACE) == 0 || self->file_name == NULL) { return FALSE; } - if (zend_stack_count(&self->call_stack) >= self->nest_level_limit) { + if ((uint) zend_stack_count(&self->call_stack) >= self->nest_level_limit) { return FALSE; } @@ -348,7 +348,7 @@ if ((self->flags & MYSQLND_DEBUG_DUMP_TRACE) == 0 || self->file_name == NULL) { return PASS; } - if (zend_stack_count(&self->call_stack) >= self->nest_level_limit) { + if ((uint) zend_stack_count(&self->call_stack) >= self->nest_level_limit) { return PASS; } Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_wireprotocol.c =================================================================== --- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_wireprotocol.c 2010-04-15 15:28:38 UTC (rev 298044) +++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_wireprotocol.c 2010-04-15 15:53:58 UTC (rev 298045) @@ -338,7 +338,7 @@ /* pad2 */ p+= 13; - if (p - buf < packet->header.size) { + if ((size_t) (p - buf) < packet->header.size) { /* scramble_buf is split into two parts */ memcpy(packet->scramble_buf + SCRAMBLE_LENGTH_323, p, SCRAMBLE_LENGTH - SCRAMBLE_LENGTH_323); @@ -352,7 +352,7 @@ DBG_INF_FMT("server_capabilities=%d charset_no=%d server_status=%d", packet->server_capabilities, packet->charset_no, packet->server_status); - if (p - begin > packet->header.size) { + if ((size_t)(p - begin) > packet->header.size) { DBG_ERR_FMT("GREET packet %d bytes shorter than expected", p - begin - packet->header.size); php_error_docref(NULL TSRMLS_CC, E_WARNING, "GREET packet "MYSQLND_SZ_T_SPEC" bytes shorter than expected", p - begin - packet->header.size); @@ -556,7 +556,7 @@ packet->affected_rows, packet->last_insert_id, packet->server_status, packet->warning_count); - if (p - begin > packet->header.size) { + if ((size_t)(p - begin) > packet->header.size) { DBG_ERR_FMT("OK packet %d bytes shorter than expected", p - begin - packet->header.size); php_error_docref(NULL TSRMLS_CC, E_WARNING, "OK packet "MYSQLND_SZ_T_SPEC" bytes shorter than expected", p - begin - packet->header.size); @@ -631,7 +631,7 @@ packet->server_status = 0; } - if (p - begin > packet->header.size) { + if ((size_t)(p - begin) > packet->header.size) { DBG_ERR_FMT("EOF packet %d bytes shorter than expected", p - begin - packet->header.size); php_error_docref(NULL TSRMLS_CC, E_WARNING, "EOF packet "MYSQLND_SZ_T_SPEC" bytes shorter than expected", p - begin - packet->header.size); @@ -795,7 +795,7 @@ /* Result set */ break; } - if (p - begin > packet->header.size) { + if ((size_t)(p - begin) > packet->header.size) { DBG_ERR_FMT("RSET_HEADER packet %d bytes shorter than expected", p - begin - packet->header.size); php_error_docref(NULL TSRMLS_CC, E_WARNING, "RSET_HEADER packet "MYSQLND_SZ_T_SPEC" bytes shorter than expected", p - begin - packet->header.size); @@ -947,7 +947,7 @@ p += len; } - if (p - begin > packet->header.size) { + if ((size_t)(p - begin) > packet->header.size) { DBG_ERR_FMT("RSET field packet %d bytes shorter than expected", p - begin - packet->header.size); php_error_docref(NULL TSRMLS_CC, E_WARNING, "Result set field packet "MYSQLND_SZ_T_SPEC" bytes " "shorter than expected", p - begin - packet->header.size); @@ -1639,7 +1639,7 @@ DBG_INF_FMT("Prepare packet read: stmt_id=%d fields=%d params=%d", packet->stmt_id, packet->field_count, packet->param_count); - if (p - begin > packet->header.size) { + if ((size_t)(p - begin) > packet->header.size) { DBG_ERR_FMT("PREPARE packet %d bytes shorter than expected", p - begin - packet->header.size); php_error_docref(NULL TSRMLS_CC, E_WARNING, "PREPARE packet "MYSQLND_SZ_T_SPEC" bytes shorter than expected", p - begin - packet->header.size); @@ -1700,7 +1700,7 @@ packet->error_info.sqlstate TSRMLS_CC); } - if (p - begin > packet->header.size) { + if ((size_t) (p - begin) > packet->header.size) { DBG_ERR_FMT("CHANGE_USER packet %d bytes shorter than expected", p - begin - packet->header.size); php_error_docref(NULL TSRMLS_CC, E_WARNING, "CHANGE_USER packet "MYSQLND_SZ_T_SPEC" bytes shorter than expected", p - begin - packet->header.size); Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_debug.c =================================================================== --- php/php-src/trunk/ext/mysqlnd/mysqlnd_debug.c 2010-04-15 15:28:38 UTC (rev 298044) +++ php/php-src/trunk/ext/mysqlnd/mysqlnd_debug.c 2010-04-15 15:53:58 UTC (rev 298045) @@ -311,7 +311,7 @@ if ((self->flags & MYSQLND_DEBUG_DUMP_TRACE) == 0 || self->file_name == NULL) { return FALSE; } - if (zend_stack_count(&self->call_stack) >= self->nest_level_limit) { + if ((uint) zend_stack_count(&self->call_stack) >= self->nest_level_limit) { return FALSE; } @@ -348,7 +348,7 @@ if ((self->flags & MYSQLND_DEBUG_DUMP_TRACE) == 0 || self->file_name == NULL) { return PASS; } - if (zend_stack_count(&self->call_stack) >= self->nest_level_limit) { + if ((uint) zend_stack_count(&self->call_stack) >= self->nest_level_limit) { return PASS; } Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_wireprotocol.c =================================================================== --- php/php-src/trunk/ext/mysqlnd/mysqlnd_wireprotocol.c 2010-04-15 15:28:38 UTC (rev 298044) +++ php/php-src/trunk/ext/mysqlnd/mysqlnd_wireprotocol.c 2010-04-15 15:53:58 UTC (rev 298045) @@ -338,7 +338,7 @@ /* pad2 */ p+= 13; - if (p - buf < packet->header.size) { + if ((size_t) (p - buf) < packet->header.size) { /* scramble_buf is split into two parts */ memcpy(packet->scramble_buf + SCRAMBLE_LENGTH_323, p, SCRAMBLE_LENGTH - SCRAMBLE_LENGTH_323); @@ -352,7 +352,7 @@ DBG_INF_FMT("server_capabilities=%d charset_no=%d server_status=%d", packet->server_capabilities, packet->charset_no, packet->server_status); - if (p - begin > packet->header.size) { + if ((size_t)(p - begin) > packet->header.size) { DBG_ERR_FMT("GREET packet %d bytes shorter than expected", p - begin - packet->header.size); php_error_docref(NULL TSRMLS_CC, E_WARNING, "GREET packet "MYSQLND_SZ_T_SPEC" bytes shorter than expected", p - begin - packet->header.size); @@ -556,7 +556,7 @@ packet->affected_rows, packet->last_insert_id, packet->server_status, packet->warning_count); - if (p - begin > packet->header.size) { + if ((size_t)(p - begin) > packet->header.size) { DBG_ERR_FMT("OK packet %d bytes shorter than expected", p - begin - packet->header.size); php_error_docref(NULL TSRMLS_CC, E_WARNING, "OK packet "MYSQLND_SZ_T_SPEC" bytes shorter than expected", p - begin - packet->header.size); @@ -631,7 +631,7 @@ packet->server_status = 0; } - if (p - begin > packet->header.size) { + if ((size_t)(p - begin) > packet->header.size) { DBG_ERR_FMT("EOF packet %d bytes shorter than expected", p - begin - packet->header.size); php_error_docref(NULL TSRMLS_CC, E_WARNING, "EOF packet "MYSQLND_SZ_T_SPEC" bytes shorter than expected", p - begin - packet->header.size); @@ -795,7 +795,7 @@ /* Result set */ break; } - if (p - begin > packet->header.size) { + if ((size_t)(p - begin) > packet->header.size) { DBG_ERR_FMT("RSET_HEADER packet %d bytes shorter than expected", p - begin - packet->header.size); php_error_docref(NULL TSRMLS_CC, E_WARNING, "RSET_HEADER packet "MYSQLND_SZ_T_SPEC" bytes shorter than expected", p - begin - packet->header.size); @@ -947,7 +947,7 @@ p += len; } - if (p - begin > packet->header.size) { + if ((size_t)(p - begin) > packet->header.size) { DBG_ERR_FMT("RSET field packet %d bytes shorter than expected", p - begin - packet->header.size); php_error_docref(NULL TSRMLS_CC, E_WARNING, "Result set field packet "MYSQLND_SZ_T_SPEC" bytes " "shorter than expected", p - begin - packet->header.size); @@ -1639,7 +1639,7 @@ DBG_INF_FMT("Prepare packet read: stmt_id=%d fields=%d params=%d", packet->stmt_id, packet->field_count, packet->param_count); - if (p - begin > packet->header.size) { + if ((size_t)(p - begin) > packet->header.size) { DBG_ERR_FMT("PREPARE packet %d bytes shorter than expected", p - begin - packet->header.size); php_error_docref(NULL TSRMLS_CC, E_WARNING, "PREPARE packet "MYSQLND_SZ_T_SPEC" bytes shorter than expected", p - begin - packet->header.size); @@ -1700,7 +1700,7 @@ packet->error_info.sqlstate TSRMLS_CC); } - if (p - begin > packet->header.size) { + if ((size_t) (p - begin) > packet->header.size) { DBG_ERR_FMT("CHANGE_USER packet %d bytes shorter than expected", p - begin - packet->header.size); php_error_docref(NULL TSRMLS_CC, E_WARNING, "CHANGE_USER packet "MYSQLND_SZ_T_SPEC" bytes shorter than expected", p - begin - packet->header.size);
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php