소스 검색

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.