aboutsummaryrefslogtreecommitdiff
path: root/gas/listing.c
diff options
context:
space:
mode:
Diffstat (limited to 'gas/listing.c')
-rw-r--r--gas/listing.c45
1 files changed, 12 insertions, 33 deletions
diff --git a/gas/listing.c b/gas/listing.c
index c47a43d..d611179 100644
--- a/gas/listing.c
+++ b/gas/listing.c
@@ -190,10 +190,10 @@ struct list_info_struct
typedef struct list_info_struct list_info_type;
-int listing_lhs_width = LISTING_LHS_WIDTH;
-int listing_lhs_width_second = LISTING_LHS_WIDTH_SECOND;
-int listing_lhs_cont_lines = LISTING_LHS_CONT_LINES;
-int listing_rhs_width = LISTING_RHS_WIDTH;
+unsigned int listing_lhs_width = LISTING_LHS_WIDTH;
+unsigned int listing_lhs_width_second = LISTING_LHS_WIDTH_SECOND;
+unsigned int listing_lhs_cont_lines = LISTING_LHS_CONT_LINES;
+unsigned int listing_rhs_width = LISTING_RHS_WIDTH;
struct list_info_struct * listing_tail;
@@ -201,8 +201,8 @@ static file_info_type * file_info_head;
static file_info_type * last_open_file_info;
static FILE * last_open_file;
static struct list_info_struct * head;
-static int paper_width = 200;
-static int paper_height = 60;
+static unsigned int paper_width = 200;
+static unsigned int paper_height = 60;
extern int listing;
@@ -735,7 +735,7 @@ listing_page (list_info_type *list)
{
/* Grope around, see if we can see a title or subtitle edict coming up
soon. (we look down 10 lines of the page and see if it's there) */
- if ((eject || (on_page >= (unsigned int) paper_height))
+ if ((eject || (on_page >= paper_height))
&& paper_height != 0)
{
unsigned int c = 10;
@@ -793,7 +793,7 @@ emit_line (list_info_type * list, const char * format, ...)
static unsigned int
calc_hex (list_info_type *list)
{
- int data_buffer_size;
+ size_t data_buffer_size;
list_info_type *first = list;
unsigned int address = ~(unsigned int) 0;
fragS *frag;
@@ -826,7 +826,7 @@ calc_hex (list_info_type *list)
data_buffer_size += 2;
octet_in_frag++;
}
- if (frag_ptr->fr_type == rs_fill)
+ if (frag_ptr->fr_type == rs_fill || frag_ptr->fr_type == rs_fill_nop)
{
unsigned int var_rep_max = octet_in_frag;
unsigned int var_rep_idx = octet_in_frag;
@@ -851,27 +851,6 @@ calc_hex (list_info_type *list)
var_rep_idx = var_rep_max;
}
}
- else if (frag_ptr->fr_type == rs_fill_nop && frag_ptr->fr_opcode)
- {
- /* Print as many bytes from fr_opcode as is sensible. */
- octet_in_frag = 0;
- while (octet_in_frag < (unsigned int) frag_ptr->fr_offset
- && data_buffer_size < MAX_BYTES - 3)
- {
- if (address == ~(unsigned int) 0)
- address = frag_ptr->fr_address / OCTETS_PER_BYTE;
-
- sprintf (data_buffer + data_buffer_size,
- "%02X",
- frag_ptr->fr_opcode[octet_in_frag] & 0xff);
- data_buffer_size += 2;
-
- octet_in_frag++;
- }
-
- free (frag_ptr->fr_opcode);
- frag_ptr->fr_opcode = NULL;
- }
frag_ptr = frag_ptr->fr_next;
}
@@ -941,7 +920,7 @@ print_lines (list_info_type *list, unsigned int lineno,
emit_line (list, "**** %s\n", msg->message);
for (lines = 0;
- lines < (unsigned int) listing_lhs_cont_lines
+ lines < listing_lhs_cont_lines
&& src[cur];
lines++)
{
@@ -1377,7 +1356,7 @@ print_timestamp (void)
static void
print_single_option (char * opt, int *pos)
{
- int opt_len = strlen (opt);
+ size_t opt_len = strlen (opt);
if ((*pos + opt_len) < paper_width)
{
@@ -1546,7 +1525,7 @@ listing_psize (int width_only)
{
paper_height = get_absolute_expression ();
- if (paper_height < 0 || paper_height > 1000)
+ if (paper_height > 1000)
{
paper_height = 0;
as_warn (_("strange paper height, set to no form"));