]> git.ipfire.org Git - thirdparty/HylaFAX.git/commitdiff
[Bug 277] here are the patches that Mandrake and Debian use
authorDarren Nickerson <darren.nickerson@ifax.com>
Fri, 24 May 2002 15:44:14 +0000 (15:44 +0000)
committerDarren Nickerson <darren.nickerson@ifax.com>
Fri, 24 May 2002 15:44:14 +0000 (15:44 +0000)
Merged in relevant vendor fixes for 64-bit compatibility.
Thanks Lee and Patrice for sifting through the detritus!

faxd/Class1Send.c++
faxd/Class2Send.c++
faxd/PCFFont.c++
util/FaxClient.c++
util/Socket.h

index aec108b0d9482ff3973c214b46ea7560e9536c33..92f678d64f568067e36e176dc68e6fe7b1f243ee 100644 (file)
@@ -780,11 +780,7 @@ Class1Modem::sendPage(TIFF* tif, const Class2Params& params, u_int pageChop, fxS
        uint32* stripbytecount;
        (void) TIFFGetField(tif, TIFFTAG_STRIPBYTECOUNTS, &stripbytecount);
        tstrip_t strip;
-       #ifdef __alpha
-           u_long totdata = 0;
-       #else
-           uint32 totdata = 0;
-       #endif
+       u_long totdata = 0;
        for (strip = 0; strip < nstrips; strip++)
            totdata += stripbytecount[strip];
        /*
index c03531a6748e150c5ec28923a3ebb0a9e355593b..6e6210cd4813809d7bbd850c7d64f8f55e36b94e 100644 (file)
@@ -372,11 +372,7 @@ Class2Modem::sendPageData(TIFF* tif, u_int pageChop)
        uint32* stripbytecount;
        (void) TIFFGetField(tif, TIFFTAG_STRIPBYTECOUNTS, &stripbytecount);
        tstrip_t strip;
-       #ifdef __alpha
-           u_long totdata = 0;
-       #else
-           uint32 totdata = 0;
-       #endif
+       u_long totdata = 0;
        for (strip = 0; strip < nstrips; strip++)
            totdata += stripbytecount[strip];
        /*
index 9e08a2bcd2355dbf1a39b2427020835bb7e32f44..f83297a75ed99f1a2472e8eeca3b9d7924f2aee0 100644 (file)
@@ -233,7 +233,7 @@ PCFFont::read(const char* name)
        }
        for (i = 0; i < nbitmaps; i++) {
            metrics[i].bits = bitmaps + offsets[i];
-           if ((unsigned) metrics[i].bits & 1) {
+           if ((unsigned long) metrics[i].bits & 1) {
                error("Internal error, bitmap data not word-aligned");
                delete offsets;
                return (false);
index 91c9fe27ee4bc6b4ad8221db7786d90ffea4c159..643498a82e896d6236bf7e776b197d2d82e4e3f8 100644 (file)
@@ -1271,12 +1271,13 @@ bool
 FaxClient::recvData(bool (*f)(void*, const char*, int, fxStr&),
     void* arg, fxStr& emsg, u_long restart, const char* fmt, ...)
 {
-    if (!setMode(MODE_S))
-       goto bad;
-    if (!initDataConn(emsg))
-       goto bad;
-    if (restart && command("REST %lu", restart) != CONTINUE)
-       goto bad;
+    if ((!setMode(MODE_S)) ||
+       (!initDataConn(emsg)) ||
+       (restart && command("REST %lu", restart) != CONTINUE)) {
+       // cannot "goto bad" because it is outside the scope of a va_arg
+       closeDataConn();
+       return (false);
+    }
     va_list ap;
     va_start(ap, fmt);
     int r; r = vcommand(fmt, ap);
@@ -1326,12 +1327,14 @@ FaxClient::recvZData(bool (*f)(void*, const char*, int, fxStr&),
     zstream.opaque = NULL;
     zstream.data_type = Z_BINARY;
     if (inflateInit(&zstream) == Z_OK) {
-       if (!setMode(MODE_Z))
-           goto bad;
-       if (!initDataConn(emsg))
-           goto bad;
-       if (restart && command("REST %lu", restart) != CONTINUE)
-           goto bad;
+       if ((!setMode(MODE_Z)) ||
+           (!initDataConn(emsg)) ||
+           (restart && command("REST %lu", restart) != CONTINUE)) {
+           // cannot "goto bad" because it is outside the scope of a va_arg
+           closeDataConn();
+           inflateEnd(&zstream);
+           return (false);
+       }
        va_list ap;
        va_start(ap, fmt);
        int r; r = vcommand(fmt, ap);           // XXX for __GNUC__
index 055ce5b1933d96c524c185abcb474562fcdeb0ad..4dcc39039c25376dd9933fbdc791dc72d3d64304 100644 (file)
@@ -57,11 +57,11 @@ extern "C" {
 class Socket {
 public:
     static int accept(int s, void* addr, socklen_t* addrlen);
-    static int bind(int s, const void* addr, int addrlen);
-    static int connect(int s, const void* addr, int addrlen);
+    static int bind(int s, const void* addr, socklen_t addrlen);
+    static int connect(int s, const void* addr, socklen_t addrlen);
     static int getpeername(int s, void* name, socklen_t* namelen);
     static int getsockname(int s, void* name, socklen_t* namelen);
-    static int setsockopt(int s, int level, int oname, const void* oval, int olen);
+    static int setsockopt(int s, int level, int oname, const void* oval, socklen_t olen);
     static struct hostent* gethostbyname(const char* name);
 };
 
@@ -74,12 +74,12 @@ inline int Socket::accept(int s, void* addr, socklen_t* addrlen)
 #endif
 }
 
-inline int Socket::bind(int s, const void* addr, int addrlen)
+inline int Socket::bind(int s, const void* addr, socklen_t addrlen)
 {
     return ::bind(s, (const struct sockaddr*) addr, addrlen);
 }
 
-inline int Socket::connect(int s, const void* addr, int addrlen)
+inline int Socket::connect(int s, const void* addr, socklen_t addrlen)
 {
     return ::connect(s, (const struct sockaddr*) addr, addrlen);
 }
@@ -102,7 +102,7 @@ inline int Socket::getsockname(int s, void* name, socklen_t* namelen)
 #endif
 }
 
-inline int Socket::setsockopt(int s, int level, int oname, const void* oval, int olen)
+inline int Socket::setsockopt(int s, int level, int oname, const void* oval, socklen_t olen)
 {
     return ::setsockopt(s, level, oname, (const char*) oval, olen);
 }