Kaynağa Gözat

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

ambrop7 13 yıl önce
ebeveyn
işleme
907aba2046
1 değiştirilmiş dosya ile 1 ekleme ve 1 silme
  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.