summaryrefslogtreecommitdiff
path: root/command_line/CmdLine/Src/Plugins/CLPlugins.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/Plugins/CLPlugins.c
parent0bec4f557a96e1a40437cf5af20cc78a5eec8a63 (diff)
downloadMWCC-54bb1363a26b6a52cf1a8ecf1f16f76e9920956f.tar.gz
MWCC-54bb1363a26b6a52cf1a8ecf1f16f76e9920956f.zip
get it to compile with clang
Diffstat (limited to '')
-rw-r--r--command_line/CmdLine/Src/Plugins/CLPlugins.c54
1 files changed, 20 insertions, 34 deletions
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;