mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
Imported from libpng-1.0.5q.tar
This commit is contained in:
52
contrib/pngminus/makefile
Normal file
52
contrib/pngminus/makefile
Normal file
@@ -0,0 +1,52 @@
|
||||
# Makefile for PngMinus (png2pnm and pnm2png)
|
||||
# Linux / Unix
|
||||
|
||||
CC=cc -O -n32
|
||||
LD=cc -O -n32
|
||||
#CC=gcc -O
|
||||
#LD=gcc -O
|
||||
LB=ar
|
||||
RM=rm
|
||||
CP=cp
|
||||
|
||||
PNGPATH = /usr/local
|
||||
PNGINC = $(PNGPATH)/include
|
||||
PNGLIB = $(PNGPATH)/lib -lpng
|
||||
# PNGLIB = $(PNGPATH)/libpng.a
|
||||
|
||||
ZPATH = /usr/local
|
||||
ZINC = $(ZPATH)/include
|
||||
ZLIB = $(ZPATH)/lib -lz
|
||||
# ZLIB = $(ZPATH)/libz.a
|
||||
|
||||
CCFLAGS=-I$(PNGINC) -I$(ZINC)
|
||||
LDFLAGS=-L$(PNGLIB) -L$(ZLIB) -lm
|
||||
C=.c
|
||||
O=.o
|
||||
L=.a
|
||||
E=
|
||||
|
||||
# dependencies
|
||||
|
||||
all: png2pnm$(E) pnm2png$(E)
|
||||
|
||||
png2pnm$(O): png2pnm$(C)
|
||||
$(CC) -c $(CCFLAGS) png2pnm$(C)
|
||||
|
||||
png2pnm$(E): png2pnm$(O)
|
||||
$(LD) -o png2pnm$(E) png2pnm$(O) $(LDFLAGS)
|
||||
|
||||
pnm2png$(O): pnm2png$(C)
|
||||
$(CC) -c $(CCFLAGS) pnm2png$(C)
|
||||
|
||||
pnm2png$(E): pnm2png$(O)
|
||||
$(LD) -o pnm2png$(E) pnm2png$(O) $(LDFLAGS)
|
||||
|
||||
clean:
|
||||
$(RM) png2pnm$(O)
|
||||
$(RM) pnm2png$(O)
|
||||
$(RM) png2pnm$(E)
|
||||
$(RM) pnm2png$(E)
|
||||
|
||||
# End of makefile for png2pnm / pnm2png
|
||||
|
||||
@@ -77,7 +77,8 @@ int main(int argc, char *argv[])
|
||||
if ((fp_al = fopen (argv[argi], "rb")) == NULL)
|
||||
{
|
||||
fprintf (stderr, "PNM2PNG\n");
|
||||
fprintf (stderr, "Error: alpha-channel file %s does not exist\n", argv[argi]);
|
||||
fprintf (stderr, "Error: alpha-channel file %s does not exist\n",
|
||||
argv[argi]);
|
||||
exit (1);
|
||||
}
|
||||
break;
|
||||
@@ -511,8 +512,8 @@ png_uint_32 get_value (FILE *pnm_file, int depth)
|
||||
for (i = 0; i < depth; i++)
|
||||
mask = (mask << 1) | 0x01;
|
||||
|
||||
get_token (pnm_file, token);
|
||||
sscanf (token, "%lu", &ret_value);
|
||||
get_token (pnm_file, (char *) token);
|
||||
sscanf ((const char *) token, "%lu", &ret_value);
|
||||
|
||||
ret_value &= mask;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user