2000-10-30 Kazu Hirata <kazu@hxi.com>

* expr.c: Fix formatting.
	* flonum-copy.c: Likewise.
	* flonum.h: Likewise.
	* gasp.c: Likewise.
	* hash.c: Likewise.
This commit is contained in:
Kazu Hirata 2000-10-30 21:59:01 +00:00
parent 8e1a459b89
commit b041f888ac
6 changed files with 51 additions and 65 deletions

View File

@ -1,3 +1,11 @@
2000-10-30 Kazu Hirata <kazu@hxi.com>
* expr.c: Fix formatting.
* flonum-copy.c: Likewise.
* flonum.h: Likewise.
* gasp.c: Likewise.
* hash.c: Likewise.
2000-10-30 Hans-Peter Nilsson <hp@bitrange.com> 2000-10-30 Hans-Peter Nilsson <hp@bitrange.com>
* as.h (OPTION_MD_BASE): Bump to 190. * as.h (OPTION_MD_BASE): Bump to 190.

View File

@ -1417,9 +1417,8 @@ clean_up_expression (expressionP)
#undef __ #undef __
#define __ O_illegal #define __ O_illegal
static const operatorT op_encoding[256] = /* Maps ASCII -> operators. */
{ /* Maps ASCII -> operators. */ static const operatorT op_encoding[256] = {
__, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __,
__, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __,

View File

@ -14,8 +14,9 @@
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with GAS; see the file COPYING. If not, write to along with GAS; see the file COPYING. If not, write to the Free
the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
#include "as.h" #include "as.h"
@ -37,23 +38,22 @@ flonum_copy (in, out)
else else
{ {
out_length = out->high - out->low; out_length = out->high - out->low;
/* /* Assume no GAPS in packing of littlenums.
* Assume no GAPS in packing of littlenums. I.e. sizeof(array) == sizeof(element) * number_of_elements. */
* I.e. sizeof(array) == sizeof(element) * number_of_elements.
*/
if (in_length <= out_length) if (in_length <= out_length)
{ {
{ {
/* /* For defensive programming, zero any high-order
* For defensive programming, zero any high-order littlenums we don't need. littlenums we don't need. This is destroying evidence
* This is destroying evidence and wasting time, so why bother??? and wasting time, so why bother??? */
*/
if (in_length < out_length) if (in_length < out_length)
{ {
memset ((char *) (out->low + in_length + 1), '\0', out_length - in_length); memset ((char *) (out->low + in_length + 1), '\0',
out_length - in_length);
} }
} }
memcpy ((void *) (out->low), (void *) (in->low), ((in_length + 1) * sizeof (LITTLENUM_TYPE))); memcpy ((void *) (out->low), (void *) (in->low),
((in_length + 1) * sizeof (LITTLENUM_TYPE)));
out->exponent = in->exponent; out->exponent = in->exponent;
out->leader = in->leader - in->low + out->low; out->leader = in->leader - in->low + out->low;
} }
@ -63,11 +63,10 @@ flonum_copy (in, out)
shorten = in_length - out_length; shorten = in_length - out_length;
/* Assume out_length >= 0 ! */ /* Assume out_length >= 0 ! */
memcpy ((void *) (out->low), (void *) (in->low + shorten), ((out_length + 1) * sizeof (LITTLENUM_TYPE))); memcpy ((void *) (out->low), (void *) (in->low + shorten),
((out_length + 1) * sizeof (LITTLENUM_TYPE)));
out->leader = out->high; out->leader = out->high;
out->exponent = in->exponent + shorten; out->exponent = in->exponent + shorten;
} }
} /* if any significant bits */ } /* if any significant bits */
} /* flonum_copy() */ }
/* end of flonum_copy.c */

View File

@ -49,8 +49,7 @@
A sign value of 'P' means we've been asked to assemble +Inf A sign value of 'P' means we've been asked to assemble +Inf
A sign value of 'N' means we've been asked to assemble -Inf A sign value of 'N' means we've been asked to assemble -Inf
*/ */
struct FLONUM_STRUCT struct FLONUM_STRUCT {
{
LITTLENUM_TYPE *low; /* low order littlenum of a bignum */ LITTLENUM_TYPE *low; /* low order littlenum of a bignum */
LITTLENUM_TYPE *high; /* high order littlenum of a bignum */ LITTLENUM_TYPE *high; /* high order littlenum of a bignum */
LITTLENUM_TYPE *leader; /* -> 1st non-zero littlenum */ LITTLENUM_TYPE *leader; /* -> 1st non-zero littlenum */
@ -76,9 +75,8 @@ typedef struct FLONUM_STRUCT FLONUM_TYPE;
extern const FLONUM_TYPE flonum_positive_powers_of_ten[]; extern const FLONUM_TYPE flonum_positive_powers_of_ten[];
extern const FLONUM_TYPE flonum_negative_powers_of_ten[]; extern const FLONUM_TYPE flonum_negative_powers_of_ten[];
extern const int table_size_of_flonum_powers_of_ten; extern const int table_size_of_flonum_powers_of_ten;
/* Flonum_XXX_powers_of_ten[] table has */ /* Flonum_XXX_powers_of_ten[] table has legal indices from 0 to
/* legal indices from 0 to */ + this number inclusive. */
/* + this number inclusive. */
/***********************************************************************\ /***********************************************************************\
* * * *

View File

@ -124,32 +124,27 @@ static char chartype[256];
a bug in the user's macro structure. */ a bug in the user's macro structure. */
#define IFNESTING 100 #define IFNESTING 100
struct struct {
{
int on; /* Is the level being output. */ int on; /* Is the level being output. */
int hadelse; /* Has an aelse been seen. */ int hadelse; /* Has an aelse been seen. */
} } ifstack[IFNESTING];
ifstack[IFNESTING];
int ifi; int ifi;
/* The final and intermediate results of expression evaluation are kept in /* The final and intermediate results of expression evaluation are kept in
exp_t's. Note that a symbol is not an sb, but a pointer into the input exp_t's. Note that a symbol is not an sb, but a pointer into the input
line. It must be coped somewhere safe before the next line is read in. */ line. It must be coped somewhere safe before the next line is read in. */
typedef struct typedef struct {
{
char *name; char *name;
int len; int len;
} } symbol;
symbol;
typedef struct typedef struct {
{
int value; /* Constant part. */ int value; /* Constant part. */
symbol add_symbol; /* Name part. */ symbol add_symbol; /* Name part. */
symbol sub_symbol; /* Name part. */ symbol sub_symbol; /* Name part. */
} } exp_t;
exp_t;
/* Hashing is done in a pretty standard way. A hash_table has a /* Hashing is done in a pretty standard way. A hash_table has a
pointer to a vector of pointers to hash_entrys, and the size of the pointer to a vector of pointers to hash_entrys, and the size of the
@ -158,20 +153,17 @@ exp_t;
with the same hash are kept in a chain. */ with the same hash are kept in a chain. */
/* What the data in a hash_entry means. */ /* What the data in a hash_entry means. */
typedef enum typedef enum {
{
hash_integer, /* Name->integer mapping. */ hash_integer, /* Name->integer mapping. */
hash_string, /* Name->string mapping. */ hash_string, /* Name->string mapping. */
hash_macro, /* Name is a macro. */ hash_macro, /* Name is a macro. */
hash_formal /* Name is a formal argument. */ hash_formal /* Name is a formal argument. */
} hash_type; } hash_type;
typedef struct hs typedef struct hs {
{
sb key; /* Symbol name. */ sb key; /* Symbol name. */
hash_type type; /* Symbol meaning. */ hash_type type; /* Symbol meaning. */
union union {
{
sb s; sb s;
int i; int i;
struct macro_struct *m; struct macro_struct *m;
@ -180,8 +172,7 @@ typedef struct hs
struct hs *next; /* Next hash_entry with same hash key. */ struct hs *next; /* Next hash_entry with same hash key. */
} hash_entry; } hash_entry;
typedef struct typedef struct {
{
hash_entry **table; hash_entry **table;
int size; int size;
} hash_table; } hash_table;
@ -201,13 +192,11 @@ typedef struct
the same stack index. If we're being reasonable, we can detect the same stack index. If we're being reasonable, we can detect
recusive expansion by checking the index is reasonably small. */ recusive expansion by checking the index is reasonably small. */
typedef enum typedef enum {
{
include_file, include_repeat, include_while, include_macro include_file, include_repeat, include_while, include_macro
} include_type; } include_type;
struct include_stack struct include_stack {
{
sb pushback; /* Current pushback stream. */ sb pushback; /* Current pushback stream. */
int pushback_index; /* Next char to read from stream. */ int pushback_index; /* Next char to read from stream. */
FILE *handle; /* Open file. */ FILE *handle; /* Open file. */
@ -215,16 +204,14 @@ struct include_stack
int linecount; /* Number of lines read so far. */ int linecount; /* Number of lines read so far. */
include_type type; include_type type;
int index; /* Index of this layer. */ int index; /* Index of this layer. */
} } include_stack[MAX_INCLUDES];
include_stack[MAX_INCLUDES];
struct include_stack *sp; struct include_stack *sp;
#define isp (sp - include_stack) #define isp (sp - include_stack)
/* Include file list. */ /* Include file list. */
typedef struct include_path typedef struct include_path {
{
struct include_path *next; struct include_path *next;
sb path; sb path;
} include_path; } include_path;
@ -3079,15 +3066,13 @@ chartype_init ()
#define K_IRP (PROCESS|54) #define K_IRP (PROCESS|54)
#define K_IRPC (PROCESS|55) #define K_IRPC (PROCESS|55)
struct keyword struct keyword {
{
char *name; char *name;
int code; int code;
int extra; int extra;
}; };
static struct keyword kinfo[] = static struct keyword kinfo[] = {
{
{ "EQU", K_EQU, 0 }, { "EQU", K_EQU, 0 },
{ "ALTERNATE", K_ALTERNATE, 0 }, { "ALTERNATE", K_ALTERNATE, 0 },
{ "ASSIGN", K_ASSIGN, 0 }, { "ASSIGN", K_ASSIGN, 0 },
@ -3138,8 +3123,7 @@ static struct keyword kinfo[] =
handle them here as well, in case they are used in a recursive handle them here as well, in case they are used in a recursive
macro to end the recursion. */ macro to end the recursion. */
static struct keyword mrikinfo[] = static struct keyword mrikinfo[] = {
{
{ "IFEQ", K_IFEQ, 0 }, { "IFEQ", K_IFEQ, 0 },
{ "IFNE", K_IFNE, 0 }, { "IFNE", K_IFNE, 0 },
{ "IFLT", K_IFLT, 0 }, { "IFLT", K_IFLT, 0 },

View File

@ -37,8 +37,7 @@
/* An entry in a hash table. */ /* An entry in a hash table. */
struct hash_entry struct hash_entry {
{
/* Next entry for this hash code. */ /* Next entry for this hash code. */
struct hash_entry *next; struct hash_entry *next;
/* String being hashed. */ /* String being hashed. */
@ -52,8 +51,7 @@ struct hash_entry
/* A hash table. */ /* A hash table. */
struct hash_control struct hash_control {
{
/* The hash array. */ /* The hash array. */
struct hash_entry **table; struct hash_entry **table;
/* The number of slots in the hash table. */ /* The number of slots in the hash table. */