diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-11-11 08:14:05 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-11-11 08:14:05 +0300 |
commit | e9c19b28202eb1fdc774d62f23896bf9fafb0fb8 (patch) | |
tree | 50b68aa926ced99419875359070069513521f621 /source/blender/imbuf | |
parent | 11bf3b7035fadedebd6a12214c2f38322ca294bb (diff) |
Cleanup: avoid boolean literals for functions that return int
Diffstat (limited to 'source/blender/imbuf')
-rw-r--r-- | source/blender/imbuf/intern/util.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/source/blender/imbuf/intern/util.c b/source/blender/imbuf/intern/util.c index 37a1afb5dd7..ae904c5d133 100644 --- a/source/blender/imbuf/intern/util.c +++ b/source/blender/imbuf/intern/util.c @@ -167,7 +167,7 @@ int IMB_ispic_type_from_memory(const unsigned char *mem, const size_t mem_size) } for (const ImFileType *type = IMB_FILE_TYPES; type < IMB_FILE_TYPES_LAST; type++) { - if (type->is_a) { + if (type->is_a != NULL) { if (type->is_a(buf)) { return type->filetype; } @@ -181,7 +181,7 @@ int IMB_ispic_type(const char *name) { unsigned char buf[HEADER_SIZE]; if (!imb_ispic_read_header_from_filename(name, buf)) { - return false; + return 0; } return IMB_ispic_type_from_memory(buf, HEADER_SIZE); } @@ -190,7 +190,7 @@ bool IMB_ispic_type_matches(const char *name, int filetype) { unsigned char buf[HEADER_SIZE]; if (!imb_ispic_read_header_from_filename(name, buf)) { - return false; + return 0; } for (const ImFileType *type = IMB_FILE_TYPES; type < IMB_FILE_TYPES_LAST; type++) { @@ -198,10 +198,12 @@ bool IMB_ispic_type_matches(const char *name, int filetype) /* Requesting to load a type that can't check it's own header doesn't make sense. * Keep the check for developers. */ BLI_assert(type->is_a != NULL); - return type->is_a ? type->is_a(buf) : false; + if (type->is_a != NULL) { + return type->is_a(buf); + } } } - return false; + return 0; } #undef HEADER_SIZE @@ -211,7 +213,7 @@ bool IMB_ispic(const char *name) return (IMB_ispic_type(name) != 0); } -static int isavi(const char *name) +static bool isavi(const char *name) { #ifdef WITH_AVI return AVI_is_avi(name); |