summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2022-08-18 19:02:35 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2022-08-18 19:02:35 -0700
commitff3456b04e1b42fd77e0db061bf7a563108b5868 (patch)
tree0025a0ad0fe4019e82b8e6a3d84d67550af4edf4
parentf8a2329d8a24c0901d945986232267c02f080fc4 (diff)
Resolve -Wsign-compare warnings
XRecord.c: In function ‘XRecordFreeState’: XRecord.c:515:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(i=0; i<state->nclients; i++) { ^ XRecord.c: In function ‘parse_reply_call_callback’: XRecord.c:752:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (current_index + 4 > rep->length << 2) ^ XRecord.c:759:28: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (current_index + 1 > rep->length << 2) ^ XRecord.c:763:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (current_index + 8 > rep->length << 2) ^ XRecord.c:777:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (current_index + 4 > rep->length << 2) ^ XRecord.c:785:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (current_index + 4 > rep->length << 2) ^ XRecord.c:792:28: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (current_index + 4 > rep->length<<2) ^ XRecord.c:797:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (current_index + 8 > rep->length << 2) ^ XRecord.c:810:28: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (current_index + 8 > rep->length << 2) ^ XRecord.c:818:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (current_index + 4 > rep->length << 2) ^ XRecord.c:824:31: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] } else if (current_index < rep->length << 2) ^ XRecord.c:830:24: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (current_index < rep->length << 2) ^ XRecord.c:859:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] } while (current_index<rep->length<<2); ^ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--src/XRecord.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/XRecord.c b/src/XRecord.c
index fefd842..00f4480 100644
--- a/src/XRecord.c
+++ b/src/XRecord.c
@@ -510,9 +510,7 @@ XRecordGetContext(Display *dpy, XRecordContext context,
void
XRecordFreeState(XRecordState *state)
{
- int i;
-
- for(i=0; i<state->nclients; i++) {
+ for (unsigned long i = 0; i < state->nclients; i++) {
if (state->client_info[i]->ranges) {
if (state->client_info[i]->ranges[0])
Xfree(state->client_info[i]->ranges[0]);
@@ -727,7 +725,7 @@ parse_reply_call_callback(
XRecordInterceptProc callback,
XPointer closure)
{
- int current_index;
+ unsigned int current_index;
int datum_bytes = 0;
XRecordInterceptData *data;