|
From: Andre R. <and...@us...> - 2004-10-30 23:07:43
|
Update of /cvsroot/frontierkernel/Frontier/Common/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22734 Modified Files: dialogs.c Log Message: Fix GCC compiler warnings. Index: dialogs.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/dialogs.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** dialogs.c 24 Oct 2004 16:14:45 -0000 1.3 --- dialogs.c 30 Oct 2004 23:07:30 -0000 1.4 *************** *** 62,75 **** //switched to use CountDITL. This has been around since OS 7 return CountDITL(pdialog); - /* - amazingly we have to klooge around to find out how many items there are - in a dialog's item list. - */ - - /*register Handle h; - - h = (*(DialogPeek) pdialog).items; - - return ((**(short **) h) + 1); /*magic incantation -- Boozer says this works*/ } /*dialogcountitems*/ --- 62,65 ---- *************** *** 81,97 **** //check this I need to check to see if this is a memory leak or not. #if ACCESSOR_CALLS_ARE_FUNCTIONS == 1 ! DialogItemType itemType = 0; ! Handle h; ! Rect r = {0,0,0,0}; ! SInt16 whichField = 0; ! h = NewHandle(0); ! h = GetDialogTextEditHandle(pdialog); ! ! *hbuffer = h; #else ! //old code ! *hbuffer = (*(DialogPeek) pdialog).textH; #endif } /*dialoggeteditbuffer*/ --- 71,84 ---- //check this I need to check to see if this is a memory leak or not. #if ACCESSOR_CALLS_ARE_FUNCTIONS == 1 ! //DialogItemType itemType = 0; ! //Handle h; ! //Rect r = {0,0,0,0}; ! //SInt16 whichField = 0; ! *hbuffer = GetDialogTextEditHandle((DialogRef) pdialog); #else ! //old code ! *hbuffer = (*(DialogPeek) pdialog).textH; #endif } /*dialoggeteditbuffer*/ *************** *** 360,364 **** #endif ! pdialog = GetNewDialog (id, nil, (DialogPtr) -1L); #ifdef flcomponent --- 347,351 ---- #endif ! pdialog = GetNewDialog (id, nil, (WindowRef) -1L); #ifdef flcomponent *************** *** 406,410 **** DisposeDialog (pdialog); ! #if 0 /*ndef flruntime/ /*handle all pending activate & update events*/ --- 393,397 ---- DisposeDialog (pdialog); ! #if 0 //ndef flruntime /*handle all pending activate & update events*/ *************** *** 998,1005 **** //register short hit = 0; ! #ifdef flcomponent ! ! long curA5 = SetUpAppA5 (); ! #endif --- 985,990 ---- //register short hit = 0; ! #if !TARGET_API_MAC_CARBON && defined(flcomponent) ! long curA5 = SetUpAppA5 (); #endif *************** *** 1069,1077 **** boldenbutton (pdialog, defaultitem); #if TARGET_API_MAC_CARBON == 1 ! { ! WindowRef pWindow = GetDialogWindow(pdialog); ! CGrafPtr thePort = GetDialogPort(pdialog); ! QDFlushPortBuffer(thePort, nil); ! } #endif break; --- 1054,1061 ---- boldenbutton (pdialog, defaultitem); #if TARGET_API_MAC_CARBON == 1 ! { ! CGrafPtr thePort = GetDialogPort(pdialog); ! QDFlushPortBuffer(thePort, nil); ! } #endif break; *************** *** 1080,1084 **** /* ! shellblockevents (); /*all events are blocked when modal dialog is in front%/ if (flscriptrunning) --- 1064,1068 ---- /* ! shellblockevents (); /%all events are blocked when modal dialog is in front%/ if (flscriptrunning) *************** *** 1095,1107 **** //at some points to use ModalDialog Correctly. #if TARGET_API_MAC_CARBON == 1 ! { ! WindowRef pWindow = GetDialogWindow(pdialog); ! CGrafPtr thePort = GetDialogPort(pdialog); ! ! SelectWindow(pWindow); ! QDFlushPortBuffer(thePort, nil); ! } #else ! SelectWindow (pdialog); /*make sure no one has screwed around with us*/ #endif break; --- 1079,1091 ---- //at some points to use ModalDialog Correctly. #if TARGET_API_MAC_CARBON == 1 ! { ! WindowRef pWindow = GetDialogWindow(pdialog); ! CGrafPtr thePort = GetDialogPort(pdialog); ! ! SelectWindow(pWindow); ! QDFlushPortBuffer(thePort, nil); ! } #else ! SelectWindow (pdialog); /*make sure no one has screwed around with us*/ #endif break; *************** *** 1109,1116 **** } /*switch*/ ! #ifdef flcomponent ! ! RestoreA5 (curA5); ! #endif return (eventHandled); /*the dialog manager's version of false*/ --- 1093,1098 ---- } /*switch*/ ! #if !TARGET_API_MAC_CARBON && defined(flcomponent) ! RestoreA5 (curA5); #endif return (eventHandled); /*the dialog manager's version of false*/ *************** *** 1132,1140 **** { ProcPtr filter = (ProcPtr) modaldialogcallback; ! long appA5 = SetUpCurA5 (); /*for system*/ ModalDialog ((ModalFilterUPP) filter, &itemnumber); ! RestoreA5 (appA5); } #else --- 1114,1126 ---- { ProcPtr filter = (ProcPtr) modaldialogcallback; ! #if !TARGET_API_MAC_CARBON && defined(flcomponent) ! long appA5 = SetUpCurA5 (); /*for system*/ ! #endif ModalDialog ((ModalFilterUPP) filter, &itemnumber); ! #if !TARGET_API_MAC_CARBON && defined(flcomponent) ! RestoreA5 (appA5); ! #endif } #else *************** *** 1324,1328 **** #if TARGET_API_MAC_CARBON == 1 WindowClass wclass; ! err = GetWindowClass (pdialog, &wclass); if (err==noErr) { if (wclass == kModalWindowClass) { --- 1310,1314 ---- #if TARGET_API_MAC_CARBON == 1 WindowClass wclass; ! err = GetWindowClass ((WindowRef) pdialog, &wclass); if (err==noErr) { if (wclass == kModalWindowClass) { *************** *** 1332,1336 **** // it's not a dialog, it's an olde-tyme window. The Find window, for example. ! return (dialogsetselect (GetDialogFromWindow(pdialog), 0, infinity)); } --- 1318,1322 ---- // it's not a dialog, it's an olde-tyme window. The Find window, for example. ! return (dialogsetselect (GetDialogFromWindow((WindowRef) pdialog), 0, infinity)); } *************** *** 1366,1370 **** register short id; ! if (bsfname == nil) /*file wasn't dirty; just want to confirm Quit%/ id = quitdialogid; else --- 1352,1356 ---- register short id; ! if (bsfname == nil) /%file wasn't dirty; just want to confirm Quit%/ id = quitdialogid; else |