From f38ad4c66bee4fd28dbfe3fa4662fb6f8eb7d1c5 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 6 Nov 2020 15:56:03 +1100 Subject: Cleanup: replace STREQLEN with STRPREFIX for constant strings --- source/blender/imbuf/intern/jpeg.c | 4 ++-- source/blender/imbuf/intern/openexr/openexr_api.cpp | 2 +- source/blender/imbuf/intern/png.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'source/blender/imbuf') diff --git a/source/blender/imbuf/intern/jpeg.c b/source/blender/imbuf/intern/jpeg.c index 525284bd867..38f8806d910 100644 --- a/source/blender/imbuf/intern/jpeg.c +++ b/source/blender/imbuf/intern/jpeg.c @@ -246,7 +246,7 @@ static boolean handle_app1(j_decompress_ptr cinfo) INPUT_BYTE(cinfo, neogeo[i], return false); } length = 0; - if (STREQLEN(neogeo, "NeoGeo", 6)) { + if (STRPREFIX(neogeo, "NeoGeo")) { struct NeoGeo_Word *neogeo_word = (struct NeoGeo_Word *)(neogeo + 6); ibuf_quality = neogeo_word->quality; } @@ -362,7 +362,7 @@ static ImBuf *ibJpegImageFromCinfo(struct jpeg_decompress_struct *cinfo, int fla * That is why we need split it to the * common key/value here. */ - if (!STREQLEN(str, "Blender", 7)) { + if (!STRPREFIX(str, "Blender")) { /* * Maybe the file have text that * we don't know "what it's", in that diff --git a/source/blender/imbuf/intern/openexr/openexr_api.cpp b/source/blender/imbuf/intern/openexr/openexr_api.cpp index 7bb4176f4a6..08577f767e7 100644 --- a/source/blender/imbuf/intern/openexr/openexr_api.cpp +++ b/source/blender/imbuf/intern/openexr/openexr_api.cpp @@ -1210,7 +1210,7 @@ void IMB_exr_read_channels(void *handle) "BlenderMultiChannel"); /* 'previous multilayer attribute, flipped. */ - short flip = (ta && STREQLEN(ta->value().c_str(), "Blender V2.43", 13)); + short flip = (ta && STRPREFIX(ta->value().c_str(), "Blender V2.43")); exr_printf( "\nIMB_exr_read_channels\n%s %-6s %-22s " diff --git a/source/blender/imbuf/intern/png.c b/source/blender/imbuf/intern/png.c index dbae641f707..c4fbd3f7563 100644 --- a/source/blender/imbuf/intern/png.c +++ b/source/blender/imbuf/intern/png.c @@ -521,7 +521,7 @@ static void imb_png_warning(png_structp UNUSED(png_ptr), png_const_charp message * and with new libpng it became too much picky, giving a warning on * the splash screen even. */ - if ((G.debug & G_DEBUG) == 0 && STREQLEN(message, "iCCP", 4)) { + if ((G.debug & G_DEBUG) == 0 && STRPREFIX(message, "iCCP")) { return; } fprintf(stderr, "libpng warning: %s\n", message); -- cgit v1.2.3