get it to compile with clang

This commit is contained in:
Ash Wolf 2023-01-11 23:26:04 +00:00
parent 0bec4f557a
commit 54bb1363a2
46 changed files with 385 additions and 500 deletions

View File

@ -75,9 +75,8 @@ int Browser_SearchFile(OSHandle *browsetable, const char *fullpath, SInt16 *ID)
SInt32 size; SInt32 size;
Boolean found = 0; Boolean found = 0;
#line 114 OS_ASSERT(114, OS_IsFullPath(fullpath));
OPTION_ASSERT(OS_IsFullPath(fullpath)); OS_ASSERT(115, browsetable!=NULL);
OPTION_ASSERT(browsetable!=NULL);
GetBrowseTableInfoAndLock(browsetable, &scan, &cnt, &size); GetBrowseTableInfoAndLock(browsetable, &scan, &cnt, &size);
for (idx = 0; idx < cnt; idx++) { for (idx = 0; idx < cnt; idx++) {
@ -167,9 +166,8 @@ int Browser_PackBrowseFile(Handle browsedata, OSHandle *browsetable, OSHandle *b
int err; int err;
void *bptr; void *bptr;
#line 253 OS_ASSERT(253, browsedata!=NULL);
OPTION_ASSERT(browsedata!=NULL); OS_ASSERT(254, browsetable!=NULL);
OPTION_ASSERT(browsetable!=NULL);
datasize = GetHandleSize(browsedata); datasize = GetHandleSize(browsedata);
tableoffs = (datasize + sizeof(header) + 7) & ~7; tableoffs = (datasize + sizeof(header) + 7) & ~7;

View File

@ -99,8 +99,7 @@ static Boolean FindFileInPaths(Paths *paths, const char *filename, Path **thepat
for (idx = 0; idx < Paths_Count(paths); idx++) { for (idx = 0; idx < Paths_Count(paths); idx++) {
path = Paths_GetPath(paths, idx); path = Paths_GetPath(paths, idx);
#line 175 OS_ASSERT(175, path);
OPTION_ASSERT(path);
if (_FindFileInPath(path, filename, thepath, spec)) if (_FindFileInPath(path, filename, thepath, spec))
return 1; return 1;
} }
@ -263,8 +262,7 @@ int Deps_ChangeSpecialAccessPath(OSSpec *srcfss, Boolean initialize) {
} }
break; break;
default: default:
#line 468 DO_INTERNAL_ERROR(468, "Unhandled include file search type (%d)\n", optsCompiler.includeSearch);
DO_INTERNAL_ERROR("Unhandled include file search type (%d)\n", optsCompiler.includeSearch);
} }
specialAccessPath = FindOrAddGlobalInclPath(gTarg->incls.allPaths, pathspecptr); specialAccessPath = FindOrAddGlobalInclPath(gTarg->incls.allPaths, pathspecptr);

View File

@ -415,8 +415,7 @@ static int CompileEntry(File *file, Boolean *compiled) {
return 1; return 1;
} }
#line 835 OS_ASSERT(835, file->compiler);
OPTION_ASSERT(file->compiler);
*compiled = 1; *compiled = 1;
beginWork = OS_GetMilliseconds(); beginWork = OS_GetMilliseconds();
@ -471,8 +470,7 @@ static void DumpFileAndPathInfo(void) {
} else { } else {
for (i = 0; i < n; i++) { for (i = 0; i < n; i++) {
Path *path = Paths_GetPath(&FrameworkPaths, i); Path *path = Paths_GetPath(&FrameworkPaths, i);
#line 961 OS_ASSERT(961, path != NULL);
OPTION_ASSERT(path != NULL);
CLReport(85, CLReport(85,
OS_PathSpecToString(path->spec, STSbuf, sizeof(STSbuf)), OS_PathSpecToString(path->spec, STSbuf, sizeof(STSbuf)),
@ -483,8 +481,7 @@ static void DumpFileAndPathInfo(void) {
UInt16 j; UInt16 j;
for (j = 0; j < Paths_Count(path->recursive); j++) { for (j = 0; j < Paths_Count(path->recursive); j++) {
Path *sub = Paths_GetPath(path->recursive, j); Path *sub = Paths_GetPath(path->recursive, j);
#line 976 OS_ASSERT(976, sub);
OPTION_ASSERT(sub);
CLReport(85, "\t", OS_PathSpecToString(sub->spec, STSbuf, sizeof(STSbuf))); CLReport(85, "\t", OS_PathSpecToString(sub->spec, STSbuf, sizeof(STSbuf)));
} }
} }
@ -497,8 +494,7 @@ static void DumpFileAndPathInfo(void) {
for (i = 0; i < n; i++) { for (i = 0; i < n; i++) {
char version[80]; char version[80];
Paths_FWInfo *info = Frameworks_GetInfo(i); Paths_FWInfo *info = Frameworks_GetInfo(i);
#line 993 OS_ASSERT(993, info);
OPTION_ASSERT(info);
version[0] = 0; version[0] = 0;
strcpy(version, "\t("); strcpy(version, "\t(");
@ -522,8 +518,7 @@ static void DumpFileAndPathInfo(void) {
} else { } else {
for (i = 0; i < Paths_Count(&gTarg->userPaths); i++) { for (i = 0; i < Paths_Count(&gTarg->userPaths); i++) {
Path *path = Paths_GetPath(&gTarg->userPaths, i); Path *path = Paths_GetPath(&gTarg->userPaths, i);
#line 1024 OS_ASSERT(1024, path != NULL);
OPTION_ASSERT(path != NULL);
CLReport(85, CLReport(85,
OS_PathSpecToString(path->spec, STSbuf, sizeof(STSbuf)), OS_PathSpecToString(path->spec, STSbuf, sizeof(STSbuf)),
@ -534,8 +529,7 @@ static void DumpFileAndPathInfo(void) {
UInt16 j; UInt16 j;
for (j = 0; j < Paths_Count(path->recursive); j++) { for (j = 0; j < Paths_Count(path->recursive); j++) {
Path *sub = Paths_GetPath(path->recursive, j); Path *sub = Paths_GetPath(path->recursive, j);
#line 1039 OS_ASSERT(1039, sub);
OPTION_ASSERT(sub);
CLReport(85, "\t", OS_PathSpecToString(sub->spec, STSbuf, sizeof(STSbuf))); CLReport(85, "\t", OS_PathSpecToString(sub->spec, STSbuf, sizeof(STSbuf)));
} }
} }
@ -550,8 +544,7 @@ static void DumpFileAndPathInfo(void) {
for (i = 0; i < Paths_Count(&gTarg->sysPaths); i++) { for (i = 0; i < Paths_Count(&gTarg->sysPaths); i++) {
Path *path = Paths_GetPath(&gTarg->sysPaths, i); Path *path = Paths_GetPath(&gTarg->sysPaths, i);
#line 1054 OS_ASSERT(1054, path != NULL);
OPTION_ASSERT(path != NULL);
CLReport(85, CLReport(85,
OS_PathSpecToString(path->spec, STSbuf, sizeof(STSbuf)), OS_PathSpecToString(path->spec, STSbuf, sizeof(STSbuf)),
@ -562,8 +555,7 @@ static void DumpFileAndPathInfo(void) {
UInt16 j; UInt16 j;
for (j = 0; j < Paths_Count(path->recursive); j++) { for (j = 0; j < Paths_Count(path->recursive); j++) {
Path *sub = Paths_GetPath(path->recursive, j); Path *sub = Paths_GetPath(path->recursive, j);
#line 1069 OS_ASSERT(1069, sub);
OPTION_ASSERT(sub);
CLReport(85, "\t", OS_PathSpecToString(sub->spec, STSbuf, sizeof(STSbuf))); CLReport(85, "\t", OS_PathSpecToString(sub->spec, STSbuf, sizeof(STSbuf)));
} }
} }

View File

@ -218,8 +218,7 @@ Boolean SendTargetInfoRequest(Target *targ, Plugin *linker, SInt32 dropinflags)
if (linker && !(dropinflags & dropInExecutableTool)) { if (linker && !(dropinflags & dropInExecutableTool)) {
if (optsCmdLine.verbose > 1) if (optsCmdLine.verbose > 1)
CLReport(CLStr50, Plugin_GetDropInName(linker)); CLReport(CLStr50, Plugin_GetDropInName(linker));
#line 298 OS_ASSERT(298, Plugin_GetPluginType(linker) == CWDROPINLINKERTYPE);
OPTION_ASSERT(Plugin_GetPluginType(linker) == CWDROPINLINKERTYPE);
if (!Plugin_VerifyPanels(linker)) if (!Plugin_VerifyPanels(linker))
return 0; return 0;

View File

@ -42,8 +42,7 @@ Handle PrefPanel_GetHandle(PrefPanel *panel) {
else else
SetHandleSize(panel->workHandle, len); SetHandleSize(panel->workHandle, len);
#line 60 OS_ASSERT(60, MemError()==noErr);
OPTION_ASSERT(MemError()==noErr);
HLock(panel->data); HLock(panel->data);
HLock(panel->workHandle); HLock(panel->workHandle);

View File

@ -13,12 +13,9 @@ Target *Target_New(const char *name, OSType cpu, OSType os, OSType lang) {
OS_GetCWD(&targ->outputDirectory); OS_GetCWD(&targ->outputDirectory);
#line 25 OS_ASSERT(25, Segments_Initialize(&targ->linkage.segs));
OPTION_ASSERT(Segments_Initialize(&targ->linkage.segs)); OS_ASSERT(28, Overlays_Initialize(&targ->linkage.overlays));
#line 28 OS_ASSERT(35, Files_Initialize(&targ->files) && Files_Initialize(&targ->pchs) && VFiles_Initialize(&targ->virtualFiles) &&
OPTION_ASSERT(Overlays_Initialize(&targ->linkage.overlays));
#line 35
OPTION_ASSERT(Files_Initialize(&targ->files) && Files_Initialize(&targ->pchs) && VFiles_Initialize(&targ->virtualFiles) &&
Paths_Initialize(&targ->sysPaths) && Paths_Initialize(&targ->userPaths) && Incls_Initialize(&targ->incls, targ)); Paths_Initialize(&targ->sysPaths) && Paths_Initialize(&targ->userPaths) && Incls_Initialize(&targ->incls, targ));
return targ; return targ;

View File

@ -46,8 +46,7 @@ static int SetupLinkerCommandLine(SInt32 dropinflags, File *file, CWCommandLineA
break; break;
} }
#line 89 OS_ASSERT(89, x < numPlugins);
OPTION_ASSERT(x < numPlugins);
args->argc = 1; args->argc = 1;
args->argv = xmalloc("command-line arguments", 2 * sizeof(char *)); args->argv = xmalloc("command-line arguments", 2 * sizeof(char *));
@ -150,8 +149,7 @@ int ExecuteLinker(Plugin *plugin, SInt32 dropinflags, File *file, char *stdoutfi
int x; int x;
// TODO rename this flag to isExecutableTool // TODO rename this flag to isExecutableTool
#line 269 OS_ASSERT(269, dropinflags & dropInExecutableTool);
OPTION_ASSERT(dropinflags & dropInExecutableTool);
args.argc = 0; args.argc = 0;
args.argv = args.envp = NULL; args.argv = args.envp = NULL;

View File

@ -6,8 +6,7 @@ int WriteObjectFile(File *file, OSType maccreator, OSType mactype) {
FSSpec srcfss; FSSpec srcfss;
FSSpec outfss; FSSpec outfss;
#line 22 OS_ASSERT(22, file->objectdata && file->compiler);
OPTION_ASSERT(file->objectdata && file->compiler);
OS_OSSpec_To_FSSpec(&file->outfss, &outfss); OS_OSSpec_To_FSSpec(&file->outfss, &outfss);
OS_OSSpec_To_FSSpec(&file->srcfss, &srcfss); OS_OSSpec_To_FSSpec(&file->srcfss, &srcfss);

View File

@ -52,10 +52,8 @@ CWResult UCBStoreObjectData(CWPluginContext context, SInt32 whichfile, CWObjectD
UCBSecretAttachHandle(context, objecthand, &object->objectdata); UCBSecretAttachHandle(context, objecthand, &object->objectdata);
UCBSecretAttachHandle(context, browsehand, &object->browsedata); UCBSecretAttachHandle(context, browsehand, &object->browsedata);
} else { } else {
if (filedata->outfileowner && filedata->outfileowner != CmdLineStageMask_Cg) { if (filedata->outfileowner && filedata->outfileowner != CmdLineStageMask_Cg)
#line 240 DO_INTERNAL_ERROR(240, "Cannot store object file spec for '%s'\n", filedata->srcfilename);
DO_INTERNAL_ERROR("Cannot store object file spec for '%s'\n", filedata->srcfilename);
}
OS_FSSpec_To_OSSpec(object->objectfile, &filedata->outfss); OS_FSSpec_To_OSSpec(object->objectfile, &filedata->outfss);
filedata->wroteToDisk |= CmdLineStageMask_Cg; filedata->wroteToDisk |= CmdLineStageMask_Cg;
} }
@ -134,8 +132,7 @@ CWResult UCBBeginSubCompile(CWPluginContext context, SInt32 whichfile, CWPluginC
if (optsCmdLine.verbose > 3) if (optsCmdLine.verbose > 3)
CLPrint("Callback: %s\n", "UCBBeginSubCompile"); CLPrint("Callback: %s\n", "UCBBeginSubCompile");
#line 372 DO_INTERNAL_ERROR(372, "UCBBeginSubCompile not implemented");
DO_INTERNAL_ERROR("UCBBeginSubCompile not implemented");
return cwErrRequestFailed; return cwErrRequestFailed;
} }
@ -143,8 +140,7 @@ CWResult UCBEndSubCompile(CWPluginContext subContext) {
if (optsCmdLine.verbose > 3) if (optsCmdLine.verbose > 3)
CLPrint("Callback: %s\n", "UCBEndSubCompile"); CLPrint("Callback: %s\n", "UCBEndSubCompile");
#line 384 DO_INTERNAL_ERROR(384, "UCBEndSubCompile not implemented");
DO_INTERNAL_ERROR("UCBEndSubCompile not implemented");
return cwErrRequestFailed; return cwErrRequestFailed;
} }
@ -165,8 +161,7 @@ CWResult UCBGetPrecompiledHeaderSpec(CWPluginContext context, CWFileSpec *pchspe
return cwErrInvalidCallback; return cwErrInvalidCallback;
file = Files_GetFile(&gTarg->files, c->whichfile); file = Files_GetFile(&gTarg->files, c->whichfile);
#line 420 OS_ASSERT(420, file != NULL);
OPTION_ASSERT(file != NULL);
cof = Plugin_CL_GetObjectFlags(file->compiler); cof = Plugin_CL_GetObjectFlags(file->compiler);
if (!file->outfilename[0]) { if (!file->outfilename[0]) {
@ -222,8 +217,7 @@ CWResult UCBGetResourceFile(CWPluginContext context, CWFileSpec *filespec) {
if (optsCmdLine.verbose > 3) if (optsCmdLine.verbose > 3)
CLPrint("Callback: %s\n", "UCBGetResourceFile"); CLPrint("Callback: %s\n", "UCBGetResourceFile");
#line 514 DO_INTERNAL_ERROR(514, "UCBGetResourceFile not implemented");
DO_INTERNAL_ERROR("UCBGetResourceFile not implemented");
return cwErrRequestFailed; return cwErrRequestFailed;
} }
@ -231,8 +225,7 @@ CWResult UCBPutResourceFile(CWPluginContext context, const char *prompt, const c
if (optsCmdLine.verbose > 3) if (optsCmdLine.verbose > 3)
CLPrint("Callback: %s\n", "UCBPutResourceFile"); CLPrint("Callback: %s\n", "UCBPutResourceFile");
#line 529 DO_INTERNAL_ERROR(529, "UCBPutResourceFile not implemented");
DO_INTERNAL_ERROR("UCBPutResourceFile not implemented");
return cwErrRequestFailed; return cwErrRequestFailed;
} }
@ -270,8 +263,7 @@ CWResult UCBLookUpUnit(CWPluginContext context, const char *name, Boolean isdepe
return cwErrInvalidCallback; return cwErrInvalidCallback;
srcfile = Files_GetFile(&gTarg->files, c->whichfile); srcfile = Files_GetFile(&gTarg->files, c->whichfile);
#line 591 OS_ASSERT(591, srcfile != NULL);
OPTION_ASSERT(srcfile != NULL);
*unitdata = NULL; *unitdata = NULL;
*unitdatalength = 0; *unitdatalength = 0;
@ -403,8 +395,7 @@ CWResult UCBStoreUnit(CWPluginContext context, const char *inunitname, CWMemHand
return cwErrInvalidCallback; return cwErrInvalidCallback;
srcfile = Files_GetFile(&gTarg->files, c->whichfile); srcfile = Files_GetFile(&gTarg->files, c->whichfile);
#line 791 OS_ASSERT(791, srcfile != NULL);
OPTION_ASSERT(srcfile != NULL);
if (optsCompiler.sbmPath[0]) { if (optsCompiler.sbmPath[0]) {
err = OS_MakeSpecWithPath(&clState.sbmPathSpec, unitname, 1, &sbmspec); err = OS_MakeSpecWithPath(&clState.sbmPathSpec, unitname, 1, &sbmspec);
@ -510,8 +501,7 @@ CWResult UCBGetModifiedFiles(CWPluginContext context, SInt32 *modifiedFileCount,
CLPrint("Callback: %s\n", "UCBGetModifiedFiles"); CLPrint("Callback: %s\n", "UCBGetModifiedFiles");
*modifiedFileCount = 0; *modifiedFileCount = 0;
#line 949 DO_INTERNAL_ERROR(949, "CWGetModifiedFiles not implemented!\n");
DO_INTERNAL_ERROR("CWGetModifiedFiles not implemented!\n");
return cwNoErr; return cwNoErr;
} }
@ -538,8 +528,7 @@ CWResult UCBGetStoredObjectFileSpec(CWPluginContext context, SInt32 whichfile, C
if (!(file = Files_GetFile(&gTarg->files, whichfile))) if (!(file = Files_GetFile(&gTarg->files, whichfile)))
return cwErrUnknownFile; return cwErrUnknownFile;
if (file->outfileowner != CmdLineStageMask_Cg) { if (file->outfileowner != CmdLineStageMask_Cg) {
#line 993 DO_INTERNAL_ERROR(993, "Lost stored object file spec for '%s'\n", file->srcfilename);
DO_INTERNAL_ERROR("Lost stored object file spec for '%s'\n", file->srcfilename);
return cwErrRequestFailed; return cwErrRequestFailed;
} else { } else {
OS_OSSpec_To_FSSpec(&file->outfss, fileSpec); OS_OSSpec_To_FSSpec(&file->outfss, fileSpec);

View File

@ -203,8 +203,7 @@ static Boolean FindAndLoad_MissingFile(CWPluginContext context, const char *file
return 0; return 0;
file = Files_GetFile(&gTarg->files, c->whichfile); file = Files_GetFile(&gTarg->files, c->whichfile);
#line 486 OS_ASSERT(486, file != NULL);
OPTION_ASSERT(file != NULL);
OS_MakeSpecWithPath(&file->srcfss.path, filename, 1, spec); OS_MakeSpecWithPath(&file->srcfss.path, filename, 1, spec);
Deps_AddDependency(&file->deps, -1, spec, !fileinfo->fullsearch && !optsCompiler.noSysPath, fileinfo->dependencyType, &fileinfo->alreadyincluded); Deps_AddDependency(&file->deps, -1, spec, !fileinfo->fullsearch && !optsCompiler.noSysPath, fileinfo->dependencyType, &fileinfo->alreadyincluded);
@ -638,8 +637,7 @@ CWResult UCBStorePluginData(CWPluginContext context, SInt32 whichfile, CWDataTyp
if (optsCmdLine.verbose > 3) if (optsCmdLine.verbose > 3)
CLPrint("Callback: %s\n", "UCBStorePluginData"); CLPrint("Callback: %s\n", "UCBStorePluginData");
#line 1267 DO_INTERNAL_ERROR(1267, "UCBStorePluginData not implemented");
DO_INTERNAL_ERROR("UCBStorePluginData not implemented");
return cwErrRequestFailed; return cwErrRequestFailed;
} }
@ -647,8 +645,7 @@ CWResult UCBGetPluginData(CWPluginContext context, SInt32 whichfile, CWDataType
if (optsCmdLine.verbose > 3) if (optsCmdLine.verbose > 3)
CLPrint("Callback: %s\n", "UCBGetPluginData"); CLPrint("Callback: %s\n", "UCBGetPluginData");
#line 1286 DO_INTERNAL_ERROR(1286, "UCBGetPluginData not implemented");
DO_INTERNAL_ERROR("UCBGetPluginData not implemented");
return cwErrRequestFailed; return cwErrRequestFailed;
} }
@ -951,8 +948,7 @@ CWResult UCBCreateNewTextDocument(CWPluginContext context, const CWNewTextDocume
return cwErrRequestFailed; return cwErrRequestFailed;
} }
} else { } else {
#line 1755 DO_INTERNAL_ERROR(1755, "Cannot deal with unexpected document");
DO_INTERNAL_ERROR("Cannot deal with unexpected document");
return cwErrInvalidCallback; return cwErrInvalidCallback;
} }
} }
@ -1062,8 +1058,7 @@ CWResult UCBPreFileAction(CWPluginContext context, const CWFileSpec *theFile) {
if (optsCmdLine.verbose > 3) if (optsCmdLine.verbose > 3)
CLPrint("Callback: %s\n", "UCBPreFileAction"); CLPrint("Callback: %s\n", "UCBPreFileAction");
#line 1963 DO_INTERNAL_ERROR(1963, "UCBPreFileAction not implemented");
DO_INTERNAL_ERROR("UCBPreFileAction not implemented");
return cwErrRequestFailed; return cwErrRequestFailed;
} }
@ -1071,8 +1066,7 @@ CWResult UCBPostFileAction(CWPluginContext context, const CWFileSpec *theFile) {
if (optsCmdLine.verbose > 3) if (optsCmdLine.verbose > 3)
CLPrint("Callback: %s\n", "UCBPostFileAction"); CLPrint("Callback: %s\n", "UCBPostFileAction");
#line 1977 DO_INTERNAL_ERROR(1977, "UCBPostFileAction not implemented");
DO_INTERNAL_ERROR("UCBPostFileAction not implemented");
return cwErrRequestFailed; return cwErrRequestFailed;
} }
@ -1100,8 +1094,7 @@ CWResult UCBCacheAccessPathList(CWPluginContext context) {
for (x = 0; x < apl->userPathCount; x++) { for (x = 0; x < apl->userPathCount; x++) {
ap = &apl->userPaths[x]; ap = &apl->userPaths[x];
path = Paths_GetPath(&gTarg->userPaths, x); path = Paths_GetPath(&gTarg->userPaths, x);
#line 2010 OS_ASSERT(2010, path);
OPTION_ASSERT(path);
OS_MakeSpecWithPath(path->spec, NULL, 0, &spec); OS_MakeSpecWithPath(path->spec, NULL, 0, &spec);
OS_OSSpec_To_FSSpec(&spec, &ap->pathSpec); OS_OSSpec_To_FSSpec(&spec, &ap->pathSpec);
@ -1132,8 +1125,7 @@ CWResult UCBCacheAccessPathList(CWPluginContext context) {
for (x = 0; x < apl->systemPathCount; x++) { for (x = 0; x < apl->systemPathCount; x++) {
ap = &apl->systemPaths[x]; ap = &apl->systemPaths[x];
path = Paths_GetPath(&gTarg->sysPaths, x); path = Paths_GetPath(&gTarg->sysPaths, x);
#line 2044 OS_ASSERT(2044, path);
OPTION_ASSERT(path);
OS_MakeSpecWithPath(path->spec, NULL, 0, &spec); OS_MakeSpecWithPath(path->spec, NULL, 0, &spec);
OS_OSSpec_To_FSSpec(&spec, &ap->pathSpec); OS_OSSpec_To_FSSpec(&spec, &ap->pathSpec);
@ -1208,8 +1200,7 @@ CWResult UCBCheckinLicense(CWPluginContext context, SInt32 cookie) {
} }
CWResult UCBResolveRelativePath(CWPluginContext context, const CWRelativePath *relativePath, CWFileSpec *fileSpec, Boolean create) { CWResult UCBResolveRelativePath(CWPluginContext context, const CWRelativePath *relativePath, CWFileSpec *fileSpec, Boolean create) {
#line 2255 DO_INTERNAL_ERROR(2255, "UCBResolveRelativePath not implemented");
DO_INTERNAL_ERROR("UCBResolveRelativePath not implemented");
return cwErrRequestFailed; return cwErrRequestFailed;
} }

View File

@ -258,7 +258,7 @@ typedef struct {
} UnkCLIOStruct; } UnkCLIOStruct;
// unknown names for these inlines // unknown names for these inlines
inline void appendText(UnkCLIOStruct *f, const char *str) { CW_INLINE void appendText(UnkCLIOStruct *f, const char *str) {
int len = strlen(str); int len = strlen(str);
if (f->pos + len >= f->maxlen) { if (f->pos + len >= f->maxlen) {
@ -278,7 +278,7 @@ inline void appendText(UnkCLIOStruct *f, const char *str) {
f->pos += len; f->pos += len;
f->col += len; f->col += len;
} }
inline void appendChar(UnkCLIOStruct *f, char c) { CW_INLINE void appendChar(UnkCLIOStruct *f, char c) {
if (f->pos >= f->maxlen) { if (f->pos >= f->maxlen) {
f->maxlen *= 2; f->maxlen *= 2;
if (f->original) { if (f->original) {
@ -301,7 +301,7 @@ static void StartLine(UnkCLIOStruct *f) {
appendText(f, f->newline); appendText(f, f->newline);
} }
inline void newLine(UnkCLIOStruct *f) { CW_INLINE void newLine(UnkCLIOStruct *f) {
if (f->newline) if (f->newline)
appendChar(f, '\n'); appendChar(f, '\n');
else else
@ -424,14 +424,12 @@ void CLPrintDispatch(int unk, SInt16 msgtype, const char *message) {
const char *ptr; const char *ptr;
const char *nptr; const char *nptr;
if (optsCmdLine.stderr2stdout == 1 || msgtype == Msg_Note || msgtype == Msg_Status) { if (optsCmdLine.stderr2stdout == 1 || msgtype == Msg_Note || msgtype == Msg_Status)
out = stdout; out = stdout;
} else if (msgtype == Msg_Warning || msgtype == Msg_Error || msgtype == Msg_Alert) { else if (msgtype == Msg_Warning || msgtype == Msg_Error || msgtype == Msg_Alert)
out = stderr; out = stderr;
} else { else
#line 847 OS_ASSERT(847, 0);
OPTION_ASSERT(0);
}
if (!printedAnything && !ioPiping) { if (!printedAnything && !ioPiping) {
printedAnything = 1; printedAnything = 1;

View File

@ -672,8 +672,7 @@ OSErr FSMakeFSSpec(SInt16 vRefNum, SInt32 dirID, ConstStr255Param pathName, FSSp
} }
OS_PathSpecToString(&spec.path, path, 256); OS_PathSpecToString(&spec.path, path, 256);
} else { } else {
#line 840 OS_ASSERT(840, vRefNum!=0);
OPTION_ASSERT(vRefNum!=0);
tmpfss.vRefNum = vRefNum; tmpfss.vRefNum = vRefNum;
tmpfss.parID = dirID ? dirID : 2; tmpfss.parID = dirID ? dirID : 2;
tmpfss.name[0] = 0; tmpfss.name[0] = 0;

View File

@ -568,8 +568,7 @@ static void WriteResourceFork(SInt16 ref) {
mrle = mtyp->ref_list; mrle = mtyp->ref_list;
while (mrle) { while (mrle) {
#line 943 OS_ASSERT(943, reflist_offs < dmap.namelist_offs);
OPTION_ASSERT(reflist_offs < dmap.namelist_offs);
drle.id = mrle->id; drle.id = mrle->id;
drle.name_offs = (mrle->name) ? name_offs : -1; drle.name_offs = (mrle->name) ? name_offs : -1;
@ -583,18 +582,16 @@ static void WriteResourceFork(SInt16 ref) {
reflist_offs += sizeof(trle); reflist_offs += sizeof(trle);
if (mrle->name) { if (mrle->name) {
#line 962
if (dhdr.map_offs < dhdr.data_offs) if (dhdr.map_offs < dhdr.data_offs)
OPTION_ASSERT(name_offs + dmap.namelist_offs + dhdr.map_offs < dhdr.data_offs); OS_ASSERT(963, name_offs + dmap.namelist_offs + dhdr.map_offs < dhdr.data_offs);
RF_HANDLE_INSERT(hand_ref, mrle->name, dhdr.map_offs + dmap.namelist_offs + drle.name_offs, mrle->name[0] + 1); RF_HANDLE_INSERT(hand_ref, mrle->name, dhdr.map_offs + dmap.namelist_offs + drle.name_offs, mrle->name[0] + 1);
name_offs += mrle->name[0] + 1; name_offs += mrle->name[0] + 1;
} }
#line 970 OS_ASSERT(970, data_offs < dhdr.data_len);
OPTION_ASSERT(data_offs < dhdr.data_len); OS_ASSERT(971, mrle->hand!=NULL);
OPTION_ASSERT(mrle->hand!=NULL);
if (dhdr.map_offs > dhdr.data_offs) if (dhdr.map_offs > dhdr.data_offs)
OPTION_ASSERT(data_offs + dhdr.data_offs < dhdr.map_offs); OS_ASSERT(973, data_offs + dhdr.data_offs < dhdr.map_offs);
HLock(mrle->hand); HLock(mrle->hand);
dent.len = GetHandleSize(mrle->hand); dent.len = GetHandleSize(mrle->hand);

View File

@ -7,7 +7,7 @@ static OSOpenedDir wilddirref;
static OSSpec wildmatch; static OSSpec wildmatch;
char STSbuf[256]; char STSbuf[256];
inline char dummyfunc(int ch) { CW_INLINE char dummyfunc(int ch) {
return ch; return ch;
} }

View File

@ -15,8 +15,7 @@ void OS_AddFileTypeMappingList(OSFileTypeMappings **list, const OSFileTypeMappin
scan = &(*scan)->next; scan = &(*scan)->next;
*scan = malloc(sizeof(OSFileTypeMappings)); *scan = malloc(sizeof(OSFileTypeMappings));
#line 40 OS_ASSERT(40, *scan != NULL);
OPTION_ASSERT(*scan != NULL);
(*scan)->mappingList = entry; (*scan)->mappingList = entry;
(*scan)->next = 0; (*scan)->next = 0;
} }

View File

@ -94,8 +94,7 @@ static DirNode *FindDirMapEntry(unsigned int dirID) {
row = dirID >> 8; row = dirID >> 8;
col = dirID & 0xFF; col = dirID & 0xFF;
#line 166 OS_ASSERT(166, dirID != 2);
OPTION_ASSERT(dirID != 2);
if (row >= dirMapRows) if (row >= dirMapRows)
return 0; return 0;
@ -167,8 +166,7 @@ static int FindOrAdd(const OSPathSpec *path, unsigned int *vRefNum, unsigned int
*vRefNum = vol->vRefNum; *vRefNum = vol->vRefNum;
level = &vol->root; level = &vol->root;
ptr = &pb[1]; ptr = &pb[1];
#line 267 OS_ASSERT(267, *pb == OS_PATHSEP);
OPTION_ASSERT(*pb == OS_PATHSEP);
while (*ptr) { while (*ptr) {
st = ptr; st = ptr;

View File

@ -91,8 +91,7 @@ char *mvprintf(char *mybuf, unsigned int len, const char *format, va_list va) {
int ret; int ret;
char *buf; char *buf;
#line 134 OS_ASSERT(134, mybuf != NULL);
OPTION_ASSERT(mybuf != NULL);
maxlen = len - 1; maxlen = len - 1;
buf = mybuf; buf = mybuf;

View File

@ -15,8 +15,7 @@ const ToolVersionInfo *Plugin_GetToolVersionInfo(void) {
static const char *Plugin_GetDisplayName(Plugin *pl) { static const char *Plugin_GetDisplayName(Plugin *pl) {
const char *name; const char *name;
#line 251 OS_ASSERT(251, pl);
OPTION_ASSERT(pl);
if (pl->cb->GetDisplayName && pl->cb->GetDisplayName(&name) == 0) if (pl->cb->GetDisplayName && pl->cb->GetDisplayName(&name) == 0)
return name; return name;
@ -26,8 +25,7 @@ static const char *Plugin_GetDisplayName(Plugin *pl) {
const char *Plugin_GetDropInName(Plugin *pl) { const char *Plugin_GetDropInName(Plugin *pl) {
const char *name; const char *name;
#line 263 OS_ASSERT(263, pl);
OPTION_ASSERT(pl);
if (pl->cb->GetDropInName && pl->cb->GetDropInName(&name) == 0) if (pl->cb->GetDropInName && pl->cb->GetDropInName(&name) == 0)
return name; return name;
@ -38,8 +36,7 @@ const char *Plugin_GetDropInName(Plugin *pl) {
const VersionInfo *Plugin_GetVersionInfo(Plugin *pl) { const VersionInfo *Plugin_GetVersionInfo(Plugin *pl) {
static const VersionInfo fakeversion = {0, 0, 0, 0}; static const VersionInfo fakeversion = {0, 0, 0, 0};
const VersionInfo *vi; const VersionInfo *vi;
#line 276 OS_ASSERT(276, pl);
OPTION_ASSERT(pl);
if (pl->cb->GetVersionInfo && pl->cb->GetVersionInfo(&vi) == 0) if (pl->cb->GetVersionInfo && pl->cb->GetVersionInfo(&vi) == 0)
return vi; return vi;
@ -82,8 +79,7 @@ DropInFlags *Plugin_GetDropInFlags(Plugin *pl) {
const DropInFlags *df; const DropInFlags *df;
SInt32 dfsize; SInt32 dfsize;
#line 329 OS_ASSERT(329, pl);
OPTION_ASSERT(pl);
if (pl->cb->GetDropInFlags && pl->cb->GetDropInFlags(&df, &dfsize) == 0) { if (pl->cb->GetDropInFlags && pl->cb->GetDropInFlags(&df, &dfsize) == 0) {
memset(&retdf, 0, sizeof(retdf)); memset(&retdf, 0, sizeof(retdf));
@ -97,8 +93,7 @@ DropInFlags *Plugin_GetDropInFlags(Plugin *pl) {
OSType Plugin_GetPluginType(Plugin *pl) { OSType Plugin_GetPluginType(Plugin *pl) {
DropInFlags *df; DropInFlags *df;
#line 345 OS_ASSERT(345, pl);
OPTION_ASSERT(pl);
df = Plugin_GetDropInFlags(pl); df = Plugin_GetDropInFlags(pl);
if (df) if (df)
@ -115,9 +110,8 @@ const CWTargetList *Plugin_CL_GetTargetList(Plugin *pl) {
}; };
const CWTargetList *tl; const CWTargetList *tl;
#line 358 OS_ASSERT(358, pl);
OPTION_ASSERT(pl); OS_ASSERT(359, pl->cl_cb != NULL);
OPTION_ASSERT(pl->cl_cb != NULL);
if (pl->cl_cb->GetTargetList && pl->cl_cb->GetTargetList(&tl) == 0) if (pl->cl_cb->GetTargetList && pl->cl_cb->GetTargetList(&tl) == 0)
return tl; return tl;
@ -131,8 +125,7 @@ const CWPanelList *Plugin_GetPanelList(Plugin *pl) {
}; };
const CWPanelList *pnl; const CWPanelList *pnl;
#line 381 OS_ASSERT(381, pl);
OPTION_ASSERT(pl);
if (pl->cb->GetPanelList && pl->cb->GetPanelList(&pnl) == 0) if (pl->cb->GetPanelList && pl->cb->GetPanelList(&pnl) == 0)
return pnl; return pnl;
@ -147,9 +140,8 @@ const CWExtMapList *Plugin_CL_GetExtMapList(Plugin *pl) {
}; };
const CWExtMapList *el; const CWExtMapList *el;
#line 401 OS_ASSERT(401, pl);
OPTION_ASSERT(pl); OS_ASSERT(402, pl->cl_cb != NULL);
OPTION_ASSERT(pl->cl_cb != NULL);
if (pl->cl_cb->GetDefaultMappingList && pl->cl_cb->GetDefaultMappingList(&el) == 0) if (pl->cl_cb->GetDefaultMappingList && pl->cl_cb->GetDefaultMappingList(&el) == 0)
return el; return el;
@ -160,8 +152,7 @@ const CWExtMapList *Plugin_CL_GetExtMapList(Plugin *pl) {
const OSFileTypeMappingList *Plugin_GetFileTypeMappingList(Plugin *pl) { const OSFileTypeMappingList *Plugin_GetFileTypeMappingList(Plugin *pl) {
const OSFileTypeMappingList *ftml; const OSFileTypeMappingList *ftml;
#line 422 OS_ASSERT(422, pl);
OPTION_ASSERT(pl);
if (pl->cb->GetFileTypeMappings && pl->cb->GetFileTypeMappings(&ftml) == 0) if (pl->cb->GetFileTypeMappings && pl->cb->GetFileTypeMappings(&ftml) == 0)
return ftml; return ftml;
@ -177,9 +168,8 @@ const CWObjectFlags *Plugin_CL_GetObjectFlags(Plugin *pl) {
}; };
const CWObjectFlags *cof; const CWObjectFlags *cof;
#line 434 OS_ASSERT(434, pl);
OPTION_ASSERT(pl); OS_ASSERT(435, pl->cl_cb != NULL);
OPTION_ASSERT(pl->cl_cb != NULL);
if (pl->cl_cb->GetObjectFlags && pl->cl_cb->GetObjectFlags(&cof) == 0) if (pl->cl_cb->GetObjectFlags && pl->cl_cb->GetObjectFlags(&cof) == 0)
return cof; return cof;
@ -288,8 +278,7 @@ Boolean Plugin_MatchesType(Plugin *pl, OSType type, OSType lang, Boolean exact)
Boolean Plugin_Pr_MatchesPlugin(Plugin *pl, CLPluginInfo *pluginfo, OSType cpu, OSType os) { Boolean Plugin_Pr_MatchesPlugin(Plugin *pl, CLPluginInfo *pluginfo, OSType cpu, OSType os) {
Boolean isSupported; Boolean isSupported;
#line 566 OS_ASSERT(566, pl->pr_cb != NULL);
OPTION_ASSERT(pl->pr_cb != NULL);
if (pl->pr_cb->SupportsPlugin && pl->pr_cb->SupportsPlugin(pluginfo, cpu, os, &isSupported) == 0) if (pl->pr_cb->SupportsPlugin && pl->pr_cb->SupportsPlugin(pluginfo, cpu, os, &isSupported) == 0)
return isSupported; return isSupported;
@ -300,8 +289,7 @@ Boolean Plugin_Pr_MatchesPlugin(Plugin *pl, CLPluginInfo *pluginfo, OSType cpu,
Boolean Plugin_Pr_MatchesPanels(Plugin *pl, int numPanels, const char **panelNames) { Boolean Plugin_Pr_MatchesPanels(Plugin *pl, int numPanels, const char **panelNames) {
Boolean isSupported; Boolean isSupported;
#line 578 OS_ASSERT(578, pl->pr_cb != NULL);
OPTION_ASSERT(pl->pr_cb != NULL);
if (pl->pr_cb->SupportsPanels && pl->pr_cb->SupportsPanels(numPanels, panelNames, &isSupported) == 0) if (pl->pr_cb->SupportsPanels && pl->pr_cb->SupportsPanels(numPanels, panelNames, &isSupported) == 0)
return isSupported; return isSupported;
@ -312,9 +300,8 @@ Boolean Plugin_Pr_MatchesPanels(Plugin *pl, int numPanels, const char **panelNam
Boolean Plugin_CL_WriteObjectFile(Plugin *pl, FSSpec *srcfss, FSSpec *outfss, OSType creator, OSType type, Handle data) { Boolean Plugin_CL_WriteObjectFile(Plugin *pl, FSSpec *srcfss, FSSpec *outfss, OSType creator, OSType type, Handle data) {
OSSpec outoss; OSSpec outoss;
#line 590 OS_ASSERT(590, pl->cl_cb != NULL);
OPTION_ASSERT(pl->cl_cb != NULL); OS_ASSERT(591, data != NULL && srcfss != NULL && outfss != NULL);
OPTION_ASSERT(data != NULL && srcfss != NULL && outfss != NULL);
if (pl->cl_cb->WriteObjectFile) { if (pl->cl_cb->WriteObjectFile) {
return pl->cl_cb->WriteObjectFile(srcfss, outfss, creator, type, data) == 0; return pl->cl_cb->WriteObjectFile(srcfss, outfss, creator, type, data) == 0;
@ -349,7 +336,7 @@ Boolean Plugin_CL_GetCompilerMapping(Plugin *pl, OSType type, const char *ext, U
} }
static Boolean SupportedPlugin(Plugin *pl, const char **reason) { static Boolean SupportedPlugin(Plugin *pl, const char **reason) {
static const SInt32 DropInFlagsSize[3] = {0, 0x10, 0x12}; static const SInt32 DropInFlagsSize[3] = {0, sizeof(DropInFlagsV1), sizeof(DropInFlags)};
const DropInFlags *df; const DropInFlags *df;
const CWObjectFlags *cof; const CWObjectFlags *cof;
SInt32 dfsize; SInt32 dfsize;
@ -884,9 +871,8 @@ int Plugins_GetPluginList(Plugin *list, int *numPlugins, CLPluginInfo **pluginIn
while (scan) { while (scan) {
df = Plugin_GetDropInFlags(scan); df = Plugin_GetDropInFlags(scan);
vi = Plugin_GetVersionInfo(scan); vi = Plugin_GetVersionInfo(scan);
#line 1270 OS_ASSERT(1270, df != NULL);
OPTION_ASSERT(df != NULL); OS_ASSERT(1271, vi != NULL);
OPTION_ASSERT(vi != NULL);
(*pluginInfo)[idx].plugintype = df->dropintype; (*pluginInfo)[idx].plugintype = df->dropintype;
(*pluginInfo)[idx].language = df->edit_language; (*pluginInfo)[idx].language = df->edit_language;
(*pluginInfo)[idx].dropinflags = df->dropinflags; (*pluginInfo)[idx].dropinflags = df->dropinflags;

View File

@ -32,8 +32,7 @@ void Path_Free(Path *path) {
} }
Boolean Paths_Initialize(Paths *paths) { Boolean Paths_Initialize(Paths *paths) {
#line 52 OS_ASSERT(52, paths != NULL);
OPTION_ASSERT(paths != NULL);
memset(paths, 0, sizeof(Paths)); memset(paths, 0, sizeof(Paths));
paths->pathsArray = NULL; paths->pathsArray = NULL;
@ -43,8 +42,7 @@ Boolean Paths_Initialize(Paths *paths) {
Boolean Paths_Terminate(Paths *paths) { Boolean Paths_Terminate(Paths *paths) {
UInt16 index; UInt16 index;
#line 63 OS_ASSERT(63, paths != NULL);
OPTION_ASSERT(paths != NULL);
if (paths->pathsArray) { if (paths->pathsArray) {
for (index = 0; index < paths->pathsCount; index++) for (index = 0; index < paths->pathsCount; index++)
@ -59,8 +57,7 @@ Boolean Paths_Terminate(Paths *paths) {
static Boolean Paths_GrowPaths(Paths *paths, UInt16 *index) { static Boolean Paths_GrowPaths(Paths *paths, UInt16 *index) {
Path **newArray; Path **newArray;
#line 84 OS_ASSERT(84, paths != NULL);
OPTION_ASSERT(paths != NULL);
if (paths->pathsCount >= paths->arraySize) { if (paths->pathsCount >= paths->arraySize) {
paths->arraySize += 20; paths->arraySize += 20;
@ -116,8 +113,7 @@ Boolean Paths_DeletePath(Paths *paths, UInt16 index) {
} }
Path *Paths_GetPath(Paths *paths, UInt16 pathnum) { Path *Paths_GetPath(Paths *paths, UInt16 pathnum) {
#line 151 OS_ASSERT(151, paths != NULL);
OPTION_ASSERT(paths != NULL);
if (pathnum < paths->pathsCount) if (pathnum < paths->pathsCount)
return paths->pathsArray[pathnum]; return paths->pathsArray[pathnum];
@ -126,8 +122,7 @@ Path *Paths_GetPath(Paths *paths, UInt16 pathnum) {
} }
UInt16 Paths_Count(const Paths *paths) { UInt16 Paths_Count(const Paths *paths) {
#line 161 OS_ASSERT(161, paths != NULL);
OPTION_ASSERT(paths != NULL);
return paths->pathsCount; return paths->pathsCount;
} }
@ -135,8 +130,7 @@ UInt16 Paths_Count(const Paths *paths) {
Boolean Paths_FindPath(const Paths *paths, const Path *path) { Boolean Paths_FindPath(const Paths *paths, const Path *path) {
UInt16 idx; UInt16 idx;
#line 169 OS_ASSERT(169, paths != NULL);
OPTION_ASSERT(paths != NULL);
for (idx = 0; idx < paths->pathsCount; idx++) { for (idx = 0; idx < paths->pathsCount; idx++) {
if (paths->pathsArray[idx] == path) if (paths->pathsArray[idx] == path)
@ -150,8 +144,7 @@ Path *Paths_FindPathSpec(const Paths *paths, const OSPathSpec *dir) {
UInt16 idx; UInt16 idx;
Path *path; Path *path;
#line 182 OS_ASSERT(182, paths != NULL);
OPTION_ASSERT(paths != NULL);
for (idx = 0; idx < paths->pathsCount; idx++) { for (idx = 0; idx < paths->pathsCount; idx++) {
path = paths->pathsArray[idx]; path = paths->pathsArray[idx];
@ -220,8 +213,7 @@ int Paths_CountRecurse(Paths *paths) {
mine = Paths_Count(paths); mine = Paths_Count(paths);
for (idx = 0; idx < mine; idx++) { for (idx = 0; idx < mine; idx++) {
path = Paths_GetPath(paths, idx); path = Paths_GetPath(paths, idx);
#line 336 OS_ASSERT(336, path);
OPTION_ASSERT(path);
if (path->recursive) if (path->recursive)
mine += Paths_CountRecurse(path->recursive); mine += Paths_CountRecurse(path->recursive);
@ -237,11 +229,9 @@ static void CopyRecurseFSS(FSSpec **list, Paths *paths, UInt16 *count) {
for (idx = 0; idx < Paths_Count(paths); idx++) { for (idx = 0; idx < Paths_Count(paths); idx++) {
path = Paths_GetPath(paths, idx); path = Paths_GetPath(paths, idx);
#line 353 OS_ASSERT(353, path && *count > 0);
OPTION_ASSERT(path && *count > 0);
OS_MakeSpecWithPath(path->spec, NULL, 0, &spec); OS_MakeSpecWithPath(path->spec, NULL, 0, &spec);
#line 355 OS_ASSERT(355, OS_OSSpec_To_FSSpec(&spec, *list));
OPTION_ASSERT(OS_OSSpec_To_FSSpec(&spec, *list));
(*list)++; (*list)++;
(*count)--; (*count)--;
if (path->recursive) if (path->recursive)
@ -251,13 +241,11 @@ static void CopyRecurseFSS(FSSpec **list, Paths *paths, UInt16 *count) {
void Paths_CopyRecurseFSS(FSSpec *list, Paths *paths, UInt16 count) { void Paths_CopyRecurseFSS(FSSpec *list, Paths *paths, UInt16 count) {
CopyRecurseFSS(&list, paths, &count); CopyRecurseFSS(&list, paths, &count);
#line 367 OS_ASSERT(367, count == 0);
OPTION_ASSERT(count == 0);
} }
static Boolean Frameworks_Initialize(Frameworks *fws) { static Boolean Frameworks_Initialize(Frameworks *fws) {
#line 405 OS_ASSERT(405, fws != NULL);
OPTION_ASSERT(fws != NULL);
memset(fws, 0, sizeof(Frameworks)); memset(fws, 0, sizeof(Frameworks));
fws->fwsArray = NULL; fws->fwsArray = NULL;
@ -267,8 +255,7 @@ static Boolean Frameworks_Initialize(Frameworks *fws) {
static Boolean Frameworks_Grow(Frameworks *fws, UInt16 *index) { static Boolean Frameworks_Grow(Frameworks *fws, UInt16 *index) {
Paths_FWInfo **newArray; Paths_FWInfo **newArray;
#line 418 OS_ASSERT(418, fws != NULL);
OPTION_ASSERT(fws != NULL);
if (fws->fwsCount >= fws->arraySize) { if (fws->fwsCount >= fws->arraySize) {
fws->arraySize += 20; fws->arraySize += 20;
@ -461,9 +448,8 @@ void Framework_GetEnvInfo(void) {
int err; int err;
Boolean is_file; Boolean is_file;
#line 672 OS_ASSERT(672, Paths_Initialize(&FrameworkPaths) == 1);
OPTION_ASSERT(Paths_Initialize(&FrameworkPaths) == 1); OS_ASSERT(673, Frameworks_Initialize(&FrameworkInfo) == 1);
OPTION_ASSERT(Frameworks_Initialize(&FrameworkInfo) == 1);
env = getenv("MWFrameworkPaths"); env = getenv("MWFrameworkPaths");
if (env) { if (env) {
@ -518,8 +504,7 @@ int Frameworks_GetCount(void) {
} }
Paths_FWInfo *Frameworks_GetInfo(int which) { Paths_FWInfo *Frameworks_GetInfo(int which) {
#line 762 OS_ASSERT(762, FrameworkInfo.fwsArray);
OPTION_ASSERT(FrameworkInfo.fwsArray); OS_ASSERT(763, FrameworkInfo.fwsCount > which);
OPTION_ASSERT(FrameworkInfo.fwsCount > which);
return FrameworkInfo.fwsArray[which]; return FrameworkInfo.fwsArray[which];
} }

View File

@ -30,8 +30,7 @@ void File_Free(File *file) {
} }
Boolean Files_Initialize(Files *this) { Boolean Files_Initialize(Files *this) {
#line 47 OS_ASSERT(47, this != NULL);
OPTION_ASSERT(this != NULL);
return 1; return 1;
} }
@ -39,8 +38,7 @@ Boolean Files_Terminate(Files *this) {
File *file; File *file;
File *next; File *next;
#line 56 OS_ASSERT(56, this != NULL);
OPTION_ASSERT(this != NULL);
for (file = this->fileList; file; file = next) { for (file = this->fileList; file; file = next) {
next = file->next; next = file->next;
@ -57,9 +55,8 @@ Boolean Files_AddFile(Files *this, File *file) {
Boolean Files_InsertFile(Files *this, File *file, SInt32 position) { Boolean Files_InsertFile(Files *this, File *file, SInt32 position) {
File **scan; File **scan;
#line 80 OS_ASSERT(80, this != NULL);
OPTION_ASSERT(this != NULL); OS_ASSERT(81, file != NULL);
OPTION_ASSERT(file != NULL);
if (position < 0) if (position < 0)
position = 0; position = 0;
@ -81,9 +78,8 @@ Boolean Files_InsertFile(Files *this, File *file, SInt32 position) {
File *Files_GetFile(Files *this, SInt32 filenum) { File *Files_GetFile(Files *this, SInt32 filenum) {
File *file; File *file;
#line 104 OS_ASSERT(104, this != NULL);
OPTION_ASSERT(this != NULL); OS_ASSERT(105, filenum >= 0);
OPTION_ASSERT(filenum >= 0);
file = this->fileList; file = this->fileList;
while (file && file->filenum != filenum) while (file && file->filenum != filenum)
@ -101,8 +97,7 @@ File *Files_FindFile(Files *this, OSSpec *spec) {
} }
int Files_Count(Files *this) { int Files_Count(Files *this) {
#line 127 OS_ASSERT(127, this != NULL);
OPTION_ASSERT(this != NULL);
return this->fileCount; return this->fileCount;
} }

View File

@ -6,8 +6,7 @@ Boolean Overlays_Initialize(Overlays *this) {
OvlAddr addr; OvlAddr addr;
SInt32 idx; SInt32 idx;
#line 24 OS_ASSERT(24, this);
OPTION_ASSERT(this);
this->groups = NULL; this->groups = NULL;
this->lastgrp = NULL; this->lastgrp = NULL;
@ -24,12 +23,10 @@ Boolean Overlays_Initialize(Overlays *this) {
return 0; return 0;
OvlGroup_AddOverlay(grp, ovl, &idx); OvlGroup_AddOverlay(grp, ovl, &idx);
#line 42 OS_ASSERT(42, idx==0);
OPTION_ASSERT(idx==0);
Overlays_AddOvlGroup(this, grp, &idx); Overlays_AddOvlGroup(this, grp, &idx);
#line 45 OS_ASSERT(45, idx==0);
OPTION_ASSERT(idx==0);
return 1; return 1;
} }
@ -38,8 +35,7 @@ Boolean Overlays_Terminate(Overlays *this) {
OvlGroup *grp; OvlGroup *grp;
OvlGroup *nxtgrp; OvlGroup *nxtgrp;
#line 54 OS_ASSERT(54, this);
OPTION_ASSERT(this);
for (grp = this->groups; grp; grp = nxtgrp) { for (grp = this->groups; grp; grp = nxtgrp) {
nxtgrp = grp->next; nxtgrp = grp->next;
@ -52,9 +48,8 @@ Boolean Overlays_Terminate(Overlays *this) {
} }
Boolean Overlays_AddOvlGroup(Overlays *this, OvlGroup *grp, SInt32 *grpnum) { Boolean Overlays_AddOvlGroup(Overlays *this, OvlGroup *grp, SInt32 *grpnum) {
#line 70 OS_ASSERT(70, this);
OPTION_ASSERT(this); OS_ASSERT(71, grp);
OPTION_ASSERT(grp);
if (this->groups == NULL) if (this->groups == NULL)
this->groups = grp; this->groups = grp;
@ -73,8 +68,7 @@ OvlGroup *Overlays_GetOvlGroup(Overlays *this, SInt32 grpnum) {
OvlGroup *grp; OvlGroup *grp;
SInt32 cnt = 0; SInt32 cnt = 0;
#line 93 OS_ASSERT(93, this);
OPTION_ASSERT(this);
grp = this->groups; grp = this->groups;
while (grp && cnt < grpnum) { while (grp && cnt < grpnum) {
@ -92,8 +86,7 @@ SInt32 Overlays_CountGroups(Overlays *this) {
OvlGroup *scan; OvlGroup *scan;
int num = 0; int num = 0;
#line 112 OS_ASSERT(112, this);
OPTION_ASSERT(this);
scan = this->groups; scan = this->groups;
while (scan) { while (scan) {
@ -107,8 +100,7 @@ SInt32 Overlays_CountGroups(Overlays *this) {
Boolean Overlays_AddFileToOverlay(Overlays *this, SInt32 grpnum, SInt32 ovlnum, SInt32 filenum) { Boolean Overlays_AddFileToOverlay(Overlays *this, SInt32 grpnum, SInt32 ovlnum, SInt32 filenum) {
Overlay *oly; Overlay *oly;
#line 130 OS_ASSERT(130, this);
OPTION_ASSERT(this);
oly = Overlays_GetOverlayInGroup(this, grpnum, ovlnum); oly = Overlays_GetOverlayInGroup(this, grpnum, ovlnum);
if (oly) if (oly)
@ -120,8 +112,7 @@ Boolean Overlays_AddFileToOverlay(Overlays *this, SInt32 grpnum, SInt32 ovlnum,
Overlay *Overlays_GetOverlayInGroup(Overlays *this, SInt32 grpnum, SInt32 ovlnum) { Overlay *Overlays_GetOverlayInGroup(Overlays *this, SInt32 grpnum, SInt32 ovlnum) {
OvlGroup *grp; OvlGroup *grp;
#line 144 OS_ASSERT(144, this);
OPTION_ASSERT(this);
grp = Overlays_GetOvlGroup(this, grpnum); grp = Overlays_GetOvlGroup(this, grpnum);
if (grp) if (grp)
@ -133,8 +124,7 @@ Overlay *Overlays_GetOverlayInGroup(Overlays *this, SInt32 grpnum, SInt32 ovlnum
SInt32 Overlays_GetFileInOverlay(Overlays *this, SInt32 grpnum, SInt32 ovlnum, SInt32 filnum) { SInt32 Overlays_GetFileInOverlay(Overlays *this, SInt32 grpnum, SInt32 ovlnum, SInt32 filnum) {
Overlay *oly; Overlay *oly;
#line 160 OS_ASSERT(160, this);
OPTION_ASSERT(this);
oly = Overlays_GetOverlayInGroup(this, grpnum, ovlnum); oly = Overlays_GetOverlayInGroup(this, grpnum, ovlnum);
if (oly) if (oly)
@ -146,8 +136,7 @@ SInt32 Overlays_GetFileInOverlay(Overlays *this, SInt32 grpnum, SInt32 ovlnum, S
OvlGroup *OvlGroup_New(const char *name, OvlAddr addr) { OvlGroup *OvlGroup_New(const char *name, OvlAddr addr) {
OvlGroup *grp; OvlGroup *grp;
#line 175 OS_ASSERT(175, name);
OPTION_ASSERT(name);
grp = xmalloc(NULL, sizeof(OvlGroup)); grp = xmalloc(NULL, sizeof(OvlGroup));
if (grp) { if (grp) {
@ -159,8 +148,7 @@ OvlGroup *OvlGroup_New(const char *name, OvlAddr addr) {
grp->olycnt = 0; grp->olycnt = 0;
grp->next = NULL; grp->next = NULL;
} else { } else {
#line 188 DO_INTERNAL_ERROR(188, "Could not allocate %s", "overlay group");
DO_INTERNAL_ERROR("Could not allocate %s", "overlay group");
} }
return grp; return grp;
} }
@ -169,8 +157,7 @@ void OvlGroup_Delete(OvlGroup *grp) {
Overlay *scan; Overlay *scan;
Overlay *next; Overlay *next;
#line 197 OS_ASSERT(197, grp);
OPTION_ASSERT(grp);
for (scan = grp->olys; scan; scan = next) { for (scan = grp->olys; scan; scan = next) {
next = scan->next; next = scan->next;
@ -182,9 +169,8 @@ void OvlGroup_Delete(OvlGroup *grp) {
} }
Boolean OvlGroup_AddOverlay(OvlGroup *this, Overlay *oly, SInt32 *olynum) { Boolean OvlGroup_AddOverlay(OvlGroup *this, Overlay *oly, SInt32 *olynum) {
#line 211 OS_ASSERT(211, this);
OPTION_ASSERT(this); OS_ASSERT(212, oly);
OPTION_ASSERT(oly);
if (!this->lastoly) if (!this->lastoly)
this->olys = oly; this->olys = oly;
@ -203,8 +189,7 @@ Overlay *OvlGroup_GetOverlay(OvlGroup *this, SInt32 olynum) {
Overlay *oly; Overlay *oly;
SInt32 cnt = 0; SInt32 cnt = 0;
#line 234 OS_ASSERT(234, this);
OPTION_ASSERT(this);
oly = this->olys; oly = this->olys;
while (oly && cnt < olynum) { while (oly && cnt < olynum) {
@ -222,8 +207,7 @@ SInt32 OvlGroup_CountOverlays(OvlGroup *this) {
Overlay *scan; Overlay *scan;
int num = 0; int num = 0;
#line 254 OS_ASSERT(254, this);
OPTION_ASSERT(this);
scan = this->olys; scan = this->olys;
while (scan) { while (scan) {
@ -246,15 +230,13 @@ Overlay *Overlay_New(const char *name) {
oly->cnt = 0; oly->cnt = 0;
oly->next = NULL; oly->next = NULL;
} else { } else {
#line 281 DO_INTERNAL_ERROR(281, "Could not allocate %s", "overlay");
DO_INTERNAL_ERROR("Could not allocate %s", "overlay");
} }
return oly; return oly;
} }
void Overlay_Delete(Overlay *oly) { void Overlay_Delete(Overlay *oly) {
#line 288 OS_ASSERT(288, oly);
OPTION_ASSERT(oly);
if (oly->list) if (oly->list)
xfree(oly->list); xfree(oly->list);
@ -262,8 +244,7 @@ void Overlay_Delete(Overlay *oly) {
} }
Boolean Overlay_AddFile(Overlay *oly, SInt32 filenum, SInt32 *filnum) { Boolean Overlay_AddFile(Overlay *oly, SInt32 filenum, SInt32 *filnum) {
#line 296 OS_ASSERT(296, oly);
OPTION_ASSERT(oly);
if (oly->cnt >= oly->max) { if (oly->cnt >= oly->max) {
oly->max += 16; oly->max += 16;
@ -279,8 +260,7 @@ Boolean Overlay_AddFile(Overlay *oly, SInt32 filenum, SInt32 *filnum) {
} }
SInt32 Overlay_GetFile(Overlay *oly, SInt32 filnum) { SInt32 Overlay_GetFile(Overlay *oly, SInt32 filnum) {
#line 314 OS_ASSERT(314, oly);
OPTION_ASSERT(oly);
if (filnum < oly->cnt) if (filnum < oly->cnt)
return oly->list[filnum]; return oly->list[filnum];
@ -289,8 +269,7 @@ SInt32 Overlay_GetFile(Overlay *oly, SInt32 filnum) {
} }
SInt32 Overlay_CountFiles(Overlay *oly) { SInt32 Overlay_CountFiles(Overlay *oly) {
#line 323 OS_ASSERT(323, oly);
OPTION_ASSERT(oly);
return oly->cnt; return oly->cnt;
} }

View File

@ -8,8 +8,7 @@ Boolean Proj_Initialize(Project *this) {
} }
Boolean Proj_Terminate(Project *this) { Boolean Proj_Terminate(Project *this) {
#line 25 OS_ASSERT(25, this != NULL);
OPTION_ASSERT(this != NULL);
Targets_Term(this->targets); Targets_Term(this->targets);
return 1; return 1;

View File

@ -18,21 +18,18 @@ Boolean Segments_Initialize(Segments *segs) {
Segment *main; Segment *main;
UInt16 idx; UInt16 idx;
#line 36 OS_ASSERT(36, segs != NULL);
OPTION_ASSERT(segs != NULL);
memset(segs, 0, sizeof(Segments)); memset(segs, 0, sizeof(Segments));
segs->segsArray = NULL; segs->segsArray = NULL;
jump = Segment_New("Jump Table", 0x28); jump = Segment_New("Jump Table", 0x28);
Segments_AddSegment(segs, jump, &idx); Segments_AddSegment(segs, jump, &idx);
#line 44 OS_ASSERT(44, idx==0);
OPTION_ASSERT(idx==0);
main = Segment_New("Main", 0xFFFF); main = Segment_New("Main", 0xFFFF);
Segments_AddSegment(segs, main, &idx); Segments_AddSegment(segs, main, &idx);
#line 49 OS_ASSERT(49, idx==1);
OPTION_ASSERT(idx==1);
return 1; return 1;
} }
@ -40,8 +37,7 @@ Boolean Segments_Initialize(Segments *segs) {
Boolean Segments_Terminate(Segments *segs) { Boolean Segments_Terminate(Segments *segs) {
UInt16 index; UInt16 index;
#line 57 OS_ASSERT(57, segs != NULL);
OPTION_ASSERT(segs != NULL);
if (segs->segsArray) { if (segs->segsArray) {
for (index = 0; index < segs->segsCount; index++) for (index = 0; index < segs->segsCount; index++)
@ -56,8 +52,7 @@ Boolean Segments_Terminate(Segments *segs) {
static Boolean Segments_GrowSegments(Segments *segs, UInt16 *index) { static Boolean Segments_GrowSegments(Segments *segs, UInt16 *index) {
Segment **newArray; Segment **newArray;
#line 78 OS_ASSERT(78, segs != NULL);
OPTION_ASSERT(segs != NULL);
if (segs->segsCount >= segs->arraySize) { if (segs->segsCount >= segs->arraySize) {
segs->arraySize += 20; segs->arraySize += 20;
@ -106,8 +101,7 @@ Boolean Segments_DeleteSegment(Segments *segs, UInt16 index) {
} }
Segment *Segments_GetSegment(Segments *segs, UInt16 segnum) { Segment *Segments_GetSegment(Segments *segs, UInt16 segnum) {
#line 137 OS_ASSERT(137, segs != NULL);
OPTION_ASSERT(segs != NULL);
if (segnum < segs->segsCount) if (segnum < segs->segsCount)
return segs->segsArray[segnum]; return segs->segsArray[segnum];
@ -116,8 +110,7 @@ Segment *Segments_GetSegment(Segments *segs, UInt16 segnum) {
} }
UInt16 Segments_Count(const Segments *segs) { UInt16 Segments_Count(const Segments *segs) {
#line 147 OS_ASSERT(147, segs != NULL);
OPTION_ASSERT(segs != NULL);
return segs->segsCount; return segs->segsCount;
} }

View File

@ -1364,7 +1364,7 @@ static Boolean CScope_FindQualifiedTag(CScopeParseResult *result, NameSpace *nsp
return 0; return 0;
} }
inline void CScope_NSIteratorInit(CScopeNSIterator *iterator, NameSpace *nspace, CScopeParseResult *result) { CW_INLINE void CScope_NSIteratorInit(CScopeNSIterator *iterator, NameSpace *nspace, CScopeParseResult *result) {
// assumed name // assumed name
if (nspace->usings) { if (nspace->usings) {
iterator->nspace = NULL; iterator->nspace = NULL;
@ -1376,7 +1376,7 @@ inline void CScope_NSIteratorInit(CScopeNSIterator *iterator, NameSpace *nspace,
iterator->result = result; iterator->result = result;
} }
inline Boolean CScope_NSIteratorNext(CScopeNSIterator *iterator) { CW_INLINE Boolean CScope_NSIteratorNext(CScopeNSIterator *iterator) {
// assumed name // assumed name
if (iterator->lookup) if (iterator->lookup)
return (iterator->lookup = iterator->lookup->next) != NULL; return (iterator->lookup = iterator->lookup->next) != NULL;

View File

@ -225,7 +225,7 @@ static Boolean CExpr_IsBetterClassConversion(TypeClass *a, TypeClass *b, TypeCla
return 0; return 0;
} }
inline Boolean Inline_501D40(Type *a, Type *b) { CW_INLINE Boolean Inline_501D40(Type *a, Type *b) {
return (a == TYPE(&stbool)) && (IS_TYPE_POINTER_ONLY(b) || IS_TYPE_MEMBERPOINTER(b)); return (a == TYPE(&stbool)) && (IS_TYPE_POINTER_ONLY(b) || IS_TYPE_MEMBERPOINTER(b));
} }
@ -430,7 +430,7 @@ typedef enum MysteryEnum {
ME_255 = 255 ME_255 = 255
} MysteryEnum; } MysteryEnum;
inline MysteryEnum Inline_501FF0(UInt32 qual1, UInt32 qual2) { CW_INLINE MysteryEnum Inline_501FF0(UInt32 qual1, UInt32 qual2) {
if ((qual1 & Q_CV) == (qual2 & Q_CV)) if ((qual1 & Q_CV) == (qual2 & Q_CV))
return ME_0; return ME_0;

View File

@ -386,7 +386,7 @@ static ENode *CInline_FoldConst(ENode *expr) {
} }
// unknown name // unknown name
inline SInt32 CInline_GetLocalID2(Object *object) { CW_INLINE SInt32 CInline_GetLocalID2(Object *object) {
ObjectList *list; ObjectList *list;
SInt32 counter; SInt32 counter;

View File

@ -204,7 +204,7 @@ static Type *CSOM_FindClassType(HashNameNode *name) {
return type; return type;
} }
static inline UInt16 CSOM_GetTokenTableIndex(const Object *object) { CW_INLINE UInt16 CSOM_GetTokenTableIndex(const Object *object) {
CError_ASSERT(173, IS_TYPE_METHOD(object->type)); CError_ASSERT(173, IS_TYPE_METHOD(object->type));
return TYPE_METHOD(object->type)->x1E; return TYPE_METHOD(object->type)->x1E;
} }

View File

@ -47,7 +47,7 @@ static void DiadicOperatorPPC(IAExpr *left, short token, IAExpr *right);
static void InlineAsm_ExpressionPPC(IAExpr *expr, SInt32 value); static void InlineAsm_ExpressionPPC(IAExpr *expr, SInt32 value);
static void savepicbase(short reg, HashNameNode *name); static void savepicbase(short reg, HashNameNode *name);
inline SInt32 ExtractValue(CInt64 value) { CW_INLINE SInt32 ExtractValue(CInt64 value) {
return (SInt32) CInt64_GetULong(&value); return (SInt32) CInt64_GetULong(&value);
} }

View File

@ -183,7 +183,7 @@ static void MarkArgs(IROLinear *linear) {
} }
// assumed name, position // assumed name, position
static inline void MarkSubExpr(IROLinear *linear) { CW_INLINE void MarkSubExpr(IROLinear *linear) {
int i; int i;
switch (linear->type) { switch (linear->type) {

File diff suppressed because it is too large Load Diff

View File

@ -796,7 +796,7 @@ IROLinear *IRO_TempReference(Object *obj, IROList *list) {
return ind; return ind;
} }
inline IROLinear *LocateFatherHelper(IROLinear *linear, Boolean a, IROLinear ***b) { CW_INLINE IROLinear *LocateFatherHelper(IROLinear *linear, Boolean a, IROLinear ***b) {
IROLinear *scan; IROLinear *scan;
SInt32 index; SInt32 index;
int i; int i;

View File

@ -119,7 +119,7 @@ enum {
CLStr112 = 112 CLStr112 = 112
}; };
#define DO_INTERNAL_ERROR(...) CLInternalError(__FILE__, __LINE__, __VA_ARGS__) #define DO_INTERNAL_ERROR(line, ...) CLInternalError(__FILE__, line, __VA_ARGS__)
#ifdef __MWERKS__ #ifdef __MWERKS__
#pragma options align=mac68k #pragma options align=mac68k

View File

@ -28,10 +28,14 @@
#define alloca(x) __alloca(x) #define alloca(x) __alloca(x)
#define CW_INLINE inline
#else #else
#include <stdarg.h> #include <stdarg.h>
// expand this to nothing // expand this to nothing
#define CW_PASCAL #define CW_PASCAL
#define CW_INLINE static inline
#endif #endif
// ---------- // ----------

View File

@ -23,7 +23,7 @@ extern void Bv_Set(BitVector *bv);
extern Boolean Bv_IsSubset(const BitVector *a, const BitVector *b); extern Boolean Bv_IsSubset(const BitVector *a, const BitVector *b);
extern Boolean Bv_IsEmpty(const BitVector *bv); extern Boolean Bv_IsEmpty(const BitVector *bv);
inline void Bv_SetBit(UInt32 bit, BitVector *bv) { CW_INLINE void Bv_SetBit(UInt32 bit, BitVector *bv) {
if ((bit / 32) < bv->size) { if ((bit / 32) < bv->size) {
bv->data[bit / 32] |= 1 << (bit & 31); bv->data[bit / 32] |= 1 << (bit & 31);
} else { } else {

View File

@ -10,33 +10,33 @@ extern const CInt64 cint64_one;
extern const CInt64 cint64_max; extern const CInt64 cint64_max;
extern const CInt64 cint64_min; extern const CInt64 cint64_min;
inline Boolean CInt64_IsNegative(const CInt64 *n) { CW_INLINE Boolean CInt64_IsNegative(const CInt64 *n) {
return (n->hi & 0x80000000) != 0; return (n->hi & 0x80000000) != 0;
} }
inline UInt32 CInt64_GetULong(const CInt64 *n) { // 42E660 in mwcppc.exe CW_INLINE UInt32 CInt64_GetULong(const CInt64 *n) { // 42E660 in mwcppc.exe
return n->lo; return n->lo;
} }
inline void CInt64_SetLong(CInt64 *pN, SInt32 n) { CW_INLINE void CInt64_SetLong(CInt64 *pN, SInt32 n) {
pN->lo = n; pN->lo = n;
pN->hi = (n < 0) ? 0xFFFFFFFF : 0; pN->hi = (n < 0) ? 0xFFFFFFFF : 0;
} }
inline void CInt64_SetULong(CInt64 *pN, UInt32 n) { CW_INLINE void CInt64_SetULong(CInt64 *pN, UInt32 n) {
pN->lo = n; pN->lo = n;
pN->hi = 0; pN->hi = 0;
} }
inline Boolean CInt64_IsZero(CInt64 *n) { CW_INLINE Boolean CInt64_IsZero(CInt64 *n) {
//if (n->hi == 0 && n->lo == 0) //if (n->hi == 0 && n->lo == 0)
// return 1; // return 1;
//else //else
// return 0; // return 0;
return n->hi == 0 && n->lo == 0; return n->hi == 0 && n->lo == 0;
} }
inline Boolean CInt64_IsOne(CInt64 *n) { // assumed name CW_INLINE Boolean CInt64_IsOne(CInt64 *n) { // assumed name
return n->hi == 0 && n->lo == 1; return n->hi == 0 && n->lo == 1;
} }
inline void CInt64_Extend32(CInt64 *n) { // assumed name CW_INLINE void CInt64_Extend32(CInt64 *n) { // assumed name
n->hi = (n->lo >> 31) ? 0xFFFFFFFF : 0; n->hi = (n->lo >> 31) ? 0xFFFFFFFF : 0;
} }

View File

@ -211,7 +211,7 @@ extern Object *InlineAsm_GetObjectOffset(InlineAsm *ia, SInt32 index, SInt32 *of
extern char *InlineAsm_DumpStatement(Statement *stmt); extern char *InlineAsm_DumpStatement(Statement *stmt);
// unknown name // unknown name
inline void InlineAsm_InitExpr5(IAExpr *expr, SInt32 value) { CW_INLINE void InlineAsm_InitExpr5(IAExpr *expr, SInt32 value) {
expr->type = IAExpr_5; expr->type = IAExpr_5;
expr->flags = 0; expr->flags = 0;
expr->value = value; expr->value = value;
@ -224,12 +224,12 @@ inline void InlineAsm_InitExpr5(IAExpr *expr, SInt32 value) {
} }
// unknown name // unknown name
inline int InlineAsm_CheckExpr(IAExpr *expr) { CW_INLINE int InlineAsm_CheckExpr(IAExpr *expr) {
return (expr->xC == NULL && expr->object == NULL && expr->label == NULL); return (expr->xC == NULL && expr->object == NULL && expr->label == NULL);
} }
// unknown name // unknown name
inline SInt32 InlineAsm_GetExprValue(IAExpr *expr) { CW_INLINE SInt32 InlineAsm_GetExprValue(IAExpr *expr) {
switch (expr->type) { switch (expr->type) {
case IAExpr_8: case IAExpr_8:
return HIGH_PART(expr->value); return HIGH_PART(expr->value);

View File

@ -62,20 +62,20 @@ extern void IRO_BuildFlowgraph(IROLinear *linear);
extern IRONode *IRO_NewFlowGraphNode(void); extern IRONode *IRO_NewFlowGraphNode(void);
extern IRONode *IRO_MergeFlowGraphNodes(IRONode *a, IRONode *b); extern IRONode *IRO_MergeFlowGraphNodes(IRONode *a, IRONode *b);
inline void IROFlowgraph_sub_4C2140(IRONodes *nodes) { CW_INLINE void IROFlowgraph_sub_4C2140(IRONodes *nodes) {
nodes->indices = oalloc(sizeof(UInt16) * IRO_NumNodes); nodes->indices = oalloc(sizeof(UInt16) * IRO_NumNodes);
nodes->num = 0; nodes->num = 0;
nodes->base = 0; nodes->base = 0;
} }
inline void IROFlowgraph_sub_4C20E0(IRONodes *nodes) { CW_INLINE void IROFlowgraph_sub_4C20E0(IRONodes *nodes) {
} }
inline UInt16 IROFlowgraph_sub_4C2040(IRONodes *nodes) { CW_INLINE UInt16 IROFlowgraph_sub_4C2040(IRONodes *nodes) {
return nodes->num; return nodes->num;
} }
inline UInt16 IROFlowgraph_sub_4C2100(IRONodes *nodes) { CW_INLINE UInt16 IROFlowgraph_sub_4C2100(IRONodes *nodes) {
UInt16 result = -1; UInt16 result = -1;
if (nodes->num) { if (nodes->num) {
result = nodes->indices[nodes->base]; result = nodes->indices[nodes->base];
@ -85,7 +85,7 @@ inline UInt16 IROFlowgraph_sub_4C2100(IRONodes *nodes) {
return result; return result;
} }
inline void IROFlowgraph_sub_4C3880(IRONodes *nodes, UInt16 index) { CW_INLINE void IROFlowgraph_sub_4C3880(IRONodes *nodes, UInt16 index) {
if (nodes->num < IRO_NumNodes) { if (nodes->num < IRO_NumNodes) {
nodes->indices[(nodes->base + nodes->num) % IRO_NumNodes] = index; nodes->indices[(nodes->base + nodes->num) % IRO_NumNodes] = index;
nodes->num++; nodes->num++;

View File

@ -106,19 +106,19 @@ extern void IRO_SetupForUserBreakChecking(void);
extern void IRO_CheckForUserBreak(void); extern void IRO_CheckForUserBreak(void);
// TODO is this elsewhere? // TODO is this elsewhere?
inline Boolean IRO_IsUnsignedType(Type *type) { CW_INLINE Boolean IRO_IsUnsignedType(Type *type) {
return is_unsigned(type); return is_unsigned(type);
} }
// 4B4D40 // 4B4D40
inline CInt64 IRO_MakeULong(UInt32 i) { CW_INLINE CInt64 IRO_MakeULong(UInt32 i) {
CInt64 val; CInt64 val;
CInt64_SetULong(&val, i); CInt64_SetULong(&val, i);
return val; return val;
} }
// 4BAAA0 // 4BAAA0
inline CInt64 IRO_MakeLong(SInt32 i) { CW_INLINE CInt64 IRO_MakeLong(SInt32 i) {
CInt64 val; CInt64 val;
CInt64_SetLong(&val, i); CInt64_SetLong(&val, i);
return val; return val;

View File

@ -235,7 +235,7 @@ enum {
// placing these here until further notice // placing these here until further notice
// unknown name, mwcppc.exe 7.0: 484870 // unknown name, mwcppc.exe 7.0: 484870
inline Boolean Inline_IsObjectData(Object *object) { CW_INLINE Boolean Inline_IsObjectData(Object *object) {
return object->datatype == DDATA; return object->datatype == DDATA;
} }

View File

@ -10,6 +10,7 @@
*/ */
#define OPTION_ASSERT(cond) do { if (!!(cond) == 0) { printf("%s:%u: failed assertion\n", __FILE__, __LINE__); abort(); } } while(0) #define OPTION_ASSERT(cond) do { if (!!(cond) == 0) { printf("%s:%u: failed assertion\n", __FILE__, __LINE__); abort(); } } while(0)
#define OS_ASSERT(line, cond) do { if (!!(cond) == 0) { printf("%s:%u: failed assertion\n", __FILE__, line); abort(); } } while(0)
typedef struct uOSTypePair { typedef struct uOSTypePair {
int perm; int perm;

File diff suppressed because one or more lines are too long

View File

@ -557,8 +557,7 @@ void Arg_AddToToolArgs(anon0_50 *ta, short tokval, char *toktxt) {
Arg_GrowArg(ta, ","); Arg_GrowArg(ta, ",");
break; break;
default: default:
#line 787 CLPFatalError(__FILE__, 787, "Unknown token (%d)", tokval);
CLPFatalError(__FILE__, __LINE__, "Unknown token (%d)", tokval);
break; break;
} }
} }

View File

@ -81,8 +81,7 @@ int Args_StackSize(void) {
} }
void Args_Push(short flags, void *first, void *second) { void Args_Push(short flags, void *first, void *second) {
#line 104 OS_ASSERT(104, oStackPtr<MAXSTACK);
OPTION_ASSERT(oStackPtr<MAXSTACK);
if (oStackPtr > 0) if (oStackPtr > 0)
{ {
short prev = short prev =
@ -943,8 +942,7 @@ static int Options_DoParse(OptionList *search, int flags) {
tok = Arg_GetToken(); tok = Arg_GetToken();
if (!tok) if (!tok)
tok = Arg_UndoToken(); tok = Arg_UndoToken();
#line 1335 OS_ASSERT(1335, tok);
OPTION_ASSERT(tok);
} }
if (!parsedany || haderrors) if (!parsedany || haderrors)

View File

@ -1012,8 +1012,7 @@ static int Param_GetArgument(PARAM_T *param, const char **cparam, int exec) {
lastOpt = !subparse ? ATK_END : ATK_ARG_END; lastOpt = !subparse ? ATK_END : ATK_ARG_END;
tok = Arg_PeekToken(); tok = Arg_PeekToken();
#line 1467 OS_ASSERT(1467, tok);
OPTION_ASSERT(tok);
if ((param->flags & PARAMFLAGS_3) == 0) { if ((param->flags & PARAMFLAGS_3) == 0) {
if (tok->val == nextParam || tok->val == ATK_EQUALS) if (tok->val == nextParam || tok->val == ATK_EQUALS)

View File

@ -140,16 +140,14 @@ int SetupPragmas(const Pragma *pragmas) {
else if (*((char *)pragmas->value) == PR_RESET) else if (*((char *)pragmas->value) == PR_RESET)
set = "reset"; set = "reset";
else else
#line 186 OS_ASSERT(186, *((char *)pragmas->value) == PR_UNSET);
OPTION_ASSERT(*((char *)pragmas->value) == PR_UNSET);
if (set) { if (set) {
snprintf(tmp, sizeof(tmp), "#pragma %s %s\n", pragmas->pragma, set); snprintf(tmp, sizeof(tmp), "#pragma %s %s\n", pragmas->pragma, set);
AddStringToHandle(&definesHandle, tmp); AddStringToHandle(&definesHandle, tmp);
} }
} else { } else {
#line 195 OS_ASSERT(195, !"Can't handle pragma");
OPTION_ASSERT(!"Can't handle pragma");
} }
pragmas++; pragmas++;
} }

View File

@ -5,8 +5,7 @@ ParserTool *pTool;
int SetParserToolInfo(ParserTool *tool) { int SetParserToolInfo(ParserTool *tool) {
pTool = tool; pTool = tool;
#line 16 OS_ASSERT(16, pTool->toolInfo && (parseopts.toolVersion || pTool->copyright));
OPTION_ASSERT(pTool->toolInfo && (parseopts.toolVersion || pTool->copyright));
return 1; return 1;
} }