Browse Source

Mark internal functions and variables (not declared in the corresponding header) static.

git-svn-id: file:///var/svn/tigccpp/trunk/tigcc/ld-tigcc@158 9552661e-59e3-4036-b4f2-dbe53926924f
kevinkofler 19 years ago
parent
commit
4bce27391c
9 changed files with 21 additions and 21 deletions
  1. 1 1
      bincode/cutrange.c
  2. 2 2
      bincode/fix_m68k.c
  3. 1 1
      dump.c
  4. 1 1
      export/exp_farg.c
  5. 2 2
      export/export.c
  6. 7 7
      insert/comprrlc.c
  7. 2 2
      insert/kernel.c
  8. 4 4
      manip.c
  9. 1 1
      special.c

+ 1 - 1
bincode/cutrange.c

@@ -48,7 +48,7 @@ BOOLEAN CanCutRange (SECTION *Section, OFFSET Start, OFFSET End)
 // specified range. The location needs to be adjusted if the range
 // is between the location's symbol and the place it actually points
 // to.
-void AdjustLocationForRangeCut (RELOC *Reloc, LOCATION *Location, OFFSET Start, OFFSET End)
+static void AdjustLocationForRangeCut (RELOC *Reloc, LOCATION *Location, OFFSET Start, OFFSET End)
 {
 	// Length of the range that has been cut.
 	OFFSET RangeLength = End - Start;

+ 2 - 2
bincode/fix_m68k.c

@@ -93,7 +93,7 @@ void M68kFixCodePreMerge (SECTION *Dest, SECTION *Src, SIZE DestSize)
 // to be at even addresses. It is also assumed that IsBinaryDataRange
 // has been called on the range (without an exception, or with an
 // exception that has since been removed).
-void M68kCutOrFillRange (SECTION *Section, OFFSET Start, OFFSET End, OPTIMIZE_INFO *OptimizeInfo)
+static void M68kCutOrFillRange (SECTION *Section, OFFSET Start, OFFSET End, OPTIMIZE_INFO *OptimizeInfo)
 {
 	if (End > Start)
 	{
@@ -746,7 +746,7 @@ OFFSET M68kFixTargetOffset (OFFSET Offset, SIZE RelocSize, BOOLEAN RelocRelative
 #define SHORT_IMPORTANCE 2048
 
 // Called by M68kGetSectionRelationship; see below.
-COUNT M68kGetRelocImportance (const RELOC *Reloc, OFFSET Offset)
+static COUNT M68kGetRelocImportance (const RELOC *Reloc, OFFSET Offset)
 {
 	SECTION *Section = Reloc->Parent;
 	

+ 1 - 1
dump.c

@@ -37,7 +37,7 @@
 	NextIndent [NewLen - 1] = ' '; \
 	NextIndent [NewLen] = 0;
 
-void PrintOffset (FILE *File, OFFSET Offset)
+static void PrintOffset (FILE *File, OFFSET Offset)
 {
 	if (Offset)
 	{

+ 1 - 1
export/exp_farg.c

@@ -24,7 +24,7 @@
 #include "../manip.h"
 
 // Fargo TI-BASIC fork
-const I1 FARGO_TIBASIC_FORK[] = {
+static const I1 FARGO_TIBASIC_FORK[] = {
 	0xE9,            // ENDSTACK_TAG
 	0x12, 0xE4,      // 'EndPrgm'
 	0x00, 0xE8,      // Newline

+ 2 - 2
export/export.c

@@ -55,7 +55,7 @@ typedef struct {
 
 // Return the maximum file size allowed for a given format
 // (without header and footer).
-SIZE GetMaxFileSize (FileFormats FileFormat, ProgramCalcs Calc)
+static SIZE GetMaxFileSize (FileFormats FileFormat, ProgramCalcs Calc)
 {
 	switch (FileFormat)
 	{
@@ -73,7 +73,7 @@ SIZE GetMaxFileSize (FileFormats FileFormat, ProgramCalcs Calc)
 
 // Export the internal data structures to an external file for the given
 // calculator.
-BOOLEAN ExportProgramToFormat (const PROGRAM *Program, const EXPORT_STRUCT *ExportStruct, ProgramCalcs Calc)
+static BOOLEAN ExportProgramToFormat (const PROGRAM *Program, const EXPORT_STRUCT *ExportStruct, ProgramCalcs Calc)
 {
 	BOOLEAN Success;
 	EXP_FILE File;

+ 7 - 7
insert/comprrlc.c

@@ -28,7 +28,7 @@
 #include <string.h>
 
 // Append a new I1 to the section. Return TRUE on success, FALSE on failure.
-BOOLEAN AppendI1ToSection (SECTION *Section, I1 NewI1)
+static BOOLEAN AppendI1ToSection (SECTION *Section, I1 NewI1)
 {
 	TI1 *NewSpace = (TI1 *) AllocateSpaceInSection (Section, 1);
 	if (!NewSpace)
@@ -39,7 +39,7 @@ BOOLEAN AppendI1ToSection (SECTION *Section, I1 NewI1)
 }
 
 // Append a new I2 to the section. Return TRUE on success, FALSE on failure.
-BOOLEAN AppendI2ToSection (SECTION *Section, I2 NewI2)
+static BOOLEAN AppendI2ToSection (SECTION *Section, I2 NewI2)
 {
 	TI2 *NewSpace = (TI2 *) AllocateSpaceInSection (Section, 2);
 	if (!NewSpace)
@@ -51,7 +51,7 @@ BOOLEAN AppendI2ToSection (SECTION *Section, I2 NewI2)
 
 // Emit a compressed reloc nibble buffer. Return TRUE on success, FALSE on
 // failure.
-BOOLEAN EmitCompressedRelocNibbles (SECTION *Section, I4 NibbleCount, I1 *NibbleBuffer)
+static BOOLEAN EmitCompressedRelocNibbles (SECTION *Section, I4 NibbleCount, I1 *NibbleBuffer)
 {
 	I4 CurrentNibble;
 	I4 ByteCount = (NibbleCount + 1) >> 1; // number of bytes emitted as nibbles
@@ -86,7 +86,7 @@ BOOLEAN EmitCompressedRelocNibbles (SECTION *Section, I4 NibbleCount, I1 *Nibble
 
 // Emit a compressed reloc. If Offset is -1, end the relocation table. Return
 // TRUE on success, FALSE on failure.
-BOOLEAN EmitCompressedReloc (SECTION *Section, OFFSET Offset)
+static BOOLEAN EmitCompressedReloc (SECTION *Section, OFFSET Offset)
 {
 // Maximum number of nibbles in a nibble group.
 #define MAX_NIBBLES 9
@@ -155,7 +155,7 @@ Continue:
 // the offset as used in the compressed reloc table or gives an error message if
 // it isn't representable. Call EmitCompressedReloc with the computed offset.
 // Return TRUE on success, FALSE on failure.
-BOOLEAN EmitCompressedRelocFromActualOffset (SECTION *Section, OFFSET Offset)
+static BOOLEAN EmitCompressedRelocFromActualOffset (SECTION *Section, OFFSET Offset)
 {
 	if ((Offset > 0) && (Offset & 1))
 	{
@@ -176,7 +176,7 @@ BOOLEAN EmitCompressedRelocFromActualOffset (SECTION *Section, OFFSET Offset)
 
 // Emit a reloc table in compressed format for the items enumerated in the
 // list model specified by Model.
-BOOLEAN EmitCompressedFormatRelocs (LIST_MODEL *Model, SECTION *SourceSection, const LOCATION *SourceBase, void *UserData, SECTION *Section)
+static BOOLEAN EmitCompressedFormatRelocs (LIST_MODEL *Model, SECTION *SourceSection, const LOCATION *SourceBase, void *UserData, SECTION *Section)
 {
 	if (!SourceSection)
 		SourceSection = Section;
@@ -352,7 +352,7 @@ BOOLEAN InsertCompressedROMCalls (SECTION *Section, SECTION *MergedSection, cons
 
 // Emit a compressed index in PreOs format. Return TRUE on success, FALSE on
 // failure. This is NOT the same format as the compressed relocs!
-BOOLEAN EmitPreOsCompressedIndex (SECTION *Section, COUNT LastIndex, COUNT Index)
+static BOOLEAN EmitPreOsCompressedIndex (SECTION *Section, COUNT LastIndex, COUNT Index)
 {
 #define AppendI1(i1) ({if (!AppendI1ToSection (Section, (i1))) return FALSE;})
 #define AppendI2(i2) ({if (!AppendI2ToSection (Section, (i2))) return FALSE;})

+ 2 - 2
insert/kernel.c

@@ -30,7 +30,7 @@
 // Get the size needed to emit a reloc table in kernel format for the
 // items enumerated in the list model specified by Model. SourceSection
 // may be NULL.
-SIZE GetKernelFormatRelocSize (LIST_MODEL *Model, PROGRAM *Program, SECTION *SourceSection, void *UserData)
+static SIZE GetKernelFormatRelocSize (LIST_MODEL *Model, PROGRAM *Program, SECTION *SourceSection, void *UserData)
 {
 	// We simply need 2 bytes per item, and 2 additional bytes at the end.
 	return (2 * (GetItemCount (Model, Program, SourceSection, UserData)) + 2);
@@ -38,7 +38,7 @@ SIZE GetKernelFormatRelocSize (LIST_MODEL *Model, PROGRAM *Program, SECTION *Sou
 
 // Emit a reloc table in kernel format for the items enumerated in the
 // list model specified by Model. SourceSection may be NULL.
-BOOLEAN EmitKernelFormatRelocs (LIST_MODEL *Model, PROGRAM *Program, SECTION *SourceSection, void *UserData, SECTION *Section, I1 **NewData)
+static BOOLEAN EmitKernelFormatRelocs (LIST_MODEL *Model, PROGRAM *Program, SECTION *SourceSection, void *UserData, SECTION *Section, I1 **NewData)
 {
 	SECTION *CurSection;
 	void *NextItem = NULL;

+ 4 - 4
manip.c

@@ -302,7 +302,7 @@ void InsertSymbol (SECTION *Section, SYMBOL *Symbol)
 
 // Increase the counters for references between the two sections, if the sections
 // are different.
-void IncRefCounts (SECTION *SourceSection, SECTION *TargetSection, const RELOC *Reloc)
+static void IncRefCounts (SECTION *SourceSection, SECTION *TargetSection, const RELOC *Reloc)
 {
 	if (SourceSection != TargetSection)
 	{
@@ -461,7 +461,7 @@ SYMBOL *ResolveLocation (PROGRAM *Program, SECTION *Section, LOCATION *Location)
 // or library call, replace it with the appropriate item.
 // This must be called in order, as the items are appended
 // unconditionally.
-BOOLEAN ResolveSpecialExternalSymbolReloc (RELOC *Reloc)
+static BOOLEAN ResolveSpecialExternalSymbolReloc (RELOC *Reloc)
 {
 	SECTION *Section = Reloc->Parent;
 	PROGRAM *Program = Section->Parent;
@@ -577,7 +577,7 @@ BOOLEAN ResolveSpecialExternalSymbolReloc (RELOC *Reloc)
 
 // Resolve the reloc's target, if possible.
 // Force: Fail on unresolvable reference.
-BOOLEAN ResolveRelocTarget (RELOC *Reloc, BOOLEAN Force)
+static BOOLEAN ResolveRelocTarget (RELOC *Reloc, BOOLEAN Force)
 {
 	SECTION *Section = Reloc->Parent;
 	PROGRAM *Program = Section->Parent;
@@ -633,7 +633,7 @@ BOOLEAN ResolveRelocTarget (RELOC *Reloc, BOOLEAN Force)
 
 // Resolve the reloc's relation, if possible.
 // Force: Fail on unresolvable reference.
-BOOLEAN ResolveRelocRelation (RELOC *Reloc, BOOLEAN Force)
+static BOOLEAN ResolveRelocRelation (RELOC *Reloc, BOOLEAN Force)
 {
 	SECTION *Section = Reloc->Parent;
 	PROGRAM *Program = Section->Parent;

+ 1 - 1
special.c

@@ -1019,7 +1019,7 @@ BOOLEAN GetBuiltinValue (PROGRAM *Program, const char *SymName, SIZE SymNameLeng
 
 // If the given symbol name belongs to a calculator-specific builtin
 // symbol, return a pointer to the part of it that holds the values.
-const char *GetCalcBuiltinValues (const char *SymName)
+static const char *GetCalcBuiltinValues (const char *SymName)
 {
 	if (!(strncmp (SymName, SYMPF_BUILTIN_CALC_CONST, sizeof (SYMPF_BUILTIN_CALC_CONST) - 1)))
 	{