diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2012-05-13 00:03:35 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2012-07-09 19:12:56 -0700 |
commit | 789d64e19a3b3d98b88bc80f677e0c37bfb5c631 (patch) | |
tree | 40f01917cef8f4b645bda7f95aa2c769225d2a4a /hw/kdrive/ephyr | |
parent | 329db3292223cccd4887062956622285c45a1523 (diff) |
Remove unneccesary casts from WriteToClient calls
Casting return to (void) was used to tell lint that you intended
to ignore the return value, so it didn't warn you about it.
Casting the third argument to (char *) was used as the most generic
pointer type in the days before compilers supported C89 (void *)
(except for a couple places it's used for byte-sized pointer math).
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Tested-by: Daniel Stone <daniel@fooishbar.org>
Diffstat (limited to 'hw/kdrive/ephyr')
-rw-r--r-- | hw/kdrive/ephyr/ephyrdriext.c | 25 | ||||
-rw-r--r-- | hw/kdrive/ephyr/ephyrglxext.c | 14 | ||||
-rw-r--r-- | hw/kdrive/ephyr/ephyrproxyext.c | 2 |
3 files changed, 20 insertions, 21 deletions
diff --git a/hw/kdrive/ephyr/ephyrdriext.c b/hw/kdrive/ephyr/ephyrdriext.c index 28486f516..aefbcfbce 100644 --- a/hw/kdrive/ephyr/ephyrdriext.c +++ b/hw/kdrive/ephyr/ephyrdriext.c @@ -536,7 +536,7 @@ ProcXF86DRIQueryVersion(register ClientPtr client) swaps(&rep.minorVersion); swapl(&rep.patchVersion); } - WriteToClient(client, sizeof(xXF86DRIQueryVersionReply), (char *) &rep); + WriteToClient(client, sizeof(xXF86DRIQueryVersionReply), &rep); EPHYR_LOG("leave\n"); return Success; } @@ -574,7 +574,7 @@ ProcXF86DRIQueryDirectRenderingCapable(register ClientPtr client) } WriteToClient(client, sizeof(xXF86DRIQueryDirectRenderingCapableReply), - (char *) &rep); + &rep); EPHYR_LOG("leave\n"); return Success; @@ -617,7 +617,7 @@ ProcXF86DRIOpenConnection(register ClientPtr client) rep.hSAREAHigh = 0; #endif - WriteToClient(client, sizeof(xXF86DRIOpenConnectionReply), (char *) &rep); + WriteToClient(client, sizeof(xXF86DRIOpenConnectionReply), &rep); if (rep.busIdStringLength) WriteToClient(client, rep.busIdStringLength, busIdString); free(busIdString); @@ -648,7 +648,7 @@ ProcXF86DRIAuthConnection(register ClientPtr client) ErrorF("Failed to authenticate %lu\n", (unsigned long) stuff->magic); rep.authenticated = 0; } - WriteToClient(client, sizeof(xXF86DRIAuthConnectionReply), (char *) &rep); + WriteToClient(client, sizeof(xXF86DRIAuthConnectionReply), &rep); EPHYR_LOG("leave\n"); return Success; } @@ -702,8 +702,7 @@ ProcXF86DRIGetClientDriverName(register ClientPtr client) SIZEOF(xGenericReply) + pad_to_int32(rep.clientDriverNameLength)); - WriteToClient(client, - sizeof(xXF86DRIGetClientDriverNameReply), (char *) &rep); + WriteToClient(client, sizeof(xXF86DRIGetClientDriverNameReply), &rep); if (rep.clientDriverNameLength) WriteToClient(client, rep.clientDriverNameLength, clientDriverName); EPHYR_LOG("leave\n"); @@ -752,7 +751,7 @@ ProcXF86DRICreateContext(register ClientPtr client) return BadValue; } - WriteToClient(client, sizeof(xXF86DRICreateContextReply), (char *) &rep); + WriteToClient(client, sizeof(xXF86DRICreateContextReply), &rep); EPHYR_LOG("leave\n"); return Success; } @@ -974,7 +973,7 @@ ProcXF86DRICreateDrawable(ClientPtr client) EPHYR_LOG("paired window '%p' with remote '%d'\n", window, remote_win); } - WriteToClient(client, sizeof(xXF86DRICreateDrawableReply), (char *) &rep); + WriteToClient(client, sizeof(xXF86DRICreateDrawableReply), &rep); EPHYR_LOG("leave\n"); return Success; } @@ -1136,18 +1135,18 @@ ProcXF86DRIGetDrawableInfo(register ClientPtr client) rep.length = bytes_to_int32(rep.length); - WriteToClient(client, sizeof(xXF86DRIGetDrawableInfoReply), (char *) &rep); + WriteToClient(client, sizeof(xXF86DRIGetDrawableInfoReply), &rep); if (rep.numClipRects) { WriteToClient(client, sizeof(drm_clip_rect_t) * rep.numClipRects, - (char *) clipRects); + clipRects); } if (rep.numBackClipRects) { WriteToClient(client, sizeof(drm_clip_rect_t) * rep.numBackClipRects, - (char *) backClipRects); + backClipRects); } free(clipRects); clipRects = NULL; @@ -1200,9 +1199,9 @@ ProcXF86DRIGetDeviceInfo(register ClientPtr client) pad_to_int32(rep.devPrivateSize)); } - WriteToClient(client, sizeof(xXF86DRIGetDeviceInfoReply), (char *) &rep); + WriteToClient(client, sizeof(xXF86DRIGetDeviceInfoReply), &rep); if (rep.length) { - WriteToClient(client, rep.devPrivateSize, (char *) pDevPrivate); + WriteToClient(client, rep.devPrivateSize, pDevPrivate); } EPHYR_LOG("leave\n"); return Success; diff --git a/hw/kdrive/ephyr/ephyrglxext.c b/hw/kdrive/ephyr/ephyrglxext.c index dab028bf3..1287e0484 100644 --- a/hw/kdrive/ephyr/ephyrglxext.c +++ b/hw/kdrive/ephyr/ephyrglxext.c @@ -169,7 +169,7 @@ ephyrGLXQueryVersion(__GLXclientState * a_cl, GLbyte * a_pc) __glXSwapQueryVersionReply(client, &reply); } else { - WriteToClient(client, sz_xGLXQueryVersionReply, (char *) &reply); + WriteToClient(client, sz_xGLXQueryVersionReply, &reply); } res = Success; @@ -228,7 +228,7 @@ ephyrGLXGetVisualConfigsReal(__GLXclientState * a_cl, __GLX_SWAP_INT(&reply.numProps); __GLX_SWAP_INT_ARRAY(props_buf, num_props); } - WriteToClient(client, sz_xGLXGetVisualConfigsReply, (char *) &reply); + WriteToClient(client, sz_xGLXGetVisualConfigsReply, &reply); props_per_visual_size = props_buf_size / num_visuals; for (i = 0; i < num_visuals; i++) { WriteToClient(client, @@ -282,7 +282,7 @@ ephyrGLXGetFBConfigsSGIXReal(__GLXclientState * a_cl, __GLX_SWAP_INT(&reply.numProps); __GLX_SWAP_INT_ARRAY(props_buf, num_props); } - WriteToClient(client, sz_xGLXGetVisualConfigsReply, (char *) &reply); + WriteToClient(client, sz_xGLXGetVisualConfigsReply, &reply); props_per_visual_size = props_buf_size / num_visuals; for (i = 0; i < num_visuals; i++) { WriteToClient(client, @@ -375,7 +375,7 @@ ephyrGLXQueryServerString(__GLXclientState * a_cl, GLbyte * a_pc) } memcpy(buf, server_string, length); - WriteToClient(client, sz_xGLXQueryServerStringReply, (char *) &reply); + WriteToClient(client, sz_xGLXQueryServerStringReply, &reply); WriteToClient(client, (int) (reply.length << 2), server_string); res = Success; @@ -538,7 +538,7 @@ ephyrGLXMakeCurrentReal(__GLXclientState * a_cl, GLbyte * a_pc, Bool a_do_swap) __GLX_SWAP_INT(&reply.length); __GLX_SWAP_INT(&reply.contextTag); } - WriteToClient(a_cl->client, sz_xGLXMakeCurrentReply, (char *) &reply); + WriteToClient(a_cl->client, sz_xGLXMakeCurrentReply, &reply); res = Success; out: @@ -601,7 +601,7 @@ ephyrGLXGetStringReal(__GLXclientState * a_cl, GLbyte * a_pc, Bool a_do_swap) __GLX_SWAP_REPLY_SIZE(); __GLX_SWAP_REPLY_HEADER(); } - WriteToClient(client, length, (char *) string); + WriteToClient(client, length, string); res = Success; out: @@ -690,7 +690,7 @@ ephyrGLXIsDirectReal(__GLXclientState * a_cl, GLbyte * a_pc, Bool a_do_swap) reply.length = 0; reply.type = X_Reply; reply.sequenceNumber = client->sequence; - WriteToClient(client, sz_xGLXIsDirectReply, (char *) &reply); + WriteToClient(client, sz_xGLXIsDirectReply, &reply); res = Success; out: diff --git a/hw/kdrive/ephyr/ephyrproxyext.c b/hw/kdrive/ephyr/ephyrproxyext.c index 3d86d2db1..c24238c04 100644 --- a/hw/kdrive/ephyr/ephyrproxyext.c +++ b/hw/kdrive/ephyr/ephyrproxyext.c @@ -75,7 +75,7 @@ ephyrProxyProcDispatch(ClientPtr a_client) reply.sequence_number = a_client->sequence; res = Success; - WriteToClient(a_client, 32, (char *) &reply); + WriteToClient(a_client, 32, &reply); out: return res; |