r376 - trunk
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Sat Nov 24 01:18:58 EST 2007
Author: icculus
Date: 2007-11-24 01:18:58 -0500 (Sat, 24 Nov 2007)
New Revision: 376
Modified:
trunk/stb_image.c
Log:
Minor tweaks so you can build stb_image.c with any set of decoders enabled.
Modified: trunk/stb_image.c
===================================================================
--- trunk/stb_image.c 2007-11-24 06:07:07 UTC (rev 375)
+++ trunk/stb_image.c 2007-11-24 06:18:58 UTC (rev 376)
@@ -657,6 +657,11 @@
static uint32 img_x, img_y;
static int img_n, img_out_n;
+#if __MOJOSETUP__ // moved here from elsewhere for #ifdef safety.
+static uint8 *idata, *expanded, *out;
+static unsigned long code_buffer; // jpeg entropy-coded buffer
+#endif
+
enum
{
SCAN_load=0,
@@ -975,11 +980,13 @@
uint8 *data;
} img_comp[4];
+#if !__MOJOSETUP__ // moved elsewhere for #ifdef safety.
static unsigned long code_buffer; // jpeg entropy-coded buffer
+#endif
static int code_bits; // number of valid bits
static unsigned char marker; // marker seen while filling entropy buffer
static int nomore; // flag if we saw a marker so must stop
-
+
static void grow_buffer_unsafe(void)
{
do {
@@ -2260,7 +2267,9 @@
return 1;
}
+#if !__MOJOSETUP__ // moved elsewhere for #ifdef safety.
static uint8 *idata, *expanded, *out;
+#endif
enum {
F_none=0, F_sub=1, F_up=2, F_avg=3, F_paeth=4,
@@ -3496,9 +3505,14 @@
static char *hdr_gettoken(char *buffer)
{
int len=0;
+
+#if __MOJOSETUP__ // compiler complained about unused variable.
+ char c = get8();
+#else
char *s = buffer, c = '\0';
c = get8();
+#endif
while (!at_eof() && c != '\n') {
buffer[len++] = c;
@@ -3788,6 +3802,10 @@
(void) get32le;
(void) getn;
(void) convert_format;
+ (void) idata;
+ (void) expanded;
+ (void) out;
+ (void) code_buffer;
}
#endif
More information about the mojosetup-commits
mailing list