diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-11-17 11:07:10 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-11-17 11:26:08 -0800 |
commit | ba46dd91f2b2248e459911b38acd49a776c748f2 (patch) | |
tree | a2067cd7eb76a21290db00f0365000882e488f1e /src | |
parent | 90bb47685ed92df1eb5bbb9b6875a40f3e98bb43 (diff) |
Handle -Wconversion warnings from clang
Xdamage.c:81:30: warning: implicit conversion loses integer precision: 'int' to 'CARD8' (aka 'unsigned char') [-Wconversion]
req->reqType = info->codes->major_opcode;
~ ~~~~~~~~~~~~~^~~~~~~~~~~~
Xdamage.c:264:29: warning: implicit conversion loses integer precision: 'int' to 'CARD8' (aka 'unsigned char') [-Wconversion]
awire->type = aevent->type | (aevent->send_event ? 0x80 : 0);
~ ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Xdamage.c:267:31: warning: implicit conversion loses integer precision: 'int' to 'CARD8' (aka 'unsigned char') [-Wconversion]
awire->level = aevent->level | (aevent->more ? DamageNotifyMore : 0);
~ ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Xdamage.c:324:33: warning: implicit conversion loses integer precision: 'int' to 'CARD8' (aka 'unsigned char') [-Wconversion]
req->reqType = info->codes->major_opcode;
~ ~~~~~~~~~~~~~^~~~~~~~~~~~
Xdamage.c:328:18: warning: implicit conversion loses integer precision: 'int' to 'CARD8' (aka 'unsigned char') [-Wconversion]
req->level = level;
~ ^~~~~
Xdamage.c:343:33: warning: implicit conversion loses integer precision: 'int' to 'CARD8' (aka 'unsigned char') [-Wconversion]
req->reqType = info->codes->major_opcode;
~ ~~~~~~~~~~~~~^~~~~~~~~~~~
Xdamage.c:360:33: warning: implicit conversion loses integer precision: 'int' to 'CARD8' (aka 'unsigned char') [-Wconversion]
req->reqType = info->codes->major_opcode;
~ ~~~~~~~~~~~~~^~~~~~~~~~~~
Xdamage.c:378:33: warning: implicit conversion loses integer precision: 'int' to 'CARD8' (aka 'unsigned char') [-Wconversion]
req->reqType = info->codes->major_opcode;
~ ~~~~~~~~~~~~~^~~~~~~~~~~~
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/Xdamage.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/Xdamage.c b/src/Xdamage.c index 55b1824..bcb8eb9 100644 --- a/src/Xdamage.c +++ b/src/Xdamage.c @@ -78,7 +78,7 @@ XDamageExtAddDisplay (XDamageExtInfo *extinfo, */ LockDisplay (dpy); GetReq (DamageQueryVersion, req); - req->reqType = info->codes->major_opcode; + req->reqType = (CARD8) info->codes->major_opcode; req->damageReqType = X_DamageQueryVersion; req->majorVersion = DAMAGE_MAJOR; req->minorVersion = DAMAGE_MINOR; @@ -261,10 +261,10 @@ XDamageEventToWire(Display *dpy, XEvent *event, xEvent *wire) xDamageNotifyEvent *awire; awire = (xDamageNotifyEvent *) wire; aevent = (XDamageNotifyEvent *) event; - awire->type = aevent->type | (aevent->send_event ? 0x80 : 0); + awire->type = (CARD8) aevent->type | (aevent->send_event ? 0x80 : 0); awire->drawable = aevent->drawable; awire->damage = aevent->damage; - awire->level = aevent->level | (aevent->more ? DamageNotifyMore : 0); + awire->level = (CARD8) aevent->level | (aevent->more ? DamageNotifyMore : 0); awire->timestamp = aevent->timestamp; awire->area.x = aevent->area.x; awire->area.y = aevent->area.y; @@ -321,11 +321,11 @@ XDamageCreate (Display *dpy, Drawable drawable, int level) XDamageCheckExtension (dpy, info, 0); LockDisplay (dpy); GetReq (DamageCreate, req); - req->reqType = info->codes->major_opcode; + req->reqType = (CARD8) info->codes->major_opcode; req->damageReqType = X_DamageCreate; req->damage = damage = XAllocID (dpy); req->drawable = drawable; - req->level = level; + req->level = (CARD8) level; UnlockDisplay (dpy); SyncHandle (); return damage; @@ -340,7 +340,7 @@ XDamageDestroy (Display *dpy, Damage damage) XDamageSimpleCheckExtension (dpy, info); LockDisplay (dpy); GetReq (DamageDestroy, req); - req->reqType = info->codes->major_opcode; + req->reqType = (CARD8) info->codes->major_opcode; req->damageReqType = X_DamageDestroy; req->damage = damage; UnlockDisplay (dpy); @@ -357,7 +357,7 @@ XDamageSubtract (Display *dpy, Damage damage, XDamageSimpleCheckExtension (dpy, info); LockDisplay (dpy); GetReq (DamageSubtract, req); - req->reqType = info->codes->major_opcode; + req->reqType = (CARD8) info->codes->major_opcode; req->damageReqType = X_DamageSubtract; req->damage = damage; req->repair = repair; @@ -375,7 +375,7 @@ XDamageAdd (Display *dpy, Drawable drawable, XserverRegion region) XDamageSimpleCheckExtension (dpy, info); LockDisplay (dpy); GetReq (DamageAdd, req); - req->reqType = info->codes->major_opcode; + req->reqType = (CARD8) info->codes->major_opcode; req->damageReqType = X_DamageAdd; req->drawable = drawable; req->region = region; |