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/blenkernel | |
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/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/image.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/packedFile.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index 9010c846954..cd2ed32cd4f 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -1341,7 +1341,7 @@ int BKE_image_imtype_to_ftype(const char imtype, ImbFormatOptions *r_options) char BKE_image_ftype_to_imtype(const int ftype, const ImbFormatOptions *options) { - if (ftype == 0) { + if (ftype == IMB_FTYPE_NONE) { return R_IMF_IMTYPE_TARGA; } if (ftype == IMB_FTYPE_IMAGIC) { diff --git a/source/blender/blenkernel/intern/packedFile.c b/source/blender/blenkernel/intern/packedFile.c index e99dd77005b..87239d160b4 100644 --- a/source/blender/blenkernel/intern/packedFile.c +++ b/source/blender/blenkernel/intern/packedFile.c @@ -536,8 +536,8 @@ static void unpack_generate_paths(const char *name, ImagePackedFile *imapf = ((Image *)id)->packedfiles.last; if (imapf != NULL && imapf->packedfile != NULL) { const PackedFile *pf = imapf->packedfile; - const int ftype = IMB_ispic_type_from_memory((const uchar *)pf->data, pf->size); - if (ftype != 0) { + enum eImbFileType ftype = IMB_ispic_type_from_memory((const uchar *)pf->data, pf->size); + if (ftype != IMB_FTYPE_NONE) { const int imtype = BKE_image_ftype_to_imtype(ftype, NULL); BKE_image_path_ensure_ext_from_imtype(tempname, imtype); } |