Skip to content

Commit 38b24cc

Browse files
committed
fix more build warnings
1 parent 9940a65 commit 38b24cc

File tree

6 files changed

+9
-11
lines changed

6 files changed

+9
-11
lines changed

enum.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ PHP_METHOD(protocolbuffers_enum, isValid)
2626
return;
2727
#else
2828
long value;
29-
zval *result, *result2;
29+
zval *result;
3030

3131
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
3232
"l", &value) == FAILURE) {
@@ -71,15 +71,15 @@ PHP_METHOD(protocolbuffers_enum, getName)
7171
return;
7272
#else
7373
long value;
74-
zval *result, *result2;
74+
zval *result;
7575

7676
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
7777
"l", &value) == FAILURE) {
7878
return;
7979
}
8080

8181
if (zend_call_method_with_0_params(NULL, EG(called_scope), NULL, "getenumdescriptor", &result)) {
82-
zval *values, **entry, **key;
82+
zval *values, **entry;
8383
HashPosition pos;
8484

8585
if (!instanceof_function_ex(Z_OBJCE_P(result), php_protocol_buffers_enum_descriptor_class_entry, 0 TSRMLS_CC)) {

enum_descriptor_builder.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ PHP_METHOD(protocolbuffers_enum_descriptor_builder, __construct)
2727
PHP_METHOD(protocolbuffers_enum_descriptor_builder, addValue)
2828
{
2929
zval *instance = getThis();
30-
zval *value, **fields, *name, *value2;
30+
zval *value, **fields, *name;
3131
zend_bool force = 0;
3232
char *property;
3333
int property_len;

helper.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ static void php_protocolbuffers_helper_debug_zval(zval **value TSRMLS_DC)
3535
zval *val = *value;
3636

3737
php_printf("{\n");
38-
php_printf(" address: 0x%x,\n", (unsigned int)val);
38+
php_printf(" address: 0x%lx,\n", (unsigned long)val);
3939
php_printf(" type: %d,\n", val->type);
4040
php_printf(" is_ref: %d,\n", PZVAL_IS_REF(val));
4141
php_printf(" refcount: %d,\n", Z_REFCOUNT_PP(value));
@@ -44,14 +44,14 @@ static void php_protocolbuffers_helper_debug_zval(zval **value TSRMLS_DC)
4444
php_printf(" double: %f,\n", val->value.dval);
4545
if (val->type == 4) {
4646
php_printf(" ht: {\n");
47-
php_printf(" address: 0x%x,\n", (unsigned int)val->value.ht);
47+
php_printf(" address: 0x%lx,\n", (unsigned long)val->value.ht);
4848
php_printf(" num_of_elements: %d,\n", (unsigned int)val->value.ht->nNumOfElements);
4949
php_printf(" next_free_elements: %d,\n", (unsigned int)val->value.ht->nNextFreeElement);
5050
php_printf(" },\n");
5151
}
5252
php_printf(" object: {\n");
5353
php_printf(" handle: 0x%x,\n", val->value.obj.handle);
54-
php_printf(" handlers: 0x%x,\n", (unsigned int)val->value.obj.handlers);
54+
php_printf(" handlers: 0x%lx,\n", (unsigned long)val->value.obj.handlers);
5555
php_printf(" },\n");
5656
php_printf(" }\n");
5757
php_printf("}\n");

message.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1571,7 +1571,6 @@ PHP_METHOD(protocolbuffers_message, clearExtension)
15711571

15721572
if (zend_hash_find(htt, n, n_len, (void **)&e) == SUCCESS) {
15731573
zval *tmp;
1574-
ulong hval;
15751574
if (is_mangled) {
15761575
efree(n);
15771576
}
@@ -1676,7 +1675,6 @@ PHP_METHOD(protocolbuffers_message, jsonSerialize)
16761675
PHP_METHOD(protocolbuffers_message, toArray)
16771676
{
16781677
zval *instance = getThis(), *result = NULL;
1679-
zend_class_entry **json;
16801678

16811679
if (php_protocolbuffers_jsonserialize(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1, Z_OBJCE_P(instance), instance, &result) == 0) {
16821680
RETURN_ZVAL(result, 0, 1);

serializer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -723,13 +723,13 @@ int php_protocolbuffers_fetch_element(INTERNAL_FUNCTION_PARAMETERS, php_protocol
723723

724724
if (zend_hash_find(hash, name, name_len, (void **)&tmp) == SUCCESS) {
725725
*output = *tmp;
726-
return 0;
727726
} else {
728727
if (scheme->required > 0) {
729728
zend_throw_exception_ex(php_protocol_buffers_invalid_protocolbuffers_exception_class_entry, 0 TSRMLS_CC, "the class does not declared required property `%s`. probably you missed declaration", scheme->name);
730729
return 1;
731730
}
732731
}
732+
return 0;
733733
}
734734

735735
int php_protocolbuffers_encode_message(INTERNAL_FUNCTION_PARAMETERS, zval *klass, php_protocolbuffers_scheme_container *container, php_protocolbuffers_serializer **serializer)

unknown_field_set.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ void php_protocolbuffers_unknown_field_set_properties_init(zval *object TSRMLS_D
6666

6767
void php_protocolbuffers_unknown_field_clear(INTERNAL_FUNCTION_PARAMETERS, zval *instance)
6868
{
69-
zval *fields = NULL, **prior_fields = NULL;
69+
zval *fields = NULL;
7070
char *name = {0};
7171
int name_len = 0;
7272

0 commit comments

Comments
 (0)