fixed all the build errors
This commit is contained in:
		
							parent
							
								
									667ac01f92
								
							
						
					
					
						commit
						2768155f4e
					
				
							
								
								
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							@ -1,3 +1,4 @@
 | 
			
		||||
*~
 | 
			
		||||
*.o
 | 
			
		||||
src/upiwin
 | 
			
		||||
buildutils/mksplash
 | 
			
		||||
 | 
			
		||||
@ -1,7 +1,7 @@
 | 
			
		||||
ALL: mksplash
 | 
			
		||||
 | 
			
		||||
mksplash: mksplash.c
 | 
			
		||||
	gcc -o mksplash -O -Wall -I/usr/include/libpng mksplash.c -lpng12 -lz
 | 
			
		||||
	gcc -o mksplash -O -Wall -I/usr/include/libpng mksplash.c -lpng16 -lz
 | 
			
		||||
 | 
			
		||||
clean:
 | 
			
		||||
	rm -f *.o mksplash
 | 
			
		||||
 | 
			
		||||
@ -7,6 +7,10 @@
 | 
			
		||||
#include <sys/stat.h>
 | 
			
		||||
#include <png.h>
 | 
			
		||||
 | 
			
		||||
typedef unsigned char uch;
 | 
			
		||||
typedef unsigned short ush;
 | 
			
		||||
typedef unsigned long ulg;
 | 
			
		||||
 | 
			
		||||
#ifndef png_jmpbuf
 | 
			
		||||
#define png_jmpbuf(png_ptr)   ((png_ptr)->jmpbuf)
 | 
			
		||||
#endif
 | 
			
		||||
@ -152,7 +156,7 @@ uch *readpng_get_image(const char *fname, double display_exponent, int *pChannel
 | 
			
		||||
    return NULL;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  fprintf(stderr, "image %s: chans=%d rowbytes=%ld height=%ld\n", fname, *pChannels,
 | 
			
		||||
  fprintf(stderr, "image %s: chans=%d rowbytes=%u height=%u\n", fname, *pChannels,
 | 
			
		||||
	  rowbytes, height);
 | 
			
		||||
 | 
			
		||||
  for (i = 0; i < height; ++i)
 | 
			
		||||
@ -189,7 +193,7 @@ int do_convert(const char *infilename, const char *outfilename)
 | 
			
		||||
  ulg image_width, image_height, image_rowbytes, row, i;
 | 
			
		||||
  FILE *fpin;
 | 
			
		||||
  uch *image_data, *src;
 | 
			
		||||
  uint16_t bred, bgreen, bblue, buf;
 | 
			
		||||
  uint16_t bred = 0, bgreen = 0, bblue = 0, buf = 0;
 | 
			
		||||
  int image_channels, fdout;
 | 
			
		||||
  uch bg_red=0, bg_green=0, bg_blue=0, br, bg, bb, ba;
 | 
			
		||||
  double display_exponent = 2.2; /* a guesstimate */
 | 
			
		||||
@ -200,7 +204,7 @@ int do_convert(const char *infilename, const char *outfilename)
 | 
			
		||||
     return -1;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (readpng_init(fpin, &image_width, &image_height))
 | 
			
		||||
  if (readpng_init(infilename, fpin, &image_width, &image_height))
 | 
			
		||||
  {
 | 
			
		||||
    readpng_cleanup(1);
 | 
			
		||||
    fclose(fpin);
 | 
			
		||||
@ -222,7 +226,7 @@ int do_convert(const char *infilename, const char *outfilename)
 | 
			
		||||
    return -1;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  image_data = readpng_get_image(display_exponent, &image_channels, &image_rowbytes);
 | 
			
		||||
  image_data = readpng_get_image(infilename, display_exponent, &image_channels, &image_rowbytes);
 | 
			
		||||
  readpng_cleanup(0);
 | 
			
		||||
  fclose(fpin);
 | 
			
		||||
  if (!image_data)
 | 
			
		||||
@ -266,9 +270,9 @@ int do_convert(const char *infilename, const char *outfilename)
 | 
			
		||||
	}
 | 
			
		||||
	else
 | 
			
		||||
	{
 | 
			
		||||
	  alpha_composite(bred, br, ba, bg_red);
 | 
			
		||||
	  alpha_composite(bgreen, bg, ba, bg_green);
 | 
			
		||||
	  alpha_composite(bblue, bb, ba, bg_blue);
 | 
			
		||||
	  png_composite(bred, br, ba, bg_red);
 | 
			
		||||
	  png_composite(bgreen, bg, ba, bg_green);
 | 
			
		||||
	  png_composite(bblue, bb, ba, bg_blue);
 | 
			
		||||
	}
 | 
			
		||||
      }
 | 
			
		||||
      bred = (bred >> 3) & 0x1F;
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user