commit 5eb5146

Michael Forney  ·  2014-01-31 20:22:29 +0000 UTC
parent e527984
Only use upper 8 bits for implementation in object types

While I'm breaking ABI, might as well do this as well.
4 files changed,  +12, -6
M drm.h
M wld.h
M drm.h
+5, -3
 1@@ -27,11 +27,13 @@
 2 #include <stdbool.h>
 3 #include <stdint.h>
 4 
 5+#define WLD_DRM_ID (0x02 << 24)
 6+
 7 enum wld_drm_object_type
 8 {
 9-    WLD_DRM_OBJECT_HANDLE   = 0x00010000,
10-    WLD_DRM_OBJECT_PRIME_FD = 0x00010001,
11-    WLD_DRM_OBJECT_GEM_NAME = 0x00010002
12+    WLD_DRM_OBJECT_HANDLE = WLD_DRM_ID,
13+    WLD_DRM_OBJECT_PRIME_FD,
14+    WLD_DRM_OBJECT_GEM_NAME
15 };
16 
17 enum wld_drm_flags
+3, -1
 1@@ -26,9 +26,11 @@
 2 
 3 #include <stdint.h>
 4 
 5+#define WLD_PIXMAN_ID (0x01 << 24)
 6+
 7 enum wld_pixman_object_type
 8 {
 9-    WLD_PIXMAN_OBJECT_IMAGE = 0x00030000
10+    WLD_PIXMAN_OBJECT_IMAGE = WLD_PIXMAN_ID
11 };
12 
13 extern struct wld_context * wld_pixman_context;
+3, -1
 1@@ -29,6 +29,8 @@
 2 struct wl_display;
 3 struct wl_surface;
 4 
 5+#define WLD_WAYLAND_ID (0x3 << 24)
 6+
 7 enum wld_wayland_interface_id
 8 {
 9     /**
10@@ -47,7 +49,7 @@ enum wld_wayland_interface_id
11 
12 enum wld_wayland_object_type
13 {
14-    WLD_WAYLAND_OBJECT_BUFFER   = 0x00020000
15+    WLD_WAYLAND_OBJECT_BUFFER = WLD_WAYLAND_ID
16 };
17 
18 /**
M wld.h
+1, -1
1@@ -56,7 +56,7 @@ bool wld_lookup_named_color(const char * name, uint32_t * color);
2 
3 enum wld_object_type
4 {
5-    WLD_OBJECT_DATA = 0x0
6+    WLD_OBJECT_DATA
7 };
8 
9 union wld_object