Commit 40580e2d authored by oharboe's avatar oharboe
Browse files

Zach Welch <zw@superlucidity.net> fix -Werror warnings

git-svn-id: svn://svn.berlios.de/openocd/trunk@1472 b42882b7-edfa-0310-969c-e2dbd0fdcd60
parent 7989000e
......@@ -517,7 +517,7 @@ int feroceon_bulk_write_memory(target_t *target, u32 address, u32 count, u8 *buf
arm7_9_common_t *arm7_9 = armv4_5->arch_info;
enum armv4_5_state core_state = armv4_5->core_state;
u32 x, flip, shift, save[7];
int i;
u32 i;
/*
* We can't use the dcc flow control bits, so let's transfer data
......@@ -547,7 +547,7 @@ int feroceon_bulk_write_memory(target_t *target, u32 address, u32 count, u8 *buf
0xeafffff3, /* b 3b */
};
int dcc_size = sizeof(dcc_code);
u32 dcc_size = sizeof(dcc_code);
if (!arm7_9->dcc_downloads)
return target->type->write_memory(target, address, 4, count, buffer);
......
......@@ -47,7 +47,7 @@ typedef struct mips32_comparator_s
typedef struct mips32_common_s
{
int common_magic;
u32 common_magic;
void *arch_info;
reg_cache_t *core_cache;
mips_ejtag_t ejtag_info;
......
......@@ -40,7 +40,7 @@ int mips_ejtag_set_instr(mips_ejtag_t *ejtag_info, int new_instr, in_handler_t h
if (tap==NULL)
return ERROR_FAIL;
if (buf_get_u32(tap->cur_instr, 0, tap->ir_length) != new_instr)
if (buf_get_u32(tap->cur_instr, 0, tap->ir_length) != (u32)new_instr)
{
scan_field_t field;
u8 t[4];
......
......@@ -78,7 +78,8 @@ int oocd_trace_write_reg(oocd_trace_t *oocd_trace, int reg, u32 value)
int oocd_trace_read_memory(oocd_trace_t *oocd_trace, u8 *data, u32 address, u32 size)
{
size_t bytes_written, bytes_read, bytes_to_read;
size_t bytes_written, bytes_to_read;
ssize_t bytes_read;
u8 cmd;
oocd_trace_write_reg(oocd_trace, OOCD_TRACE_ADDRESS, address);
......@@ -188,7 +189,7 @@ int oocd_trace_read_trace(etm_context_t *etm_ctx)
u32 first_frame = 0x0;
u32 num_frames = 1048576;
u8 *trace_data;
int i;
u32 i;
oocd_trace_read_reg(oocd_trace, OOCD_TRACE_STATUS, &status);
oocd_trace_read_reg(oocd_trace, OOCD_TRACE_ADDRESS, &address);
......
......@@ -40,7 +40,7 @@ typedef struct reg_s
u8 *value;
int dirty;
int valid;
int size;
u32 size;
bitfield_desc_t *bitfield_desc;
int num_bitfields;
void *arch_info;
......
......@@ -985,7 +985,7 @@ int target_write_buffer(struct target_s *target, u32 address, u32 size, u8 *buff
/* handle unaligned head bytes */
if (address % 4)
{
int unaligned = 4 - (address % 4);
u32 unaligned = 4 - (address % 4);
if (unaligned > size)
unaligned = size;
......@@ -1060,7 +1060,7 @@ int target_read_buffer(struct target_s *target, u32 address, u32 size, u8 *buffe
/* handle unaligned head bytes */
if (address % 4)
{
int unaligned = 4 - (address % 4);
u32 unaligned = 4 - (address % 4);
if (unaligned > size)
unaligned = size;
......@@ -1100,7 +1100,7 @@ int target_checksum_memory(struct target_s *target, u32 address, u32 size, u32*
{
u8 *buffer;
int retval;
int i;
u32 i;
u32 checksum = 0;
if (!target->type->examined)
{
......@@ -2273,7 +2273,7 @@ int handle_verify_image_command_internal(struct command_context_s *cmd_ctx, char
retval = target->type->read_memory(target, image.sections[i].base_address, size, count, data);
if (retval == ERROR_OK)
{
int t;
u32 t;
for (t = 0; t < buf_cnt; t++)
{
if (data[t] != buffer[t])
......@@ -2508,9 +2508,9 @@ static void writeString(FILE *f, char *s)
}
/* Dump a gmon.out histogram file. */
static void writeGmon(u32 *samples, int sampleNum, char *filename)
static void writeGmon(u32 *samples, u32 sampleNum, char *filename)
{
int i;
u32 i;
FILE *f=fopen(filename, "w");
if (f==NULL)
return;
......@@ -2539,8 +2539,8 @@ static void writeGmon(u32 *samples, int sampleNum, char *filename)
int addressSpace=(max-min+1);
static int const maxBuckets=256*1024; /* maximum buckets. */
int length=addressSpace;
static const u32 maxBuckets = 256 * 1024; /* maximum buckets. */
u32 length = addressSpace;
if (length > maxBuckets)
{
length=maxBuckets;
......@@ -2747,7 +2747,8 @@ static int target_mem2array(Jim_Interp *interp, target_t *target, int argc, Jim_
u32 v;
const char *varname;
u8 buffer[4096];
int i, n, e, retval;
int n, e, retval;
u32 i;
/* argv[1] = name of array to receive the data
* argv[2] = desired width
......@@ -2928,7 +2929,8 @@ static int target_array2mem(Jim_Interp *interp, target_t *target, int argc, Jim_
u32 v;
const char *varname;
u8 buffer[4096];
int i, n, e, retval;
int n, e, retval;
u32 i;
/* argv[1] = name of array to get the data
* argv[2] = desired width
......@@ -3200,7 +3202,7 @@ static int target_configure( Jim_GetOptInfo *goi, target_t *target )
teap = target->event_action;
/* replace existing? */
while( teap ){
if( teap->event == n->value ){
if( teap->event == (enum target_event)n->value ){
break;
}
teap = teap->next;
......
......@@ -73,7 +73,7 @@ int target_hexmsg(target_t *target, int size, u32 length)
char line[128];
int line_len;
debug_msg_receiver_t *c = target->dbgmsg;
int i;
u32 i;
LOG_DEBUG("size: %i, length: %i", size, length);
......
......@@ -31,7 +31,7 @@
#include <string.h>
#include <inttypes.h>
int trace_point(target_t *target, int number)
int trace_point(target_t *target, u32 number)
{
trace_t *trace = target->trace_info;
......@@ -60,7 +60,7 @@ int handle_trace_point_command(struct command_context_s *cmd_ctx, char *cmd, cha
if (argc == 0)
{
int i;
u32 i;
for (i = 0; i < trace->num_trace_points; i++)
{
......@@ -125,9 +125,9 @@ int handle_trace_history_command(struct command_context_s *cmd_ctx, char *cmd, c
}
else
{
int i;
int first = 0;
int last = trace->trace_history_pos;
u32 i;
u32 first = 0;
u32 last = trace->trace_history_pos;
if ( !trace->trace_history_size ) {
command_print(cmd_ctx, "trace history buffer is not allocated");
......
......@@ -32,12 +32,12 @@ typedef struct trace_point_s
typedef struct trace_s
{
int num_trace_points;
int trace_points_size;
u32 num_trace_points;
u32 trace_points_size;
trace_point_t *trace_points;
int trace_history_size;
u32 trace_history_size;
u32 *trace_history;
int trace_history_pos;
u32 trace_history_pos;
int trace_history_overflowed;
} trace_t;
......@@ -50,7 +50,7 @@ typedef enum trace_status
TRACE_OVERFLOWED = 0x8,
} trace_status_t;
extern int trace_point(struct target_s *target, int number);
extern int trace_point(struct target_s *target, u32 number);
extern int trace_register_commands(struct command_context_s *cmd_ctx);
#define ERROR_TRACE_IMAGE_UNAVAILABLE -(1500)
......
......@@ -1631,7 +1631,7 @@ int xscale_deassert_reset(target_t *target)
u32 binary_size;
u32 buf_cnt;
int i;
u32 i;
int retval;
breakpoint_t *breakpoint = target->breakpoints;
......@@ -1928,7 +1928,7 @@ int xscale_read_memory(struct target_s *target, u32 address, u32 size, u32 count
armv4_5_common_t *armv4_5 = target->arch_info;
xscale_common_t *xscale = armv4_5->arch_info;
u32 *buf32;
int i;
u32 i;
int retval;
LOG_DEBUG("address: 0x%8.8x, size: 0x%8.8x, count: 0x%8.8x", address, size, count);
......@@ -2933,7 +2933,7 @@ int xscale_analyze_trace(target_t *target, command_context_t *cmd_ctx)
(((instruction.type == ARM_B) ||
(instruction.type == ARM_BL) ||
(instruction.type == ARM_BLX)) &&
(instruction.info.b_bl_bx_blx.target_address != -1)))
(instruction.info.b_bl_bx_blx.target_address != ~0UL)))
{
xscale->trace.current_pc = instruction.info.b_bl_bx_blx.target_address;
}
......
......@@ -743,7 +743,7 @@ static int handle_xsvf_command(struct command_context_s *cmd_ctx, char *cmd, cha
case XCOMMENT:
{
int ndx = 0;
unsigned int ndx = 0;
char comment[128];
do
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment