]> git.ipfire.org Git - thirdparty/HylaFAX.git/commitdiff
Revert "Bug 608: fixes for compilation on AMD 64"
authorAidan Van Dyk <aidan@ifax.com>
Tue, 9 Jun 2009 18:27:45 +0000 (14:27 -0400)
committerAidan Van Dyk <aidan@ifax.com>
Fri, 21 Aug 2009 18:14:44 +0000 (14:14 -0400)
This reverts commit 2b711903d33ea38717a1238f2277e8a3bdecbe44.

That commit changed the recvData API callback from:
  bool (*f)(void*, const char*, int, fxStr&)
to;
  bool (*f)(int, const char*, int, fxStr&)

Which is the exact *wrong* thing to do, and did it under the guise of
AMD fixes...  That warning is properly fixed here as well as bringing the
API back to the (void*) argument.

faxstat/faxstat.c++
libhylafax/FaxClient.c++
libhylafax/FaxClient.h
util/faxfetch.c++
util/faxwatch.c++

index 4cfcbc000829b5ffdd6dd835671658accfef26de..cf6c9e442584e82dc3a6f54ea73cacbed992c4a0 100644 (file)
@@ -46,7 +46,7 @@ faxStatApp::faxStatApp() {}
 faxStatApp::~faxStatApp() {}
 
 static bool
-writeStdout(int, const char* buf, int cc, fxStr&)
+writeStdout(void*, const char* buf, int cc, fxStr&)
 {
     (void) Sys::write(STDOUT_FILENO, buf, cc);
     return (true);
@@ -102,7 +102,7 @@ faxStatApp::run(int argc, char** argv)
     if (callServer(emsg)) {
        if (login(NULL, emsg)) {
            if (checkInfo)
-               (void) recvData(writeStdout, 0, emsg, 0,
+               (void) recvData(writeStdout, NULL, emsg, 0,
                    "RETR " FAX_STATUSDIR "/any." FAX_INFOSUF);
            for (u_int i = 0, n = dirs.length(); i < n; i++) {
                header = (i > 0 ? "\n" : "");
index 84184e6401c5c6d2133f39b44b1747a81ad14b0d..9a5d375a07905af2091475a5cbd8a68910a51f7f 100644 (file)
@@ -1324,8 +1324,8 @@ bad:
  * or other data connection-based transfer.
  */
 bool
-FaxClient::recvData(bool (*f)(int, const char*, int, fxStr&),
-    int arg, fxStr& emsg, u_long restart, const char* fmt, ...)
+FaxClient::recvData(bool (*f)(void*, const char*, int, fxStr&),
+    void* arg, fxStr& emsg, u_long restart, const char* fmt, ...)
 {
     if ((!setMode(MODE_S)) ||
        (!initDataConn(emsg)) ||
index 9068ba748f8755ea7587ffd1522eb70d65dd275b..dfe2cdb81324f4cd3a01e96bce9916eec9f353f6 100644 (file)
@@ -284,8 +284,8 @@ public:
     /*
      * Retrieve information from the server.
      */
-    bool recvData(bool (*f)(int, const char*, int, fxStr&),
-    int arg, fxStr& emsg, u_long restart, const char* fmt, ...);
+    bool recvData(bool (*f)(void*, const char*, int, fxStr&),
+    void* arg, fxStr& emsg, u_long restart, const char* fmt, ...);
     bool recvZData(bool (*f)(void*, const char*, int, fxStr&),
     void* arg, fxStr& emsg, u_long restart, const char* fmt, ...);
     /*
index 45859a8d6b09b69bbc071fe298e1c2c5fd8d5441..fdddfd4fc4151a61940a8280558874678e463ae8 100644 (file)
@@ -40,18 +40,12 @@ faxFetchApp::faxFetchApp() {}
 faxFetchApp::~faxFetchApp() {}
 
 static bool
-writeStdout(int, const char* buf, int cc, fxStr&)
+writeStdout(void*, const char* buf, int cc, fxStr&)
 {
     (void) Sys::write(STDOUT_FILENO, buf, cc);
     return (true);
 }
 
-static bool
-writeStdout(void*, const char* buf, int cc, fxStr&)
-{
-    return writeStdout(0,buf,cc);
-}
-
 void
 faxFetchApp::vtraceServer(const char* fmt, va_list ap)
 {
@@ -98,7 +92,7 @@ faxFetchApp::run(int argc, char** argv)
                setType(TYPE_I);        // always image type
                for (; optind < argc; optind++)
                    if (mode == MODE_S)
-                       recvData(writeStdout, 0, emsg, page, op | argv[optind]);
+                       recvData(writeStdout, NULL, emsg, page, op | argv[optind]);
                    else
                        recvZData(writeStdout, NULL, emsg, page, op | argv[optind]);
            }
index 27561b55b732b8ba4ce25f8b446017a0404b82c2..d309a153f99c0c1591e77a11223fe73d9ea52eac 100644 (file)
@@ -49,7 +49,7 @@ watchApp::watchApp() {}
 watchApp::~watchApp() {}
 
 static bool
-writeData(int arg, const char* buf, int cc, fxStr& emsg)
+writeData(void* arg, const char* buf, int cc, fxStr& emsg)
 {
     if (Sys::write((intptr_t) arg, buf, cc) != cc) {
        emsg = fxStr::format(_("write error: %s"), strerror(errno));
@@ -99,7 +99,7 @@ watchApp::run(int argc, char** argv)
        if (login(NULL, emsg) && setType(TYPE_A)) {
            if (getTimeZone() == TZ_GMT)
                printWarning(_("time values reported in GMT"));
-           (void) recvData(writeData, STDOUT_FILENO, emsg, 0,
+           (void) recvData(writeData, (void*) STDOUT_FILENO, emsg, 0,
                "SITE TRIGGER %s", argv[optind]);
        }
        hangupServer();