From 15aafbb6ff578e10bfc9348c0d04aeaf83279705 Mon Sep 17 00:00:00 2001 From: David Monniaux Date: Tue, 29 Jan 2019 22:00:49 +0100 Subject: muf muf muf --- test/monniaux/jpeg-6b/Makefile | 2 +- test/monniaux/jpeg-6b/jchuff.c | 4 +--- test/monniaux/jpeg-6b/jconfig.h | 6 +++--- test/monniaux/jpeg-6b/jdhuff.c | 6 ++---- test/monniaux/jpeg-6b/jdphuff.c | 5 ++--- test/monniaux/jpeg-6b/jmemnobs.c | 6 +++++- test/monniaux/jpeg-6b/jmorecfg.h | 7 +++++++ 7 files changed, 21 insertions(+), 15 deletions(-) (limited to 'test/monniaux') diff --git a/test/monniaux/jpeg-6b/Makefile b/test/monniaux/jpeg-6b/Makefile index 0b3234d3..5e9e5fe8 100644 --- a/test/monniaux/jpeg-6b/Makefile +++ b/test/monniaux/jpeg-6b/Makefile @@ -23,7 +23,7 @@ mandir = $(prefix)/man/man$(manext) CC= ./ccomp.sh # You may need to adjust these cc options: -CFLAGS= -DNO_DOUBLE -DNO_32BIT_DIVISION -DNO_FLOAT -DNO_SWITCH -DTAIL_CALL_MISSING -I$(srcdir) +CFLAGS= -DNO_DOUBLE -DNO_32BIT_DIVISION -DNO_FLOAT -DNO_SWITCH -DTAIL_CALL_MISSING -DMEMCPY_MISSING -I$(srcdir) # 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: diff --git a/test/monniaux/jpeg-6b/jchuff.c b/test/monniaux/jpeg-6b/jchuff.c index 4b043beb..4a2d0da2 100644 --- a/test/monniaux/jpeg-6b/jchuff.c +++ b/test/monniaux/jpeg-6b/jchuff.c @@ -892,9 +892,7 @@ 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; -#ifdef DMONNIAUX_MEMCPY - entropy->pub.start_pass = start_pass_huff; -#endif + ASSIGN_FUNPTR(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/jconfig.h b/test/monniaux/jpeg-6b/jconfig.h index 85611970..1b30a525 100644 --- a/test/monniaux/jpeg-6b/jconfig.h +++ b/test/monniaux/jpeg-6b/jconfig.h @@ -29,11 +29,11 @@ #ifdef JPEG_CJPEG_DJPEG -#define BMP_SUPPORTED /* BMP image file format */ -#define GIF_SUPPORTED /* GIF image file format */ +#undef BMP_SUPPORTED /* BMP image file format */ +#undef GIF_SUPPORTED /* GIF image file format */ #define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */ #undef RLE_SUPPORTED /* Utah RLE image file format */ -#define TARGA_SUPPORTED /* Targa image file format */ +#undef TARGA_SUPPORTED /* Targa image file format */ #undef TWO_FILE_COMMANDLINE #undef NEED_SIGNAL_CATCHER diff --git a/test/monniaux/jpeg-6b/jdhuff.c b/test/monniaux/jpeg-6b/jdhuff.c index d04919c9..41dab479 100644 --- a/test/monniaux/jpeg-6b/jdhuff.c +++ b/test/monniaux/jpeg-6b/jdhuff.c @@ -641,10 +641,8 @@ jinit_huff_decoder (j_decompress_ptr cinfo) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(huff_entropy_decoder)); cinfo->entropy = (struct jpeg_entropy_decoder *) entropy; -#ifdef DMONNIAUX_MEMCPY - entropy->pub.start_pass = start_pass_huff_decoder; - entropy->pub.decode_mcu = decode_mcu; -#endif + ASSIGN_FUNPTR(entropy->pub.start_pass, start_pass_huff_decoder); + ASSIGN_FUNPTR(entropy->pub.decode_mcu, decode_mcu); /* Mark tables unallocated */ for (i = 0; i < NUM_HUFF_TBLS; i++) { diff --git a/test/monniaux/jpeg-6b/jdphuff.c b/test/monniaux/jpeg-6b/jdphuff.c index 65c196b3..1750bdd0 100644 --- a/test/monniaux/jpeg-6b/jdphuff.c +++ b/test/monniaux/jpeg-6b/jdphuff.c @@ -648,9 +648,8 @@ 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; -#ifdef DMONNIAUX_MEMCPY - entropy->pub.start_pass = start_pass_phuff_decoder; -#endif + ASSIGN_FUNPTR(entropy->pub.start_pass, start_pass_phuff_decoder); + /* Mark derived tables unallocated */ for (i = 0; i < NUM_HUFF_TBLS; i++) { entropy->derived_tbls[i] = NULL; diff --git a/test/monniaux/jpeg-6b/jmemnobs.c b/test/monniaux/jpeg-6b/jmemnobs.c index 2e4454db..8bf9f8be 100644 --- a/test/monniaux/jpeg-6b/jmemnobs.c +++ b/test/monniaux/jpeg-6b/jmemnobs.c @@ -33,7 +33,11 @@ extern void free JPP((void *ptr)); GLOBAL(void *) jpeg_get_small (j_common_ptr cinfo, size_t sizeofobject) { - return (void *) malloc(sizeofobject); + void *p= (void *) malloc(sizeofobject); + if (p==NULL) { /* DM */ + printf("malloc (%zu) failed\n", sizeofobject); + } + return p; } GLOBAL(void) diff --git a/test/monniaux/jpeg-6b/jmorecfg.h b/test/monniaux/jpeg-6b/jmorecfg.h index 4ca525e1..43bff325 100644 --- a/test/monniaux/jpeg-6b/jmorecfg.h +++ b/test/monniaux/jpeg-6b/jmorecfg.h @@ -17,12 +17,19 @@ #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 +#ifdef MEMCPY_MISSING +#define ASSIGN_FUNPTR(x, y) +#else +#define ASSIGN_FUNPTR(x, y) x = y +#endif + /* * Define BITS_IN_JSAMPLE as either * 8 for 8-bit sample values (the usual setting) -- cgit