Hylafax Mailing List Archives
|
[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
SOLVED Re: tiff-3.5-interfaces.patch error
There are three problems with the tiff-3.5-interfaces.patch file as found
on the HylaFAX website which causes the patch to crash (review of the rej
files makes hand-modification simple, though). The "/* $Id:
tiff-3.5-interfaces..." vs. "/* $Id: tif_fax3.h..." problem is confusing to
me, but the others were merely whitespace or tabbing errors.
This, however, is insufficient, as it does *not* modify ./configure from
checking version 3.4 to 3.5. I have made those additions to the patch file.
Attached and following is my corrected copy of tiff-3.5-interfaces.patch
Thanks.
Lee Howard
At 05:47 PM 5/10/00 -0600, you wrote:
>Robert, when applying the tiff-3.5-interfaces.patch file on my RedHat 6.1
>(updated) system I get the following:
>
...
# tiff-3.5-interfaces.patch
# Robert Colquhoun <rjc@trump.net.au> Wed, 22
Mar 2000 09:57:00
# modified Thurs, 11 May 2000 by Lee Howard
<faxguy@deanox.com>
#
# Attached is a patch so that hylafax works with tiff
3.5. The tiff
# maintainers changed a few of the internal interfaces to
achieve large
# run lengths (from 16 to 32 bits). Hylafax uses one of
libtiffs header
# files(faxd/tif_fax3.h) for some undocumented macros and
interfaces and
# was only expecting 16 bits, and broke.
#
# I successfully
sent one fax with this patch and libtiff 3.5...anything
# more complicated
might or might not work ;-)
#
# Instructions: From main source directory
run command :
# patch -bp0 --verbose <tiff-3.5-interfaces.patch
---
configure 1999/07/26 08:57:29
+++ configure 2000/05/11 22:03:01
@@ -2865,7
+2865,7 @@
printf("old include files: version %u\n", TIFFLIB_VERSION);
exit(-1);
}
- if (strncmp(TIFFGetVersion(), "LIBTIFF, Version
3.4", 20) != 0) {
+ if (strncmp(TIFFGetVersion(), "LIBTIFF, Version
3.5", 20) != 0) {
printf("old library: version %s\n", TIFFGetVersion());
exit(-1);
} else
--- faxd/CopyQuality.c++ 1999/09/02 10:16:22 1.4
+++
faxd/CopyQuality.c++ 2000/03/22 12:32:01
@@ -50,7 +50,7 @@
setupDecoder(conf.recvFillOrder, params.is2D());
u_int rowpixels =
params.pageWidth(); // NB: assume rowpixels <= 2432
- uint16
runs[2*2432]; // run arrays for cur+ref rows
+ uint32 runs[2*2432];
// run arrays for cur+ref rows
setRuns(runs, runs+2432, rowpixels);
recvEOLCount = 0; // count of EOL codes
--- faxd/G3Decoder.c++
1999/06/13 07:41:03 1.2
+++ faxd/G3Decoder.c++ 2000/03/22 12:32:04
@@
-41,13 +41,13 @@
DECLARE_STATE_EOL(); \
int a0; /*
reference element */ \
int RunLength; /* length of current run */
\
- uint16* pa; /* place to stuff next run */ \
- uint16* thisrun;
/* current row's run array */ \
+ uint32* pa; /* place to stuff
next run */ \
+ uint32* thisrun; /* current row's run array */ \
const TIFFFaxTabEnt* TabEnt
#define DECLARE_STATE_2D() \
DECLARE_STATE(); \
int b1; /* next change on prev line */ \
-
uint16* pb /* next run in reference line */
+ uint32* pb /*
next run in reference line */
/*
* Load any state that may be changed
during decoding.
*/
@@ -113,7 +113,7 @@
}
void
-G3Decoder::setRuns(uint16* cr, uint16* rr, int
w)
+G3Decoder::setRuns(uint32* cr, uint32* rr, int w)
{
curruns =
cr;
if (refruns = rr) {
@@ -134,7 +134,7 @@
{
u_int rowbytes =
howmany(w, 8);
if (curruns == NULL) {
- uint16 runs[2*2432]; // run
arrays for cur+ref rows
+ uint32 runs[2*2432]; // run arrays for cur+ref
rows
setRuns(runs, runs+2432, w);
while (h-- > 0) {
decodeRow(raster, w);
@@ -235,7 +235,7 @@
_TIFFFax3fillruns((u_char*)
scanline, thisrun, pa, lastx);
if (is2D) {
SETVAL(0); // imaginary
change for reference
- SWAP(uint16*, curruns, refruns);
+ SWAP(uint32*,
curruns, refruns);
}
rowref++;
UNCACHE_STATE();
---
faxd/G3Decoder.h 1999/06/13 07:41:03 1.2
+++ faxd/G3Decoder.h 2000/03/22
12:32:05
@@ -43,8 +43,8 @@
int RTCrun; // count of consecutive
zero-length rows
int rowref; // reference count of rows decoded
int RTCrow; // row number of start of RTC
- uint16* refruns; // runs
for reference line
- uint16* curruns; // runs for current line
+
uint32* refruns; // runs for reference line
+ uint32* curruns; // runs
for current line
const u_char* bitmap; // bit reversal table
protected:
G3Decoder();
@@ -68,8 +68,8 @@
virtual ~G3Decoder();
void setupDecoder(u_int fillorder, bool is2D);
- void
setRuns(uint16*, uint16*, int);
- uint16* lastRuns();
+ void
setRuns(uint32*, uint32*, int);
+ uint32* lastRuns();
void
decode(void* raster, u_int w, u_int h);
bool decodeRow(void* scanline,
u_int w);
@@ -92,7 +92,7 @@
#define EOFraised() (sigsetjmp(jmpEOF, 0) !=
0)
#define RTCraised() (sigsetjmp(jmpRTC, 0) != 0)
-inline uint16*
G3Decoder::lastRuns() { return is2D ? refruns : curruns; }
+inline uint32*
G3Decoder::lastRuns() { return is2D ? refruns : curruns; }
inline const
u_char* G3Decoder::getBitmap() { return bitmap; }
inline int
G3Decoder::getPendingBits() const { return bit; }
inline bool
G3Decoder::seenRTC() const { return (RTCrow != -1); }
--- faxd/TagLine.c++
1999/08/23 11:19:34 1.4
+++ faxd/TagLine.c++ 2000/03/22 12:32:13
@@ -208,7
+208,7 @@
*/
TagLineMemoryDecoder dec(buf);
dec.setupDecoder(fillorder, params.is2D());
- uint16 runs[2*2432]; //
run arrays for cur+ref rows
+ uint32 runs[2*2432]; // run arrays for
cur+ref rows
dec.setRuns(runs, runs+2432, w);
dec.decode(NULL,
w, th); // discard decoded data
--- faxd/choptest.c++ 1999/06/13 07:41:05
1.2
+++ faxd/choptest.c++ 2000/03/22 12:32:14
@@ -70,7 +70,7 @@
}
static bool
-isBlank(uint16* runs, u_int rowpixels)
+isBlank(uint32* runs,
u_int rowpixels)
{
u_int x = 0;
for (;;) {
@@ -89,7 +89,7 @@
{
setupDecoder(fillorder, params.is2D());
u_int rowpixels =
params.pageWidth(); // NB: assume rowpixels <= 2432
- uint16
runs[2*2432]; // run arrays for cur+ref rows
+ uint32 runs[2*2432];
// run arrays for cur+ref rows
setRuns(runs, runs+2432, rowpixels);
if (!RTCraised()) {
--- faxd/cqtest.c++ 1999/09/02 10:16:22 1.4
+++
faxd/cqtest.c++ 2000/03/22 12:32:16
@@ -144,7 +144,7 @@
setupDecoder(recvFillOrder, params.is2D());
u_int rowpixels =
params.pageWidth(); // NB: assume rowpixels <= 2432
- uint16
runs[2*2432]; // run arrays for cur+ref rows
+ uint32 runs[2*2432];
// run arrays for cur+ref rows
setRuns(runs, runs+2432, rowpixels);
recvEOLCount = 0; // count of EOL codes
--- faxd/faxQueueApp.c++
2000/03/08 13:44:06 1.7
+++ faxd/faxQueueApp.c++ 2000/03/22 12:32:43
@@
-805,7 +805,7 @@
}
static bool
-isBlank(uint16* runs, u_int
rowpixels)
+isBlank(uint32* runs, u_int rowpixels)
{
u_int x = 0;
for (;;) {
@@ -824,7 +824,7 @@
{
setupDecoder(fillorder,
params.is2D());
u_int rowpixels = params.pageWidth(); // NB: assume
rowpixels <= 2432
- uint16 runs[2*2432]; // run arrays for cur+ref
rows
+ uint32 runs[2*2432]; // run arrays for cur+ref rows
setRuns(runs, runs+2432, rowpixels);
if (!RTCraised()) {
---
faxd/tagtest.c++ 1999/08/23 11:19:35 1.4
+++ faxd/tagtest.c++ 2000/03/22
12:32:47
@@ -236,7 +236,7 @@
*/
MemoryDecoder dec(buf);
dec.setupDecoder(fillorder, params.is2D());
- uint16 runs[2*2432]; //
run arrays for cur+ref rows
+ uint32 runs[2*2432]; // run arrays for
cur+ref rows
dec.setRuns(runs, runs+2432, w);
u_int row;
---
faxd/tif_fax3.h 1998/10/12 20:47:49 1.1.1.1
+++ faxd/tif_fax3.h 2000/03/22
12:32:51
@@ -1,8 +1,8 @@
-/* $Id: tif_fax3.h,v 1.1.1.1 1998/10/12 20:47:49
root Exp $ */
+/* $Id: tif_fax3.h,v 1.1.1.1 1998/10/12 20:47:49 root Exp $
*/
/*
- * Copyright (c) 1990-1996 Sam Leffler
- * Copyright (c)
1991-1996 Silicon Graphics, Inc.
+ * Copyright (c) 1990-1997 Sam Leffler
+
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
*
* Permission to use,
copy, modify, distribute, and sell this software and
* its documentation
for any purpose is hereby granted without fee, provided
@@ -43,7 +43,7 @@
* The routine must have the type signature given below;
* for example:
*
- * fillruns(unsigned char* buf, uint16* runs, uint16* erun, uint32
lastx)
+ * fillruns(unsigned char* buf, uint32* runs, uint32* erun, uint32
lastx)
*
* where buf is place to set the bits, runs is the array of b&w
run
* lengths (white then black), erun is the last run in the array,
and
@@ -52,7 +52,7 @@
* data in the run array as needed (e.g. to append
zero runs to bring
* the count up to a nice multiple).
*/
-typedef void
(*TIFFFaxFillFunc)(unsigned char*, uint16*, uint16*, uint32);
+typedef void
(*TIFFFaxFillFunc)(unsigned char*, uint32*, uint32*, uint32);
/*
* The
default run filler; made external for other decoders.
@@ -60,7 +60,7 @@
#if defined(__cplusplus)
extern "C" {
#endif
-extern void
_TIFFFax3fillruns(unsigned char*, uint16*, uint16*, uint32);
+extern void
_TIFFFax3fillruns(unsigned char*, uint32*, uint32*, uint32);
#if
defined(__cplusplus)
}
#endif
@@ -84,7 +84,7 @@
typedef struct { /*
state table entry */
unsigned char State; /* see above */
unsigned char
Width; /* width of code in bits */
- uint16 Param; /* unsigned 16-bit run
length in bits */
+ uint32 Param; /* unsigned 32-bit run length in bits
*/
} TIFFFaxTabEnt;
extern const TIFFFaxTabEnt TIFFFaxMainTable[];
# tiff-3.5-interfaces.patch
# Robert Colquhoun <rjc@trump.net.au> Wed, 22 Mar 2000 09:57:00
# modified Thurs, 11 May 2000 by Lee Howard <faxguy@deanox.com>
#
# Attached is a patch so that hylafax works with tiff 3.5. The tiff
# maintainers changed a few of the internal interfaces to achieve large
# run lengths (from 16 to 32 bits). Hylafax uses one of libtiffs header
# files(faxd/tif_fax3.h) for some undocumented macros and interfaces and
# was only expecting 16 bits, and broke.
#
# I successfully sent one fax with this patch and libtiff 3.5...anything
# more complicated might or might not work ;-)
#
# Instructions: From main source directory run command :
# patch -bp0 --verbose <tiff-3.5-interfaces.patch
--- configure 1999/07/26 08:57:29
+++ configure 2000/05/11 22:03:01
@@ -2865,7 +2865,7 @@
printf("old include files: version %u\n", TIFFLIB_VERSION);
exit(-1);
}
- if (strncmp(TIFFGetVersion(), "LIBTIFF, Version 3.4", 20) != 0) {
+ if (strncmp(TIFFGetVersion(), "LIBTIFF, Version 3.5", 20) != 0) {
printf("old library: version %s\n", TIFFGetVersion());
exit(-1);
} else
--- faxd/CopyQuality.c++ 1999/09/02 10:16:22 1.4
+++ faxd/CopyQuality.c++ 2000/03/22 12:32:01
@@ -50,7 +50,7 @@
setupDecoder(conf.recvFillOrder, params.is2D());
u_int rowpixels = params.pageWidth(); // NB: assume rowpixels <= 2432
- uint16 runs[2*2432]; // run arrays for cur+ref rows
+ uint32 runs[2*2432]; // run arrays for cur+ref rows
setRuns(runs, runs+2432, rowpixels);
recvEOLCount = 0; // count of EOL codes
--- faxd/G3Decoder.c++ 1999/06/13 07:41:03 1.2
+++ faxd/G3Decoder.c++ 2000/03/22 12:32:04
@@ -41,13 +41,13 @@
DECLARE_STATE_EOL(); \
int a0; /* reference element */ \
int RunLength; /* length of current run */ \
- uint16* pa; /* place to stuff next run */ \
- uint16* thisrun; /* current row's run array */ \
+ uint32* pa; /* place to stuff next run */ \
+ uint32* thisrun; /* current row's run array */ \
const TIFFFaxTabEnt* TabEnt
#define DECLARE_STATE_2D() \
DECLARE_STATE(); \
int b1; /* next change on prev line */ \
- uint16* pb /* next run in reference line */
+ uint32* pb /* next run in reference line */
/*
* Load any state that may be changed during decoding.
*/
@@ -113,7 +113,7 @@
}
void
-G3Decoder::setRuns(uint16* cr, uint16* rr, int w)
+G3Decoder::setRuns(uint32* cr, uint32* rr, int w)
{
curruns = cr;
if (refruns = rr) {
@@ -134,7 +134,7 @@
{
u_int rowbytes = howmany(w, 8);
if (curruns == NULL) {
- uint16 runs[2*2432]; // run arrays for cur+ref rows
+ uint32 runs[2*2432]; // run arrays for cur+ref rows
setRuns(runs, runs+2432, w);
while (h-- > 0) {
decodeRow(raster, w);
@@ -235,7 +235,7 @@
_TIFFFax3fillruns((u_char*) scanline, thisrun, pa, lastx);
if (is2D) {
SETVAL(0); // imaginary change for reference
- SWAP(uint16*, curruns, refruns);
+ SWAP(uint32*, curruns, refruns);
}
rowref++;
UNCACHE_STATE();
--- faxd/G3Decoder.h 1999/06/13 07:41:03 1.2
+++ faxd/G3Decoder.h 2000/03/22 12:32:05
@@ -43,8 +43,8 @@
int RTCrun; // count of consecutive zero-length rows
int rowref; // reference count of rows decoded
int RTCrow; // row number of start of RTC
- uint16* refruns; // runs for reference line
- uint16* curruns; // runs for current line
+ uint32* refruns; // runs for reference line
+ uint32* curruns; // runs for current line
const u_char* bitmap; // bit reversal table
protected:
G3Decoder();
@@ -68,8 +68,8 @@
virtual ~G3Decoder();
void setupDecoder(u_int fillorder, bool is2D);
- void setRuns(uint16*, uint16*, int);
- uint16* lastRuns();
+ void setRuns(uint32*, uint32*, int);
+ uint32* lastRuns();
void decode(void* raster, u_int w, u_int h);
bool decodeRow(void* scanline, u_int w);
@@ -92,7 +92,7 @@
#define EOFraised() (sigsetjmp(jmpEOF, 0) != 0)
#define RTCraised() (sigsetjmp(jmpRTC, 0) != 0)
-inline uint16* G3Decoder::lastRuns() { return is2D ? refruns : curruns; }
+inline uint32* G3Decoder::lastRuns() { return is2D ? refruns : curruns; }
inline const u_char* G3Decoder::getBitmap() { return bitmap; }
inline int G3Decoder::getPendingBits() const { return bit; }
inline bool G3Decoder::seenRTC() const { return (RTCrow != -1); }
--- faxd/TagLine.c++ 1999/08/23 11:19:34 1.4
+++ faxd/TagLine.c++ 2000/03/22 12:32:13
@@ -208,7 +208,7 @@
*/
TagLineMemoryDecoder dec(buf);
dec.setupDecoder(fillorder, params.is2D());
- uint16 runs[2*2432]; // run arrays for cur+ref rows
+ uint32 runs[2*2432]; // run arrays for cur+ref rows
dec.setRuns(runs, runs+2432, w);
dec.decode(NULL, w, th); // discard decoded data
--- faxd/choptest.c++ 1999/06/13 07:41:05 1.2
+++ faxd/choptest.c++ 2000/03/22 12:32:14
@@ -70,7 +70,7 @@
}
static bool
-isBlank(uint16* runs, u_int rowpixels)
+isBlank(uint32* runs, u_int rowpixels)
{
u_int x = 0;
for (;;) {
@@ -89,7 +89,7 @@
{
setupDecoder(fillorder, params.is2D());
u_int rowpixels = params.pageWidth(); // NB: assume rowpixels <= 2432
- uint16 runs[2*2432]; // run arrays for cur+ref rows
+ uint32 runs[2*2432]; // run arrays for cur+ref rows
setRuns(runs, runs+2432, rowpixels);
if (!RTCraised()) {
--- faxd/cqtest.c++ 1999/09/02 10:16:22 1.4
+++ faxd/cqtest.c++ 2000/03/22 12:32:16
@@ -144,7 +144,7 @@
setupDecoder(recvFillOrder, params.is2D());
u_int rowpixels = params.pageWidth(); // NB: assume rowpixels <= 2432
- uint16 runs[2*2432]; // run arrays for cur+ref rows
+ uint32 runs[2*2432]; // run arrays for cur+ref rows
setRuns(runs, runs+2432, rowpixels);
recvEOLCount = 0; // count of EOL codes
--- faxd/faxQueueApp.c++ 2000/03/08 13:44:06 1.7
+++ faxd/faxQueueApp.c++ 2000/03/22 12:32:43
@@ -805,7 +805,7 @@
}
static bool
-isBlank(uint16* runs, u_int rowpixels)
+isBlank(uint32* runs, u_int rowpixels)
{
u_int x = 0;
for (;;) {
@@ -824,7 +824,7 @@
{
setupDecoder(fillorder, params.is2D());
u_int rowpixels = params.pageWidth(); // NB: assume rowpixels <= 2432
- uint16 runs[2*2432]; // run arrays for cur+ref rows
+ uint32 runs[2*2432]; // run arrays for cur+ref rows
setRuns(runs, runs+2432, rowpixels);
if (!RTCraised()) {
--- faxd/tagtest.c++ 1999/08/23 11:19:35 1.4
+++ faxd/tagtest.c++ 2000/03/22 12:32:47
@@ -236,7 +236,7 @@
*/
MemoryDecoder dec(buf);
dec.setupDecoder(fillorder, params.is2D());
- uint16 runs[2*2432]; // run arrays for cur+ref rows
+ uint32 runs[2*2432]; // run arrays for cur+ref rows
dec.setRuns(runs, runs+2432, w);
u_int row;
--- faxd/tif_fax3.h 1998/10/12 20:47:49 1.1.1.1
+++ faxd/tif_fax3.h 2000/03/22 12:32:51
@@ -1,8 +1,8 @@
-/* $Id: tif_fax3.h,v 1.1.1.1 1998/10/12 20:47:49 root Exp $ */
+/* $Id: tif_fax3.h,v 1.1.1.1 1998/10/12 20:47:49 root Exp $ */
/*
- * Copyright (c) 1990-1996 Sam Leffler
- * Copyright (c) 1991-1996 Silicon Graphics, Inc.
+ * Copyright (c) 1990-1997 Sam Leffler
+ * Copyright (c) 1991-1997 Silicon Graphics, Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and
* its documentation for any purpose is hereby granted without fee, provided
@@ -43,7 +43,7 @@
* The routine must have the type signature given below;
* for example:
*
- * fillruns(unsigned char* buf, uint16* runs, uint16* erun, uint32 lastx)
+ * fillruns(unsigned char* buf, uint32* runs, uint32* erun, uint32 lastx)
*
* where buf is place to set the bits, runs is the array of b&w run
* lengths (white then black), erun is the last run in the array, and
@@ -52,7 +52,7 @@
* data in the run array as needed (e.g. to append zero runs to bring
* the count up to a nice multiple).
*/
-typedef void (*TIFFFaxFillFunc)(unsigned char*, uint16*, uint16*, uint32);
+typedef void (*TIFFFaxFillFunc)(unsigned char*, uint32*, uint32*, uint32);
/*
* The default run filler; made external for other decoders.
@@ -60,7 +60,7 @@
#if defined(__cplusplus)
extern "C" {
#endif
-extern void _TIFFFax3fillruns(unsigned char*, uint16*, uint16*, uint32);
+extern void _TIFFFax3fillruns(unsigned char*, uint32*, uint32*, uint32);
#if defined(__cplusplus)
}
#endif
@@ -84,7 +84,7 @@
typedef struct { /* state table entry */
unsigned char State; /* see above */
unsigned char Width; /* width of code in bits */
- uint16 Param; /* unsigned 16-bit run length in bits */
+ uint32 Param; /* unsigned 32-bit run length in bits */
} TIFFFaxTabEnt;
extern const TIFFFaxTabEnt TIFFFaxMainTable[];