aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2019-01-29 22:00:49 +0100
committerDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2019-01-29 22:00:49 +0100
commit15aafbb6ff578e10bfc9348c0d04aeaf83279705 (patch)
tree49cd839c4a28923feb16b8ffd278aab0d283e297
parentc92fb6bebc781525e09bd38cb77f746c3b8d118c (diff)
downloadcompcert-kvx-15aafbb6ff578e10bfc9348c0d04aeaf83279705.tar.gz
compcert-kvx-15aafbb6ff578e10bfc9348c0d04aeaf83279705.zip
muf muf muf
-rw-r--r--test/monniaux/jpeg-6b/Makefile2
-rw-r--r--test/monniaux/jpeg-6b/jchuff.c4
-rw-r--r--test/monniaux/jpeg-6b/jconfig.h6
-rw-r--r--test/monniaux/jpeg-6b/jdhuff.c6
-rw-r--r--test/monniaux/jpeg-6b/jdphuff.c5
-rw-r--r--test/monniaux/jpeg-6b/jmemnobs.c6
-rw-r--r--test/monniaux/jpeg-6b/jmorecfg.h7
7 files changed, 21 insertions, 15 deletions
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)