summaryrefslogtreecommitdiff
path: root/ext/mysqlnd/mysqlnd_ps_codec.c
diff options
context:
space:
mode:
authorAndrey Hristov <andrey@php.net>2010-10-04 14:12:31 +0000
committerAndrey Hristov <andrey@php.net>2010-10-04 14:12:31 +0000
commit9f73a4e045e9dfefad8b7f62ff6307ee70be5c4e (patch)
treeb6888216d3f848dbcb0436f76d4bb6c20a4d46e3 /ext/mysqlnd/mysqlnd_ps_codec.c
parent4c63a2232d53cfc8be18914c1301e82d471381f2 (diff)
downloadphp-git-9f73a4e045e9dfefad8b7f62ff6307ee70be5c4e.tar.gz
add some safe casts - lower the number of warnings by 2
Diffstat (limited to 'ext/mysqlnd/mysqlnd_ps_codec.c')
-rw-r--r--ext/mysqlnd/mysqlnd_ps_codec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/mysqlnd/mysqlnd_ps_codec.c b/ext/mysqlnd/mysqlnd_ps_codec.c
index e2fc9b62d7..b95d6f00df 100644
--- a/ext/mysqlnd/mysqlnd_ps_codec.c
+++ b/ext/mysqlnd/mysqlnd_ps_codec.c
@@ -84,7 +84,7 @@ void ps_fetch_from_1_to_8_bytes(zval *zv, const MYSQLND_FIELD * const field,
#endif /* #if SIZEOF_LONG==4 */
{
if (byte_count < 8 || uval <= L64(9223372036854775807)) {
- ZVAL_LONG(zv, uval);
+ ZVAL_LONG(zv, (long) uval); /* the cast is safe, we are in the range */
} else {
DBG_INF("stringify");
tmp_len = sprintf((char *)&tmp, MYSQLND_LLU_SPEC, uval);
@@ -112,7 +112,7 @@ void ps_fetch_from_1_to_8_bytes(zval *zv, const MYSQLND_FIELD * const field,
} else
#endif /* SIZEOF */
{
- ZVAL_LONG(zv, lval);
+ ZVAL_LONG(zv, (long) lval); /* the cast is safe, we are in the range */
}
}