diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-08-28 12:19:58 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-08-28 12:21:55 +0300 |
commit | 2e71927622ec7e25c400f23b58fd8d14e056482d (patch) | |
tree | 0d14bb1f9811849f4f00407e63c70d0d71571a73 /source/blender/makesdna/DNA_ID.h | |
parent | f4b36786462e52bc914a1cdc182b7e25da081dd0 (diff) |
Make GS macro return proper IDType type
Previously it was returning short, which was really easy to (a) compare against
non-ID type value (b) forget to handle some specific value in switch statement.
Both issues happened in the nearest past, so it's time to tighten some nuts
here.
Most of the change related on silencing strict compiler warning now, but there
is also one tricky aspect: ID_NLA is not in the IDType enum. So there is still
cast to short to handle that switch. If someone has better ideas how to deal
with this please go ahead :)
Diffstat (limited to 'source/blender/makesdna/DNA_ID.h')
-rw-r--r-- | source/blender/makesdna/DNA_ID.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h index a940e4bf65d..b2a3cb4f9bc 100644 --- a/source/blender/makesdna/DNA_ID.h +++ b/source/blender/makesdna/DNA_ID.h @@ -287,7 +287,7 @@ typedef enum ID_Type { #ifdef GS # undef GS #endif -#define GS(a) (CHECK_TYPE_ANY(a, char *, const char *, char [66], const char[66]), (*((const short *)(a)))) +#define GS(a) (CHECK_TYPE_ANY(a, char *, const char *, char [66], const char[66]), (ID_Type)(*((const short *)(a)))) #define ID_NEW_SET(_id, _idn) \ (((ID *)(_id))->newid = (ID *)(_idn), ((ID *)(_id))->newid->tag |= LIB_TAG_NEW, (void *)((ID *)(_id))->newid) |