summaryrefslogtreecommitdiff
path: root/command_line/CmdLine
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--command_line/CmdLine/Src/CLBrowser.c10
-rw-r--r--command_line/CmdLine/Src/CLDependencies.c6
-rw-r--r--command_line/CmdLine/Src/CLFileOps.c24
-rw-r--r--command_line/CmdLine/Src/CLPluginRequests.cpp3
-rw-r--r--command_line/CmdLine/Src/CLPrefs.c3
-rw-r--r--command_line/CmdLine/Src/CLTarg.c9
-rw-r--r--command_line/CmdLine/Src/CLToolExec.c6
-rw-r--r--command_line/CmdLine/Src/CLWriteObjectFile.c3
-rw-r--r--command_line/CmdLine/Src/Callbacks/CLCompilerLinkerDropin_V10.cpp33
-rw-r--r--command_line/CmdLine/Src/Callbacks/CLDropinCallbacks_V10.cpp27
-rw-r--r--command_line/CmdLine/Src/Envir/CLIO.c16
-rw-r--r--command_line/CmdLine/Src/MacEmul/Files.c3
-rw-r--r--command_line/CmdLine/Src/MacEmul/Resources.c13
-rw-r--r--command_line/CmdLine/Src/OSLib/Generic.c2
-rw-r--r--command_line/CmdLine/Src/OSLib/MacFileTypes.c3
-rw-r--r--command_line/CmdLine/Src/OSLib/MacSpecs.c6
-rw-r--r--command_line/CmdLine/Src/OSLib/StringUtils.c3
-rw-r--r--command_line/CmdLine/Src/Plugins/CLPlugins.c54
-rw-r--r--command_line/CmdLine/Src/Project/CLAccessPaths.c49
-rw-r--r--command_line/CmdLine/Src/Project/CLFiles.c19
-rw-r--r--command_line/CmdLine/Src/Project/CLOverlays.c67
-rw-r--r--command_line/CmdLine/Src/Project/CLProj.c3
-rw-r--r--command_line/CmdLine/Src/Project/CLSegs.c21
23 files changed, 135 insertions, 248 deletions
diff --git a/command_line/CmdLine/Src/CLBrowser.c b/command_line/CmdLine/Src/CLBrowser.c
index 826d395..2679e52 100644
--- a/command_line/CmdLine/Src/CLBrowser.c
+++ b/command_line/CmdLine/Src/CLBrowser.c
@@ -75,9 +75,8 @@ int Browser_SearchFile(OSHandle *browsetable, const char *fullpath, SInt16 *ID)
SInt32 size;
Boolean found = 0;
-#line 114
- OPTION_ASSERT(OS_IsFullPath(fullpath));
- OPTION_ASSERT(browsetable!=NULL);
+ OS_ASSERT(114, OS_IsFullPath(fullpath));
+ OS_ASSERT(115, browsetable!=NULL);
GetBrowseTableInfoAndLock(browsetable, &scan, &cnt, &size);
for (idx = 0; idx < cnt; idx++) {
@@ -167,9 +166,8 @@ int Browser_PackBrowseFile(Handle browsedata, OSHandle *browsetable, OSHandle *b
int err;
void *bptr;
-#line 253
- OPTION_ASSERT(browsedata!=NULL);
- OPTION_ASSERT(browsetable!=NULL);
+ OS_ASSERT(253, browsedata!=NULL);
+ OS_ASSERT(254, browsetable!=NULL);
datasize = GetHandleSize(browsedata);
tableoffs = (datasize + sizeof(header) + 7) & ~7;
diff --git a/command_line/CmdLine/Src/CLDependencies.c b/command_line/CmdLine/Src/CLDependencies.c
index 6590257..724141a 100644
--- a/command_line/CmdLine/Src/CLDependencies.c
+++ b/command_line/CmdLine/Src/CLDependencies.c
@@ -99,8 +99,7 @@ static Boolean FindFileInPaths(Paths *paths, const char *filename, Path **thepat
for (idx = 0; idx < Paths_Count(paths); idx++) {
path = Paths_GetPath(paths, idx);
-#line 175
- OPTION_ASSERT(path);
+ OS_ASSERT(175, path);
if (_FindFileInPath(path, filename, thepath, spec))
return 1;
}
@@ -263,8 +262,7 @@ int Deps_ChangeSpecialAccessPath(OSSpec *srcfss, Boolean initialize) {
}
break;
default:
-#line 468
- DO_INTERNAL_ERROR("Unhandled include file search type (%d)\n", optsCompiler.includeSearch);
+ DO_INTERNAL_ERROR(468, "Unhandled include file search type (%d)\n", optsCompiler.includeSearch);
}
specialAccessPath = FindOrAddGlobalInclPath(gTarg->incls.allPaths, pathspecptr);
diff --git a/command_line/CmdLine/Src/CLFileOps.c b/command_line/CmdLine/Src/CLFileOps.c
index be3c00c..a5976be 100644
--- a/command_line/CmdLine/Src/CLFileOps.c
+++ b/command_line/CmdLine/Src/CLFileOps.c
@@ -415,8 +415,7 @@ static int CompileEntry(File *file, Boolean *compiled) {
return 1;
}
-#line 835
- OPTION_ASSERT(file->compiler);
+ OS_ASSERT(835, file->compiler);
*compiled = 1;
beginWork = OS_GetMilliseconds();
@@ -471,8 +470,7 @@ static void DumpFileAndPathInfo(void) {
} else {
for (i = 0; i < n; i++) {
Path *path = Paths_GetPath(&FrameworkPaths, i);
-#line 961
- OPTION_ASSERT(path != NULL);
+ OS_ASSERT(961, path != NULL);
CLReport(85,
OS_PathSpecToString(path->spec, STSbuf, sizeof(STSbuf)),
@@ -483,8 +481,7 @@ static void DumpFileAndPathInfo(void) {
UInt16 j;
for (j = 0; j < Paths_Count(path->recursive); j++) {
Path *sub = Paths_GetPath(path->recursive, j);
-#line 976
- OPTION_ASSERT(sub);
+ OS_ASSERT(976, sub);
CLReport(85, "\t", OS_PathSpecToString(sub->spec, STSbuf, sizeof(STSbuf)));
}
}
@@ -497,8 +494,7 @@ static void DumpFileAndPathInfo(void) {
for (i = 0; i < n; i++) {
char version[80];
Paths_FWInfo *info = Frameworks_GetInfo(i);
-#line 993
- OPTION_ASSERT(info);
+ OS_ASSERT(993, info);
version[0] = 0;
strcpy(version, "\t(");
@@ -522,8 +518,7 @@ static void DumpFileAndPathInfo(void) {
} else {
for (i = 0; i < Paths_Count(&gTarg->userPaths); i++) {
Path *path = Paths_GetPath(&gTarg->userPaths, i);
-#line 1024
- OPTION_ASSERT(path != NULL);
+ OS_ASSERT(1024, path != NULL);
CLReport(85,
OS_PathSpecToString(path->spec, STSbuf, sizeof(STSbuf)),
@@ -534,8 +529,7 @@ static void DumpFileAndPathInfo(void) {
UInt16 j;
for (j = 0; j < Paths_Count(path->recursive); j++) {
Path *sub = Paths_GetPath(path->recursive, j);
-#line 1039
- OPTION_ASSERT(sub);
+ OS_ASSERT(1039, sub);
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++) {
Path *path = Paths_GetPath(&gTarg->sysPaths, i);
-#line 1054
- OPTION_ASSERT(path != NULL);
+ OS_ASSERT(1054, path != NULL);
CLReport(85,
OS_PathSpecToString(path->spec, STSbuf, sizeof(STSbuf)),
@@ -562,8 +555,7 @@ static void DumpFileAndPathInfo(void) {
UInt16 j;
for (j = 0; j < Paths_Count(path->recursive); j++) {
Path *sub = Paths_GetPath(path->recursive, j);
-#line 1069
- OPTION_ASSERT(sub);
+ OS_ASSERT(1069, sub);
CLReport(85, "\t", OS_PathSpecToString(sub->spec, STSbuf, sizeof(STSbuf)));
}
}
diff --git a/command_line/CmdLine/Src/CLPluginRequests.cpp b/command_line/CmdLine/Src/CLPluginRequests.cpp
index 9de50ba..dc11d18 100644
--- a/command_line/CmdLine/Src/CLPluginRequests.cpp
+++ b/command_line/CmdLine/Src/CLPluginRequests.cpp
@@ -218,8 +218,7 @@ Boolean SendTargetInfoRequest(Target *targ, Plugin *linker, SInt32 dropinflags)
if (linker && !(dropinflags & dropInExecutableTool)) {
if (optsCmdLine.verbose > 1)
CLReport(CLStr50, Plugin_GetDropInName(linker));
-#line 298
- OPTION_ASSERT(Plugin_GetPluginType(linker) == CWDROPINLINKERTYPE);
+ OS_ASSERT(298, Plugin_GetPluginType(linker) == CWDROPINLINKERTYPE);
if (!Plugin_VerifyPanels(linker))
return 0;
diff --git a/command_line/CmdLine/Src/CLPrefs.c b/command_line/CmdLine/Src/CLPrefs.c
index dba6dd8..b825c4a 100644
--- a/command_line/CmdLine/Src/CLPrefs.c
+++ b/command_line/CmdLine/Src/CLPrefs.c
@@ -42,8 +42,7 @@ Handle PrefPanel_GetHandle(PrefPanel *panel) {
else
SetHandleSize(panel->workHandle, len);
-#line 60
- OPTION_ASSERT(MemError()==noErr);
+ OS_ASSERT(60, MemError()==noErr);
HLock(panel->data);
HLock(panel->workHandle);
diff --git a/command_line/CmdLine/Src/CLTarg.c b/command_line/CmdLine/Src/CLTarg.c
index a3f4389..6a1782a 100644
--- a/command_line/CmdLine/Src/CLTarg.c
+++ b/command_line/CmdLine/Src/CLTarg.c
@@ -13,12 +13,9 @@ Target *Target_New(const char *name, OSType cpu, OSType os, OSType lang) {
OS_GetCWD(&targ->outputDirectory);
-#line 25
- OPTION_ASSERT(Segments_Initialize(&targ->linkage.segs));
-#line 28
- OPTION_ASSERT(Overlays_Initialize(&targ->linkage.overlays));
-#line 35
- OPTION_ASSERT(Files_Initialize(&targ->files) && Files_Initialize(&targ->pchs) && VFiles_Initialize(&targ->virtualFiles) &&
+ OS_ASSERT(25, Segments_Initialize(&targ->linkage.segs));
+ OS_ASSERT(28, Overlays_Initialize(&targ->linkage.overlays));
+ OS_ASSERT(35, 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));
return targ;
diff --git a/command_line/CmdLine/Src/CLToolExec.c b/command_line/CmdLine/Src/CLToolExec.c
index 9bc4213..cbd1a91 100644
--- a/command_line/CmdLine/Src/CLToolExec.c
+++ b/command_line/CmdLine/Src/CLToolExec.c
@@ -46,8 +46,7 @@ static int SetupLinkerCommandLine(SInt32 dropinflags, File *file, CWCommandLineA
break;
}
-#line 89
- OPTION_ASSERT(x < numPlugins);
+ OS_ASSERT(89, x < numPlugins);
args->argc = 1;
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;
// TODO rename this flag to isExecutableTool
-#line 269
- OPTION_ASSERT(dropinflags & dropInExecutableTool);
+ OS_ASSERT(269, dropinflags & dropInExecutableTool);
args.argc = 0;
args.argv = args.envp = NULL;
diff --git a/command_line/CmdLine/Src/CLWriteObjectFile.c b/command_line/CmdLine/Src/CLWriteObjectFile.c
index 6e92114..22028dc 100644
--- a/command_line/CmdLine/Src/CLWriteObjectFile.c
+++ b/command_line/CmdLine/Src/CLWriteObjectFile.c
@@ -6,8 +6,7 @@ int WriteObjectFile(File *file, OSType maccreator, OSType mactype) {
FSSpec srcfss;
FSSpec outfss;
-#line 22
- OPTION_ASSERT(file->objectdata && file->compiler);
+ OS_ASSERT(22, file->objectdata && file->compiler);
OS_OSSpec_To_FSSpec(&file->outfss, &outfss);
OS_OSSpec_To_FSSpec(&file->srcfss, &srcfss);
diff --git a/command_line/CmdLine/Src/Callbacks/CLCompilerLinkerDropin_V10.cpp b/command_line/CmdLine/Src/Callbacks/CLCompilerLinkerDropin_V10.cpp
index 070bc07..3804b93 100644
--- a/command_line/CmdLine/Src/Callbacks/CLCompilerLinkerDropin_V10.cpp
+++ b/command_line/CmdLine/Src/Callbacks/CLCompilerLinkerDropin_V10.cpp
@@ -52,10 +52,8 @@ CWResult UCBStoreObjectData(CWPluginContext context, SInt32 whichfile, CWObjectD
UCBSecretAttachHandle(context, objecthand, &object->objectdata);
UCBSecretAttachHandle(context, browsehand, &object->browsedata);
} else {
- if (filedata->outfileowner && filedata->outfileowner != CmdLineStageMask_Cg) {
-#line 240
- DO_INTERNAL_ERROR("Cannot store object file spec for '%s'\n", filedata->srcfilename);
- }
+ if (filedata->outfileowner && filedata->outfileowner != CmdLineStageMask_Cg)
+ DO_INTERNAL_ERROR(240, "Cannot store object file spec for '%s'\n", filedata->srcfilename);
OS_FSSpec_To_OSSpec(object->objectfile, &filedata->outfss);
filedata->wroteToDisk |= CmdLineStageMask_Cg;
}
@@ -134,8 +132,7 @@ CWResult UCBBeginSubCompile(CWPluginContext context, SInt32 whichfile, CWPluginC
if (optsCmdLine.verbose > 3)
CLPrint("Callback: %s\n", "UCBBeginSubCompile");
-#line 372
- DO_INTERNAL_ERROR("UCBBeginSubCompile not implemented");
+ DO_INTERNAL_ERROR(372, "UCBBeginSubCompile not implemented");
return cwErrRequestFailed;
}
@@ -143,8 +140,7 @@ CWResult UCBEndSubCompile(CWPluginContext subContext) {
if (optsCmdLine.verbose > 3)
CLPrint("Callback: %s\n", "UCBEndSubCompile");
-#line 384
- DO_INTERNAL_ERROR("UCBEndSubCompile not implemented");
+ DO_INTERNAL_ERROR(384, "UCBEndSubCompile not implemented");
return cwErrRequestFailed;
}
@@ -165,8 +161,7 @@ CWResult UCBGetPrecompiledHeaderSpec(CWPluginContext context, CWFileSpec *pchspe
return cwErrInvalidCallback;
file = Files_GetFile(&gTarg->files, c->whichfile);
-#line 420
- OPTION_ASSERT(file != NULL);
+ OS_ASSERT(420, file != NULL);
cof = Plugin_CL_GetObjectFlags(file->compiler);
if (!file->outfilename[0]) {
@@ -222,8 +217,7 @@ CWResult UCBGetResourceFile(CWPluginContext context, CWFileSpec *filespec) {
if (optsCmdLine.verbose > 3)
CLPrint("Callback: %s\n", "UCBGetResourceFile");
-#line 514
- DO_INTERNAL_ERROR("UCBGetResourceFile not implemented");
+ DO_INTERNAL_ERROR(514, "UCBGetResourceFile not implemented");
return cwErrRequestFailed;
}
@@ -231,8 +225,7 @@ CWResult UCBPutResourceFile(CWPluginContext context, const char *prompt, const c
if (optsCmdLine.verbose > 3)
CLPrint("Callback: %s\n", "UCBPutResourceFile");
-#line 529
- DO_INTERNAL_ERROR("UCBPutResourceFile not implemented");
+ DO_INTERNAL_ERROR(529, "UCBPutResourceFile not implemented");
return cwErrRequestFailed;
}
@@ -270,8 +263,7 @@ CWResult UCBLookUpUnit(CWPluginContext context, const char *name, Boolean isdepe
return cwErrInvalidCallback;
srcfile = Files_GetFile(&gTarg->files, c->whichfile);
-#line 591
- OPTION_ASSERT(srcfile != NULL);
+ OS_ASSERT(591, srcfile != NULL);
*unitdata = NULL;
*unitdatalength = 0;
@@ -403,8 +395,7 @@ CWResult UCBStoreUnit(CWPluginContext context, const char *inunitname, CWMemHand
return cwErrInvalidCallback;
srcfile = Files_GetFile(&gTarg->files, c->whichfile);
-#line 791
- OPTION_ASSERT(srcfile != NULL);
+ OS_ASSERT(791, srcfile != NULL);
if (optsCompiler.sbmPath[0]) {
err = OS_MakeSpecWithPath(&clState.sbmPathSpec, unitname, 1, &sbmspec);
@@ -510,8 +501,7 @@ CWResult UCBGetModifiedFiles(CWPluginContext context, SInt32 *modifiedFileCount,
CLPrint("Callback: %s\n", "UCBGetModifiedFiles");
*modifiedFileCount = 0;
-#line 949
- DO_INTERNAL_ERROR("CWGetModifiedFiles not implemented!\n");
+ DO_INTERNAL_ERROR(949, "CWGetModifiedFiles not implemented!\n");
return cwNoErr;
}
@@ -538,8 +528,7 @@ CWResult UCBGetStoredObjectFileSpec(CWPluginContext context, SInt32 whichfile, C
if (!(file = Files_GetFile(&gTarg->files, whichfile)))
return cwErrUnknownFile;
if (file->outfileowner != CmdLineStageMask_Cg) {
-#line 993
- DO_INTERNAL_ERROR("Lost stored object file spec for '%s'\n", file->srcfilename);
+ DO_INTERNAL_ERROR(993, "Lost stored object file spec for '%s'\n", file->srcfilename);
return cwErrRequestFailed;
} else {
OS_OSSpec_To_FSSpec(&file->outfss, fileSpec);
diff --git a/command_line/CmdLine/Src/Callbacks/CLDropinCallbacks_V10.cpp b/command_line/CmdLine/Src/Callbacks/CLDropinCallbacks_V10.cpp
index ed02965..24eaf83 100644
--- a/command_line/CmdLine/Src/Callbacks/CLDropinCallbacks_V10.cpp
+++ b/command_line/CmdLine/Src/Callbacks/CLDropinCallbacks_V10.cpp
@@ -203,8 +203,7 @@ static Boolean FindAndLoad_MissingFile(CWPluginContext context, const char *file
return 0;
file = Files_GetFile(&gTarg->files, c->whichfile);
-#line 486
- OPTION_ASSERT(file != NULL);
+ OS_ASSERT(486, file != NULL);
OS_MakeSpecWithPath(&file->srcfss.path, filename, 1, spec);
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)
CLPrint("Callback: %s\n", "UCBStorePluginData");
-#line 1267
- DO_INTERNAL_ERROR("UCBStorePluginData not implemented");
+ DO_INTERNAL_ERROR(1267, "UCBStorePluginData not implemented");
return cwErrRequestFailed;
}
@@ -647,8 +645,7 @@ CWResult UCBGetPluginData(CWPluginContext context, SInt32 whichfile, CWDataType
if (optsCmdLine.verbose > 3)
CLPrint("Callback: %s\n", "UCBGetPluginData");
-#line 1286
- DO_INTERNAL_ERROR("UCBGetPluginData not implemented");
+ DO_INTERNAL_ERROR(1286, "UCBGetPluginData not implemented");
return cwErrRequestFailed;
}
@@ -951,8 +948,7 @@ CWResult UCBCreateNewTextDocument(CWPluginContext context, const CWNewTextDocume
return cwErrRequestFailed;
}
} else {
-#line 1755
- DO_INTERNAL_ERROR("Cannot deal with unexpected document");
+ DO_INTERNAL_ERROR(1755, "Cannot deal with unexpected document");
return cwErrInvalidCallback;
}
}
@@ -1062,8 +1058,7 @@ CWResult UCBPreFileAction(CWPluginContext context, const CWFileSpec *theFile) {
if (optsCmdLine.verbose > 3)
CLPrint("Callback: %s\n", "UCBPreFileAction");
-#line 1963
- DO_INTERNAL_ERROR("UCBPreFileAction not implemented");
+ DO_INTERNAL_ERROR(1963, "UCBPreFileAction not implemented");
return cwErrRequestFailed;
}
@@ -1071,8 +1066,7 @@ CWResult UCBPostFileAction(CWPluginContext context, const CWFileSpec *theFile) {
if (optsCmdLine.verbose > 3)
CLPrint("Callback: %s\n", "UCBPostFileAction");
-#line 1977
- DO_INTERNAL_ERROR("UCBPostFileAction not implemented");
+ DO_INTERNAL_ERROR(1977, "UCBPostFileAction not implemented");
return cwErrRequestFailed;
}
@@ -1100,8 +1094,7 @@ CWResult UCBCacheAccessPathList(CWPluginContext context) {
for (x = 0; x < apl->userPathCount; x++) {
ap = &apl->userPaths[x];
path = Paths_GetPath(&gTarg->userPaths, x);
-#line 2010
- OPTION_ASSERT(path);
+ OS_ASSERT(2010, path);
OS_MakeSpecWithPath(path->spec, NULL, 0, &spec);
OS_OSSpec_To_FSSpec(&spec, &ap->pathSpec);
@@ -1132,8 +1125,7 @@ CWResult UCBCacheAccessPathList(CWPluginContext context) {
for (x = 0; x < apl->systemPathCount; x++) {
ap = &apl->systemPaths[x];
path = Paths_GetPath(&gTarg->sysPaths, x);
-#line 2044
- OPTION_ASSERT(path);
+ OS_ASSERT(2044, path);
OS_MakeSpecWithPath(path->spec, NULL, 0, &spec);
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) {
-#line 2255
- DO_INTERNAL_ERROR("UCBResolveRelativePath not implemented");
+ DO_INTERNAL_ERROR(2255, "UCBResolveRelativePath not implemented");
return cwErrRequestFailed;
}
diff --git a/command_line/CmdLine/Src/Envir/CLIO.c b/command_line/CmdLine/Src/Envir/CLIO.c
index 0c07eaf..1d6eaad 100644
--- a/command_line/CmdLine/Src/Envir/CLIO.c
+++ b/command_line/CmdLine/Src/Envir/CLIO.c
@@ -258,7 +258,7 @@ typedef struct {
} UnkCLIOStruct;
// 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);
if (f->pos + len >= f->maxlen) {
@@ -278,7 +278,7 @@ inline void appendText(UnkCLIOStruct *f, const char *str) {
f->pos += len;
f->col += len;
}
-inline void appendChar(UnkCLIOStruct *f, char c) {
+CW_INLINE void appendChar(UnkCLIOStruct *f, char c) {
if (f->pos >= f->maxlen) {
f->maxlen *= 2;
if (f->original) {
@@ -301,7 +301,7 @@ static void StartLine(UnkCLIOStruct *f) {
appendText(f, f->newline);
}
-inline void newLine(UnkCLIOStruct *f) {
+CW_INLINE void newLine(UnkCLIOStruct *f) {
if (f->newline)
appendChar(f, '\n');
else
@@ -424,14 +424,12 @@ void CLPrintDispatch(int unk, SInt16 msgtype, const char *message) {
const char *ptr;
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;
- } else if (msgtype == Msg_Warning || msgtype == Msg_Error || msgtype == Msg_Alert) {
+ else if (msgtype == Msg_Warning || msgtype == Msg_Error || msgtype == Msg_Alert)
out = stderr;
- } else {
-#line 847
- OPTION_ASSERT(0);
- }
+ else
+ OS_ASSERT(847, 0);
if (!printedAnything && !ioPiping) {
printedAnything = 1;
diff --git a/command_line/CmdLine/Src/MacEmul/Files.c b/command_line/CmdLine/Src/MacEmul/Files.c
index a613b4a..02760e7 100644
--- a/command_line/CmdLine/Src/MacEmul/Files.c
+++ b/command_line/CmdLine/Src/MacEmul/Files.c
@@ -672,8 +672,7 @@ OSErr FSMakeFSSpec(SInt16 vRefNum, SInt32 dirID, ConstStr255Param pathName, FSSp
}
OS_PathSpecToString(&spec.path, path, 256);
} else {
-#line 840
- OPTION_ASSERT(vRefNum!=0);
+ OS_ASSERT(840, vRefNum!=0);
tmpfss.vRefNum = vRefNum;
tmpfss.parID = dirID ? dirID : 2;
tmpfss.name[0] = 0;
diff --git a/command_line/CmdLine/Src/MacEmul/Resources.c b/command_line/CmdLine/Src/MacEmul/Resources.c
index 821df0b..1563898 100644
--- a/command_line/CmdLine/Src/MacEmul/Resources.c
+++ b/command_line/CmdLine/Src/MacEmul/Resources.c
@@ -568,8 +568,7 @@ static void WriteResourceFork(SInt16 ref) {
mrle = mtyp->ref_list;
while (mrle) {
-#line 943
- OPTION_ASSERT(reflist_offs < dmap.namelist_offs);
+ OS_ASSERT(943, reflist_offs < dmap.namelist_offs);
drle.id = mrle->id;
drle.name_offs = (mrle->name) ? name_offs : -1;
@@ -583,18 +582,16 @@ static void WriteResourceFork(SInt16 ref) {
reflist_offs += sizeof(trle);
if (mrle->name) {
-#line 962
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);
name_offs += mrle->name[0] + 1;
}
-#line 970
- OPTION_ASSERT(data_offs < dhdr.data_len);
- OPTION_ASSERT(mrle->hand!=NULL);
+ OS_ASSERT(970, data_offs < dhdr.data_len);
+ OS_ASSERT(971, mrle->hand!=NULL);
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);
dent.len = GetHandleSize(mrle->hand);
diff --git a/command_line/CmdLine/Src/OSLib/Generic.c b/command_line/CmdLine/Src/OSLib/Generic.c
index f2c2ac9..84de7fd 100644
--- a/command_line/CmdLine/Src/OSLib/Generic.c
+++ b/command_line/CmdLine/Src/OSLib/Generic.c
@@ -7,7 +7,7 @@ static OSOpenedDir wilddirref;
static OSSpec wildmatch;
char STSbuf[256];
-inline char dummyfunc(int ch) {
+CW_INLINE char dummyfunc(int ch) {
return ch;
}
diff --git a/command_line/CmdLine/Src/OSLib/MacFileTypes.c b/command_line/CmdLine/Src/OSLib/MacFileTypes.c
index 5ebb4d6..d8e63a8 100644
--- a/command_line/CmdLine/Src/OSLib/MacFileTypes.c
+++ b/command_line/CmdLine/Src/OSLib/MacFileTypes.c
@@ -15,8 +15,7 @@ void OS_AddFileTypeMappingList(OSFileTypeMappings **list, const OSFileTypeMappin
scan = &(*scan)->next;
*scan = malloc(sizeof(OSFileTypeMappings));
-#line 40
- OPTION_ASSERT(*scan != NULL);
+ OS_ASSERT(40, *scan != NULL);
(*scan)->mappingList = entry;
(*scan)->next = 0;
}
diff --git a/command_line/CmdLine/Src/OSLib/MacSpecs.c b/command_line/CmdLine/Src/OSLib/MacSpecs.c
index ece3d96..6d11620 100644
--- a/command_line/CmdLine/Src/OSLib/MacSpecs.c
+++ b/command_line/CmdLine/Src/OSLib/MacSpecs.c
@@ -94,8 +94,7 @@ static DirNode *FindDirMapEntry(unsigned int dirID) {
row = dirID >> 8;
col = dirID & 0xFF;
-#line 166
- OPTION_ASSERT(dirID != 2);
+ OS_ASSERT(166, dirID != 2);
if (row >= dirMapRows)
return 0;
@@ -167,8 +166,7 @@ static int FindOrAdd(const OSPathSpec *path, unsigned int *vRefNum, unsigned int
*vRefNum = vol->vRefNum;
level = &vol->root;
ptr = &pb[1];
-#line 267
- OPTION_ASSERT(*pb == OS_PATHSEP);
+ OS_ASSERT(267, *pb == OS_PATHSEP);
while (*ptr) {
st = ptr;
diff --git a/command_line/CmdLine/Src/OSLib/StringUtils.c b/command_line/CmdLine/Src/OSLib/StringUtils.c
index 9d5d110..b2a71e7 100644
--- a/command_line/CmdLine/Src/OSLib/StringUtils.c
+++ b/command_line/CmdLine/Src/OSLib/StringUtils.c
@@ -91,8 +91,7 @@ char *mvprintf(char *mybuf, unsigned int len, const char *format, va_list va) {
int ret;
char *buf;
-#line 134
- OPTION_ASSERT(mybuf != NULL);
+ OS_ASSERT(134, mybuf != NULL);
maxlen = len - 1;
buf = mybuf;
diff --git a/command_line/CmdLine/Src/Plugins/CLPlugins.c b/command_line/CmdLine/Src/Plugins/CLPlugins.c
index 38af6fe..8db8398 100644
--- a/command_line/CmdLine/Src/Plugins/CLPlugins.c
+++ b/command_line/CmdLine/Src/Plugins/CLPlugins.c
@@ -15,8 +15,7 @@ const ToolVersionInfo *Plugin_GetToolVersionInfo(void) {
static const char *Plugin_GetDisplayName(Plugin *pl) {
const char *name;
-#line 251
- OPTION_ASSERT(pl);
+ OS_ASSERT(251, pl);
if (pl->cb->GetDisplayName && pl->cb->GetDisplayName(&name) == 0)
return name;
@@ -26,8 +25,7 @@ static const char *Plugin_GetDisplayName(Plugin *pl) {
const char *Plugin_GetDropInName(Plugin *pl) {
const char *name;
-#line 263
- OPTION_ASSERT(pl);
+ OS_ASSERT(263, pl);
if (pl->cb->GetDropInName && pl->cb->GetDropInName(&name) == 0)
return name;
@@ -38,8 +36,7 @@ const char *Plugin_GetDropInName(Plugin *pl) {
const VersionInfo *Plugin_GetVersionInfo(Plugin *pl) {
static const VersionInfo fakeversion = {0, 0, 0, 0};
const VersionInfo *vi;
-#line 276
- OPTION_ASSERT(pl);
+ OS_ASSERT(276, pl);
if (pl->cb->GetVersionInfo && pl->cb->GetVersionInfo(&vi) == 0)
return vi;
@@ -82,8 +79,7 @@ DropInFlags *Plugin_GetDropInFlags(Plugin *pl) {
const DropInFlags *df;
SInt32 dfsize;
-#line 329
- OPTION_ASSERT(pl);
+ OS_ASSERT(329, pl);
if (pl->cb->GetDropInFlags && pl->cb->GetDropInFlags(&df, &dfsize) == 0) {
memset(&retdf, 0, sizeof(retdf));
@@ -97,8 +93,7 @@ DropInFlags *Plugin_GetDropInFlags(Plugin *pl) {
OSType Plugin_GetPluginType(Plugin *pl) {
DropInFlags *df;
-#line 345
- OPTION_ASSERT(pl);
+ OS_ASSERT(345, pl);
df = Plugin_GetDropInFlags(pl);
if (df)
@@ -115,9 +110,8 @@ const CWTargetList *Plugin_CL_GetTargetList(Plugin *pl) {
};
const CWTargetList *tl;
-#line 358
- OPTION_ASSERT(pl);
- OPTION_ASSERT(pl->cl_cb != NULL);
+ OS_ASSERT(358, pl);
+ OS_ASSERT(359, pl->cl_cb != NULL);
if (pl->cl_cb->GetTargetList && pl->cl_cb->GetTargetList(&tl) == 0)
return tl;
@@ -131,8 +125,7 @@ const CWPanelList *Plugin_GetPanelList(Plugin *pl) {
};
const CWPanelList *pnl;
-#line 381
- OPTION_ASSERT(pl);
+ OS_ASSERT(381, pl);
if (pl->cb->GetPanelList && pl->cb->GetPanelList(&pnl) == 0)
return pnl;
@@ -147,9 +140,8 @@ const CWExtMapList *Plugin_CL_GetExtMapList(Plugin *pl) {
};
const CWExtMapList *el;
-#line 401
- OPTION_ASSERT(pl);
- OPTION_ASSERT(pl->cl_cb != NULL);
+ OS_ASSERT(401, pl);
+ OS_ASSERT(402, pl->cl_cb != NULL);
if (pl->cl_cb->GetDefaultMappingList && pl->cl_cb->GetDefaultMappingList(&el) == 0)
return el;
@@ -160,8 +152,7 @@ const CWExtMapList *Plugin_CL_GetExtMapList(Plugin *pl) {
const OSFileTypeMappingList *Plugin_GetFileTypeMappingList(Plugin *pl) {
const OSFileTypeMappingList *ftml;
-#line 422
- OPTION_ASSERT(pl);
+ OS_ASSERT(422, pl);
if (pl->cb->GetFileTypeMappings && pl->cb->GetFileTypeMappings(&ftml) == 0)
return ftml;
@@ -177,9 +168,8 @@ const CWObjectFlags *Plugin_CL_GetObjectFlags(Plugin *pl) {
};
const CWObjectFlags *cof;
-#line 434
- OPTION_ASSERT(pl);
- OPTION_ASSERT(pl->cl_cb != NULL);
+ OS_ASSERT(434, pl);
+ OS_ASSERT(435, pl->cl_cb != NULL);
if (pl->cl_cb->GetObjectFlags && pl->cl_cb->GetObjectFlags(&cof) == 0)
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 isSupported;
-#line 566
- OPTION_ASSERT(pl->pr_cb != NULL);
+ OS_ASSERT(566, pl->pr_cb != NULL);
if (pl->pr_cb->SupportsPlugin && pl->pr_cb->SupportsPlugin(pluginfo, cpu, os, &isSupported) == 0)
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 isSupported;
-#line 578
- OPTION_ASSERT(pl->pr_cb != NULL);
+ OS_ASSERT(578, pl->pr_cb != NULL);
if (pl->pr_cb->SupportsPanels && pl->pr_cb->SupportsPanels(numPanels, panelNames, &isSupported) == 0)
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) {
OSSpec outoss;
-#line 590
- OPTION_ASSERT(pl->cl_cb != NULL);
- OPTION_ASSERT(data != NULL && srcfss != NULL && outfss != NULL);
+ OS_ASSERT(590, pl->cl_cb != NULL);
+ OS_ASSERT(591, data != NULL && srcfss != NULL && outfss != NULL);
if (pl->cl_cb->WriteObjectFile) {
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 const SInt32 DropInFlagsSize[3] = {0, 0x10, 0x12};
+ static const SInt32 DropInFlagsSize[3] = {0, sizeof(DropInFlagsV1), sizeof(DropInFlags)};
const DropInFlags *df;
const CWObjectFlags *cof;
SInt32 dfsize;
@@ -884,9 +871,8 @@ int Plugins_GetPluginList(Plugin *list, int *numPlugins, CLPluginInfo **pluginIn
while (scan) {
df = Plugin_GetDropInFlags(scan);
vi = Plugin_GetVersionInfo(scan);
-#line 1270
- OPTION_ASSERT(df != NULL);
- OPTION_ASSERT(vi != NULL);
+ OS_ASSERT(1270, df != NULL);
+ OS_ASSERT(1271, vi != NULL);
(*pluginInfo)[idx].plugintype = df->dropintype;
(*pluginInfo)[idx].language = df->edit_language;
(*pluginInfo)[idx].dropinflags = df->dropinflags;
diff --git a/command_line/CmdLine/Src/Project/CLAccessPaths.c b/command_line/CmdLine/Src/Project/CLAccessPaths.c
index d20b16b..1b455da 100644
--- a/command_line/CmdLine/Src/Project/CLAccessPaths.c
+++ b/command_line/CmdLine/Src/Project/CLAccessPaths.c
@@ -32,8 +32,7 @@ void Path_Free(Path *path) {
}
Boolean Paths_Initialize(Paths *paths) {
-#line 52
- OPTION_ASSERT(paths != NULL);
+ OS_ASSERT(52, paths != NULL);
memset(paths, 0, sizeof(Paths));
paths->pathsArray = NULL;
@@ -43,8 +42,7 @@ Boolean Paths_Initialize(Paths *paths) {
Boolean Paths_Terminate(Paths *paths) {
UInt16 index;
-#line 63
- OPTION_ASSERT(paths != NULL);
+ OS_ASSERT(63, paths != NULL);
if (paths->pathsArray) {
for (index = 0; index < paths->pathsCount; index++)
@@ -59,8 +57,7 @@ Boolean Paths_Terminate(Paths *paths) {
static Boolean Paths_GrowPaths(Paths *paths, UInt16 *index) {
Path **newArray;
-#line 84
- OPTION_ASSERT(paths != NULL);
+ OS_ASSERT(84, paths != NULL);
if (paths->pathsCount >= paths->arraySize) {
paths->arraySize += 20;
@@ -116,8 +113,7 @@ Boolean Paths_DeletePath(Paths *paths, UInt16 index) {
}
Path *Paths_GetPath(Paths *paths, UInt16 pathnum) {
-#line 151
- OPTION_ASSERT(paths != NULL);
+ OS_ASSERT(151, paths != NULL);
if (pathnum < paths->pathsCount)
return paths->pathsArray[pathnum];
@@ -126,8 +122,7 @@ Path *Paths_GetPath(Paths *paths, UInt16 pathnum) {
}
UInt16 Paths_Count(const Paths *paths) {
-#line 161
- OPTION_ASSERT(paths != NULL);
+ OS_ASSERT(161, paths != NULL);
return paths->pathsCount;
}
@@ -135,8 +130,7 @@ UInt16 Paths_Count(const Paths *paths) {
Boolean Paths_FindPath(const Paths *paths, const Path *path) {
UInt16 idx;
-#line 169
- OPTION_ASSERT(paths != NULL);
+ OS_ASSERT(169, paths != NULL);
for (idx = 0; idx < paths->pathsCount; idx++) {
if (paths->pathsArray[idx] == path)
@@ -150,8 +144,7 @@ Path *Paths_FindPathSpec(const Paths *paths, const OSPathSpec *dir) {
UInt16 idx;
Path *path;
-#line 182
- OPTION_ASSERT(paths != NULL);
+ OS_ASSERT(182, paths != NULL);
for (idx = 0; idx < paths->pathsCount; idx++) {
path = paths->pathsArray[idx];
@@ -220,8 +213,7 @@ int Paths_CountRecurse(Paths *paths) {
mine = Paths_Count(paths);
for (idx = 0; idx < mine; idx++) {
path = Paths_GetPath(paths, idx);
-#line 336
- OPTION_ASSERT(path);
+ OS_ASSERT(336, path);
if (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++) {
path = Paths_GetPath(paths, idx);
-#line 353
- OPTION_ASSERT(path && *count > 0);
+ OS_ASSERT(353, path && *count > 0);
OS_MakeSpecWithPath(path->spec, NULL, 0, &spec);
-#line 355
- OPTION_ASSERT(OS_OSSpec_To_FSSpec(&spec, *list));
+ OS_ASSERT(355, OS_OSSpec_To_FSSpec(&spec, *list));
(*list)++;
(*count)--;
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) {
CopyRecurseFSS(&list, paths, &count);
-#line 367
- OPTION_ASSERT(count == 0);
+ OS_ASSERT(367, count == 0);
}
static Boolean Frameworks_Initialize(Frameworks *fws) {
-#line 405
- OPTION_ASSERT(fws != NULL);
+ OS_ASSERT(405, fws != NULL);
memset(fws, 0, sizeof(Frameworks));
fws->fwsArray = NULL;
@@ -267,8 +255,7 @@ static Boolean Frameworks_Initialize(Frameworks *fws) {
static Boolean Frameworks_Grow(Frameworks *fws, UInt16 *index) {
Paths_FWInfo **newArray;
-#line 418
- OPTION_ASSERT(fws != NULL);
+ OS_ASSERT(418, fws != NULL);
if (fws->fwsCount >= fws->arraySize) {
fws->arraySize += 20;
@@ -461,9 +448,8 @@ void Framework_GetEnvInfo(void) {
int err;
Boolean is_file;
-#line 672
- OPTION_ASSERT(Paths_Initialize(&FrameworkPaths) == 1);
- OPTION_ASSERT(Frameworks_Initialize(&FrameworkInfo) == 1);
+ OS_ASSERT(672, Paths_Initialize(&FrameworkPaths) == 1);
+ OS_ASSERT(673, Frameworks_Initialize(&FrameworkInfo) == 1);
env = getenv("MWFrameworkPaths");
if (env) {
@@ -518,8 +504,7 @@ int Frameworks_GetCount(void) {
}
Paths_FWInfo *Frameworks_GetInfo(int which) {
-#line 762
- OPTION_ASSERT(FrameworkInfo.fwsArray);
- OPTION_ASSERT(FrameworkInfo.fwsCount > which);
+ OS_ASSERT(762, FrameworkInfo.fwsArray);
+ OS_ASSERT(763, FrameworkInfo.fwsCount > which);
return FrameworkInfo.fwsArray[which];
}
diff --git a/command_line/CmdLine/Src/Project/CLFiles.c b/command_line/CmdLine/Src/Project/CLFiles.c
index 6953df1..e651c73 100644
--- a/command_line/CmdLine/Src/Project/CLFiles.c
+++ b/command_line/CmdLine/Src/Project/CLFiles.c
@@ -30,8 +30,7 @@ void File_Free(File *file) {
}
Boolean Files_Initialize(Files *this) {
-#line 47
- OPTION_ASSERT(this != NULL);
+ OS_ASSERT(47, this != NULL);
return 1;
}
@@ -39,8 +38,7 @@ Boolean Files_Terminate(Files *this) {
File *file;
File *next;
-#line 56
- OPTION_ASSERT(this != NULL);
+ OS_ASSERT(56, this != NULL);
for (file = this->fileList; file; 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) {
File **scan;
-#line 80
- OPTION_ASSERT(this != NULL);
- OPTION_ASSERT(file != NULL);
+ OS_ASSERT(80, this != NULL);
+ OS_ASSERT(81, file != NULL);
if (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 *file;
-#line 104
- OPTION_ASSERT(this != NULL);
- OPTION_ASSERT(filenum >= 0);
+ OS_ASSERT(104, this != NULL);
+ OS_ASSERT(105, filenum >= 0);
file = this->fileList;
while (file && file->filenum != filenum)
@@ -101,8 +97,7 @@ File *Files_FindFile(Files *this, OSSpec *spec) {
}
int Files_Count(Files *this) {
-#line 127
- OPTION_ASSERT(this != NULL);
+ OS_ASSERT(127, this != NULL);
return this->fileCount;
}
diff --git a/command_line/CmdLine/Src/Project/CLOverlays.c b/command_line/CmdLine/Src/Project/CLOverlays.c
index 3437366..2656869 100644
--- a/command_line/CmdLine/Src/Project/CLOverlays.c
+++ b/command_line/CmdLine/Src/Project/CLOverlays.c
@@ -6,8 +6,7 @@ Boolean Overlays_Initialize(Overlays *this) {
OvlAddr addr;
SInt32 idx;
-#line 24
- OPTION_ASSERT(this);
+ OS_ASSERT(24, this);
this->groups = NULL;
this->lastgrp = NULL;
@@ -24,12 +23,10 @@ Boolean Overlays_Initialize(Overlays *this) {
return 0;
OvlGroup_AddOverlay(grp, ovl, &idx);
-#line 42
- OPTION_ASSERT(idx==0);
+ OS_ASSERT(42, idx==0);
Overlays_AddOvlGroup(this, grp, &idx);
-#line 45
- OPTION_ASSERT(idx==0);
+ OS_ASSERT(45, idx==0);
return 1;
}
@@ -38,8 +35,7 @@ Boolean Overlays_Terminate(Overlays *this) {
OvlGroup *grp;
OvlGroup *nxtgrp;
-#line 54
- OPTION_ASSERT(this);
+ OS_ASSERT(54, this);
for (grp = this->groups; grp; grp = nxtgrp) {
nxtgrp = grp->next;
@@ -52,9 +48,8 @@ Boolean Overlays_Terminate(Overlays *this) {
}
Boolean Overlays_AddOvlGroup(Overlays *this, OvlGroup *grp, SInt32 *grpnum) {
-#line 70
- OPTION_ASSERT(this);
- OPTION_ASSERT(grp);
+ OS_ASSERT(70, this);
+ OS_ASSERT(71, grp);
if (this->groups == NULL)
this->groups = grp;
@@ -73,8 +68,7 @@ OvlGroup *Overlays_GetOvlGroup(Overlays *this, SInt32 grpnum) {
OvlGroup *grp;
SInt32 cnt = 0;
-#line 93
- OPTION_ASSERT(this);
+ OS_ASSERT(93, this);
grp = this->groups;
while (grp && cnt < grpnum) {
@@ -92,8 +86,7 @@ SInt32 Overlays_CountGroups(Overlays *this) {
OvlGroup *scan;
int num = 0;
-#line 112
- OPTION_ASSERT(this);
+ OS_ASSERT(112, this);
scan = this->groups;
while (scan) {
@@ -107,8 +100,7 @@ SInt32 Overlays_CountGroups(Overlays *this) {
Boolean Overlays_AddFileToOverlay(Overlays *this, SInt32 grpnum, SInt32 ovlnum, SInt32 filenum) {
Overlay *oly;
-#line 130
- OPTION_ASSERT(this);
+ OS_ASSERT(130, this);
oly = Overlays_GetOverlayInGroup(this, grpnum, ovlnum);
if (oly)
@@ -120,8 +112,7 @@ Boolean Overlays_AddFileToOverlay(Overlays *this, SInt32 grpnum, SInt32 ovlnum,
Overlay *Overlays_GetOverlayInGroup(Overlays *this, SInt32 grpnum, SInt32 ovlnum) {
OvlGroup *grp;
-#line 144
- OPTION_ASSERT(this);
+ OS_ASSERT(144, this);
grp = Overlays_GetOvlGroup(this, grpnum);
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) {
Overlay *oly;
-#line 160
- OPTION_ASSERT(this);
+ OS_ASSERT(160, this);
oly = Overlays_GetOverlayInGroup(this, grpnum, ovlnum);
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 *grp;
-#line 175
- OPTION_ASSERT(name);
+ OS_ASSERT(175, name);
grp = xmalloc(NULL, sizeof(OvlGroup));
if (grp) {
@@ -159,8 +148,7 @@ OvlGroup *OvlGroup_New(const char *name, OvlAddr addr) {
grp->olycnt = 0;
grp->next = NULL;
} else {
-#line 188
- DO_INTERNAL_ERROR("Could not allocate %s", "overlay group");
+ DO_INTERNAL_ERROR(188, "Could not allocate %s", "overlay group");
}
return grp;
}
@@ -169,8 +157,7 @@ void OvlGroup_Delete(OvlGroup *grp) {
Overlay *scan;
Overlay *next;
-#line 197
- OPTION_ASSERT(grp);
+ OS_ASSERT(197, grp);
for (scan = grp->olys; scan; scan = next) {
next = scan->next;
@@ -182,9 +169,8 @@ void OvlGroup_Delete(OvlGroup *grp) {
}
Boolean OvlGroup_AddOverlay(OvlGroup *this, Overlay *oly, SInt32 *olynum) {
-#line 211
- OPTION_ASSERT(this);
- OPTION_ASSERT(oly);
+ OS_ASSERT(211, this);
+ OS_ASSERT(212, oly);
if (!this->lastoly)
this->olys = oly;
@@ -203,8 +189,7 @@ Overlay *OvlGroup_GetOverlay(OvlGroup *this, SInt32 olynum) {
Overlay *oly;
SInt32 cnt = 0;
-#line 234
- OPTION_ASSERT(this);
+ OS_ASSERT(234, this);
oly = this->olys;
while (oly && cnt < olynum) {
@@ -222,8 +207,7 @@ SInt32 OvlGroup_CountOverlays(OvlGroup *this) {
Overlay *scan;
int num = 0;
-#line 254
- OPTION_ASSERT(this);
+ OS_ASSERT(254, this);
scan = this->olys;
while (scan) {
@@ -246,15 +230,13 @@ Overlay *Overlay_New(const char *name) {
oly->cnt = 0;
oly->next = NULL;
} else {
-#line 281
- DO_INTERNAL_ERROR("Could not allocate %s", "overlay");
+ DO_INTERNAL_ERROR(281, "Could not allocate %s", "overlay");
}
return oly;
}
void Overlay_Delete(Overlay *oly) {
-#line 288
- OPTION_ASSERT(oly);
+ OS_ASSERT(288, oly);
if (oly->list)
xfree(oly->list);
@@ -262,8 +244,7 @@ void Overlay_Delete(Overlay *oly) {
}
Boolean Overlay_AddFile(Overlay *oly, SInt32 filenum, SInt32 *filnum) {
-#line 296
- OPTION_ASSERT(oly);
+ OS_ASSERT(296, oly);
if (oly->cnt >= oly->max) {
oly->max += 16;
@@ -279,8 +260,7 @@ Boolean Overlay_AddFile(Overlay *oly, SInt32 filenum, SInt32 *filnum) {
}
SInt32 Overlay_GetFile(Overlay *oly, SInt32 filnum) {
-#line 314
- OPTION_ASSERT(oly);
+ OS_ASSERT(314, oly);
if (filnum < oly->cnt)
return oly->list[filnum];
@@ -289,8 +269,7 @@ SInt32 Overlay_GetFile(Overlay *oly, SInt32 filnum) {
}
SInt32 Overlay_CountFiles(Overlay *oly) {
-#line 323
- OPTION_ASSERT(oly);
+ OS_ASSERT(323, oly);
return oly->cnt;
}
diff --git a/command_line/CmdLine/Src/Project/CLProj.c b/command_line/CmdLine/Src/Project/CLProj.c
index 83b2ce1..79b99ae 100644
--- a/command_line/CmdLine/Src/Project/CLProj.c
+++ b/command_line/CmdLine/Src/Project/CLProj.c
@@ -8,8 +8,7 @@ Boolean Proj_Initialize(Project *this) {
}
Boolean Proj_Terminate(Project *this) {
-#line 25
- OPTION_ASSERT(this != NULL);
+ OS_ASSERT(25, this != NULL);
Targets_Term(this->targets);
return 1;
diff --git a/command_line/CmdLine/Src/Project/CLSegs.c b/command_line/CmdLine/Src/Project/CLSegs.c
index a0e006c..e2c7369 100644
--- a/command_line/CmdLine/Src/Project/CLSegs.c
+++ b/command_line/CmdLine/Src/Project/CLSegs.c
@@ -18,21 +18,18 @@ Boolean Segments_Initialize(Segments *segs) {
Segment *main;
UInt16 idx;
-#line 36
- OPTION_ASSERT(segs != NULL);
+ OS_ASSERT(36, segs != NULL);
memset(segs, 0, sizeof(Segments));
segs->segsArray = NULL;
jump = Segment_New("Jump Table", 0x28);
Segments_AddSegment(segs, jump, &idx);
-#line 44
- OPTION_ASSERT(idx==0);
+ OS_ASSERT(44, idx==0);
main = Segment_New("Main", 0xFFFF);
Segments_AddSegment(segs, main, &idx);
-#line 49
- OPTION_ASSERT(idx==1);
+ OS_ASSERT(49, idx==1);
return 1;
}
@@ -40,8 +37,7 @@ Boolean Segments_Initialize(Segments *segs) {
Boolean Segments_Terminate(Segments *segs) {
UInt16 index;
-#line 57
- OPTION_ASSERT(segs != NULL);
+ OS_ASSERT(57, segs != NULL);
if (segs->segsArray) {
for (index = 0; index < segs->segsCount; index++)
@@ -56,8 +52,7 @@ Boolean Segments_Terminate(Segments *segs) {
static Boolean Segments_GrowSegments(Segments *segs, UInt16 *index) {
Segment **newArray;
-#line 78
- OPTION_ASSERT(segs != NULL);
+ OS_ASSERT(78, segs != NULL);
if (segs->segsCount >= segs->arraySize) {
segs->arraySize += 20;
@@ -106,8 +101,7 @@ Boolean Segments_DeleteSegment(Segments *segs, UInt16 index) {
}
Segment *Segments_GetSegment(Segments *segs, UInt16 segnum) {
-#line 137
- OPTION_ASSERT(segs != NULL);
+ OS_ASSERT(137, segs != NULL);
if (segnum < segs->segsCount)
return segs->segsArray[segnum];
@@ -116,8 +110,7 @@ Segment *Segments_GetSegment(Segments *segs, UInt16 segnum) {
}
UInt16 Segments_Count(const Segments *segs) {
-#line 147
- OPTION_ASSERT(segs != NULL);
+ OS_ASSERT(147, segs != NULL);
return segs->segsCount;
}