summaryrefslogtreecommitdiff
path: root/command_line/CmdLine/Src/Project/CLOverlays.c
diff options
context:
space:
mode:
authorAsh Wolf <ninji@wuffs.org>2023-01-11 23:26:04 +0000
committerAsh Wolf <ninji@wuffs.org>2023-01-11 23:26:04 +0000
commit54bb1363a26b6a52cf1a8ecf1f16f76e9920956f (patch)
tree53644f3d0a9b24a10275ba723f6e7e43aee00ec9 /command_line/CmdLine/Src/Project/CLOverlays.c
parent0bec4f557a96e1a40437cf5af20cc78a5eec8a63 (diff)
downloadMWCC-54bb1363a26b6a52cf1a8ecf1f16f76e9920956f.tar.gz
MWCC-54bb1363a26b6a52cf1a8ecf1f16f76e9920956f.zip
get it to compile with clang
Diffstat (limited to 'command_line/CmdLine/Src/Project/CLOverlays.c')
-rw-r--r--command_line/CmdLine/Src/Project/CLOverlays.c67
1 files changed, 23 insertions, 44 deletions
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;
}