diff options
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/fcurve.c | 2 | ||||
-rw-r--r-- | source/blender/blenlib/intern/listbase.c | 19 | ||||
-rw-r--r-- | source/blender/imbuf/intern/jpeg.c | 6 |
3 files changed, 24 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c index c86ee11985a..8d3d503a33c 100644 --- a/source/blender/blenkernel/intern/fcurve.c +++ b/source/blender/blenkernel/intern/fcurve.c @@ -1248,7 +1248,7 @@ static float dvar_eval_locDiff(ChannelDriver *driver, DriverVar *dvar) float tmp_loc[3]; /* after the checks above, the targets should be valid here... */ - BLI_assert((ob != NULL) && (GS(ob->id.name) != ID_OB)); + BLI_assert((ob != NULL) && (GS(ob->id.name) == ID_OB)); /* try to get posechannel */ pchan = BKE_pose_channel_find_name(ob->pose, dtar->pchan_name); diff --git a/source/blender/blenlib/intern/listbase.c b/source/blender/blenlib/intern/listbase.c index f5f67ba3645..c5b10de3ff2 100644 --- a/source/blender/blenlib/intern/listbase.c +++ b/source/blender/blenlib/intern/listbase.c @@ -71,6 +71,7 @@ void BLI_addhead(ListBase *listbase, void *vlink) Link *link = vlink; if (link == NULL) return; + BLI_assert(listbase != NULL); if (listbase == NULL) return; link->next = listbase->first; @@ -90,6 +91,7 @@ void BLI_addtail(ListBase *listbase, void *vlink) Link *link = vlink; if (link == NULL) return; + BLI_assert(listbase != NULL); if (listbase == NULL) return; link->next = NULL; @@ -109,6 +111,7 @@ void BLI_remlink(ListBase *listbase, void *vlink) Link *link = vlink; if (link == NULL) return; + BLI_assert(listbase != NULL); if (listbase == NULL) return; if (link->next) link->next->prev = link->prev; @@ -141,6 +144,7 @@ void BLI_freelinkN(ListBase *listbase, void *vlink) Link *link = vlink; if (link == NULL) return; + BLI_assert(listbase != NULL); if (listbase == NULL) return; BLI_remlink(listbase, link); @@ -160,6 +164,7 @@ void BLI_sortlist(ListBase *listbase, int (*cmp)(void *, void *)) Link *next = NULL; if (cmp == NULL) return; + BLI_assert(listbase != NULL); if (listbase == NULL) return; if (listbase->first != listbase->last) { @@ -189,6 +194,7 @@ void BLI_insertlinkafter(ListBase *listbase, void *vprevlink, void *vnewlink) /* newlink before nextlink */ if (newlink == NULL) return; + BLI_assert(listbase != NULL); if (listbase == NULL) return; /* empty list */ @@ -231,6 +237,7 @@ void BLI_insertlinkbefore(ListBase *listbase, void *vnextlink, void *vnewlink) /* newlink before nextlink */ if (newlink == NULL) return; + BLI_assert(listbase != NULL); if (listbase == NULL) return; /* empty list */ @@ -270,6 +277,7 @@ void BLI_freelist(ListBase *listbase) { Link *link, *next; + BLI_assert(listbase != NULL); if (listbase == NULL) return; @@ -291,6 +299,7 @@ void BLI_freelistN(ListBase *listbase) { Link *link, *next; + BLI_assert(listbase != NULL); if (listbase == NULL) return; link = listbase->first; @@ -367,6 +376,7 @@ int BLI_findindex(const ListBase *listbase, const void *vlink) Link *link = NULL; int number = 0; + BLI_assert(listbase != NULL); if (listbase == NULL) return -1; if (vlink == NULL) return -1; @@ -391,6 +401,7 @@ void *BLI_findstring(const ListBase *listbase, const char *id, const int offset) Link *link = NULL; const char *id_iter; + BLI_assert(listbase != NULL); if (listbase == NULL) return NULL; for (link = listbase->first; link; link = link->next) { @@ -413,6 +424,7 @@ void *BLI_rfindstring(const ListBase *listbase, const char *id, const int offset Link *link = NULL; const char *id_iter; + BLI_assert(listbase != NULL); if (listbase == NULL) return NULL; for (link = listbase->last; link; link = link->prev) { @@ -435,6 +447,7 @@ void *BLI_findstring_ptr(const ListBase *listbase, const char *id, const int off Link *link = NULL; const char *id_iter; + BLI_assert(listbase != NULL); if (listbase == NULL) return NULL; for (link = listbase->first; link; link = link->next) { @@ -458,6 +471,7 @@ void *BLI_rfindstring_ptr(const ListBase *listbase, const char *id, const int of Link *link = NULL; const char *id_iter; + BLI_assert(listbase != NULL); if (listbase == NULL) return NULL; for (link = listbase->last; link; link = link->prev) { @@ -481,6 +495,7 @@ void *BLI_findptr(const ListBase *listbase, const void *ptr, const int offset) Link *link = NULL; const void *ptr_iter; + BLI_assert(listbase != NULL); if (listbase == NULL) return NULL; for (link = listbase->first; link; link = link->next) { @@ -504,6 +519,7 @@ void *BLI_rfindptr(const ListBase *listbase, const void *ptr, const int offset) Link *link = NULL; const void *ptr_iter; + BLI_assert(listbase != NULL); if (listbase == NULL) return NULL; for (link = listbase->last; link; link = link->prev) { @@ -528,6 +544,7 @@ int BLI_findstringindex(const ListBase *listbase, const char *id, const int offs const char *id_iter; int i = 0; + BLI_assert(listbase != NULL); if (listbase == NULL) return -1; link = listbase->first; @@ -607,7 +624,7 @@ LinkData *BLI_genericNodeN(void *data) return NULL; /* create new link, and make it hold the given data */ - ld = MEM_callocN(sizeof(LinkData), "BLI_genericNodeN()"); + ld = MEM_callocN(sizeof(LinkData), __func__); ld->data = data; return ld; diff --git a/source/blender/imbuf/intern/jpeg.c b/source/blender/imbuf/intern/jpeg.c index 1ace364482f..9bb625a64b0 100644 --- a/source/blender/imbuf/intern/jpeg.c +++ b/source/blender/imbuf/intern/jpeg.c @@ -59,7 +59,11 @@ #define IS_maxjpg(x) ((x->ftype & JPG_MSK) == JPG_MAX) /* the types are from the jpeg lib */ -static void jpeg_error(j_common_ptr cinfo); +static void jpeg_error(j_common_ptr cinfo) +#ifdef __GNUC__ +__attribute__((noreturn)); +#endif +; static void init_source(j_decompress_ptr cinfo); static boolean fill_input_buffer(j_decompress_ptr cinfo); static void skip_input_data(j_decompress_ptr cinfo, long num_bytes); |