Skip to content

Commit 68e764d

Browse files
committed
Merge pull request php-memcached-dev#131 from remicollet/issue-220RC1
Fix build warnings
2 parents 03811a1 + 573c978 commit 68e764d

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

php_memcached.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ static void php_memc_getMulti_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool by_ke
702702
uint64_t cas = 0;
703703
zval *cas_tokens = NULL;
704704
zval *udf_flags = NULL;
705-
uint64_t orig_cas_flag;
705+
uint64_t orig_cas_flag = 0;
706706
zval *value;
707707
long get_flags = 0;
708708
int i = 0;
@@ -907,7 +907,7 @@ static void php_memc_getDelayed_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool by_
907907
zval **entry = NULL;
908908
const char **mkeys = NULL;
909909
size_t *mkeys_len = NULL;
910-
uint64_t orig_cas_flag;
910+
uint64_t orig_cas_flag = 0;
911911
zend_fcall_info fci = empty_fcall_info;
912912
zend_fcall_info_cache fcc = empty_fcall_info_cache;
913913
int i = 0;
@@ -1393,7 +1393,7 @@ static void php_memc_store_impl(INTERNAL_FUNCTION_PARAMETERS, int op, zend_bool
13931393
zval *value;
13941394
long expiration = 0;
13951395
long udf_flags = 0;
1396-
char *payload;
1396+
char *payload = NULL;
13971397
size_t payload_len;
13981398
uint32_t flags = 0;
13991399
uint32_t retry = 0;
@@ -1545,6 +1545,7 @@ static void php_memc_store_impl(INTERNAL_FUNCTION_PARAMETERS, int op, zend_bool
15451545

15461546
default:
15471547
/* not reached */
1548+
status = 0;
15481549
assert(0);
15491550
break;
15501551
}
@@ -1556,7 +1557,7 @@ static void php_memc_store_impl(INTERNAL_FUNCTION_PARAMETERS, int op, zend_bool
15561557
RETVAL_TRUE;
15571558
}
15581559

1559-
if (op != MEMC_OP_TOUCH) {
1560+
if (payload) {
15601561
efree(payload);
15611562
}
15621563
}
@@ -3286,7 +3287,7 @@ char *php_memc_zval_to_payload(zval *value, size_t *payload_len, uint32_t *flags
32863287
static
32873288
char *s_decompress_value (const char *payload, size_t *payload_len, uint32_t flags TSRMLS_DC)
32883289
{
3289-
char *buffer;
3290+
char *buffer = NULL;
32903291
uint32_t len;
32913292
unsigned long length;
32923293
zend_bool decompress_status = 0;
@@ -3734,8 +3735,6 @@ PHP_METHOD(MemcachedServer, run)
37343735
static
37353736
PHP_METHOD(MemcachedServer, on)
37363737
{
3737-
php_memc_server_t *intern;
3738-
37393738
long event;
37403739
zend_fcall_info fci;
37413740
zend_fcall_info_cache fci_cache;
@@ -3745,8 +3744,6 @@ PHP_METHOD(MemcachedServer, on)
37453744
return;
37463745
}
37473746

3748-
intern = (php_memc_server_t *) zend_object_store_get_object(getThis() TSRMLS_CC);
3749-
37503747
if (event <= MEMC_SERVER_ON_MIN || event >= MEMC_SERVER_ON_MAX) {
37513748
RETURN_FALSE;
37523749
}

php_memcached_private.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ ZEND_BEGIN_MODULE_GLOBALS(php_memcached)
165165
#endif
166166
#ifdef HAVE_MEMCACHED_PROTOCOL
167167
struct {
168-
php_memc_server_cb_t callbacks [14];
168+
php_memc_server_cb_t callbacks [MEMC_SERVER_ON_MAX];
169169
} server;
170170
#endif
171171
long store_retry_count;

0 commit comments

Comments
 (0)