mirror of
				https://gitlab.freedesktop.org/wayland/wayland.git
				synced 2025-11-03 09:01:42 -05:00 
			
		
		
		
	Introduce enum wl_arg_type
This is less cryptic to read than letters, and allows the compiler to check switch statements exhaustiveness. Signed-off-by: Simon Ser <contact@emersion.fr>
This commit is contained in:
		
							parent
							
								
									47de87263c
								
							
						
					
					
						commit
						155dd63b58
					
				
					 4 changed files with 111 additions and 92 deletions
				
			
		| 
						 | 
				
			
			@ -48,6 +48,20 @@
 | 
			
		|||
#define WL_MAP_MAX_OBJECTS 0x00f00000
 | 
			
		||||
#define WL_CLOSURE_MAX_ARGS 20
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Argument types used in signatures.
 | 
			
		||||
 */
 | 
			
		||||
enum wl_arg_type {
 | 
			
		||||
	WL_ARG_INT = 'i',
 | 
			
		||||
	WL_ARG_UINT = 'u',
 | 
			
		||||
	WL_ARG_FIXED = 'f',
 | 
			
		||||
	WL_ARG_STRING = 's',
 | 
			
		||||
	WL_ARG_OBJECT = 'o',
 | 
			
		||||
	WL_ARG_NEW_ID = 'n',
 | 
			
		||||
	WL_ARG_ARRAY = 'a',
 | 
			
		||||
	WL_ARG_FD = 'h',
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct wl_object {
 | 
			
		||||
	const struct wl_interface *interface;
 | 
			
		||||
	const void *implementation;
 | 
			
		||||
| 
						 | 
				
			
			@ -149,7 +163,7 @@ struct wl_closure {
 | 
			
		|||
};
 | 
			
		||||
 | 
			
		||||
struct argument_details {
 | 
			
		||||
	char type;
 | 
			
		||||
	enum wl_arg_type type;
 | 
			
		||||
	int nullable;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue