Skip to contentSkip to conversation

xf86drm: fix return type for drmIsMaster()

PATCH In review Eric Engestrom 3 participants 4 messages Feb 8, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xf86drm: fix return type for drmIsMaster()

Xserver has struct members named bool, which means the last commit breaks its build with errors like this:

error: two or more data types in declaration specifiers

  Bool bool;
       ^

Fix this by making it return a 0/1 integer, with the same semantic as the boolean it was before.

Fixes 17dfe3ac93217b43f93b "xf86drm: Add drmIsMaster()"
Cc Christopher James Halse Rogers <[email protected]>
Cc Emil Velikov <[email protected]>
---
 xf86drm.c | 2 +-
 xf86drm.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
xf86drm.c +1 -1
index 54695fcd5d1967574b00..05331c6d15bdd15b4be5 100644
@@ -2724,7 +2724,7 @@ drm_public int drmDropMaster(int fd)
         return drmIoctl(fd, DRM_IOCTL_DROP_MASTER, NULL);
 }
 
-drm_public bool drmIsMaster(int fd)
+drm_public int drmIsMaster(int fd)
 {
         /* Detect master by attempting something that requires master.
          *
xf86drm.h +1 -1
index b31ec9b5673a717bd6f3..9666a12c36bf28996157 100644
@@ -746,7 +746,7 @@ extern void drmMsg(const char *format, ...) DRM_PRINTFLIKE(1, 2);
 
 extern int drmSetMaster(int fd);
 extern int drmDropMaster(int fd);
-extern bool drmIsMaster(int fd);
+extern int drmIsMaster(int fd);
 
 #define DRM_EVENT_CONTEXT_VERSION 4
 
Signature · 7 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw

Hi Eric,

Quoted 9 lines · Eric Engestrom

Xserver has struct members named bool, which means the last commit breaks its build with errors like this:

error: two or more data types in declaration specifiers

  Bool bool;
       ^

Fix this by making it return a 0/1 integer, with the same semantic as the boolean it was before.

Don't you need to drop the stdbool.h include for this to fix compilation?

Cheers,
Daniel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Reviewed-by
#2 lore raw
Quoted 7 lines · Daniel Stone

Hi Eric,

Quoted 3 lines · Eric Engestrom

Xserver has struct members named bool, which means the last commit breaks its build with errors like this:

Quoted 9 lines
Quoted 6 lines

error: two or more data types in declaration specifiers

  Bool bool;
       ^

Fix this by making it return a 0/1 integer, with the same semantic as the boolean it was before.

Don't you need to drop the stdbool.h include for this to fix compilation?

Thanks Eric. With Dan's comment

I really wonder if we cannot fix these trivial X nuisances? As-is every project used has to either work around X mistakes :-( Wrt libdrm that is fine, yet other projects might be less happy.

Thanks
-Emil
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw
Quoted 8 lines · Emil Velikov
Quoted 7 lines · Daniel Stone

Hi Eric,

Quoted 3 lines · Eric Engestrom

Xserver has struct members named bool, which means the last commit breaks its build with errors like this:

Quoted 8 lines
Quoted 8 lines
Quoted 6 lines

error: two or more data types in declaration specifiers

  Bool bool;
       ^

Fix this by making it return a 0/1 integer, with the same semantic as the boolean it was before.

Don't you need to drop the stdbool.h include for this to fix compilation?

Ahem... /me looks for his brown paper bag :]

Quoted 7 lines
Quoted 1 line

Thanks Eric. With Dan's comment

I really wonder if we cannot fix these trivial X nuisances? As-is every project used has to either work around X mistakes :-( Wrt libdrm that is fine, yet other projects might be less happy.

Agreed :/

The issue is that you still won't be able to have bools in libdrm, because a new libdrm might be used with an old xserver...

Quoted 3 lines

Thanks
-Emil

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel