Renames CfgError -> PError, CfgWarning -> PWarning.
This commit is contained in:
@@ -1034,8 +1034,7 @@ static void OptConfig (const char* Opt attribute ((unused)), const char* Arg)
|
|||||||
static void OptColor(const char* Opt, const char* Arg)
|
static void OptColor(const char* Opt, const char* Arg)
|
||||||
/* Handle the --color option */
|
/* Handle the --color option */
|
||||||
{
|
{
|
||||||
ColorMode Mode = CP_Parse (Arg);
|
if (CP_Parse (Arg) == CM_INVALID) {
|
||||||
if (Mode == CM_INVALID) {
|
|
||||||
Error ("Invalid argument to %s: %s", Opt, Arg);
|
Error ("Invalid argument to %s: %s", Opt, Arg);
|
||||||
} else {
|
} else {
|
||||||
CmdAddArg2 (&CA65, "--color", Arg);
|
CmdAddArg2 (&CA65, "--color", Arg);
|
||||||
|
|||||||
@@ -144,12 +144,12 @@ void CheckAssertions (void)
|
|||||||
|
|
||||||
case ASSERT_ACT_WARN:
|
case ASSERT_ACT_WARN:
|
||||||
case ASSERT_ACT_LDWARN:
|
case ASSERT_ACT_LDWARN:
|
||||||
CfgWarning (Pos, "Assertion failed: %s", Message);
|
PWarning (Pos, "Assertion failed: %s", Message);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ASSERT_ACT_ERROR:
|
case ASSERT_ACT_ERROR:
|
||||||
case ASSERT_ACT_LDERROR:
|
case ASSERT_ACT_LDERROR:
|
||||||
CfgError (Pos, "Assertion failed: %s", Message);
|
PError (Pos, "Assertion failed: %s", Message);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ static ExprNode* Factor (void)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
CfgError (&CfgErrorPos, "Invalid expression: %d", CfgTok);
|
PError (&CfgErrorPos, "Invalid expression: %d", CfgTok);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -213,7 +213,7 @@ long CfgConstExpr (void)
|
|||||||
|
|
||||||
/* Check that it's const */
|
/* Check that it's const */
|
||||||
if (!IsConstExpr (Expr)) {
|
if (!IsConstExpr (Expr)) {
|
||||||
CfgError (&CfgErrorPos, "Constant expression expected");
|
PError (&CfgErrorPos, "Constant expression expected");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get the value */
|
/* Get the value */
|
||||||
@@ -238,7 +238,7 @@ long CfgCheckedConstExpr (long Min, long Max)
|
|||||||
|
|
||||||
/* Check the range */
|
/* Check the range */
|
||||||
if (Val < Min || Val > Max) {
|
if (Val < Min || Val > Max) {
|
||||||
CfgError (&CfgErrorPos, "Range error");
|
PError (&CfgErrorPos, "Range error");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return the value */
|
/* Return the value */
|
||||||
|
|||||||
@@ -228,7 +228,7 @@ static MemoryArea* CfgGetMemory (unsigned Name)
|
|||||||
{
|
{
|
||||||
MemoryArea* M = CfgFindMemory (Name);
|
MemoryArea* M = CfgFindMemory (Name);
|
||||||
if (M == 0) {
|
if (M == 0) {
|
||||||
CfgError (&CfgErrorPos, "Invalid memory area `%s'", GetString (Name));
|
PError (&CfgErrorPos, "Invalid memory area `%s'", GetString (Name));
|
||||||
}
|
}
|
||||||
return M;
|
return M;
|
||||||
}
|
}
|
||||||
@@ -321,7 +321,7 @@ static MemoryArea* CreateMemoryArea (const FilePos* Pos, unsigned Name)
|
|||||||
/* Check for duplicate names */
|
/* Check for duplicate names */
|
||||||
MemoryArea* M = CfgFindMemory (Name);
|
MemoryArea* M = CfgFindMemory (Name);
|
||||||
if (M) {
|
if (M) {
|
||||||
CfgError (&CfgErrorPos,
|
PError (&CfgErrorPos,
|
||||||
"Memory area `%s' defined twice",
|
"Memory area `%s' defined twice",
|
||||||
GetString (Name));
|
GetString (Name));
|
||||||
}
|
}
|
||||||
@@ -345,7 +345,7 @@ static SegDesc* NewSegDesc (unsigned Name)
|
|||||||
/* Check for duplicate names */
|
/* Check for duplicate names */
|
||||||
SegDesc* S = CfgFindSegDesc (Name);
|
SegDesc* S = CfgFindSegDesc (Name);
|
||||||
if (S) {
|
if (S) {
|
||||||
CfgError (&CfgErrorPos, "Segment `%s' defined twice", GetString (Name));
|
PError (&CfgErrorPos, "Segment `%s' defined twice", GetString (Name));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Allocate memory */
|
/* Allocate memory */
|
||||||
@@ -391,7 +391,7 @@ static void FlagAttr (unsigned* Flags, unsigned Mask, const char* Name)
|
|||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
if (*Flags & Mask) {
|
if (*Flags & Mask) {
|
||||||
CfgError (&CfgErrorPos, "Attribute `%s' is already defined", Name);
|
PError (&CfgErrorPos, "Attribute `%s' is already defined", Name);
|
||||||
}
|
}
|
||||||
*Flags |= Mask;
|
*Flags |= Mask;
|
||||||
}
|
}
|
||||||
@@ -402,7 +402,7 @@ static void AttrCheck (unsigned Attr, unsigned Mask, const char* Name)
|
|||||||
/* Check that a mandatory attribute was given */
|
/* Check that a mandatory attribute was given */
|
||||||
{
|
{
|
||||||
if ((Attr & Mask) == 0) {
|
if ((Attr & Mask) == 0) {
|
||||||
CfgError (&CfgErrorPos, "Mandatory attribute `%s' is missing", Name);
|
PError (&CfgErrorPos, "Mandatory attribute `%s' is missing", Name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -554,7 +554,7 @@ static void ParseFiles (void)
|
|||||||
|
|
||||||
/* The MEMORY section must preceed the FILES section */
|
/* The MEMORY section must preceed the FILES section */
|
||||||
if ((SectionsEncountered & SE_MEMORY) == 0) {
|
if ((SectionsEncountered & SE_MEMORY) == 0) {
|
||||||
CfgError (&CfgErrorPos, "MEMORY must precede FILES");
|
PError (&CfgErrorPos, "MEMORY must precede FILES");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Parse all files */
|
/* Parse all files */
|
||||||
@@ -568,7 +568,7 @@ static void ParseFiles (void)
|
|||||||
/* Search for the file, it must exist */
|
/* Search for the file, it must exist */
|
||||||
F = FindFile (GetStrBufId (&CfgSVal));
|
F = FindFile (GetStrBufId (&CfgSVal));
|
||||||
if (F == 0) {
|
if (F == 0) {
|
||||||
CfgError (&CfgErrorPos,
|
PError (&CfgErrorPos,
|
||||||
"File `%s' not found in MEMORY section",
|
"File `%s' not found in MEMORY section",
|
||||||
SB_GetConstBuf (&CfgSVal));
|
SB_GetConstBuf (&CfgSVal));
|
||||||
}
|
}
|
||||||
@@ -595,7 +595,7 @@ static void ParseFiles (void)
|
|||||||
case CFGTOK_FORMAT:
|
case CFGTOK_FORMAT:
|
||||||
if (F->Format != BINFMT_DEFAULT) {
|
if (F->Format != BINFMT_DEFAULT) {
|
||||||
/* We've set the format already! */
|
/* We've set the format already! */
|
||||||
CfgError (&CfgErrorPos,
|
PError (&CfgErrorPos,
|
||||||
"Cannot set a file format twice");
|
"Cannot set a file format twice");
|
||||||
}
|
}
|
||||||
/* Read the format token */
|
/* Read the format token */
|
||||||
@@ -667,7 +667,7 @@ static void ParseSegments (void)
|
|||||||
|
|
||||||
/* The MEMORY section must preceed the SEGMENTS section */
|
/* The MEMORY section must preceed the SEGMENTS section */
|
||||||
if ((SectionsEncountered & SE_MEMORY) == 0) {
|
if ((SectionsEncountered & SE_MEMORY) == 0) {
|
||||||
CfgError (&CfgErrorPos, "MEMORY must precede SEGMENTS");
|
PError (&CfgErrorPos, "MEMORY must precede SEGMENTS");
|
||||||
}
|
}
|
||||||
|
|
||||||
while (CfgTok == CFGTOK_IDENT) {
|
while (CfgTok == CFGTOK_IDENT) {
|
||||||
@@ -793,7 +793,7 @@ static void ParseSegments (void)
|
|||||||
** separate run and load memory areas.
|
** separate run and load memory areas.
|
||||||
*/
|
*/
|
||||||
if ((S->Flags & SF_ALIGN_LOAD) != 0 && (S->Load == S->Run)) {
|
if ((S->Flags & SF_ALIGN_LOAD) != 0 && (S->Load == S->Run)) {
|
||||||
CfgWarning (&CfgErrorPos,
|
PWarning (&CfgErrorPos,
|
||||||
"ALIGN_LOAD attribute specified, but no separate "
|
"ALIGN_LOAD attribute specified, but no separate "
|
||||||
"LOAD and RUN memory areas assigned");
|
"LOAD and RUN memory areas assigned");
|
||||||
/* Remove the flag */
|
/* Remove the flag */
|
||||||
@@ -804,7 +804,7 @@ static void ParseSegments (void)
|
|||||||
** load and run memory areas, because it's is never written to disk.
|
** load and run memory areas, because it's is never written to disk.
|
||||||
*/
|
*/
|
||||||
if ((S->Flags & SF_BSS) != 0 && (S->Load != S->Run)) {
|
if ((S->Flags & SF_BSS) != 0 && (S->Load != S->Run)) {
|
||||||
CfgWarning (&CfgErrorPos,
|
PWarning (&CfgErrorPos,
|
||||||
"Segment with type `bss' has both LOAD and RUN "
|
"Segment with type `bss' has both LOAD and RUN "
|
||||||
"memory areas assigned");
|
"memory areas assigned");
|
||||||
}
|
}
|
||||||
@@ -812,7 +812,7 @@ static void ParseSegments (void)
|
|||||||
/* Don't allow read/write data to be put into a readonly area */
|
/* Don't allow read/write data to be put into a readonly area */
|
||||||
if ((S->Flags & SF_RO) == 0) {
|
if ((S->Flags & SF_RO) == 0) {
|
||||||
if (S->Run->Flags & MF_RO) {
|
if (S->Run->Flags & MF_RO) {
|
||||||
CfgError (&CfgErrorPos,
|
PError (&CfgErrorPos,
|
||||||
"Cannot put r/w segment `%s' in r/o memory area `%s'",
|
"Cannot put r/w segment `%s' in r/o memory area `%s'",
|
||||||
GetString (S->Name), GetString (S->Run->Name));
|
GetString (S->Name), GetString (S->Run->Name));
|
||||||
}
|
}
|
||||||
@@ -823,7 +823,7 @@ static void ParseSegments (void)
|
|||||||
((S->Flags & SF_OFFSET) != 0) +
|
((S->Flags & SF_OFFSET) != 0) +
|
||||||
((S->Flags & SF_START) != 0);
|
((S->Flags & SF_START) != 0);
|
||||||
if (Count > 1) {
|
if (Count > 1) {
|
||||||
CfgError (&CfgErrorPos,
|
PError (&CfgErrorPos,
|
||||||
"Only one of ALIGN, START, OFFSET may be used");
|
"Only one of ALIGN, START, OFFSET may be used");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -936,7 +936,7 @@ static void ParseO65 (void)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
CfgError (&CfgErrorPos, "Unexpected type token");
|
PError (&CfgErrorPos, "Unexpected type token");
|
||||||
}
|
}
|
||||||
/* Eat the attribute token */
|
/* Eat the attribute token */
|
||||||
CfgNextTok ();
|
CfgNextTok ();
|
||||||
@@ -958,7 +958,7 @@ static void ParseO65 (void)
|
|||||||
case CFGTOK_OSA65: OS = O65OS_OSA65; break;
|
case CFGTOK_OSA65: OS = O65OS_OSA65; break;
|
||||||
case CFGTOK_CC65: OS = O65OS_CC65; break;
|
case CFGTOK_CC65: OS = O65OS_CC65; break;
|
||||||
case CFGTOK_OPENCBM: OS = O65OS_OPENCBM; break;
|
case CFGTOK_OPENCBM: OS = O65OS_OPENCBM; break;
|
||||||
default: CfgError (&CfgErrorPos, "Unexpected OS token");
|
default: PError (&CfgErrorPos, "Unexpected OS token");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
CfgNextTok ();
|
CfgNextTok ();
|
||||||
@@ -993,12 +993,12 @@ static void ParseO65 (void)
|
|||||||
/* Check for attributes that may not be combined */
|
/* Check for attributes that may not be combined */
|
||||||
if (OS == O65OS_CC65) {
|
if (OS == O65OS_CC65) {
|
||||||
if ((AttrFlags & (atImport | atExport)) != 0 && ModuleId < 0x8000) {
|
if ((AttrFlags & (atImport | atExport)) != 0 && ModuleId < 0x8000) {
|
||||||
CfgError (&CfgErrorPos,
|
PError (&CfgErrorPos,
|
||||||
"OS type CC65 may not have imports or exports for ids < $8000");
|
"OS type CC65 may not have imports or exports for ids < $8000");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (AttrFlags & atID) {
|
if (AttrFlags & atID) {
|
||||||
CfgError (&CfgErrorPos,
|
PError (&CfgErrorPos,
|
||||||
"Operating system does not support the ID attribute");
|
"Operating system does not support the ID attribute");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1071,7 +1071,7 @@ static void ParseXex (void)
|
|||||||
CfgNextTok ();
|
CfgNextTok ();
|
||||||
/* Add to XEX */
|
/* Add to XEX */
|
||||||
if (XexAddInitAd (XexFmtDesc, InitMem, InitAd))
|
if (XexAddInitAd (XexFmtDesc, InitMem, InitAd))
|
||||||
CfgError (&CfgErrorPos, "INITAD already given for memory area");
|
PError (&CfgErrorPos, "INITAD already given for memory area");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@@ -1290,7 +1290,7 @@ static void ParseConDes (void)
|
|||||||
|
|
||||||
/* Check if the condes has already attributes defined */
|
/* Check if the condes has already attributes defined */
|
||||||
if (ConDesHasSegName(Type) || ConDesHasLabel(Type)) {
|
if (ConDesHasSegName(Type) || ConDesHasLabel(Type)) {
|
||||||
CfgError (&CfgErrorPos,
|
PError (&CfgErrorPos,
|
||||||
"CONDES attributes for type %d are already defined",
|
"CONDES attributes for type %d are already defined",
|
||||||
Type);
|
Type);
|
||||||
}
|
}
|
||||||
@@ -1559,7 +1559,7 @@ static void ParseSymbols (void)
|
|||||||
case CfgSymImport:
|
case CfgSymImport:
|
||||||
/* An import must not have a value */
|
/* An import must not have a value */
|
||||||
if (AttrFlags & atValue) {
|
if (AttrFlags & atValue) {
|
||||||
CfgError (&CfgErrorPos, "Imports must not have a value");
|
PError (&CfgErrorPos, "Imports must not have a value");
|
||||||
}
|
}
|
||||||
/* Generate the import */
|
/* Generate the import */
|
||||||
Imp = InsertImport (GenImport (Name, AddrSize));
|
Imp = InsertImport (GenImport (Name, AddrSize));
|
||||||
@@ -1703,7 +1703,7 @@ static void ProcessSegments (void)
|
|||||||
** in the segment.
|
** in the segment.
|
||||||
*/
|
*/
|
||||||
if ((S->Flags & SF_BSS) != 0 && S->Seg != 0 && !IsBSSType (S->Seg)) {
|
if ((S->Flags & SF_BSS) != 0 && S->Seg != 0 && !IsBSSType (S->Seg)) {
|
||||||
CfgWarning (GetSourcePos (S->LI),
|
PWarning (GetSourcePos (S->LI),
|
||||||
"Segment `%s' with type `bss' contains initialized data",
|
"Segment `%s' with type `bss' contains initialized data",
|
||||||
GetString (S->Name));
|
GetString (S->Name));
|
||||||
}
|
}
|
||||||
@@ -1732,7 +1732,7 @@ static void ProcessSegments (void)
|
|||||||
|
|
||||||
/* Print a warning if the segment is not optional */
|
/* Print a warning if the segment is not optional */
|
||||||
if ((S->Flags & SF_OPTIONAL) == 0) {
|
if ((S->Flags & SF_OPTIONAL) == 0) {
|
||||||
CfgWarning (&CfgErrorPos,
|
PWarning (&CfgErrorPos,
|
||||||
"Segment `%s' does not exist",
|
"Segment `%s' does not exist",
|
||||||
GetString (S->Name));
|
GetString (S->Name));
|
||||||
}
|
}
|
||||||
@@ -1764,7 +1764,7 @@ static void ProcessSymbols (void)
|
|||||||
case CfgSymO65Export:
|
case CfgSymO65Export:
|
||||||
/* Check if the export symbol is also defined as an import. */
|
/* Check if the export symbol is also defined as an import. */
|
||||||
if (O65GetImport (O65FmtDesc, Sym->Name) != 0) {
|
if (O65GetImport (O65FmtDesc, Sym->Name) != 0) {
|
||||||
CfgError (
|
PError (
|
||||||
GetSourcePos (Sym->LI),
|
GetSourcePos (Sym->LI),
|
||||||
"Exported o65 symbol `%s' cannot also be an o65 import",
|
"Exported o65 symbol `%s' cannot also be an o65 import",
|
||||||
GetString (Sym->Name)
|
GetString (Sym->Name)
|
||||||
@@ -1776,7 +1776,7 @@ static void ProcessSymbols (void)
|
|||||||
** error message when checking it here.
|
** error message when checking it here.
|
||||||
*/
|
*/
|
||||||
if (O65GetExport (O65FmtDesc, Sym->Name) != 0) {
|
if (O65GetExport (O65FmtDesc, Sym->Name) != 0) {
|
||||||
CfgError (
|
PError (
|
||||||
GetSourcePos (Sym->LI),
|
GetSourcePos (Sym->LI),
|
||||||
"Duplicate exported o65 symbol: `%s'",
|
"Duplicate exported o65 symbol: `%s'",
|
||||||
GetString (Sym->Name)
|
GetString (Sym->Name)
|
||||||
@@ -1790,7 +1790,7 @@ static void ProcessSymbols (void)
|
|||||||
case CfgSymO65Import:
|
case CfgSymO65Import:
|
||||||
/* Check if the import symbol is also defined as an export. */
|
/* Check if the import symbol is also defined as an export. */
|
||||||
if (O65GetExport (O65FmtDesc, Sym->Name) != 0) {
|
if (O65GetExport (O65FmtDesc, Sym->Name) != 0) {
|
||||||
CfgError (
|
PError (
|
||||||
GetSourcePos (Sym->LI),
|
GetSourcePos (Sym->LI),
|
||||||
"Imported o65 symbol `%s' cannot also be an o65 export",
|
"Imported o65 symbol `%s' cannot also be an o65 export",
|
||||||
GetString (Sym->Name)
|
GetString (Sym->Name)
|
||||||
@@ -1802,7 +1802,7 @@ static void ProcessSymbols (void)
|
|||||||
** error message when checking it here.
|
** error message when checking it here.
|
||||||
*/
|
*/
|
||||||
if (O65GetImport (O65FmtDesc, Sym->Name) != 0) {
|
if (O65GetImport (O65FmtDesc, Sym->Name) != 0) {
|
||||||
CfgError (
|
PError (
|
||||||
GetSourcePos (Sym->LI),
|
GetSourcePos (Sym->LI),
|
||||||
"Duplicate imported o65 symbol: `%s'",
|
"Duplicate imported o65 symbol: `%s'",
|
||||||
GetString (Sym->Name)
|
GetString (Sym->Name)
|
||||||
@@ -1913,7 +1913,7 @@ unsigned CfgProcess (void)
|
|||||||
** and mark the memory area as placed.
|
** and mark the memory area as placed.
|
||||||
*/
|
*/
|
||||||
if (!IsConstExpr (M->StartExpr)) {
|
if (!IsConstExpr (M->StartExpr)) {
|
||||||
CfgError (GetSourcePos (M->LI),
|
PError (GetSourcePos (M->LI),
|
||||||
"Start address of memory area `%s' is not constant",
|
"Start address of memory area `%s' is not constant",
|
||||||
GetString (M->Name));
|
GetString (M->Name));
|
||||||
}
|
}
|
||||||
@@ -1938,13 +1938,13 @@ unsigned CfgProcess (void)
|
|||||||
|
|
||||||
/* Resolve the size expression */
|
/* Resolve the size expression */
|
||||||
if (!IsConstExpr (M->SizeExpr)) {
|
if (!IsConstExpr (M->SizeExpr)) {
|
||||||
CfgError (GetSourcePos (M->LI),
|
PError (GetSourcePos (M->LI),
|
||||||
"Size of memory area `%s' is not constant",
|
"Size of memory area `%s' is not constant",
|
||||||
GetString (M->Name));
|
GetString (M->Name));
|
||||||
}
|
}
|
||||||
M->Size = GetExprVal (M->SizeExpr);
|
M->Size = GetExprVal (M->SizeExpr);
|
||||||
if (M->Size >= 0x80000000) {
|
if (M->Size >= 0x80000000) {
|
||||||
CfgError (GetSourcePos (M->LI),
|
PError (GetSourcePos (M->LI),
|
||||||
"Size of memory area `%s' is negative: %ld",
|
"Size of memory area `%s' is negative: %ld",
|
||||||
GetString (M->Name), (long)M->Size);
|
GetString (M->Name), (long)M->Size);
|
||||||
}
|
}
|
||||||
@@ -1968,14 +1968,14 @@ unsigned CfgProcess (void)
|
|||||||
if (S->Flags & (SF_OFFSET | SF_START)) {
|
if (S->Flags & (SF_OFFSET | SF_START)) {
|
||||||
++Overwrites;
|
++Overwrites;
|
||||||
} else {
|
} else {
|
||||||
CfgError (GetSourcePos (M->LI),
|
PError (GetSourcePos (M->LI),
|
||||||
"Segment `%s' of type `overwrite' requires either"
|
"Segment `%s' of type `overwrite' requires either"
|
||||||
" `START' or `OFFSET' attribute to be specified",
|
" `START' or `OFFSET' attribute to be specified",
|
||||||
GetString (S->Name));
|
GetString (S->Name));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (Overwrites > 0) {
|
if (Overwrites > 0) {
|
||||||
CfgError (GetSourcePos (M->LI),
|
PError (GetSourcePos (M->LI),
|
||||||
"Segment `%s' is preceded by at least one segment"
|
"Segment `%s' is preceded by at least one segment"
|
||||||
" of type `overwrite'",
|
" of type `overwrite'",
|
||||||
GetString (S->Name));
|
GetString (S->Name));
|
||||||
@@ -2002,7 +2002,7 @@ unsigned CfgProcess (void)
|
|||||||
/* Segment requires another alignment than configured
|
/* Segment requires another alignment than configured
|
||||||
** in the linker.
|
** in the linker.
|
||||||
*/
|
*/
|
||||||
CfgWarning (GetSourcePos (S->LI),
|
PWarning (GetSourcePos (S->LI),
|
||||||
"Segment `%s' isn't aligned properly; the"
|
"Segment `%s' isn't aligned properly; the"
|
||||||
" resulting executable might not be functional.",
|
" resulting executable might not be functional.",
|
||||||
GetString (S->Name));
|
GetString (S->Name));
|
||||||
@@ -2017,7 +2017,7 @@ unsigned CfgProcess (void)
|
|||||||
** that is somewhat suspicious.
|
** that is somewhat suspicious.
|
||||||
*/
|
*/
|
||||||
if (M->FillLevel == 0 && NewAddr > Addr) {
|
if (M->FillLevel == 0 && NewAddr > Addr) {
|
||||||
CfgWarning (GetSourcePos (S->LI),
|
PWarning (GetSourcePos (S->LI),
|
||||||
"The first segment in memory area `%s' "
|
"The first segment in memory area `%s' "
|
||||||
"needs fill bytes for alignment.",
|
"needs fill bytes for alignment.",
|
||||||
GetString (M->Name));
|
GetString (M->Name));
|
||||||
@@ -2038,7 +2038,7 @@ unsigned CfgProcess (void)
|
|||||||
|
|
||||||
if (S->Flags & SF_OVERWRITE) {
|
if (S->Flags & SF_OVERWRITE) {
|
||||||
if (NewAddr < M->Start) {
|
if (NewAddr < M->Start) {
|
||||||
CfgError (GetSourcePos (S->LI),
|
PError (GetSourcePos (S->LI),
|
||||||
"Segment `%s' begins before memory area `%s'",
|
"Segment `%s' begins before memory area `%s'",
|
||||||
GetString (S->Name), GetString (M->Name));
|
GetString (S->Name), GetString (M->Name));
|
||||||
} else {
|
} else {
|
||||||
@@ -2049,12 +2049,12 @@ unsigned CfgProcess (void)
|
|||||||
/* Offset already too large */
|
/* Offset already too large */
|
||||||
++Overflows;
|
++Overflows;
|
||||||
if (S->Flags & SF_OFFSET) {
|
if (S->Flags & SF_OFFSET) {
|
||||||
CfgWarning (GetSourcePos (S->LI),
|
PWarning (GetSourcePos (S->LI),
|
||||||
"Segment `%s' offset is too small in `%s' by %lu byte%s",
|
"Segment `%s' offset is too small in `%s' by %lu byte%s",
|
||||||
GetString (S->Name), GetString (M->Name),
|
GetString (S->Name), GetString (M->Name),
|
||||||
Addr - NewAddr, (Addr - NewAddr == 1) ? "" : "s");
|
Addr - NewAddr, (Addr - NewAddr == 1) ? "" : "s");
|
||||||
} else {
|
} else {
|
||||||
CfgWarning (GetSourcePos (S->LI),
|
PWarning (GetSourcePos (S->LI),
|
||||||
"Segment `%s' start address is too low in `%s' by %lu byte%s",
|
"Segment `%s' start address is too low in `%s' by %lu byte%s",
|
||||||
GetString (S->Name), GetString (M->Name),
|
GetString (S->Name), GetString (M->Name),
|
||||||
Addr - NewAddr, (Addr - NewAddr == 1) ? "" : "s");
|
Addr - NewAddr, (Addr - NewAddr == 1) ? "" : "s");
|
||||||
@@ -2101,7 +2101,7 @@ unsigned CfgProcess (void)
|
|||||||
if (FillLevel > M->Size && (M->Flags & MF_OVERFLOW) == 0) {
|
if (FillLevel > M->Size && (M->Flags & MF_OVERFLOW) == 0) {
|
||||||
++Overflows;
|
++Overflows;
|
||||||
M->Flags |= MF_OVERFLOW;
|
M->Flags |= MF_OVERFLOW;
|
||||||
CfgWarning (GetSourcePos (M->LI),
|
PWarning (GetSourcePos (M->LI),
|
||||||
"Segment `%s' overflows memory area `%s' by %lu byte%s",
|
"Segment `%s' overflows memory area `%s' by %lu byte%s",
|
||||||
GetString (S->Name), GetString (M->Name),
|
GetString (S->Name), GetString (M->Name),
|
||||||
FillLevel - M->Size, (FillLevel - M->Size == 1) ? "" : "s");
|
FillLevel - M->Size, (FillLevel - M->Size == 1) ? "" : "s");
|
||||||
|
|||||||
@@ -348,7 +348,7 @@ void AddCfgNote (const FilePos* Pos, const char* Format, ...)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
void CfgWarning (const FilePos* Pos, const char* Format, ...)
|
void PWarning (const FilePos* Pos, const char* Format, ...)
|
||||||
/* Print a warning message adding file name and line number of a given file */
|
/* Print a warning message adding file name and line number of a given file */
|
||||||
{
|
{
|
||||||
/* Output the message */
|
/* Output the message */
|
||||||
@@ -366,7 +366,7 @@ void CfgWarning (const FilePos* Pos, const char* Format, ...)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
void CfgError (const FilePos* Pos, const char* Format, ...)
|
void PError (const FilePos* Pos, const char* Format, ...)
|
||||||
/* Print an error message adding file name and line number of a given file */
|
/* Print an error message adding file name and line number of a given file */
|
||||||
{
|
{
|
||||||
/* Output the message */
|
/* Output the message */
|
||||||
|
|||||||
@@ -81,10 +81,10 @@ void AddCfgNote (const FilePos* Pos, const char* Format, ...) attribute((format(
|
|||||||
** See comment for AddNote() above.
|
** See comment for AddNote() above.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void CfgWarning (const FilePos* Pos, const char* Format, ...) attribute((format(printf,2,3)));
|
void PWarning (const FilePos* Pos, const char* Format, ...) attribute((format(printf,2,3)));
|
||||||
/* Print a warning message adding file name and line number of the config file */
|
/* Print a warning message adding file name and line number of the config file */
|
||||||
|
|
||||||
void CfgError (const FilePos* Pos, const char* Format, ...) attribute((format(printf,2,3)));
|
void PError (const FilePos* Pos, const char* Format, ...) attribute((format(printf,2,3)));
|
||||||
/* Print an error message adding file name and line number of a given file */
|
/* Print an error message adding file name and line number of a given file */
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -786,7 +786,7 @@ static void PrintUnresolved (ExpCheckFunc F, void* Data)
|
|||||||
} else {
|
} else {
|
||||||
for (J = 0; J < Count; ++J) {
|
for (J = 0; J < Count; ++J) {
|
||||||
const LineInfo* LI = CollConstAt (&Imp->RefLines, J);
|
const LineInfo* LI = CollConstAt (&Imp->RefLines, J);
|
||||||
CfgWarning (GetSourcePos (LI),
|
PWarning (GetSourcePos (LI),
|
||||||
"Unresolved external `%s'",
|
"Unresolved external `%s'",
|
||||||
Name);
|
Name);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ static void StrVal (void)
|
|||||||
|
|
||||||
case EOF:
|
case EOF:
|
||||||
case '\n':
|
case '\n':
|
||||||
CfgError (&CfgErrorPos, "Unterminated string");
|
PError (&CfgErrorPos, "Unterminated string");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '%':
|
case '%':
|
||||||
@@ -137,7 +137,7 @@ static void StrVal (void)
|
|||||||
case EOF:
|
case EOF:
|
||||||
case '\n':
|
case '\n':
|
||||||
case '\"':
|
case '\"':
|
||||||
CfgError (&CfgErrorPos, "Unterminated `%%' escape sequence");
|
PError (&CfgErrorPos, "Unterminated `%%' escape sequence");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '%':
|
case '%':
|
||||||
@@ -155,7 +155,7 @@ static void StrVal (void)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
CfgWarning (&CfgErrorPos,
|
PWarning (&CfgErrorPos,
|
||||||
"Unknown escape sequence `%%%c'", C);
|
"Unknown escape sequence `%%%c'", C);
|
||||||
SB_AppendChar (&CfgSVal, '%');
|
SB_AppendChar (&CfgSVal, '%');
|
||||||
SB_AppendChar (&CfgSVal, C);
|
SB_AppendChar (&CfgSVal, C);
|
||||||
@@ -212,7 +212,7 @@ Again:
|
|||||||
if (C == '$') {
|
if (C == '$') {
|
||||||
NextChar ();
|
NextChar ();
|
||||||
if (!isxdigit (C)) {
|
if (!isxdigit (C)) {
|
||||||
CfgError (&CfgErrorPos, "Hex digit expected");
|
PError (&CfgErrorPos, "Hex digit expected");
|
||||||
}
|
}
|
||||||
CfgIVal = 0;
|
CfgIVal = 0;
|
||||||
while (isxdigit (C)) {
|
while (isxdigit (C)) {
|
||||||
@@ -340,7 +340,7 @@ Again:
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
CfgError (&CfgErrorPos, "Invalid format specification");
|
PError (&CfgErrorPos, "Invalid format specification");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -349,7 +349,7 @@ Again:
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
CfgError (&CfgErrorPos, "Invalid character `%c'", C);
|
PError (&CfgErrorPos, "Invalid character `%c'", C);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -360,7 +360,7 @@ void CfgConsume (cfgtok_t T, const char* Msg)
|
|||||||
/* Skip a token, print an error message if not found */
|
/* Skip a token, print an error message if not found */
|
||||||
{
|
{
|
||||||
if (CfgTok != T) {
|
if (CfgTok != T) {
|
||||||
CfgError (&CfgErrorPos, "%s", Msg);
|
PError (&CfgErrorPos, "%s", Msg);
|
||||||
}
|
}
|
||||||
CfgNextTok ();
|
CfgNextTok ();
|
||||||
}
|
}
|
||||||
@@ -407,7 +407,7 @@ void CfgAssureInt (void)
|
|||||||
/* Make sure the next token is an integer */
|
/* Make sure the next token is an integer */
|
||||||
{
|
{
|
||||||
if (CfgTok != CFGTOK_INTCON) {
|
if (CfgTok != CFGTOK_INTCON) {
|
||||||
CfgError (&CfgErrorPos, "Integer constant expected");
|
PError (&CfgErrorPos, "Integer constant expected");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -417,7 +417,7 @@ void CfgAssureStr (void)
|
|||||||
/* Make sure the next token is a string constant */
|
/* Make sure the next token is a string constant */
|
||||||
{
|
{
|
||||||
if (CfgTok != CFGTOK_STRCON) {
|
if (CfgTok != CFGTOK_STRCON) {
|
||||||
CfgError (&CfgErrorPos, "String constant expected");
|
PError (&CfgErrorPos, "String constant expected");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -427,7 +427,7 @@ void CfgAssureIdent (void)
|
|||||||
/* Make sure the next token is an identifier */
|
/* Make sure the next token is an identifier */
|
||||||
{
|
{
|
||||||
if (CfgTok != CFGTOK_IDENT) {
|
if (CfgTok != CFGTOK_IDENT) {
|
||||||
CfgError (&CfgErrorPos, "Identifier expected");
|
PError (&CfgErrorPos, "Identifier expected");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -437,7 +437,7 @@ void CfgRangeCheck (unsigned long Lo, unsigned long Hi)
|
|||||||
/* Check the range of CfgIVal */
|
/* Check the range of CfgIVal */
|
||||||
{
|
{
|
||||||
if (CfgIVal < Lo || CfgIVal > Hi) {
|
if (CfgIVal < Lo || CfgIVal > Hi) {
|
||||||
CfgError (&CfgErrorPos, "Range error");
|
PError (&CfgErrorPos, "Range error");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -462,12 +462,12 @@ void CfgSpecialToken (const IdentTok* Table, unsigned Size, const char* Name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Not found */
|
/* Not found */
|
||||||
CfgError (&CfgErrorPos, "%s expected, got `%s'", Name, SB_GetConstBuf(&CfgSVal));
|
PError (&CfgErrorPos, "%s expected, got `%s'", Name, SB_GetConstBuf(&CfgSVal));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* No identifier */
|
/* No identifier */
|
||||||
CfgError (&CfgErrorPos, "%s expected", Name);
|
PError (&CfgErrorPos, "%s expected", Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -488,7 +488,7 @@ void CfgBoolToken (void)
|
|||||||
} else {
|
} else {
|
||||||
/* We expected an integer here */
|
/* We expected an integer here */
|
||||||
if (CfgTok != CFGTOK_INTCON) {
|
if (CfgTok != CFGTOK_INTCON) {
|
||||||
CfgError (&CfgErrorPos, "Boolean value expected");
|
PError (&CfgErrorPos, "Boolean value expected");
|
||||||
}
|
}
|
||||||
CfgTok = (CfgIVal == 0)? CFGTOK_FALSE : CFGTOK_TRUE;
|
CfgTok = (CfgIVal == 0)? CFGTOK_FALSE : CFGTOK_TRUE;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user