From f99049f84c37695debe0e3f5a3bf2d70f10a0420 Mon Sep 17 00:00:00 2001 From: cuz Date: Sun, 23 Nov 2003 21:39:12 +0000 Subject: [PATCH] Hold address sizes in an unsigned char git-svn-id: svn://svn.cc65.org/cc65/trunk@2680 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- src/ca65/segment.c | 4 ++-- src/ca65/segment.h | 4 ++-- src/common/segdefs.c | 3 ++- src/common/segdefs.h | 10 +++++----- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/ca65/segment.c b/src/ca65/segment.c index b1ea4da56..5db9fe2b4 100644 --- a/src/ca65/segment.c +++ b/src/ca65/segment.c @@ -102,7 +102,7 @@ Segment* ActiveSeg = &CodeSeg; -static Segment* NewSegment (const char* Name, unsigned AddrSize) +static Segment* NewSegment (const char* Name, unsigned char AddrSize) /* Create a new segment, insert it into the global list and return it */ { Segment* S; @@ -261,7 +261,7 @@ void SegAlign (unsigned Power, int Val) -unsigned GetSegAddrSize (unsigned SegNum) +unsigned char GetSegAddrSize (unsigned SegNum) /* Return the address size of the segment with the given number */ { /* Search for the segment */ diff --git a/src/ca65/segment.h b/src/ca65/segment.h index 85f50308b..f4b8c8240 100644 --- a/src/ca65/segment.h +++ b/src/ca65/segment.h @@ -116,7 +116,7 @@ INLINE unsigned GetCurrentSegNum (void) #endif #if defined(HAVE_INLINE) -INLINE unsigned GetCurrentSegAddrSize (void) +INLINE unsigned char GetCurrentSegAddrSize (void) /* Get the address size of the current segment */ { return ActiveSeg->Def->AddrSize; @@ -131,7 +131,7 @@ void SegAlign (unsigned Power, int Val); * given value. */ -unsigned GetSegAddrSize (unsigned SegNum); +unsigned char GetSegAddrSize (unsigned SegNum); /* Return the address size of the segment with the given number */ unsigned long GetPC (void); diff --git a/src/common/segdefs.c b/src/common/segdefs.c index b43272c1e..5e0c5e9e1 100644 --- a/src/common/segdefs.c +++ b/src/common/segdefs.c @@ -45,7 +45,7 @@ -SegDef* NewSegDef (const char* Name, unsigned AddrSize) +SegDef* NewSegDef (const char* Name, unsigned char AddrSize) /* Create a new segment definition and return it */ { /* Allocate memory */ @@ -78,3 +78,4 @@ SegDef* DupSegDef (const SegDef* Def) + diff --git a/src/common/segdefs.h b/src/common/segdefs.h index 8c9adcbbb..5fbb8cb13 100644 --- a/src/common/segdefs.h +++ b/src/common/segdefs.h @@ -37,7 +37,7 @@ #define SEGDEFS_H - + /* common */ #include "addrsize.h" @@ -52,8 +52,8 @@ /* Segment definition */ typedef struct SegDef SegDef; struct SegDef { - char* Name; /* Segment name */ - unsigned AddrSize; /* Default address size */ + char* Name; /* Segment name */ + unsigned char AddrSize; /* Default address size */ }; /* Initializer for static SegDefs */ @@ -67,7 +67,7 @@ struct SegDef { -SegDef* NewSegDef (const char* Name, unsigned AddrSize); +SegDef* NewSegDef (const char* Name, unsigned char AddrSize); /* Create a new segment definition and return it */ void FreeSegDef (SegDef* D); @@ -77,7 +77,7 @@ SegDef* DupSegDef (const SegDef* D); /* Duplicate a segment definition and return it */ - + /* End of segdefs.h */ #endif