Sfoglia il codice sorgente

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

ambrop7 13 anni fa
parent
commit
907aba2046
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  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.