From 57decf216a5291397c21fc3d307cca16423259ab Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Mon, 27 Dec 2021 11:03:13 +0100 Subject: [PATCH] fix warnings --- ion.c | 6 +++--- ion_private.h | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ion.c b/ion.c index c252457..e8fa657 100644 --- a/ion.c +++ b/ion.c @@ -201,8 +201,8 @@ static ZEND_METHOD(ion_Symbol_Table_Shared, __construct) break; } - ION_STRING is; - ION_CHECK(ion_symbol_table_add_symbol(obj->tab, ion_string_from_zend(&is, str), NULL), zend_string_release(str)); + ION_STRING istr; + ION_CHECK(ion_symbol_table_add_symbol(obj->tab, ion_string_from_zend(&istr, str), NULL), zend_string_release(str)); zend_string_release(str); } ZEND_HASH_FOREACH_END(); @@ -1547,7 +1547,7 @@ static ZEND_METHOD(ion_Writer_Writer, writeAnnotation) for (unsigned i = 0; i < argc; ++i) { switch (Z_TYPE(args[i])) { - case IS_STRING: + case IS_STRING: ; ION_STRING is; ION_CHECK(ion_writer_add_annotation(obj->writer, ion_string_from_zend(&is, Z_STR(args[i])))); break; diff --git a/ion_private.h b/ion_private.h index 5993af0..50658e7 100644 --- a/ion_private.h +++ b/ion_private.h @@ -435,7 +435,7 @@ static inline zend_object *php_ion_type_fetch(ION_TYPE typ) static inline ION_TYPE ion_type_from_enum(zend_object *zo) { - return Z_LVAL_P(zend_enum_fetch_case_value(zo)); + return (ION_TYPE) Z_LVAL_P(zend_enum_fetch_case_value(zo)); } typedef struct php_ion_symbol_iloc { @@ -2102,7 +2102,7 @@ static inline void php_ion_unserialize_list(php_ion_unserializer *ser, zval *ret static inline void php_ion_reader_read_lob(ION_READER *reader, zval *return_value) { zend_string *zstr = zend_string_alloc(0x1000, 0); -again: +again: ; SIZE read = 0; iERR err = ion_reader_read_lob_bytes(reader, (BYTE *) zstr->val, zstr->len, &read); if (err == IERR_BUFFER_TOO_SMALL) { @@ -2148,7 +2148,7 @@ static inline void php_ion_reader_read_int(ION_READER *reader, zval *return_valu RETVAL_LONG(i64); goto done; - case IERR_NUMERIC_OVERFLOW: + case IERR_NUMERIC_OVERFLOW: ; SIZE max, len; ION_CHECK(ion_int_char_length(num, &max)); zend_string *zs = zend_string_alloc(max, 0); @@ -2300,7 +2300,7 @@ static inline void php_ion_unserialize_zval(php_ion_unserializer *ser, zval *ret ION_CHECK(ion_reader_read_null(ser->reader, typ)); RETURN_NULL(); - case tid_BOOL_INT: + case tid_BOOL_INT: ; BOOL bval; ION_CHECK(ion_reader_read_bool(ser->reader, &bval)); RETURN_BOOL(bval); @@ -2322,7 +2322,7 @@ static inline void php_ion_unserialize_zval(php_ion_unserializer *ser, zval *ret } return; - case tid_FLOAT_INT: + case tid_FLOAT_INT: ; double d; ION_CHECK(ion_reader_read_double(ser->reader, &d)); RETURN_DOUBLE(d); @@ -2340,7 +2340,7 @@ static inline void php_ion_unserialize_zval(php_ion_unserializer *ser, zval *ret zend_hash_next_index_insert(ser->ids, return_value); return; - case tid_SYMBOL_INT: + case tid_SYMBOL_INT: ; ION_SYMBOL sym; ION_CHECK(ion_reader_read_ion_symbol(ser->reader, &sym)); php_ion_symbol_zval(&sym, return_value); @@ -2351,7 +2351,7 @@ static inline void php_ion_unserialize_zval(php_ion_unserializer *ser, zval *ret zend_hash_next_index_insert(ser->ids, return_value); return; - case tid_STRING_INT: + case tid_STRING_INT: ; ION_STRING str; ION_CHECK(ion_reader_read_string(ser->reader, &str)); RETVAL_STRINGL((char *) str.value, str.length); -- 2.30.2