diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-10-17 16:45:38 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-10-17 16:45:38 -0700 |
commit | 684ed1b997f9e8a2fe2219524c1dea04b20a7e25 (patch) | |
tree | 3ee5dafa6f75483460c147a07066fd8a53d945c5 /src/XrrProvider.c | |
parent | 8ddb2aefcda77709cf98f15fbcb7d97a2d00ab7d (diff) |
XRRGetProviderInfo: Remove unneeded ProviderInfoExtra
It was always 0, hence caused gcc warnings:
XrrProvider.c: In function ‘XRRGetProviderInfo’:
XrrProvider.c:133:49: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
if (rep.length > INT_MAX >> 2 || rep.length < ProviderInfoExtra >> 2)
^
XrrProvider.c:135:17: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
if (rep.length < ProviderInfoExtra >> 2)
^
XrrProvider.c:135:5: warning: this condition has identical branches [-Wduplicated-branches]
if (rep.length < ProviderInfoExtra >> 2)
^
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'src/XrrProvider.c')
-rw-r--r-- | src/XrrProvider.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/XrrProvider.c b/src/XrrProvider.c index d796cd0..1c7c43b 100644 --- a/src/XrrProvider.c +++ b/src/XrrProvider.c @@ -104,7 +104,6 @@ XRRFreeProviderResources(XRRProviderResources *provider_resources) free(provider_resources); } -#define ProviderInfoExtra (SIZEOF(xRRGetProviderInfoReply) - 32) XRRProviderInfo * XRRGetProviderInfo(Display *dpy, XRRScreenResources *resources, RRProvider provider) { @@ -123,25 +122,22 @@ XRRGetProviderInfo(Display *dpy, XRRScreenResources *resources, RRProvider provi req->provider = provider; req->configTimestamp = resources->configTimestamp; - if (!_XReply (dpy, (xReply *) &rep, ProviderInfoExtra >> 2, xFalse)) + if (!_XReply (dpy, (xReply *) &rep, 0, xFalse)) { UnlockDisplay (dpy); SyncHandle (); return NULL; } - if (rep.length > INT_MAX >> 2 || rep.length < ProviderInfoExtra >> 2) + if (rep.length > INT_MAX >> 2) { - if (rep.length < ProviderInfoExtra >> 2) - _XEatDataWords (dpy, rep.length); - else - _XEatDataWords (dpy, rep.length - (ProviderInfoExtra >> 2)); + _XEatDataWords (dpy, rep.length); UnlockDisplay (dpy); SyncHandle (); return NULL; } - nbytes = ((long) rep.length << 2) - ProviderInfoExtra; + nbytes = ((long) rep.length << 2); nbytesRead = (long)(rep.nCrtcs * 4 + rep.nOutputs * 4 + @@ -156,7 +152,7 @@ XRRGetProviderInfo(Display *dpy, XRRScreenResources *resources, RRProvider provi xpi = (XRRProviderInfo *)Xmalloc(rbytes); if (xpi == NULL) { - _XEatDataWords (dpy, rep.length - (ProviderInfoExtra >> 2)); + _XEatDataWords (dpy, rep.length); UnlockDisplay (dpy); SyncHandle (); return NULL; |