From 0a5c6314883b37ccb83d3b809ad4fe6c9d4b95a5 Mon Sep 17 00:00:00 2001 From: Andrey Hristov Date: Mon, 4 Oct 2010 14:12:31 +0000 Subject: [PATCH] add some safe casts - lower the number of warnings by 2 --- ext/mysqlnd/mysqlnd_ps_codec.c | 4 ++-- 1 file 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 */ } } -- 2.40.0