From a231f5dbb93c60da240a027f2afd8a4797069541 Mon Sep 17 00:00:00 2001 From: Ash Wolf Date: Sun, 15 Jan 2023 21:50:41 +0000 Subject: more cleanup --- command_line/C++_Parser/Src/Library/IO.c | 2 +- command_line/C++_Parser/Src/Library/Parameter.c | 46 +++++++++++----------- command_line/C++_Parser/Src/Library/Projects.c | 14 +++---- .../C++_Parser/Src/Library/ToolHelpers-cc.c | 4 +- 4 files changed, 33 insertions(+), 33 deletions(-) (limited to 'command_line/C++_Parser') diff --git a/command_line/C++_Parser/Src/Library/IO.c b/command_line/C++_Parser/Src/Library/IO.c index 36d809b..0ce74df 100644 --- a/command_line/C++_Parser/Src/Library/IO.c +++ b/command_line/C++_Parser/Src/Library/IO.c @@ -7,7 +7,7 @@ void ShowTextHandle(const char *description, Handle text) { return; if (description) - CLPStatus(71, description); + CLPStatus(CLPStr71, description); CWSecretAttachHandle(parseopts.context, text, &mh); CWParserDisplayTextHandle(parseopts.context, description, mh); } diff --git a/command_line/C++_Parser/Src/Library/Parameter.c b/command_line/C++_Parser/Src/Library/Parameter.c index 31669e1..4b640b3 100644 --- a/command_line/C++_Parser/Src/Library/Parameter.c +++ b/command_line/C++_Parser/Src/Library/Parameter.c @@ -162,7 +162,7 @@ static int Param_Number(NUM_T *p, const char *pstr, int flags) { val = 0; opstr = pstr; if (!pstr[0]) { - Param_Error(5, "", pstr); + Param_Error(CLPStr5, "", pstr); return 0; } @@ -175,12 +175,12 @@ static int Param_Number(NUM_T *p, const char *pstr, int flags) { while (*pstr) { if (!my_isxdigit(*pstr)) { - Param_Error(5, "hexadecimal ", opstr); + Param_Error(CLPStr5, "hexadecimal ", opstr); return 0; } if (val > 0xFFFFFFF) { - Param_Error(4, opstr); + Param_Error(CLPStr4, opstr); return 0; } @@ -192,12 +192,12 @@ static int Param_Number(NUM_T *p, const char *pstr, int flags) { while (*pstr) { if (*pstr < '0' || *pstr >= '8') { - Param_Error(5, "octal ", opstr); + Param_Error(CLPStr5, "octal ", opstr); return 0; } if (val > 0x1FFFFFFF) { - Param_Error(4, opstr); + Param_Error(CLPStr4, opstr); return 0; } @@ -207,12 +207,12 @@ static int Param_Number(NUM_T *p, const char *pstr, int flags) { } else { while (*pstr) { if (!my_isdigit(*pstr)) { - Param_Error(5, "decimal ", opstr); + Param_Error(CLPStr5, "decimal ", opstr); return 0; } if (val > 0x19999999) { - Param_Error(4, opstr); + Param_Error(CLPStr4, opstr); return 0; } @@ -238,15 +238,15 @@ static int Param_Number(NUM_T *p, const char *pstr, int flags) { } if (!p->fit && (val < lo || val > hi)) { - Param_Error(6, val, lo, hi); + Param_Error(CLPStr6, val, lo, hi); return 0; } if (val < lo) { - Param_Warning(7, val, lo, hi, lo); + Param_Warning(CLPStr7, val, lo, hi, lo); val = lo; } else if (val > hi) { - Param_Warning(7, val, lo, hi, hi); + Param_Warning(CLPStr7, val, lo, hi, hi); val = hi; } @@ -309,7 +309,7 @@ static int Param_FTypeCreator(FTYPE_T *p, const char *pstr, int flags) { } if (*pstr) { - Param_Error(8, opstr); + Param_Error(CLPStr8, opstr); return 0; } @@ -352,7 +352,7 @@ static int Param_String(STRING_T *p, const char *pstr, int flags) { c2pstr(p->str); if (len > p->maxlen) { - Param_Error(9, pstr, pstr + len - 5, p->maxlen - 1); + Param_Error(CLPStr9, pstr, pstr + len - 5, p->maxlen - 1); return 0; } @@ -399,10 +399,10 @@ static int Param_ID_or_SYM(STRING_T *p, const char *pstr, int flags) { for (ptr = pstr; *ptr; ++ptr) { if (ptr == pstr && my_isdigit(*ptr)) - Param_Warning(10, pstr); + Param_Warning(CLPStr10, pstr); if (!my_isalnum(*ptr) && !strchr(x, *ptr)) - Param_Warning(11, pstr, *ptr); + Param_Warning(CLPStr11, pstr, *ptr); } return 1; @@ -444,7 +444,7 @@ static int Param_OnOff(ONOFF_T *p, const char *pstr, int flags) { } else if (!ustrcmp(pstr, "off")) { *(p->var) = mytrue == 0; } else { - Param_Error(12, pstr); + Param_Error(CLPStr12, pstr); return 0; } @@ -484,7 +484,7 @@ static int Param_OffOn(OFFON_T *p, const char *pstr, int flags) { } else if (!ustrcmp(pstr, "on")) { *(p->var) = mytrue == 0; } else { - Param_Error(12, pstr); + Param_Error(CLPStr12, pstr); return 0; } @@ -518,7 +518,7 @@ static int Param_FilePath(FILEPATH_T *p, const char *pstr, int flags) { err = OS_MakeFileSpec(pstr, &spec); if (err) { - Param_Error(18, pstr, OS_GetErrText(err)); + Param_Error(CLPStr18, pstr, OS_GetErrText(err)); return 0; } @@ -528,7 +528,7 @@ static int Param_FilePath(FILEPATH_T *p, const char *pstr, int flags) { } else { clen = strlen(canon); if (clen > p->maxlen) { - Param_Error(13, canon + clen - 32, canon); + Param_Error(CLPStr13, canon + clen - 32, canon); return 0; } strcpy(p->filename, canon); @@ -744,7 +744,7 @@ static int Param_Setting(SETTING_T *p, const char *pstr, int flags) { Boolean equals = 0; if (!pstr) { - Param_Error(40); + Param_Error(CLPStr40); return 0; } @@ -988,7 +988,7 @@ static Boolean Param_IsNonTextFile(const char *fname, Boolean warn) { if (!OS_GetMacFileType(&tmp, &mactype)) { if (mactype != 'TEXT') { if (warn) - Param_Warning(77, fname); + Param_Warning(CLPStr77, fname); return 1; } } @@ -1018,11 +1018,11 @@ static int Param_GetArgument(PARAM_T *param, const char **cparam, int exec) { if (tok->val == nextParam || tok->val == ATK_EQUALS) tok = Arg_UsedToken(); if (tok->val == nextOpt || tok->val == nextParam || tok->val == lastOpt) { - Param_Error(34); + Param_Error(CLPStr34_ArgumentsExpected); return 0; } if (tok->val != ATK_ARG) { - Param_Error(57, "parameter", Arg_GetTokenName(tok)); + Param_Error(CLPStr57, "parameter", Arg_GetTokenName(tok)); return 0; } Arg_GetTokenText(tok, curparam, sizeof(curparam), 1); @@ -1038,7 +1038,7 @@ static int Param_GetArgument(PARAM_T *param, const char **cparam, int exec) { *cparam = 0; if (tok->val == ATK_EQUALS && !subparse) { if (!(exec & PARAMPARSEFLAGS_40)) { - Param_Error(37); + Param_Error(CLPStr37); return 0; } Arg_UsedToken(); diff --git a/command_line/C++_Parser/Src/Library/Projects.c b/command_line/C++_Parser/Src/Library/Projects.c index dca9df2..b310398 100644 --- a/command_line/C++_Parser/Src/Library/Projects.c +++ b/command_line/C++_Parser/Src/Library/Projects.c @@ -27,7 +27,7 @@ int AddFileToProject(OSSpec *oss, SInt16 which, char *outfilename, Boolean exist err = OS_OSSpec_To_FSSpec(oss, &cws); if (err) { - CLPOSAlert(44, err, OS_SpecToStringRelative(oss, 0, STSbuf, sizeof(STSbuf))); + CLPOSAlert(CLPStr44, err, OS_SpecToStringRelative(oss, 0, STSbuf, sizeof(STSbuf))); return 0; } @@ -79,7 +79,7 @@ int AddAccessPath(OSPathSpec *oss, SInt16 type, SInt32 position, Boolean recursi CWAccessPathListInfo apli; if ((err = OS_MakeSpecWithPath(oss, NULL, 0, &spec)) || (err = OS_OSSpec_To_FSSpec(&spec, &api.pathSpec))) { - CLPOSAlert(45, err, OS_PathSpecToString(&spec.path, STSbuf, sizeof(STSbuf))); + CLPOSAlert(CLPStr45, err, OS_PathSpecToString(&spec.path, STSbuf, sizeof(STSbuf))); return 0; } @@ -173,7 +173,7 @@ void AddOverlayGroup(const char *name, CWAddr64 *addr, SInt32 *groupnum, SInt32 result = CWParserAddOverlay1Group(parseopts.context, name, addr, groupnum); if (result) { if (result == cwErrInvalidCallback) { - CLPReportError(72); + CLPReportError(CLPStr72); } else { failedCallback = "CWParserAddOverlay1Group"; longjmp(exit_plugin, result); @@ -187,7 +187,7 @@ void AddOverlay(SInt32 groupnum, const char *name, SInt32 *overlaynum) { result = CWParserAddOverlay1(parseopts.context, name, groupnum, overlaynum); if (result) { if (result == cwErrInvalidCallback) { - CLPReportError(72); + CLPReportError(CLPStr72); } else { failedCallback = "CWParserAddOverlay1"; longjmp(exit_plugin, result); @@ -201,7 +201,7 @@ void AddSegment(const char *name, SInt16 attrs, SInt32 *segmentnum) { result = CWParserAddSegment(parseopts.context, name, attrs, segmentnum); if (result) { if (result == cwErrInvalidCallback) { - CLPReportError(73); + CLPReportError(CLPStr73); } else { failedCallback = "CWParserAddSegment"; longjmp(exit_plugin, result); @@ -215,7 +215,7 @@ void ChangeSegment(SInt32 segmentnum, const char *name, SInt16 attrs) { result = CWParserSetSegment(parseopts.context, segmentnum, name, attrs); if (result) { if (result == cwErrInvalidCallback) { - CLPReportError(73); + CLPReportError(CLPStr73); } else { failedCallback = "CWParserSetSegment"; longjmp(exit_plugin, result); @@ -230,7 +230,7 @@ int GetSegment(SInt32 segmentnum, char *name, SInt16 *attrs) { result = CWGetSegmentInfo(parseopts.context, segmentnum, &psi); if (result) { if (result == cwErrInvalidCallback) { - CLPReportError(73); + CLPReportError(CLPStr73); } return 0; } diff --git a/command_line/C++_Parser/Src/Library/ToolHelpers-cc.c b/command_line/C++_Parser/Src/Library/ToolHelpers-cc.c index b58f188..6c19b5b 100644 --- a/command_line/C++_Parser/Src/Library/ToolHelpers-cc.c +++ b/command_line/C++_Parser/Src/Library/ToolHelpers-cc.c @@ -21,9 +21,9 @@ void FinishCompilerTool(void) { strcpy(pCmdLineCompiler.outMakefile, parseopts.lastoutputname); } else if (outputOrdering == OutputOrdering2) { if (parseopts.possibleFiles > 0 || parseopts.userSpecifiedFiles > 0) - CLPReportError(41, parseopts.lastoutputname); + CLPReportError(CLPStr41, parseopts.lastoutputname); else - CLPReportError(42, parseopts.lastoutputname); + CLPReportError(CLPStr42, parseopts.lastoutputname); } else { SetFileOutputName(numfiles - 1, lastStage, parseopts.lastoutputname); } -- cgit v1.2.3