@@ -2186,7 +2186,6 @@ static void php_memc_incdec_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool by_key,
21862186{
21872187 zend_string * key , * server_key = NULL ;
21882188 zend_long offset = 1 ;
2189- uint32_t offset32 = 0 ;
21902189 uint64_t value = UINT64_MAX , initial = 0 ;
21912190 time_t expiry = 0 ;
21922191 memcached_return status ;
@@ -2213,23 +2212,18 @@ static void php_memc_incdec_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool by_key,
22132212 RETURN_FALSE ;
22142213 }
22152214
2216- if (offset > UINT_MAX ) {
2217- php_error_docref (NULL , E_WARNING , "offset cannot be larger than %d" , UINT_MAX );
2218- RETURN_FALSE ;
2219- }
2220-
22212215 if ((!by_key && n_args < 3 ) || (by_key && n_args < 4 )) {
22222216 if (by_key ) {
22232217 if (incr ) {
2224- status = memcached_increment_by_key (intern -> memc , ZSTR_VAL (server_key ), ZSTR_LEN (server_key ), ZSTR_VAL (key ), ZSTR_LEN (key ), ( unsigned int ) offset , & value );
2218+ status = memcached_increment_by_key (intern -> memc , ZSTR_VAL (server_key ), ZSTR_LEN (server_key ), ZSTR_VAL (key ), ZSTR_LEN (key ), offset , & value );
22252219 } else {
2226- status = memcached_decrement_by_key (intern -> memc , ZSTR_VAL (server_key ), ZSTR_LEN (server_key ), ZSTR_VAL (key ), ZSTR_LEN (key ), ( unsigned int ) offset , & value );
2220+ status = memcached_decrement_by_key (intern -> memc , ZSTR_VAL (server_key ), ZSTR_LEN (server_key ), ZSTR_VAL (key ), ZSTR_LEN (key ), offset , & value );
22272221 }
22282222 } else {
22292223 if (incr ) {
2230- status = memcached_increment (intern -> memc , ZSTR_VAL (key ), ZSTR_LEN (key ), ( unsigned int ) offset , & value );
2224+ status = memcached_increment_by_key (intern -> memc , ZSTR_VAL (key ), ZSTR_LEN (key ), ZSTR_VAL ( key ), ZSTR_LEN ( key ), offset , & value );
22312225 } else {
2232- status = memcached_decrement (intern -> memc , ZSTR_VAL (key ), ZSTR_LEN (key ), ( unsigned int ) offset , & value );
2226+ status = memcached_decrement_by_key (intern -> memc , ZSTR_VAL (key ), ZSTR_LEN (key ), ZSTR_VAL ( key ), ZSTR_LEN ( key ), offset , & value );
22332227 }
22342228 }
22352229
@@ -2243,15 +2237,15 @@ static void php_memc_incdec_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool by_key,
22432237 }
22442238 if (by_key ) {
22452239 if (incr ) {
2246- status = memcached_increment_with_initial_by_key (intern -> memc , ZSTR_VAL (server_key ), ZSTR_LEN (server_key ), ZSTR_VAL (key ), ZSTR_LEN (key ), ( unsigned int ) offset , initial , expiry , & value );
2240+ status = memcached_increment_with_initial_by_key (intern -> memc , ZSTR_VAL (server_key ), ZSTR_LEN (server_key ), ZSTR_VAL (key ), ZSTR_LEN (key ), offset , initial , expiry , & value );
22472241 } else {
2248- status = memcached_decrement_with_initial_by_key (intern -> memc , ZSTR_VAL (server_key ), ZSTR_LEN (server_key ), ZSTR_VAL (key ), ZSTR_LEN (key ), ( unsigned int ) offset , initial , expiry , & value );
2242+ status = memcached_decrement_with_initial_by_key (intern -> memc , ZSTR_VAL (server_key ), ZSTR_LEN (server_key ), ZSTR_VAL (key ), ZSTR_LEN (key ), offset , initial , expiry , & value );
22492243 }
22502244 } else {
22512245 if (incr ) {
2252- status = memcached_increment_with_initial (intern -> memc , ZSTR_VAL (key ), ZSTR_LEN (key ), ( unsigned int ) offset , initial , expiry , & value );
2246+ status = memcached_increment_with_initial (intern -> memc , ZSTR_VAL (key ), ZSTR_LEN (key ), offset , initial , expiry , & value );
22532247 } else {
2254- status = memcached_decrement_with_initial (intern -> memc , ZSTR_VAL (key ), ZSTR_LEN (key ), ( unsigned int ) offset , initial , expiry , & value );
2248+ status = memcached_decrement_with_initial (intern -> memc , ZSTR_VAL (key ), ZSTR_LEN (key ), offset , initial , expiry , & value );
22552249 }
22562250 }
22572251 if (s_should_retry_write (intern , status ) && retries -- > 0 ) {
0 commit comments