[jbig2-dev] jbig2dec patches to compile with MSVC
Russell Lang
gsview@ghostgum.com.au
Thu, 4 Jul 2002 22:06:03 +1000
--Message-Boundary-28871
Content-type: text/plain; charset=US-ASCII
Content-transfer-encoding: 7BIT
Content-description: Mail message body
Ralph,
These changes are pretty minimal.
msvc.txt is the patch.
msvcwarn.txt are the compiler warnings.
MSVC is very picky about signed/unsigned comparisons,
unused variables, unused formal parameters, possibly
uninitialised variables, and automatic type conversions
that reduce precision.
I have replaced <stdint.h> with "stdint_.h" because
stdint.h is not provided by MSVC++ 7.
MSVC uses _vsnprintf, not vsnprintf. I have put a #define
for this in stdint_.h, but it should be moved to a more
suitable place.
For a Windows GUI program, stdin/out/err are NOT available.
If you stick with using fprintf(stderr, ...), then it will
be easy to find and remove these by searching for stderr.
If you use printf, it is much harder.
Where you have
typedef enum {
JBIG2_OPTIONS_EMBEDDED = 1
} Jbig2Options;
or any other typedef, it helps debugging in MSVC++ if you
provide a name for the enum or struct:
typedef enum _Jbig2Options{
JBIG2_OPTIONS_EMBEDDED = 1
} Jbig2Options;
After compiling on Windows, the file 042_1.jb2 was decoded
to a page of text.
Russell Lang gsview@ghostgum.com.au
Ghostgum Software Pty Ltd http://www.ghostgum.com.au/
--Message-Boundary-28871
Content-type: Application/Octet-stream; name="msvcwarn.txt"; type=Text
Content-disposition: attachment; filename="msvcwarn.txt"
cl -nologo -W4 -Zi -DHAVE_STRING_H=1 -Ilibpng -Izlib -c getopt.c
getopt.c
getopt.c(217) : warning C4131: 'my_index' : uses old-style declarator
getopt.c(300) : warning C4131: 'exchange' : uses old-style declarator
getopt.c(385) : warning C4131: '_getopt_initialize' : uses old-style declarator
getopt.c(447) : warning C4100: 'argv' : unreferenced formal parameter
getopt.c(447) : warning C4100: 'argc' : unreferenced formal parameter
getopt.c(507) : warning C4131: '_getopt_internal' : uses old-style declarator
getopt.c(973) : warning C4131: 'getopt' : uses old-style declarator
cl -nologo -W4 -Zi -DHAVE_STRING_H=1 -Ilibpng -Izlib -c getopt1.c
getopt1.c
getopt1.c(68) : warning C4131: 'getopt_long' : uses old-style declarator
getopt1.c(84) : warning C4131: 'getopt_long_only' : uses old-style declarator
cl -nologo -W4 -Zi -DHAVE_STRING_H=1 -Ilibpng -Izlib -c jbig2.c
jbig2.c
jbig2.c(27) : warning C4100: 'allocator' : unreferenced formal parameter
jbig2.c(33) : warning C4100: 'allocator' : unreferenced formal parameter
jbig2.c(39) : warning C4100: 'allocator' : unreferenced formal parameter
jbig2.c(170) : warning C4018: '<' : signed/unsigned mismatch
jbig2.c(176) : warning C4018: '>' : signed/unsigned mismatch
jbig2.c(179) : warning C4018: '<=' : signed/unsigned mismatch
jbig2.c(191) : warning C4018: '<' : signed/unsigned mismatch
jbig2.c(315) : warning C4101: 'seg_ix' : unreferenced local variable
jbig2.c(359) : warning C4018: '<' : signed/unsigned mismatch
jbig2.c(367) : warning C4018: '<' : signed/unsigned mismatch
d:\data\src\jbig2dec\jbig2.c(307) : warning C4702: unreachable code
cl -nologo -W4 -Zi -DHAVE_STRING_H=1 -Ilibpng -Izlib -c jbig2_arith.c
jbig2_arith.c
jbig2_arith.c(63) : warning C4244: '=' : conversion from 'uint32_t' to 'byte', possible loss of data
jbig2_arith.c(72) : warning C4244: '=' : conversion from 'uint32_t' to 'byte', possible loss of data
jbig2_arith.c(101) : warning C4244: '=' : conversion from 'uint32_t' to 'byte', possible loss of data
jbig2_arith.c(145) : warning C4244: '=' : conversion from 'uint32_t' to 'byte', possible loss of data
jbig2_arith.c(166) : warning C4100: 'ctx' : unreferenced formal parameter
cl -nologo -W4 -Zi -DHAVE_STRING_H=1 -Ilibpng -Izlib -c jbig2_arith_iaid.c
jbig2_arith_iaid.c
jbig2_arith_iaid.c(27) : warning C4013: 'memset' undefined; assuming extern returning int
cl -nologo -W4 -Zi -DHAVE_STRING_H=1 -Ilibpng -Izlib -c jbig2_arith_int.c
jbig2_arith_int.c
jbig2_arith_int.c(19) : warning C4013: 'memset' undefined; assuming extern returning int
cl -nologo -W4 -Zi -DHAVE_STRING_H=1 -Ilibpng -Izlib -c jbig2_generic.c
jbig2_generic.c
jbig2_generic.c(32) : warning C4100: 'params' : unreferenced formal parameter
jbig2_generic.c(31) : warning C4100: 'segment' : unreferenced formal parameter
jbig2_generic.c(30) : warning C4100: 'ctx' : unreferenced formal parameter
jbig2_generic.c(42) : warning C4189: 'LTP' : local variable is initialized but not referenced
jbig2_generic.c(101) : warning C4100: 'params' : unreferenced formal parameter
jbig2_generic.c(100) : warning C4100: 'segment' : unreferenced formal parameter
jbig2_generic.c(99) : warning C4100: 'ctx' : unreferenced formal parameter
jbig2_generic.c(111) : warning C4189: 'LTP' : local variable is initialized but not referenced
jbig2_generic.c(170) : warning C4100: 'params' : unreferenced formal parameter
jbig2_generic.c(169) : warning C4100: 'segment' : unreferenced formal parameter
jbig2_generic.c(168) : warning C4100: 'ctx' : unreferenced formal parameter
jbig2_generic.c(180) : warning C4189: 'LTP' : local variable is initialized but not referenced
jbig2_generic.c(239) : warning C4100: 'params' : unreferenced formal parameter
jbig2_generic.c(238) : warning C4100: 'segment' : unreferenced formal parameter
jbig2_generic.c(237) : warning C4100: 'ctx' : unreferenced formal parameter
jbig2_generic.c(249) : warning C4189: 'LTP' : local variable is initialized but not referenced
jbig2_generic.c(349) : warning C4013: 'printf' undefined; assuming extern returning int
jbig2_generic.c(398) : warning C4013: 'memcpy' undefined; assuming extern returning int
jbig2_generic.c(428) : warning C4013: 'memset' undefined; assuming extern returning int
cl -nologo -W4 -Zi -DHAVE_STRING_H=1 -Ilibpng -Izlib -c jbig2_huffman.c
jbig2_huffman.c
jbig2_huffman.c(208) : warning C4244: '=' : conversion from 'int' to 'byte', possible loss of data
jbig2_huffman.c(209) : warning C4244: '=' : conversion from 'int' to 'byte', possible loss of data
jbig2_huffman.c(225) : warning C4244: '=' : conversion from 'int' to 'byte', possible loss of data
cl -nologo -W4 -Zi -DHAVE_STRING_H=1 -Ilibpng -Izlib -c jbig2_image.c
jbig2_image.c
jbig2_image.c(93) : warning C4013: 'memcpy' undefined; assuming extern returning int
jbig2_image.c(108) : warning C4244: '=' : conversion from 'int' to 'uint8_t', possible loss of data
jbig2_image.c(122) : warning C4244: '=' : conversion from 'int' to 'uint8_t', possible loss of data
jbig2_image.c(124) : warning C4244: '=' : conversion from 'int' to 'uint8_t', possible loss of data
jbig2_image.c(126) : warning C4244: '=' : conversion from 'int' to 'uint8_t', possible loss of data
cl -nologo -W4 -Zi -DHAVE_STRING_H=1 -Ilibpng -Izlib -c jbig2_image_pbm.c
jbig2_image_pbm.c
jbig2_image_pbm.c(42) : warning C4189: 'p' : local variable is initialized but not referenced
jbig2_image_pbm.c(41) : warning C4101: 'i' : unreferenced local variable
jbig2_image_pbm.c(83) : warning C4244: '=' : conversion from 'int' to 'char', possible loss of data
jbig2_image_pbm.c(86) : warning C4244: '=' : conversion from 'int' to 'char', possible loss of data
jbig2_image_pbm.c(97) : warning C4244: '=' : conversion from 'int' to 'char', possible loss of data
jbig2_image_pbm.c(102) : warning C4244: '=' : conversion from 'int' to 'char', possible loss of data
jbig2_image_pbm.c(105) : warning C4013: 'isdigit' undefined; assuming extern returning int
jbig2_image_pbm.c(107) : warning C4244: '=' : conversion from 'int' to 'char', possible loss of data
jbig2_image_pbm.c(76) : warning C4101: 'pbm_stride' : unreferenced local variable
jbig2_image_pbm.c(76) : warning C4101: 'stride' : unreferenced local variable
jbig2_image_pbm.c(80) : warning C4101: 'data' : unreferenced local variable
cl -nologo -W4 -Zi -DHAVE_STRING_H=1 -Ilibpng -Izlib -c jbig2_image_png.c
jbig2_image_png.c
jbig2_image_png.c(34) : warning C4013: 'jbig2_image_write_png' undefined; assuming extern returning int
cl -nologo -W4 -Zi -DHAVE_STRING_H=1 -Ilibpng -Izlib -c jbig2_mmr.c
jbig2_mmr.c
jbig2_mmr.c(40) : warning C4018: '<' : signed/unsigned mismatch
jbig2_mmr.c(54) : warning C4018: '<' : signed/unsigned mismatch
jbig2_mmr.c(735) : warning C4127: conditional expression is constant
jbig2_mmr.c(738) : warning C4013: 'printf' undefined; assuming extern returning int
jbig2_mmr.c(731) : warning C4100: 'dst' : unreferenced formal parameter
jbig2_mmr.c(731) : warning C4100: 'ref' : unreferenced formal parameter
jbig2_mmr.c(733) : warning C4189: 'a0' : local variable is initialized but not referenced
jbig2_mmr.c(796) : warning C4100: 'params' : unreferenced formal parameter
jbig2_mmr.c(795) : warning C4100: 'segment' : unreferenced formal parameter
jbig2_mmr.c(794) : warning C4100: 'ctx' : unreferenced formal parameter
d:\data\src\jbig2dec\jbig2_mmr.c(812) : warning C4716: 'jbig2_decode_generic_mmr' : must return a value
cl -nologo -W4 -Zi -DHAVE_STRING_H=1 -Ilibpng -Izlib -c jbig2_page.c
jbig2_page.c
jbig2_page.c(98) : warning C4047: 'return' : 'int' differs in levels of indirection from 'void *'
jbig2_page.c(144) : warning C4047: 'return' : 'int' differs in levels of indirection from 'void *'
jbig2_page.c(163) : warning C4100: 'segment_data' : unreferenced formal parameter
jbig2_page.c(199) : warning C4101: 'image' : unreferenced local variable
cl -nologo -W4 -Zi -DHAVE_STRING_H=1 -Ilibpng -Izlib -c jbig2_segment.c
jbig2_segment.c
jbig2_segment.c(79) : warning C4057: '=' : 'int32_t *' differs in indirection to slightly different base types from 'uint32_t *'
jbig2_segment.c(89) : warning C4018: '>' : signed/unsigned mismatch
jbig2_segment.c(166) : warning C4013: 'jbig2_immediate_generic_region' undefined; assuming extern returning int
cl -nologo -W4 -Zi -DHAVE_STRING_H=1 -Ilibpng -Izlib -c jbig2_symbol_dict.c
jbig2_symbol_dict.c
jbig2_symbol_dict.c(175) : warning C4013: 'memcpy' undefined; assuming extern returning int
jbig2_symbol_dict.c(284) : warning C4013: 'memset' undefined; assuming extern returning int
d:\data\src\jbig2dec\jbig2_symbol_dict.c(144) : warning C4701: local variable 'code' may be used without having been initialized
d:\data\src\jbig2dec\jbig2_symbol_dict.c(117) : warning C4701: local variable 'HCDH' may be used without having been initialized
d:\data\src\jbig2dec\jbig2_symbol_dict.c(146) : warning C4701: local variable 'DW' may be used without having been initialized
cl -nologo -W4 -Zi -DHAVE_STRING_H=1 -Ilibpng -Izlib -c jbig2_text.c
jbig2_text.c
jbig2_text.c(113) : warning C4018: '<' : signed/unsigned mismatch
jbig2_text.c(134) : warning C4018: '<' : signed/unsigned mismatch
jbig2_text.c(220) : warning C4057: 'function' : 'int32_t *' differs in indirection to slightly different base types from 'uint32_t *'
d:\data\src\jbig2dec\jbig2_text.c(220) : warning C4701: local variable 'as' may be used without having been initialized
d:\data\src\jbig2dec\jbig2_text.c(192) : warning C4701: local variable 'code' may be used without having been initialized
d:\data\src\jbig2dec\jbig2_text.c(151) : warning C4701: local variable 'STRIPT' may be used without having been initialized
d:\data\src\jbig2dec\jbig2_text.c(163) : warning C4701: local variable 'DT' may be used without having been initialized
d:\data\src\jbig2dec\jbig2_text.c(179) : warning C4701: local variable 'DFS' may be used without having been initialized
d:\data\src\jbig2dec\jbig2_text.c(198) : warning C4701: local variable 'CURS' may be used without having been initialized
d:\data\src\jbig2dec\jbig2_text.c(198) : warning C4701: local variable 'IDS' may be used without having been initialized
d:\data\src\jbig2dec\jbig2_text.c(212) : warning C4701: local variable 'CURT' may be used without having been initialized
d:\data\src\jbig2dec\jbig2_text.c(222) : warning C4701: local variable 'ID' may be used without having been initialized
d:\data\src\jbig2dec\jbig2_text.c(270) : warning C4701: local variable 'x' may be used without having been initialized
d:\data\src\jbig2dec\jbig2_text.c(270) : warning C4701: local variable 'y' may be used without having been initialized
d:\data\src\jbig2dec\jbig2_text.c(362) : warning C4700: local variable 'huffman_flags' used without having been initialized
cl -nologo -W4 -Zi -DHAVE_STRING_H=1 -Ilibpng -Izlib -c jbig2dec.c
jbig2dec.c
jbig2dec.c(82) : warning C4127: conditional expression is constant
jbig2dec.c(119) : warning C4100: 'error_callback_data' : unreferenced formal parameter
cl -nologo -W4 -Zi -DHAVE_STRING_H=1 -Ilibpng -Izlib -Fejbig2dec.exe getopt.obj getopt1.obj jbig2.obj jbig2_arith.obj jbig2_arith_iaid.obj jbig2_arith_int.obj jbig2_generic.obj jbig2_huffman.obj jbig2_image.obj jbig2_image_pbm.obj jbig2_image_png.obj jbig2_mmr.obj jbig2_page.obj jbig2_segment.obj jbig2_symbol_dict.obj jbig2_text.obj jbig2dec.obj libpng\libpng.lib zlib\zlib.lib
--Message-Boundary-28871
Content-type: Application/Octet-stream; name="msvc.txt"; type=Text
Content-disposition: attachment; filename="msvc.txt"
diff -c l:/cvs/jbig2dec/jbig2.c ./jbig2.c
*** l:/cvs/jbig2dec/jbig2.c Mon Jun 24 23:28:13 2002
--- ./jbig2.c Thu Jul 04 11:46:44 2002
***************
*** 11,19 ****
$Id: jbig2.c,v 1.10 2002/06/24 23:28:13 giles Exp $
*/
! #include <stdint.h>
#include <stdlib.h>
#include <stdarg.h>
#include <stdio.h>
#include "jbig2.h"
--- 11,20 ----
$Id: jbig2.c,v 1.10 2002/06/24 23:28:13 giles Exp $
*/
! #include "stdint_.h"
#include <stdlib.h>
#include <stdarg.h>
+ #include <string.h>
#include <stdio.h>
#include "jbig2.h"
***************
*** 78,84 ****
n = vsnprintf (buf, sizeof(buf), fmt, ap);
va_end (ap);
if (n < 0 || n == sizeof(buf))
! strcpy (buf, "jbig2_error: error in generating error string");
code = ctx->error_callback (ctx->error_callback_data, buf, severity, seg_idx);
if (severity == JBIG2_SEVERITY_FATAL)
code = -1;
--- 79,86 ----
n = vsnprintf (buf, sizeof(buf), fmt, ap);
va_end (ap);
if (n < 0 || n == sizeof(buf))
! strncpy (buf, "jbig2_error: error in generating error string",
! sizeof(buf));
code = ctx->error_callback (ctx->error_callback_data, buf, severity, seg_idx);
if (severity == JBIG2_SEVERITY_FATAL)
code = -1;
diff -c l:/cvs/jbig2dec/jbig2.h ./jbig2.h
*** l:/cvs/jbig2dec/jbig2.h Wed Jul 03 19:43:21 2002
--- ./jbig2.h Thu Jul 04 11:38:22 2002
***************
*** 15,21 ****
extern "C" {
#endif
! #include <stdint.h> // for C99 types -- need a more portable sol'n
/* warning levels */
typedef enum {
--- 15,21 ----
extern "C" {
#endif
! #include "stdint_.h" // for C99 types -- need a more portable sol'n
/* warning levels */
typedef enum {
diff -c l:/cvs/jbig2dec/jbig2_arith.c ./jbig2_arith.c
*** l:/cvs/jbig2dec/jbig2_arith.c Wed Jun 05 00:15:57 2002
--- ./jbig2_arith.c Wed Jul 03 22:13:10 2002
***************
*** 13,19 ****
#include <stdio.h>
#include <stdlib.h>
! #include <stdint.h>
#include "jbig2.h"
#include "jbig2_priv.h"
--- 13,19 ----
#include <stdio.h>
#include <stdlib.h>
! #include "stdint_.h"
#include "jbig2.h"
#include "jbig2_priv.h"
diff -c l:/cvs/jbig2dec/jbig2_arith_iaid.c ./jbig2_arith_iaid.c
*** l:/cvs/jbig2dec/jbig2_arith_iaid.c Mon Jul 01 19:34:31 2002
--- ./jbig2_arith_iaid.c Wed Jul 03 22:13:12 2002
***************
*** 5,11 ****
#endif
#include <stddef.h>
! #include <stdint.h>
#include "jbig2.h"
#include "jbig2_priv.h"
#include "jbig2_arith.h"
--- 5,11 ----
#endif
#include <stddef.h>
! #include "stdint_.h"
#include "jbig2.h"
#include "jbig2_priv.h"
#include "jbig2_arith.h"
diff -c l:/cvs/jbig2dec/jbig2_arith_int.c ./jbig2_arith_int.c
*** l:/cvs/jbig2dec/jbig2_arith_int.c Wed Jun 05 00:03:49 2002
--- ./jbig2_arith_int.c Wed Jul 03 22:13:16 2002
***************
*** 1,7 ****
/* Annex A */
#include <stddef.h>
! #include <stdint.h>
#include "jbig2.h"
#include "jbig2_priv.h"
#include "jbig2_arith.h"
--- 1,7 ----
/* Annex A */
#include <stddef.h>
! #include "stdint_.h"
#include "jbig2.h"
#include "jbig2_priv.h"
#include "jbig2_arith.h"
diff -c l:/cvs/jbig2dec/jbig2_generic.c ./jbig2_generic.c
*** l:/cvs/jbig2dec/jbig2_generic.c Mon Jun 24 15:51:57 2002
--- ./jbig2_generic.c Wed Jul 03 22:13:20 2002
***************
*** 15,21 ****
* Generic region handlers.
**/
! #include <stdint.h>
#include <stddef.h>
#ifdef OUTPUT_PBM
#include <stdio.h>
--- 15,21 ----
* Generic region handlers.
**/
! #include "stdint_.h"
#include <stddef.h>
#ifdef OUTPUT_PBM
#include <stdio.h>
diff -c l:/cvs/jbig2dec/jbig2_image.c ./jbig2_image.c
*** l:/cvs/jbig2dec/jbig2_image.c Wed Jul 03 21:51:09 2002
--- ./jbig2_image.c Wed Jul 03 22:13:24 2002
***************
*** 13,19 ****
#include <stdio.h>
#include <stdlib.h>
! #include <stdint.h>
#include "jbig2.h"
#include "jbig2_priv.h"
--- 13,19 ----
#include <stdio.h>
#include <stdlib.h>
! #include "stdint_.h"
#include "jbig2.h"
#include "jbig2_priv.h"
diff -c l:/cvs/jbig2dec/jbig2_mmr.c ./jbig2_mmr.c
*** l:/cvs/jbig2dec/jbig2_mmr.c Sat Jun 22 16:05:45 2002
--- ./jbig2_mmr.c Wed Jul 03 22:13:30 2002
***************
*** 2,8 ****
in Ghostscript.
*/
! #include <stdint.h>
#include <stddef.h>
#ifdef OUTPUT_PBM
#include <stdio.h>
--- 2,8 ----
in Ghostscript.
*/
! #include "stdint_.h"
#include <stddef.h>
#ifdef OUTPUT_PBM
#include <stdio.h>
diff -c l:/cvs/jbig2dec/jbig2_segment.c ./jbig2_segment.c
*** l:/cvs/jbig2dec/jbig2_segment.c Mon Jun 24 23:28:13 2002
--- ./jbig2_segment.c Wed Jul 03 22:13:36 2002
***************
*** 13,19 ****
#include <stdio.h>
#include <stdlib.h>
! #include <stdint.h>
#include "jbig2.h"
#include "jbig2_priv.h"
--- 13,19 ----
#include <stdio.h>
#include <stdlib.h>
! #include "stdint_.h"
#include "jbig2.h"
#include "jbig2_priv.h"
diff -c l:/cvs/jbig2dec/jbig2_symbol_dict.c ./jbig2_symbol_dict.c
*** l:/cvs/jbig2dec/jbig2_symbol_dict.c Mon Jun 24 19:09:47 2002
--- ./jbig2_symbol_dict.c Wed Jul 03 22:13:38 2002
***************
*** 14,20 ****
*/
#include <stddef.h>
! #include <stdint.h>
#ifdef HAVE_CONFIG_H
#include "config.h"
--- 14,20 ----
*/
#include <stddef.h>
! #include "stdint_.h"
#ifdef HAVE_CONFIG_H
#include "config.h"
diff -c l:/cvs/jbig2dec/jbig2_text.c ./jbig2_text.c
*** l:/cvs/jbig2dec/jbig2_text.c Wed Jul 03 00:08:40 2002
--- ./jbig2_text.c Wed Jul 03 22:13:42 2002
***************
*** 12,18 ****
*/
#include <stddef.h>
! #include <stdint.h>
#include <stdio.h>
#include <string.h> /* memset() */
--- 12,18 ----
*/
#include <stddef.h>
! #include "stdint_.h"
#include <stdio.h>
#include <string.h> /* memset() */
diff -c l:/cvs/jbig2dec/jbig2dec.c ./jbig2dec.c
*** l:/cvs/jbig2dec/jbig2dec.c Sat Jun 22 10:08:43 2002
--- ./jbig2dec.c Wed Jul 03 22:13:44 2002
***************
*** 13,19 ****
#include <stdio.h>
#include <stdlib.h>
! #include <stdint.h>
#include <string.h>
#ifdef HAVE_CONFIG_H
--- 13,19 ----
#include <stdio.h>
#include <stdlib.h>
! #include "stdint_.h"
#include <string.h>
#ifdef HAVE_CONFIG_H
diff -c l:/cvs/jbig2dec/msvc.mak ./msvc.mak
*** l:/cvs/jbig2dec/msvc.mak Thu Jul 04 11:48:23 2002
--- ./msvc.mak Thu Jul 04 11:40:04 2002
***************
*** 0 ****
--- 1,93 ----
+ # makefile for jbig2dec
+
+ EXE=.exe
+ OBJ=.obj
+ NUL=
+ CFLAGS=-nologo -W4 -Zi -DHAVE_STRING_H=1 -Ilibpng -Izlib
+ CC=cl
+ FE=-Fe
+
+ OBJS=getopt$(OBJ) getopt1$(OBJ) jbig2$(OBJ) jbig2_arith$(OBJ) \
+ jbig2_arith_iaid$(OBJ) jbig2_arith_int$(OBJ) jbig2_generic$(OBJ) \
+ jbig2_huffman$(OBJ) jbig2_image$(OBJ) jbig2_image_pbm$(OBJ) \
+ jbig2_image_png$(OBJ) jbig2_mmr$(OBJ) jbig2_page$(OBJ) \
+ jbig2_segment$(OBJ) jbig2_symbol_dict$(OBJ) jbig2_text$(OBJ) \
+ jbig2dec$(OBJ)
+
+ HDRS=getopt.h jbig2.h jbig2_arith.h jbig2_arith_iaid.h jbig2_arith_int.h \
+ jbig2_generic.h jbig2_huffman.h jbig2_hufftab.h jbig2_image.h \
+ jbig2_mmr.h jbig2_priv.h jbig2_symbol_dict.h stdint_.h
+
+ all: jbig2dec$(EXE)
+
+ jbig2dec$(EXE): $(OBJS)
+ $(CC) $(CFLAGS) $(FE)jbig2dec$(EXE) $(OBJS) libpng\libpng.lib zlib\zlib.lib
+
+ getopt$(OBJ): getopt.c getopt.h
+ $(CC) $(CFLAGS) -c getopt.c
+
+ getopt1$(OBJ): getopt1.c getopt.h
+ $(CC) $(CFLAGS) -c getopt1.c
+
+ jbig2$(OBJ): jbig2.c $(HDRS)
+ $(CC) $(CFLAGS) -c jbig2.c
+
+ jbig2_arith$(OBJ): jbig2_arith.c $(HDRS)
+ $(CC) $(CFLAGS) -c jbig2_arith.c
+
+ jbig2_arith_iaid$(OBJ): jbig2_arith_iaid.c $(HDRS)
+ $(CC) $(CFLAGS) -c jbig2_arith_iaid.c
+
+ jbig2_arith_int$(OBJ): jbig2_arith_int.c $(HDRS)
+ $(CC) $(CFLAGS) -c jbig2_arith_int.c
+
+ jbig2_generic$(OBJ): jbig2_generic.c $(HDRS)
+ $(CC) $(CFLAGS) -c jbig2_generic.c
+
+ jbig2_huffman$(OBJ): jbig2_huffman.c $(HDRS)
+ $(CC) $(CFLAGS) -c jbig2_huffman.c
+
+ jbig2_image$(OBJ): jbig2_image.c $(HDRS)
+ $(CC) $(CFLAGS) -c jbig2_image.c
+
+ jbig2_image_pbm$(OBJ): jbig2_image_pbm.c $(HDRS)
+ $(CC) $(CFLAGS) -c jbig2_image_pbm.c
+
+ jbig2_image_png$(OBJ): jbig2_image_png.c $(HDRS)
+ $(CC) $(CFLAGS) -c jbig2_image_png.c
+
+ jbig2_mmr$(OBJ): jbig2_mmr.c $(HDRS)
+ $(CC) $(CFLAGS) -c jbig2_mmr.c
+
+ jbig2_page$(OBJ): jbig2_page.c $(HDRS)
+ $(CC) $(CFLAGS) -c jbig2_page.c
+
+ jbig2_segment$(OBJ): jbig2_segment.c $(HDRS)
+ $(CC) $(CFLAGS) -c jbig2_segment.c
+
+ jbig2_symbol_dict$(OBJ): jbig2_symbol_dict.c $(HDRS)
+ $(CC) $(CFLAGS) -c jbig2_symbol_dict.c
+
+ jbig2_text$(OBJ): jbig2_text.c $(HDRS)
+ $(CC) $(CFLAGS) -c jbig2_text.c
+
+ jbig2dec$(OBJ): jbig2dec.c $(HDRS)
+ $(CC) $(CFLAGS) -c jbig2dec.c
+
+ pbm2png$(OBJ): pbm2png.c $(HDRS)
+ $(CC) $(CFLAGS) -c pbm2png.c
+
+ pbm2png$(EXE): pbm2png$(OBJ) jbig2_image$(OBJ)
+ $(CC) $(CFLAGS) $(FE)pbm2png$(EXE) pbm2png$(OBJ) jbig2_image$(OBJ) libpng\libpng.lib
+
+ clean:
+ -del $(OBJS)
+ -del jbig2dec$(EXE)
+ -del jbig2dec.ilk
+ -del jbig2dec.pdb
+ -del pbm2png$(EXE)
+ -del pbm2png.ilk
+ -del pbm2png.pdb
+ -del vc70.pdb
+ -del vc60.pdb
+ -del vc50.pdb
diff -c l:/cvs/jbig2dec/pbm2png.c ./pbm2png.c
*** l:/cvs/jbig2dec/pbm2png.c Tue Jun 04 16:51:02 2002
--- ./pbm2png.c Thu Jul 04 11:30:42 2002
***************
*** 13,20 ****
#include <stdio.h>
#include <stdlib.h>
! #include <stdint.h>
#include <string.h>
#include "jbig2_image.h"
int main(int argc, char *argv[])
--- 13,21 ----
#include <stdio.h>
#include <stdlib.h>
! #include "stdint_.h"
#include <string.h>
+ #include "jbig2.h"
#include "jbig2_image.h"
int main(int argc, char *argv[])
***************
*** 22,28 ****
Jbig2Image *image;
int error;
! image = jbig2_image_read_pbm_file(argv[1]);
if(image == NULL) {
fprintf(stderr, "error reading pbm file '%s'\n", argv[1]);
return 1;
--- 23,29 ----
Jbig2Image *image;
int error;
! image = jbig2_image_read_pbm_file(image, argv[1]);
if(image == NULL) {
fprintf(stderr, "error reading pbm file '%s'\n", argv[1]);
return 1;
diff -c l:/cvs/jbig2dec/stdint_.h ./stdint_.h
*** l:/cvs/jbig2dec/stdint_.h Thu Jul 04 11:48:35 2002
--- ./stdint_.h Thu Jul 04 11:36:16 2002
***************
*** 0 ****
--- 1,24 ----
+ /* stdint_.h */
+
+ #ifndef _STDINT__H
+ #define _STDINT__H
+
+ # ifdef _MSC_VER /* Microsoft Visual C++ */
+ typedef signed char int8_t;
+ typedef short int int16_t;
+ typedef int int32_t;
+ typedef __int64 int64_t;
+
+ typedef unsigned char uint8_t;
+ typedef unsigned short int uint16_t;
+ typedef unsigned int uint32_t;
+ /* no uint64_t */
+
+ # define vsnprintf _vsnprintf
+ # define snprintf _snprintf
+ # else
+ # include <stdint.h>
+ # endif
+
+ #endif
+
--Message-Boundary-28871--