|
From: Andre R. <and...@us...> - 2004-10-29 19:40:47
|
Update of /cvsroot/frontierkernel/Frontier/Common/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30977 Modified Files: file.c Log Message: Moved prototypes for fileinit and fileshutdown to file.h to fix GCC compiler warnings in file.c. Use universal procedure pointer (UPP) for iocompletion on Mach-O. Index: file.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/file.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** file.c 23 Oct 2004 22:17:19 -0000 1.2 --- file.c 29 Oct 2004 19:40:38 -0000 1.3 *************** *** 371,375 **** static boolean filereadhandlebytes (short fnum, long ctbytes, Handle *hreturned) { ! /* 6/x/91 mao this one is parallel to filewritehandle --- 371,375 ---- static boolean filereadhandlebytes (short fnum, long ctbytes, Handle *hreturned) { ! /% 6/x/91 mao this one is parallel to filewritehandle *************** *** 381,385 **** return (false); ! h = *hreturned; /*copy into register%/ if (oserror (fileread (fnum, ctbytes, *h))) { --- 381,385 ---- return (false); ! h = *hreturned; /%copy into register%/ if (oserror (fileread (fnum, ctbytes, *h))) { *************** *** 391,395 **** return (true); ! } /*filereadhandlebytes*/ --- 391,396 ---- return (true); ! } /%filereadhandlebytes%/ ! */ *************** *** 432,450 **** } /*iocompletion*/ ! #if TARGET_RT_MAC_CFM ! #if !TARGET_API_MAC_CARBON ! static RoutineDescriptor iocompletionDesc = BUILD_ROUTINE_DESCRIPTOR (uppIOCompletionProcInfo, iocompletion); ! #define iocompletionUPP (&iocompletionDesc) ! #else //looks like we need some kind of file UPP //do we need to create a UPP, yes we do. IOCompletionUPP iocompletionDesc = nil; #define iocompletionUPP (iocompletionDesc) #endif - #endif /*TARGET_RT_MAC_CFM*/ ! #if TARGET_RT_MAC_MACHO static IOCompletionUPP iocompletionUPP = &iocompletion; ! #endif /*TARGET_RT_MAC_MACHO*/ #endif //MACVERSION --- 433,460 ---- } /*iocompletion*/ ! ! #if TARGET_RT_MAC_CFM || TARGET_RT_MAC_MACHO ! ! #if TARGET_API_MAC_CARBON ! //looks like we need some kind of file UPP //do we need to create a UPP, yes we do. IOCompletionUPP iocompletionDesc = nil; + #define iocompletionUPP (iocompletionDesc) + + #else + + static RoutineDescriptor iocompletionDesc = BUILD_ROUTINE_DESCRIPTOR (uppIOCompletionProcInfo, iocompletion); + + #define iocompletionUPP (&iocompletionDesc) + #endif ! #else ! static IOCompletionUPP iocompletionUPP = &iocompletion; ! ! #endif #endif //MACVERSION *************** *** 478,499 **** //Code change by Timothy Paustian Wednesday, July 26, 2000 10:52:49 PM //new routine to create UPPS for the async file saves. ! ! extern void fileinit (); ! ! void fileinit() ! { ! #if TARGET_API_MAC_CARBON && TARGET_RT_MAC_CFM if(iocompletionDesc == nil) iocompletionDesc = NewIOCompletionUPP(iocompletion); #endif ! } ! extern void fileshutdown (); ! void fileshutdown() ! { ! #if TARGET_API_MAC_CARBON && TARGET_RT_MAC_CFM if(iocompletionDesc != nil) DisposeIOCompletionUPP(iocompletionDesc); #endif ! } static boolean filecreateandopen (const tyfilespec *fs, OSType creator, OSType filetype, hdlfilenum *fnum) { --- 488,507 ---- //Code change by Timothy Paustian Wednesday, July 26, 2000 10:52:49 PM //new routine to create UPPS for the async file saves. ! void fileinit (void) { ! #if TARGET_API_MAC_CARBON if(iocompletionDesc == nil) iocompletionDesc = NewIOCompletionUPP(iocompletion); #endif ! } /*fileinit*/ ! ! ! void fileshutdown(void) { ! ! #if TARGET_API_MAC_CARBON if(iocompletionDesc != nil) DisposeIOCompletionUPP(iocompletionDesc); #endif ! } /*fileshutdown*/ ! static boolean filecreateandopen (const tyfilespec *fs, OSType creator, OSType filetype, hdlfilenum *fnum) { |