Changed data type used to store line numbers from unsigned long to unsigned.

git-svn-id: svn://svn.cc65.org/cc65/trunk@5222 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz
2011-08-19 10:44:45 +00:00
parent 5f0e6dd7e9
commit 68db31c53b
7 changed files with 23 additions and 23 deletions

View File

@@ -110,7 +110,7 @@ void CheckAssertions (void)
const LineInfo* LI; const LineInfo* LI;
const char* Module; const char* Module;
unsigned long Line; unsigned Line;
/* Get the assertion */ /* Get the assertion */
Assertion* A = CollAtUnchecked (&Assertions, I); Assertion* A = CollAtUnchecked (&Assertions, I);
@@ -129,7 +129,7 @@ void CheckAssertions (void)
/* If the expression is not constant, we're not able to handle it */ /* If the expression is not constant, we're not able to handle it */
if (!IsConstExpr (A->Expr)) { if (!IsConstExpr (A->Expr)) {
Warning ("Cannot evaluate assertion in module `%s', line %lu", Warning ("Cannot evaluate assertion in module `%s', line %u",
Module, Line); Module, Line);
} else if (GetExprVal (A->Expr) == 0) { } else if (GetExprVal (A->Expr) == 0) {
@@ -140,17 +140,17 @@ void CheckAssertions (void)
case ASSERT_ACT_WARN: case ASSERT_ACT_WARN:
case ASSERT_ACT_LDWARN: case ASSERT_ACT_LDWARN:
Warning ("%s(%lu): %s", Module, Line, Message); Warning ("%s(%u): %s", Module, Line, Message);
break; break;
case ASSERT_ACT_ERROR: case ASSERT_ACT_ERROR:
case ASSERT_ACT_LDERROR: case ASSERT_ACT_LDERROR:
Error ("%s(%lu): %s", Module, Line, Message); Error ("%s(%u): %s", Module, Line, Message);
break; break;
default: default:
Internal ("Invalid assertion action (%u) in module `%s', " Internal ("Invalid assertion action (%u) in module `%s', "
"line %lu (file corrupt?)", "line %u (file corrupt?)",
A->Action, Module, Line); A->Action, Module, Line);
break; break;
} }

View File

@@ -166,7 +166,7 @@ Import* ReadImport (FILE* F, ObjData* Obj)
*/ */
if (ObjHasFiles (I->Obj)) { if (ObjHasFiles (I->Obj)) {
const LineInfo* LI = GetImportPos (I); const LineInfo* LI = GetImportPos (I);
Error ("Invalid import size in for `%s', imported from %s(%lu): 0x%02X", Error ("Invalid import size in for `%s', imported from %s(%u): 0x%02X",
GetString (I->Name), GetString (I->Name),
GetSourceName (LI), GetSourceName (LI),
GetSourceLine (LI), GetSourceLine (LI),
@@ -202,7 +202,7 @@ Import* GenImport (unsigned Name, unsigned char AddrSize)
*/ */
if (ObjHasFiles (I->Obj)) { if (ObjHasFiles (I->Obj)) {
const LineInfo* LI = GetImportPos (I); const LineInfo* LI = GetImportPos (I);
Error ("Invalid import size in for `%s', imported from %s(%lu): 0x%02X", Error ("Invalid import size in for `%s', imported from %s(%u): 0x%02X",
GetString (I->Name), GetString (I->Name),
GetSourceName (LI), GetSourceName (LI),
GetSourceLine (LI), GetSourceLine (LI),
@@ -674,23 +674,23 @@ static void CheckSymType (const Export* E)
*/ */
if (E->Obj) { if (E->Obj) {
/* The export comes from an object file */ /* The export comes from an object file */
SB_Printf (&ExportLoc, "%s, %s(%lu)", SB_Printf (&ExportLoc, "%s, %s(%u)",
GetString (E->Obj->Name), GetString (E->Obj->Name),
GetSourceName (ExportLI), GetSourceName (ExportLI),
GetSourceLine (ExportLI)); GetSourceLine (ExportLI));
} else { } else {
SB_Printf (&ExportLoc, "%s(%lu)", SB_Printf (&ExportLoc, "%s(%u)",
GetSourceName (ExportLI), GetSourceName (ExportLI),
GetSourceLine (ExportLI)); GetSourceLine (ExportLI));
} }
if (I->Obj) { if (I->Obj) {
/* The import comes from an object file */ /* The import comes from an object file */
SB_Printf (&ImportLoc, "%s, %s(%lu)", SB_Printf (&ImportLoc, "%s, %s(%u)",
GetString (I->Obj->Name), GetString (I->Obj->Name),
GetSourceName (ImportLI), GetSourceName (ImportLI),
GetSourceLine (ImportLI)); GetSourceLine (ImportLI));
} else { } else {
SB_Printf (&ImportLoc, "%s(%lu)", SB_Printf (&ImportLoc, "%s(%u)",
GetSourceName (ImportLI), GetSourceName (ImportLI),
GetSourceLine (ImportLI)); GetSourceLine (ImportLI));
} }
@@ -753,7 +753,7 @@ static void PrintUnresolved (ExpCheckFunc F, void* Data)
for (J = 0; J < CollCount (&Imp->RefLines); ++J) { for (J = 0; J < CollCount (&Imp->RefLines); ++J) {
const LineInfo* LI = CollConstAt (&Imp->RefLines, J); const LineInfo* LI = CollConstAt (&Imp->RefLines, J);
fprintf (stderr, fprintf (stderr,
" %s(%lu)\n", " %s(%u)\n",
GetSourceName (LI), GetSourceName (LI),
GetSourceLine (LI)); GetSourceLine (LI));
} }
@@ -908,7 +908,7 @@ void PrintImportMap (FILE* F)
/* Print the import */ /* Print the import */
const LineInfo* LI = GetImportPos (Imp); const LineInfo* LI = GetImportPos (Imp);
fprintf (F, fprintf (F,
" %-25s %s(%lu)\n", " %-25s %s(%u)\n",
GetObjFileName (Imp->Obj), GetObjFileName (Imp->Obj),
GetSourceName (LI), GetSourceName (LI),
GetSourceLine (LI)); GetSourceLine (LI));
@@ -965,7 +965,7 @@ void CircularRefError (const Export* E)
/* Print an error about a circular reference using to define the given export */ /* Print an error about a circular reference using to define the given export */
{ {
const LineInfo* LI = GetExportPos (E); const LineInfo* LI = GetExportPos (E);
Error ("Circular reference for symbol `%s', %s(%lu)", Error ("Circular reference for symbol `%s', %s(%u)",
GetString (E->Name), GetString (E->Name),
GetSourceName (LI), GetSourceName (LI),
GetSourceLine (LI)); GetSourceLine (LI));

View File

@@ -98,9 +98,9 @@ INLINE const char* GetFragmentSourceName (const Fragment* F)
#endif #endif
#if defined(HAVE_INLINE) #if defined(HAVE_INLINE)
INLINE unsigned long GetFragmentSourceLine (const Fragment* F) INLINE unsigned GetFragmentSourceLine (const Fragment* F)
/* Return the source file line for this fragment */ /* Return the source file line for this fragment */
{ {
return GetSourceLineFromList (&F->LineInfos); return GetSourceLineFromList (&F->LineInfos);
} }
#else #else

View File

@@ -229,7 +229,7 @@ void PrintDbgLineInfo (FILE* F)
/* Print the start of the line */ /* Print the start of the line */
fprintf (F, fprintf (F,
"line\tid=%u,file=%u,line=%lu", "line\tid=%u,file=%u,line=%u",
LI->Id, LI->File->Id, GetSourceLine (LI)); LI->Id, LI->File->Id, GetSourceLine (LI));
/* Print type if not LI_TYPE_ASM and count if not zero */ /* Print type if not LI_TYPE_ASM and count if not zero */

View File

@@ -128,7 +128,7 @@ INLINE const char* GetSourceName (const LineInfo* LI)
#endif #endif
#if defined(HAVE_INLINE) #if defined(HAVE_INLINE)
INLINE unsigned long GetSourceLine (const LineInfo* LI) INLINE unsigned GetSourceLine (const LineInfo* LI)
/* Return the source file line from the given line info */ /* Return the source file line from the given line info */
{ {
return LI->Pos.Line; return LI->Pos.Line;
@@ -160,7 +160,7 @@ INLINE const char* GetSourceNameFromList (const Collection* LineInfos)
#endif #endif
#if defined(HAVE_INLINE) #if defined(HAVE_INLINE)
INLINE unsigned long GetSourceLineFromList (const Collection* LineInfos) INLINE unsigned GetSourceLineFromList (const Collection* LineInfos)
/* Return the source file line from a list of line infos */ /* Return the source file line from a list of line infos */
{ {
/* The relevant entry is in slot zero */ /* The relevant entry is in slot zero */

View File

@@ -17,7 +17,7 @@ LD65_CFG = \"/usr/lib/cc65/cfg/\"
# #
CC = gcc CC = gcc
CFLAGS = -g -O2 -Wall -W -std=c89 CFLAGS = -g -Wall -W -std=c89
override CFLAGS += -I$(COMMON) override CFLAGS += -I$(COMMON)
override CFLAGS += -DLD65_LIB=$(LD65_LIB) -DLD65_OBJ=$(LD65_OBJ) -DLD65_CFG=$(LD65_CFG) override CFLAGS += -DLD65_LIB=$(LD65_LIB) -DLD65_OBJ=$(LD65_OBJ) -DLD65_CFG=$(LD65_CFG)
EBIND = emxbind EBIND = emxbind

View File

@@ -492,19 +492,19 @@ void SegWrite (const char* TgtName, FILE* Tgt, Segment* S, SegWriteFunc F, void*
break; break;
case SEG_EXPR_RANGE_ERROR: case SEG_EXPR_RANGE_ERROR:
Error ("Range error in module `%s', line %lu", Error ("Range error in module `%s', line %u",
GetFragmentSourceName (Frag), GetFragmentSourceName (Frag),
GetFragmentSourceLine (Frag)); GetFragmentSourceLine (Frag));
break; break;
case SEG_EXPR_TOO_COMPLEX: case SEG_EXPR_TOO_COMPLEX:
Error ("Expression too complex in module `%s', line %lu", Error ("Expression too complex in module `%s', line %u",
GetFragmentSourceName (Frag), GetFragmentSourceName (Frag),
GetFragmentSourceLine (Frag)); GetFragmentSourceLine (Frag));
break; break;
case SEG_EXPR_INVALID: case SEG_EXPR_INVALID:
Error ("Invalid expression in module `%s', line %lu", Error ("Invalid expression in module `%s', line %u",
GetFragmentSourceName (Frag), GetFragmentSourceName (Frag),
GetFragmentSourceLine (Frag)); GetFragmentSourceLine (Frag));
break; break;