|
From: Andre R. <and...@us...> - 2004-10-28 22:07:22
|
Update of /cvsroot/frontierkernel/Frontier/Common/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16518/Frontier/Common/source Modified Files: OpenTransportNetEvents.c Log Message: Eliminated most GCC compiler warnings. Index: OpenTransportNetEvents.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/OpenTransportNetEvents.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** OpenTransportNetEvents.c 23 Oct 2004 22:40:14 -0000 1.3 --- OpenTransportNetEvents.c 28 Oct 2004 22:07:07 -0000 1.4 *************** *** 167,170 **** --- 167,171 ---- }; + #if 0 static unsigned char * dnserrorstrings [5] = { *************** *** 175,179 **** "\x39" "Valid name, no data record of requested type. (DNS error)", /* 4 */ }; ! static unsigned char * stdcliberrorstrings [80] = { --- 176,181 ---- "\x39" "Valid name, no data record of requested type. (DNS error)", /* 4 */ }; ! ! #endif static unsigned char * stdcliberrorstrings [80] = { *************** *** 328,332 **** typedef struct tylistenrecord { EndpointRef ep; ! long stateflags; OTLink validationlink; /* Link into an OT FIFO (not atomic) */ OTLIFO idleEPs; /* Endpoints ready to accept a new incoming connection */ --- 330,334 ---- typedef struct tylistenrecord { EndpointRef ep; ! UInt8 stateflags; OTLink validationlink; /* Link into an OT FIFO (not atomic) */ OTLIFO idleEPs; /* Endpoints ready to accept a new incoming connection */ *************** *** 351,356 **** OTLink link; /* Used for linking into TCP low-level lists (atomic) */ OTLink validationlink; /* Used for linking into worker thread lists (atomic) */ ! long stateflags; ! long completionflags; OSStatus result; tysocktypeid typeID; --- 353,358 ---- OTLink link; /* Used for linking into TCP low-level lists (atomic) */ OTLink validationlink; /* Used for linking into worker thread lists (atomic) */ ! UInt8 stateflags; ! UInt8 completionflags; OSStatus result; tysocktypeid typeID; *************** *** 463,467 **** static OSStatus EnterSndDisconnect (EndpointRecordRef epref); static void ReadAllAndClose (EndpointRecordRef epref); ! static void DoWaitList (ListenRecordRef listenref); static pascal void DNRNotifier (void *context, OTEventCode event, OTResult result, void *cookie); static pascal void ListenNotifier (void *context, OTEventCode code, OTResult result, void *cookie); --- 465,469 ---- static OSStatus EnterSndDisconnect (EndpointRecordRef epref); static void ReadAllAndClose (EndpointRecordRef epref); ! //static void DoWaitList (ListenRecordRef listenref); static pascal void DNRNotifier (void *context, OTEventCode event, OTResult result, void *cookie); static pascal void ListenNotifier (void *context, OTEventCode code, OTResult result, void *cookie); *************** *** 473,477 **** /*Code change by Timothy Paustian Monday, September 25, 2000 8:58:07 PM needed to add a declaration to get the new carbon stuff to compile.*/ ! static void *fwsacceptingthreadmain (long *param); --- 475,479 ---- /*Code change by Timothy Paustian Monday, September 25, 2000 8:58:07 PM needed to add a declaration to get the new carbon stuff to compile.*/ ! static void *fwsacceptingthreadmain (void *param); *************** *** 704,708 **** if (epref) { if (!CheckEndpointList (epref)) { ! wsprintf (TCPmsg, "Entering %s at line %d, EndpointRecordRef = %08lx - INVALID ENPOINT.", functionName, linenumber, epref); TCPWRITEMSG (); return; --- 706,710 ---- if (epref) { if (!CheckEndpointList (epref)) { ! wsprintf (TCPmsg, "Entering %s at line %d, EndpointRecordRef = %08lx - INVALID ENPOINT.", functionName, linenumber, (long) epref); TCPWRITEMSG (); return; *************** *** 710,714 **** wsprintf (TCPmsg, "Entering %s at line %d, EndpointRecordRef = %08lx, Endpoint = %08lx, Type = %s, State Flags = %02x, Completion Flags = %02x, Listen Ref = %08lX.", ! functionName, linenumber, epref, epref->ep, TCPGETTYPE (epref->typeID), epref->stateflags, epref->completionflags, epref->listener); TCPWRITEMSG (); --- 712,716 ---- wsprintf (TCPmsg, "Entering %s at line %d, EndpointRecordRef = %08lx, Endpoint = %08lx, Type = %s, State Flags = %02x, Completion Flags = %02x, Listen Ref = %08lX.", ! functionName, linenumber, (long) epref, (long) epref->ep, TCPGETTYPE (epref->typeID), epref->stateflags, epref->completionflags, (long) epref->listener); TCPWRITEMSG (); *************** *** 717,727 **** if (listenref) { if (!CheckListenList (listenref)) { ! wsprintf (TCPmsg, "Entering %s at line %d, ListenRecordRef = %08lx - INVALID ENPOINT.", functionName, linenumber, listenref); TCPWRITEMSG (); return; } ! wsprintf (TCPmsg, "Entering %s at line %d, ListenRecordRef = %08lx, Endpoint = %08lx, Type = %s, Max Depth = %d, Refcon = %08lX, Thread = %d", ! functionName, linenumber, listenref, listenref->ep, TCPGETTYPE (listenref->typeID), listenref->maxdepth, listenref->refcon, listenref->idthread); TCPWRITEMSG (); --- 719,729 ---- if (listenref) { if (!CheckListenList (listenref)) { ! wsprintf (TCPmsg, "Entering %s at line %d, ListenRecordRef = %08lx - INVALID ENPOINT.", functionName, linenumber, (long) listenref); TCPWRITEMSG (); return; } ! wsprintf (TCPmsg, "Entering %s at line %d, ListenRecordRef = %08lx, Endpoint = %08lx, Type = %s, Max Depth = %ld, Refcon = %08lX, Thread = %ld", ! functionName, linenumber, (long) listenref, (long) listenref->ep, TCPGETTYPE (listenref->typeID), listenref->maxdepth, listenref->refcon, listenref->idthread); TCPWRITEMSG (); *************** *** 736,740 **** if (epref) { if (!CheckEndpointList (epref)) { ! wsprintf (TCPmsg, "Exiting %s at line %d, EndpointRecordRef = %08lx - INVALID ENPOINT.", functionName, linenumber, epref); TCPWRITEMSG (); return; --- 738,742 ---- if (epref) { if (!CheckEndpointList (epref)) { ! wsprintf (TCPmsg, "Exiting %s at line %d, EndpointRecordRef = %08lx - INVALID ENPOINT.", functionName, linenumber, (long) epref); TCPWRITEMSG (); return; *************** *** 742,746 **** wsprintf (TCPmsg, "Exiting %s at line %d, EndpointRecordRef = %08lx, Endpoint = %08lx, Type = %s, State Flags = %02x, Completion Flags = %02x, Listen Ref = %08lX.", ! functionName, linenumber, epref, epref->ep, TCPGETTYPE (epref->typeID), epref->stateflags, epref->completionflags, epref->listener); TCPWRITEMSG (); --- 744,748 ---- wsprintf (TCPmsg, "Exiting %s at line %d, EndpointRecordRef = %08lx, Endpoint = %08lx, Type = %s, State Flags = %02x, Completion Flags = %02x, Listen Ref = %08lX.", ! functionName, linenumber, (long) epref, (long) epref->ep, TCPGETTYPE (epref->typeID), epref->stateflags, epref->completionflags, (long) epref->listener); TCPWRITEMSG (); *************** *** 749,759 **** if (listenref) { if (!CheckListenList (listenref)) { ! wsprintf (TCPmsg, "Exiting %s at line %d, ListenRecordRef = %08lx - INVALID ENPOINT.", functionName, linenumber, listenref); TCPWRITEMSG (); return; } ! wsprintf (TCPmsg, "Exiting %s at line %d, ListenRecordRef = %08lx, Endpoint = %08lx, Type = %s, Max Depth = %d, Refcon = %08lX, Thread = %d", ! functionName, linenumber, listenref, listenref->ep, TCPGETTYPE (listenref->typeID), listenref->maxdepth, listenref->refcon, listenref->idthread); TCPWRITEMSG (); --- 751,761 ---- if (listenref) { if (!CheckListenList (listenref)) { ! wsprintf (TCPmsg, "Exiting %s at line %d, ListenRecordRef = %08lx - INVALID ENPOINT.", functionName, linenumber, (long) listenref); TCPWRITEMSG (); return; } ! wsprintf (TCPmsg, "Exiting %s at line %d, ListenRecordRef = %08lx, Endpoint = %08lx, Type = %s, Max Depth = %ld, Refcon = %08lX, Thread = %ld", ! functionName, linenumber, (long) listenref, (long) listenref->ep, TCPGETTYPE (listenref->typeID), listenref->maxdepth, listenref->refcon, listenref->idthread); TCPWRITEMSG (); *************** *** 782,786 **** #endif ! extern long ctconnections = 0; --- 784,788 ---- #endif ! static long ctconnections = 0; *************** *** 827,831 **** static pascal boolean listendatabasevisit (const void* ref, OTLink* linkToCheck) { ! hdldatabaserecord hdatabase = (ListenRecordRef) ref; return (hdatabase == (OTGetLinkObject (linkToCheck, tylistenrecord, validationlink))->hdatabase); --- 829,833 ---- static pascal boolean listendatabasevisit (const void* ref, OTLink* linkToCheck) { ! hdldatabaserecord hdatabase = (hdldatabaserecord) ref; return (hdatabase == (OTGetLinkObject (linkToCheck, tylistenrecord, validationlink))->hdatabase); *************** *** 851,855 **** static boolean CheckEndpointList (EndpointRecordRef epref) { ! OTList *eplink; #if TARGET_API_MAC_CARBON == 1 --- 853,857 ---- static boolean CheckEndpointList (EndpointRecordRef epref) { ! OTLink *eplink; #if TARGET_API_MAC_CARBON == 1 *************** *** 865,869 **** static boolean CheckListenList (ListenRecordRef listenref) { ! OTList *listenlink; #if TARGET_API_MAC_CARBON == 1 --- 867,871 ---- static boolean CheckListenList (ListenRecordRef listenref) { ! OTLink *listenlink; #if TARGET_API_MAC_CARBON == 1 *************** *** 1165,1170 **** /* if (!incrementconnectioncounter ()) { ! OTSndDisconnect (listenref->ep, nil); /*6.2b13 AR: reject connection (PIKE) */ ! /* return; }*/ --- 1167,1172 ---- /* if (!incrementconnectioncounter ()) { ! OTSndDisconnect (listenref->ep, nil); /%6.2b13 AR: reject connection (PIKE) %/ ! return; }*/ *************** *** 1344,1348 **** }/*DoSndOrderlyDisconnect*/ ! /*static OSStatus EnterSndOrderlyDisconnect (EndpointRecordRef epref) { OSStatus err; --- 1346,1352 ---- }/*DoSndOrderlyDisconnect*/ ! #if 0 ! ! static OSStatus EnterSndOrderlyDisconnect (EndpointRecordRef epref) { OSStatus err; *************** *** 1357,1360 **** --- 1361,1365 ---- }/*EnterSndOrderlyDisconnect*/ + #endif // *************** *** 2381,2384 **** --- 2386,2390 ---- } /*neterror*/ + #if 0 static void dnserror (char *cannot, long errcode) { *************** *** 2414,2417 **** --- 2420,2426 ---- } + #endif + + static void intneterror (long errcode) { bigstring bs; *************** *** 2817,2821 **** *addr = hostinfo.addrs[0]; ! TCPprintf (wsprintf(TCPmsg, "Leaving fwsNetEventNameToAddress at line %d. Address: %ld.", __LINE__, addr)); TCPWRITEMSG(); --- 2826,2830 ---- *addr = hostinfo.addrs[0]; ! TCPprintf (wsprintf(TCPmsg, "Leaving fwsNetEventNameToAddress at line %d. Address: %08lx.", __LINE__, *addr)); TCPWRITEMSG(); *************** *** 3057,3061 **** epref->typeID = SOCKTYPE_OPEN; ! TCPprintf (wsprintf (TCPmsg, "In fwsacceptpendingconnections at line %d. Accepted new connection #%08ld on listener %08lx: %s (%08lx, %ld).", __LINE__, ct, listenref, stringbaseaddress (listenref->callback), epref, listenref->refcon)); TCPWRITEMSG(); --- 3066,3071 ---- epref->typeID = SOCKTYPE_OPEN; ! TCPprintf (wsprintf (TCPmsg, "In fwsacceptpendingconnections at line %d. Accepted new connection #%08ld on listener %08lx: %s (%08lx, %ld).", ! __LINE__, ct, (long) listenref, stringbaseaddress (listenref->callback), (long) epref, listenref->refcon)); TCPWRITEMSG(); *************** *** 3151,3157 **** disposehandle (listenref->hcallbacktree); ! DisposePtr (listenref->acceptors); ! DisposePtr (listenref); return; --- 3161,3167 ---- disposehandle (listenref->hcallbacktree); ! DisposePtr ((Ptr) listenref->acceptors); ! DisposePtr ((Ptr) listenref); return; *************** *** 3159,3163 **** ! static void *fwsacceptingthreadmain (long *param) { /* --- 3169,3173 ---- ! static void *fwsacceptingthreadmain (void *param) { /* *************** *** 3188,3192 **** }/*while*/ ! TCPprintf (wsprintf (TCPmsg, "In fwsacceptingthreadmain at line %d, broke out of loop after accepting %ld connections on listener %08lx. Now starting clean-up.", __LINE__, ct, listenref)); TCPWRITEMSG(); --- 3198,3203 ---- }/*while*/ ! TCPprintf (wsprintf (TCPmsg, "In fwsacceptingthreadmain at line %d, broke out of loop after accepting %ld connections on listener %08lx. Now starting clean-up.", ! __LINE__, ct, (long) listenref)); TCPWRITEMSG(); *************** *** 3285,3290 **** if (kOTNoError != err) { ! OSStatus junk = OTCloseProvider (listenref->ep); ! OTAssert ("fwsNetEventListenStream: Could not close listener", junk == kOTNoError); neterror ("set listen stream to blocking mode", err); goto exit; --- 3296,3302 ---- if (kOTNoError != err) { ! OSStatus status; ! status = OTCloseProvider (listenref->ep); ! OTAssert ("fwsNetEventListenStream: Could not close listener", status == kOTNoError); neterror ("set listen stream to blocking mode", err); goto exit; *************** *** 3306,3311 **** if (kOTNoError != err) { ! OSStatus junk = OTCloseProvider (listenref->ep); ! OTAssert ("fwsNetEventListenStream: Could not close listener", junk == kOTNoError); neterror ("set IP_REUSEADDR option on listen stream", err); goto exit; --- 3318,3324 ---- if (kOTNoError != err) { ! OSStatus status; ! status = OTCloseProvider (listenref->ep); ! OTAssert ("fwsNetEventListenStream: Could not close listener", status == kOTNoError); neterror ("set IP_REUSEADDR option on listen stream", err); goto exit; *************** *** 3325,3330 **** if (kOTNoError != err) { ! OSStatus junk = OTCloseProvider (listenref->ep); ! OTAssert ("fwsNetEventListenStream: Could not close listener", junk == kOTNoError); neterror ("bind listen stream", err); goto exit; --- 3338,3344 ---- if (kOTNoError != err) { ! OSStatus status; ! status = OTCloseProvider (listenref->ep); ! OTAssert ("fwsNetEventListenStream: Could not close listener", status == kOTNoError); neterror ("bind listen stream", err); goto exit; *************** *** 3339,3344 **** if (kOTNoError != err) { ! OSStatus junk = OTCloseProvider (listenref->ep); ! OTAssert ("fwsNetEventListenStream: Could not close listener", junk == kOTNoError); neterror ("install notifier for listen stream", err); goto exit; --- 3353,3359 ---- if (kOTNoError != err) { ! OSStatus status; ! status = OTCloseProvider (listenref->ep); ! OTAssert ("fwsNetEventListenStream: Could not close listener", status == kOTNoError); neterror ("install notifier for listen stream", err); goto exit; *************** *** 3348,3353 **** if (kOTNoError != err) { ! OSStatus junk = OTCloseProvider (listenref->ep); ! OTAssert ("fwsNetEventListenStream: Could not close listener", junk == kOTNoError); neterror ("set listen stream to async mode", err); goto exit; --- 3363,3369 ---- if (kOTNoError != err) { ! OSStatus status; ! status = OTCloseProvider (listenref->ep); ! OTAssert ("fwsNetEventListenStream: Could not close listener", status == kOTNoError); neterror ("set listen stream to async mode", err); goto exit; *************** *** 3361,3366 **** if (!fwslaunchacceptingthread (listenref)) { /* takes care of closing ep and cleaning up, even if we fail further down */ ! OSStatus junk = OTCloseProvider (listenref->ep); ! OTAssert ("fwsNetEventListenStream: Could not close listener", junk == kOTNoError); goto exit; } --- 3377,3383 ---- if (!fwslaunchacceptingthread (listenref)) { /* takes care of closing ep and cleaning up, even if we fail further down */ ! OSStatus status; ! status = OTCloseProvider (listenref->ep); ! OTAssert ("fwsNetEventListenStream: Could not close listener", status == kOTNoError); goto exit; } *************** *** 3464,3468 **** if (kOTNoError != err) { ! TCPERRORprintf (wsprintf (TCPmsg, "In fwscleanuplistener at line %d, error %ld setting listener %08lx to synchronous mode.", __LINE__, err, listenref)); TCPERRORWRITEMSG(); } --- 3481,3485 ---- if (kOTNoError != err) { ! TCPERRORprintf (wsprintf (TCPmsg, "In fwscleanuplistener at line %d, error %ld setting listener %08lx to synchronous mode.", __LINE__, err, (long) listenref)); TCPERRORWRITEMSG(); } *************** *** 3473,3477 **** if (kOTNoError != err) { ! TCPERRORprintf (wsprintf (TCPmsg, "In fwscleanuplistener at line %d, error %ld closing listener %08lx.", __LINE__, err, listenref)); TCPERRORWRITEMSG(); } --- 3490,3494 ---- if (kOTNoError != err) { ! TCPERRORprintf (wsprintf (TCPmsg, "In fwscleanuplistener at line %d, error %ld closing listener %08lx.", __LINE__, err, (long) listenref)); TCPERRORWRITEMSG(); } *************** *** 3620,3624 **** if (kOTNoError != err) { ! DisposePtr (epref); neterror ("open stream", err); decrementconnectioncounter(); --- 3637,3641 ---- if (kOTNoError != err) { ! DisposePtr ((Ptr) epref); neterror ("open stream", err); decrementconnectioncounter(); *************** *** 3810,3814 **** if (kOTNoError != err) { // Scripts don't have to care about this error, it has already been taken care off anyway ! TCPERRORprintf (wsprintf (TCPmsg, "In fwsNetEventAbortStream at line %d, error %ld disconnecting endpoint %08lx.", __LINE__, err, epref)); TCPERRORWRITEMSG(); } --- 3827,3831 ---- if (kOTNoError != err) { // Scripts don't have to care about this error, it has already been taken care off anyway ! TCPERRORprintf (wsprintf (TCPmsg, "In fwsNetEventAbortStream at line %d, error %ld disconnecting endpoint %08lx.", __LINE__, err, (long) epref)); TCPERRORWRITEMSG(); } *************** *** 4155,4159 **** copyctopstring ("OPEN", status); ! result = OTCountDataBytes (epref->ep, (size_t*) bytesPending); switch (result) { --- 4172,4176 ---- copyctopstring ("OPEN", status); ! result = OTCountDataBytes (epref->ep, (OTByteCount*) bytesPending); switch (result) { |