From 68db31c53b10226c65ce3fb6826250c2a6c47f9b Mon Sep 17 00:00:00 2001 From: uz Date: Fri, 19 Aug 2011 10:44:45 +0000 Subject: [PATCH] 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 --- src/ld65/asserts.c | 10 +++++----- src/ld65/exports.c | 18 +++++++++--------- src/ld65/fragment.h | 4 ++-- src/ld65/lineinfo.c | 2 +- src/ld65/lineinfo.h | 4 ++-- src/ld65/make/gcc.mak | 2 +- src/ld65/segments.c | 6 +++--- 7 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/ld65/asserts.c b/src/ld65/asserts.c index f0aafdb28..650fd0745 100644 --- a/src/ld65/asserts.c +++ b/src/ld65/asserts.c @@ -110,7 +110,7 @@ void CheckAssertions (void) const LineInfo* LI; const char* Module; - unsigned long Line; + unsigned Line; /* Get the assertion */ 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 (!IsConstExpr (A->Expr)) { - Warning ("Cannot evaluate assertion in module `%s', line %lu", + Warning ("Cannot evaluate assertion in module `%s', line %u", Module, Line); } else if (GetExprVal (A->Expr) == 0) { @@ -140,17 +140,17 @@ void CheckAssertions (void) case ASSERT_ACT_WARN: case ASSERT_ACT_LDWARN: - Warning ("%s(%lu): %s", Module, Line, Message); + Warning ("%s(%u): %s", Module, Line, Message); break; case ASSERT_ACT_ERROR: case ASSERT_ACT_LDERROR: - Error ("%s(%lu): %s", Module, Line, Message); + Error ("%s(%u): %s", Module, Line, Message); break; default: Internal ("Invalid assertion action (%u) in module `%s', " - "line %lu (file corrupt?)", + "line %u (file corrupt?)", A->Action, Module, Line); break; } diff --git a/src/ld65/exports.c b/src/ld65/exports.c index 34f4f53e7..fe95721f5 100644 --- a/src/ld65/exports.c +++ b/src/ld65/exports.c @@ -166,7 +166,7 @@ Import* ReadImport (FILE* F, ObjData* Obj) */ if (ObjHasFiles (I->Obj)) { 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), GetSourceName (LI), GetSourceLine (LI), @@ -202,7 +202,7 @@ Import* GenImport (unsigned Name, unsigned char AddrSize) */ if (ObjHasFiles (I->Obj)) { 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), GetSourceName (LI), GetSourceLine (LI), @@ -674,23 +674,23 @@ static void CheckSymType (const Export* E) */ if (E->Obj) { /* The export comes from an object file */ - SB_Printf (&ExportLoc, "%s, %s(%lu)", + SB_Printf (&ExportLoc, "%s, %s(%u)", GetString (E->Obj->Name), GetSourceName (ExportLI), GetSourceLine (ExportLI)); } else { - SB_Printf (&ExportLoc, "%s(%lu)", + SB_Printf (&ExportLoc, "%s(%u)", GetSourceName (ExportLI), GetSourceLine (ExportLI)); } if (I->Obj) { /* The import comes from an object file */ - SB_Printf (&ImportLoc, "%s, %s(%lu)", + SB_Printf (&ImportLoc, "%s, %s(%u)", GetString (I->Obj->Name), GetSourceName (ImportLI), GetSourceLine (ImportLI)); } else { - SB_Printf (&ImportLoc, "%s(%lu)", + SB_Printf (&ImportLoc, "%s(%u)", GetSourceName (ImportLI), GetSourceLine (ImportLI)); } @@ -753,7 +753,7 @@ static void PrintUnresolved (ExpCheckFunc F, void* Data) for (J = 0; J < CollCount (&Imp->RefLines); ++J) { const LineInfo* LI = CollConstAt (&Imp->RefLines, J); fprintf (stderr, - " %s(%lu)\n", + " %s(%u)\n", GetSourceName (LI), GetSourceLine (LI)); } @@ -908,7 +908,7 @@ void PrintImportMap (FILE* F) /* Print the import */ const LineInfo* LI = GetImportPos (Imp); fprintf (F, - " %-25s %s(%lu)\n", + " %-25s %s(%u)\n", GetObjFileName (Imp->Obj), GetSourceName (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 */ { const LineInfo* LI = GetExportPos (E); - Error ("Circular reference for symbol `%s', %s(%lu)", + Error ("Circular reference for symbol `%s', %s(%u)", GetString (E->Name), GetSourceName (LI), GetSourceLine (LI)); diff --git a/src/ld65/fragment.h b/src/ld65/fragment.h index 78b8b2d94..a94aad2c2 100644 --- a/src/ld65/fragment.h +++ b/src/ld65/fragment.h @@ -98,9 +98,9 @@ INLINE const char* GetFragmentSourceName (const Fragment* F) #endif #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 GetSourceLineFromList (&F->LineInfos); } #else diff --git a/src/ld65/lineinfo.c b/src/ld65/lineinfo.c index aa5d99741..1e60d8162 100644 --- a/src/ld65/lineinfo.c +++ b/src/ld65/lineinfo.c @@ -229,7 +229,7 @@ void PrintDbgLineInfo (FILE* F) /* Print the start of the line */ fprintf (F, - "line\tid=%u,file=%u,line=%lu", + "line\tid=%u,file=%u,line=%u", LI->Id, LI->File->Id, GetSourceLine (LI)); /* Print type if not LI_TYPE_ASM and count if not zero */ diff --git a/src/ld65/lineinfo.h b/src/ld65/lineinfo.h index 6a04a4a37..2f123ae0d 100644 --- a/src/ld65/lineinfo.h +++ b/src/ld65/lineinfo.h @@ -128,7 +128,7 @@ INLINE const char* GetSourceName (const LineInfo* LI) #endif #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 LI->Pos.Line; @@ -160,7 +160,7 @@ INLINE const char* GetSourceNameFromList (const Collection* LineInfos) #endif #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 */ { /* The relevant entry is in slot zero */ diff --git a/src/ld65/make/gcc.mak b/src/ld65/make/gcc.mak index 9e071f685..ea5df8b4d 100644 --- a/src/ld65/make/gcc.mak +++ b/src/ld65/make/gcc.mak @@ -17,7 +17,7 @@ LD65_CFG = \"/usr/lib/cc65/cfg/\" # CC = gcc -CFLAGS = -g -O2 -Wall -W -std=c89 +CFLAGS = -g -Wall -W -std=c89 override CFLAGS += -I$(COMMON) override CFLAGS += -DLD65_LIB=$(LD65_LIB) -DLD65_OBJ=$(LD65_OBJ) -DLD65_CFG=$(LD65_CFG) EBIND = emxbind diff --git a/src/ld65/segments.c b/src/ld65/segments.c index 84c80d085..ca563606e 100644 --- a/src/ld65/segments.c +++ b/src/ld65/segments.c @@ -492,19 +492,19 @@ void SegWrite (const char* TgtName, FILE* Tgt, Segment* S, SegWriteFunc F, void* break; case SEG_EXPR_RANGE_ERROR: - Error ("Range error in module `%s', line %lu", + Error ("Range error in module `%s', line %u", GetFragmentSourceName (Frag), GetFragmentSourceLine (Frag)); break; 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), GetFragmentSourceLine (Frag)); break; case SEG_EXPR_INVALID: - Error ("Invalid expression in module `%s', line %lu", + Error ("Invalid expression in module `%s', line %u", GetFragmentSourceName (Frag), GetFragmentSourceLine (Frag)); break; -- 2.39.5