diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-11-13 12:25:21 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-11-13 12:32:15 +0300 |
commit | a8f9a2493915bf9384553b3933593a5296e70a1c (patch) | |
tree | b92994b73297c1f9bb439c1d38dae373985065b7 /source/blender/imbuf/intern/util.c | |
parent | 4a3b26dd5e7fc0fb0d95271859ee7b780add2a88 (diff) |
Cleanup: use IMB_FTYPE_NONE instead of 0 for imbuf format comparison
Image format code checked the file type against an enum except for
zero which is used when the format can't be detected.
Also add doc-strings to some of the image file type callbacks.
Diffstat (limited to 'source/blender/imbuf/intern/util.c')
-rw-r--r-- | source/blender/imbuf/intern/util.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/imbuf/intern/util.c b/source/blender/imbuf/intern/util.c index c18321ae2fe..64dad5de902 100644 --- a/source/blender/imbuf/intern/util.c +++ b/source/blender/imbuf/intern/util.c @@ -159,7 +159,7 @@ int IMB_ispic_type_from_memory(const unsigned char *buf, const size_t buf_size) } } - return 0; + return IMB_FTYPE_NONE; } int IMB_ispic_type(const char *filepath) @@ -167,7 +167,7 @@ int IMB_ispic_type(const char *filepath) unsigned char buf[HEADER_SIZE]; const ssize_t buf_size = imb_ispic_read_header_from_filepath(filepath, buf); if (buf_size <= 0) { - return 0; + return IMB_FTYPE_NONE; } return IMB_ispic_type_from_memory(buf, (size_t)buf_size); } @@ -196,7 +196,7 @@ bool IMB_ispic_type_matches(const char *filepath, int filetype) bool IMB_ispic(const char *filepath) { - return (IMB_ispic_type(filepath) != 0); + return (IMB_ispic_type(filepath) != IMB_FTYPE_NONE); } static bool isavi(const char *filepath) |