ソースを参照

Fix format string mismatches.

git-svn-id: file:///var/svn/tigccpp/trunk/tigcc/ld-tigcc@167 9552661e-59e3-4036-b4f2-dbe53926924f
kevinkofler 19 年 前
コミット
aa68907768
4 ファイル変更19 行追加18 行削除
  1. 4 3
      ar/import/imp_amig.c
  2. 4 4
      bincode/cutrange.c
  3. 3 3
      import/imp_amig.c
  4. 8 8
      insert/comprrlc.c

+ 4 - 3
ar/import/imp_amig.c

@@ -1,6 +1,7 @@
 /* imp_amiga.c: Routines to import an AmigaOS-hunks file
 
-   Copyright (C) 2003 Kevin Kofler and Sebastian Reichelt
+   Copyright (C) 2003-2005 Kevin Kofler
+   Copyright (C) 2003 Sebastian Reichelt
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -140,7 +141,7 @@ BOOLEAN ArImportAmigaOSFile (OBJECT_FILE *ObjectFile)
 								break;
 
 							default:
-								FailWithError("Unsupported AmigaOS symbol type `0x%lX'.",hunkType);
+								FailWithError("Unsupported AmigaOS symbol type `0x%lX'.",(unsigned long)hunkType);
 								break;
 						}
 					}
@@ -161,7 +162,7 @@ BOOLEAN ArImportAmigaOSFile (OBJECT_FILE *ObjectFile)
 				break;
 
 			default:
-				FailWithError("Unsupported AmigaOS hunk type `0x%lX'.",hunkType);
+				FailWithError("Unsupported AmigaOS hunk type `0x%lX'.",(unsigned long)hunkType);
 				break;
 		}
 	}

+ 4 - 4
bincode/cutrange.c

@@ -1,6 +1,6 @@
 /* fix_cutr.c: Routines for range cutting
 
-   Copyright (C) 2003 Kevin Kofler
+   Copyright (C) 2003-2005 Kevin Kofler
    Portions taken from manip.c, Copyright (C) 2002-2003 Sebastian Reichelt
 
    This program is free software; you can redistribute it and/or modify
@@ -64,7 +64,7 @@ static void AdjustLocationForRangeCut (RELOC *Reloc, LOCATION *Location, OFFSET
 		if ((TargetLocation > Start) && (TargetLocation < End))
 		{
 			Warning (GetFileName (Reloc->Parent, Reloc->Location), "Reloc at 0x%lX in section `%s' pointing to %s%+ld in a range which is being optimized away.",
-					 Reloc->Location, Reloc->Parent->SectionSymbol->Name, Location->Symbol->Name, Location->Offset);
+					 (unsigned long) Reloc->Location, Reloc->Parent->SectionSymbol->Name, Location->Symbol->Name, (long) Location->Offset);
 			// Set location value to Start.
 			Location->Offset = Start - SymbolLocation;
 		}
@@ -151,7 +151,7 @@ void CutRange (SECTION *Section, OFFSET Start, OFFSET End)
 			if (Symbol->Location < End)
 			{
 				Symbol->Location = Start;
-				Warning (GetFileName (Section, Symbol->Location), "Symbol `%s' at 0x%lX in section `%s' in a range which is being optimized away.", Symbol->Name, Symbol->Location, Section->SectionSymbol->Name);
+				Warning (GetFileName (Section, Symbol->Location), "Symbol `%s' at 0x%lX in section `%s' in a range which is being optimized away.", Symbol->Name, (unsigned long) Symbol->Location, Section->SectionSymbol->Name);
 			}
 			// If the position was behind the range, adjust it.
 			else
@@ -170,7 +170,7 @@ void CutRange (SECTION *Section, OFFSET Start, OFFSET End)
 		{ \
 			if (Item->Location < End) \
 			{ \
-				Warning (GetFileName (Item->Parent, Item->Location), "%s at 0x%lX in section `%s' in a range which is being optimized away.", ItemName, Item->Location, Section->SectionSymbol->Name); \
+				Warning (GetFileName (Item->Parent, Item->Location), "%s at 0x%lX in section `%s' in a range which is being optimized away.", ItemName, (unsigned long) Item->Location, Section->SectionSymbol->Name); \
 				if (Item->Location > Start) \
 					Item->Location = Start; \
 			} \

+ 3 - 3
import/imp_amig.c

@@ -1,6 +1,6 @@
 /* imp_amig.c: Routines to import an AmigaOS-hunks file
 
-   Copyright (C) 2002-2003 Kevin Kofler
+   Copyright (C) 2002-2005 Kevin Kofler
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -619,7 +619,7 @@ BOOLEAN ImportAmigaOSFile (PROGRAM *Program, const I1 *File, SIZE FileSize, cons
 
 						// Other symbol types are never used by A68k.
 						default:
-							FailWithError("Unsupported AmigaOS symbol type `0x%lX'.",hunkType);
+							FailWithError("Unsupported AmigaOS symbol type `0x%lX'.",(unsigned long)hunkType);
 							break;
 					}
 
@@ -685,7 +685,7 @@ BOOLEAN ImportAmigaOSFile (PROGRAM *Program, const I1 *File, SIZE FileSize, cons
 
 			// The other hunk types are not well-documented or not applicable here, and A68k never generates them anyway.
 			default:
-				FailWithError("Unsupported AmigaOS hunk type `0x%lX'.",hunkType);
+				FailWithError("Unsupported AmigaOS hunk type `0x%lX'.",(unsigned long)hunkType);
 				break;
 		}
 	}

+ 8 - 8
insert/comprrlc.c

@@ -167,7 +167,7 @@ static BOOLEAN EmitCompressedRelocFromActualOffset (SECTION *Section, OFFSET Off
 	{
 		Error (Section->FileName, (Offset >= 0) ? "Cannot emit overlapping absolute relocs (offset `0x%lx', need offset >=4)."
 		                                        : "Invalid internal reloc sorting order (offset `-0x%lx', need positive offset).",
-		       (Offset >= 0) ? Offset : -Offset);
+		       (Offset >= 0) ? (long)Offset : -(long)Offset);
 		return FALSE;
 	}
 	
@@ -198,19 +198,19 @@ static BOOLEAN EmitCompressedFormatRelocs (LIST_MODEL *Model, SECTION *SourceSec
 			
 			if (BaseAddress & 1)
 			{
-				Error (Section->FileName, "Invalid base address `0x%lx'. Even base address needed.", BaseAddress);
+				Error (Section->FileName, "Invalid base address `0x%lx'. Even base address needed.", (long) BaseAddress);
 				return FALSE;
 			}
 			
 			if (Offset & 1)
 			{
-				Error (Section->FileName, "Odd offset between base address `0x%lx' and first absolute reloc `0x%lx'. Even offset needed.", BaseAddress, Offset);
+				Error (Section->FileName, "Odd offset between base address `0x%lx' and first absolute reloc `0x%lx'. Even offset needed.", (long) BaseAddress, (long) Offset);
 				return FALSE;
 			}
 			
 			if (Offset < BaseAddress)
 			{
-				Error (Section->FileName, "Cannot emit absolute reloc located at `0x%lx' before base address.", Offset);
+				Error (Section->FileName, "Cannot emit absolute reloc located at `0x%lx' before base address.", (long) Offset);
 				return FALSE;
 			}
 			
@@ -954,7 +954,7 @@ static BOOLEAN EmitMlinkRelocFromActualOffset (SECTION *Section, OFFSET Offset)
 	if (Offset < 0)
 	{
 		Error (Section->FileName, "Invalid internal reloc sorting order (offset `-0x%lx', need positive offset).",
-		       -Offset);
+		       -(long)Offset);
 		return FALSE;
 	}
 	
@@ -985,19 +985,19 @@ static BOOLEAN EmitMlinkFormatRelocs (LIST_MODEL *Model, SECTION *SourceSection,
 			
 			if (BaseAddress & 1)
 			{
-				Error (Section->FileName, "Invalid base address `0x%lx'. Even base address needed.", BaseAddress);
+				Error (Section->FileName, "Invalid base address `0x%lx'. Even base address needed.", (long) BaseAddress);
 				return FALSE;
 			}
 			
 			if (Offset & 1)
 			{
-				Error (Section->FileName, "Odd offset between base address `0x%lx' and first absolute reloc `0x%lx'. Even offset needed.", BaseAddress, Offset);
+				Error (Section->FileName, "Odd offset between base address `0x%lx' and first absolute reloc `0x%lx'. Even offset needed.", (long) BaseAddress, (long) Offset);
 				return FALSE;
 			}
 			
 			if (Offset < BaseAddress)
 			{
-				Error (Section->FileName, "Cannot emit absolute reloc located at `0x%lx' before base address.", Offset);
+				Error (Section->FileName, "Cannot emit absolute reloc located at `0x%lx' before base address.", (long) Offset);
 				return FALSE;
 			}