Skip to content

Commit

Permalink
Use G_STRUCT_OFFSET macro
Browse files Browse the repository at this point in the history
  • Loading branch information
monich committed Aug 4, 2014
1 parent bc2a532 commit 9297a5a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions mms-lib/include/mms_lib_types.h
Expand Up @@ -75,9 +75,8 @@ typedef enum mms_read_status {
} MMSReadStatus;

/* Convenience macros */
#define MMS_CAST(address,type,field) ((type *)( \
(char*)(address) - \
(char*)(&((type *)0)->field)))
#define MMS_CAST(address,type,field) \
((type *)((guint8*)(address) - G_STRUCT_OFFSET(type,field)))

#endif /* JOLLA_MMS_LIB_TYPES_H */

Expand Down

0 comments on commit 9297a5a

Please sign in to comment.