diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-08-01 19:21:39 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-08-01 19:21:39 +0400 |
commit | 693c43cd95326da7ecb5ee82ed56c39272080d8e (patch) | |
tree | 1db83e257b9c1238f7a03b07e374a52b25bf82a0 /source/blender/blenloader | |
parent | 45801286a5c740ac03af7c9c7f59b59663ef9066 (diff) |
replace 'GET_INT_FROM_POINTER( &((BHeadN*)0)->bhead) )' with 'offsetof(BHeadN, bhead))'
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index dee882c6737..4ab0076d000 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -761,7 +761,7 @@ BHead *blo_firstbhead(FileData *fd) BHead *blo_prevbhead(FileData *UNUSED(fd), BHead *thisblock) { - BHeadN *bheadn = (BHeadN *) (((char *) thisblock) - GET_INT_FROM_POINTER( &((BHeadN*)0)->bhead) ); + BHeadN *bheadn = (BHeadN *) (((char *) thisblock) - offsetof(BHeadN, bhead)); BHeadN *prev = bheadn->prev; return (prev) ? &prev->bhead : NULL; @@ -773,11 +773,11 @@ BHead *blo_nextbhead(FileData *fd, BHead *thisblock) BHead *bhead = NULL; if (thisblock) { - // bhead is actually a sub part of BHeadN - // We calculate the BHeadN pointer from the BHead pointer below - new_bhead = (BHeadN *) (((char *) thisblock) - GET_INT_FROM_POINTER( &((BHeadN*)0)->bhead) ); + /* bhead is actually a sub part of BHeadN + * We calculate the BHeadN pointer from the BHead pointer below */ + new_bhead = (BHeadN *) (((char *) thisblock) - offsetof(BHeadN, bhead)); - // get the next BHeadN. If it doesn't exist we read in the next one + /* get the next BHeadN. If it doesn't exist we read in the next one */ new_bhead = new_bhead->next; if (new_bhead == NULL) { new_bhead = get_bhead(fd); @@ -785,8 +785,8 @@ BHead *blo_nextbhead(FileData *fd, BHead *thisblock) } if (new_bhead) { - // here we do the reverse: - // go from the BHeadN pointer to the BHead pointer + /* here we do the reverse: + * go from the BHeadN pointer to the BHead pointer */ bhead = &new_bhead->bhead; } |