stb_image_write: add missing 'static' on internal functions
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Sean Barrett · committed by Sean Barrett · parent ddccc72 · Browse files · 1 file·+6 added−6 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
1 file+6 added−6 removed
- other:+6 added−6 removed
Provenance
- Commit
feb9de3- Tree
f7d9fb9- Author
Sean Barrett <sean@nothings.org>- Committer
Sean Barrett <sean@nothings.org>- Parent
ddccc72
1 file changed+6 added−6 removed
modified:stb_image_write.h+6 added-6 removed
600 unmodified lines601 // by Baldur Karlsson602 603 #define stbiw__max(a, b) ((a) > (b) ? (a) : (b))604 605-void stbiw__linear_to_rgbe(unsigned char *rgbe, float *linear)605+static void stbiw__linear_to_rgbe(unsigned char *rgbe, float *linear)606 {607 int exponent;608 float maxcomp = stbiw__max(linear[0], stbiw__max(linear[1], linear[2]));609 8 unmodified lines618 rgbe[3] = (unsigned char)(exponent + 128);619 }620 }621 622-void stbiw__write_run_data(stbi__write_context *s, int length, unsigned char databyte)622+static void stbiw__write_run_data(stbi__write_context *s, int length, unsigned char databyte)623 {624 unsigned char lengthbyte = STBIW_UCHAR(length+128);625 STBIW_ASSERT(length+128 <= 255);626 s->func(s->context, &lengthbyte, 1);627 s->func(s->context, &databyte, 1);628 }629 630-void stbiw__write_dump_data(stbi__write_context *s, int length, unsigned char *data)630+static void stbiw__write_dump_data(stbi__write_context *s, int length, unsigned char *data)631 {632 unsigned char lengthbyte = STBIW_UCHAR(length);633 STBIW_ASSERT(length <= 128); // inconsistent with spec but consistent with official code634 s->func(s->context, &lengthbyte, 1);635 s->func(s->context, data, length);636 }637 638-void stbiw__write_hdr_scanline(stbi__write_context *s, int width, int ncomp, unsigned char *scratch, float *scanline)638+static void stbiw__write_hdr_scanline(stbi__write_context *s, int width, int ncomp, unsigned char *scratch, float *scanline)639 {640 unsigned char scanlineheader[4] = { 2, 2, 0, 0 };641 unsigned char rgbe[4];642 float linear[3];215 unmodified lines858 #define stbiw__ZHASH 16384859 860 #endif // STBIW_ZLIB_COMPRESS861 862-unsigned char * stbi_zlib_compress(unsigned char *data, int data_len, int *out_len, int quality)862+STBIWDEF unsigned char * stbi_zlib_compress(unsigned char *data, int data_len, int *out_len, int quality)863 {864 #ifdef STBIW_ZLIB_COMPRESS865 // user provided a zlib compress implementation, use that866 return STBIW_ZLIB_COMPRESS(data, data_len, out_len, quality);207 unmodified lines1074 case 6: for (i=n; i < width*n; ++i) line_buffer[i] = z[i] - stbiw__paeth(z[i-n], 0,0); break;1075 }1076 }1077 1078-unsigned char *stbi_write_png_to_mem(const unsigned char *pixels, int stride_bytes, int x, int y, int n, int *out_len)1078+STBIWDEF unsigned char *stbi_write_png_to_mem(const unsigned char *pixels, int stride_bytes, int x, int y, int n, int *out_len)1079 {1080 int force_filter = stbi_write_force_png_filter;1081 int ctype[5] = { -1, 0, 4, 2, 6 };1082 unsigned char sig[8] = { 137,80,78,71,13,10,26,10 };541 unmodified lines