瀏覽代碼

misc/offset.h: in UPPER_OBJECT, cast to char * not to uint8_t *

ambrop7 13 年之前
父節點
當前提交
907aba2046
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      misc/offset.h

+ 1 - 1
misc/offset.h

@@ -40,7 +40,7 @@
 /**
  * Returns a pointer to a struct, given a pointer to its member.
  */
-#define UPPER_OBJECT(_ptr, _object_type, _field_name) ((_object_type *)((uint8_t *)(_ptr) - offsetof(_object_type, _field_name)))
+#define UPPER_OBJECT(_ptr, _object_type, _field_name) ((_object_type *)((char *)(_ptr) - offsetof(_object_type, _field_name)))
 
 /**
  * Returns the offset of one struct member from another.