Pacify gcc-current -Wall.

This commit is contained in:
Andrew Cagney
1997-09-03 07:30:17 +00:00
parent fdd64f952d
commit b5e935ae85
8 changed files with 49 additions and 23 deletions

View File

@ -1,5 +1,20 @@
Wed Sep 3 10:18:55 1997 Andrew Cagney <cagney@b1.cygnus.com> Wed Sep 3 10:18:55 1997 Andrew Cagney <cagney@b1.cygnus.com>
* sim-main.h: Replace SIM_HAVE_FLATMEM with mem ptr.
* interp.c (map): Do not add to a void pointer.
* Makefile.in (INCLUDE): Add sim-main.h
* configure.in: Check for time.h
* configure: Re-generate.
* interp.c (struct interrupt_generator): Make time unsigned long,
address SIM_ADDR.
(sim_resume): Make oldpc SIM_ADDR.
(struct hash_entry): Make mask/opcode unsigned.
* v850_sim.h (struct simops ): Make opcode and mask unsigned.
* simops.c (utime.h): Include if available. * simops.c (utime.h): Include if available.
(OP_10007E0): Check for UTIME function. (OP_10007E0): Check for UTIME function.
(divun): Put parentheses around shift argument. (divun): Put parentheses around shift argument.

View File

@ -44,7 +44,7 @@ SIM_EXTRA_CFLAGS = -I$(srcdir)/../../newlib/libc/sys/sysnecv850 \
$(SIM_HOSTENDIAN) $(SIM_HOSTENDIAN)
SIM_EXTRA_CLEAN = clean-extra SIM_EXTRA_CLEAN = clean-extra
INCLUDE = v850_sim.h $(srcdir)/../../include/callback.h INCLUDE = v850_sim.h sim-main.h $(srcdir)/../../include/callback.h
## COMMON_POST_CONFIG_FRAG ## COMMON_POST_CONFIG_FRAG

View File

@ -3,6 +3,10 @@
/* Define as the return type of signal handlers (int or void). */ /* Define as the return type of signal handlers (int or void). */
#undef RETSIGTYPE #undef RETSIGTYPE
/* Define if your processor stores words with the most significant
byte first (like Motorola and SPARC, unlike Intel and VAX). */
#undef WORDS_BIGENDIAN
/* Define if you have the getrusage function. */ /* Define if you have the getrusage function. */
#undef HAVE_GETRUSAGE #undef HAVE_GETRUSAGE
@ -29,3 +33,6 @@
/* Define if you have the <unistd.h> header file. */ /* Define if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H #undef HAVE_UNISTD_H
/* Define if you have the <utime.h> header file. */
#undef HAVE_UTIME_H

9
sim/v850/configure vendored
View File

@ -1512,24 +1512,25 @@ EOF
chmod chmod
else else
echo "$ac_t""no" 1>&6 echo "$ac_t""no" 1>&6
utime
fi fi
done done
for ac_hdr in unistd.h for ac_hdr in unistd.h stdlib.h string.h strings.h utime.h time.h
do do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:1523: checking for $ac_hdr" >&5 echo "configure:1524: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 1528 "configure" #line 1529 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <$ac_hdr> #include <$ac_hdr>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1533: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } { (eval echo configure:1534: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out` ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*

View File

@ -10,6 +10,6 @@ SIM_AC_OPTION_HOSTENDIAN
SIM_AC_OPTION_WARNINGS SIM_AC_OPTION_WARNINGS
AC_CHECK_FUNCS(time, chmod, utime) AC_CHECK_FUNCS(time, chmod, utime)
AC_CHECK_HEADERS(unistd.h stdlib.h string.h strings.h utime.h) AC_CHECK_HEADERS(unistd.h stdlib.h string.h strings.h utime.h time.h)
SIM_AC_OUTPUT SIM_AC_OUTPUT

View File

@ -47,8 +47,8 @@ struct interrupt_generator
enum interrupt_type type; enum interrupt_type type;
enum interrupt_cond_type cond_type; enum interrupt_cond_type cond_type;
int number; int number;
int address; SIM_ADDR address;
int time; unsigned long time;
int enabled; int enabled;
struct interrupt_generator *next; struct interrupt_generator *next;
}; };
@ -105,8 +105,8 @@ static void do_format_9_10 PARAMS ((uint32));
struct hash_entry struct hash_entry
{ {
struct hash_entry *next; struct hash_entry *next;
long opcode; unsigned long opcode;
long mask; unsigned long mask;
struct simops *ops; struct simops *ops;
}; };
@ -223,13 +223,13 @@ map (addr)
{ {
/* "Mirror" the addresses below 1MB. */ /* "Mirror" the addresses below 1MB. */
addr = addr & (simulator->rom_size - 1); addr = addr & (simulator->rom_size - 1);
return (uint8 *) (addr + STATE_MEMORY (simulator)); return (uint8 *) (simulator->mem) + addr;
} }
else if (addr < simulator->low_end) else if (addr < simulator->low_end)
{ {
/* chunk is just after the rom */ /* chunk is just after the rom */
addr = addr - 0x100000 + simulator->rom_size; addr = addr - 0x100000 + simulator->rom_size;
return (uint8 *) (addr + STATE_MEMORY (simulator)); return (uint8 *) (simulator->mem) + addr;
} }
else if (addr >= simulator->high_start) else if (addr >= simulator->high_start)
{ {
@ -240,7 +240,7 @@ map (addr)
else if (addr >= 0xffe000) else if (addr >= 0xffe000)
addr &= 0xffe3ff; addr &= 0xffe3ff;
addr = addr - simulator->high_start + simulator->high_base; addr = addr - simulator->high_start + simulator->high_base;
return (uint8 *) (STATE_MEMORY (simulator)); return (uint8 *) (simulator->mem) + addr;
} }
else else
{ {
@ -311,8 +311,8 @@ sim_memory_init (SIM_DESC sd)
{ {
int totsize; int totsize;
if (STATE_MEMORY (sd)) if (sd->mem)
zfree (STATE_MEMORY (sd)); zfree (sd->mem);
totsize = (simulator->rom_size totsize = (simulator->rom_size
+ (sd->low_end - 0x100000) + (sd->low_end - 0x100000)
@ -320,8 +320,8 @@ sim_memory_init (SIM_DESC sd)
sd->high_base = sd->rom_size + (sd->low_end - 0x100000); sd->high_base = sd->rom_size + (sd->low_end - 0x100000);
STATE_MEMORY (sd) = zalloc (totsize); sd->mem = zalloc (totsize);
if (!STATE_MEMORY (sd)) if (!sd->mem)
{ {
sim_io_error (sd, "Allocation of main memory failed."); sim_io_error (sd, "Allocation of main memory failed.");
} }
@ -506,7 +506,7 @@ sim_resume (sd, step, siggnal)
{ {
SIM_ELAPSED_TIME start_time; SIM_ELAPSED_TIME start_time;
uint32 inst; uint32 inst;
reg_t oldpc; SIM_ADDR oldpc;
struct interrupt_generator *intgen; struct interrupt_generator *intgen;
if (step) if (step)
@ -816,7 +816,7 @@ sim_set_interrupt (sd, spec)
intgen->enabled = 1; intgen->enabled = 1;
intgen->next = intgen_list; intgen->next = intgen_list;
intgen_list = intgen; intgen_list = intgen;
sim_io_printf (sd, "Interrupt generator %d (NMI) at pc=0x%x, time=%d.\n", intgen_list->number, intgen_list->address, intgen_list->time); sim_io_printf (sd, "Interrupt generator %d (NMI) at pc=0x%x, time=%ld.\n", intgen_list->number, intgen_list->address, intgen_list->time);
} }
else if (*argv && !strcmp (*argv, "remove")) else if (*argv && !strcmp (*argv, "remove"))
{ {
@ -853,10 +853,10 @@ sim_set_interrupt (sd, spec)
if (intgen_list) if (intgen_list)
{ {
for (intgen = intgen_list; intgen != NULL; intgen = intgen->next) for (intgen = intgen_list; intgen != NULL; intgen = intgen->next)
sim_io_printf (sd, "Interrupt generator %d (%s) at pc=0x%x/time=%d%s.\n", sim_io_printf (sd, "Interrupt generator %d (%s) at pc=0x%lx/time=%ld%s.\n",
intgen->number, intgen->number,
interrupt_names[intgen->type], interrupt_names[intgen->type],
intgen->address, (long) intgen->address,
intgen->time, intgen->time,
(intgen->enabled ? "" : " (disabled)")); (intgen->enabled ? "" : " (disabled)"));
} }

View File

@ -1,5 +1,3 @@
#define SIM_HAVE_FLATMEM 1
#include "sim-basics.h" #include "sim-basics.h"
typedef address_word sim_cia; typedef address_word sim_cia;
@ -49,6 +47,7 @@ struct sim_state {
SIM_ADDR low_end; SIM_ADDR low_end;
SIM_ADDR high_start; SIM_ADDR high_start;
SIM_ADDR high_base; SIM_ADDR high_base;
void *mem;
sim_state_base base; sim_state_base base;
}; };

View File

@ -5,6 +5,10 @@
#ifdef HAVE_UTIME_H #ifdef HAVE_UTIME_H
#include <utime.h> #include <utime.h>
#endif
#ifdef HAVE_TIME_H
#include <time.h>
#endif #endif
/* FIXME - should be including a version of syscall.h that does not /* FIXME - should be including a version of syscall.h that does not