Remove pointless casts

You never have to explicitly cast between `void*` and any other pointer
type.
This commit is contained in:
michael-grunder
2025-08-19 16:13:29 -07:00
committed by Michael Grunder
parent 7769194757
commit 03837f0230
4 changed files with 10 additions and 10 deletions
+6 -6
View File
@@ -1970,7 +1970,7 @@ PHP_REDIS_API void cluster_type_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster
PHP_REDIS_API void cluster_sub_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
void *ctx)
{
subscribeContext *sctx = (subscribeContext*)ctx;
subscribeContext *sctx = ctx;
zval z_tab, *z_tmp;
int pull = 0;
@@ -2080,7 +2080,7 @@ PHP_REDIS_API void cluster_sub_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *
PHP_REDIS_API void cluster_unsub_resp(INTERNAL_FUNCTION_PARAMETERS,
redisCluster *c, void *ctx)
{
subscribeContext *sctx = (subscribeContext*)ctx;
subscribeContext *sctx = ctx;
zval z_tab = {0}, *z_chan, *z_flag;
int pull = 0, argc = sctx->argc;
@@ -2631,7 +2631,7 @@ PHP_REDIS_API void cluster_multi_mbulk_resp(INTERNAL_FUNCTION_PARAMETERS,
PHP_REDIS_API void cluster_mbulk_mget_resp(INTERNAL_FUNCTION_PARAMETERS,
redisCluster *c, void *ctx)
{
clusterMultiCtx *mctx = (clusterMultiCtx*)ctx;
clusterMultiCtx *mctx = ctx;
/* Protect against an invalid response type, -1 response length, and failure
* to consume the responses. */
@@ -2667,7 +2667,7 @@ PHP_REDIS_API void cluster_mbulk_mget_resp(INTERNAL_FUNCTION_PARAMETERS,
PHP_REDIS_API void cluster_msetnx_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
void *ctx)
{
clusterMultiCtx *mctx = (clusterMultiCtx*)ctx;
clusterMultiCtx *mctx = ctx;
int real_argc = mctx->count/2;
// Protect against an invalid response type
@@ -2703,7 +2703,7 @@ PHP_REDIS_API void cluster_msetnx_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluste
PHP_REDIS_API void cluster_del_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
void *ctx)
{
clusterMultiCtx *mctx = (clusterMultiCtx*)ctx;
clusterMultiCtx *mctx = ctx;
// If we get an invalid reply, inform the client
if (c->reply_type != TYPE_INT) {
@@ -2732,7 +2732,7 @@ PHP_REDIS_API void cluster_del_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *
PHP_REDIS_API void cluster_mset_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
void *ctx)
{
clusterMultiCtx *mctx = (clusterMultiCtx*)ctx;
clusterMultiCtx *mctx = ctx;
// If we get an invalid reply type something very wrong has happened,
// and we have to abort.
+2 -2
View File
@@ -509,7 +509,7 @@ PHP_REDIS_API int redis_subscribe_response(INTERNAL_FUNCTION_PARAMETERS,
{
HashTable *subs;
subscribeCallback *cb;
subscribeContext *sctx = (subscribeContext*)ctx;
subscribeContext *sctx = ctx;
zval *z_tmp, z_resp;
int i;
@@ -663,7 +663,7 @@ PHP_REDIS_API int redis_unsubscribe_response(INTERNAL_FUNCTION_PARAMETERS,
RedisSock *redis_sock, zval *z_tab,
void *ctx)
{
subscribeContext *sctx = (subscribeContext*)ctx;
subscribeContext *sctx = ctx;
zval *z_chan, z_ret, z_resp;
int i;
+1 -1
View File
@@ -437,7 +437,7 @@ distcmd_resp_handler(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c, short slot,
if (CLUSTER_IS_ATOMIC(c)) {
// Process response now
cb(INTERNAL_FUNCTION_PARAM_PASSTHRU, c, (void*)ctx);
cb(INTERNAL_FUNCTION_PARAM_PASSTHRU, c, ctx);
} else {
cluster_enqueue_response(c, slot, cb, ctx);
}
+1 -1
View File
@@ -1622,7 +1622,7 @@ int redis_subscribe_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock,
// Push values out
*cmd_len = cmdstr.len;
*cmd = cmdstr.c;
*ctx = (void*)sctx;
*ctx = sctx;
if (shardslot != REDIS_CLUSTER_SLOTS) {
if (slot) *slot = shardslot;