diff options
author | tradke <tradke@1faa4e14-9dd3-4be0-9f0e-ffe519881164> | 2001-09-07 20:43:32 +0000 |
---|---|---|
committer | tradke <tradke@1faa4e14-9dd3-4be0-9f0e-ffe519881164> | 2001-09-07 20:43:32 +0000 |
commit | 2a821ca1ce7450829a290715ec943da92653d279 (patch) | |
tree | 080b3a9e1708d016eccd677368b92704960d94b5 /src/images | |
parent | 9d16a4d11ced1a08cf3f763beefd73b9d0f04405 (diff) |
Declare image array as 'unsigned char []'. Prevents hundreds of warnings
from the Fujitsu compiler.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusConnect/HTTPD/trunk@132 1faa4e14-9dd3-4be0-9f0e-ffe519881164
Diffstat (limited to 'src/images')
-rw-r--r-- | src/images/ImageEncoder.c | 37 | ||||
-rw-r--r-- | src/images/www.h | 4 | ||||
-rw-r--r-- | src/images/wwwcactuscodeorg.h | 4 |
3 files changed, 22 insertions, 23 deletions
diff --git a/src/images/ImageEncoder.c b/src/images/ImageEncoder.c index 946ef7a..0ea874b 100644 --- a/src/images/ImageEncoder.c +++ b/src/images/ImageEncoder.c @@ -1,21 +1,21 @@ /*********************************************************** ImageEncoder: Standalone program to convert any image into - a static character array (each byte represented in - hexadecimal) in a header file. Use this for any - images that you want to embed in the code so - that it can run standalone (ie. when you are - disconnected from the network). Currently used - to spew out the wwwcactuscodeorg.jpg image used - in thorn_HTTPD through the WebImage.cc extension - to the HTTPD. + a static character array (each byte represented in + hexadecimal) in a header file. Use this for any + images that you want to embed in the code so + that it can run standalone (ie. when you are + disconnected from the network). Currently used + to spew out the wwwcactuscodeorg.jpg image used + in thorn_HTTPD through the WebImage.cc extension + to the HTTPD. Compilation: - $(CC) -o ImageEncoder ImageEncoder.c + $(CC) -o ImageEncoder ImageEncoder.c Running: - ImageEncoder <inputimage> <outputheader> - This will take the input binary file and create a - header file (something.h) which has the image - encoded as a static character array with the - same name as the input image file (minus the extension. + ImageEncoder <inputimage> <outputheader> + This will take the input binary file and create a + header file (something.h) which has the image + encoded as a static character array with the + same name as the input image file (minus the extension. **************************************************************/ @@ -26,7 +26,7 @@ Running: int main(int argc,char *argv[]){ char *s; char *varname=0; - int c,counter=3; + int c,counter=0; FILE *in,*out; if(argc<2) { fprintf(stderr,"Usage: %s <inputimage> <outputheader>\n",argv[0]); @@ -55,9 +55,9 @@ int main(int argc,char *argv[]){ /* Now actually start writing stuff */ fprintf(out,"#ifndef __%s_H_\n#define __%s_H_\n", - varname,varname); + varname,varname); fprintf(out,"\n\n"); - fprintf(out,"static char %s[]={",varname); + fprintf(out,"static unsigned char %s[]={\n",varname); /* inefficient, but it works */ c=fgetc(in); while(c!=EOF){ @@ -71,10 +71,9 @@ int main(int argc,char *argv[]){ if(!(counter%12)) fprintf(out,"\n\t"); } - fprintf(out,"\n\n#endif /* __%s_H_ */\n\n",varname); + fprintf(out,"\n\n#endif /* __%s_H_ */\n",varname); fclose(in); if(argc>2) fclose(out); if(varname) free(varname); } - diff --git a/src/images/www.h b/src/images/www.h index 262f2d2..a8a3043 100644 --- a/src/images/www.h +++ b/src/images/www.h @@ -2,7 +2,8 @@ #define __www_H_ -static char www[]={0x47,0x49,0x46,0x38,0x37,0x61,0xA1,0x00,0x20, +static unsigned char www[]={ + 0x47,0x49,0x46,0x38,0x37,0x61,0xA1,0x00,0x20, 0x00,0xF7,0x00,0x00,0x0C,0x22,0x04,0x7C,0x93,0x29,0xAC,0xCA, 0x57,0xBC,0xCA,0xB4,0x96,0xB1,0x47,0xCC,0xE7,0x71,0xDC,0xE7, 0xB2,0x9C,0xAE,0x84,0x44,0x5A,0x0C,0x5F,0x79,0x19,0xB4,0xCB, @@ -304,4 +305,3 @@ static char www[]={0x47,0x49,0x46,0x38,0x37,0x61,0xA1,0x00,0x20, 0x90,0x25,0xB9,0x92,0x26,0x11,0x10,0x00,0x3B}; #endif /*__www_H_ */ - diff --git a/src/images/wwwcactuscodeorg.h b/src/images/wwwcactuscodeorg.h index d6db8a7..02ebc14 100644 --- a/src/images/wwwcactuscodeorg.h +++ b/src/images/wwwcactuscodeorg.h @@ -2,7 +2,8 @@ #define __wwwcactuscodeorg_H_ -static char wwwcactuscodeorg[]={0xFF,0xD8,0xFF,0xE0,0x00,0x10,0x4A,0x46,0x49, +static unsigned char wwwcactuscodeorg[]={ + 0xFF,0xD8,0xFF,0xE0,0x00,0x10,0x4A,0x46,0x49, 0x46,0x00,0x01,0x01,0x00,0x00,0x01,0x00,0x01,0x00,0x00,0xFF, 0xFE,0x00,0x4F,0x43,0x52,0x45,0x41,0x54,0x4F,0x52,0x3A,0x20, 0x58,0x56,0x20,0x56,0x65,0x72,0x73,0x69,0x6F,0x6E,0x20,0x33, @@ -750,4 +751,3 @@ static char wwwcactuscodeorg[]={0xFF,0xD8,0xFF,0xE0,0x00,0x10,0x4A,0x46,0x49, 0x28,0xA2,0x80,0x3F,0xFF,0xD9}; #endif /* __wwwcactuscodeorg_H_ */ - |