diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2009-07-03 13:57:14 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2009-07-14 10:05:53 +1000 |
commit | 7dd415aa6a3959f15276741db168ba264948ecfe (patch) | |
tree | 84e5b697f073722936dc82f138255f71ef2153d4 /Xi/xiproperty.c | |
parent | 912402fd71144bcee255141efe12a78abad39240 (diff) |
Xi: use byte-counting macros instead of manual calculation.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'Xi/xiproperty.c')
-rw-r--r-- | Xi/xiproperty.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Xi/xiproperty.c b/Xi/xiproperty.c index 55f20c402..0a47e31ee 100644 --- a/Xi/xiproperty.c +++ b/Xi/xiproperty.c @@ -903,7 +903,7 @@ ProcXChangeDeviceProperty (ClientPtr client) stuff->format, stuff->mode, stuff->nUnits); len = stuff->nUnits; - if (len > ((0xffffffff - sizeof(xChangeDevicePropertyReq)) >> 2)) + if (len > (bytes_to_int32(0xffffffff - sizeof(xChangeDevicePropertyReq)))) return BadLength; totalSize = len * (stuff->format/8); @@ -972,7 +972,7 @@ ProcXGetDeviceProperty (ClientPtr client) reply.format = format; reply.bytesAfter = bytes_after; reply.propertyType = type; - reply.length = (length + 3) >> 2; + reply.length = bytes_to_int32(length); if (stuff->delete && (reply.bytesAfter == 0)) send_property_event(dev, stuff->property, XIPropertyDeleted); @@ -1146,7 +1146,7 @@ ProcXIChangeProperty(ClientPtr client) rc = check_change_property(client, stuff->property, stuff->type, stuff->format, stuff->mode, stuff->num_items); len = stuff->num_items; - if (len > ((0xffffffff - sizeof(xXIChangePropertyReq)) >> 2)) + if (len > bytes_to_int32(0xffffffff - sizeof(xXIChangePropertyReq))) return BadLength; totalSize = len * (stuff->format/8); @@ -1215,7 +1215,7 @@ ProcXIGetProperty(ClientPtr client) reply.format = format; reply.bytes_after = bytes_after; reply.type = type; - reply.length = (length + 3)/4; + reply.length = bytes_to_int32(length); if (length && stuff->delete && (reply.bytes_after == 0)) send_property_event(dev, stuff->property, XIPropertyDeleted); |