OSDN Git Service

add typedefs to gralloc and hardware.h so it's more C friendly
authorMathias Agopian <mathias@google.com>
Wed, 19 Aug 2009 18:20:55 +0000 (11:20 -0700)
committerMathias Agopian <mathias@google.com>
Wed, 19 Aug 2009 18:20:55 +0000 (11:20 -0700)
include/hardware/gralloc.h
include/hardware/hardware.h

index d88591f..cdf415a 100644 (file)
@@ -80,7 +80,7 @@ typedef const native_handle* buffer_handle_t;
  * and the fields of this data structure must begin with hw_module_t
  * followed by module specific information.
  */
-struct gralloc_module_t {
+typedef struct gralloc_module_t {
     struct hw_module_t common;
     
     
@@ -162,7 +162,7 @@ struct gralloc_module_t {
     int (*unlock)(struct gralloc_module_t const* module,
             buffer_handle_t handle);
 
-};
+} gralloc_module_t;
 
 /*****************************************************************************/
 
@@ -171,7 +171,7 @@ struct gralloc_module_t {
  * followed by module specific public methods and attributes.
  */
 
-struct alloc_device_t {
+typedef struct alloc_device_t {
     struct hw_device_t common;
 
     /* 
@@ -201,10 +201,10 @@ struct alloc_device_t {
     int (*free)(struct alloc_device_t* dev,
             buffer_handle_t handle);
 
-};
+} alloc_device_t;
 
 
-struct framebuffer_device_t {
+typedef struct framebuffer_device_t {
     struct hw_device_t common;
 
     /* flags describing some attributes of the framebuffer */
@@ -288,7 +288,8 @@ struct framebuffer_device_t {
     int (*post)(struct framebuffer_device_t* dev, buffer_handle_t buffer);
 
     void* reserved_proc[8];
-};
+
+} framebuffer_device_t;
 
 
 /** convenience API for opening and closing a supported device */
index 4d34852..ee5123d 100644 (file)
@@ -42,7 +42,7 @@ struct hw_device_t;
  * and the fields of this data structure must begin with hw_module_t
  * followed by module specific information.
  */
-struct hw_module_t {
+typedef struct hw_module_t {
     /** tag must be initialized to HARDWARE_MODULE_TAG */
     uint32_t tag;
 
@@ -69,19 +69,21 @@ struct hw_module_t {
 
     /** padding to 128 bytes, reserved for future use */
     uint32_t reserved[32-7];
-};
 
-struct hw_module_methods_t {
+} hw_module_t;
+
+typedef struct hw_module_methods_t {
     /** Open a specific device */
     int (*open)(const struct hw_module_t* module, const char* id,
             struct hw_device_t** device);
-};
+
+} hw_module_methods_t;
 
 /**
  * Every device data structure must begin with hw_device_t
  * followed by module specific public methods and attributes.
  */
-struct hw_device_t {
+typedef struct hw_device_t {
     /** tag must be initialized to HARDWARE_DEVICE_TAG */
     uint32_t tag;
 
@@ -96,7 +98,8 @@ struct hw_device_t {
 
     /** Close this device */
     int (*close)(struct hw_device_t* device);
-};
+
+} hw_device_t;
 
 /**
  * Name of the hal_module_info