Refactoring

This commit is contained in:
elasota
2020-06-01 00:38:24 -04:00
parent 6fe0f2d964
commit eac923c475
9 changed files with 171 additions and 173 deletions

View File

@@ -52,7 +52,7 @@ PLError_t DoOpenDocAE (const AppleEvent *theAE, AppleEvent *reply, UInt32 ref)
VFileInfo finderInfo;
AEDescList docList;
long itemsInList;
Size actualSize;
size_t actualSize;
AEKeyword keywd;
DescType returnedType;
PLError_t theErr, whoCares;
@@ -162,7 +162,7 @@ PLError_t DoQuitAE (const AppleEvent *theAE, AppleEvent *reply, UInt32 ref)
PLError_t MyGotRequiredParams (const AppleEvent *theAE)
{
DescType returnedType;
Size actualSize;
size_t actualSize;
return (AEGetAttributePtr(theAE, keyMissedKeywordAttr, typeWildCard,
&returnedType, 0L, 0, &actualSize) == errAEDescNotFound) ? PLErrors::kNone :

View File

@@ -58,7 +58,7 @@ Boolean CreateNewHouse (void)
{
AEKeyword theKeyword;
DescType actualType;
Size actualSize;
size_t actualSize;
VFileSpec tempSpec;
VFileSpec theSpec;
PLError_t theErr;

View File

@@ -42,7 +42,7 @@ void SaveGame2 (void)
PortabilityLayer::InputManager::GetInstance()->ClearState();
Str255 gameNameStr;
Size byteCount;
size_t byteCount;
houseType *thisHousePtr;
roomType *srcRoom;
savedRoom *destRoom;

View File

@@ -19,13 +19,13 @@ PLError_t AECountItems(AEDescList *descList, long *count)
return PLErrors::kNone;
}
PLError_t AEGetNthPtr(AEDescList *descList, long index, DescType desiredType, AEKeyword *keyword, DescType *type, void *data, Size maxSize, Size *actualSize)
PLError_t AEGetNthPtr(AEDescList *descList, long index, DescType desiredType, AEKeyword *keyword, DescType *type, void *data, size_t maxSize, size_t *actualSize)
{
PL_NotYetImplemented();
return PLErrors::kNone;
}
PLError_t AEGetAttributePtr(const AppleEvent *evt, AEKeyword keyword, DescType desiredType, DescType *type, void *data, Size maxSize, Size *actualSize)
PLError_t AEGetAttributePtr(const AppleEvent *evt, AEKeyword keyword, DescType desiredType, DescType *type, void *data, size_t maxSize, size_t *actualSize)
{
PL_NotYetImplemented();
return PLErrors::kNone;

View File

@@ -22,8 +22,8 @@ typedef AEEventHandler AEEventHandlerUPP;
PLError_t AEGetParamDesc(const AppleEvent *evt, AEKeyword keyword, DescType desiredType, AEDescList *descList);
PLError_t AEDisposeDesc(AEDescList *descList);
PLError_t AECountItems(AEDescList *descList, long *count);
PLError_t AEGetNthPtr(AEDescList *descList, long index, DescType desiredType, AEKeyword *keyword, DescType *type, void *data, Size maxSize, Size *actualSize);
PLError_t AEGetAttributePtr(const AppleEvent *evt, AEKeyword keyword, DescType desiredType, DescType *type, void *data, Size maxSize, Size *actualSize);
PLError_t AEGetNthPtr(AEDescList *descList, long index, DescType desiredType, AEKeyword *keyword, DescType *type, void *data, size_t maxSize, size_t *actualSize);
PLError_t AEGetAttributePtr(const AppleEvent *evt, AEKeyword keyword, DescType desiredType, DescType *type, void *data, size_t maxSize, size_t *actualSize);
PLError_t AEInstallEventHandler(AEEventClass eventClass, AEEventID eventID, AEEventHandlerUPP handler, UInt32 ref, bool isSysHandler);
PLError_t AESetInteractionAllowed(AEInteractAllowed level);

View File

@@ -561,7 +561,7 @@ void ExitToShell()
PL_NotYetImplemented();
}
Handle NewHandle(Size size)
Handle NewHandle(size_t size)
{
PortabilityLayer::MMHandleBlock *hBlock = PortabilityLayer::MemoryManager::GetInstance()->AllocHandle(size);
if (!hBlock)
@@ -578,7 +578,7 @@ long GetHandleSize(Handle handle)
return handle.MMBlock()->m_size;
}
PLError_t SetHandleSize(Handle hdl, Size newSize)
PLError_t SetHandleSize(Handle hdl, size_t newSize)
{
PortabilityLayer::MemoryManager *mm = PortabilityLayer::MemoryManager::GetInstance();
if (!mm->ResizeHandle(hdl.MMBlock(), newSize))
@@ -587,12 +587,12 @@ PLError_t SetHandleSize(Handle hdl, Size newSize)
return PLErrors::kNone;
}
void *NewPtr(Size size)
void *NewPtr(size_t size)
{
return PortabilityLayer::MemoryManager::GetInstance()->Alloc(size);
}
void *NewPtrClear(Size size)
void *NewPtrClear(size_t size)
{
void *data = NewPtr(size);
if (data != nullptr && size != 0)

View File

@@ -36,8 +36,6 @@ typedef int16_t SInt16;
typedef int32_t Int32;
typedef uint32_t UInt32;
typedef size_t Size;
typedef unsigned char Str15[16];
typedef unsigned char Str31[32];
typedef unsigned char Str63[64];
@@ -256,13 +254,13 @@ void GetTime(DateTimeRec *dateTime);
void FlushEvents();
Handle NewHandle(Size size);
Handle NewHandle(size_t size);
long GetHandleSize(Handle handle);
PLError_t SetHandleSize(Handle hdl, Size newSize);
PLError_t SetHandleSize(Handle hdl, size_t newSize);
void *NewPtr(Size size);
void *NewPtrClear(Size size);
void *NewPtr(size_t size);
void *NewPtrClear(size_t size);
void DisposePtr(void *ptr);