From 35244064bbb2a853fb5c08898e8a74a7ec489aaa Mon Sep 17 00:00:00 2001 From: David Monniaux Date: Fri, 1 Feb 2019 15:45:39 +0100 Subject: block tail calls etc. --- test/monniaux/jpeg-6b/Makefile | 353 ++- test/monniaux/jpeg-6b/ansi2knr.c | 693 ------ test/monniaux/jpeg-6b/ccomp.sh | 1 - test/monniaux/jpeg-6b/cjpeg.i | 3270 --------------------------- test/monniaux/jpeg-6b/configure | 2 +- test/monniaux/jpeg-6b/dm_configure_ccomp.sh | 1 - test/monniaux/jpeg-6b/jcapimin.c | 16 +- test/monniaux/jpeg-6b/jccoefct.c | 10 +- test/monniaux/jpeg-6b/jccolor.c | 4 +- test/monniaux/jpeg-6b/jcdctmgr.c | 4 - test/monniaux/jpeg-6b/jchuff.c | 10 +- test/monniaux/jpeg-6b/jcinit.c | 4 +- test/monniaux/jpeg-6b/jcmainct.c | 8 +- test/monniaux/jpeg-6b/jcmarker.c | 4 +- test/monniaux/jpeg-6b/jcmaster.c | 10 +- test/monniaux/jpeg-6b/jconfig.h | 157 +- test/monniaux/jpeg-6b/jcparam.c | 12 +- test/monniaux/jpeg-6b/jcprepct.c | 8 +- test/monniaux/jpeg-6b/jcprepct.i | 3092 ------------------------- test/monniaux/jpeg-6b/jcsample.c | 13 +- test/monniaux/jpeg-6b/jdapimin.c | 109 +- test/monniaux/jpeg-6b/jdatadst.c | 4 +- test/monniaux/jpeg-6b/jdcoefct.c | 24 +- test/monniaux/jpeg-6b/jdhuff.c | 4 +- test/monniaux/jpeg-6b/jdinput.c | 6 +- test/monniaux/jpeg-6b/jdmainct.c | 29 +- test/monniaux/jpeg-6b/jdmarker.c | 16 +- test/monniaux/jpeg-6b/jdmaster.c | 4 +- test/monniaux/jpeg-6b/jdphuff.c | 2 +- test/monniaux/jpeg-6b/jdsample.c | 16 +- test/monniaux/jpeg-6b/jerror.c | 4 +- test/monniaux/jpeg-6b/jmemmgr.c | 9 +- test/monniaux/jpeg-6b/jmemnobs.c | 17 +- test/monniaux/jpeg-6b/jmorecfg.h | 21 +- test/monniaux/jpeg-6b/jquant1.c | 18 +- test/monniaux/jpeg-6b/jquant2.c | 6 +- test/monniaux/jpeg-6b/jutils.c | 4 +- test/monniaux/jpeg-6b/modulo_division.c | 15 - test/monniaux/jpeg-6b/rdbmp.c | 4 +- test/monniaux/jpeg-6b/rdcolmap.c | 2 +- test/monniaux/jpeg-6b/rdppm.c | 2 +- test/monniaux/jpeg-6b/wrbmp.c | 2 +- test/monniaux/jpeg-6b/wrgif.c | 4 +- test/monniaux/jpeg-6b/wrppm.c | 4 +- test/monniaux/jpeg-6b/wrtarga.c | 4 +- 45 files changed, 384 insertions(+), 7618 deletions(-) delete mode 100644 test/monniaux/jpeg-6b/ansi2knr.c delete mode 100755 test/monniaux/jpeg-6b/ccomp.sh delete mode 100644 test/monniaux/jpeg-6b/cjpeg.i delete mode 100755 test/monniaux/jpeg-6b/dm_configure_ccomp.sh delete mode 100644 test/monniaux/jpeg-6b/jcprepct.i delete mode 100644 test/monniaux/jpeg-6b/modulo_division.c (limited to 'test') diff --git a/test/monniaux/jpeg-6b/Makefile b/test/monniaux/jpeg-6b/Makefile index 5e9e5fe8..05a96602 100644 --- a/test/monniaux/jpeg-6b/Makefile +++ b/test/monniaux/jpeg-6b/Makefile @@ -1,29 +1,15 @@ -# Generated automatically from makefile.cfg by configure. # Makefile for Independent JPEG Group's software -# makefile.cfg is edited by configure to produce a custom Makefile. +# This makefile is suitable for Unix-like systems with non-ANSI compilers. +# If you have an ANSI compiler, makefile.ansi is a better starting point. # Read installation instructions before saying "make" !! -# For compiling with source and object files in different directories. -srcdir = . - -# Where to install the programs and man pages. -prefix = /usr/local -exec_prefix = ${prefix} -bindir = $(exec_prefix)/bin -libdir = $(exec_prefix)/lib -includedir = $(prefix)/include -binprefix = -manprefix = -manext = 1 -mandir = $(prefix)/man/man$(manext) - # The name of your C compiler: -CC= ./ccomp.sh +CC= ../../../ccomp # You may need to adjust these cc options: -CFLAGS= -DNO_DOUBLE -DNO_32BIT_DIVISION -DNO_FLOAT -DNO_SWITCH -DTAIL_CALL_MISSING -DMEMCPY_MISSING -I$(srcdir) +CFLAGS= -O3 # Generally, we recommend defining any configuration symbols in jconfig.h, # NOT via -D switches here. # However, any special defines for ansi2knr.c may be included here: @@ -35,39 +21,22 @@ LDFLAGS= # To link any special libraries, add the necessary -l commands here. LDLIBS= -# If using GNU libtool, LIBTOOL references it; if not, LIBTOOL is empty. -LIBTOOL = -# $(O) expands to "lo" if using libtool, plain "o" if not. -# Similarly, $(A) expands to "la" or "a". -O = o -A = a - -# Library version ID; libtool uses this for the shared library version number. -# Note: we suggest this match the macro of the same name in jpeglib.h. -JPEG_LIB_VERSION = 62 - # Put here the object file name for the correct system-dependent memory # manager file. For Unix this is usually jmemnobs.o, but you may want # to use jmemansi.o or jmemname.o if you have limited swap space. -SYSDEPMEM= jmemnobs.$(O) +SYSDEPMEM= jmemnobs.o # miscellaneous OS-dependent stuff -SHELL= /bin/sh # linker LN= $(CC) # file deletion command RM= rm -f -# directory creation command -MKDIR= mkdir +# file rename command +MV= mv # library (.a) file creation command AR= ar rc # second step in .a creation (use "touch" if not needed) AR2= ranlib -# installation program -INSTALL= /usr/bin/install -c -INSTALL_PROGRAM= ${INSTALL} -INSTALL_LIB= ${INSTALL} -m 644 -INSTALL_DATA= ${INSTALL} -m 644 # End of configurable options. @@ -110,216 +79,150 @@ TESTFILES= testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg \ DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \ $(CONFIGUREFILES) $(OTHERFILES) $(TESTFILES) # library object files common to compression and decompression -COMOBJECTS= jcomapi.$(O) jutils.$(O) jerror.$(O) jmemmgr.$(O) $(SYSDEPMEM) +COMOBJECTS= jcomapi.o jutils.o jerror.o jmemmgr.o $(SYSDEPMEM) # compression library object files -CLIBOBJECTS= jcapimin.$(O) jcapistd.$(O) jctrans.$(O) jcparam.$(O) \ - jdatadst.$(O) jcinit.$(O) jcmaster.$(O) jcmarker.$(O) jcmainct.$(O) \ - jcprepct.$(O) jccoefct.$(O) jccolor.$(O) jcsample.$(O) jchuff.$(O) \ - jcphuff.$(O) jcdctmgr.$(O) jfdctfst.$(O) jfdctflt.$(O) \ - jfdctint.$(O) +CLIBOBJECTS= jcapimin.o jcapistd.o jctrans.o jcparam.o jdatadst.o jcinit.o \ + jcmaster.o jcmarker.o jcmainct.o jcprepct.o jccoefct.o jccolor.o \ + jcsample.o jchuff.o jcphuff.o jcdctmgr.o jfdctfst.o jfdctflt.o \ + jfdctint.o # decompression library object files -DLIBOBJECTS= jdapimin.$(O) jdapistd.$(O) jdtrans.$(O) jdatasrc.$(O) \ - jdmaster.$(O) jdinput.$(O) jdmarker.$(O) jdhuff.$(O) jdphuff.$(O) \ - jdmainct.$(O) jdcoefct.$(O) jdpostct.$(O) jddctmgr.$(O) \ - jidctfst.$(O) jidctflt.$(O) jidctint.$(O) jidctred.$(O) \ - jdsample.$(O) jdcolor.$(O) jquant1.$(O) jquant2.$(O) jdmerge.$(O) +DLIBOBJECTS= jdapimin.o jdapistd.o jdtrans.o jdatasrc.o jdmaster.o \ + jdinput.o jdmarker.o jdhuff.o jdphuff.o jdmainct.o jdcoefct.o \ + jdpostct.o jddctmgr.o jidctfst.o jidctflt.o jidctint.o jidctred.o \ + jdsample.o jdcolor.o jquant1.o jquant2.o jdmerge.o # These objectfiles are included in libjpeg.a LIBOBJECTS= $(CLIBOBJECTS) $(DLIBOBJECTS) $(COMOBJECTS) # object files for sample applications (excluding library files) -COBJECTS= cjpeg.$(O) rdppm.$(O) rdgif.$(O) rdtarga.$(O) rdrle.$(O) \ - rdbmp.$(O) rdswitch.$(O) cdjpeg.$(O) -DOBJECTS= djpeg.$(O) wrppm.$(O) wrgif.$(O) wrtarga.$(O) wrrle.$(O) \ - wrbmp.$(O) rdcolmap.$(O) cdjpeg.$(O) -TROBJECTS= jpegtran.$(O) rdswitch.$(O) cdjpeg.$(O) transupp.$(O) +COBJECTS= cjpeg.o rdppm.o rdgif.o rdtarga.o rdrle.o rdbmp.o rdswitch.o \ + cdjpeg.o +DOBJECTS= djpeg.o wrppm.o wrgif.o wrtarga.o wrrle.o wrbmp.o rdcolmap.o \ + cdjpeg.o +TROBJECTS= jpegtran.o rdswitch.o cdjpeg.o transupp.o -all: libjpeg.$(A) cjpeg djpeg jpegtran rdjpgcom wrjpgcom +all: libjpeg.a cjpeg djpeg jpegtran rdjpgcom wrjpgcom -# Special compilation rules to support ansi2knr and libtool. -.SUFFIXES: .lo .la - -# How to compile with libtool. -# .c.lo: -# $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c $(srcdir)/$*.c - -# How to use ansi2knr, when not using libtool. +# This rule causes ansi2knr to be invoked. # .c.o: -# ./ansi2knr $(srcdir)/$*.c knr/$*.c -# $(CC) $(CFLAGS) -c knr/$*.c -# $(RM) knr/$*.c - -# How to use ansi2knr AND libtool. -# .c.lo: -# ./ansi2knr $(srcdir)/$*.c knr/$*.c -# $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c knr/$*.c -# $(RM) knr/$*.c +# ./ansi2knr $*.c T$*.c +# $(CC) $(CFLAGS) -c T$*.c +# $(RM) T$*.c $*.o +# $(MV) T$*.o $*.o ansi2knr: ansi2knr.c - $(CC) $(CFLAGS) $(ANSI2KNRFLAGS) -o ansi2knr $(srcdir)/ansi2knr.c - $(MKDIR) knr + $(CC) $(CFLAGS) $(ANSI2KNRFLAGS) -o ansi2knr ansi2knr.c -# the library: - -EXTRAOBJECTS= modulo_division.o - -# without libtool: -libjpeg.a: $(LIBOBJECTS) $(EXTRAOBJECTS) +libjpeg.a: $(LIBOBJECTS) $(RM) libjpeg.a - $(AR) libjpeg.a $(LIBOBJECTS) $(EXTRAOBJECTS) + $(AR) libjpeg.a $(LIBOBJECTS) $(AR2) libjpeg.a -# with libtool: -libjpeg.la: $(LIBOBJECTS) - $(LIBTOOL) --mode=link $(CC) -o libjpeg.la $(LIBOBJECTS) \ - -rpath $(libdir) -version-info $(JPEG_LIB_VERSION) - -# sample programs: - -cjpeg: $(COBJECTS) libjpeg.$(A) - $(LN) $(LDFLAGS) -o cjpeg $(COBJECTS) libjpeg.$(A) $(LDLIBS) - -djpeg: $(DOBJECTS) libjpeg.$(A) - $(LN) $(LDFLAGS) -o djpeg $(DOBJECTS) libjpeg.$(A) $(LDLIBS) - -jpegtran: $(TROBJECTS) libjpeg.$(A) - $(LN) $(LDFLAGS) -o jpegtran $(TROBJECTS) libjpeg.$(A) $(LDLIBS) - -rdjpgcom: rdjpgcom.$(O) - $(LN) $(LDFLAGS) -o rdjpgcom rdjpgcom.$(O) $(LDLIBS) +cjpeg: $(COBJECTS) libjpeg.a + $(LN) $(LDFLAGS) -o cjpeg $(COBJECTS) libjpeg.a $(LDLIBS) -wrjpgcom: wrjpgcom.$(O) - $(LN) $(LDFLAGS) -o wrjpgcom wrjpgcom.$(O) $(LDLIBS) +djpeg: $(DOBJECTS) libjpeg.a + $(LN) $(LDFLAGS) -o djpeg $(DOBJECTS) libjpeg.a $(LDLIBS) -# Installation rules: +jpegtran: $(TROBJECTS) libjpeg.a + $(LN) $(LDFLAGS) -o jpegtran $(TROBJECTS) libjpeg.a $(LDLIBS) -install: cjpeg djpeg jpegtran rdjpgcom wrjpgcom - $(INSTALL_PROGRAM) cjpeg $(bindir)/$(binprefix)cjpeg - $(INSTALL_PROGRAM) djpeg $(bindir)/$(binprefix)djpeg - $(INSTALL_PROGRAM) jpegtran $(bindir)/$(binprefix)jpegtran - $(INSTALL_PROGRAM) rdjpgcom $(bindir)/$(binprefix)rdjpgcom - $(INSTALL_PROGRAM) wrjpgcom $(bindir)/$(binprefix)wrjpgcom - $(INSTALL_DATA) $(srcdir)/cjpeg.1 $(mandir)/$(manprefix)cjpeg.$(manext) - $(INSTALL_DATA) $(srcdir)/djpeg.1 $(mandir)/$(manprefix)djpeg.$(manext) - $(INSTALL_DATA) $(srcdir)/jpegtran.1 $(mandir)/$(manprefix)jpegtran.$(manext) - $(INSTALL_DATA) $(srcdir)/rdjpgcom.1 $(mandir)/$(manprefix)rdjpgcom.$(manext) - $(INSTALL_DATA) $(srcdir)/wrjpgcom.1 $(mandir)/$(manprefix)wrjpgcom.$(manext) +rdjpgcom: rdjpgcom.o + $(LN) $(LDFLAGS) -o rdjpgcom rdjpgcom.o $(LDLIBS) -install-lib: libjpeg.$(A) install-headers - $(INSTALL_LIB) libjpeg.$(A) $(libdir)/$(binprefix)libjpeg.$(A) - -install-headers: jconfig.h - $(INSTALL_DATA) jconfig.h $(includedir)/jconfig.h - $(INSTALL_DATA) $(srcdir)/jpeglib.h $(includedir)/jpeglib.h - $(INSTALL_DATA) $(srcdir)/jmorecfg.h $(includedir)/jmorecfg.h - $(INSTALL_DATA) $(srcdir)/jerror.h $(includedir)/jerror.h - -clean: - $(RM) *.o *.lo libjpeg.a libjpeg.la - $(RM) cjpeg djpeg jpegtran rdjpgcom wrjpgcom - $(RM) ansi2knr core testout* config.log config.status - $(RM) -r knr .libs _libs - -distclean: clean - $(RM) Makefile jconfig.h libtool config.cache - -test: cjpeg djpeg jpegtran - $(RM) testout* - ./djpeg -dct int -ppm -outfile testout.ppm $(srcdir)/testorig.jpg - ./djpeg -dct int -bmp -colors 256 -outfile testout.bmp $(srcdir)/testorig.jpg - ./cjpeg -dct int -outfile testout.jpg $(srcdir)/testimg.ppm - ./djpeg -dct int -ppm -outfile testoutp.ppm $(srcdir)/testprog.jpg - ./cjpeg -dct int -progressive -opt -outfile testoutp.jpg $(srcdir)/testimg.ppm - ./jpegtran -outfile testoutt.jpg $(srcdir)/testprog.jpg - cmp $(srcdir)/testimg.ppm testout.ppm - cmp $(srcdir)/testimg.bmp testout.bmp - cmp $(srcdir)/testimg.jpg testout.jpg - cmp $(srcdir)/testimg.ppm testoutp.ppm - cmp $(srcdir)/testimgp.jpg testoutp.jpg - cmp $(srcdir)/testorig.jpg testoutt.jpg - -check: test - -# Mistake catcher: +wrjpgcom: wrjpgcom.o + $(LN) $(LDFLAGS) -o wrjpgcom wrjpgcom.o $(LDLIBS) jconfig.h: jconfig.doc echo You must prepare a system-dependent jconfig.h file. echo Please read the installation directions in install.doc. exit 1 -# GNU Make likes to know which target names are not really files to be made: -.PHONY: all install install-lib install-headers clean distclean test check - - -jcapimin.$(O): jcapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h -jcapistd.$(O): jcapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h -jccoefct.$(O): jccoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h -jccolor.$(O): jccolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h -jcdctmgr.$(O): jcdctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h -jchuff.$(O): jchuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jchuff.h -jcinit.$(O): jcinit.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h -jcmainct.$(O): jcmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h -jcmarker.$(O): jcmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h -jcmaster.$(O): jcmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h -jcomapi.$(O): jcomapi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h -jcparam.$(O): jcparam.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h -jcphuff.$(O): jcphuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jchuff.h -jcprepct.$(O): jcprepct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h -jcsample.$(O): jcsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h -jctrans.$(O): jctrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h -jdapimin.$(O): jdapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h -jdapistd.$(O): jdapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h -jdatadst.$(O): jdatadst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h -jdatasrc.$(O): jdatasrc.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h -jdcoefct.$(O): jdcoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h -jdcolor.$(O): jdcolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h -jddctmgr.$(O): jddctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h -jdhuff.$(O): jdhuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdhuff.h -jdinput.$(O): jdinput.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h -jdmainct.$(O): jdmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h -jdmarker.$(O): jdmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h -jdmaster.$(O): jdmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h -jdmerge.$(O): jdmerge.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h -jdphuff.$(O): jdphuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdhuff.h -jdpostct.$(O): jdpostct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h -jdsample.$(O): jdsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h -jdtrans.$(O): jdtrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h -jerror.$(O): jerror.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jversion.h jerror.h -jfdctflt.$(O): jfdctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h -jfdctfst.$(O): jfdctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h -jfdctint.$(O): jfdctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h -jidctflt.$(O): jidctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h -jidctfst.$(O): jidctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h -jidctint.$(O): jidctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h -jidctred.$(O): jidctred.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h -jquant1.$(O): jquant1.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h -jquant2.$(O): jquant2.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h -jutils.$(O): jutils.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h -jmemmgr.$(O): jmemmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h -jmemansi.$(O): jmemansi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h -jmemname.$(O): jmemname.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h -jmemnobs.$(O): jmemnobs.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h -jmemdos.$(O): jmemdos.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h -jmemmac.$(O): jmemmac.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h -cjpeg.$(O): cjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h -djpeg.$(O): djpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h -jpegtran.$(O): jpegtran.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h transupp.h jversion.h -rdjpgcom.$(O): rdjpgcom.c jinclude.h jconfig.h -wrjpgcom.$(O): wrjpgcom.c jinclude.h jconfig.h -cdjpeg.$(O): cdjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h -rdcolmap.$(O): rdcolmap.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h -rdswitch.$(O): rdswitch.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h -transupp.$(O): transupp.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h transupp.h -rdppm.$(O): rdppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h -wrppm.$(O): wrppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h -rdgif.$(O): rdgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h -wrgif.$(O): wrgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h -rdtarga.$(O): rdtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h -wrtarga.$(O): wrtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h -rdbmp.$(O): rdbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h -wrbmp.$(O): wrbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h -rdrle.$(O): rdrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h -wrrle.$(O): wrrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +clean: + $(RM) *.o cjpeg djpeg jpegtran libjpeg.a rdjpgcom wrjpgcom + $(RM) core testout* -FALLBACK_CC=k1-mbr-gcc -modulo_division.o: modulo_division.c - $(FALLBACK_CC) -Wall -c $< -o $@ +test: cjpeg djpeg jpegtran + $(RM) testout* + ./djpeg -dct int -ppm -outfile testout.ppm testorig.jpg + ./djpeg -dct int -bmp -colors 256 -outfile testout.bmp testorig.jpg + ./cjpeg -dct int -outfile testout.jpg testimg.ppm + ./djpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg + ./cjpeg -dct int -progressive -opt -outfile testoutp.jpg testimg.ppm + ./jpegtran -outfile testoutt.jpg testprog.jpg + cmp testimg.ppm testout.ppm + cmp testimg.bmp testout.bmp + cmp testimg.jpg testout.jpg + cmp testimg.ppm testoutp.ppm + cmp testimgp.jpg testoutp.jpg + cmp testorig.jpg testoutt.jpg + + +jcapimin.o: jcapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcapistd.o: jcapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jccoefct.o: jccoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jccolor.o: jccolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcdctmgr.o: jcdctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jchuff.o: jchuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jchuff.h +jcinit.o: jcinit.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcmainct.o: jcmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcmarker.o: jcmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcmaster.o: jcmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcomapi.o: jcomapi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcparam.o: jcparam.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcphuff.o: jcphuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jchuff.h +jcprepct.o: jcprepct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcsample.o: jcsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jctrans.o: jctrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdapimin.o: jdapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdapistd.o: jdapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdatadst.o: jdatadst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h +jdatasrc.o: jdatasrc.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h +jdcoefct.o: jdcoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdcolor.o: jdcolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jddctmgr.o: jddctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jdhuff.o: jdhuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdhuff.h +jdinput.o: jdinput.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdmainct.o: jdmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdmarker.o: jdmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdmaster.o: jdmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdmerge.o: jdmerge.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdphuff.o: jdphuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdhuff.h +jdpostct.o: jdpostct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdsample.o: jdsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdtrans.o: jdtrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jerror.o: jerror.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jversion.h jerror.h +jfdctflt.o: jfdctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jfdctfst.o: jfdctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jfdctint.o: jfdctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jidctflt.o: jidctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jidctfst.o: jidctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jidctint.o: jidctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jidctred.o: jidctred.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jquant1.o: jquant1.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jquant2.o: jquant2.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jutils.o: jutils.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jmemmgr.o: jmemmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h +jmemansi.o: jmemansi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h +jmemname.o: jmemname.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h +jmemnobs.o: jmemnobs.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h +jmemdos.o: jmemdos.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h +jmemmac.o: jmemmac.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h +cjpeg.o: cjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h +djpeg.o: djpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h +jpegtran.o: jpegtran.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h transupp.h jversion.h +rdjpgcom.o: rdjpgcom.c jinclude.h jconfig.h +wrjpgcom.o: wrjpgcom.c jinclude.h jconfig.h +cdjpeg.o: cdjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +rdcolmap.o: rdcolmap.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +rdswitch.o: rdswitch.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +transupp.o: transupp.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h transupp.h +rdppm.o: rdppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +wrppm.o: wrppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +rdgif.o: rdgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +wrgif.o: wrgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +rdtarga.o: rdtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +wrtarga.o: wrtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +rdbmp.o: rdbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +wrbmp.o: wrbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +rdrle.o: rdrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +wrrle.o: wrrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h diff --git a/test/monniaux/jpeg-6b/ansi2knr.c b/test/monniaux/jpeg-6b/ansi2knr.c deleted file mode 100644 index 4e05fc2d..00000000 --- a/test/monniaux/jpeg-6b/ansi2knr.c +++ /dev/null @@ -1,693 +0,0 @@ -/* ansi2knr.c */ -/* Convert ANSI C function definitions to K&R ("traditional C") syntax */ - -/* -ansi2knr is distributed in the hope that it will be useful, but WITHOUT ANY -WARRANTY. No author or distributor accepts responsibility to anyone for the -consequences of using it or for whether it serves any particular purpose or -works at all, unless he says so in writing. Refer to the GNU General Public -License (the "GPL") for full details. - -Everyone is granted permission to copy, modify and redistribute ansi2knr, -but only under the conditions described in the GPL. A copy of this license -is supposed to have been given to you along with ansi2knr so you can know -your rights and responsibilities. It should be in a file named COPYLEFT. -[In the IJG distribution, the GPL appears below, not in a separate file.] -Among other things, the copyright notice and this notice must be preserved -on all copies. - -We explicitly state here what we believe is already implied by the GPL: if -the ansi2knr program is distributed as a separate set of sources and a -separate executable file which are aggregated on a storage medium together -with another program, this in itself does not bring the other program under -the GPL, nor does the mere fact that such a program or the procedures for -constructing it invoke the ansi2knr executable bring any other part of the -program under the GPL. -*/ - -/* ----------- Here is the GNU GPL file COPYLEFT, referred to above ---------- ------ These terms do NOT apply to the JPEG software itself; see README ------ - - GHOSTSCRIPT GENERAL PUBLIC LICENSE - (Clarified 11 Feb 1988) - - Copyright (C) 1988 Richard M. Stallman - Everyone is permitted to copy and distribute verbatim copies of this - license, but changing it is not allowed. You can also use this wording - to make the terms for other programs. - - The license agreements of most software companies keep you at the -mercy of those companies. By contrast, our general public license is -intended to give everyone the right to share Ghostscript. To make sure -that you get the rights we want you to have, we need to make -restrictions that forbid anyone to deny you these rights or to ask you -to surrender the rights. Hence this license agreement. - - Specifically, we want to make sure that you have the right to give -away copies of Ghostscript, that you receive source code or else can get -it if you want it, that you can change Ghostscript or use pieces of it -in new free programs, and that you know you can do these things. - - To make sure that everyone has such rights, we have to forbid you to -deprive anyone else of these rights. For example, if you distribute -copies of Ghostscript, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must tell them their rights. - - Also, for our own protection, we must make certain that everyone finds -out that there is no warranty for Ghostscript. If Ghostscript is -modified by someone else and passed on, we want its recipients to know -that what they have is not what we distributed, so that any problems -introduced by others will not reflect on our reputation. - - Therefore we (Richard M. Stallman and the Free Software Foundation, -Inc.) make the following terms which say what you must do to be allowed -to distribute or change Ghostscript. - - - COPYING POLICIES - - 1. You may copy and distribute verbatim copies of Ghostscript source -code as you receive it, in any medium, provided that you conspicuously -and appropriately publish on each copy a valid copyright and license -notice "Copyright (C) 1989 Aladdin Enterprises. All rights reserved. -Distributed by Free Software Foundation, Inc." (or with whatever year is -appropriate); keep intact the notices on all files that refer to this -License Agreement and to the absence of any warranty; and give any other -recipients of the Ghostscript program a copy of this License Agreement -along with the program. You may charge a distribution fee for the -physical act of transferring a copy. - - 2. You may modify your copy or copies of Ghostscript or any portion of -it, and copy and distribute such modifications under the terms of -Paragraph 1 above, provided that you also do the following: - - a) cause the modified files to carry prominent notices stating - that you changed the files and the date of any change; and - - b) cause the whole of any work that you distribute or publish, - that in whole or in part contains or is a derivative of Ghostscript - or any part thereof, to be licensed at no charge to all third - parties on terms identical to those contained in this License - Agreement (except that you may choose to grant more extensive - warranty protection to some or all third parties, at your option). - - c) You may charge a distribution fee for the physical act of - transferring a copy, and you may at your option offer warranty - protection in exchange for a fee. - -Mere aggregation of another unrelated program with this program (or its -derivative) on a volume of a storage or distribution medium does not bring -the other program under the scope of these terms. - - 3. You may copy and distribute Ghostscript (or a portion or derivative -of it, under Paragraph 2) in object code or executable form under the -terms of Paragraphs 1 and 2 above provided that you also do one of the -following: - - a) accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of - Paragraphs 1 and 2 above; or, - - b) accompany it with a written offer, valid for at least three - years, to give any third party free (except for a nominal - shipping charge) a complete machine-readable copy of the - corresponding source code, to be distributed under the terms of - Paragraphs 1 and 2 above; or, - - c) accompany it with the information you received as to where the - corresponding source code may be obtained. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form alone.) - -For an executable file, complete source code means all the source code for -all modules it contains; but, as a special exception, it need not include -source code for modules which are standard libraries that accompany the -operating system on which the executable file runs. - - 4. You may not copy, sublicense, distribute or transfer Ghostscript -except as expressly provided under this License Agreement. Any attempt -otherwise to copy, sublicense, distribute or transfer Ghostscript is -void and your rights to use the program under this License agreement -shall be automatically terminated. However, parties who have received -computer software programs from you with this License Agreement will not -have their licenses terminated so long as such parties remain in full -compliance. - - 5. If you wish to incorporate parts of Ghostscript into other free -programs whose distribution conditions are different, write to the Free -Software Foundation at 675 Mass Ave, Cambridge, MA 02139. We have not -yet worked out a simple rule that can be stated here, but we will often -permit this. We will be guided by the two goals of preserving the free -status of all derivatives of our free software and of promoting the -sharing and reuse of software. - -Your comments and suggestions about our licensing policies and our -software are welcome! Please contact the Free Software Foundation, -Inc., 675 Mass Ave, Cambridge, MA 02139, or call (617) 876-3296. - - NO WARRANTY - - BECAUSE GHOSTSCRIPT IS LICENSED FREE OF CHARGE, WE PROVIDE ABSOLUTELY -NO WARRANTY, TO THE EXTENT PERMITTED BY APPLICABLE STATE LAW. EXCEPT -WHEN OTHERWISE STATED IN WRITING, FREE SOFTWARE FOUNDATION, INC, RICHARD -M. STALLMAN, ALADDIN ENTERPRISES, L. PETER DEUTSCH, AND/OR OTHER PARTIES -PROVIDE GHOSTSCRIPT "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER -EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE -ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF GHOSTSCRIPT IS WITH -YOU. SHOULD GHOSTSCRIPT PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL -NECESSARY SERVICING, REPAIR OR CORRECTION. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW WILL RICHARD M. -STALLMAN, THE FREE SOFTWARE FOUNDATION, INC., L. PETER DEUTSCH, ALADDIN -ENTERPRISES, AND/OR ANY OTHER PARTY WHO MAY MODIFY AND REDISTRIBUTE -GHOSTSCRIPT AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING -ANY LOST PROFITS, LOST MONIES, OR OTHER SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE -(INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED -INACCURATE OR LOSSES SUSTAINED BY THIRD PARTIES OR A FAILURE OF THE -PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS) GHOSTSCRIPT, EVEN IF YOU -HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES, OR FOR ANY CLAIM -BY ANY OTHER PARTY. - --------------------- End of file COPYLEFT ------------------------------ -*/ - -/* - * Usage: - ansi2knr input_file [output_file] - * If no output_file is supplied, output goes to stdout. - * There are no error messages. - * - * ansi2knr recognizes function definitions by seeing a non-keyword - * identifier at the left margin, followed by a left parenthesis, - * with a right parenthesis as the last character on the line, - * and with a left brace as the first token on the following line - * (ignoring possible intervening comments). - * It will recognize a multi-line header provided that no intervening - * line ends with a left or right brace or a semicolon. - * These algorithms ignore whitespace and comments, except that - * the function name must be the first thing on the line. - * The following constructs will confuse it: - * - Any other construct that starts at the left margin and - * follows the above syntax (such as a macro or function call). - * - Some macros that tinker with the syntax of the function header. - */ - -/* - * The original and principal author of ansi2knr is L. Peter Deutsch - * . Other authors are noted in the change history - * that follows (in reverse chronological order): - lpd 96-01-21 added code to cope with not HAVE_CONFIG_H and with - compilers that don't understand void, as suggested by - Tom Lane - lpd 96-01-15 changed to require that the first non-comment token - on the line following a function header be a left brace, - to reduce sensitivity to macros, as suggested by Tom Lane - - lpd 95-06-22 removed #ifndefs whose sole purpose was to define - undefined preprocessor symbols as 0; changed all #ifdefs - for configuration symbols to #ifs - lpd 95-04-05 changed copyright notice to make it clear that - including ansi2knr in a program does not bring the entire - program under the GPL - lpd 94-12-18 added conditionals for systems where ctype macros - don't handle 8-bit characters properly, suggested by - Francois Pinard ; - removed --varargs switch (this is now the default) - lpd 94-10-10 removed CONFIG_BROKETS conditional - lpd 94-07-16 added some conditionals to help GNU `configure', - suggested by Francois Pinard ; - properly erase prototype args in function parameters, - contributed by Jim Avera ; - correct error in writeblanks (it shouldn't erase EOLs) - lpd 89-xx-xx original version - */ - -/* Most of the conditionals here are to make ansi2knr work with */ -/* or without the GNU configure machinery. */ - -#if HAVE_CONFIG_H -# include -#endif - -#include -#include - -#if HAVE_CONFIG_H - -/* - For properly autoconfiguring ansi2knr, use AC_CONFIG_HEADER(config.h). - This will define HAVE_CONFIG_H and so, activate the following lines. - */ - -# if STDC_HEADERS || HAVE_STRING_H -# include -# else -# include -# endif - -#else /* not HAVE_CONFIG_H */ - -/* Otherwise do it the hard way */ - -# ifdef BSD -# include -# else -# ifdef VMS - extern int strlen(), strncmp(); -# else -# include -# endif -# endif - -#endif /* not HAVE_CONFIG_H */ - -#if STDC_HEADERS -# include -#else -/* - malloc and free should be declared in stdlib.h, - but if you've got a K&R compiler, they probably aren't. - */ -# ifdef MSDOS -# include -# else -# ifdef VMS - extern char *malloc(); - extern void free(); -# else - extern char *malloc(); - extern int free(); -# endif -# endif - -#endif - -/* - * The ctype macros don't always handle 8-bit characters correctly. - * Compensate for this here. - */ -#ifdef isascii -# undef HAVE_ISASCII /* just in case */ -# define HAVE_ISASCII 1 -#else -#endif -#if STDC_HEADERS || !HAVE_ISASCII -# define is_ascii(c) 1 -#else -# define is_ascii(c) isascii(c) -#endif - -#define is_space(c) (is_ascii(c) && isspace(c)) -#define is_alpha(c) (is_ascii(c) && isalpha(c)) -#define is_alnum(c) (is_ascii(c) && isalnum(c)) - -/* Scanning macros */ -#define isidchar(ch) (is_alnum(ch) || (ch) == '_') -#define isidfirstchar(ch) (is_alpha(ch) || (ch) == '_') - -/* Forward references */ -char *skipspace(); -int writeblanks(); -int test1(); -int convert1(); - -/* The main program */ -int -main(argc, argv) - int argc; - char *argv[]; -{ FILE *in, *out; -#define bufsize 5000 /* arbitrary size */ - char *buf; - char *line; - char *more; - /* - * In previous versions, ansi2knr recognized a --varargs switch. - * If this switch was supplied, ansi2knr would attempt to convert - * a ... argument to va_alist and va_dcl; if this switch was not - * supplied, ansi2knr would simply drop any such arguments. - * Now, ansi2knr always does this conversion, and we only - * check for this switch for backward compatibility. - */ - int convert_varargs = 1; - - if ( argc > 1 && argv[1][0] == '-' ) - { if ( !strcmp(argv[1], "--varargs") ) - { convert_varargs = 1; - argc--; - argv++; - } - else - { fprintf(stderr, "Unrecognized switch: %s\n", argv[1]); - exit(1); - } - } - switch ( argc ) - { - default: - printf("Usage: ansi2knr input_file [output_file]\n"); - exit(0); - case 2: - out = stdout; - break; - case 3: - out = fopen(argv[2], "w"); - if ( out == NULL ) - { fprintf(stderr, "Cannot open output file %s\n", argv[2]); - exit(1); - } - } - in = fopen(argv[1], "r"); - if ( in == NULL ) - { fprintf(stderr, "Cannot open input file %s\n", argv[1]); - exit(1); - } - fprintf(out, "#line 1 \"%s\"\n", argv[1]); - buf = malloc(bufsize); - line = buf; - while ( fgets(line, (unsigned)(buf + bufsize - line), in) != NULL ) - { -test: line += strlen(line); - switch ( test1(buf) ) - { - case 2: /* a function header */ - convert1(buf, out, 1, convert_varargs); - break; - case 1: /* a function */ - /* Check for a { at the start of the next line. */ - more = ++line; -f: if ( line >= buf + (bufsize - 1) ) /* overflow check */ - goto wl; - if ( fgets(line, (unsigned)(buf + bufsize - line), in) == NULL ) - goto wl; - switch ( *skipspace(more, 1) ) - { - case '{': - /* Definitely a function header. */ - convert1(buf, out, 0, convert_varargs); - fputs(more, out); - break; - case 0: - /* The next line was blank or a comment: */ - /* keep scanning for a non-comment. */ - line += strlen(line); - goto f; - default: - /* buf isn't a function header, but */ - /* more might be. */ - fputs(buf, out); - strcpy(buf, more); - line = buf; - goto test; - } - break; - case -1: /* maybe the start of a function */ - if ( line != buf + (bufsize - 1) ) /* overflow check */ - continue; - /* falls through */ - default: /* not a function */ -wl: fputs(buf, out); - break; - } - line = buf; - } - if ( line != buf ) - fputs(buf, out); - free(buf); - fclose(out); - fclose(in); - return 0; -} - -/* Skip over space and comments, in either direction. */ -char * -skipspace(p, dir) - register char *p; - register int dir; /* 1 for forward, -1 for backward */ -{ for ( ; ; ) - { while ( is_space(*p) ) - p += dir; - if ( !(*p == '/' && p[dir] == '*') ) - break; - p += dir; p += dir; - while ( !(*p == '*' && p[dir] == '/') ) - { if ( *p == 0 ) - return p; /* multi-line comment?? */ - p += dir; - } - p += dir; p += dir; - } - return p; -} - -/* - * Write blanks over part of a string. - * Don't overwrite end-of-line characters. - */ -int -writeblanks(start, end) - char *start; - char *end; -{ char *p; - for ( p = start; p < end; p++ ) - if ( *p != '\r' && *p != '\n' ) - *p = ' '; - return 0; -} - -/* - * Test whether the string in buf is a function definition. - * The string may contain and/or end with a newline. - * Return as follows: - * 0 - definitely not a function definition; - * 1 - definitely a function definition; - * 2 - definitely a function prototype (NOT USED); - * -1 - may be the beginning of a function definition, - * append another line and look again. - * The reason we don't attempt to convert function prototypes is that - * Ghostscript's declaration-generating macros look too much like - * prototypes, and confuse the algorithms. - */ -int -test1(buf) - char *buf; -{ register char *p = buf; - char *bend; - char *endfn; - int contin; - - if ( !isidfirstchar(*p) ) - return 0; /* no name at left margin */ - bend = skipspace(buf + strlen(buf) - 1, -1); - switch ( *bend ) - { - case ';': contin = 0 /*2*/; break; - case ')': contin = 1; break; - case '{': return 0; /* not a function */ - case '}': return 0; /* not a function */ - default: contin = -1; - } - while ( isidchar(*p) ) - p++; - endfn = p; - p = skipspace(p, 1); - if ( *p++ != '(' ) - return 0; /* not a function */ - p = skipspace(p, 1); - if ( *p == ')' ) - return 0; /* no parameters */ - /* Check that the apparent function name isn't a keyword. */ - /* We only need to check for keywords that could be followed */ - /* by a left parenthesis (which, unfortunately, is most of them). */ - { static char *words[] = - { "asm", "auto", "case", "char", "const", "double", - "extern", "float", "for", "if", "int", "long", - "register", "return", "short", "signed", "sizeof", - "static", "switch", "typedef", "unsigned", - "void", "volatile", "while", 0 - }; - char **key = words; - char *kp; - int len = endfn - buf; - - while ( (kp = *key) != 0 ) - { if ( strlen(kp) == len && !strncmp(kp, buf, len) ) - return 0; /* name is a keyword */ - key++; - } - } - return contin; -} - -/* Convert a recognized function definition or header to K&R syntax. */ -int -convert1(buf, out, header, convert_varargs) - char *buf; - FILE *out; - int header; /* Boolean */ - int convert_varargs; /* Boolean */ -{ char *endfn; - register char *p; - char **breaks; - unsigned num_breaks = 2; /* for testing */ - char **btop; - char **bp; - char **ap; - char *vararg = 0; - - /* Pre-ANSI implementations don't agree on whether strchr */ - /* is called strchr or index, so we open-code it here. */ - for ( endfn = buf; *(endfn++) != '('; ) - ; -top: p = endfn; - breaks = (char **)malloc(sizeof(char *) * num_breaks * 2); - if ( breaks == 0 ) - { /* Couldn't allocate break table, give up */ - fprintf(stderr, "Unable to allocate break table!\n"); - fputs(buf, out); - return -1; - } - btop = breaks + num_breaks * 2 - 2; - bp = breaks; - /* Parse the argument list */ - do - { int level = 0; - char *lp = NULL; - char *rp; - char *end = NULL; - - if ( bp >= btop ) - { /* Filled up break table. */ - /* Allocate a bigger one and start over. */ - free((char *)breaks); - num_breaks <<= 1; - goto top; - } - *bp++ = p; - /* Find the end of the argument */ - for ( ; end == NULL; p++ ) - { switch(*p) - { - case ',': - if ( !level ) end = p; - break; - case '(': - if ( !level ) lp = p; - level++; - break; - case ')': - if ( --level < 0 ) end = p; - else rp = p; - break; - case '/': - p = skipspace(p, 1) - 1; - break; - default: - ; - } - } - /* Erase any embedded prototype parameters. */ - if ( lp ) - writeblanks(lp + 1, rp); - p--; /* back up over terminator */ - /* Find the name being declared. */ - /* This is complicated because of procedure and */ - /* array modifiers. */ - for ( ; ; ) - { p = skipspace(p - 1, -1); - switch ( *p ) - { - case ']': /* skip array dimension(s) */ - case ')': /* skip procedure args OR name */ - { int level = 1; - while ( level ) - switch ( *--p ) - { - case ']': case ')': level++; break; - case '[': case '(': level--; break; - case '/': p = skipspace(p, -1) + 1; break; - default: ; - } - } - if ( *p == '(' && *skipspace(p + 1, 1) == '*' ) - { /* We found the name being declared */ - while ( !isidfirstchar(*p) ) - p = skipspace(p, 1) + 1; - goto found; - } - break; - default: - goto found; - } - } -found: if ( *p == '.' && p[-1] == '.' && p[-2] == '.' ) - { if ( convert_varargs ) - { *bp++ = "va_alist"; - vararg = p-2; - } - else - { p++; - if ( bp == breaks + 1 ) /* sole argument */ - writeblanks(breaks[0], p); - else - writeblanks(bp[-1] - 1, p); - bp--; - } - } - else - { while ( isidchar(*p) ) p--; - *bp++ = p+1; - } - p = end; - } - while ( *p++ == ',' ); - *bp = p; - /* Make a special check for 'void' arglist */ - if ( bp == breaks+2 ) - { p = skipspace(breaks[0], 1); - if ( !strncmp(p, "void", 4) ) - { p = skipspace(p+4, 1); - if ( p == breaks[2] - 1 ) - { bp = breaks; /* yup, pretend arglist is empty */ - writeblanks(breaks[0], p + 1); - } - } - } - /* Put out the function name and left parenthesis. */ - p = buf; - while ( p != endfn ) putc(*p, out), p++; - /* Put out the declaration. */ - if ( header ) - { fputs(");", out); - for ( p = breaks[0]; *p; p++ ) - if ( *p == '\r' || *p == '\n' ) - putc(*p, out); - } - else - { for ( ap = breaks+1; ap < bp; ap += 2 ) - { p = *ap; - while ( isidchar(*p) ) - putc(*p, out), p++; - if ( ap < bp - 1 ) - fputs(", ", out); - } - fputs(") ", out); - /* Put out the argument declarations */ - for ( ap = breaks+2; ap <= bp; ap += 2 ) - (*ap)[-1] = ';'; - if ( vararg != 0 ) - { *vararg = 0; - fputs(breaks[0], out); /* any prior args */ - fputs("va_dcl", out); /* the final arg */ - fputs(bp[0], out); - } - else - fputs(breaks[0], out); - } - free((char *)breaks); - return 0; -} diff --git a/test/monniaux/jpeg-6b/ccomp.sh b/test/monniaux/jpeg-6b/ccomp.sh deleted file mode 100755 index 45c7923a..00000000 --- a/test/monniaux/jpeg-6b/ccomp.sh +++ /dev/null @@ -1 +0,0 @@ -exec /home/monniaux/work/Kalray/CompCert/ccomp "$@" diff --git a/test/monniaux/jpeg-6b/cjpeg.i b/test/monniaux/jpeg-6b/cjpeg.i deleted file mode 100644 index 3ac77ff4..00000000 --- a/test/monniaux/jpeg-6b/cjpeg.i +++ /dev/null @@ -1,3270 +0,0 @@ -# 1 "cjpeg.c" -# 1 "" -# 1 "" -# 1 "cjpeg.c" -# 26 "cjpeg.c" -# 1 "cdjpeg.h" 1 -# 14 "cdjpeg.h" -# 1 "jinclude.h" 1 -# 20 "jinclude.h" -# 1 "jconfig.h" 1 -# 21 "jinclude.h" 2 -# 35 "jinclude.h" -# 1 "/opt/Kalray/usr/local/k1rdtools/lib/gcc/k1-mbr/4.9.4/include/stddef.h" 1 3 4 -# 147 "/opt/Kalray/usr/local/k1rdtools/lib/gcc/k1-mbr/4.9.4/include/stddef.h" 3 4 -typedef long int ptrdiff_t; -# 212 "/opt/Kalray/usr/local/k1rdtools/lib/gcc/k1-mbr/4.9.4/include/stddef.h" 3 4 -typedef unsigned long long size_t; -# 324 "/opt/Kalray/usr/local/k1rdtools/lib/gcc/k1-mbr/4.9.4/include/stddef.h" 3 4 -typedef int wchar_t; -# 36 "jinclude.h" 2 - - - -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdlib.h" 1 3 -# 10 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdlib.h" 3 -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/machine/ieeefp.h" 1 3 -# 11 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdlib.h" 2 3 -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/_ansi.h" 1 3 -# 15 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/_ansi.h" 3 -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/newlib.h" 1 3 -# 16 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/_ansi.h" 2 3 -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/config.h" 1 3 - - - -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/machine/ieeefp.h" 1 3 -# 5 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/config.h" 2 3 -# 17 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/_ansi.h" 2 3 -# 12 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdlib.h" 2 3 - - - -# 1 "/opt/Kalray/usr/local/k1rdtools/lib/gcc/k1-mbr/4.9.4/include/stddef.h" 1 3 4 -# 16 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdlib.h" 2 3 - -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/reent.h" 1 3 -# 13 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/reent.h" 3 -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/_ansi.h" 1 3 -# 14 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/reent.h" 2 3 -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/_types.h" 1 3 -# 12 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/_types.h" 3 -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/machine/_types.h" 1 3 - - - - - - -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/machine/_default_types.h" 1 3 -# 22 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/machine/_default_types.h" 3 -# 1 "/opt/Kalray/usr/local/k1rdtools/lib/gcc/k1-mbr/4.9.4/include-fixed/limits.h" 1 3 4 -# 23 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/machine/_default_types.h" 2 3 - - - -typedef signed char __int8_t ; -typedef unsigned char __uint8_t ; -# 36 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/machine/_default_types.h" 3 -typedef signed short __int16_t; -typedef unsigned short __uint16_t; -# 46 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/machine/_default_types.h" 3 -typedef __int16_t __int_least16_t; -typedef __uint16_t __uint_least16_t; -# 62 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/machine/_default_types.h" 3 -typedef signed int __int32_t; -typedef unsigned int __uint32_t; -# 76 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/machine/_default_types.h" 3 -typedef __int32_t __int_least32_t; -typedef __uint32_t __uint_least32_t; -# 93 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/machine/_default_types.h" 3 -typedef signed long __int64_t; -typedef unsigned long __uint64_t; -# 8 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/machine/_types.h" 2 3 -# 13 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/_types.h" 2 3 -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/lock.h" 1 3 -# 9 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/lock.h" 3 -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/atomic.h" 1 3 -# 12 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/atomic.h" 3 -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/cpu.h" 1 3 -# 13 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/cpu.h" 3 -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/registers.h" 1 3 -# 14 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/cpu.h" 2 3 -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/types.h" 1 3 -# 16 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/types.h" 3 -typedef unsigned char __k1_uchar; - - -typedef unsigned short __k1_ushort; - - -typedef unsigned int __k1_uint; - - -typedef unsigned long __k1_ulong; - - -typedef signed long __k1_long; - - - -typedef unsigned char __k1_uint8_t; - - -typedef signed char __k1_int8_t; - - -typedef unsigned short __k1_uint16_t; - - -typedef signed short __k1_int16_t; - - -typedef unsigned int __k1_uint32_t; - - -typedef signed int __k1_int32_t; - - -typedef unsigned long long __k1_uint64_t; - - -typedef signed long long __k1_int64_t; -# 63 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/types.h" 3 -typedef long __k1_intptr_t; - - -typedef unsigned long __k1_uintptr_t; -# 15 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/cpu.h" 2 3 -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/assert.h" 1 3 -# 11 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/assert.h" 3 -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/common.h" 1 3 -# 12 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/assert.h" 2 3 -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/scall_no.h" 1 3 -# 13 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/assert.h" 2 3 -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/syscall.h" 1 3 -# 9 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/syscall.h" 3 -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdint.h" 1 3 -# 41 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdint.h" 3 -typedef signed char int8_t ; -typedef unsigned char uint8_t ; - - - - -typedef signed char int_least8_t; -typedef unsigned char uint_least8_t; -# 57 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdint.h" 3 -typedef signed short int16_t; -typedef unsigned short uint16_t; -# 67 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdint.h" 3 -typedef int16_t int_least16_t; -typedef uint16_t uint_least16_t; -# 83 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdint.h" 3 -typedef signed int int32_t; -typedef unsigned int uint32_t; -# 97 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdint.h" 3 -typedef int32_t int_least32_t; -typedef uint32_t uint_least32_t; -# 115 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdint.h" 3 -typedef signed long int64_t; -typedef unsigned long uint64_t; -# 129 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdint.h" 3 -typedef int64_t int_least64_t; -typedef uint64_t uint_least64_t; -# 159 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdint.h" 3 - typedef signed int int_fast8_t; - typedef unsigned int uint_fast8_t; - - - - - typedef signed int int_fast16_t; - typedef unsigned int uint_fast16_t; - - - - - typedef signed int int_fast32_t; - typedef unsigned int uint_fast32_t; -# 213 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdint.h" 3 - typedef int_least64_t int_fast64_t; - typedef uint_least64_t uint_fast64_t; - - - - - - - - typedef long int intmax_t; -# 231 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdint.h" 3 - typedef long unsigned int uintmax_t; -# 244 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdint.h" 3 - typedef int64_t intptr_t; - typedef uint64_t uintptr_t; -# 10 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/syscall.h" 2 3 -# 21 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/syscall.h" 3 -extern int __k1_syscall(const uint32_t syscall); -# 38 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/syscall.h" 3 -extern int __k1_syscall_with_args(const uint64_t syscall, uint64_t sc_arg0, uint64_t sc_arg1, - uint64_t sc_arg2, uint64_t sc_arg3, uint64_t sc_arg4, - uint64_t sc_arg5); -# 52 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/syscall.h" 3 -extern int __k1_syscall0(const uint32_t syscall); -# 61 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/syscall.h" 3 -extern int __k1_syscall1(const uint32_t syscall, uint64_t sc_arg0); -# 72 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/syscall.h" 3 -extern int __k1_syscall2(const uint32_t syscall, uint64_t sc_arg0, - uint64_t sc_arg1); -# 85 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/syscall.h" 3 -extern int __k1_syscall3(const uint32_t syscall, uint64_t sc_arg0, uint64_t sc_arg1, - uint64_t sc_arg2); -# 100 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/syscall.h" 3 -extern int __k1_syscall4(const uint32_t syscall, uint64_t sc_arg0, uint64_t sc_arg1, - uint64_t sc_arg2, uint64_t sc_arg3); -# 116 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/syscall.h" 3 -extern int -__k1_syscall5(const uint32_t syscall, uint64_t sc_arg0, uint64_t sc_arg1, - uint64_t sc_arg2, uint64_t sc_arg3, uint64_t sc_arg4); -# 135 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/syscall.h" 3 -extern int __k1_syscall6(const uint32_t syscall, uint64_t sc_arg0, uint64_t sc_arg1, - uint64_t sc_arg2, uint64_t sc_arg3, uint64_t sc_arg4, - uint64_t sc_arg5); -# 14 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/assert.h" 2 3 -# 16 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/cpu.h" 2 3 - - - - - - - -extern unsigned long __bsp_rtl_simu __attribute__ ((weak)); -# 32 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/cpu.h" 3 -extern unsigned long __bsp_core_only __attribute__ ((weak)); - - - - - - -extern char __k1_streaming_enable(char); - - - - - -extern char __k1_streaming_disable(char); - - - - - - extern unsigned int __bsp_frequency; -# 80 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/cpu.h" 3 -extern int __k1_is_rm(char) __attribute__((__const__)); - - - - - - -extern int __k1_get_cpu_id(char) __attribute__((__const__)); - - - - - - -extern int __k1_get_rm_id(char); - - - - - - - -extern __k1_uint32_t __k1_sysreg_get_num(unsigned int n); - - - - - - - -extern char __k1_sysreg_set_num(unsigned int n, __k1_uint32_t i); - - - - - - -extern unsigned int __k1_hw_loop_enabled(char); - - - - - -extern char __k1_hwloops_enable(char); - - - - - -extern char __k1_hwloops_disable(char); - - - - - -enum __k1_fpu_rounding_mode { - _K1_FPU_NEAREST_EVEN = 0, - _K1_FPU_TOWARDS_PLUS_INF = 1, - _K1_FPU_TOWARDS_MINUS_INF = 2, - _K1_FPU_TOWARDS_ZERO = 3 -}; - - - - - -extern char __k1_fpu_set_rounding_mode(enum __k1_fpu_rounding_mode mode); - - - - - -extern enum __k1_fpu_rounding_mode __k1_fpu_get_rounding_mode(char); - - - - - -enum __k1_fpu_exceptions { - _K1_FPU_INVALID_OPERATION = 0x2LL, - _K1_FPU_DIVIDE_BY_ZERO = 0x4LL, - _K1_FPU_OVERFLOW = 0x8LL, - _K1_FPU_UNDERFLOW = 0x10LL, - _K1_FPU_INEXACT = 0x20LL, - _K1_FPU_ALL_EXCEPTS = 0x2LL | 0x4LL | 0x8LL | 0x10LL | 0x20LL -}; - - - - - -extern char __k1_fpu_raise_exceptions(int excepts); - - - - - -extern char __k1_fpu_clear_exceptions(int excepts); - - - - - -extern unsigned int __k1_fpu_get_exceptions(char); -# 13 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/atomic.h" 2 3 -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/cache.h" 1 3 -# 47 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/cache.h" 3 -extern unsigned int __k1_icache_enabled(char); - - - - - -extern char __k1_icache_enable(char); - - - - - -extern char __k1_icache_disable(char); -# 70 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/cache.h" 3 -extern char __k1_icache_invalidate_mem_area(uintptr_t addr, int size); -# 81 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/cache.h" 3 -extern unsigned int __k1_dcache_enabled(char); - - - - - -extern char __k1_dcache_enable(char); - - - - - -extern char __k1_dcache_disable(char); -# 104 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/cache.h" 3 -extern char __k1_dcache_invalidate_mem_area(uintptr_t addr, int size); - - - - - -extern char __k1_l1_coherency_enable(char); - - - - - -extern char __k1_l1_coherency_disable(char); - - - - - -extern char __k1_l2cache_enable(char); - - - - - -extern char __k1_l2cache_disable(char); - - - - - - -extern char __k1_mb(char); - - - - - - -extern char __k1_wmb(char); - - - - - - -char __k1_rmb(char); -# 14 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/atomic.h" 2 3 -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/io.h" 1 3 -# 28 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/io.h" 3 -extern uint8_t __k1_io_read8(char *addr); - - - - - - - -extern uint16_t __k1_io_read16(char *addr); - - - - - - - -extern uint32_t __k1_io_read32(char *addr); - - - - - - - -extern uint64_t __k1_io_read64(char *addr); -# 64 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/io.h" 3 -extern char __k1_io_write8(char *addr, uint8_t val); - - - - - - - -extern char __k1_io_write16(char *addr, uint16_t val); - - - - - - - -extern char __k1_io_write32(char *addr, uint32_t val); - - - - - - - -extern char __k1_io_write64(char *addr, uint64_t val); -# 104 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/io.h" 3 -extern uint32_t __k1_umem_read32(char *addr __attribute__((unused))); - - - - - - - -extern uint64_t __k1_umem_read64(char *addr); - - - - - - - -extern uint8_t __k1_umem_read8(char *addr __attribute__((unused))); - - - - - - - -extern uint16_t __k1_umem_read16(char *addr); -# 140 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/io.h" 3 -extern char __k1_umem_write32(char *addr, uint32_t val); - - - - - - - -extern char __k1_umem_write64(char *addr, uint64_t val); - - - - - - - -extern char __k1_umem_write8(char *addr, uint8_t val); - - - - - - - -extern char __k1_umem_write16(char *addr, uint16_t val); -# 15 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/atomic.h" 2 3 -# 33 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/atomic.h" 3 -extern uint32_t __k1_atomic_swap32(char *addr, uint32_t new_value); - - - - - - - -extern uint64_t __k1_atomic_swap64(char *addr, uint64_t new_value); - - - - - - - -extern int32_t __k1_atomic_add32(char *addr, int32_t value); - - - - - - - -extern int __k1_compare_and_swap32(char *ptr, uint32_t old_value, - uint32_t new_value); -# 73 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/atomic.h" 3 -typedef struct __k1_recursive_lock __k1_recursive_lock_t; - -struct __k1_recursive_lock { - uint32_t owner; - uint32_t counter; -}; -# 94 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/atomic.h" 3 -extern char __k1_recursive_initlock_base(__k1_recursive_lock_t *lock); -# 107 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/atomic.h" 3 -extern int __k1_recursive_trylock_base(__k1_recursive_lock_t *lock, - uint32_t myself); -# 117 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/atomic.h" 3 -extern char __k1_recursive_lock_base(__k1_recursive_lock_t *lock, - uint64_t myself); -# 129 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/atomic.h" 3 -extern int __k1_recursive_unlock_base(__k1_recursive_lock_t *lock, - uint64_t myself); -# 141 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/atomic.h" 3 -extern int __k1_recursive_release_base(__k1_recursive_lock_t *lock, - uint64_t myself); -# 10 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/lock.h" 2 3 -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/cache.h" 1 3 -# 47 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/cache.h" 3 -extern unsigned int __k1_icache_enabled(char); - - - - - -extern char __k1_icache_enable(char); - - - - - -extern char __k1_icache_disable(char); -# 70 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/cache.h" 3 -extern char __k1_icache_invalidate_mem_area(uintptr_t addr, int size); -# 81 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/cache.h" 3 -extern unsigned int __k1_dcache_enabled(char); - - - - - -extern char __k1_dcache_enable(char); - - - - - -extern char __k1_dcache_disable(char); -# 104 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/cache.h" 3 -extern char __k1_dcache_invalidate_mem_area(uintptr_t addr, int size); - - - - - -extern char __k1_l1_coherency_enable(char); - - - - - -extern char __k1_l1_coherency_disable(char); - - - - - -extern char __k1_l2cache_enable(char); - - - - - -extern char __k1_l2cache_disable(char); - - - - - - -extern char __k1_mb(char); - - - - - - -extern char __k1_wmb(char); - - - - - - -char __k1_rmb(char); -# 11 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/lock.h" 2 3 - - - - -typedef struct __libc_lock_recursive_s -{ - __k1_recursive_lock_t lock; -} __libc_lock_recursive_t __attribute__ ((aligned (((64*8)/8)))); - -typedef struct __libc_lock_recursive_s __libc_lock_t; - - - - - - -int __libc_lock_init_recursive(__libc_lock_recursive_t *lock); -int __libc_lock_close_recursive(__libc_lock_recursive_t *lock); -int __libc_lock_acquire_recursive(__libc_lock_recursive_t *lock); -int __libc_lock_try_acquire_recursive(__libc_lock_recursive_t *lock); -int __libc_lock_release_recursive(__libc_lock_recursive_t *lock); -# 42 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/lock.h" 3 -typedef __libc_lock_t _LOCK_T __attribute__ ((aligned (((64*8)/8)))); -typedef __libc_lock_recursive_t _LOCK_RECURSIVE_T __attribute__ ((aligned (((64*8)/8)))); -# 14 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/_types.h" 2 3 - - -typedef long _off_t; - - - - - - - -typedef short __dev_t; - - - - -typedef unsigned short __uid_t; - - -typedef unsigned short __gid_t; - - - -__extension__ typedef long long _off64_t; - - - - - - - -typedef long _fpos_t; -# 56 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/_types.h" 3 -typedef int _ssize_t; - - - - - - -# 1 "/opt/Kalray/usr/local/k1rdtools/lib/gcc/k1-mbr/4.9.4/include/stddef.h" 1 3 4 -# 353 "/opt/Kalray/usr/local/k1rdtools/lib/gcc/k1-mbr/4.9.4/include/stddef.h" 3 4 -typedef unsigned int wint_t; -# 64 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/_types.h" 2 3 - - - -typedef struct -{ - int __count; - union - { - wint_t __wch; - unsigned char __wchb[4]; - } __value; -} _mbstate_t; - - - -typedef _LOCK_RECURSIVE_T _flock_t; - - - - -typedef char *_iconv_t; -# 15 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/reent.h" 2 3 -# 24 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/reent.h" 3 -typedef unsigned int __ULong; -# 37 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/reent.h" 3 -struct _reent; - - - - - - -struct _Bigint -{ - struct _Bigint *_next; - int _k, _maxwds, _sign, _wds; - __ULong _x[1]; -}; - - -struct __tm -{ - int __tm_sec; - int __tm_min; - int __tm_hour; - int __tm_mday; - int __tm_mon; - int __tm_year; - int __tm_wday; - int __tm_yday; - int __tm_isdst; -}; - - - - - - - -struct _on_exit_args { - char * _fnargs[32]; - char * _dso_handle[32]; - - __ULong _fntypes; - - - __ULong _is_cxa; -}; -# 89 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/reent.h" 3 -struct _atexit { - struct _atexit *_next; - int _ind; - - char (*_fns[32])(char); - struct _on_exit_args _on_exit_args; -}; -# 105 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/reent.h" 3 -struct __sbuf { - unsigned char *_base; - int _size; -}; -# 169 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/reent.h" 3 -struct __sFILE { - unsigned char *_p; - int _r; - int _w; - short _flags; - short _file; - struct __sbuf _bf; - int _lbfsize; - - - - - - - char * _cookie; - - int (* _read) (struct _reent *, char *, char *, int) - ; - int (* _write) (struct _reent *, char *, const char *, int) - ; - _fpos_t (* _seek) (struct _reent *, char *, _fpos_t, int); - int (* _close) (struct _reent *, char *); - - - struct __sbuf _ub; - unsigned char *_up; - int _ur; - - - unsigned char _ubuf[3]; - unsigned char _nbuf[1]; - - - struct __sbuf _lb; - - - int _blksize; - int _offset; - - - struct _reent *_data; - - - - _flock_t _lock; - - _mbstate_t _mbstate; - int _flags2; -}; -# 273 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/reent.h" 3 -typedef struct __sFILE __FILE; - - - -struct _glue -{ - struct _glue *_next; - int _niobs; - __FILE *_iobs; -}; -# 305 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/reent.h" 3 -struct _rand48 { - unsigned short _seed[3]; - unsigned short _mult[3]; - unsigned short _add; - - - - -}; -# 579 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/reent.h" 3 -struct _reent -{ - int _errno; - - - - - __FILE *_stdin, *_stdout, *_stderr; - - int _inc; - char _emergency[25]; - - int _current_category; - const char *_current_locale; - - int __sdidinit; - - char (* __cleanup) (struct _reent *); - - - struct _Bigint *_result; - int _result_k; - struct _Bigint *_p5s; - struct _Bigint **_freelist; - - - int _cvtlen; - char *_cvtbuf; - - union - { - struct - { - unsigned int _unused_rand; - char * _strtok_last; - char _asctime_buf[26]; - struct __tm _localtime_buf; - int _gamma_signgam; - __extension__ unsigned long long _rand_next; - struct _rand48 _r48; - _mbstate_t _mblen_state; - _mbstate_t _mbtowc_state; - _mbstate_t _wctomb_state; - char _l64a_buf[8]; - char _signal_buf[24]; - int _getdate_err; - _mbstate_t _mbrlen_state; - _mbstate_t _mbrtowc_state; - _mbstate_t _mbsrtowcs_state; - _mbstate_t _wcrtomb_state; - _mbstate_t _wcsrtombs_state; - int _h_errno; - } _reent; - - - - struct - { - - unsigned char * _nextf[30]; - unsigned int _nmalloc[30]; - } _unused; - } _new; - - - struct _atexit *_atexit; - struct _atexit _atexit0; - - - char (**(_sig_func))(int); - - - - - struct _glue __sglue; - __FILE __sf[3]; -}; -# 817 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/reent.h" 3 -extern struct _reent *_impure_ptr ; -extern struct _reent *const _global_impure_ptr ; - -char _reclaim_reent (struct _reent *); -# 18 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdlib.h" 2 3 -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/machine/stdlib.h" 1 3 -# 19 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdlib.h" 2 3 -# 27 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdlib.h" 3 - - -typedef struct -{ - int quot; - int rem; -} div_t; - -typedef struct -{ - long quot; - long rem; -} ldiv_t; -# 58 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdlib.h" 3 -extern int __mb_cur_max; - - - -char abort (char) ; -int abs (int); -int atexit (char (*__func)(char)); -double atof (const char *__nptr); - - - -int atoi (const char *__nptr); -int _atoi_r (struct _reent *, const char *__nptr); -long atol (const char *__nptr); -long _atol_r (struct _reent *, const char *__nptr); -char * bsearch (const char * __key, const char * __base, size_t __nmemb, size_t __size, int (* _compar) (const char *, const char *)) - - - - ; -char * calloc (size_t __nmemb, size_t __size) ; -div_t div (int __numer, int __denom); -char exit (int __status) ; -char free (char *) ; -char * getenv (const char *__string); -char * _getenv_r (struct _reent *, const char *__string); -char * _findenv (const char *, int *); -char * _findenv_r (struct _reent *, const char *, int *); -long labs (long); -ldiv_t ldiv (long __numer, long __denom); -char * malloc (size_t __size) ; -int mblen (const char *, size_t); -int _mblen_r (struct _reent *, const char *, size_t, _mbstate_t *); -int mbtowc (wchar_t *, const char *, size_t); -int _mbtowc_r (struct _reent *, wchar_t *, const char *, size_t, _mbstate_t *); -int wctomb (char *, wchar_t); -int _wctomb_r (struct _reent *, char *, wchar_t, _mbstate_t *); -size_t mbstowcs (wchar_t *, const char *, size_t); -size_t _mbstowcs_r (struct _reent *, wchar_t *, const char *, size_t, _mbstate_t *); -size_t wcstombs (char *, const wchar_t *, size_t); -size_t _wcstombs_r (struct _reent *, char *, const wchar_t *, size_t, _mbstate_t *); -# 111 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdlib.h" 3 -char qsort (char * __base, size_t __nmemb, size_t __size, int(*_compar)(const char *, const char *)); -int rand (char); -char * realloc (char * __r, size_t __size) ; - - - -char srand (unsigned __seed); -double strtod (const char *__n, char **__end_PTR); -double _strtod_r (struct _reent *,const char *__n, char **__end_PTR); -float strtof (const char *__n, char **__end_PTR); - - - - - - -long strtol (const char *__n, char **__end_PTR, int __base); -long _strtol_r (struct _reent *,const char *__n, char **__end_PTR, int __base); -unsigned long strtoul (const char *__n, char **__end_PTR, int __base); -unsigned long _strtoul_r (struct _reent *,const char *__n, char **__end_PTR, int __base); - -int system (const char *__string); -# 198 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdlib.h" 3 -char * _dtoa_r (struct _reent *, double, int, int, int *, int*, char**); - -char * _malloc_r (struct _reent *, size_t) ; -char * _calloc_r (struct _reent *, size_t, size_t) ; -char _free_r (struct _reent *, char *) ; -char * _realloc_r (struct _reent *, char *, size_t) ; -char _mstats_r (struct _reent *, char *); - -int _system_r (struct _reent *, const char *); - -char __eprintf (const char *, const char *, unsigned int, const char *); - - - -extern long double strtold (const char *, char **); -extern long double wcstold (const wchar_t *, wchar_t **); - - - -# 40 "jinclude.h" 2 - - - - - - -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdio.h" 1 3 -# 34 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdio.h" 3 -# 1 "/opt/Kalray/usr/local/k1rdtools/lib/gcc/k1-mbr/4.9.4/include/stddef.h" 1 3 4 -# 35 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdio.h" 2 3 - - -# 1 "/opt/Kalray/usr/local/k1rdtools/lib/gcc/k1-mbr/4.9.4/include/stdarg.h" 1 3 4 -# 40 "/opt/Kalray/usr/local/k1rdtools/lib/gcc/k1-mbr/4.9.4/include/stdarg.h" 3 4 -typedef __builtin_va_list __gnuc_va_list; -# 38 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdio.h" 2 3 -# 46 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdio.h" 3 -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/types.h" 1 3 -# 69 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/types.h" 3 -# 1 "/opt/Kalray/usr/local/k1rdtools/lib/gcc/k1-mbr/4.9.4/include/stddef.h" 1 3 4 -# 70 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/types.h" 2 3 -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/machine/types.h" 1 3 -# 19 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/machine/types.h" 3 -typedef long int __off_t; -typedef int __pid_t; - - - -typedef long int __loff_t; -# 71 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/types.h" 2 3 -# 92 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/types.h" 3 -typedef unsigned char u_char; -typedef unsigned short u_short; -typedef unsigned int u_int; -typedef unsigned long u_long; - - - -typedef unsigned short ushort; -typedef unsigned int uint; - - - -typedef unsigned long clock_t; - - - - -typedef long time_t; - - - - -struct timespec { - time_t tv_sec; - long tv_nsec; -}; - -struct itimerspec { - struct timespec it_interval; - struct timespec it_value; -}; - - -typedef long daddr_t; -typedef char * caddr_t; - - - - - - -typedef unsigned short ino_t; -# 162 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/types.h" 3 -typedef _off_t off_t; -typedef __dev_t dev_t; -typedef __uid_t uid_t; -typedef __gid_t gid_t; - - - - - -typedef int pid_t; - - - -typedef long key_t; - -typedef _ssize_t ssize_t; -# 191 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/types.h" 3 -typedef unsigned int mode_t ; - - - - -typedef unsigned short nlink_t; -# 218 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/types.h" 3 -typedef long fd_mask; - - - - - - - -typedef struct _types_fd_set { - fd_mask fds_bits[(((64)+(((sizeof (fd_mask) * 8))-1))/((sizeof (fd_mask) * 8)))]; -} _types_fd_set; -# 249 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/types.h" 3 -typedef unsigned long clockid_t; - - - - -typedef unsigned long timer_t; - - - -typedef unsigned long useconds_t; -typedef long suseconds_t; - -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/features.h" 1 3 -# 262 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/types.h" 2 3 -# 273 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/types.h" 3 -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/sched.h" 1 3 -# 46 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/sched.h" 3 -struct sched_param { - int sched_priority; -# 59 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/sched.h" 3 -}; -# 274 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/types.h" 2 3 -# 282 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/types.h" 3 -typedef __uint32_t pthread_t; -# 344 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/types.h" 3 -typedef struct { - int is_initialized; - char *stackaddr; - int stacksize; - int contentionscope; - int inheritsched; - int schedpolicy; - struct sched_param schedparam; - - - - - - - int detachstate; - -} pthread_attr_t; -# 459 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/types.h" 3 -typedef __uint32_t pthread_mutex_t; - - -typedef struct { - int is_initialized; -# 474 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/types.h" 3 - int recursive; -} pthread_mutexattr_t; - - - - - - - -typedef __uint32_t pthread_cond_t; - - -typedef struct { - int is_initialized; - - - -} pthread_condattr_t; - - - - - - -typedef __uint32_t pthread_key_t; - - -typedef struct { - int is_initialized; - int init_executed; -} pthread_once_t; -# 517 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/types.h" 3 -typedef __uint32_t pthread_barrier_t; - - -typedef struct { - int is_initialized; - - - -} pthread_barrierattr_t; -# 537 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/types.h" 3 -typedef __uint32_t pthread_spinlock_t; -# 47 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdio.h" 2 3 - - - -typedef __FILE FILE; -# 59 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdio.h" 3 -typedef _fpos_t fpos_t; - - - - - -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/stdio.h" 1 3 -# 66 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdio.h" 2 3 -# 175 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdio.h" 3 -FILE * tmpfile (char); -char * tmpnam (char *); -int fclose (FILE *); -int fflush (FILE *); -FILE * freopen (const char *, const char *, FILE *); -char setbuf (FILE *, char *); -int setvbuf (FILE *, char *, int, size_t); -int fprintf (FILE *, const char *, ...) - ; -int fscanf (FILE *, const char *, ...) - ; -int printf (const char *, ...) - ; -int scanf (const char *, ...) - ; -int sscanf (const char *, const char *, ...) - ; -int vfprintf (FILE *, const char *, char*) - ; -int vprintf (const char *, char*) - ; -int vsprintf (char *, const char *, char*) - ; -int fgetc (FILE *); -char * fgets (char *, int, FILE *); -int fputc (int, FILE *); -int fputs (const char *, FILE *); -int getc (FILE *); -int getchar (char); -char * gets (char *); -int putc (int, FILE *); -int putchar (int); -int puts (const char *); -int ungetc (int, FILE *); -size_t fread (char *, size_t _size, size_t _n, FILE *); -size_t fwrite (const char * , size_t _size, size_t _n, FILE *); - - - -int fgetpos (FILE *, fpos_t *); - -int fseek (FILE *, long, int); - - - -int fsetpos (FILE *, const fpos_t *); - -long ftell ( FILE *); -char rewind (FILE *); -char clearerr (FILE *); -int feof (FILE *); -int ferror (FILE *); -char perror (const char *); - -FILE * fopen (const char *_name, const char *_type); -int sprintf (char *, const char *, ...) - ; -int remove (const char *); -int rename (const char *, const char *); -# 246 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdio.h" 3 -int asiprintf (char **, const char *, ...) - ; -char * asniprintf (char *, size_t *, const char *, ...) - ; -char * asnprintf (char *, size_t *, const char *, ...) - ; -int asprintf (char **, const char *, ...) - ; - -int diprintf (int, const char *, ...) - ; - -int fcloseall (char); -int fiprintf (FILE *, const char *, ...) - ; -int fiscanf (FILE *, const char *, ...) - ; -int iprintf (const char *, ...) - ; -int iscanf (const char *, ...) - ; -int siprintf (char *, const char *, ...) - ; -int siscanf (const char *, const char *, ...) - ; -int snprintf (char *, size_t, const char *, ...) - ; -int sniprintf (char *, size_t, const char *, ...) - ; -char * tempnam (const char *, const char *); -int vasiprintf (char **, const char *, char*) - ; -char * vasniprintf (char *, size_t *, const char *, char*) - ; -char * vasnprintf (char *, size_t *, const char *, char*) - ; -int vasprintf (char **, const char *, char*) - ; -int vdiprintf (int, const char *, char*) - ; -int vfiprintf (FILE *, const char *, char*) - ; -int vfiscanf (FILE *, const char *, char*) - ; -int vfscanf (FILE *, const char *, char*) - ; -int viprintf (const char *, char*) - ; -int viscanf (const char *, char*) - ; -int vscanf (const char *, char*) - ; -int vsiprintf (char *, const char *, char*) - ; -int vsiscanf (const char *, const char *, char*) - ; -int vsniprintf (char *, size_t, const char *, char*) - ; -int vsnprintf (char *, size_t, const char *, char*) - ; -int vsscanf (const char *, const char *, char*) - ; -# 361 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdio.h" 3 -int _asiprintf_r (struct _reent *, char **, const char *, ...) - ; -char * _asniprintf_r (struct _reent *, char *, size_t *, const char *, ...) - ; -char * _asnprintf_r (struct _reent *, char *, size_t *, const char *, ...) - ; -int _asprintf_r (struct _reent *, char **, const char *, ...) - ; -int _diprintf_r (struct _reent *, int, const char *, ...) - ; -int _dprintf_r (struct _reent *, int, const char *, ...) - ; -int _fclose_r (struct _reent *, FILE *); -int _fcloseall_r (struct _reent *); -FILE * _fdopen_r (struct _reent *, int, const char *); -int _fflush_r (struct _reent *, FILE *); -int _fgetc_r (struct _reent *, FILE *); -char * _fgets_r (struct _reent *, char *, int, FILE *); - - - - -int _fgetpos_r (struct _reent *, FILE *, fpos_t *); -int _fsetpos_r (struct _reent *, FILE *, const fpos_t *); - -int _fiprintf_r (struct _reent *, FILE *, const char *, ...) - ; -int _fiscanf_r (struct _reent *, FILE *, const char *, ...) - ; -FILE * _fmemopen_r (struct _reent *, char *, size_t, const char *); -FILE * _fopen_r (struct _reent *, const char *, const char *); -FILE * _freopen_r (struct _reent *, const char *, const char *, FILE *); -int _fprintf_r (struct _reent *, FILE *, const char *, ...) - ; -int _fpurge_r (struct _reent *, FILE *); -int _fputc_r (struct _reent *, int, FILE *); -int _fputs_r (struct _reent *, const char *, FILE *); -size_t _fread_r (struct _reent *, char *, size_t _size, size_t _n, FILE *); -int _fscanf_r (struct _reent *, FILE *, const char *, ...) - ; -int _fseek_r (struct _reent *, FILE *, long, int); -int _fseeko_r (struct _reent *, FILE *, _off_t, int); -long _ftell_r (struct _reent *, FILE *); -_off_t _ftello_r (struct _reent *, FILE *); -char _rewind_r (struct _reent *, FILE *); -size_t _fwrite_r (struct _reent *, const char * , size_t _size, size_t _n, FILE *); -int _getc_r (struct _reent *, FILE *); -int _getc_unlocked_r (struct _reent *, FILE *); -int _getchar_r (struct _reent *); -int _getchar_unlocked_r (struct _reent *); -char * _gets_r (struct _reent *, char *); -int _iprintf_r (struct _reent *, const char *, ...) - ; -int _iscanf_r (struct _reent *, const char *, ...) - ; -FILE * _open_memstream_r (struct _reent *, char **, size_t *); -char _perror_r (struct _reent *, const char *); -int _printf_r (struct _reent *, const char *, ...) - ; -int _putc_r (struct _reent *, int, FILE *); -int _putc_unlocked_r (struct _reent *, int, FILE *); -int _putchar_unlocked_r (struct _reent *, int); -int _putchar_r (struct _reent *, int); -int _puts_r (struct _reent *, const char *); -int _remove_r (struct _reent *, const char *); -int _rename_r (struct _reent *, const char *_old, const char *_new) - ; -int _scanf_r (struct _reent *, const char *, ...) - ; -int _siprintf_r (struct _reent *, char *, const char *, ...) - ; -int _siscanf_r (struct _reent *, const char *, const char *, ...) - ; -int _sniprintf_r (struct _reent *, char *, size_t, const char *, ...) - ; -int _snprintf_r (struct _reent *, char *, size_t, const char *, ...) - ; -int _sprintf_r (struct _reent *, char *, const char *, ...) - ; -int _sscanf_r (struct _reent *, const char *, const char *, ...) - ; -char * _tempnam_r (struct _reent *, const char *, const char *); -FILE * _tmpfile_r (struct _reent *); -char * _tmpnam_r (struct _reent *, char *); -int _ungetc_r (struct _reent *, int, FILE *); -int _vasiprintf_r (struct _reent *, char **, const char *, char*) - ; -char * _vasniprintf_r (struct _reent*, char *, size_t *, const char *, char*) - ; -char * _vasnprintf_r (struct _reent*, char *, size_t *, const char *, char*) - ; -int _vasprintf_r (struct _reent *, char **, const char *, char*) - ; -int _vdiprintf_r (struct _reent *, int, const char *, char*) - ; -int _vdprintf_r (struct _reent *, int, const char *, char*) - ; -int _vfiprintf_r (struct _reent *, FILE *, const char *, char*) - ; -int _vfiscanf_r (struct _reent *, FILE *, const char *, char*) - ; -int _vfprintf_r (struct _reent *, FILE *, const char *, char*) - ; -int _vfscanf_r (struct _reent *, FILE *, const char *, char*) - ; -int _viprintf_r (struct _reent *, const char *, char*) - ; -int _viscanf_r (struct _reent *, const char *, char*) - ; -int _vprintf_r (struct _reent *, const char *, char*) - ; -int _vscanf_r (struct _reent *, const char *, char*) - ; -int _vsiprintf_r (struct _reent *, char *, const char *, char*) - ; -int _vsiscanf_r (struct _reent *, const char *, const char *, char*) - ; -int _vsniprintf_r (struct _reent *, char *, size_t, const char *, char*) - ; -int _vsnprintf_r (struct _reent *, char *, size_t, const char *, char*) - ; -int _vsprintf_r (struct _reent *, char *, const char *, char*) - ; -int _vsscanf_r (struct _reent *, const char *, const char *, char*) - ; - - - -int fpurge (FILE *); -ssize_t __getdelim (char **, size_t *, int, FILE *); -ssize_t __getline (char **, size_t *, FILE *); -# 519 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdio.h" 3 -int __srget_r (struct _reent *, FILE *); -int __swbuf_r (struct _reent *, int, FILE *); -# 687 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdio.h" 3 - -# 47 "jinclude.h" 2 -# 66 "jinclude.h" -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/string.h" 1 3 -# 14 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/string.h" 3 -# 1 "/opt/Kalray/usr/local/k1rdtools/lib/gcc/k1-mbr/4.9.4/include/stddef.h" 1 3 4 -# 15 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/string.h" 2 3 - - - - - - - -char * memchr (const char *, int, size_t); -int memcmp (const char *, const char *, size_t); -char * memcpy (char *, const char *, size_t); -char * memmove (char *, const char *, size_t); -char * memset (char *, int, size_t); -char *strcat (char *, const char *); -char *strchr (const char *, int); -int strcmp (const char *, const char *); -int strcoll (const char *, const char *); -char *strcpy (char *, const char *); -size_t strcspn (const char *, const char *); -char *strerror (int); -size_t strlen (const char *); -char *strncat (char *, const char *, size_t); -int strncmp (const char *, const char *, size_t); -char *strncpy (char *, const char *, size_t); -char *strpbrk (const char *, const char *); -char *strrchr (const char *, int); -size_t strspn (const char *, const char *); -char *strstr (const char *, const char *); - - -char *strtok (char *, const char *); - - -size_t strxfrm (char *, const char *, size_t); -# 78 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/string.h" 3 -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/string.h" 1 3 -# 79 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/string.h" 2 3 - - -# 67 "jinclude.h" 2 -# 15 "cdjpeg.h" 2 -# 1 "jpeglib.h" 1 -# 26 "jpeglib.h" -# 1 "jmorecfg.h" 1 -# 66 "jmorecfg.h" -typedef unsigned char JSAMPLE; -# 106 "jmorecfg.h" -typedef short JCOEF; -# 117 "jmorecfg.h" -typedef unsigned char JOCTET; -# 142 "jmorecfg.h" -typedef unsigned char UINT8; -# 154 "jmorecfg.h" -typedef unsigned short UINT16; - - - - - - - -typedef short INT16; - - - - - -typedef long INT32; -# 178 "jmorecfg.h" -typedef unsigned int JDIMENSION; -# 234 "jmorecfg.h" -typedef int boolean; -# 27 "jpeglib.h" 2 -# 66 "jpeglib.h" -typedef JSAMPLE *JSAMPROW; -typedef JSAMPROW *JSAMPARRAY; -typedef JSAMPARRAY *JSAMPIMAGE; - -typedef JCOEF JBLOCK[64]; -typedef JBLOCK *JBLOCKROW; -typedef JBLOCKROW *JBLOCKARRAY; -typedef JBLOCKARRAY *JBLOCKIMAGE; - -typedef JCOEF *JCOEFPTR; - - - - - - - -typedef struct { - - - - - UINT16 quantval[64]; - - - - - - boolean sent_table; -} JQUANT_TBL; - - - - -typedef struct { - - UINT8 bits[17]; - - UINT8 huffval[256]; - - - - - - boolean sent_table; -} JHUFF_TBL; - - - - -typedef struct { - - - - int component_id; - int component_index; - int h_samp_factor; - int v_samp_factor; - int quant_tbl_no; - - - - - int dc_tbl_no; - int ac_tbl_no; -# 139 "jpeglib.h" - JDIMENSION width_in_blocks; - JDIMENSION height_in_blocks; - - - - - - - int DCT_scaled_size; - - - - - - - JDIMENSION downsampled_width; - JDIMENSION downsampled_height; - - - - - boolean component_needed; - - - - int MCU_width; - int MCU_height; - int MCU_blocks; - int MCU_sample_width; - int last_col_width; - int last_row_height; - - - - - - JQUANT_TBL * quant_table; - - - char * dct_table; -} jpeg_component_info; - - - - -typedef struct { - int comps_in_scan; - int component_index[4]; - int Ss, Se; - int Ah, Al; -} jpeg_scan_info; - - - -typedef struct jpeg_marker_struct * jpeg_saved_marker_ptr; - -struct jpeg_marker_struct { - jpeg_saved_marker_ptr next; - UINT8 marker; - unsigned int original_length; - unsigned int data_length; - JOCTET * data; - -}; - - - -typedef enum { - JCS_UNKNOWN, - JCS_GRAYSCALE, - JCS_RGB, - JCS_YCbCr, - JCS_CMYK, - JCS_YCCK -} J_COLOR_SPACE; - - - -typedef enum { - JDCT_ISLOW, - JDCT_IFAST, - JDCT_FLOAT -} J_DCT_METHOD; -# 232 "jpeglib.h" -typedef enum { - JDITHER_NONE, - JDITHER_ORDERED, - JDITHER_FS -} J_DITHER_MODE; -# 253 "jpeglib.h" -struct jpeg_common_struct { - struct jpeg_error_mgr * err; struct jpeg_memory_mgr * mem; struct jpeg_progress_mgr * progress; char * client_data; boolean is_decompressor; int global_state; - - - - -}; - -typedef struct jpeg_common_struct * j_common_ptr; -typedef struct jpeg_compress_struct * j_compress_ptr; -typedef struct jpeg_decompress_struct * j_decompress_ptr; - - - - -struct jpeg_compress_struct { - struct jpeg_error_mgr * err; struct jpeg_memory_mgr * mem; struct jpeg_progress_mgr * progress; char * client_data; boolean is_decompressor; int global_state; - - - struct jpeg_destination_mgr * dest; - - - - - - - JDIMENSION image_width; - JDIMENSION image_height; - int input_components; - J_COLOR_SPACE in_color_space; - - double input_gamma; -# 294 "jpeglib.h" - int data_precision; - - int num_components; - J_COLOR_SPACE jpeg_color_space; - - jpeg_component_info * comp_info; - - - JQUANT_TBL * quant_tbl_ptrs[4]; - - - JHUFF_TBL * dc_huff_tbl_ptrs[4]; - JHUFF_TBL * ac_huff_tbl_ptrs[4]; - - - UINT8 arith_dc_L[16]; - UINT8 arith_dc_U[16]; - UINT8 arith_ac_K[16]; - - int num_scans; - const jpeg_scan_info * scan_info; - - - - - - boolean raw_data_in; - boolean arith_code; - boolean optimize_coding; - boolean CCIR601_sampling; - int smoothing_factor; - J_DCT_METHOD dct_method; - - - - - - - unsigned int restart_interval; - int restart_in_rows; - - - - boolean write_JFIF_header; - UINT8 JFIF_major_version; - UINT8 JFIF_minor_version; - - - - - UINT8 density_unit; - UINT16 X_density; - UINT16 Y_density; - boolean write_Adobe_marker; - - - - - - - JDIMENSION next_scanline; -# 363 "jpeglib.h" - boolean progressive_mode; - int max_h_samp_factor; - int max_v_samp_factor; - - JDIMENSION total_iMCU_rows; -# 378 "jpeglib.h" - int comps_in_scan; - jpeg_component_info * cur_comp_info[4]; - - - JDIMENSION MCUs_per_row; - JDIMENSION MCU_rows_in_scan; - - int blocks_in_MCU; - int MCU_membership[10]; - - - - int Ss, Se, Ah, Al; - - - - - struct jpeg_comp_master * master; - struct jpeg_c_main_controller * main; - struct jpeg_c_prep_controller * prep; - struct jpeg_c_coef_controller * coef; - struct jpeg_marker_writer * marker; - struct jpeg_color_converter * cconvert; - struct jpeg_downsampler * downsample; - struct jpeg_forward_dct * fdct; - struct jpeg_entropy_encoder * entropy; - jpeg_scan_info * script_space; - int script_space_size; -}; - - - - -struct jpeg_decompress_struct { - struct jpeg_error_mgr * err; struct jpeg_memory_mgr * mem; struct jpeg_progress_mgr * progress; char * client_data; boolean is_decompressor; int global_state; - - - struct jpeg_source_mgr * src; - - - - - JDIMENSION image_width; - JDIMENSION image_height; - int num_components; - J_COLOR_SPACE jpeg_color_space; - - - - - - - J_COLOR_SPACE out_color_space; - - unsigned int scale_num, scale_denom; - - double output_gamma; - - boolean buffered_image; - boolean raw_data_out; - - J_DCT_METHOD dct_method; - boolean do_fancy_upsampling; - boolean do_block_smoothing; - - boolean quantize_colors; - - J_DITHER_MODE dither_mode; - boolean two_pass_quantize; - int desired_number_of_colors; - - boolean enable_1pass_quant; - boolean enable_external_quant; - boolean enable_2pass_quant; - - - - - - - - JDIMENSION output_width; - JDIMENSION output_height; - int out_color_components; - int output_components; - - - - int rec_outbuf_height; -# 478 "jpeglib.h" - int actual_number_of_colors; - JSAMPARRAY colormap; -# 489 "jpeglib.h" - JDIMENSION output_scanline; - - - - - int input_scan_number; - JDIMENSION input_iMCU_row; - - - - - - int output_scan_number; - JDIMENSION output_iMCU_row; -# 511 "jpeglib.h" - int (*coef_bits)[64]; -# 522 "jpeglib.h" - JQUANT_TBL * quant_tbl_ptrs[4]; - - - JHUFF_TBL * dc_huff_tbl_ptrs[4]; - JHUFF_TBL * ac_huff_tbl_ptrs[4]; - - - - - - - int data_precision; - - jpeg_component_info * comp_info; - - - boolean progressive_mode; - boolean arith_code; - - UINT8 arith_dc_L[16]; - UINT8 arith_dc_U[16]; - UINT8 arith_ac_K[16]; - - unsigned int restart_interval; - - - - - boolean saw_JFIF_marker; - - UINT8 JFIF_major_version; - UINT8 JFIF_minor_version; - UINT8 density_unit; - UINT16 X_density; - UINT16 Y_density; - boolean saw_Adobe_marker; - UINT8 Adobe_transform; - - boolean CCIR601_sampling; - - - - - - jpeg_saved_marker_ptr marker_list; -# 575 "jpeglib.h" - int max_h_samp_factor; - int max_v_samp_factor; - - int min_DCT_scaled_size; - - JDIMENSION total_iMCU_rows; -# 589 "jpeglib.h" - JSAMPLE * sample_range_limit; - - - - - - - int comps_in_scan; - jpeg_component_info * cur_comp_info[4]; - - - JDIMENSION MCUs_per_row; - JDIMENSION MCU_rows_in_scan; - - int blocks_in_MCU; - int MCU_membership[10]; - - - - int Ss, Se, Ah, Al; - - - - - - int unread_marker; - - - - - struct jpeg_decomp_master * master; - struct jpeg_d_main_controller * main; - struct jpeg_d_coef_controller * coef; - struct jpeg_d_post_controller * post; - struct jpeg_input_controller * inputctl; - struct jpeg_marker_reader * marker; - struct jpeg_entropy_decoder * entropy; - struct jpeg_inverse_dct * idct; - struct jpeg_upsampler * upsample; - struct jpeg_color_deconverter * cconvert; - struct jpeg_color_quantizer * cquantize; -}; -# 643 "jpeglib.h" -struct jpeg_error_mgr { - - char (*error_exit) (j_common_ptr cinfo); - - char (*emit_message) (j_common_ptr cinfo, int msg_level); - - char (*output_message) (j_common_ptr cinfo); - - char (*format_message) (j_common_ptr cinfo, char * buffer); - - - char (*reset_error_mgr) (j_common_ptr cinfo); - - - - - int msg_code; - - union { - int i[8]; - char s[80]; - } msg_parm; - - - - int trace_level; - - - - - - - - long num_warnings; -# 688 "jpeglib.h" - const char * const * jpeg_message_table; - int last_jpeg_message; - - - - const char * const * addon_message_table; - int first_addon_message; - int last_addon_message; -}; - - - - -struct jpeg_progress_mgr { - char (*progress_monitor) (j_common_ptr cinfo); - - long pass_counter; - long pass_limit; - int completed_passes; - int total_passes; -}; - - - - -struct jpeg_destination_mgr { - JOCTET * next_output_byte; - size_t free_in_buffer; - - char (*init_destination) (j_compress_ptr cinfo); - boolean (*empty_output_buffer) (j_compress_ptr cinfo); - char (*term_destination) (j_compress_ptr cinfo); -}; - - - - -struct jpeg_source_mgr { - const JOCTET * next_input_byte; - size_t bytes_in_buffer; - - char (*init_source) (j_decompress_ptr cinfo); - boolean (*fill_input_buffer) (j_decompress_ptr cinfo); - char (*skip_input_data) (j_decompress_ptr cinfo, long num_bytes); - boolean (*resync_to_restart) (j_decompress_ptr cinfo, int desired); - char (*term_source) (j_decompress_ptr cinfo); -}; -# 752 "jpeglib.h" -typedef struct jvirt_sarray_control * jvirt_sarray_ptr; -typedef struct jvirt_barray_control * jvirt_barray_ptr; - - -struct jpeg_memory_mgr { - - char * (*alloc_small) (j_common_ptr cinfo, int pool_id, size_t sizeofobject) - ; - char * (*alloc_large) (j_common_ptr cinfo, int pool_id, size_t sizeofobject) - ; - JSAMPARRAY (*alloc_sarray) (j_common_ptr cinfo, int pool_id, JDIMENSION samplesperrow, JDIMENSION numrows) - - ; - JBLOCKARRAY (*alloc_barray) (j_common_ptr cinfo, int pool_id, JDIMENSION blocksperrow, JDIMENSION numrows) - - ; - jvirt_sarray_ptr (*request_virt_sarray) (j_common_ptr cinfo, int pool_id, boolean pre_zero, JDIMENSION samplesperrow, JDIMENSION numrows, JDIMENSION maxaccess) - - - - - ; - jvirt_barray_ptr (*request_virt_barray) (j_common_ptr cinfo, int pool_id, boolean pre_zero, JDIMENSION blocksperrow, JDIMENSION numrows, JDIMENSION maxaccess) - - - - - ; - char (*realize_virt_arrays) (j_common_ptr cinfo); - JSAMPARRAY (*access_virt_sarray) (j_common_ptr cinfo, jvirt_sarray_ptr ptr, JDIMENSION start_row, JDIMENSION num_rows, boolean writable) - - - - ; - JBLOCKARRAY (*access_virt_barray) (j_common_ptr cinfo, jvirt_barray_ptr ptr, JDIMENSION start_row, JDIMENSION num_rows, boolean writable) - - - - ; - char (*free_pool) (j_common_ptr cinfo, int pool_id); - char (*self_destruct) (j_common_ptr cinfo); - - - - - - - long max_memory_to_use; - - - long max_alloc_chunk; -}; - - - - - -typedef boolean (*jpeg_marker_parser_method) (j_decompress_ptr cinfo); -# 884 "jpeglib.h" -extern struct jpeg_error_mgr * jpeg_std_error - (struct jpeg_error_mgr * err); -# 900 "jpeglib.h" -extern char jpeg_CreateCompress (j_compress_ptr cinfo, int version, size_t structsize) - ; -extern char jpeg_CreateDecompress (j_decompress_ptr cinfo, int version, size_t structsize) - ; - -extern char jpeg_destroy_compress (j_compress_ptr cinfo); -extern char jpeg_destroy_decompress (j_decompress_ptr cinfo); - - - -extern char jpeg_stdio_dest (j_compress_ptr cinfo, FILE * outfile); -extern char jpeg_stdio_src (j_decompress_ptr cinfo, FILE * infile); - - -extern char jpeg_set_defaults (j_compress_ptr cinfo); - -extern char jpeg_set_colorspace (j_compress_ptr cinfo, J_COLOR_SPACE colorspace) - ; -extern char jpeg_default_colorspace (j_compress_ptr cinfo); -extern char jpeg_set_quality (j_compress_ptr cinfo, int quality, boolean force_baseline) - ; -extern char jpeg_set_linear_quality (j_compress_ptr cinfo, int scale_factor, boolean force_baseline) - - ; -extern char jpeg_add_quant_table (j_compress_ptr cinfo, int which_tbl, const unsigned int *basic_table, int scale_factor, boolean force_baseline) - - - ; -extern int jpeg_quality_scaling (int quality); -extern char jpeg_simple_progression (j_compress_ptr cinfo); -extern char jpeg_suppress_tables (j_compress_ptr cinfo, boolean suppress) - ; -extern JQUANT_TBL * jpeg_alloc_quant_table (j_common_ptr cinfo); -extern JHUFF_TBL * jpeg_alloc_huff_table (j_common_ptr cinfo); - - -extern char jpeg_start_compress (j_compress_ptr cinfo, boolean write_all_tables) - ; -extern JDIMENSION jpeg_write_scanlines (j_compress_ptr cinfo, JSAMPARRAY scanlines, JDIMENSION num_lines) - - ; -extern char jpeg_finish_compress (j_compress_ptr cinfo); - - -extern JDIMENSION jpeg_write_raw_data (j_compress_ptr cinfo, JSAMPIMAGE data, JDIMENSION num_lines) - - ; - - -extern char jpeg_write_marker - (j_compress_ptr cinfo, int marker, const JOCTET * dataptr, unsigned int datalen) - ; - -extern char jpeg_write_m_header - (j_compress_ptr cinfo, int marker, unsigned int datalen); -extern char jpeg_write_m_byte - (j_compress_ptr cinfo, int val); - - -extern char jpeg_write_tables (j_compress_ptr cinfo); - - -extern int jpeg_read_header (j_decompress_ptr cinfo, boolean require_image) - ; -# 975 "jpeglib.h" -extern boolean jpeg_start_decompress (j_decompress_ptr cinfo); -extern JDIMENSION jpeg_read_scanlines (j_decompress_ptr cinfo, JSAMPARRAY scanlines, JDIMENSION max_lines) - - ; -extern boolean jpeg_finish_decompress (j_decompress_ptr cinfo); - - -extern JDIMENSION jpeg_read_raw_data (j_decompress_ptr cinfo, JSAMPIMAGE data, JDIMENSION max_lines) - - ; - - -extern boolean jpeg_has_multiple_scans (j_decompress_ptr cinfo); -extern boolean jpeg_start_output (j_decompress_ptr cinfo, int scan_number) - ; -extern boolean jpeg_finish_output (j_decompress_ptr cinfo); -extern boolean jpeg_input_complete (j_decompress_ptr cinfo); -extern char jpeg_new_colormap (j_decompress_ptr cinfo); -extern int jpeg_consume_input (j_decompress_ptr cinfo); -# 1002 "jpeglib.h" -extern char jpeg_calc_output_dimensions (j_decompress_ptr cinfo); - - -extern char jpeg_save_markers - (j_decompress_ptr cinfo, int marker_code, unsigned int length_limit) - ; - - -extern char jpeg_set_marker_processor - (j_decompress_ptr cinfo, int marker_code, jpeg_marker_parser_method routine) - ; - - -extern jvirt_barray_ptr * jpeg_read_coefficients (j_decompress_ptr cinfo); -extern char jpeg_write_coefficients (j_compress_ptr cinfo, jvirt_barray_ptr * coef_arrays) - ; -extern char jpeg_copy_critical_parameters (j_decompress_ptr srcinfo, j_compress_ptr dstinfo) - ; - - - - - - - -extern char jpeg_abort_compress (j_compress_ptr cinfo); -extern char jpeg_abort_decompress (j_decompress_ptr cinfo); - - - - -extern char jpeg_abort (j_common_ptr cinfo); -extern char jpeg_destroy (j_common_ptr cinfo); - - -extern boolean jpeg_resync_to_restart (j_decompress_ptr cinfo, int desired) - ; -# 16 "cdjpeg.h" 2 -# 1 "jerror.h" 1 -# 33 "jerror.h" -typedef enum { - - - - - -JMSG_NOMESSAGE , - - -JERR_ARITH_NOTIMPL , - -JERR_BAD_ALIGN_TYPE , -JERR_BAD_ALLOC_CHUNK , -JERR_BAD_BUFFER_MODE , -JERR_BAD_COMPONENT_ID , -JERR_BAD_DCT_COEF , -JERR_BAD_DCTSIZE , -JERR_BAD_HUFF_TABLE , -JERR_BAD_IN_COLORSPACE , -JERR_BAD_J_COLORSPACE , -JERR_BAD_LENGTH , -JERR_BAD_LIB_VERSION , - -JERR_BAD_MCU_SIZE , -JERR_BAD_POOL_ID , -JERR_BAD_PRECISION , -JERR_BAD_PROGRESSION , - -JERR_BAD_PROG_SCRIPT , - -JERR_BAD_SAMPLING , -JERR_BAD_SCAN_SCRIPT , -JERR_BAD_STATE , -JERR_BAD_STRUCT_SIZE , - -JERR_BAD_VIRTUAL_ACCESS , -JERR_BUFFER_SIZE , -JERR_CANT_SUSPEND , -JERR_CCIR601_NOTIMPL , -JERR_COMPONENT_COUNT , -JERR_CONVERSION_NOTIMPL , -JERR_DAC_INDEX , -JERR_DAC_VALUE , -JERR_DHT_INDEX , -JERR_DQT_INDEX , -JERR_EMPTY_IMAGE , -JERR_EMS_READ , -JERR_EMS_WRITE , -JERR_EOI_EXPECTED , -JERR_FILE_READ , -JERR_FILE_WRITE , -JERR_FRACT_SAMPLE_NOTIMPL , -JERR_HUFF_CLEN_OVERFLOW , -JERR_HUFF_MISSING_CODE , -JERR_IMAGE_TOO_BIG , -JERR_INPUT_EMPTY , -JERR_INPUT_EOF , -JERR_MISMATCHED_QUANT_TABLE , - -JERR_MISSING_DATA , -JERR_MODE_CHANGE , -JERR_NOTIMPL , -JERR_NOT_COMPILED , -JERR_NO_BACKING_STORE , -JERR_NO_HUFF_TABLE , -JERR_NO_IMAGE , -JERR_NO_QUANT_TABLE , -JERR_NO_SOI , -JERR_OUT_OF_MEMORY , -JERR_QUANT_COMPONENTS , - -JERR_QUANT_FEW_COLORS , -JERR_QUANT_MANY_COLORS , -JERR_SOF_DUPLICATE , -JERR_SOF_NO_SOS , -JERR_SOF_UNSUPPORTED , -JERR_SOI_DUPLICATE , -JERR_SOS_NO_SOF , -JERR_TFILE_CREATE , -JERR_TFILE_READ , -JERR_TFILE_SEEK , -JERR_TFILE_WRITE , - -JERR_TOO_LITTLE_DATA , -JERR_UNKNOWN_MARKER , -JERR_VIRTUAL_BUG , -JERR_WIDTH_OVERFLOW , -JERR_XMS_READ , -JERR_XMS_WRITE , -JMSG_COPYRIGHT , -JMSG_VERSION , -JTRC_16BIT_TABLES , - -JTRC_ADOBE , - -JTRC_APP0 , -JTRC_APP14 , -JTRC_DAC , -JTRC_DHT , -JTRC_DQT , -JTRC_DRI , -JTRC_EMS_CLOSE , -JTRC_EMS_OPEN , -JTRC_EOI , -JTRC_HUFFBITS , -JTRC_JFIF , -JTRC_JFIF_BADTHUMBNAILSIZE , - -JTRC_JFIF_EXTENSION , - -JTRC_JFIF_THUMBNAIL , -JTRC_MISC_MARKER , -JTRC_PARMLESS_MARKER , -JTRC_QUANTVALS , -JTRC_QUANT_3_NCOLORS , -JTRC_QUANT_NCOLORS , -JTRC_QUANT_SELECTED , -JTRC_RECOVERY_ACTION , -JTRC_RST , -JTRC_SMOOTH_NOTIMPL , - -JTRC_SOF , -JTRC_SOF_COMPONENT , -JTRC_SOI , -JTRC_SOS , -JTRC_SOS_COMPONENT , -JTRC_SOS_PARAMS , -JTRC_TFILE_CLOSE , -JTRC_TFILE_OPEN , -JTRC_THUMB_JPEG , - -JTRC_THUMB_PALETTE , - -JTRC_THUMB_RGB , - -JTRC_UNKNOWN_IDS , - -JTRC_XMS_CLOSE , -JTRC_XMS_OPEN , -JWRN_ADOBE_XFORM , -JWRN_BOGUS_PROGRESSION , - -JWRN_EXTRANEOUS_DATA , - -JWRN_HIT_MARKER , -JWRN_HUFF_BAD_CODE , -JWRN_JFIF_MAJOR , -JWRN_JPEG_EOF , -JWRN_MUST_RESYNC , - -JWRN_NOT_SEQUENTIAL , -JWRN_TOO_MUCH_DATA , - - - - JMSG_LASTMSGCODE -} J_MESSAGE_CODE; -# 17 "cdjpeg.h" 2 -# 1 "cderror.h" 1 -# 33 "cderror.h" -typedef enum { - - - - - -JMSG_FIRSTADDONCODE=1000 , - - -JERR_BMP_BADCMAP , -JERR_BMP_BADDEPTH , -JERR_BMP_BADHEADER , -JERR_BMP_BADPLANES , -JERR_BMP_COLORSPACE , -JERR_BMP_COMPRESSED , -JERR_BMP_NOT , -JTRC_BMP , -JTRC_BMP_MAPPED , -JTRC_BMP_OS2 , -JTRC_BMP_OS2_MAPPED , - - - -JERR_GIF_BUG , -JERR_GIF_CODESIZE , -JERR_GIF_COLORSPACE , -JERR_GIF_IMAGENOTFOUND , -JERR_GIF_NOT , -JTRC_GIF , -JTRC_GIF_BADVERSION , - -JTRC_GIF_EXTENSION , -JTRC_GIF_NONSQUARE , -JWRN_GIF_BADDATA , -JWRN_GIF_CHAR , -JWRN_GIF_ENDCODE , -JWRN_GIF_NOMOREDATA , - - - -JERR_PPM_COLORSPACE , -JERR_PPM_NONNUMERIC , -JERR_PPM_NOT , -JTRC_PGM , -JTRC_PGM_TEXT , -JTRC_PPM , -JTRC_PPM_TEXT , -# 100 "cderror.h" -JERR_TGA_BADCMAP , -JERR_TGA_BADPARMS , -JERR_TGA_COLORSPACE , -JTRC_TGA , -JTRC_TGA_GRAY , -JTRC_TGA_MAPPED , - - - - -JERR_BAD_CMAP_FILE , - -JERR_TOO_MANY_COLORS , - -JERR_UNGETC_FAILED , - -JERR_UNKNOWN_FORMAT , - - - - -JERR_UNSUPPORTED_FORMAT , - - - - JMSG_LASTADDONCODE -} ADDON_MESSAGE_CODE; -# 18 "cdjpeg.h" 2 - - - - - - -typedef struct cjpeg_source_struct * cjpeg_source_ptr; - -struct cjpeg_source_struct { - char (*start_input) (j_compress_ptr cinfo, cjpeg_source_ptr sinfo) - ; - JDIMENSION (*get_pixel_rows) (j_compress_ptr cinfo, cjpeg_source_ptr sinfo) - ; - char (*finish_input) (j_compress_ptr cinfo, cjpeg_source_ptr sinfo) - ; - - FILE *input_file; - - JSAMPARRAY buffer; - JDIMENSION buffer_height; -}; - - - - - - -typedef struct djpeg_dest_struct * djpeg_dest_ptr; - -struct djpeg_dest_struct { - - - - char (*start_output) (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo) - ; - - char (*put_pixel_rows) (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo, JDIMENSION rows_supplied) - - ; - - char (*finish_output) (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo) - ; - - - FILE * output_file; - - - - - - JSAMPARRAY buffer; - JDIMENSION buffer_height; -}; -# 81 "cdjpeg.h" -struct cdjpeg_progress_mgr { - struct jpeg_progress_mgr pub; - int completed_extra_passes; - int total_extra_passes; - - int percent_done; -}; - -typedef struct cdjpeg_progress_mgr * cd_progress_ptr; -# 119 "cdjpeg.h" -extern cjpeg_source_ptr jinit_read_bmp (j_compress_ptr cinfo); -extern djpeg_dest_ptr jinit_write_bmp (j_decompress_ptr cinfo, boolean is_os2) - ; -extern cjpeg_source_ptr jinit_read_gif (j_compress_ptr cinfo); -extern djpeg_dest_ptr jinit_write_gif (j_decompress_ptr cinfo); -extern cjpeg_source_ptr jinit_read_ppm (j_compress_ptr cinfo); -extern djpeg_dest_ptr jinit_write_ppm (j_decompress_ptr cinfo); -extern cjpeg_source_ptr jinit_read_rle (j_compress_ptr cinfo); -extern djpeg_dest_ptr jinit_write_rle (j_decompress_ptr cinfo); -extern cjpeg_source_ptr jinit_read_targa (j_compress_ptr cinfo); -extern djpeg_dest_ptr jinit_write_targa (j_decompress_ptr cinfo); - - - -extern boolean read_quant_tables (j_compress_ptr cinfo, char * filename, int scale_factor, boolean force_baseline) - ; -extern boolean read_scan_script (j_compress_ptr cinfo, char * filename); -extern boolean set_quant_slots (j_compress_ptr cinfo, char *arg); -extern boolean set_sample_factors (j_compress_ptr cinfo, char *arg); - - - -extern char read_color_map (j_decompress_ptr cinfo, FILE * infile); - - - -extern char enable_signal_catcher (j_common_ptr cinfo); -extern char start_progress_monitor (j_common_ptr cinfo, cd_progress_ptr progress) - ; -extern char end_progress_monitor (j_common_ptr cinfo); -extern boolean keymatch (char * arg, const char * keyword, int minchars); -extern FILE * read_stdin (char); -extern FILE * write_stdout (char); -# 27 "cjpeg.c" 2 -# 1 "jversion.h" 1 -# 28 "cjpeg.c" 2 -# 44 "cjpeg.c" -static const char * const cdjpeg_message_table[] = { -# 1 "cderror.h" 1 -# 39 "cderror.h" -((char *)0) , - - -"Unsupported BMP colormap format" , -"Only 8- and 24-bit BMP files are supported" , -"Invalid BMP file: bad header length" , -"Invalid BMP file: biPlanes not equal to 1" , -"BMP output must be grayscale or RGB" , -"Sorry, compressed BMPs not yet supported" , -"Not a BMP file - does not start with BM" , -"%ux%u 24-bit BMP image" , -"%ux%u 8-bit colormapped BMP image" , -"%ux%u 24-bit OS2 BMP image" , -"%ux%u 8-bit colormapped OS2 BMP image" , - - - -"GIF output got confused" , -"Bogus GIF codesize %d" , -"GIF output must be grayscale or RGB" , -"Too few images in GIF file" , -"Not a GIF file" , -"%ux%ux%d GIF image" , -"Warning: unexpected GIF version number '%c%c%c'" , - -"Ignoring GIF extension block of type 0x%02x" , -"Caution: nonsquare pixels in input" , -"Corrupt data in GIF file" , -"Bogus char 0x%02x in GIF file, ignoring" , -"Premature end of GIF image" , -"Ran out of GIF bits" , - - - -"PPM output must be grayscale or RGB" , -"Nonnumeric data in PPM file" , -"Not a PPM/PGM file" , -"%ux%u PGM image" , -"%ux%u text PGM image" , -"%ux%u PPM image" , -"%ux%u text PPM image" , -# 100 "cderror.h" -"Unsupported Targa colormap format" , -"Invalid or unsupported Targa file" , -"Targa output must be grayscale or RGB" , -"%ux%u RGB Targa image" , -"%ux%u grayscale Targa image" , -"%ux%u colormapped Targa image" , - - - - -"Color map file is invalid or of unsupported format" , - -"Output file format cannot handle %d colormap entries" , - -"ungetc failed" , - -"Unrecognized input file format --- perhaps you need -targa" , - - - - -"Unsupported output file format" , -# 46 "cjpeg.c" 2 - ((char *)0) -}; -# 76 "cjpeg.c" -static boolean is_targa; - - -static cjpeg_source_ptr -select_file_type (j_compress_ptr cinfo, FILE * infile) -{ - int c; - - if (is_targa) { - - return jinit_read_targa(cinfo); - - - - } - - if ((c = (--(infile)->_r < 0 ? __srget_r(_impure_ptr, infile) : (int)(*(infile)->_p++))) == (-1)) - ((cinfo)->err->msg_code = (JERR_INPUT_EMPTY), (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))); - if (ungetc(c, infile) == (-1)) - ((cinfo)->err->msg_code = (JERR_UNGETC_FAILED), (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))); - - switch (c) { - - case 'B': - return jinit_read_bmp(cinfo); - - - case 'G': - return jinit_read_gif(cinfo); - - - case 'P': - return jinit_read_ppm(cinfo); - - - - - - - case 0x00: - return jinit_read_targa(cinfo); - - default: - ((cinfo)->err->msg_code = (JERR_UNKNOWN_FORMAT), (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))); - break; - } - - return ((char *)0); -} -# 136 "cjpeg.c" -static const char * progname; -static char * outfilename; - - -static char -usage (char) - -{ - fprintf((_impure_ptr->_stderr), "usage: %s [switches] ", progname); - - - - fprintf((_impure_ptr->_stderr), "[inputfile]\n"); - - - fprintf((_impure_ptr->_stderr), "Switches (names may be abbreviated):\n"); - fprintf((_impure_ptr->_stderr), " -quality N Compression quality (0..100; 5-95 is useful range)\n"); - fprintf((_impure_ptr->_stderr), " -grayscale Create monochrome JPEG file\n"); - - fprintf((_impure_ptr->_stderr), " -optimize Optimize Huffman table (smaller file, but slow compression)\n"); - - - fprintf((_impure_ptr->_stderr), " -progressive Create progressive JPEG file\n"); - - - fprintf((_impure_ptr->_stderr), " -targa Input file is Targa format (usually not needed)\n"); - - fprintf((_impure_ptr->_stderr), "Switches for advanced users:\n"); - - fprintf((_impure_ptr->_stderr), " -dct int Use integer DCT method%s\n", - (JDCT_ISLOW == JDCT_ISLOW ? " (default)" : "")); - - - fprintf((_impure_ptr->_stderr), " -dct fast Use fast integer DCT (less accurate)%s\n", - (JDCT_ISLOW == JDCT_IFAST ? " (default)" : "")); - - - - - - fprintf((_impure_ptr->_stderr), " -restart N Set restart interval in rows, or in blocks with B\n"); - - fprintf((_impure_ptr->_stderr), " -smooth N Smooth dithered input (N=1..100 is strength)\n"); - - fprintf((_impure_ptr->_stderr), " -maxmemory N Maximum memory to use (in kbytes)\n"); - fprintf((_impure_ptr->_stderr), " -outfile name Specify name for output file\n"); - fprintf((_impure_ptr->_stderr), " -verbose or -debug Emit debug output\n"); - fprintf((_impure_ptr->_stderr), "Switches for wizards:\n"); - - - - fprintf((_impure_ptr->_stderr), " -baseline Force baseline quantization tables\n"); - fprintf((_impure_ptr->_stderr), " -qtables file Use quantization tables given in file\n"); - fprintf((_impure_ptr->_stderr), " -qslots N[,...] Set component quantization tables\n"); - fprintf((_impure_ptr->_stderr), " -sample HxV[,...] Set component sampling factors\n"); - - fprintf((_impure_ptr->_stderr), " -scans file Create multi-scan JPEG per script file\n"); - - exit(1); -} - - -static int -parse_switches (j_compress_ptr cinfo, int argc, char **argv, - int last_file_arg_seen, boolean for_real) -# 209 "cjpeg.c" -{ - int argn; - char * arg; - int quality; - int q_scale_factor; - boolean force_baseline; - boolean simple_progressive; - char * qtablefile = ((char *)0); - char * qslotsarg = ((char *)0); - char * samplearg = ((char *)0); - char * scansarg = ((char *)0); - - - - - - quality = 75; - q_scale_factor = 100; - force_baseline = 0; - simple_progressive = 0; - is_targa = 0; - outfilename = ((char *)0); - cinfo->err->trace_level = 0; - - - - for (argn = 1; argn < argc; argn++) { - arg = argv[argn]; - if (*arg != '-') { - - if (argn <= last_file_arg_seen) { - outfilename = ((char *)0); - continue; - } - break; - } - arg++; - - if (keymatch(arg, "arithmetic", 1)) { - - - - - fprintf((_impure_ptr->_stderr), "%s: sorry, arithmetic coding not supported\n", - progname); - exit(1); - - - } else if (keymatch(arg, "baseline", 1)) { - - force_baseline = 1; - - } else if (keymatch(arg, "dct", 2)) { - - if (++argn >= argc) - usage(); - if (keymatch(argv[argn], "int", 1)) { - cinfo->dct_method = JDCT_ISLOW; - } else if (keymatch(argv[argn], "fast", 2)) { - cinfo->dct_method = JDCT_IFAST; - } else if (keymatch(argv[argn], "float", 2)) { - cinfo->dct_method = JDCT_FLOAT; - } else - usage(); - - } else if (keymatch(arg, "debug", 1) || keymatch(arg, "verbose", 1)) { - - - static boolean printed_version = 0; - - if (! printed_version) { - fprintf((_impure_ptr->_stderr), "Independent JPEG Group's CJPEG, version %s\n%s\n", - "6b 27-Mar-1998", "Copyright (C) 1998, Thomas G. Lane"); - printed_version = 1; - } - cinfo->err->trace_level++; - - } else if (keymatch(arg, "grayscale", 2) || keymatch(arg, "greyscale",2)) { - - jpeg_set_colorspace(cinfo, JCS_GRAYSCALE); - - } else if (keymatch(arg, "maxmemory", 3)) { - - long lval; - char ch = 'x'; - - if (++argn >= argc) - usage(); - if (sscanf(argv[argn], "%ld%c", &lval, &ch) < 1) - usage(); - if (ch == 'm' || ch == 'M') - lval *= 1000L; - cinfo->mem->max_memory_to_use = lval * 1000L; - - } else if (keymatch(arg, "optimize", 1) || keymatch(arg, "optimise", 1)) { - - - cinfo->optimize_coding = 1; - - - - - - - } else if (keymatch(arg, "outfile", 4)) { - - if (++argn >= argc) - usage(); - outfilename = argv[argn]; - - } else if (keymatch(arg, "progressive", 1)) { - - - simple_progressive = 1; - - - - - - - - } else if (keymatch(arg, "quality", 1)) { - - if (++argn >= argc) - usage(); - if (sscanf(argv[argn], "%d", &quality) != 1) - usage(); - - q_scale_factor = jpeg_quality_scaling(quality); - - } else if (keymatch(arg, "qslots", 2)) { - - if (++argn >= argc) - usage(); - qslotsarg = argv[argn]; - - - - - - } else if (keymatch(arg, "qtables", 2)) { - - if (++argn >= argc) - usage(); - qtablefile = argv[argn]; - - - } else if (keymatch(arg, "restart", 1)) { - - long lval; - char ch = 'x'; - - if (++argn >= argc) - usage(); - if (sscanf(argv[argn], "%ld%c", &lval, &ch) < 1) - usage(); - if (lval < 0 || lval > 65535L) - usage(); - if (ch == 'b' || ch == 'B') { - cinfo->restart_interval = (unsigned int) lval; - cinfo->restart_in_rows = 0; - } else { - cinfo->restart_in_rows = (int) lval; - - } - - } else if (keymatch(arg, "sample", 2)) { - - if (++argn >= argc) - usage(); - samplearg = argv[argn]; - - - - - - } else if (keymatch(arg, "scans", 2)) { - - - if (++argn >= argc) - usage(); - scansarg = argv[argn]; - - - - - - - - } else if (keymatch(arg, "smooth", 2)) { - - int val; - - if (++argn >= argc) - usage(); - if (sscanf(argv[argn], "%d", &val) != 1) - usage(); - if (val < 0 || val > 100) - usage(); - cinfo->smoothing_factor = val; - - } else if (keymatch(arg, "targa", 1)) { - - is_targa = 1; - - } else { - usage(); - } - } - - - - if (for_real) { - - - - jpeg_set_quality(cinfo, quality, force_baseline); - - if (qtablefile != ((char *)0)) - if (! read_quant_tables(cinfo, qtablefile, - q_scale_factor, force_baseline)) - usage(); - - if (qslotsarg != ((char *)0)) - if (! set_quant_slots(cinfo, qslotsarg)) - usage(); - - if (samplearg != ((char *)0)) - if (! set_sample_factors(cinfo, samplearg)) - usage(); - - - if (simple_progressive) - jpeg_simple_progression(cinfo); - - - - if (scansarg != ((char *)0)) - if (! read_scan_script(cinfo, scansarg)) - usage(); - - } - - return argn; -} - - - - - - -int -main (int argc, char **argv) -{ - struct jpeg_compress_struct cinfo; - struct jpeg_error_mgr jerr; - - - - int file_index; - cjpeg_source_ptr src_mgr; - FILE * input_file; - FILE * output_file; - JDIMENSION num_scanlines; - - - - - - - progname = argv[0]; - if (progname == ((char *)0) || progname[0] == 0) - progname = "cjpeg"; - - - cinfo.err = jpeg_std_error(&jerr); - jpeg_CreateCompress((&cinfo), 62, (size_t) sizeof(struct jpeg_compress_struct)); - - jerr.addon_message_table = cdjpeg_message_table; - jerr.first_addon_message = JMSG_FIRSTADDONCODE; - jerr.last_addon_message = JMSG_LASTADDONCODE; -# 502 "cjpeg.c" - cinfo.in_color_space = JCS_RGB; - jpeg_set_defaults(&cinfo); - - - - - - - - file_index = parse_switches(&cinfo, argc, argv, 0, 0); -# 531 "cjpeg.c" - if (file_index < argc-1) { - fprintf((_impure_ptr->_stderr), "%s: only one input file\n", progname); - usage(); - } - - - - if (file_index < argc) { - if ((input_file = fopen(argv[file_index], "rb")) == ((char *)0)) { - fprintf((_impure_ptr->_stderr), "%s: can't open %s\n", progname, argv[file_index]); - exit(1); - } - } else { - - input_file = read_stdin(); - } - - - if (outfilename != ((char *)0)) { - if ((output_file = fopen(outfilename, "wb")) == ((char *)0)) { - fprintf((_impure_ptr->_stderr), "%s: can't open %s\n", progname, outfilename); - exit(1); - } - } else { - - output_file = write_stdout(); - } - - - - - - - src_mgr = select_file_type(&cinfo, input_file); - src_mgr->input_file = input_file; - - - (*src_mgr->start_input) (&cinfo, src_mgr); - - - jpeg_default_colorspace(&cinfo); - - - file_index = parse_switches(&cinfo, argc, argv, 0, 1); - - - jpeg_stdio_dest(&cinfo, output_file); - - - jpeg_start_compress(&cinfo, 1); - - - while (cinfo.next_scanline < cinfo.image_height) { - num_scanlines = (*src_mgr->get_pixel_rows) (&cinfo, src_mgr); - (char) jpeg_write_scanlines(&cinfo, src_mgr->buffer, num_scanlines); - } - - - (*src_mgr->finish_input) (&cinfo, src_mgr); - jpeg_finish_compress(&cinfo); - jpeg_destroy_compress(&cinfo); - - - if (input_file != (_impure_ptr->_stdin)) - fclose(input_file); - if (output_file != (_impure_ptr->_stdout)) - fclose(output_file); - - - - - - - exit(jerr.num_warnings ? 2 : 0); - return 0; -} diff --git a/test/monniaux/jpeg-6b/configure b/test/monniaux/jpeg-6b/configure index ce76b557..35c9db5c 100755 --- a/test/monniaux/jpeg-6b/configure +++ b/test/monniaux/jpeg-6b/configure @@ -623,7 +623,7 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then ac_cv_prog_cc_works=yes diff --git a/test/monniaux/jpeg-6b/dm_configure_ccomp.sh b/test/monniaux/jpeg-6b/dm_configure_ccomp.sh deleted file mode 100755 index ef531cb4..00000000 --- a/test/monniaux/jpeg-6b/dm_configure_ccomp.sh +++ /dev/null @@ -1 +0,0 @@ -CC=./ccomp.sh CFLAGS="-DNO_DOUBLE -DNO_32BIT_DIVISION -DNO_FLOAT -DNO_SWITCH -DTAIL_CALL_MISSING" ./configure diff --git a/test/monniaux/jpeg-6b/jcapimin.c b/test/monniaux/jpeg-6b/jcapimin.c index 39cd76ab..038797e0 100644 --- a/test/monniaux/jpeg-6b/jcapimin.c +++ b/test/monniaux/jpeg-6b/jcapimin.c @@ -73,7 +73,7 @@ jpeg_CreateCompress (j_compress_ptr cinfo, int version, size_t structsize) cinfo->script_space = NULL; -#ifndef NO_DOUBLE +#ifdef HAVE_FLOAT cinfo->input_gamma = 1.0; /* in case application forgets */ #endif @@ -222,20 +222,14 @@ jpeg_write_m_header (j_compress_ptr cinfo, int marker, unsigned int datalen) ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); (*cinfo->marker->write_marker_header) (cinfo, marker, datalen); -#ifdef TAIL_CALL_MISSING - datalen += 1; - datalen -= 1; -#endif + KILL_TAIL_CALL(); } GLOBAL(void) jpeg_write_m_byte (j_compress_ptr cinfo, int val) { (*cinfo->marker->write_marker_byte) (cinfo, val); -#ifdef TAIL_CALL_MISSING - val += 1; - val -= 1; -#endif + KILL_TAIL_CALL(); } @@ -287,7 +281,5 @@ jpeg_write_tables (j_compress_ptr cinfo) * An app that prefers the old behavior can call jpeg_abort for itself after * each call to jpeg_write_tables(). */ -#ifdef TAIL_CALL_MISSING - int dummy = 1; -#endif + KILL_TAIL_CALL(); } diff --git a/test/monniaux/jpeg-6b/jccoefct.c b/test/monniaux/jpeg-6b/jccoefct.c index a7e7e6bd..e2f19130 100644 --- a/test/monniaux/jpeg-6b/jccoefct.c +++ b/test/monniaux/jpeg-6b/jccoefct.c @@ -126,9 +126,7 @@ start_pass_coef (j_compress_ptr cinfo, J_BUF_MODE pass_mode) ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); break; } -#ifdef TAIL_CALL_MISSING - int dummy=1; -#endif + KILL_TAIL_CALL(); } @@ -268,13 +266,13 @@ compress_first_pass (j_compress_ptr cinfo, JSAMPIMAGE input_buf) block_rows = compptr->v_samp_factor; else { /* NB: can't use last_row_height here, since may not be set! */ - block_rows = (int) DIVISION(compptr->height_in_blocks, compptr->v_samp_factor); + block_rows = (int) (compptr->height_in_blocks % compptr->v_samp_factor); if (block_rows == 0) block_rows = compptr->v_samp_factor; } blocks_across = compptr->width_in_blocks; h_samp_factor = compptr->h_samp_factor; /* Count number of dummy blocks to be added at the right margin. */ - ndummy = (int) DIVISION(blocks_across, h_samp_factor); + ndummy = (int) (blocks_across % h_samp_factor); if (ndummy > 0) ndummy = h_samp_factor - ndummy; /* Perform DCT for all non-dummy blocks in this iMCU row. Each call @@ -303,7 +301,7 @@ compress_first_pass (j_compress_ptr cinfo, JSAMPIMAGE input_buf) */ if (coef->iMCU_row_num == last_iMCU_row) { blocks_across += ndummy; /* include lower right corner */ - MCUs_across = DIVISION(blocks_across, h_samp_factor); + MCUs_across = blocks_across / h_samp_factor; for (block_row = block_rows; block_row < compptr->v_samp_factor; block_row++) { thisblockrow = buffer[block_row]; diff --git a/test/monniaux/jpeg-6b/jccolor.c b/test/monniaux/jpeg-6b/jccolor.c index b3e6055b..edc9f831 100644 --- a/test/monniaux/jpeg-6b/jccolor.c +++ b/test/monniaux/jpeg-6b/jccolor.c @@ -456,7 +456,5 @@ jinit_color_converter (j_compress_ptr cinfo) cconvert->pub.color_convert = null_convert; break; } -#ifdef TAIL_CALL_MISSING - int dummy=1; -#endif + KILL_TAIL_CALL(); } diff --git a/test/monniaux/jpeg-6b/jcdctmgr.c b/test/monniaux/jpeg-6b/jcdctmgr.c index 658a674e..61fa79b9 100644 --- a/test/monniaux/jpeg-6b/jcdctmgr.c +++ b/test/monniaux/jpeg-6b/jcdctmgr.c @@ -243,14 +243,10 @@ forward_DCT (j_compress_ptr cinfo, jpeg_component_info * compptr, * for a < b to discover whether a/b is 0. * If your machine's division is fast enough, define FAST_DIVIDE. */ -#ifdef NO_32BIT_DIVISION -#define DIVIDE_BY(a,b) a = (long long) a / b -#else #ifdef FAST_DIVIDE #define DIVIDE_BY(a,b) a /= b #else #define DIVIDE_BY(a,b) if (a >= b) a /= b; else a = 0 -#endif #endif if (temp < 0) { temp = -temp; diff --git a/test/monniaux/jpeg-6b/jchuff.c b/test/monniaux/jpeg-6b/jchuff.c index 4a2d0da2..f2352505 100644 --- a/test/monniaux/jpeg-6b/jchuff.c +++ b/test/monniaux/jpeg-6b/jchuff.c @@ -95,6 +95,7 @@ METHODDEF(boolean) encode_mcu_gather JPP((j_compress_ptr cinfo, METHODDEF(void) finish_pass_gather JPP((j_compress_ptr cinfo)); #endif + /* * Initialize for a Huffman-compressed scan. * If gather_statistics is TRUE, we do not output anything during the scan, @@ -262,6 +263,7 @@ jpeg_make_c_derived_tbl (j_compress_ptr cinfo, boolean isDC, int tblno, } } + /* Outputting bytes to the file */ /* Emit a byte, taking 'action' if must suspend. */ @@ -440,6 +442,7 @@ encode_one_block (working_state * state, JCOEFPTR block, int last_dc_val, return TRUE; } + /* * Emit a restart marker & resynchronize predictions. */ @@ -548,6 +551,7 @@ finish_pass_huff (j_compress_ptr cinfo) ASSIGN_STATE(entropy->saved, state.cur); } + /* * Huffman coding optimization. * @@ -561,6 +565,7 @@ finish_pass_huff (j_compress_ptr cinfo) #ifdef ENTROPY_OPT_SUPPORTED + /* Process a single block's worth of coefficients */ LOCAL(void) @@ -630,12 +635,12 @@ htest_one_block (j_compress_ptr cinfo, JCOEFPTR block, int last_dc_val, ac_counts[0]++; } + /* * Trial-encode one MCU's worth of Huffman-compressed coefficients. * No data is actually output, so no suspension return is possible. */ - METHODDEF(boolean) encode_mcu_gather (j_compress_ptr cinfo, JBLOCKROW *MCU_data) { @@ -892,7 +897,8 @@ jinit_huff_encoder (j_compress_ptr cinfo) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(huff_entropy_encoder)); cinfo->entropy = (struct jpeg_entropy_encoder *) entropy; - ASSIGN_FUNPTR(entropy->pub.start_pass, start_pass_huff); + entropy->pub.start_pass = start_pass_huff; + /* Mark tables unallocated */ for (i = 0; i < NUM_HUFF_TBLS; i++) { entropy->dc_derived_tbls[i] = entropy->ac_derived_tbls[i] = NULL; diff --git a/test/monniaux/jpeg-6b/jcinit.c b/test/monniaux/jpeg-6b/jcinit.c index adbccb3f..578fbe81 100644 --- a/test/monniaux/jpeg-6b/jcinit.c +++ b/test/monniaux/jpeg-6b/jcinit.c @@ -69,7 +69,5 @@ jinit_compress_master (j_compress_ptr cinfo) * This lets application insert special markers after the SOI. */ (*cinfo->marker->write_file_header) (cinfo); -#ifdef TAIL_CALL_MISSING - int dummy=1; -#endif + KILL_TAIL_CALL(); } diff --git a/test/monniaux/jpeg-6b/jcmainct.c b/test/monniaux/jpeg-6b/jcmainct.c index 9f822dd7..6ae91018 100644 --- a/test/monniaux/jpeg-6b/jcmainct.c +++ b/test/monniaux/jpeg-6b/jcmainct.c @@ -100,9 +100,7 @@ start_pass_main (j_compress_ptr cinfo, J_BUF_MODE pass_mode) ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); break; } -#ifdef TAIL_CALL_MISSING - int dummy=1; -#endif + KILL_TAIL_CALL(); } @@ -293,7 +291,5 @@ jinit_c_main_controller (j_compress_ptr cinfo, boolean need_full_buffer) (JDIMENSION) (compptr->v_samp_factor * DCTSIZE)); } } -#ifdef TAIL_CALL_MISSING - int dummy=1; -#endif + KILL_TAIL_CALL(); } diff --git a/test/monniaux/jpeg-6b/jcmarker.c b/test/monniaux/jpeg-6b/jcmarker.c index 91293ec7..ed98ef9f 100644 --- a/test/monniaux/jpeg-6b/jcmarker.c +++ b/test/monniaux/jpeg-6b/jcmarker.c @@ -115,9 +115,7 @@ emit_byte (j_compress_ptr cinfo, int val) if (! (*dest->empty_output_buffer) (cinfo)) ERREXIT(cinfo, JERR_CANT_SUSPEND); } -#ifdef TAIL_CALL_MISSING - int dummy=1; -#endif + KILL_TAIL_CALL(); } diff --git a/test/monniaux/jpeg-6b/jcmaster.c b/test/monniaux/jpeg-6b/jcmaster.c index 27a28054..fd136535 100644 --- a/test/monniaux/jpeg-6b/jcmaster.c +++ b/test/monniaux/jpeg-6b/jcmaster.c @@ -330,7 +330,7 @@ per_scan_setup (j_compress_ptr cinfo) /* For noninterleaved scans, it is convenient to define last_row_height * as the number of block rows present in the last iMCU row. */ - tmp = (int) (MODULO(compptr->height_in_blocks,compptr->v_samp_factor)); + tmp = (int) INT_UMOD(compptr->height_in_blocks, compptr->v_samp_factor); if (tmp == 0) tmp = compptr->v_samp_factor; compptr->last_row_height = tmp; @@ -363,10 +363,10 @@ per_scan_setup (j_compress_ptr cinfo) compptr->MCU_blocks = compptr->MCU_width * compptr->MCU_height; compptr->MCU_sample_width = compptr->MCU_width * DCTSIZE; /* Figure number of non-dummy blocks in last MCU column & row */ - tmp = (int) (MODULO(compptr->width_in_blocks, compptr->MCU_width)); + tmp = (int) INT_UMOD(compptr->width_in_blocks, compptr->MCU_width); if (tmp == 0) tmp = compptr->MCU_width; compptr->last_col_width = tmp; - tmp = (int) MODULO(compptr->height_in_blocks, compptr->MCU_height); + tmp = (int) INT_UMOD(compptr->height_in_blocks, compptr->MCU_height); if (tmp == 0) tmp = compptr->MCU_height; compptr->last_row_height = tmp; /* Prepare array describing MCU composition */ @@ -492,9 +492,7 @@ pass_startup (j_compress_ptr cinfo) (*cinfo->marker->write_frame_header) (cinfo); (*cinfo->marker->write_scan_header) (cinfo); -#ifdef TAIL_CALL_MISSING - int dummy=1; -#endif + KILL_TAIL_CALL(); } diff --git a/test/monniaux/jpeg-6b/jconfig.h b/test/monniaux/jpeg-6b/jconfig.h index 1b30a525..56345384 100644 --- a/test/monniaux/jpeg-6b/jconfig.h +++ b/test/monniaux/jpeg-6b/jconfig.h @@ -1,45 +1,162 @@ -/* jconfig.h. Generated automatically by configure. */ -/* jconfig.cfg --- source file edited by configure script */ -/* see jconfig.doc for explanations */ - -#define HAVE_PROTOTYPES -#define HAVE_UNSIGNED_CHAR -#define HAVE_UNSIGNED_SHORT -/* wtf #define void char */ -#undef const +/* + * jconfig.doc + * + * Copyright (C) 1991-1994, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file documents the configuration options that are required to + * customize the JPEG software for a particular system. + * + * The actual configuration options for a particular installation are stored + * in jconfig.h. On many machines, jconfig.h can be generated automatically + * or copied from one of the "canned" jconfig files that we supply. But if + * you need to generate a jconfig.h file by hand, this file tells you how. + * + * DO NOT EDIT THIS FILE --- IT WON'T ACCOMPLISH ANYTHING. + * EDIT A COPY NAMED JCONFIG.H. + */ + + +/* + * These symbols indicate the properties of your machine or compiler. + * #define the symbol if yes, #undef it if no. + */ + +/* Does your compiler support function prototypes? + * (If not, you also need to use ansi2knr, see install.doc) + */ +#define HAVE_PROTOTYPES + +extern long long __compcert_i64_sdiv(long long a, long long b); +extern unsigned __compcert_i32_umod(unsigned a, unsigned b); + +#define LONG_SDIV(x, y) __compcert_i64_sdiv(x, y) +#define INT_UMOD(x, y) __compcert_i32_umod(x, y) +#define KILL_TAIL_CALL() { int x=1; } + +/* Does your compiler support the declaration "unsigned char" ? + * How about "unsigned short" ? + */ +#define HAVE_UNSIGNED_CHAR +#define HAVE_UNSIGNED_SHORT + +/* Define "void" as "char" if your compiler doesn't know about type void. + * NOTE: be sure to define void such that "void *" represents the most general + * pointer type, e.g., that returned by malloc(). + */ +/* #define void char */ + +/* Define "const" as empty if your compiler doesn't know the "const" keyword. + */ +/* #define const */ + +/* Define this if an ordinary "char" type is unsigned. + * If you're not sure, leaving it undefined will work at some cost in speed. + * If you defined HAVE_UNSIGNED_CHAR then the speed difference is minimal. + */ #undef CHAR_IS_UNSIGNED -#define HAVE_STDDEF_H -#define HAVE_STDLIB_H + +/* Define this if your system has an ANSI-conforming file. + */ +#define HAVE_STDDEF_H + +/* Define this if your system has an ANSI-conforming file. + */ +#define HAVE_STDLIB_H + +/* Define this if your system does not have an ANSI/SysV , + * but does have a BSD-style . + */ #undef NEED_BSD_STRINGS + +/* Define this if your system does not provide typedef size_t in any of the + * ANSI-standard places (stddef.h, stdlib.h, or stdio.h), but places it in + * instead. + */ #undef NEED_SYS_TYPES_H + +/* For 80x86 machines, you need to define NEED_FAR_POINTERS, + * unless you are using a large-data memory model or 80386 flat-memory mode. + * On less brain-damaged CPUs this symbol must not be defined. + * (Defining this symbol causes large data structures to be referenced through + * "far" pointers and to be allocated with a special version of malloc.) + */ #undef NEED_FAR_POINTERS + +/* Define this if your linker needs global names to be unique in less + * than the first 15 characters. + */ #undef NEED_SHORT_EXTERNAL_NAMES -/* Define this if you get warnings about undefined structures. */ + +/* Although a real ANSI C compiler can deal perfectly well with pointers to + * unspecified structures (see "incomplete types" in the spec), a few pre-ANSI + * and pseudo-ANSI compilers get confused. To keep one of these bozos happy, + * define INCOMPLETE_TYPES_BROKEN. This is not recommended unless you + * actually get "missing structure definition" warnings or errors while + * compiling the JPEG code. + */ #undef INCOMPLETE_TYPES_BROKEN + +/* + * The following options affect code selection within the JPEG library, + * but they don't need to be visible to applications using the library. + * To minimize application namespace pollution, the symbols won't be + * defined unless JPEG_INTERNALS has been defined. + */ + #ifdef JPEG_INTERNALS +/* Define this if your compiler implements ">>" on signed values as a logical + * (unsigned) shift; leave it undefined if ">>" is a signed (arithmetic) shift, + * which is the normal and rational definition. + */ #undef RIGHT_SHIFT_IS_UNSIGNED -#define INLINE __inline__ -/* These are for configuring the JPEG memory manager. */ -#undef DEFAULT_MAX_MEM -#undef NO_MKTEMP + #endif /* JPEG_INTERNALS */ + +/* + * The remaining options do not affect the JPEG library proper, + * but only the sample applications cjpeg/djpeg (see cjpeg.c, djpeg.c). + * Other applications can ignore these. + */ + #ifdef JPEG_CJPEG_DJPEG -#undef BMP_SUPPORTED /* BMP image file format */ -#undef GIF_SUPPORTED /* GIF image file format */ +/* These defines indicate which image (non-JPEG) file formats are allowed. */ + +#define BMP_SUPPORTED /* BMP image file format */ +#define GIF_SUPPORTED /* GIF image file format */ #define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */ #undef RLE_SUPPORTED /* Utah RLE image file format */ -#undef TARGA_SUPPORTED /* Targa image file format */ +#define TARGA_SUPPORTED /* Targa image file format */ +/* Define this if you want to name both input and output files on the command + * line, rather than using stdout and optionally stdin. You MUST do this if + * your system can't cope with binary I/O to stdin/stdout. See comments at + * head of cjpeg.c or djpeg.c. + */ #undef TWO_FILE_COMMANDLINE + +/* Define this if your system needs explicit cleanup of temporary files. + * This is crucial under MS-DOS, where the temporary "files" may be areas + * of extended memory; on most other systems it's not as important. + */ #undef NEED_SIGNAL_CATCHER + +/* By default, we open image files with fopen(...,"rb") or fopen(...,"wb"). + * This is necessary on systems that distinguish text files from binary files, + * and is harmless on most systems that don't. If you have one of the rare + * systems that complains about the "b" spec, define this symbol. + */ #undef DONT_USE_B_MODE -/* Define this if you want percent-done progress reports from cjpeg/djpeg. */ +/* Define this if you want percent-done progress reports from cjpeg/djpeg. + */ #undef PROGRESS_REPORT + #endif /* JPEG_CJPEG_DJPEG */ diff --git a/test/monniaux/jpeg-6b/jcparam.c b/test/monniaux/jpeg-6b/jcparam.c index b6206fd1..2049f055 100644 --- a/test/monniaux/jpeg-6b/jcparam.c +++ b/test/monniaux/jpeg-6b/jcparam.c @@ -46,7 +46,7 @@ jpeg_add_quant_table (j_compress_ptr cinfo, int which_tbl, *qtblptr = jpeg_alloc_quant_table((j_common_ptr) cinfo); for (i = 0; i < DCTSIZE2; i++) { - temp = ((long) basic_table[i] * scale_factor + 50L) / 100L; + temp = LONG_SDIV((long) basic_table[i] * scale_factor + 50L, 100L); /* limit the values to the valid range */ if (temp <= 0L) temp = 1L; if (temp > 32767L) temp = 32767L; /* max quantizer needed for 12 bits */ @@ -120,7 +120,7 @@ jpeg_quality_scaling (int quality) * Qualities 1..50 are converted to scaling percentage 5000/Q. */ if (quality < 50) - quality = DIVISION(5000, quality); + quality = LONG_SDIV(5000, quality); else quality = 200 - quality*2; @@ -380,9 +380,7 @@ jpeg_default_colorspace (j_compress_ptr cinfo) default: ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE); } -#ifdef TAIL_CALL_MISSING - int dummy=1; -#endif + KILL_TAIL_CALL(); } @@ -469,9 +467,7 @@ jpeg_set_colorspace (j_compress_ptr cinfo, J_COLOR_SPACE colorspace) default: ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); } -#ifdef TAIL_CALL_MISSING - int dummy=1; -#endif + KILL_TAIL_CALL(); } diff --git a/test/monniaux/jpeg-6b/jcprepct.c b/test/monniaux/jpeg-6b/jcprepct.c index 85892e21..fa93333d 100644 --- a/test/monniaux/jpeg-6b/jcprepct.c +++ b/test/monniaux/jpeg-6b/jcprepct.c @@ -288,8 +288,8 @@ create_context_buffer (j_compress_ptr cinfo) */ true_buffer = (*cinfo->mem->alloc_sarray) ((j_common_ptr) cinfo, JPOOL_IMAGE, - (JDIMENSION) DIVISION(((long) compptr->width_in_blocks * DCTSIZE * - cinfo->max_h_samp_factor), compptr->h_samp_factor), + (JDIMENSION) (((long) compptr->width_in_blocks * DCTSIZE * + cinfo->max_h_samp_factor) / compptr->h_samp_factor), (JDIMENSION) (3 * rgroup_height)); /* Copy true buffer row pointers into the middle of the fake row array */ MEMCOPY(fake_buffer + rgroup_height, true_buffer, @@ -346,8 +346,8 @@ jinit_c_prep_controller (j_compress_ptr cinfo, boolean need_full_buffer) ci++, compptr++) { prep->color_buf[ci] = (*cinfo->mem->alloc_sarray) ((j_common_ptr) cinfo, JPOOL_IMAGE, - (JDIMENSION) DIVISION(((long) compptr->width_in_blocks * DCTSIZE * - cinfo->max_h_samp_factor), compptr->h_samp_factor), + (JDIMENSION) (((long) compptr->width_in_blocks * DCTSIZE * + cinfo->max_h_samp_factor) / compptr->h_samp_factor), (JDIMENSION) cinfo->max_v_samp_factor); } } diff --git a/test/monniaux/jpeg-6b/jcprepct.i b/test/monniaux/jpeg-6b/jcprepct.i deleted file mode 100644 index c0b55a87..00000000 --- a/test/monniaux/jpeg-6b/jcprepct.i +++ /dev/null @@ -1,3092 +0,0 @@ -# 1 "jcprepct.c" -# 1 "" -# 1 "" -# 1 "jcprepct.c" -# 18 "jcprepct.c" -# 1 "jinclude.h" 1 -# 20 "jinclude.h" -# 1 "jconfig.h" 1 -# 21 "jinclude.h" 2 -# 35 "jinclude.h" -# 1 "/opt/Kalray/usr/local/k1rdtools/lib/gcc/k1-mbr/4.9.4/include/stddef.h" 1 3 4 -# 147 "/opt/Kalray/usr/local/k1rdtools/lib/gcc/k1-mbr/4.9.4/include/stddef.h" 3 4 -typedef long int ptrdiff_t; -# 212 "/opt/Kalray/usr/local/k1rdtools/lib/gcc/k1-mbr/4.9.4/include/stddef.h" 3 4 -typedef unsigned long long size_t; -# 324 "/opt/Kalray/usr/local/k1rdtools/lib/gcc/k1-mbr/4.9.4/include/stddef.h" 3 4 -typedef int wchar_t; -# 36 "jinclude.h" 2 - - - -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdlib.h" 1 3 -# 10 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdlib.h" 3 -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/machine/ieeefp.h" 1 3 -# 11 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdlib.h" 2 3 -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/_ansi.h" 1 3 -# 15 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/_ansi.h" 3 -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/newlib.h" 1 3 -# 16 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/_ansi.h" 2 3 -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/config.h" 1 3 - - - -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/machine/ieeefp.h" 1 3 -# 5 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/config.h" 2 3 -# 17 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/_ansi.h" 2 3 -# 12 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdlib.h" 2 3 - - - -# 1 "/opt/Kalray/usr/local/k1rdtools/lib/gcc/k1-mbr/4.9.4/include/stddef.h" 1 3 4 -# 16 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdlib.h" 2 3 - -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/reent.h" 1 3 -# 13 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/reent.h" 3 -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/_ansi.h" 1 3 -# 14 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/reent.h" 2 3 -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/_types.h" 1 3 -# 12 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/_types.h" 3 -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/machine/_types.h" 1 3 - - - - - - -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/machine/_default_types.h" 1 3 -# 22 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/machine/_default_types.h" 3 -# 1 "/opt/Kalray/usr/local/k1rdtools/lib/gcc/k1-mbr/4.9.4/include-fixed/limits.h" 1 3 4 -# 23 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/machine/_default_types.h" 2 3 - - - -typedef signed char __int8_t ; -typedef unsigned char __uint8_t ; -# 36 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/machine/_default_types.h" 3 -typedef signed short __int16_t; -typedef unsigned short __uint16_t; -# 46 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/machine/_default_types.h" 3 -typedef __int16_t __int_least16_t; -typedef __uint16_t __uint_least16_t; -# 62 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/machine/_default_types.h" 3 -typedef signed int __int32_t; -typedef unsigned int __uint32_t; -# 76 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/machine/_default_types.h" 3 -typedef __int32_t __int_least32_t; -typedef __uint32_t __uint_least32_t; -# 93 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/machine/_default_types.h" 3 -typedef signed long __int64_t; -typedef unsigned long __uint64_t; -# 8 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/machine/_types.h" 2 3 -# 13 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/_types.h" 2 3 -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/lock.h" 1 3 -# 9 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/lock.h" 3 -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/atomic.h" 1 3 -# 12 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/atomic.h" 3 -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/cpu.h" 1 3 -# 13 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/cpu.h" 3 -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/registers.h" 1 3 -# 14 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/cpu.h" 2 3 -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/types.h" 1 3 -# 16 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/types.h" 3 -typedef unsigned char __k1_uchar; - - -typedef unsigned short __k1_ushort; - - -typedef unsigned int __k1_uint; - - -typedef unsigned long __k1_ulong; - - -typedef signed long __k1_long; - - - -typedef unsigned char __k1_uint8_t; - - -typedef signed char __k1_int8_t; - - -typedef unsigned short __k1_uint16_t; - - -typedef signed short __k1_int16_t; - - -typedef unsigned int __k1_uint32_t; - - -typedef signed int __k1_int32_t; - - -typedef unsigned long long __k1_uint64_t; - - -typedef signed long long __k1_int64_t; -# 63 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/types.h" 3 -typedef long __k1_intptr_t; - - -typedef unsigned long __k1_uintptr_t; -# 15 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/cpu.h" 2 3 -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/assert.h" 1 3 -# 11 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/assert.h" 3 -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/common.h" 1 3 -# 12 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/assert.h" 2 3 -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/scall_no.h" 1 3 -# 13 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/assert.h" 2 3 -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/syscall.h" 1 3 -# 9 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/syscall.h" 3 -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdint.h" 1 3 -# 41 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdint.h" 3 -typedef signed char int8_t ; -typedef unsigned char uint8_t ; - - - - -typedef signed char int_least8_t; -typedef unsigned char uint_least8_t; -# 57 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdint.h" 3 -typedef signed short int16_t; -typedef unsigned short uint16_t; -# 67 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdint.h" 3 -typedef int16_t int_least16_t; -typedef uint16_t uint_least16_t; -# 83 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdint.h" 3 -typedef signed int int32_t; -typedef unsigned int uint32_t; -# 97 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdint.h" 3 -typedef int32_t int_least32_t; -typedef uint32_t uint_least32_t; -# 115 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdint.h" 3 -typedef signed long int64_t; -typedef unsigned long uint64_t; -# 129 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdint.h" 3 -typedef int64_t int_least64_t; -typedef uint64_t uint_least64_t; -# 159 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdint.h" 3 - typedef signed int int_fast8_t; - typedef unsigned int uint_fast8_t; - - - - - typedef signed int int_fast16_t; - typedef unsigned int uint_fast16_t; - - - - - typedef signed int int_fast32_t; - typedef unsigned int uint_fast32_t; -# 213 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdint.h" 3 - typedef int_least64_t int_fast64_t; - typedef uint_least64_t uint_fast64_t; - - - - - - - - typedef long int intmax_t; -# 231 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdint.h" 3 - typedef long unsigned int uintmax_t; -# 244 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdint.h" 3 - typedef int64_t intptr_t; - typedef uint64_t uintptr_t; -# 10 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/syscall.h" 2 3 -# 21 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/syscall.h" 3 -extern int __k1_syscall(const uint32_t syscall); -# 38 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/syscall.h" 3 -extern int __k1_syscall_with_args(const uint64_t syscall, uint64_t sc_arg0, uint64_t sc_arg1, - uint64_t sc_arg2, uint64_t sc_arg3, uint64_t sc_arg4, - uint64_t sc_arg5); -# 52 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/syscall.h" 3 -extern int __k1_syscall0(const uint32_t syscall); -# 61 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/syscall.h" 3 -extern int __k1_syscall1(const uint32_t syscall, uint64_t sc_arg0); -# 72 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/syscall.h" 3 -extern int __k1_syscall2(const uint32_t syscall, uint64_t sc_arg0, - uint64_t sc_arg1); -# 85 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/syscall.h" 3 -extern int __k1_syscall3(const uint32_t syscall, uint64_t sc_arg0, uint64_t sc_arg1, - uint64_t sc_arg2); -# 100 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/syscall.h" 3 -extern int __k1_syscall4(const uint32_t syscall, uint64_t sc_arg0, uint64_t sc_arg1, - uint64_t sc_arg2, uint64_t sc_arg3); -# 116 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/syscall.h" 3 -extern int -__k1_syscall5(const uint32_t syscall, uint64_t sc_arg0, uint64_t sc_arg1, - uint64_t sc_arg2, uint64_t sc_arg3, uint64_t sc_arg4); -# 135 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/syscall.h" 3 -extern int __k1_syscall6(const uint32_t syscall, uint64_t sc_arg0, uint64_t sc_arg1, - uint64_t sc_arg2, uint64_t sc_arg3, uint64_t sc_arg4, - uint64_t sc_arg5); -# 14 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/assert.h" 2 3 -# 16 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/cpu.h" 2 3 - - - - - - - -extern unsigned long __bsp_rtl_simu __attribute__ ((weak)); -# 32 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/cpu.h" 3 -extern unsigned long __bsp_core_only __attribute__ ((weak)); - - - - - - -extern char __k1_streaming_enable(char); - - - - - -extern char __k1_streaming_disable(char); - - - - - - extern unsigned int __bsp_frequency; -# 80 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/cpu.h" 3 -extern int __k1_is_rm(char) __attribute__((__const__)); - - - - - - -extern int __k1_get_cpu_id(char) __attribute__((__const__)); - - - - - - -extern int __k1_get_rm_id(char); - - - - - - - -extern __k1_uint32_t __k1_sysreg_get_num(unsigned int n); - - - - - - - -extern char __k1_sysreg_set_num(unsigned int n, __k1_uint32_t i); - - - - - - -extern unsigned int __k1_hw_loop_enabled(char); - - - - - -extern char __k1_hwloops_enable(char); - - - - - -extern char __k1_hwloops_disable(char); - - - - - -enum __k1_fpu_rounding_mode { - _K1_FPU_NEAREST_EVEN = 0, - _K1_FPU_TOWARDS_PLUS_INF = 1, - _K1_FPU_TOWARDS_MINUS_INF = 2, - _K1_FPU_TOWARDS_ZERO = 3 -}; - - - - - -extern char __k1_fpu_set_rounding_mode(enum __k1_fpu_rounding_mode mode); - - - - - -extern enum __k1_fpu_rounding_mode __k1_fpu_get_rounding_mode(char); - - - - - -enum __k1_fpu_exceptions { - _K1_FPU_INVALID_OPERATION = 0x2LL, - _K1_FPU_DIVIDE_BY_ZERO = 0x4LL, - _K1_FPU_OVERFLOW = 0x8LL, - _K1_FPU_UNDERFLOW = 0x10LL, - _K1_FPU_INEXACT = 0x20LL, - _K1_FPU_ALL_EXCEPTS = 0x2LL | 0x4LL | 0x8LL | 0x10LL | 0x20LL -}; - - - - - -extern char __k1_fpu_raise_exceptions(int excepts); - - - - - -extern char __k1_fpu_clear_exceptions(int excepts); - - - - - -extern unsigned int __k1_fpu_get_exceptions(char); -# 13 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/atomic.h" 2 3 -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/cache.h" 1 3 -# 47 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/cache.h" 3 -extern unsigned int __k1_icache_enabled(char); - - - - - -extern char __k1_icache_enable(char); - - - - - -extern char __k1_icache_disable(char); -# 70 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/cache.h" 3 -extern char __k1_icache_invalidate_mem_area(uintptr_t addr, int size); -# 81 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/cache.h" 3 -extern unsigned int __k1_dcache_enabled(char); - - - - - -extern char __k1_dcache_enable(char); - - - - - -extern char __k1_dcache_disable(char); -# 104 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/cache.h" 3 -extern char __k1_dcache_invalidate_mem_area(uintptr_t addr, int size); - - - - - -extern char __k1_l1_coherency_enable(char); - - - - - -extern char __k1_l1_coherency_disable(char); - - - - - -extern char __k1_l2cache_enable(char); - - - - - -extern char __k1_l2cache_disable(char); - - - - - - -extern char __k1_mb(char); - - - - - - -extern char __k1_wmb(char); - - - - - - -char __k1_rmb(char); -# 14 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/atomic.h" 2 3 -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/io.h" 1 3 -# 28 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/io.h" 3 -extern uint8_t __k1_io_read8(char *addr); - - - - - - - -extern uint16_t __k1_io_read16(char *addr); - - - - - - - -extern uint32_t __k1_io_read32(char *addr); - - - - - - - -extern uint64_t __k1_io_read64(char *addr); -# 64 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/io.h" 3 -extern char __k1_io_write8(char *addr, uint8_t val); - - - - - - - -extern char __k1_io_write16(char *addr, uint16_t val); - - - - - - - -extern char __k1_io_write32(char *addr, uint32_t val); - - - - - - - -extern char __k1_io_write64(char *addr, uint64_t val); -# 104 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/io.h" 3 -extern uint32_t __k1_umem_read32(char *addr __attribute__((unused))); - - - - - - - -extern uint64_t __k1_umem_read64(char *addr); - - - - - - - -extern uint8_t __k1_umem_read8(char *addr __attribute__((unused))); - - - - - - - -extern uint16_t __k1_umem_read16(char *addr); -# 140 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/io.h" 3 -extern char __k1_umem_write32(char *addr, uint32_t val); - - - - - - - -extern char __k1_umem_write64(char *addr, uint64_t val); - - - - - - - -extern char __k1_umem_write8(char *addr, uint8_t val); - - - - - - - -extern char __k1_umem_write16(char *addr, uint16_t val); -# 15 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/atomic.h" 2 3 -# 33 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/atomic.h" 3 -extern uint32_t __k1_atomic_swap32(char *addr, uint32_t new_value); - - - - - - - -extern uint64_t __k1_atomic_swap64(char *addr, uint64_t new_value); - - - - - - - -extern int32_t __k1_atomic_add32(char *addr, int32_t value); - - - - - - - -extern int __k1_compare_and_swap32(char *ptr, uint32_t old_value, - uint32_t new_value); -# 73 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/atomic.h" 3 -typedef struct __k1_recursive_lock __k1_recursive_lock_t; - -struct __k1_recursive_lock { - uint32_t owner; - uint32_t counter; -}; -# 94 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/atomic.h" 3 -extern char __k1_recursive_initlock_base(__k1_recursive_lock_t *lock); -# 107 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/atomic.h" 3 -extern int __k1_recursive_trylock_base(__k1_recursive_lock_t *lock, - uint32_t myself); -# 117 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/atomic.h" 3 -extern char __k1_recursive_lock_base(__k1_recursive_lock_t *lock, - uint64_t myself); -# 129 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/atomic.h" 3 -extern int __k1_recursive_unlock_base(__k1_recursive_lock_t *lock, - uint64_t myself); -# 141 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/atomic.h" 3 -extern int __k1_recursive_release_base(__k1_recursive_lock_t *lock, - uint64_t myself); -# 10 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/lock.h" 2 3 -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/cache.h" 1 3 -# 47 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/cache.h" 3 -extern unsigned int __k1_icache_enabled(char); - - - - - -extern char __k1_icache_enable(char); - - - - - -extern char __k1_icache_disable(char); -# 70 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/cache.h" 3 -extern char __k1_icache_invalidate_mem_area(uintptr_t addr, int size); -# 81 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/cache.h" 3 -extern unsigned int __k1_dcache_enabled(char); - - - - - -extern char __k1_dcache_enable(char); - - - - - -extern char __k1_dcache_disable(char); -# 104 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/mppa_bare_runtime/k1c/cache.h" 3 -extern char __k1_dcache_invalidate_mem_area(uintptr_t addr, int size); - - - - - -extern char __k1_l1_coherency_enable(char); - - - - - -extern char __k1_l1_coherency_disable(char); - - - - - -extern char __k1_l2cache_enable(char); - - - - - -extern char __k1_l2cache_disable(char); - - - - - - -extern char __k1_mb(char); - - - - - - -extern char __k1_wmb(char); - - - - - - -char __k1_rmb(char); -# 11 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/lock.h" 2 3 - - - - -typedef struct __libc_lock_recursive_s -{ - __k1_recursive_lock_t lock; -} __libc_lock_recursive_t __attribute__ ((aligned (((64*8)/8)))); - -typedef struct __libc_lock_recursive_s __libc_lock_t; - - - - - - -int __libc_lock_init_recursive(__libc_lock_recursive_t *lock); -int __libc_lock_close_recursive(__libc_lock_recursive_t *lock); -int __libc_lock_acquire_recursive(__libc_lock_recursive_t *lock); -int __libc_lock_try_acquire_recursive(__libc_lock_recursive_t *lock); -int __libc_lock_release_recursive(__libc_lock_recursive_t *lock); -# 42 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/lock.h" 3 -typedef __libc_lock_t _LOCK_T __attribute__ ((aligned (((64*8)/8)))); -typedef __libc_lock_recursive_t _LOCK_RECURSIVE_T __attribute__ ((aligned (((64*8)/8)))); -# 14 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/_types.h" 2 3 - - -typedef long _off_t; - - - - - - - -typedef short __dev_t; - - - - -typedef unsigned short __uid_t; - - -typedef unsigned short __gid_t; - - - -__extension__ typedef long long _off64_t; - - - - - - - -typedef long _fpos_t; -# 56 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/_types.h" 3 -typedef int _ssize_t; - - - - - - -# 1 "/opt/Kalray/usr/local/k1rdtools/lib/gcc/k1-mbr/4.9.4/include/stddef.h" 1 3 4 -# 353 "/opt/Kalray/usr/local/k1rdtools/lib/gcc/k1-mbr/4.9.4/include/stddef.h" 3 4 -typedef unsigned int wint_t; -# 64 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/_types.h" 2 3 - - - -typedef struct -{ - int __count; - union - { - wint_t __wch; - unsigned char __wchb[4]; - } __value; -} _mbstate_t; - - - -typedef _LOCK_RECURSIVE_T _flock_t; - - - - -typedef char *_iconv_t; -# 15 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/reent.h" 2 3 -# 24 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/reent.h" 3 -typedef unsigned int __ULong; -# 37 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/reent.h" 3 -struct _reent; - - - - - - -struct _Bigint -{ - struct _Bigint *_next; - int _k, _maxwds, _sign, _wds; - __ULong _x[1]; -}; - - -struct __tm -{ - int __tm_sec; - int __tm_min; - int __tm_hour; - int __tm_mday; - int __tm_mon; - int __tm_year; - int __tm_wday; - int __tm_yday; - int __tm_isdst; -}; - - - - - - - -struct _on_exit_args { - char * _fnargs[32]; - char * _dso_handle[32]; - - __ULong _fntypes; - - - __ULong _is_cxa; -}; -# 89 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/reent.h" 3 -struct _atexit { - struct _atexit *_next; - int _ind; - - char (*_fns[32])(char); - struct _on_exit_args _on_exit_args; -}; -# 105 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/reent.h" 3 -struct __sbuf { - unsigned char *_base; - int _size; -}; -# 169 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/reent.h" 3 -struct __sFILE { - unsigned char *_p; - int _r; - int _w; - short _flags; - short _file; - struct __sbuf _bf; - int _lbfsize; - - - - - - - char * _cookie; - - int (* _read) (struct _reent *, char *, char *, int) - ; - int (* _write) (struct _reent *, char *, const char *, int) - ; - _fpos_t (* _seek) (struct _reent *, char *, _fpos_t, int); - int (* _close) (struct _reent *, char *); - - - struct __sbuf _ub; - unsigned char *_up; - int _ur; - - - unsigned char _ubuf[3]; - unsigned char _nbuf[1]; - - - struct __sbuf _lb; - - - int _blksize; - int _offset; - - - struct _reent *_data; - - - - _flock_t _lock; - - _mbstate_t _mbstate; - int _flags2; -}; -# 273 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/reent.h" 3 -typedef struct __sFILE __FILE; - - - -struct _glue -{ - struct _glue *_next; - int _niobs; - __FILE *_iobs; -}; -# 305 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/reent.h" 3 -struct _rand48 { - unsigned short _seed[3]; - unsigned short _mult[3]; - unsigned short _add; - - - - -}; -# 579 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/reent.h" 3 -struct _reent -{ - int _errno; - - - - - __FILE *_stdin, *_stdout, *_stderr; - - int _inc; - char _emergency[25]; - - int _current_category; - const char *_current_locale; - - int __sdidinit; - - char (* __cleanup) (struct _reent *); - - - struct _Bigint *_result; - int _result_k; - struct _Bigint *_p5s; - struct _Bigint **_freelist; - - - int _cvtlen; - char *_cvtbuf; - - union - { - struct - { - unsigned int _unused_rand; - char * _strtok_last; - char _asctime_buf[26]; - struct __tm _localtime_buf; - int _gamma_signgam; - __extension__ unsigned long long _rand_next; - struct _rand48 _r48; - _mbstate_t _mblen_state; - _mbstate_t _mbtowc_state; - _mbstate_t _wctomb_state; - char _l64a_buf[8]; - char _signal_buf[24]; - int _getdate_err; - _mbstate_t _mbrlen_state; - _mbstate_t _mbrtowc_state; - _mbstate_t _mbsrtowcs_state; - _mbstate_t _wcrtomb_state; - _mbstate_t _wcsrtombs_state; - int _h_errno; - } _reent; - - - - struct - { - - unsigned char * _nextf[30]; - unsigned int _nmalloc[30]; - } _unused; - } _new; - - - struct _atexit *_atexit; - struct _atexit _atexit0; - - - char (**(_sig_func))(int); - - - - - struct _glue __sglue; - __FILE __sf[3]; -}; -# 817 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/reent.h" 3 -extern struct _reent *_impure_ptr ; -extern struct _reent *const _global_impure_ptr ; - -char _reclaim_reent (struct _reent *); -# 18 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdlib.h" 2 3 -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/machine/stdlib.h" 1 3 -# 19 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdlib.h" 2 3 -# 27 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdlib.h" 3 - - -typedef struct -{ - int quot; - int rem; -} div_t; - -typedef struct -{ - long quot; - long rem; -} ldiv_t; -# 58 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdlib.h" 3 -extern int __mb_cur_max; - - - -char abort (char) ; -int abs (int); -int atexit (char (*__func)(char)); -double atof (const char *__nptr); - - - -int atoi (const char *__nptr); -int _atoi_r (struct _reent *, const char *__nptr); -long atol (const char *__nptr); -long _atol_r (struct _reent *, const char *__nptr); -char * bsearch (const char * __key, const char * __base, size_t __nmemb, size_t __size, int (* _compar) (const char *, const char *)) - - - - ; -char * calloc (size_t __nmemb, size_t __size) ; -div_t div (int __numer, int __denom); -char exit (int __status) ; -char free (char *) ; -char * getenv (const char *__string); -char * _getenv_r (struct _reent *, const char *__string); -char * _findenv (const char *, int *); -char * _findenv_r (struct _reent *, const char *, int *); -long labs (long); -ldiv_t ldiv (long __numer, long __denom); -char * malloc (size_t __size) ; -int mblen (const char *, size_t); -int _mblen_r (struct _reent *, const char *, size_t, _mbstate_t *); -int mbtowc (wchar_t *, const char *, size_t); -int _mbtowc_r (struct _reent *, wchar_t *, const char *, size_t, _mbstate_t *); -int wctomb (char *, wchar_t); -int _wctomb_r (struct _reent *, char *, wchar_t, _mbstate_t *); -size_t mbstowcs (wchar_t *, const char *, size_t); -size_t _mbstowcs_r (struct _reent *, wchar_t *, const char *, size_t, _mbstate_t *); -size_t wcstombs (char *, const wchar_t *, size_t); -size_t _wcstombs_r (struct _reent *, char *, const wchar_t *, size_t, _mbstate_t *); -# 111 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdlib.h" 3 -char qsort (char * __base, size_t __nmemb, size_t __size, int(*_compar)(const char *, const char *)); -int rand (char); -char * realloc (char * __r, size_t __size) ; - - - -char srand (unsigned __seed); -double strtod (const char *__n, char **__end_PTR); -double _strtod_r (struct _reent *,const char *__n, char **__end_PTR); -float strtof (const char *__n, char **__end_PTR); - - - - - - -long strtol (const char *__n, char **__end_PTR, int __base); -long _strtol_r (struct _reent *,const char *__n, char **__end_PTR, int __base); -unsigned long strtoul (const char *__n, char **__end_PTR, int __base); -unsigned long _strtoul_r (struct _reent *,const char *__n, char **__end_PTR, int __base); - -int system (const char *__string); -# 198 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdlib.h" 3 -char * _dtoa_r (struct _reent *, double, int, int, int *, int*, char**); - -char * _malloc_r (struct _reent *, size_t) ; -char * _calloc_r (struct _reent *, size_t, size_t) ; -char _free_r (struct _reent *, char *) ; -char * _realloc_r (struct _reent *, char *, size_t) ; -char _mstats_r (struct _reent *, char *); - -int _system_r (struct _reent *, const char *); - -char __eprintf (const char *, const char *, unsigned int, const char *); - - - -extern long double strtold (const char *, char **); -extern long double wcstold (const wchar_t *, wchar_t **); - - - -# 40 "jinclude.h" 2 - - - - - - -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdio.h" 1 3 -# 34 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdio.h" 3 -# 1 "/opt/Kalray/usr/local/k1rdtools/lib/gcc/k1-mbr/4.9.4/include/stddef.h" 1 3 4 -# 35 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdio.h" 2 3 - - -# 1 "/opt/Kalray/usr/local/k1rdtools/lib/gcc/k1-mbr/4.9.4/include/stdarg.h" 1 3 4 -# 40 "/opt/Kalray/usr/local/k1rdtools/lib/gcc/k1-mbr/4.9.4/include/stdarg.h" 3 4 -typedef __builtin_va_list __gnuc_va_list; -# 38 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdio.h" 2 3 -# 46 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdio.h" 3 -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/types.h" 1 3 -# 69 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/types.h" 3 -# 1 "/opt/Kalray/usr/local/k1rdtools/lib/gcc/k1-mbr/4.9.4/include/stddef.h" 1 3 4 -# 70 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/types.h" 2 3 -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/machine/types.h" 1 3 -# 19 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/machine/types.h" 3 -typedef long int __off_t; -typedef int __pid_t; - - - -typedef long int __loff_t; -# 71 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/types.h" 2 3 -# 92 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/types.h" 3 -typedef unsigned char u_char; -typedef unsigned short u_short; -typedef unsigned int u_int; -typedef unsigned long u_long; - - - -typedef unsigned short ushort; -typedef unsigned int uint; - - - -typedef unsigned long clock_t; - - - - -typedef long time_t; - - - - -struct timespec { - time_t tv_sec; - long tv_nsec; -}; - -struct itimerspec { - struct timespec it_interval; - struct timespec it_value; -}; - - -typedef long daddr_t; -typedef char * caddr_t; - - - - - - -typedef unsigned short ino_t; -# 162 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/types.h" 3 -typedef _off_t off_t; -typedef __dev_t dev_t; -typedef __uid_t uid_t; -typedef __gid_t gid_t; - - - - - -typedef int pid_t; - - - -typedef long key_t; - -typedef _ssize_t ssize_t; -# 191 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/types.h" 3 -typedef unsigned int mode_t ; - - - - -typedef unsigned short nlink_t; -# 218 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/types.h" 3 -typedef long fd_mask; - - - - - - - -typedef struct _types_fd_set { - fd_mask fds_bits[(((64)+(((sizeof (fd_mask) * 8))-1))/((sizeof (fd_mask) * 8)))]; -} _types_fd_set; -# 249 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/types.h" 3 -typedef unsigned long clockid_t; - - - - -typedef unsigned long timer_t; - - - -typedef unsigned long useconds_t; -typedef long suseconds_t; - -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/features.h" 1 3 -# 262 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/types.h" 2 3 -# 273 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/types.h" 3 -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/sched.h" 1 3 -# 46 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/sched.h" 3 -struct sched_param { - int sched_priority; -# 59 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/sched.h" 3 -}; -# 274 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/types.h" 2 3 -# 282 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/types.h" 3 -typedef __uint32_t pthread_t; -# 344 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/types.h" 3 -typedef struct { - int is_initialized; - char *stackaddr; - int stacksize; - int contentionscope; - int inheritsched; - int schedpolicy; - struct sched_param schedparam; - - - - - - - int detachstate; - -} pthread_attr_t; -# 459 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/types.h" 3 -typedef __uint32_t pthread_mutex_t; - - -typedef struct { - int is_initialized; -# 474 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/types.h" 3 - int recursive; -} pthread_mutexattr_t; - - - - - - - -typedef __uint32_t pthread_cond_t; - - -typedef struct { - int is_initialized; - - - -} pthread_condattr_t; - - - - - - -typedef __uint32_t pthread_key_t; - - -typedef struct { - int is_initialized; - int init_executed; -} pthread_once_t; -# 517 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/types.h" 3 -typedef __uint32_t pthread_barrier_t; - - -typedef struct { - int is_initialized; - - - -} pthread_barrierattr_t; -# 537 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/types.h" 3 -typedef __uint32_t pthread_spinlock_t; -# 47 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdio.h" 2 3 - - - -typedef __FILE FILE; -# 59 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdio.h" 3 -typedef _fpos_t fpos_t; - - - - - -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/stdio.h" 1 3 -# 66 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdio.h" 2 3 -# 175 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdio.h" 3 -FILE * tmpfile (char); -char * tmpnam (char *); -int fclose (FILE *); -int fflush (FILE *); -FILE * freopen (const char *, const char *, FILE *); -char setbuf (FILE *, char *); -int setvbuf (FILE *, char *, int, size_t); -int fprintf (FILE *, const char *, ...) - ; -int fscanf (FILE *, const char *, ...) - ; -int printf (const char *, ...) - ; -int scanf (const char *, ...) - ; -int sscanf (const char *, const char *, ...) - ; -int vfprintf (FILE *, const char *, char*) - ; -int vprintf (const char *, char*) - ; -int vsprintf (char *, const char *, char*) - ; -int fgetc (FILE *); -char * fgets (char *, int, FILE *); -int fputc (int, FILE *); -int fputs (const char *, FILE *); -int getc (FILE *); -int getchar (char); -char * gets (char *); -int putc (int, FILE *); -int putchar (int); -int puts (const char *); -int ungetc (int, FILE *); -size_t fread (char *, size_t _size, size_t _n, FILE *); -size_t fwrite (const char * , size_t _size, size_t _n, FILE *); - - - -int fgetpos (FILE *, fpos_t *); - -int fseek (FILE *, long, int); - - - -int fsetpos (FILE *, const fpos_t *); - -long ftell ( FILE *); -char rewind (FILE *); -char clearerr (FILE *); -int feof (FILE *); -int ferror (FILE *); -char perror (const char *); - -FILE * fopen (const char *_name, const char *_type); -int sprintf (char *, const char *, ...) - ; -int remove (const char *); -int rename (const char *, const char *); -# 246 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdio.h" 3 -int asiprintf (char **, const char *, ...) - ; -char * asniprintf (char *, size_t *, const char *, ...) - ; -char * asnprintf (char *, size_t *, const char *, ...) - ; -int asprintf (char **, const char *, ...) - ; - -int diprintf (int, const char *, ...) - ; - -int fcloseall (char); -int fiprintf (FILE *, const char *, ...) - ; -int fiscanf (FILE *, const char *, ...) - ; -int iprintf (const char *, ...) - ; -int iscanf (const char *, ...) - ; -int siprintf (char *, const char *, ...) - ; -int siscanf (const char *, const char *, ...) - ; -int snprintf (char *, size_t, const char *, ...) - ; -int sniprintf (char *, size_t, const char *, ...) - ; -char * tempnam (const char *, const char *); -int vasiprintf (char **, const char *, char*) - ; -char * vasniprintf (char *, size_t *, const char *, char*) - ; -char * vasnprintf (char *, size_t *, const char *, char*) - ; -int vasprintf (char **, const char *, char*) - ; -int vdiprintf (int, const char *, char*) - ; -int vfiprintf (FILE *, const char *, char*) - ; -int vfiscanf (FILE *, const char *, char*) - ; -int vfscanf (FILE *, const char *, char*) - ; -int viprintf (const char *, char*) - ; -int viscanf (const char *, char*) - ; -int vscanf (const char *, char*) - ; -int vsiprintf (char *, const char *, char*) - ; -int vsiscanf (const char *, const char *, char*) - ; -int vsniprintf (char *, size_t, const char *, char*) - ; -int vsnprintf (char *, size_t, const char *, char*) - ; -int vsscanf (const char *, const char *, char*) - ; -# 361 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdio.h" 3 -int _asiprintf_r (struct _reent *, char **, const char *, ...) - ; -char * _asniprintf_r (struct _reent *, char *, size_t *, const char *, ...) - ; -char * _asnprintf_r (struct _reent *, char *, size_t *, const char *, ...) - ; -int _asprintf_r (struct _reent *, char **, const char *, ...) - ; -int _diprintf_r (struct _reent *, int, const char *, ...) - ; -int _dprintf_r (struct _reent *, int, const char *, ...) - ; -int _fclose_r (struct _reent *, FILE *); -int _fcloseall_r (struct _reent *); -FILE * _fdopen_r (struct _reent *, int, const char *); -int _fflush_r (struct _reent *, FILE *); -int _fgetc_r (struct _reent *, FILE *); -char * _fgets_r (struct _reent *, char *, int, FILE *); - - - - -int _fgetpos_r (struct _reent *, FILE *, fpos_t *); -int _fsetpos_r (struct _reent *, FILE *, const fpos_t *); - -int _fiprintf_r (struct _reent *, FILE *, const char *, ...) - ; -int _fiscanf_r (struct _reent *, FILE *, const char *, ...) - ; -FILE * _fmemopen_r (struct _reent *, char *, size_t, const char *); -FILE * _fopen_r (struct _reent *, const char *, const char *); -FILE * _freopen_r (struct _reent *, const char *, const char *, FILE *); -int _fprintf_r (struct _reent *, FILE *, const char *, ...) - ; -int _fpurge_r (struct _reent *, FILE *); -int _fputc_r (struct _reent *, int, FILE *); -int _fputs_r (struct _reent *, const char *, FILE *); -size_t _fread_r (struct _reent *, char *, size_t _size, size_t _n, FILE *); -int _fscanf_r (struct _reent *, FILE *, const char *, ...) - ; -int _fseek_r (struct _reent *, FILE *, long, int); -int _fseeko_r (struct _reent *, FILE *, _off_t, int); -long _ftell_r (struct _reent *, FILE *); -_off_t _ftello_r (struct _reent *, FILE *); -char _rewind_r (struct _reent *, FILE *); -size_t _fwrite_r (struct _reent *, const char * , size_t _size, size_t _n, FILE *); -int _getc_r (struct _reent *, FILE *); -int _getc_unlocked_r (struct _reent *, FILE *); -int _getchar_r (struct _reent *); -int _getchar_unlocked_r (struct _reent *); -char * _gets_r (struct _reent *, char *); -int _iprintf_r (struct _reent *, const char *, ...) - ; -int _iscanf_r (struct _reent *, const char *, ...) - ; -FILE * _open_memstream_r (struct _reent *, char **, size_t *); -char _perror_r (struct _reent *, const char *); -int _printf_r (struct _reent *, const char *, ...) - ; -int _putc_r (struct _reent *, int, FILE *); -int _putc_unlocked_r (struct _reent *, int, FILE *); -int _putchar_unlocked_r (struct _reent *, int); -int _putchar_r (struct _reent *, int); -int _puts_r (struct _reent *, const char *); -int _remove_r (struct _reent *, const char *); -int _rename_r (struct _reent *, const char *_old, const char *_new) - ; -int _scanf_r (struct _reent *, const char *, ...) - ; -int _siprintf_r (struct _reent *, char *, const char *, ...) - ; -int _siscanf_r (struct _reent *, const char *, const char *, ...) - ; -int _sniprintf_r (struct _reent *, char *, size_t, const char *, ...) - ; -int _snprintf_r (struct _reent *, char *, size_t, const char *, ...) - ; -int _sprintf_r (struct _reent *, char *, const char *, ...) - ; -int _sscanf_r (struct _reent *, const char *, const char *, ...) - ; -char * _tempnam_r (struct _reent *, const char *, const char *); -FILE * _tmpfile_r (struct _reent *); -char * _tmpnam_r (struct _reent *, char *); -int _ungetc_r (struct _reent *, int, FILE *); -int _vasiprintf_r (struct _reent *, char **, const char *, char*) - ; -char * _vasniprintf_r (struct _reent*, char *, size_t *, const char *, char*) - ; -char * _vasnprintf_r (struct _reent*, char *, size_t *, const char *, char*) - ; -int _vasprintf_r (struct _reent *, char **, const char *, char*) - ; -int _vdiprintf_r (struct _reent *, int, const char *, char*) - ; -int _vdprintf_r (struct _reent *, int, const char *, char*) - ; -int _vfiprintf_r (struct _reent *, FILE *, const char *, char*) - ; -int _vfiscanf_r (struct _reent *, FILE *, const char *, char*) - ; -int _vfprintf_r (struct _reent *, FILE *, const char *, char*) - ; -int _vfscanf_r (struct _reent *, FILE *, const char *, char*) - ; -int _viprintf_r (struct _reent *, const char *, char*) - ; -int _viscanf_r (struct _reent *, const char *, char*) - ; -int _vprintf_r (struct _reent *, const char *, char*) - ; -int _vscanf_r (struct _reent *, const char *, char*) - ; -int _vsiprintf_r (struct _reent *, char *, const char *, char*) - ; -int _vsiscanf_r (struct _reent *, const char *, const char *, char*) - ; -int _vsniprintf_r (struct _reent *, char *, size_t, const char *, char*) - ; -int _vsnprintf_r (struct _reent *, char *, size_t, const char *, char*) - ; -int _vsprintf_r (struct _reent *, char *, const char *, char*) - ; -int _vsscanf_r (struct _reent *, const char *, const char *, char*) - ; - - - -int fpurge (FILE *); -ssize_t __getdelim (char **, size_t *, int, FILE *); -ssize_t __getline (char **, size_t *, FILE *); -# 519 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdio.h" 3 -int __srget_r (struct _reent *, FILE *); -int __swbuf_r (struct _reent *, int, FILE *); -# 687 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/stdio.h" 3 - -# 47 "jinclude.h" 2 -# 66 "jinclude.h" -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/string.h" 1 3 -# 14 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/string.h" 3 -# 1 "/opt/Kalray/usr/local/k1rdtools/lib/gcc/k1-mbr/4.9.4/include/stddef.h" 1 3 4 -# 15 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/string.h" 2 3 - - - - - - - -char * memchr (const char *, int, size_t); -int memcmp (const char *, const char *, size_t); -char * memcpy (char *, const char *, size_t); -char * memmove (char *, const char *, size_t); -char * memset (char *, int, size_t); -char *strcat (char *, const char *); -char *strchr (const char *, int); -int strcmp (const char *, const char *); -int strcoll (const char *, const char *); -char *strcpy (char *, const char *); -size_t strcspn (const char *, const char *); -char *strerror (int); -size_t strlen (const char *); -char *strncat (char *, const char *, size_t); -int strncmp (const char *, const char *, size_t); -char *strncpy (char *, const char *, size_t); -char *strpbrk (const char *, const char *); -char *strrchr (const char *, int); -size_t strspn (const char *, const char *); -char *strstr (const char *, const char *); - - -char *strtok (char *, const char *); - - -size_t strxfrm (char *, const char *, size_t); -# 78 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/string.h" 3 -# 1 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/sys/string.h" 1 3 -# 79 "/opt/Kalray/usr/local/k1rdtools/k1-mbr/include/string.h" 2 3 - - -# 67 "jinclude.h" 2 -# 19 "jcprepct.c" 2 -# 1 "jpeglib.h" 1 -# 26 "jpeglib.h" -# 1 "jmorecfg.h" 1 -# 66 "jmorecfg.h" -typedef unsigned char JSAMPLE; -# 106 "jmorecfg.h" -typedef short JCOEF; -# 117 "jmorecfg.h" -typedef unsigned char JOCTET; -# 142 "jmorecfg.h" -typedef unsigned char UINT8; -# 154 "jmorecfg.h" -typedef unsigned short UINT16; - - - - - - - -typedef short INT16; - - - - - -typedef long INT32; -# 178 "jmorecfg.h" -typedef unsigned int JDIMENSION; -# 234 "jmorecfg.h" -typedef int boolean; -# 27 "jpeglib.h" 2 -# 66 "jpeglib.h" -typedef JSAMPLE *JSAMPROW; -typedef JSAMPROW *JSAMPARRAY; -typedef JSAMPARRAY *JSAMPIMAGE; - -typedef JCOEF JBLOCK[64]; -typedef JBLOCK *JBLOCKROW; -typedef JBLOCKROW *JBLOCKARRAY; -typedef JBLOCKARRAY *JBLOCKIMAGE; - -typedef JCOEF *JCOEFPTR; - - - - - - - -typedef struct { - - - - - UINT16 quantval[64]; - - - - - - boolean sent_table; -} JQUANT_TBL; - - - - -typedef struct { - - UINT8 bits[17]; - - UINT8 huffval[256]; - - - - - - boolean sent_table; -} JHUFF_TBL; - - - - -typedef struct { - - - - int component_id; - int component_index; - int h_samp_factor; - int v_samp_factor; - int quant_tbl_no; - - - - - int dc_tbl_no; - int ac_tbl_no; -# 139 "jpeglib.h" - JDIMENSION width_in_blocks; - JDIMENSION height_in_blocks; - - - - - - - int DCT_scaled_size; - - - - - - - JDIMENSION downsampled_width; - JDIMENSION downsampled_height; - - - - - boolean component_needed; - - - - int MCU_width; - int MCU_height; - int MCU_blocks; - int MCU_sample_width; - int last_col_width; - int last_row_height; - - - - - - JQUANT_TBL * quant_table; - - - char * dct_table; -} jpeg_component_info; - - - - -typedef struct { - int comps_in_scan; - int component_index[4]; - int Ss, Se; - int Ah, Al; -} jpeg_scan_info; - - - -typedef struct jpeg_marker_struct * jpeg_saved_marker_ptr; - -struct jpeg_marker_struct { - jpeg_saved_marker_ptr next; - UINT8 marker; - unsigned int original_length; - unsigned int data_length; - JOCTET * data; - -}; - - - -typedef enum { - JCS_UNKNOWN, - JCS_GRAYSCALE, - JCS_RGB, - JCS_YCbCr, - JCS_CMYK, - JCS_YCCK -} J_COLOR_SPACE; - - - -typedef enum { - JDCT_ISLOW, - JDCT_IFAST, - JDCT_FLOAT -} J_DCT_METHOD; -# 232 "jpeglib.h" -typedef enum { - JDITHER_NONE, - JDITHER_ORDERED, - JDITHER_FS -} J_DITHER_MODE; -# 253 "jpeglib.h" -struct jpeg_common_struct { - struct jpeg_error_mgr * err; struct jpeg_memory_mgr * mem; struct jpeg_progress_mgr * progress; char * client_data; boolean is_decompressor; int global_state; - - - - -}; - -typedef struct jpeg_common_struct * j_common_ptr; -typedef struct jpeg_compress_struct * j_compress_ptr; -typedef struct jpeg_decompress_struct * j_decompress_ptr; - - - - -struct jpeg_compress_struct { - struct jpeg_error_mgr * err; struct jpeg_memory_mgr * mem; struct jpeg_progress_mgr * progress; char * client_data; boolean is_decompressor; int global_state; - - - struct jpeg_destination_mgr * dest; - - - - - - - JDIMENSION image_width; - JDIMENSION image_height; - int input_components; - J_COLOR_SPACE in_color_space; - - double input_gamma; -# 294 "jpeglib.h" - int data_precision; - - int num_components; - J_COLOR_SPACE jpeg_color_space; - - jpeg_component_info * comp_info; - - - JQUANT_TBL * quant_tbl_ptrs[4]; - - - JHUFF_TBL * dc_huff_tbl_ptrs[4]; - JHUFF_TBL * ac_huff_tbl_ptrs[4]; - - - UINT8 arith_dc_L[16]; - UINT8 arith_dc_U[16]; - UINT8 arith_ac_K[16]; - - int num_scans; - const jpeg_scan_info * scan_info; - - - - - - boolean raw_data_in; - boolean arith_code; - boolean optimize_coding; - boolean CCIR601_sampling; - int smoothing_factor; - J_DCT_METHOD dct_method; - - - - - - - unsigned int restart_interval; - int restart_in_rows; - - - - boolean write_JFIF_header; - UINT8 JFIF_major_version; - UINT8 JFIF_minor_version; - - - - - UINT8 density_unit; - UINT16 X_density; - UINT16 Y_density; - boolean write_Adobe_marker; - - - - - - - JDIMENSION next_scanline; -# 363 "jpeglib.h" - boolean progressive_mode; - int max_h_samp_factor; - int max_v_samp_factor; - - JDIMENSION total_iMCU_rows; -# 378 "jpeglib.h" - int comps_in_scan; - jpeg_component_info * cur_comp_info[4]; - - - JDIMENSION MCUs_per_row; - JDIMENSION MCU_rows_in_scan; - - int blocks_in_MCU; - int MCU_membership[10]; - - - - int Ss, Se, Ah, Al; - - - - - struct jpeg_comp_master * master; - struct jpeg_c_main_controller * main; - struct jpeg_c_prep_controller * prep; - struct jpeg_c_coef_controller * coef; - struct jpeg_marker_writer * marker; - struct jpeg_color_converter * cconvert; - struct jpeg_downsampler * downsample; - struct jpeg_forward_dct * fdct; - struct jpeg_entropy_encoder * entropy; - jpeg_scan_info * script_space; - int script_space_size; -}; - - - - -struct jpeg_decompress_struct { - struct jpeg_error_mgr * err; struct jpeg_memory_mgr * mem; struct jpeg_progress_mgr * progress; char * client_data; boolean is_decompressor; int global_state; - - - struct jpeg_source_mgr * src; - - - - - JDIMENSION image_width; - JDIMENSION image_height; - int num_components; - J_COLOR_SPACE jpeg_color_space; - - - - - - - J_COLOR_SPACE out_color_space; - - unsigned int scale_num, scale_denom; - - double output_gamma; - - boolean buffered_image; - boolean raw_data_out; - - J_DCT_METHOD dct_method; - boolean do_fancy_upsampling; - boolean do_block_smoothing; - - boolean quantize_colors; - - J_DITHER_MODE dither_mode; - boolean two_pass_quantize; - int desired_number_of_colors; - - boolean enable_1pass_quant; - boolean enable_external_quant; - boolean enable_2pass_quant; - - - - - - - - JDIMENSION output_width; - JDIMENSION output_height; - int out_color_components; - int output_components; - - - - int rec_outbuf_height; -# 478 "jpeglib.h" - int actual_number_of_colors; - JSAMPARRAY colormap; -# 489 "jpeglib.h" - JDIMENSION output_scanline; - - - - - int input_scan_number; - JDIMENSION input_iMCU_row; - - - - - - int output_scan_number; - JDIMENSION output_iMCU_row; -# 511 "jpeglib.h" - int (*coef_bits)[64]; -# 522 "jpeglib.h" - JQUANT_TBL * quant_tbl_ptrs[4]; - - - JHUFF_TBL * dc_huff_tbl_ptrs[4]; - JHUFF_TBL * ac_huff_tbl_ptrs[4]; - - - - - - - int data_precision; - - jpeg_component_info * comp_info; - - - boolean progressive_mode; - boolean arith_code; - - UINT8 arith_dc_L[16]; - UINT8 arith_dc_U[16]; - UINT8 arith_ac_K[16]; - - unsigned int restart_interval; - - - - - boolean saw_JFIF_marker; - - UINT8 JFIF_major_version; - UINT8 JFIF_minor_version; - UINT8 density_unit; - UINT16 X_density; - UINT16 Y_density; - boolean saw_Adobe_marker; - UINT8 Adobe_transform; - - boolean CCIR601_sampling; - - - - - - jpeg_saved_marker_ptr marker_list; -# 575 "jpeglib.h" - int max_h_samp_factor; - int max_v_samp_factor; - - int min_DCT_scaled_size; - - JDIMENSION total_iMCU_rows; -# 589 "jpeglib.h" - JSAMPLE * sample_range_limit; - - - - - - - int comps_in_scan; - jpeg_component_info * cur_comp_info[4]; - - - JDIMENSION MCUs_per_row; - JDIMENSION MCU_rows_in_scan; - - int blocks_in_MCU; - int MCU_membership[10]; - - - - int Ss, Se, Ah, Al; - - - - - - int unread_marker; - - - - - struct jpeg_decomp_master * master; - struct jpeg_d_main_controller * main; - struct jpeg_d_coef_controller * coef; - struct jpeg_d_post_controller * post; - struct jpeg_input_controller * inputctl; - struct jpeg_marker_reader * marker; - struct jpeg_entropy_decoder * entropy; - struct jpeg_inverse_dct * idct; - struct jpeg_upsampler * upsample; - struct jpeg_color_deconverter * cconvert; - struct jpeg_color_quantizer * cquantize; -}; -# 643 "jpeglib.h" -struct jpeg_error_mgr { - - char (*error_exit) (j_common_ptr cinfo); - - char (*emit_message) (j_common_ptr cinfo, int msg_level); - - char (*output_message) (j_common_ptr cinfo); - - char (*format_message) (j_common_ptr cinfo, char * buffer); - - - char (*reset_error_mgr) (j_common_ptr cinfo); - - - - - int msg_code; - - union { - int i[8]; - char s[80]; - } msg_parm; - - - - int trace_level; - - - - - - - - long num_warnings; -# 688 "jpeglib.h" - const char * const * jpeg_message_table; - int last_jpeg_message; - - - - const char * const * addon_message_table; - int first_addon_message; - int last_addon_message; -}; - - - - -struct jpeg_progress_mgr { - char (*progress_monitor) (j_common_ptr cinfo); - - long pass_counter; - long pass_limit; - int completed_passes; - int total_passes; -}; - - - - -struct jpeg_destination_mgr { - JOCTET * next_output_byte; - size_t free_in_buffer; - - char (*init_destination) (j_compress_ptr cinfo); - boolean (*empty_output_buffer) (j_compress_ptr cinfo); - char (*term_destination) (j_compress_ptr cinfo); -}; - - - - -struct jpeg_source_mgr { - const JOCTET * next_input_byte; - size_t bytes_in_buffer; - - char (*init_source) (j_decompress_ptr cinfo); - boolean (*fill_input_buffer) (j_decompress_ptr cinfo); - char (*skip_input_data) (j_decompress_ptr cinfo, long num_bytes); - boolean (*resync_to_restart) (j_decompress_ptr cinfo, int desired); - char (*term_source) (j_decompress_ptr cinfo); -}; -# 752 "jpeglib.h" -typedef struct jvirt_sarray_control * jvirt_sarray_ptr; -typedef struct jvirt_barray_control * jvirt_barray_ptr; - - -struct jpeg_memory_mgr { - - char * (*alloc_small) (j_common_ptr cinfo, int pool_id, size_t sizeofobject) - ; - char * (*alloc_large) (j_common_ptr cinfo, int pool_id, size_t sizeofobject) - ; - JSAMPARRAY (*alloc_sarray) (j_common_ptr cinfo, int pool_id, JDIMENSION samplesperrow, JDIMENSION numrows) - - ; - JBLOCKARRAY (*alloc_barray) (j_common_ptr cinfo, int pool_id, JDIMENSION blocksperrow, JDIMENSION numrows) - - ; - jvirt_sarray_ptr (*request_virt_sarray) (j_common_ptr cinfo, int pool_id, boolean pre_zero, JDIMENSION samplesperrow, JDIMENSION numrows, JDIMENSION maxaccess) - - - - - ; - jvirt_barray_ptr (*request_virt_barray) (j_common_ptr cinfo, int pool_id, boolean pre_zero, JDIMENSION blocksperrow, JDIMENSION numrows, JDIMENSION maxaccess) - - - - - ; - char (*realize_virt_arrays) (j_common_ptr cinfo); - JSAMPARRAY (*access_virt_sarray) (j_common_ptr cinfo, jvirt_sarray_ptr ptr, JDIMENSION start_row, JDIMENSION num_rows, boolean writable) - - - - ; - JBLOCKARRAY (*access_virt_barray) (j_common_ptr cinfo, jvirt_barray_ptr ptr, JDIMENSION start_row, JDIMENSION num_rows, boolean writable) - - - - ; - char (*free_pool) (j_common_ptr cinfo, int pool_id); - char (*self_destruct) (j_common_ptr cinfo); - - - - - - - long max_memory_to_use; - - - long max_alloc_chunk; -}; - - - - - -typedef boolean (*jpeg_marker_parser_method) (j_decompress_ptr cinfo); -# 884 "jpeglib.h" -extern struct jpeg_error_mgr * jpeg_std_error - (struct jpeg_error_mgr * err); -# 900 "jpeglib.h" -extern char jpeg_CreateCompress (j_compress_ptr cinfo, int version, size_t structsize) - ; -extern char jpeg_CreateDecompress (j_decompress_ptr cinfo, int version, size_t structsize) - ; - -extern char jpeg_destroy_compress (j_compress_ptr cinfo); -extern char jpeg_destroy_decompress (j_decompress_ptr cinfo); - - - -extern char jpeg_stdio_dest (j_compress_ptr cinfo, FILE * outfile); -extern char jpeg_stdio_src (j_decompress_ptr cinfo, FILE * infile); - - -extern char jpeg_set_defaults (j_compress_ptr cinfo); - -extern char jpeg_set_colorspace (j_compress_ptr cinfo, J_COLOR_SPACE colorspace) - ; -extern char jpeg_default_colorspace (j_compress_ptr cinfo); -extern char jpeg_set_quality (j_compress_ptr cinfo, int quality, boolean force_baseline) - ; -extern char jpeg_set_linear_quality (j_compress_ptr cinfo, int scale_factor, boolean force_baseline) - - ; -extern char jpeg_add_quant_table (j_compress_ptr cinfo, int which_tbl, const unsigned int *basic_table, int scale_factor, boolean force_baseline) - - - ; -extern int jpeg_quality_scaling (int quality); -extern char jpeg_simple_progression (j_compress_ptr cinfo); -extern char jpeg_suppress_tables (j_compress_ptr cinfo, boolean suppress) - ; -extern JQUANT_TBL * jpeg_alloc_quant_table (j_common_ptr cinfo); -extern JHUFF_TBL * jpeg_alloc_huff_table (j_common_ptr cinfo); - - -extern char jpeg_start_compress (j_compress_ptr cinfo, boolean write_all_tables) - ; -extern JDIMENSION jpeg_write_scanlines (j_compress_ptr cinfo, JSAMPARRAY scanlines, JDIMENSION num_lines) - - ; -extern char jpeg_finish_compress (j_compress_ptr cinfo); - - -extern JDIMENSION jpeg_write_raw_data (j_compress_ptr cinfo, JSAMPIMAGE data, JDIMENSION num_lines) - - ; - - -extern char jpeg_write_marker - (j_compress_ptr cinfo, int marker, const JOCTET * dataptr, unsigned int datalen) - ; - -extern char jpeg_write_m_header - (j_compress_ptr cinfo, int marker, unsigned int datalen); -extern char jpeg_write_m_byte - (j_compress_ptr cinfo, int val); - - -extern char jpeg_write_tables (j_compress_ptr cinfo); - - -extern int jpeg_read_header (j_decompress_ptr cinfo, boolean require_image) - ; -# 975 "jpeglib.h" -extern boolean jpeg_start_decompress (j_decompress_ptr cinfo); -extern JDIMENSION jpeg_read_scanlines (j_decompress_ptr cinfo, JSAMPARRAY scanlines, JDIMENSION max_lines) - - ; -extern boolean jpeg_finish_decompress (j_decompress_ptr cinfo); - - -extern JDIMENSION jpeg_read_raw_data (j_decompress_ptr cinfo, JSAMPIMAGE data, JDIMENSION max_lines) - - ; - - -extern boolean jpeg_has_multiple_scans (j_decompress_ptr cinfo); -extern boolean jpeg_start_output (j_decompress_ptr cinfo, int scan_number) - ; -extern boolean jpeg_finish_output (j_decompress_ptr cinfo); -extern boolean jpeg_input_complete (j_decompress_ptr cinfo); -extern char jpeg_new_colormap (j_decompress_ptr cinfo); -extern int jpeg_consume_input (j_decompress_ptr cinfo); -# 1002 "jpeglib.h" -extern char jpeg_calc_output_dimensions (j_decompress_ptr cinfo); - - -extern char jpeg_save_markers - (j_decompress_ptr cinfo, int marker_code, unsigned int length_limit) - ; - - -extern char jpeg_set_marker_processor - (j_decompress_ptr cinfo, int marker_code, jpeg_marker_parser_method routine) - ; - - -extern jvirt_barray_ptr * jpeg_read_coefficients (j_decompress_ptr cinfo); -extern char jpeg_write_coefficients (j_compress_ptr cinfo, jvirt_barray_ptr * coef_arrays) - ; -extern char jpeg_copy_critical_parameters (j_decompress_ptr srcinfo, j_compress_ptr dstinfo) - ; - - - - - - - -extern char jpeg_abort_compress (j_compress_ptr cinfo); -extern char jpeg_abort_decompress (j_decompress_ptr cinfo); - - - - -extern char jpeg_abort (j_common_ptr cinfo); -extern char jpeg_destroy (j_common_ptr cinfo); - - -extern boolean jpeg_resync_to_restart (j_decompress_ptr cinfo, int desired) - ; -# 1092 "jpeglib.h" -# 1 "jpegint.h" 1 -# 16 "jpegint.h" -typedef enum { - JBUF_PASS_THRU, - - JBUF_SAVE_SOURCE, - JBUF_CRANK_DEST, - JBUF_SAVE_AND_PASS -} J_BUF_MODE; -# 45 "jpegint.h" -struct jpeg_comp_master { - char (*prepare_for_pass) (j_compress_ptr cinfo); - char (*pass_startup) (j_compress_ptr cinfo); - char (*finish_pass) (j_compress_ptr cinfo); - - - boolean call_pass_startup; - boolean is_last_pass; -}; - - -struct jpeg_c_main_controller { - char (*start_pass) (j_compress_ptr cinfo, J_BUF_MODE pass_mode); - char (*process_data) (j_compress_ptr cinfo, JSAMPARRAY input_buf, JDIMENSION *in_row_ctr, JDIMENSION in_rows_avail) - - ; -}; - - -struct jpeg_c_prep_controller { - char (*start_pass) (j_compress_ptr cinfo, J_BUF_MODE pass_mode); - char (*pre_process_data) (j_compress_ptr cinfo, JSAMPARRAY input_buf, JDIMENSION *in_row_ctr, JDIMENSION in_rows_avail, JSAMPIMAGE output_buf, JDIMENSION *out_row_group_ctr, JDIMENSION out_row_groups_avail) - - - - - - ; -}; - - -struct jpeg_c_coef_controller { - char (*start_pass) (j_compress_ptr cinfo, J_BUF_MODE pass_mode); - boolean (*compress_data) (j_compress_ptr cinfo, JSAMPIMAGE input_buf) - ; -}; - - -struct jpeg_color_converter { - char (*start_pass) (j_compress_ptr cinfo); - char (*color_convert) (j_compress_ptr cinfo, JSAMPARRAY input_buf, JSAMPIMAGE output_buf, JDIMENSION output_row, int num_rows) - - ; -}; - - -struct jpeg_downsampler { - char (*start_pass) (j_compress_ptr cinfo); - char (*downsample) (j_compress_ptr cinfo, JSAMPIMAGE input_buf, JDIMENSION in_row_index, JSAMPIMAGE output_buf, JDIMENSION out_row_group_index) - - - ; - - boolean need_context_rows; -}; - - -struct jpeg_forward_dct { - char (*start_pass) (j_compress_ptr cinfo); - - char (*forward_DCT) (j_compress_ptr cinfo, jpeg_component_info * compptr, JSAMPARRAY sample_data, JBLOCKROW coef_blocks, JDIMENSION start_row, JDIMENSION start_col, JDIMENSION num_blocks) - - - - ; -}; - - -struct jpeg_entropy_encoder { - char (*start_pass) (j_compress_ptr cinfo, boolean gather_statistics); - boolean (*encode_mcu) (j_compress_ptr cinfo, JBLOCKROW *MCU_data); - char (*finish_pass) (j_compress_ptr cinfo); -}; - - -struct jpeg_marker_writer { - char (*write_file_header) (j_compress_ptr cinfo); - char (*write_frame_header) (j_compress_ptr cinfo); - char (*write_scan_header) (j_compress_ptr cinfo); - char (*write_file_trailer) (j_compress_ptr cinfo); - char (*write_tables_only) (j_compress_ptr cinfo); - - - char (*write_marker_header) (j_compress_ptr cinfo, int marker, unsigned int datalen) - ; - char (*write_marker_byte) (j_compress_ptr cinfo, int val); -}; - - - - - -struct jpeg_decomp_master { - char (*prepare_for_output_pass) (j_decompress_ptr cinfo); - char (*finish_output_pass) (j_decompress_ptr cinfo); - - - boolean is_dummy_pass; -}; - - -struct jpeg_input_controller { - int (*consume_input) (j_decompress_ptr cinfo); - char (*reset_input_controller) (j_decompress_ptr cinfo); - char (*start_input_pass) (j_decompress_ptr cinfo); - char (*finish_input_pass) (j_decompress_ptr cinfo); - - - boolean has_multiple_scans; - boolean eoi_reached; -}; - - -struct jpeg_d_main_controller { - char (*start_pass) (j_decompress_ptr cinfo, J_BUF_MODE pass_mode); - char (*process_data) (j_decompress_ptr cinfo, JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail) - - ; -}; - - -struct jpeg_d_coef_controller { - char (*start_input_pass) (j_decompress_ptr cinfo); - int (*consume_data) (j_decompress_ptr cinfo); - char (*start_output_pass) (j_decompress_ptr cinfo); - int (*decompress_data) (j_decompress_ptr cinfo, JSAMPIMAGE output_buf) - ; - - jvirt_barray_ptr *coef_arrays; -}; - - -struct jpeg_d_post_controller { - char (*start_pass) (j_decompress_ptr cinfo, J_BUF_MODE pass_mode); - char (*post_process_data) (j_decompress_ptr cinfo, JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, JDIMENSION in_row_groups_avail, JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail) - - - - - - ; -}; - - -struct jpeg_marker_reader { - char (*reset_marker_reader) (j_decompress_ptr cinfo); - - - - - int (*read_markers) (j_decompress_ptr cinfo); - - jpeg_marker_parser_method read_restart_marker; - - - - - boolean saw_SOI; - boolean saw_SOF; - int next_restart_num; - unsigned int discarded_bytes; -}; - - -struct jpeg_entropy_decoder { - char (*start_pass) (j_decompress_ptr cinfo); - boolean (*decode_mcu) (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) - ; - - - - boolean insufficient_data; -}; - - -typedef char (*inverse_DCT_method_ptr) (j_decompress_ptr cinfo, jpeg_component_info * compptr, JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col) - - - ; - -struct jpeg_inverse_dct { - char (*start_pass) (j_decompress_ptr cinfo); - - inverse_DCT_method_ptr inverse_DCT[10]; -}; - - -struct jpeg_upsampler { - char (*start_pass) (j_decompress_ptr cinfo); - char (*upsample) (j_decompress_ptr cinfo, JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, JDIMENSION in_row_groups_avail, JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail) - - - - - - ; - - boolean need_context_rows; -}; - - -struct jpeg_color_deconverter { - char (*start_pass) (j_decompress_ptr cinfo); - char (*color_convert) (j_decompress_ptr cinfo, JSAMPIMAGE input_buf, JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows) - - ; -}; - - -struct jpeg_color_quantizer { - char (*start_pass) (j_decompress_ptr cinfo, boolean is_pre_scan); - char (*color_quantize) (j_decompress_ptr cinfo, JSAMPARRAY input_buf, JSAMPARRAY output_buf, int num_rows) - - ; - char (*finish_pass) (j_decompress_ptr cinfo); - char (*new_color_map) (j_decompress_ptr cinfo); -}; -# 334 "jpegint.h" -extern char jinit_compress_master (j_compress_ptr cinfo); -extern char jinit_c_master_control (j_compress_ptr cinfo, boolean transcode_only) - ; -extern char jinit_c_main_controller (j_compress_ptr cinfo, boolean need_full_buffer) - ; -extern char jinit_c_prep_controller (j_compress_ptr cinfo, boolean need_full_buffer) - ; -extern char jinit_c_coef_controller (j_compress_ptr cinfo, boolean need_full_buffer) - ; -extern char jinit_color_converter (j_compress_ptr cinfo); -extern char jinit_downsampler (j_compress_ptr cinfo); -extern char jinit_forward_dct (j_compress_ptr cinfo); -extern char jinit_huff_encoder (j_compress_ptr cinfo); -extern char jinit_phuff_encoder (j_compress_ptr cinfo); -extern char jinit_marker_writer (j_compress_ptr cinfo); - -extern char jinit_master_decompress (j_decompress_ptr cinfo); -extern char jinit_d_main_controller (j_decompress_ptr cinfo, boolean need_full_buffer) - ; -extern char jinit_d_coef_controller (j_decompress_ptr cinfo, boolean need_full_buffer) - ; -extern char jinit_d_post_controller (j_decompress_ptr cinfo, boolean need_full_buffer) - ; -extern char jinit_input_controller (j_decompress_ptr cinfo); -extern char jinit_marker_reader (j_decompress_ptr cinfo); -extern char jinit_huff_decoder (j_decompress_ptr cinfo); -extern char jinit_phuff_decoder (j_decompress_ptr cinfo); -extern char jinit_inverse_dct (j_decompress_ptr cinfo); -extern char jinit_upsampler (j_decompress_ptr cinfo); -extern char jinit_color_deconverter (j_decompress_ptr cinfo); -extern char jinit_1pass_quantizer (j_decompress_ptr cinfo); -extern char jinit_2pass_quantizer (j_decompress_ptr cinfo); -extern char jinit_merged_upsampler (j_decompress_ptr cinfo); - -extern char jinit_memory_mgr (j_common_ptr cinfo); - - -extern long jdiv_round_up (long a, long b); -extern long jround_up (long a, long b); -extern char jcopy_sample_rows (JSAMPARRAY input_array, int source_row, JSAMPARRAY output_array, int dest_row, int num_rows, JDIMENSION num_cols) - - ; -extern char jcopy_block_row (JBLOCKROW input_row, JBLOCKROW output_row, JDIMENSION num_blocks) - ; -extern char jzero_far (char * target, size_t bytestozero); - - - - -extern const int jpeg_natural_order[]; -# 1093 "jpeglib.h" 2 -# 1 "jerror.h" 1 -# 33 "jerror.h" -typedef enum { - - - - - -JMSG_NOMESSAGE , - - -JERR_ARITH_NOTIMPL , - -JERR_BAD_ALIGN_TYPE , -JERR_BAD_ALLOC_CHUNK , -JERR_BAD_BUFFER_MODE , -JERR_BAD_COMPONENT_ID , -JERR_BAD_DCT_COEF , -JERR_BAD_DCTSIZE , -JERR_BAD_HUFF_TABLE , -JERR_BAD_IN_COLORSPACE , -JERR_BAD_J_COLORSPACE , -JERR_BAD_LENGTH , -JERR_BAD_LIB_VERSION , - -JERR_BAD_MCU_SIZE , -JERR_BAD_POOL_ID , -JERR_BAD_PRECISION , -JERR_BAD_PROGRESSION , - -JERR_BAD_PROG_SCRIPT , - -JERR_BAD_SAMPLING , -JERR_BAD_SCAN_SCRIPT , -JERR_BAD_STATE , -JERR_BAD_STRUCT_SIZE , - -JERR_BAD_VIRTUAL_ACCESS , -JERR_BUFFER_SIZE , -JERR_CANT_SUSPEND , -JERR_CCIR601_NOTIMPL , -JERR_COMPONENT_COUNT , -JERR_CONVERSION_NOTIMPL , -JERR_DAC_INDEX , -JERR_DAC_VALUE , -JERR_DHT_INDEX , -JERR_DQT_INDEX , -JERR_EMPTY_IMAGE , -JERR_EMS_READ , -JERR_EMS_WRITE , -JERR_EOI_EXPECTED , -JERR_FILE_READ , -JERR_FILE_WRITE , -JERR_FRACT_SAMPLE_NOTIMPL , -JERR_HUFF_CLEN_OVERFLOW , -JERR_HUFF_MISSING_CODE , -JERR_IMAGE_TOO_BIG , -JERR_INPUT_EMPTY , -JERR_INPUT_EOF , -JERR_MISMATCHED_QUANT_TABLE , - -JERR_MISSING_DATA , -JERR_MODE_CHANGE , -JERR_NOTIMPL , -JERR_NOT_COMPILED , -JERR_NO_BACKING_STORE , -JERR_NO_HUFF_TABLE , -JERR_NO_IMAGE , -JERR_NO_QUANT_TABLE , -JERR_NO_SOI , -JERR_OUT_OF_MEMORY , -JERR_QUANT_COMPONENTS , - -JERR_QUANT_FEW_COLORS , -JERR_QUANT_MANY_COLORS , -JERR_SOF_DUPLICATE , -JERR_SOF_NO_SOS , -JERR_SOF_UNSUPPORTED , -JERR_SOI_DUPLICATE , -JERR_SOS_NO_SOF , -JERR_TFILE_CREATE , -JERR_TFILE_READ , -JERR_TFILE_SEEK , -JERR_TFILE_WRITE , - -JERR_TOO_LITTLE_DATA , -JERR_UNKNOWN_MARKER , -JERR_VIRTUAL_BUG , -JERR_WIDTH_OVERFLOW , -JERR_XMS_READ , -JERR_XMS_WRITE , -JMSG_COPYRIGHT , -JMSG_VERSION , -JTRC_16BIT_TABLES , - -JTRC_ADOBE , - -JTRC_APP0 , -JTRC_APP14 , -JTRC_DAC , -JTRC_DHT , -JTRC_DQT , -JTRC_DRI , -JTRC_EMS_CLOSE , -JTRC_EMS_OPEN , -JTRC_EOI , -JTRC_HUFFBITS , -JTRC_JFIF , -JTRC_JFIF_BADTHUMBNAILSIZE , - -JTRC_JFIF_EXTENSION , - -JTRC_JFIF_THUMBNAIL , -JTRC_MISC_MARKER , -JTRC_PARMLESS_MARKER , -JTRC_QUANTVALS , -JTRC_QUANT_3_NCOLORS , -JTRC_QUANT_NCOLORS , -JTRC_QUANT_SELECTED , -JTRC_RECOVERY_ACTION , -JTRC_RST , -JTRC_SMOOTH_NOTIMPL , - -JTRC_SOF , -JTRC_SOF_COMPONENT , -JTRC_SOI , -JTRC_SOS , -JTRC_SOS_COMPONENT , -JTRC_SOS_PARAMS , -JTRC_TFILE_CLOSE , -JTRC_TFILE_OPEN , -JTRC_THUMB_JPEG , - -JTRC_THUMB_PALETTE , - -JTRC_THUMB_RGB , - -JTRC_UNKNOWN_IDS , - -JTRC_XMS_CLOSE , -JTRC_XMS_OPEN , -JWRN_ADOBE_XFORM , -JWRN_BOGUS_PROGRESSION , - -JWRN_EXTRANEOUS_DATA , - -JWRN_HIT_MARKER , -JWRN_HUFF_BAD_CODE , -JWRN_JFIF_MAJOR , -JWRN_JPEG_EOF , -JWRN_MUST_RESYNC , - -JWRN_NOT_SEQUENTIAL , -JWRN_TOO_MUCH_DATA , - - - - JMSG_LASTMSGCODE -} J_MESSAGE_CODE; -# 1094 "jpeglib.h" 2 -# 20 "jcprepct.c" 2 -# 53 "jcprepct.c" -typedef struct { - struct jpeg_c_prep_controller pub; - - - - - JSAMPARRAY color_buf[10]; - - JDIMENSION rows_to_go; - int next_buf_row; - - - int this_row_group; - int next_buf_stop; - -} my_prep_controller; - -typedef my_prep_controller * my_prep_ptr; - - - - - - -static char -start_pass_prep (j_compress_ptr cinfo, J_BUF_MODE pass_mode) -{ - my_prep_ptr prep = (my_prep_ptr) cinfo->prep; - - if (pass_mode != JBUF_PASS_THRU) - ((cinfo)->err->msg_code = (JERR_BAD_BUFFER_MODE), (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))); - - - prep->rows_to_go = cinfo->image_height; - - prep->next_buf_row = 0; - - - - - prep->this_row_group = 0; - - prep->next_buf_stop = 2 * cinfo->max_v_samp_factor; - -} - - - - - - - -static char -expand_bottom_edge (JSAMPARRAY image_data, JDIMENSION num_cols, - int input_rows, int output_rows) -{ - register int row; - - for (row = input_rows; row < output_rows; row++) { - jcopy_sample_rows(image_data, input_rows-1, image_data, row, - 1, num_cols); - } -} -# 127 "jcprepct.c" -static char -pre_process_data (j_compress_ptr cinfo, - JSAMPARRAY input_buf, JDIMENSION *in_row_ctr, - JDIMENSION in_rows_avail, - JSAMPIMAGE output_buf, JDIMENSION *out_row_group_ctr, - JDIMENSION out_row_groups_avail) -{ - my_prep_ptr prep = (my_prep_ptr) cinfo->prep; - int numrows, ci; - JDIMENSION inrows; - jpeg_component_info * compptr; - - while (*in_row_ctr < in_rows_avail && - *out_row_group_ctr < out_row_groups_avail) { - - inrows = in_rows_avail - *in_row_ctr; - numrows = cinfo->max_v_samp_factor - prep->next_buf_row; - numrows = (int) (((JDIMENSION) numrows) < (inrows) ? ((JDIMENSION) numrows) : (inrows)); - (*cinfo->cconvert->color_convert) (cinfo, input_buf + *in_row_ctr, - prep->color_buf, - (JDIMENSION) prep->next_buf_row, - numrows); - *in_row_ctr += numrows; - prep->next_buf_row += numrows; - prep->rows_to_go -= numrows; - - if (prep->rows_to_go == 0 && - prep->next_buf_row < cinfo->max_v_samp_factor) { - for (ci = 0; ci < cinfo->num_components; ci++) { - expand_bottom_edge(prep->color_buf[ci], cinfo->image_width, - prep->next_buf_row, cinfo->max_v_samp_factor); - } - prep->next_buf_row = cinfo->max_v_samp_factor; - } - - if (prep->next_buf_row == cinfo->max_v_samp_factor) { - (*cinfo->downsample->downsample) (cinfo, - prep->color_buf, (JDIMENSION) 0, - output_buf, *out_row_group_ctr); - prep->next_buf_row = 0; - (*out_row_group_ctr)++; - } - - - - if (prep->rows_to_go == 0 && - *out_row_group_ctr < out_row_groups_avail) { - for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; - ci++, compptr++) { - expand_bottom_edge(output_buf[ci], - compptr->width_in_blocks * 8, - (int) (*out_row_group_ctr * compptr->v_samp_factor), - (int) (out_row_groups_avail * compptr->v_samp_factor)); - } - *out_row_group_ctr = out_row_groups_avail; - break; - } - } -} -# 194 "jcprepct.c" -static char -pre_process_context (j_compress_ptr cinfo, - JSAMPARRAY input_buf, JDIMENSION *in_row_ctr, - JDIMENSION in_rows_avail, - JSAMPIMAGE output_buf, JDIMENSION *out_row_group_ctr, - JDIMENSION out_row_groups_avail) -{ - my_prep_ptr prep = (my_prep_ptr) cinfo->prep; - int numrows, ci; - int buf_height = cinfo->max_v_samp_factor * 3; - JDIMENSION inrows; - - while (*out_row_group_ctr < out_row_groups_avail) { - if (*in_row_ctr < in_rows_avail) { - - inrows = in_rows_avail - *in_row_ctr; - numrows = prep->next_buf_stop - prep->next_buf_row; - numrows = (int) (((JDIMENSION) numrows) < (inrows) ? ((JDIMENSION) numrows) : (inrows)); - (*cinfo->cconvert->color_convert) (cinfo, input_buf + *in_row_ctr, - prep->color_buf, - (JDIMENSION) prep->next_buf_row, - numrows); - - if (prep->rows_to_go == cinfo->image_height) { - for (ci = 0; ci < cinfo->num_components; ci++) { - int row; - for (row = 1; row <= cinfo->max_v_samp_factor; row++) { - jcopy_sample_rows(prep->color_buf[ci], 0, - prep->color_buf[ci], -row, - 1, cinfo->image_width); - } - } - } - *in_row_ctr += numrows; - prep->next_buf_row += numrows; - prep->rows_to_go -= numrows; - } else { - - if (prep->rows_to_go != 0) - break; - - if (prep->next_buf_row < prep->next_buf_stop) { - for (ci = 0; ci < cinfo->num_components; ci++) { - expand_bottom_edge(prep->color_buf[ci], cinfo->image_width, - prep->next_buf_row, prep->next_buf_stop); - } - prep->next_buf_row = prep->next_buf_stop; - } - } - - if (prep->next_buf_row == prep->next_buf_stop) { - (*cinfo->downsample->downsample) (cinfo, - prep->color_buf, - (JDIMENSION) prep->this_row_group, - output_buf, *out_row_group_ctr); - (*out_row_group_ctr)++; - - prep->this_row_group += cinfo->max_v_samp_factor; - if (prep->this_row_group >= buf_height) - prep->this_row_group = 0; - if (prep->next_buf_row >= buf_height) - prep->next_buf_row = 0; - prep->next_buf_stop = prep->next_buf_row + cinfo->max_v_samp_factor; - } - } -} - - - - - - -static char -create_context_buffer (j_compress_ptr cinfo) -{ - my_prep_ptr prep = (my_prep_ptr) cinfo->prep; - int rgroup_height = cinfo->max_v_samp_factor; - int ci, i; - jpeg_component_info * compptr; - JSAMPARRAY true_buffer, fake_buffer; - - - - - fake_buffer = (JSAMPARRAY) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, 1, - (cinfo->num_components * 5 * rgroup_height) * - ((size_t) sizeof(JSAMPROW))); - - for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; - ci++, compptr++) { - - - - - true_buffer = (*cinfo->mem->alloc_sarray) - ((j_common_ptr) cinfo, 1, - (JDIMENSION) (((long) compptr->width_in_blocks * 8 * - cinfo->max_h_samp_factor) / compptr->h_samp_factor), - (JDIMENSION) (3 * rgroup_height)); - - memcpy((char *)(fake_buffer + rgroup_height), (const char *)(true_buffer), (size_t)(3 * rgroup_height * ((size_t) sizeof(JSAMPROW)))) - ; - - for (i = 0; i < rgroup_height; i++) { - fake_buffer[i] = true_buffer[2 * rgroup_height + i]; - fake_buffer[4 * rgroup_height + i] = true_buffer[i]; - } - prep->color_buf[ci] = fake_buffer + rgroup_height; - fake_buffer += 5 * rgroup_height; - } -} -# 314 "jcprepct.c" -char -jinit_c_prep_controller (j_compress_ptr cinfo, boolean need_full_buffer) -{ - my_prep_ptr prep; - int ci; - jpeg_component_info * compptr; - - if (need_full_buffer) - ((cinfo)->err->msg_code = (JERR_BAD_BUFFER_MODE), (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))); - - prep = (my_prep_ptr) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, 1, - ((size_t) sizeof(my_prep_controller))); - cinfo->prep = (struct jpeg_c_prep_controller *) prep; - prep->pub.start_pass = start_pass_prep; - - - - - - if (cinfo->downsample->need_context_rows) { - - - prep->pub.pre_process_data = pre_process_context; - create_context_buffer(cinfo); - - - - } else { - - prep->pub.pre_process_data = pre_process_data; - for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; - ci++, compptr++) { - prep->color_buf[ci] = (*cinfo->mem->alloc_sarray) - ((j_common_ptr) cinfo, 1, - (JDIMENSION) ((long long) (((long) compptr->width_in_blocks * 8 * cinfo->max_h_samp_factor)) / (long long) (compptr->h_samp_factor)) - , - (JDIMENSION) cinfo->max_v_samp_factor); - } - } -} diff --git a/test/monniaux/jpeg-6b/jcsample.c b/test/monniaux/jpeg-6b/jcsample.c index cc390da6..212ec875 100644 --- a/test/monniaux/jpeg-6b/jcsample.c +++ b/test/monniaux/jpeg-6b/jcsample.c @@ -146,8 +146,8 @@ int_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, JSAMPROW inptr, outptr; INT32 outvalue; - h_expand = DIVISION(cinfo->max_h_samp_factor, compptr->h_samp_factor); - v_expand = DIVISION(cinfo->max_v_samp_factor, compptr->v_samp_factor); + h_expand = cinfo->max_h_samp_factor / compptr->h_samp_factor; + v_expand = cinfo->max_v_samp_factor / compptr->v_samp_factor; numpix = h_expand * v_expand; numpix2 = numpix/2; @@ -170,7 +170,7 @@ int_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, outvalue += (INT32) GETJSAMPLE(*inptr++); } } - *outptr++ = (JSAMPLE) DIVISION((outvalue + numpix2), numpix); + *outptr++ = (JSAMPLE) ((outvalue + numpix2) / numpix); } inrow += v_expand; } @@ -504,8 +504,8 @@ jinit_downsampler (j_compress_ptr cinfo) } else #endif downsample->methods[ci] = h2v2_downsample; - } else if (DIVISION(cinfo->max_h_samp_factor, compptr->h_samp_factor) == 0 && - DIVISION(cinfo->max_v_samp_factor, compptr->v_samp_factor) == 0) { + } else if ((cinfo->max_h_samp_factor % compptr->h_samp_factor) == 0 && + (cinfo->max_v_samp_factor % compptr->v_samp_factor) == 0) { smoothok = FALSE; downsample->methods[ci] = int_downsample; } else @@ -516,7 +516,4 @@ jinit_downsampler (j_compress_ptr cinfo) if (cinfo->smoothing_factor && !smoothok) TRACEMS(cinfo, 0, JTRC_SMOOTH_NOTIMPL); #endif -#ifdef TAIL_CALL_MISSING - int dummy=1; -#endif } diff --git a/test/monniaux/jpeg-6b/jdapimin.c b/test/monniaux/jpeg-6b/jdapimin.c index fe6c8973..cadb59fc 100644 --- a/test/monniaux/jpeg-6b/jdapimin.c +++ b/test/monniaux/jpeg-6b/jdapimin.c @@ -116,68 +116,6 @@ default_decompress_parms (j_decompress_ptr cinfo) /* Guess the input colorspace, and set output colorspace accordingly. */ /* (Wish JPEG committee had provided a real way to specify this...) */ /* Note application may override our guesses. */ -#ifdef NO_SWITCH - int numc = cinfo->num_components; - if (numc == 1) { - cinfo->jpeg_color_space = JCS_GRAYSCALE; - cinfo->out_color_space = JCS_GRAYSCALE; - } else if (numc == 3) { - if (cinfo->saw_JFIF_marker) { - cinfo->jpeg_color_space = JCS_YCbCr; /* JFIF implies YCbCr */ - } else if (cinfo->saw_Adobe_marker) { - switch (cinfo->Adobe_transform) { - case 0: - cinfo->jpeg_color_space = JCS_RGB; - break; - case 1: - cinfo->jpeg_color_space = JCS_YCbCr; - break; - default: - WARNMS1(cinfo, JWRN_ADOBE_XFORM, cinfo->Adobe_transform); - cinfo->jpeg_color_space = JCS_YCbCr; /* assume it's YCbCr */ - break; - } - } else { - /* Saw no special markers, try to guess from the component IDs */ - int cid0 = cinfo->comp_info[0].component_id; - int cid1 = cinfo->comp_info[1].component_id; - int cid2 = cinfo->comp_info[2].component_id; - - if (cid0 == 1 && cid1 == 2 && cid2 == 3) - cinfo->jpeg_color_space = JCS_YCbCr; /* assume JFIF w/out marker */ - else if (cid0 == 82 && cid1 == 71 && cid2 == 66) - cinfo->jpeg_color_space = JCS_RGB; /* ASCII 'R', 'G', 'B' */ - else { - TRACEMS3(cinfo, 1, JTRC_UNKNOWN_IDS, cid0, cid1, cid2); - cinfo->jpeg_color_space = JCS_YCbCr; /* assume it's YCbCr */ - } - } - /* Always guess RGB is proper output colorspace. */ - cinfo->out_color_space = JCS_RGB; - } else if (numc == 4) { - if (cinfo->saw_Adobe_marker) { - switch (cinfo->Adobe_transform) { - case 0: - cinfo->jpeg_color_space = JCS_CMYK; - break; - case 2: - cinfo->jpeg_color_space = JCS_YCCK; - break; - default: - WARNMS1(cinfo, JWRN_ADOBE_XFORM, cinfo->Adobe_transform); - cinfo->jpeg_color_space = JCS_YCCK; /* assume it's YCCK */ - break; - } - } else { - /* No special markers, assume straight CMYK. */ - cinfo->jpeg_color_space = JCS_CMYK; - } - cinfo->out_color_space = JCS_CMYK; - } else { - cinfo->jpeg_color_space = JCS_UNKNOWN; - cinfo->out_color_space = JCS_UNKNOWN; - } -#else switch (cinfo->num_components) { case 1: cinfo->jpeg_color_space = JCS_GRAYSCALE; @@ -245,14 +183,11 @@ default_decompress_parms (j_decompress_ptr cinfo) cinfo->out_color_space = JCS_UNKNOWN; break; } -#endif - + /* Set defaults for other decompression parameters. */ cinfo->scale_num = 1; /* 1:1 scaling */ cinfo->scale_denom = 1; -#ifndef NO_FLOAT cinfo->output_gamma = 1.0; -#endif cinfo->buffered_image = FALSE; cinfo->raw_data_out = FALSE; cinfo->dct_method = JDCT_DEFAULT; @@ -354,47 +289,6 @@ jpeg_consume_input (j_decompress_ptr cinfo) int retcode = JPEG_SUSPENDED; /* NB: every possible DSTATE value should be listed in this switch */ -#ifdef NO_SWITCH - int gstate = cinfo->global_state; - if (gstate == DSTATE_START) { - /* Start-of-datastream actions: reset appropriate modules */ - (*cinfo->inputctl->reset_input_controller) (cinfo); - /* Initialize application's data source module */ - (*cinfo->src->init_source) (cinfo); - cinfo->global_state = DSTATE_INHEADER; - retcode = (*cinfo->inputctl->consume_input) (cinfo); - if (retcode == JPEG_REACHED_SOS) { /* Found SOS, prepare to decompress */ - /* Set up default parameters based on header data */ - default_decompress_parms(cinfo); - /* Set global state: ready for start_decompress */ - cinfo->global_state = DSTATE_READY; - } - } else if (gstate == DSTATE_INHEADER) { - retcode = (*cinfo->inputctl->consume_input) (cinfo); - if (retcode == JPEG_REACHED_SOS) { /* Found SOS, prepare to decompress */ - /* Set up default parameters based on header data */ - default_decompress_parms(cinfo); - /* Set global state: ready for start_decompress */ - cinfo->global_state = DSTATE_READY; - } - } else if (gstate == DSTATE_READY) { - retcode = JPEG_REACHED_SOS; - } else if (gstate == DSTATE_PRELOAD || - gstate == DSTATE_PRESCAN || - gstate == DSTATE_SCANNING || - gstate == DSTATE_RAW_OK || - gstate == DSTATE_BUFIMAGE || - gstate == DSTATE_BUFPOST || - gstate == DSTATE_STOPPING) { - retcode = (*cinfo->inputctl->consume_input) (cinfo); -#ifdef TAIL_CALL_MISSING - retcode += 1; - retcode -= 1; -#endif - } else { - ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); - } -#else switch (cinfo->global_state) { case DSTATE_START: /* Start-of-datastream actions: reset appropriate modules */ @@ -428,7 +322,6 @@ jpeg_consume_input (j_decompress_ptr cinfo) default: ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); } -#endif return retcode; } diff --git a/test/monniaux/jpeg-6b/jdatadst.c b/test/monniaux/jpeg-6b/jdatadst.c index a3586e67..08fa7b62 100644 --- a/test/monniaux/jpeg-6b/jdatadst.c +++ b/test/monniaux/jpeg-6b/jdatadst.c @@ -117,9 +117,7 @@ term_destination (j_compress_ptr cinfo) /* Make sure we wrote the output file OK */ if (ferror(dest->outfile)) ERREXIT(cinfo, JERR_FILE_WRITE); -#ifdef TAIL_CALL_MISSING - int dummy=1; -#endif + KILL_TAIL_CALL(); } diff --git a/test/monniaux/jpeg-6b/jdcoefct.c b/test/monniaux/jpeg-6b/jdcoefct.c index 0aba1d9f..4938d20f 100644 --- a/test/monniaux/jpeg-6b/jdcoefct.c +++ b/test/monniaux/jpeg-6b/jdcoefct.c @@ -349,7 +349,7 @@ decompress_data (j_decompress_ptr cinfo, JSAMPIMAGE output_buf) block_rows = compptr->v_samp_factor; else { /* NB: can't use last_row_height here; it is input-side-dependent! */ - block_rows = (int) MODULO(compptr->height_in_blocks, compptr->v_samp_factor); + block_rows = (int) (compptr->height_in_blocks % compptr->v_samp_factor); if (block_rows == 0) block_rows = compptr->v_samp_factor; } inverse_DCT = cinfo->idct->inverse_DCT[ci]; @@ -508,7 +508,7 @@ decompress_smooth_data (j_decompress_ptr cinfo, JSAMPIMAGE output_buf) last_row = FALSE; } else { /* NB: can't use last_row_height here; it is input-side-dependent! */ - block_rows = (int) MODULO(compptr->height_in_blocks, compptr->v_samp_factor); + block_rows = (int) (compptr->height_in_blocks % compptr->v_samp_factor); if (block_rows == 0) block_rows = compptr->v_samp_factor; access_rows = block_rows; /* this iMCU row only */ last_row = TRUE; @@ -575,11 +575,11 @@ decompress_smooth_data (j_decompress_ptr cinfo, JSAMPIMAGE output_buf) if ((Al=coef_bits[1]) != 0 && workspace[1] == 0) { num = 36 * Q00 * (DC4 - DC6); if (num >= 0) { - pred = (int) DIVISION(((Q01<<7) + num), (Q01<<8)); + pred = (int) (((Q01<<7) + num) / (Q01<<8)); if (Al > 0 && pred >= (1< 0 && pred >= (1<= 0) { - pred = (int) DIVISION(((Q10<<7) + num), (Q10<<8)); + pred = (int) (((Q10<<7) + num) / (Q10<<8)); if (Al > 0 && pred >= (1< 0 && pred >= (1<= 0) { - pred = (int) DIVISION(((Q20<<7) + num), (Q20<<8)); + pred = (int) (((Q20<<7) + num) / (Q20<<8)); if (Al > 0 && pred >= (1< 0 && pred >= (1<= 0) { - pred = (int) DIVISION(((Q11<<7) + num), (Q11<<8)); + pred = (int) (((Q11<<7) + num) / (Q11<<8)); if (Al > 0 && pred >= (1< 0 && pred >= (1<= 0) { - pred = (int) DIVISION(((Q02<<7) + num), (Q02<<8)); + pred = (int) (((Q02<<7) + num) / (Q02<<8)); if (Al > 0 && pred >= (1< 0 && pred >= (1<mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(huff_entropy_decoder)); cinfo->entropy = (struct jpeg_entropy_decoder *) entropy; - ASSIGN_FUNPTR(entropy->pub.start_pass, start_pass_huff_decoder); - ASSIGN_FUNPTR(entropy->pub.decode_mcu, decode_mcu); + entropy->pub.start_pass = start_pass_huff_decoder; + entropy->pub.decode_mcu = decode_mcu; /* Mark tables unallocated */ for (i = 0; i < NUM_HUFF_TBLS; i++) { diff --git a/test/monniaux/jpeg-6b/jdinput.c b/test/monniaux/jpeg-6b/jdinput.c index 471ddcee..0c2ac8f1 100644 --- a/test/monniaux/jpeg-6b/jdinput.c +++ b/test/monniaux/jpeg-6b/jdinput.c @@ -143,7 +143,7 @@ per_scan_setup (j_decompress_ptr cinfo) /* For noninterleaved scans, it is convenient to define last_row_height * as the number of block rows present in the last iMCU row. */ - tmp = (int) MODULO(compptr->height_in_blocks, compptr->v_samp_factor); + tmp = (int) (compptr->height_in_blocks % compptr->v_samp_factor); if (tmp == 0) tmp = compptr->v_samp_factor; compptr->last_row_height = tmp; @@ -176,10 +176,10 @@ per_scan_setup (j_decompress_ptr cinfo) compptr->MCU_blocks = compptr->MCU_width * compptr->MCU_height; compptr->MCU_sample_width = compptr->MCU_width * compptr->DCT_scaled_size; /* Figure number of non-dummy blocks in last MCU column & row */ - tmp = (int) MODULO(compptr->width_in_blocks, compptr->MCU_width); + tmp = (int) (compptr->width_in_blocks % compptr->MCU_width); if (tmp == 0) tmp = compptr->MCU_width; compptr->last_col_width = tmp; - tmp = (int) MODULO(compptr->height_in_blocks, compptr->MCU_height); + tmp = (int) (compptr->height_in_blocks % compptr->MCU_height); if (tmp == 0) tmp = compptr->MCU_height; compptr->last_row_height = tmp; /* Prepare array describing MCU composition */ diff --git a/test/monniaux/jpeg-6b/jdmainct.c b/test/monniaux/jpeg-6b/jdmainct.c index cd987e05..c4be8ac1 100644 --- a/test/monniaux/jpeg-6b/jdmainct.c +++ b/test/monniaux/jpeg-6b/jdmainct.c @@ -175,8 +175,8 @@ alloc_funny_pointers (j_decompress_ptr cinfo) for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; ci++, compptr++) { - rgroup = DIVISION((compptr->v_samp_factor * compptr->DCT_scaled_size), - cinfo->min_DCT_scaled_size); /* height of a row group of component */ + rgroup = (compptr->v_samp_factor * compptr->DCT_scaled_size) / + cinfo->min_DCT_scaled_size; /* height of a row group of component */ /* Get space for pointer lists --- M+4 row groups in each list. * We alloc both pointer lists with one call to save a few cycles. */ @@ -208,8 +208,8 @@ make_funny_pointers (j_decompress_ptr cinfo) for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; ci++, compptr++) { - rgroup = DIVISION((compptr->v_samp_factor * compptr->DCT_scaled_size), - cinfo->min_DCT_scaled_size); /* height of a row group of component */ + rgroup = (compptr->v_samp_factor * compptr->DCT_scaled_size) / + cinfo->min_DCT_scaled_size; /* height of a row group of component */ xbuf0 = main->xbuffer[0][ci]; xbuf1 = main->xbuffer[1][ci]; /* First copy the workspace pointers as-is */ @@ -248,8 +248,8 @@ set_wraparound_pointers (j_decompress_ptr cinfo) for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; ci++, compptr++) { - rgroup = DIVISION((compptr->v_samp_factor * compptr->DCT_scaled_size), - cinfo->min_DCT_scaled_size); /* height of a row group of component */ + rgroup = (compptr->v_samp_factor * compptr->DCT_scaled_size) / + cinfo->min_DCT_scaled_size; /* height of a row group of component */ xbuf0 = main->xbuffer[0][ci]; xbuf1 = main->xbuffer[1][ci]; for (i = 0; i < rgroup; i++) { @@ -278,15 +278,15 @@ set_bottom_pointers (j_decompress_ptr cinfo) ci++, compptr++) { /* Count sample rows in one iMCU row and in one row group */ iMCUheight = compptr->v_samp_factor * compptr->DCT_scaled_size; - rgroup = DIVISION(iMCUheight, cinfo->min_DCT_scaled_size); + rgroup = iMCUheight / cinfo->min_DCT_scaled_size; /* Count nondummy sample rows remaining for this component */ - rows_left = (int) MODULO(compptr->downsampled_height, (JDIMENSION) iMCUheight); + rows_left = (int) (compptr->downsampled_height % (JDIMENSION) iMCUheight); if (rows_left == 0) rows_left = iMCUheight; /* Count nondummy row groups. Should get same answer for each component, * so we need only do it once. */ if (ci == 0) { - main->rowgroups_avail = (JDIMENSION) (DIVISION(rows_left-1, rgroup + 1)); + main->rowgroups_avail = (JDIMENSION) ((rows_left-1) / rgroup + 1); } /* Duplicate the last real sample row rgroup*2 times; this pads out the * last partial rowgroup and ensures at least one full rowgroup of context. @@ -333,9 +333,7 @@ start_pass_main (j_decompress_ptr cinfo, J_BUF_MODE pass_mode) ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); break; } -#ifdef TAIL_CALL_MISSING - int dummy=1; -#endif + KILL_TAIL_CALL(); } @@ -466,9 +464,6 @@ process_data_crank_post (j_decompress_ptr cinfo, (*cinfo->post->post_process_data) (cinfo, (JSAMPIMAGE) NULL, (JDIMENSION *) NULL, (JDIMENSION) 0, output_buf, out_row_ctr, out_rows_avail); -#ifdef TAIL_CALL_MISSING - int dummy=1; -#endif } #endif /* QUANT_2PASS_SUPPORTED */ @@ -508,8 +503,8 @@ jinit_d_main_controller (j_decompress_ptr cinfo, boolean need_full_buffer) for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; ci++, compptr++) { - rgroup = DIVISION((compptr->v_samp_factor * compptr->DCT_scaled_size), - cinfo->min_DCT_scaled_size); /* height of a row group of component */ + rgroup = (compptr->v_samp_factor * compptr->DCT_scaled_size) / + cinfo->min_DCT_scaled_size; /* height of a row group of component */ main->buffer[ci] = (*cinfo->mem->alloc_sarray) ((j_common_ptr) cinfo, JPOOL_IMAGE, compptr->width_in_blocks * compptr->DCT_scaled_size, diff --git a/test/monniaux/jpeg-6b/jdmarker.c b/test/monniaux/jpeg-6b/jdmarker.c index ee999f25..71feff86 100644 --- a/test/monniaux/jpeg-6b/jdmarker.c +++ b/test/monniaux/jpeg-6b/jdmarker.c @@ -653,9 +653,7 @@ examine_app0 (j_decompress_ptr cinfo, JOCTET FAR * data, /* Start of APP0 does not match "JFIF" or "JFXX", or too short */ TRACEMS1(cinfo, 1, JTRC_APP0, (int) totallen); } -#ifdef TAIL_CALL_MISSING - int dummy=1; -#endif + KILL_TAIL_CALL(); } @@ -687,9 +685,7 @@ examine_app14 (j_decompress_ptr cinfo, JOCTET FAR * data, /* Start of APP14 does not match "Adobe", or too short */ TRACEMS1(cinfo, 1, JTRC_APP14, (int) (datalen + remaining)); } -#ifdef TAIL_CALL_MISSING - int dummy=1; -#endif + KILL_TAIL_CALL(); } @@ -1342,9 +1338,7 @@ jpeg_save_markers (j_decompress_ptr cinfo, int marker_code, marker->length_limit_APPn[marker_code - (int) M_APP0] = length_limit; } else ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, marker_code); -#ifdef TAIL_CALL_MISSING - int dummy=1; -#endif + KILL_TAIL_CALL(); } #endif /* SAVE_MARKERS_SUPPORTED */ @@ -1366,7 +1360,5 @@ jpeg_set_marker_processor (j_decompress_ptr cinfo, int marker_code, marker->process_APPn[marker_code - (int) M_APP0] = routine; else ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, marker_code); -#ifdef TAIL_CALL_MISSING - int dummy=1; -#endif + KILL_TAIL_CALL(); } diff --git a/test/monniaux/jpeg-6b/jdmaster.c b/test/monniaux/jpeg-6b/jdmaster.c index 48df48a5..512bd679 100644 --- a/test/monniaux/jpeg-6b/jdmaster.c +++ b/test/monniaux/jpeg-6b/jdmaster.c @@ -529,9 +529,7 @@ jpeg_new_colormap (j_decompress_ptr cinfo) master->pub.is_dummy_pass = FALSE; /* just in case */ } else ERREXIT(cinfo, JERR_MODE_CHANGE); -#ifdef TAIL_CALL_MISSING - int dummy=1; -#endif + KILL_TAIL_CALL(); } #endif /* D_MULTISCAN_FILES_SUPPORTED */ diff --git a/test/monniaux/jpeg-6b/jdphuff.c b/test/monniaux/jpeg-6b/jdphuff.c index 1750bdd0..22678099 100644 --- a/test/monniaux/jpeg-6b/jdphuff.c +++ b/test/monniaux/jpeg-6b/jdphuff.c @@ -648,7 +648,7 @@ jinit_phuff_decoder (j_decompress_ptr cinfo) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(phuff_entropy_decoder)); cinfo->entropy = (struct jpeg_entropy_decoder *) entropy; - ASSIGN_FUNPTR(entropy->pub.start_pass, start_pass_phuff_decoder); + entropy->pub.start_pass = start_pass_phuff_decoder; /* Mark derived tables unallocated */ for (i = 0; i < NUM_HUFF_TBLS; i++) { diff --git a/test/monniaux/jpeg-6b/jdsample.c b/test/monniaux/jpeg-6b/jdsample.c index 766ca28f..80ffefb2 100644 --- a/test/monniaux/jpeg-6b/jdsample.c +++ b/test/monniaux/jpeg-6b/jdsample.c @@ -428,10 +428,10 @@ jinit_upsampler (j_decompress_ptr cinfo) /* Compute size of an "input group" after IDCT scaling. This many samples * are to be converted to max_h_samp_factor * max_v_samp_factor pixels. */ - h_in_group = DIVISION((compptr->h_samp_factor * compptr->DCT_scaled_size), - cinfo->min_DCT_scaled_size); - v_in_group = DIVISION((compptr->v_samp_factor * compptr->DCT_scaled_size), - cinfo->min_DCT_scaled_size); + h_in_group = (compptr->h_samp_factor * compptr->DCT_scaled_size) / + cinfo->min_DCT_scaled_size; + v_in_group = (compptr->v_samp_factor * compptr->DCT_scaled_size) / + cinfo->min_DCT_scaled_size; h_out_group = cinfo->max_h_samp_factor; v_out_group = cinfo->max_v_samp_factor; upsample->rowgroup_height[ci] = v_in_group; /* save for use later */ @@ -459,12 +459,12 @@ jinit_upsampler (j_decompress_ptr cinfo) upsample->pub.need_context_rows = TRUE; } else upsample->methods[ci] = h2v2_upsample; - } else if (MODULO(h_out_group, h_in_group) == 0 && - MODULO(v_out_group, v_in_group) == 0) { + } else if ((h_out_group % h_in_group) == 0 && + (v_out_group % v_in_group) == 0) { /* Generic integral-factors upsampling method */ upsample->methods[ci] = int_upsample; - upsample->h_expand[ci] = (UINT8) DIVISION(h_out_group, h_in_group); - upsample->v_expand[ci] = (UINT8) DIVISION(v_out_group, v_in_group); + upsample->h_expand[ci] = (UINT8) (h_out_group / h_in_group); + upsample->v_expand[ci] = (UINT8) (v_out_group / v_in_group); } else ERREXIT(cinfo, JERR_FRACT_SAMPLE_NOTIMPL); if (need_buffer) { diff --git a/test/monniaux/jpeg-6b/jerror.c b/test/monniaux/jpeg-6b/jerror.c index b5221a85..a60ff693 100644 --- a/test/monniaux/jpeg-6b/jerror.c +++ b/test/monniaux/jpeg-6b/jerror.c @@ -143,9 +143,7 @@ emit_message (j_common_ptr cinfo, int msg_level) if (err->trace_level >= msg_level) (*err->output_message) (cinfo); } -#ifdef TAIL_CALL_MISSING - int dummy=1; -#endif + KILL_TAIL_CALL(); } diff --git a/test/monniaux/jpeg-6b/jmemmgr.c b/test/monniaux/jpeg-6b/jmemmgr.c index 925890a3..12ab0516 100644 --- a/test/monniaux/jpeg-6b/jmemmgr.c +++ b/test/monniaux/jpeg-6b/jmemmgr.c @@ -222,7 +222,7 @@ out_of_memory (j_common_ptr cinfo, int which) cinfo->err->trace_level = 2; /* force self_destruct to report stats */ #endif ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, which); - KILL_TAIL_CALL + KILL_TAIL_CALL(); } @@ -627,7 +627,7 @@ realize_virt_arrays (j_common_ptr cinfo) if (avail_mem >= maximum_space) max_minheights = 1000000000L; else { - max_minheights = DIVISION(avail_mem, space_per_minheight); + max_minheights = avail_mem / space_per_minheight; /* If there doesn't seem to be enough space, try to get the minimum * anyway. This allows a "stub" implementation of jpeg_mem_available(). */ @@ -639,7 +639,7 @@ realize_virt_arrays (j_common_ptr cinfo) for (sptr = mem->virt_sarray_list; sptr != NULL; sptr = sptr->next) { if (sptr->mem_buffer == NULL) { /* if not realized yet */ - minheights = DIVISION(((long) sptr->rows_in_array - 1L), sptr->maxaccess) + 1L; + minheights = ((long) sptr->rows_in_array - 1L) / sptr->maxaccess + 1L; if (minheights <= max_minheights) { /* This buffer fits in memory */ sptr->rows_in_mem = sptr->rows_in_array; @@ -663,7 +663,7 @@ realize_virt_arrays (j_common_ptr cinfo) for (bptr = mem->virt_barray_list; bptr != NULL; bptr = bptr->next) { if (bptr->mem_buffer == NULL) { /* if not realized yet */ - minheights = DIVISION(((long) bptr->rows_in_array - 1L), bptr->maxaccess) + 1L; + minheights = ((long) bptr->rows_in_array - 1L) / bptr->maxaccess + 1L; if (minheights <= max_minheights) { /* This buffer fits in memory */ bptr->rows_in_mem = bptr->rows_in_array; @@ -684,7 +684,6 @@ realize_virt_arrays (j_common_ptr cinfo) bptr->dirty = FALSE; } } - KILL_TAIL_CALL } diff --git a/test/monniaux/jpeg-6b/jmemnobs.c b/test/monniaux/jpeg-6b/jmemnobs.c index 8bf9f8be..02e14a1a 100644 --- a/test/monniaux/jpeg-6b/jmemnobs.c +++ b/test/monniaux/jpeg-6b/jmemnobs.c @@ -25,6 +25,7 @@ extern void * malloc JPP((size_t size)); extern void free JPP((void *ptr)); #endif + /* * Memory allocation and freeing are controlled by the regular library * routines malloc() and free(). @@ -33,21 +34,16 @@ extern void free JPP((void *ptr)); GLOBAL(void *) jpeg_get_small (j_common_ptr cinfo, size_t sizeofobject) { - void *p= (void *) malloc(sizeofobject); - if (p==NULL) { /* DM */ - printf("malloc (%zu) failed\n", sizeofobject); - } - return p; + return (void *) malloc(sizeofobject); } GLOBAL(void) jpeg_free_small (j_common_ptr cinfo, void * object, size_t sizeofobject) { -#ifdef DMONNIAUX_FREE free(object); -#endif } + /* * "Large" objects are treated the same as "small" ones. * NB: although we include FAR keywords in the routine declarations, @@ -64,11 +60,10 @@ jpeg_get_large (j_common_ptr cinfo, size_t sizeofobject) GLOBAL(void) jpeg_free_large (j_common_ptr cinfo, void FAR * object, size_t sizeofobject) { -#ifdef DMONNIAUX_FREE - free((void*)object); -#endif + free(object); } + /* * This routine computes the total memory space available for allocation. * Here we always say, "we got all you want bud!" @@ -93,7 +88,7 @@ jpeg_open_backing_store (j_common_ptr cinfo, backing_store_ptr info, long total_bytes_needed) { ERREXIT(cinfo, JERR_NO_BACKING_STORE); - KILL_TAIL_CALL + KILL_TAIL_CALL(); } diff --git a/test/monniaux/jpeg-6b/jmorecfg.h b/test/monniaux/jpeg-6b/jmorecfg.h index 121b65d7..c274ca3a 100644 --- a/test/monniaux/jpeg-6b/jmorecfg.h +++ b/test/monniaux/jpeg-6b/jmorecfg.h @@ -10,21 +10,6 @@ * optimizations. Most users will not need to touch this file. */ -#ifdef NO_32BIT_DIVISION -#define MODULO(x, y) ((long long) (x) % (y)) -#define DIVISION(x, y) ((long long) (x) / (y)) -#else -#define MODULO(x, y) ((x) % (y)) -#define DIVISION(x, y) ((x) / (y)) -#endif - -#ifdef TAIL_CALL_MISSING -#define KILL_TAIL_CALL { int val = 1; } -#else -#define KILL_TAIL_CALL -#endif - -#define ASSIGN_FUNPTR(x, y) x = y /* * Define BITS_IN_JSAMPLE as either @@ -277,9 +262,9 @@ typedef int boolean; #define DCT_ISLOW_SUPPORTED /* slow but accurate integer algorithm */ #define DCT_IFAST_SUPPORTED /* faster, less accurate integer method */ -#ifndef NO_FLOAT -#define DCT_FLOAT_SUPPORTED /* floating-point: accurate, fast on fast HW */ -#endif + +/* DM */ +#undef DCT_FLOAT_SUPPORTED /* floating-point: accurate, fast on fast HW */ /* Encoder capability options: */ diff --git a/test/monniaux/jpeg-6b/jquant1.c b/test/monniaux/jpeg-6b/jquant1.c index bb366391..b2f96aa1 100644 --- a/test/monniaux/jpeg-6b/jquant1.c +++ b/test/monniaux/jpeg-6b/jquant1.c @@ -227,7 +227,7 @@ select_ncolors (j_decompress_ptr cinfo, int Ncolors[]) for (i = 0; i < nc; i++) { j = (cinfo->out_color_space == JCS_RGB ? RGB_order[i] : i); /* calculate new total_colors if Ncolors[j] is incremented */ - temp = DIVISION(total_colors, Ncolors[j]); + temp = total_colors / Ncolors[j]; temp *= Ncolors[j]+1; /* done in long arith to avoid oflo */ if (temp > (long) max_colors) break; /* won't fit, done with this pass */ @@ -251,7 +251,7 @@ output_value (j_decompress_ptr cinfo, int ci, int j, int maxj) * (Forcing the upper and lower values to the limits ensures that * dithering can't produce a color outside the selected gamut.) */ - return (int) DIVISION(((INT32) j * MAXJSAMPLE + maxj/2), maxj); + return (int) (((INT32) j * MAXJSAMPLE + maxj/2) / maxj); } @@ -261,7 +261,7 @@ largest_input_value (j_decompress_ptr cinfo, int ci, int j, int maxj) /* Must have largest(j=0) >= 0, and largest(j=maxj) >= MAXJSAMPLE */ { /* Breakpoints are halfway between values returned by output_value */ - return (int) DIVISION(((INT32) (2*j + 1) * MAXJSAMPLE + maxj), (2*maxj)); + return (int) (((INT32) (2*j + 1) * MAXJSAMPLE + maxj) / (2*maxj)); } @@ -303,7 +303,7 @@ create_colormap (j_decompress_ptr cinfo) for (i = 0; i < cinfo->out_color_components; i++) { /* fill in colormap entries for i'th color component */ nci = cquantize->Ncolors[i]; /* # of distinct values for this color */ - blksize = DIVISION(blkdist, nci); + blksize = blkdist / nci; for (j = 0; j < nci; j++) { /* Compute j'th output value (out of nci) for component */ val = output_value(cinfo, i, j, nci-1); @@ -360,7 +360,7 @@ create_colorindex (j_decompress_ptr cinfo) for (i = 0; i < cinfo->out_color_components; i++) { /* fill in colorindex entries for i'th color component */ nci = cquantize->Ncolors[i]; /* # of distinct values for this color */ - blksize = DIVISION(blksize, nci); + blksize = blksize / nci; /* adjust colorindex pointers to provide padding at negative indexes. */ if (pad) @@ -415,7 +415,7 @@ make_odither_array (j_decompress_ptr cinfo, int ncolors) /* Ensure round towards zero despite C's lack of consistency * about rounding negative values in integer division... */ - odither[j][k] = (int) (num<0 ? -DIVISION((-num), den) : DIVISION(num, den)); + odither[j][k] = (int) (num<0 ? -((-num)/den) : num/den); } } return odither; @@ -787,9 +787,6 @@ start_pass_1_quant (j_decompress_ptr cinfo, boolean is_pre_scan) ERREXIT(cinfo, JERR_NOT_COMPILED); break; } -#ifdef TAIL_CALL_MISSING - int dummy=1; -#endif } @@ -813,9 +810,6 @@ METHODDEF(void) new_color_map_1_quant (j_decompress_ptr cinfo) { ERREXIT(cinfo, JERR_MODE_CHANGE); -#ifdef TAIL_CALL_MISSING - int dummy=1; -#endif } diff --git a/test/monniaux/jpeg-6b/jquant2.c b/test/monniaux/jpeg-6b/jquant2.c index 32b2aa88..af601e33 100644 --- a/test/monniaux/jpeg-6b/jquant2.c +++ b/test/monniaux/jpeg-6b/jquant2.c @@ -529,9 +529,9 @@ compute_color (j_decompress_ptr cinfo, boxptr boxp, int icolor) } } - cinfo->colormap[0][icolor] = (JSAMPLE) DIVISION((c0total + (total>>1)), total); - cinfo->colormap[1][icolor] = (JSAMPLE) DIVISION((c1total + (total>>1)), total); - cinfo->colormap[2][icolor] = (JSAMPLE) DIVISION((c2total + (total>>1)), total); + cinfo->colormap[0][icolor] = (JSAMPLE) ((c0total + (total>>1)) / total); + cinfo->colormap[1][icolor] = (JSAMPLE) ((c1total + (total>>1)) / total); + cinfo->colormap[2][icolor] = (JSAMPLE) ((c2total + (total>>1)) / total); } diff --git a/test/monniaux/jpeg-6b/jutils.c b/test/monniaux/jpeg-6b/jutils.c index 505c3a07..d18a9555 100644 --- a/test/monniaux/jpeg-6b/jutils.c +++ b/test/monniaux/jpeg-6b/jutils.c @@ -73,7 +73,7 @@ jdiv_round_up (long a, long b) /* Compute a/b rounded up to next integer, ie, ceil(a/b) */ /* Assumes a >= 0, b > 0 */ { - return DIVISION((a + b - 1L), b); + return (a + b - 1L) / b; } @@ -83,7 +83,7 @@ jround_up (long a, long b) /* Assumes a >= 0, b > 0 */ { a += b - 1L; - return a - DIVISION(a, b); + return a - (a % b); } diff --git a/test/monniaux/jpeg-6b/modulo_division.c b/test/monniaux/jpeg-6b/modulo_division.c deleted file mode 100644 index 75d78a37..00000000 --- a/test/monniaux/jpeg-6b/modulo_division.c +++ /dev/null @@ -1,15 +0,0 @@ -int supplied_modulo(int x, int y) { - return x % y; -} -int supplied_division(int x, int y) { - return x / y; -} -unsigned long long __compcert_i64_udiv(unsigned long long x, unsigned long long y) { - return x / y; -} -long long __compcert_i64_sdiv(long long x, long long y) { - return x / y; -} -long long __compcert_i64_smod(long long x, long long y) { - return x % y; -} diff --git a/test/monniaux/jpeg-6b/rdbmp.c b/test/monniaux/jpeg-6b/rdbmp.c index b8bed4f9..3957ba46 100644 --- a/test/monniaux/jpeg-6b/rdbmp.c +++ b/test/monniaux/jpeg-6b/rdbmp.c @@ -229,8 +229,8 @@ preload_image (j_compress_ptr cinfo, cjpeg_source_ptr sinfo) source->source_row = cinfo->image_height; /* And read the first row */ - JDIMENSION ret = (*source->pub.get_pixel_rows) (cinfo, sinfo); - KILL_TAIL_CALL + int ret= (*source->pub.get_pixel_rows) (cinfo, sinfo); + KILL_TAIL_CALL(); return ret; } diff --git a/test/monniaux/jpeg-6b/rdcolmap.c b/test/monniaux/jpeg-6b/rdcolmap.c index d9898d01..95d97358 100644 --- a/test/monniaux/jpeg-6b/rdcolmap.c +++ b/test/monniaux/jpeg-6b/rdcolmap.c @@ -248,7 +248,7 @@ read_color_map (j_decompress_ptr cinfo, FILE * infile) ERREXIT(cinfo, JERR_BAD_CMAP_FILE); break; } - KILL_TAIL_CALL + KILL_TAIL_CALL(); } #endif /* QUANT_2PASS_SUPPORTED */ diff --git a/test/monniaux/jpeg-6b/rdppm.c b/test/monniaux/jpeg-6b/rdppm.c index 2543ff5e..1df35c1b 100644 --- a/test/monniaux/jpeg-6b/rdppm.c +++ b/test/monniaux/jpeg-6b/rdppm.c @@ -418,7 +418,7 @@ start_input_ppm (j_compress_ptr cinfo, cjpeg_source_ptr sinfo) half_maxval = maxval / 2; for (val = 0; val <= (INT32) maxval; val++) { /* The multiplication here must be done in 32 bits to avoid overflow */ - source->rescale[val] = (JSAMPLE) DIVISION((val*MAXJSAMPLE + half_maxval), maxval); + source->rescale[val] = (JSAMPLE) ((val*MAXJSAMPLE + half_maxval)/maxval); } } } diff --git a/test/monniaux/jpeg-6b/wrbmp.c b/test/monniaux/jpeg-6b/wrbmp.c index 44978834..0d13482c 100644 --- a/test/monniaux/jpeg-6b/wrbmp.c +++ b/test/monniaux/jpeg-6b/wrbmp.c @@ -379,7 +379,7 @@ finish_output_bmp (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo) fflush(outfile); if (ferror(outfile)) ERREXIT(cinfo, JERR_FILE_WRITE); - KILL_TAIL_CALL + KILL_TAIL_CALL(); } diff --git a/test/monniaux/jpeg-6b/wrgif.c b/test/monniaux/jpeg-6b/wrgif.c index 73e28633..5fe83283 100644 --- a/test/monniaux/jpeg-6b/wrgif.c +++ b/test/monniaux/jpeg-6b/wrgif.c @@ -271,7 +271,7 @@ emit_header (gif_dest_ptr dinfo, int num_colors, JSAMPARRAY colormap) } } else { /* Create a gray-scale map of num_colors values, range 0..255 */ - put_3bytes(dinfo, DIVISION((i * 255 + (num_colors-1)/2), (num_colors-1))); + put_3bytes(dinfo, (i * 255 + (num_colors-1)/2) / (num_colors-1)); } } else { /* fill out the map to a power of 2 */ @@ -291,7 +291,6 @@ emit_header (gif_dest_ptr dinfo, int num_colors, JSAMPARRAY colormap) /* Initialize for "compression" of image data */ compress_init(dinfo, InitCodeSize+1); - KILL_TAIL_CALL } @@ -350,7 +349,6 @@ finish_output_gif (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo) fflush(dest->pub.output_file); if (ferror(dest->pub.output_file)) ERREXIT(cinfo, JERR_FILE_WRITE); - KILL_TAIL_CALL } diff --git a/test/monniaux/jpeg-6b/wrppm.c b/test/monniaux/jpeg-6b/wrppm.c index 7c058d00..47dd19b4 100644 --- a/test/monniaux/jpeg-6b/wrppm.c +++ b/test/monniaux/jpeg-6b/wrppm.c @@ -194,7 +194,7 @@ start_output_ppm (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo) default: ERREXIT(cinfo, JERR_PPM_COLORSPACE); } - KILL_TAIL_CALL + KILL_TAIL_CALL(); } @@ -209,7 +209,7 @@ finish_output_ppm (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo) fflush(dinfo->output_file); if (ferror(dinfo->output_file)) ERREXIT(cinfo, JERR_FILE_WRITE); - KILL_TAIL_CALL + KILL_TAIL_CALL(); } diff --git a/test/monniaux/jpeg-6b/wrtarga.c b/test/monniaux/jpeg-6b/wrtarga.c index fb3264d8..7bfe2a44 100644 --- a/test/monniaux/jpeg-6b/wrtarga.c +++ b/test/monniaux/jpeg-6b/wrtarga.c @@ -200,7 +200,7 @@ start_output_tga (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo) } else { ERREXIT(cinfo, JERR_TGA_COLORSPACE); } - KILL_TAIL_CALL + KILL_TAIL_CALL(); } @@ -215,7 +215,7 @@ finish_output_tga (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo) fflush(dinfo->output_file); if (ferror(dinfo->output_file)) ERREXIT(cinfo, JERR_FILE_WRITE); - KILL_TAIL_CALL + KILL_TAIL_CALL(); } -- cgit