From: <lab...@us...> - 2011-04-12 11:41:05
|
Revision: 1356 http://opengtoolkit.svn.sourceforge.net/opengtoolkit/?rev=1356&view=rev Author: labviewer Date: 2011-04-12 11:40:59 +0000 (Tue, 12 Apr 2011) Log Message: ----------- Removed some depreciated Carbon function calls for OSX Modified Paths: -------------- trunk/lvzip/c_source/lvutil.c trunk/lvzip/c_source/lvutil.h Modified: trunk/lvzip/c_source/lvutil.c =================================================================== --- trunk/lvzip/c_source/lvutil.c 2011-04-11 19:35:44 UTC (rev 1355) +++ trunk/lvzip/c_source/lvutil.c 2011-04-12 11:40:59 UTC (rev 1356) @@ -797,7 +797,6 @@ int32 count = 0; #if MacOS FSSpec fss; - DTPBRec dtpb; CInfoPBRec cpb; #elif Win32 LStrPtr lstr; @@ -830,17 +829,27 @@ if (!err) { - dtpb.ioCompletion = nil; - dtpb.ioNamePtr = NULL; + #if !MacOSX + DTPBRec dtpb; + + memset(&dtpb, 0, sizeof(DTPBRec)); dtpb.ioVRefNum = fss.vRefNum; - err = OSErrToLVErr(PBDTGetPath(&dtpb)); if (err) + { + dtpb.ioNamePtr = nil; DEBUGPRINTF(("PBGetPath: err = %ld", err)); + /* Ignore error for getting/setting Desktop comments */ + err = mgNoErr; + } + else + { + dtpb.ioNamePtr = fss.name; + dtpb.ioDirID = fss.parID; + } + #endif if (!err) { - dtpb.ioNamePtr = fss.name; - dtpb.ioDirID = fss.parID; *isDirectory = (MacIsDir(cpb) != 0); if (write) @@ -872,13 +881,15 @@ err = OSErrToLVErr(PBSetCatInfoSync(&cpb)); if (err) DEBUGPRINTF(("PBSetCatInfo: err = %ld", err)); - if (!err && comment) + #if !MacOSX + if (!err && comment && dtpb.ioNamePtr) { dtpb.ioDTBuffer = LStrBuf(*comment); dtpb.ioDTReqCount = LStrLen(*comment); - /* Ignore error for setting Desktop comments as this is not supported on OSX */ + /* Ignore error for setting Desktop comments */ PBDTSetCommentSync(&dtpb); } + #endif } else { @@ -913,7 +924,8 @@ MacConvertToLVTime(cpb.hFileInfo.ioFlMdDat, &fileInfo->mDate); } - if (comment) + #if !MacOSX + if (comment && dtpb.ioNamePtr) { err = DSSetHandleSize((UHandle)comment, 255); if (!err) @@ -923,10 +935,11 @@ dtpb.ioDTActCount = 0; err = OSErrToLVErr(PBDTGetCommentSync(&dtpb)); LStrLen(*comment) = err ? 0 : dtpb.ioDTActCount; - /* Ignore error for getting Desktop comments as this is not supported on OSX */ + /* Ignore error for getting Desktop comments */ err = mgNoErr; } } + #endif } } } Modified: trunk/lvzip/c_source/lvutil.h =================================================================== --- trunk/lvzip/c_source/lvutil.h 2011-04-11 19:35:44 UTC (rev 1355) +++ trunk/lvzip/c_source/lvutil.h 2011-04-12 11:40:59 UTC (rev 1356) @@ -15,7 +15,7 @@ #if defined(macintosh) || defined(__PPCC__) || defined(THINK_C) || defined(__SC__) || defined(__MWERKS__) || defined(__APPLE_CC__) #define MacOS 1 - #ifdef __MACH__ + #ifdef TARGET_API_MAC_CARBON #define MacOSX 1 #endif #if defined(__i386__) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |