From 58c51413f633c73914e24fb90b7ad484f58cb421 Mon Sep 17 00:00:00 2001 From: Jeroen van Rijn Date: Mon, 5 Dec 2016 17:08:10 +0100 Subject: [PATCH 1/4] Fix comments where rr* functions hadn't been renamed yet. --- stb_sprintf.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stb_sprintf.h b/stb_sprintf.h index 4e3b3c0..458e9e5 100644 --- a/stb_sprintf.h +++ b/stb_sprintf.h @@ -43,12 +43,12 @@ API: ==== int stbsp_sprintf( char * buf, char const * fmt, ... ) int stbsp_snprintf( char * buf, int count, char const * fmt, ... ) - Convert an arg list into a buffer. rrsnprintf always returns + Convert an arg list into a buffer. stbsp_snprintf always returns a zero-terminated string (unlike regular snprintf). int stbsp_vsprintf( char * buf, char const * fmt, va_list va ) int stbsp_vsnprintf( char * buf, int count, char const * fmt, va_list va ) - Convert a va_list arg list into a buffer. rrvsnprintf always returns + Convert a va_list arg list into a buffer. stbsp_vsnprintf always returns a zero-terminated string (unlike regular snprintf). int stbsp_vsprintfcb( STBSP_SPRINTFCB * callback, void * user, char * buf, char const * fmt, va_list va ) @@ -182,7 +182,7 @@ STBSP__PUBLICDEF void STB_SPRINTF_DECORATE( set_separators )( char comma, char p #endif #endif -#ifdef STB_SPRINTF_NOUNALIGNED // define this before inclusion to force rrsprint to always use aligned accesses +#ifdef STB_SPRINTF_NOUNALIGNED // define this before inclusion to force stbsp_sprint to always use aligned accesses #define STBSP__UNALIGNED(code) #else #define STBSP__UNALIGNED(code) code From 791a907faafddb0838212c446ae37d8cf22c4fd4 Mon Sep 17 00:00:00 2001 From: Dima Krasner Date: Tue, 13 Aug 2019 13:09:56 +0300 Subject: [PATCH 2/4] stb_leakcheck: add support for output to stderr --- stb_leakcheck.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/stb_leakcheck.h b/stb_leakcheck.h index 8874ce5..1f2aa73 100644 --- a/stb_leakcheck.h +++ b/stb_leakcheck.h @@ -13,6 +13,10 @@ #undef realloc #endif +#ifndef STB_LEAKCHECK_OUTPUT_PIPE +#define STB_LEAKCHECK_OUTPUT_PIPE stdout +#endif + #include #include #include @@ -97,16 +101,16 @@ static void stblkck_internal_print(const char *reason, stb_leakcheck_malloc_info // without "long long" don't support 64-bit targets either, so here's the // compromise: #if _MSC_VER < 1400 // before VS 2005 - printf("%s: %s (%4d): %8d bytes at %p\n", reason, mi->file, mi->line, (int)mi->size, (void*)(mi+1)); + fprintf(STB_LEAKCHECK_OUTPUT_PIPE, "%s: %s (%4d): %8d bytes at %p\n", reason, mi->file, mi->line, (int)mi->size, (void*)(mi+1)); #else - printf("%s: %s (%4d): %16lld bytes at %p\n", reason, mi->file, mi->line, (long long)mi->size, (void*)(mi+1)); + fprintf(STB_LEAKCHECK_OUTPUT_PIPE, "%s: %s (%4d): %16lld bytes at %p\n", reason, mi->file, mi->line, (long long)mi->size, (void*)(mi+1)); #endif #else // Assume we have %zd on other targets. #ifdef __MINGW32__ - __mingw_printf("%s: %s (%4d): %zd bytes at %p\n", reason, mi->file, mi->line, mi->size, (void*)(mi+1)); + __mingw_fprintf(STB_LEAKCHECK_OUTPUT_PIPE, "%s: %s (%4d): %zd bytes at %p\n", reason, mi->file, mi->line, mi->size, (void*)(mi+1)); #else - printf("%s: %s (%4d): %zd bytes at %p\n", reason, mi->file, mi->line, mi->size, (void*)(mi+1)); + fprintf(STB_LEAKCHECK_OUTPUT_PIPE, "%s: %s (%4d): %zd bytes at %p\n", reason, mi->file, mi->line, mi->size, (void*)(mi+1)); #endif #endif } From 01b2d76baf23fbb251bb8dad784abbebcf734410 Mon Sep 17 00:00:00 2001 From: BlackMATov Date: Thu, 22 Aug 2019 10:25:09 +0700 Subject: [PATCH 3/4] stb_image.h: fix warning about unused function 'stbi__err' Fixes issue #746. --- stb_image.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/stb_image.h b/stb_image.h index 196dfd5..b28e5a0 100644 --- a/stb_image.h +++ b/stb_image.h @@ -106,6 +106,7 @@ RECENT REVISION HISTORY: Julian Raschke Gregory Mullen Baldur Karlsson github:poppolopoppo Christian Floisand Kevin Schmidt JR Smith github:darealshinji Blazej Dariusz Roszkowski github:Michaelangel007 + Matvey Cherevko */ #ifndef STBI_INCLUDE_STB_IMAGE_H @@ -881,11 +882,13 @@ STBIDEF const char *stbi_failure_reason(void) return stbi__g_failure_reason; } +#ifndef STBI_NO_FAILURE_STRINGS static int stbi__err(const char *str) { stbi__g_failure_reason = str; return 0; } +#endif static void *stbi__malloc(size_t size) { From da1294295760ce04ce261cbdd3ee889be45373f7 Mon Sep 17 00:00:00 2001 From: Niclas Olmenius Date: Thu, 3 Oct 2019 12:50:23 +0200 Subject: [PATCH 4/4] stb_image_write: fix clang warning fix -Wmissing-variable-declarations clang warning `stbi__flip_vertically_on_write` is now static like `stbi__vertically_flip_on_load` in `stb_image.h` --- stb_image_write.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stb_image_write.h b/stb_image_write.h index a9bf66c..3316feb 100644 --- a/stb_image_write.h +++ b/stb_image_write.h @@ -247,17 +247,17 @@ STBIWDEF void stbi_flip_vertically_on_write(int flip_boolean); #define STBIW_UCHAR(x) (unsigned char) ((x) & 0xff) #ifdef STB_IMAGE_WRITE_STATIC -static int stbi__flip_vertically_on_write=0; static int stbi_write_png_compression_level = 8; static int stbi_write_tga_with_rle = 1; static int stbi_write_force_png_filter = -1; #else int stbi_write_png_compression_level = 8; -int stbi__flip_vertically_on_write=0; int stbi_write_tga_with_rle = 1; int stbi_write_force_png_filter = -1; #endif +static int stbi__flip_vertically_on_write = 0; + STBIWDEF void stbi_flip_vertically_on_write(int flag) { stbi__flip_vertically_on_write = flag;