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.
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);
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" : "");
* 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)) ||
/*
* 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, ...);
/*
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)
{
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]);
}
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));
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();