From d72eb0d7570fa73e9ffd094383c3cb764fea3836 Mon Sep 17 00:00:00 2001 From: fche Date: Fri, 22 Nov 2002 20:34:58 +0000 Subject: [PATCH] * gcc 3.2 compatibility fixes [e.g. include/ChangeLog] 2002-11-22 Frank Ch. Eigler * sidattrutil.h: Give up on hash tables - too many incompatible libstdc++'s out there. * configure.in: Don't bother looking for hash stuff. * configure, sidconfutil.in: Regenerated. * sidmiscutil.h: Add some "typename" qualifiers. * sidcpuutil.h (cpu_trace_stream): Trade publicness for friendliness regarding cout_p. [e.g., component/parport/ChangeLog] 2002-11-22 Frank Ch. Eigler * ps2.cxx (parport_inputpin): Fix formal arg list. [e.g., component/interrupt/ChangeLog] 2002-11-22 Frank Ch. Eigler * components.cxx (compInterruptDelete): Avoid dynamic_cast on deleted pointer. --- sid/component/bochs/ChangeLog | 4 ++++ sid/component/bochs/pic/pic.cc | 4 ++-- sid/component/gloss/ChangeLog | 4 ++++ sid/component/gloss/gloss.cxx | 2 +- sid/component/interrupt/ChangeLog | 5 +++++ sid/component/interrupt/components.cxx | 6 ++++-- sid/component/parport/ChangeLog | 4 ++++ sid/component/parport/ps2.cxx | 2 +- sid/component/profiling/ChangeLog | 4 ++++ sid/component/profiling/gprof.cxx | 14 -------------- sid/include/ChangeLog | 10 ++++++++++ sid/include/configure | 6 +++--- sid/include/configure.in | 4 ++-- sid/include/sidattrutil.h | 18 ++++-------------- sid/include/sidconfutil.in | 6 ------ sid/include/sidcpuutil.h | 4 ---- sid/include/sidmiscutil.h | 10 +++++----- 17 files changed, 53 insertions(+), 54 deletions(-) diff --git a/sid/component/bochs/ChangeLog b/sid/component/bochs/ChangeLog index 61fa8b4f2b..7b2eec878c 100644 --- a/sid/component/bochs/ChangeLog +++ b/sid/component/bochs/ChangeLog @@ -1,3 +1,7 @@ +2002-11-22 Frank Ch. Eigler + + * pic/pic.cc: Correct #if BX_DEBUG->BX_DEBUGGER. + 2002-11-11 Frank Ch. Eigler * bochs.h: Namespace fixes. diff --git a/sid/component/bochs/pic/pic.cc b/sid/component/bochs/pic/pic.cc index a890f314ee..bcf6ba2b3c 100644 --- a/sid/component/bochs/pic/pic.cc +++ b/sid/component/bochs/pic/pic.cc @@ -523,7 +523,7 @@ bx_pic_c::trigger_irq(unsigned irq_no) int irq_no_bitmask; -#if BX_DEBUG +#if BX_DEBUGGER if ( irq_no > 15 ) BX_PANIC(("trigger_irq: irq out of range\n")); #endif @@ -553,7 +553,7 @@ bx_pic_c::untrigger_irq(unsigned irq_no) int irq_no_bitmask; -#if BX_DEBUG +#if BX_DEBUGGER if ( irq_no > 15 ) BX_PANIC(("untrigger_irq: irq out of range\n")); #endif diff --git a/sid/component/gloss/ChangeLog b/sid/component/gloss/ChangeLog index a4693f7858..3a83a07ebf 100644 --- a/sid/component/gloss/ChangeLog +++ b/sid/component/gloss/ChangeLog @@ -1,3 +1,7 @@ +2002-11-22 Frank Ch. Eigler + + * gloss.cxx (get_string): Correct formal arg list. + 2002-09-05 Ben Elliston * gloss.h: Specify std:: namespace where necessary. diff --git a/sid/component/gloss/gloss.cxx b/sid/component/gloss/gloss.cxx index b27ad7768c..fb68bde2b7 100644 --- a/sid/component/gloss/gloss.cxx +++ b/sid/component/gloss/gloss.cxx @@ -241,7 +241,7 @@ gloss32::update_endian() // imposed length limit; read from memory until a NUL is encountered. bool -gloss32::get_string (address32 address, string& value, unsigned length = 0) +gloss32::get_string (address32 address, string& value, unsigned length) { if (! cpu_memory_bus) { diff --git a/sid/component/interrupt/ChangeLog b/sid/component/interrupt/ChangeLog index b874426261..7d1397a44f 100644 --- a/sid/component/interrupt/ChangeLog +++ b/sid/component/interrupt/ChangeLog @@ -1,3 +1,8 @@ +2002-11-22 Frank Ch. Eigler + + * components.cxx (compInterruptDelete): Avoid dynamic_cast on + deleted pointer. + 2002-11-11 Frank Ch. Eigler * arm.h, cma222.h, components.h: Dtor throw () fixes. diff --git a/sid/component/interrupt/components.cxx b/sid/component/interrupt/components.cxx index dbe57d19f2..458a594bd2 100644 --- a/sid/component/interrupt/components.cxx +++ b/sid/component/interrupt/components.cxx @@ -40,8 +40,10 @@ static void compInterruptDelete(component* c) { #if SIDTARGET_ARM - delete dynamic_cast(c); - delete dynamic_cast(c); + armIntController* g1 = dynamic_cast(c); + if (g1) { delete g1; return; } + cma222IntController* g2 = dynamic_cast(c); + if (g2) { delete g2; return; } #endif } diff --git a/sid/component/parport/ChangeLog b/sid/component/parport/ChangeLog index a740a4085d..aa6c0e9686 100644 --- a/sid/component/parport/ChangeLog +++ b/sid/component/parport/ChangeLog @@ -1,3 +1,7 @@ +2002-11-22 Frank Ch. Eigler + + * ps2.cxx (parport_inputpin): Fix formal arg list. + 2001-08-04 Frank Ch. Eigler * ps2.cxx (dtor): Define. diff --git a/sid/component/parport/ps2.cxx b/sid/component/parport/ps2.cxx index 9573b2450e..51c97eef56 100644 --- a/sid/component/parport/ps2.cxx +++ b/sid/component/parport/ps2.cxx @@ -1137,7 +1137,7 @@ ParPort::intsel_attrhandler() // Constructor of nested class parport_inputpin ParPort::parport_inputpin::parport_inputpin(ParPort* owner_obj, void(ParPort::*fun_ptr)(host_int_4), - bool pin_type = false) + bool pin_type) :parport(owner_obj), handle_driven(fun_ptr) { diff --git a/sid/component/profiling/ChangeLog b/sid/component/profiling/ChangeLog index 98acdea92f..546d5e125a 100644 --- a/sid/component/profiling/ChangeLog +++ b/sid/component/profiling/ChangeLog @@ -1,3 +1,7 @@ +2002-11-22 Frank Ch. Eigler + + * gprof.cxx: Give up on hash_map; use plain map<> for count tables. + 2002-11-11 Frank Ch. Eigler * gprof.cxx: Namespace usage fixes. diff --git a/sid/component/profiling/gprof.cxx b/sid/component/profiling/gprof.cxx index 989c47ae95..01a8420196 100644 --- a/sid/component/profiling/gprof.cxx +++ b/sid/component/profiling/gprof.cxx @@ -69,7 +69,6 @@ namespace profiling_components using sidutil::endian_little; using std::map; - using std::hash_map; using std::vector; using std::string; using std::ofstream; @@ -93,21 +92,8 @@ namespace profiling_components protected fixed_relation_map_component, protected no_bus_component { -#ifdef HAVE_HASHING - struct hash_cg_pair - { - size_t operator () (const pair& s) const - { - return (s.first << 1) ^ s.second; - } - }; - - typedef hash_map hitcount_map_t; - typedef hash_map,host_int_4,hash_cg_pair> cg_count_map_t; -#else typedef map hitcount_map_t; typedef map,host_int_4> cg_count_map_t; -#endif // statistics hitcount_map_t value_hitcount_map; diff --git a/sid/include/ChangeLog b/sid/include/ChangeLog index 65096f6cc4..0e5485db77 100644 --- a/sid/include/ChangeLog +++ b/sid/include/ChangeLog @@ -1,3 +1,13 @@ +2002-11-22 Frank Ch. Eigler + + * sidattrutil.h: Give up on hash tables - too many incompatible + libstdc++'s out there. + * configure.in: Don't bother looking for hash stuff. + * configure, sidconfutil.in: Regenerated. + * sidmiscutil.h: Add some "typename" qualifiers. + * sidcpuutil.h (cpu_trace_stream): Trade publicness for friendliness + regarding cout_p. + 2002-11-11 Frank Ch. Eigler * sidcpuutil.h (cpu_trace_stream): Add some std:: qualifiers. diff --git a/sid/include/configure b/sid/include/configure index d0d66b34d1..5317f753fb 100755 --- a/sid/include/configure +++ b/sid/include/configure @@ -1117,7 +1117,7 @@ EOF fi -for ac_hdr in sstream strstream.h ext/hash_map hash_map +for ac_hdr in sstream strstream.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 @@ -1272,7 +1272,7 @@ EOF fi echo "$ac_t""$sid_cv_cctype_std" 1>&6 - + echo $ac_n "checking whether __builtin_expect is supported""... $ac_c" 1>&6 echo "configure:1278: checking whether __builtin_expect is supported" >&5 if eval "test \"`echo '$''{'sid_cv_builtin_expect'+set}'`\" = set"; then @@ -1479,7 +1479,7 @@ cat >> $CONFIG_STATUS <<\EOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. -ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_max_sed_cmds=60 # Maximum number of lines to put in a sed script. ac_file=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_cmds # Line after last line for current file. diff --git a/sid/include/configure.in b/sid/include/configure.in index 13a61c2a9e..9816c022e0 100644 --- a/sid/include/configure.in +++ b/sid/include/configure.in @@ -15,7 +15,7 @@ AC_LANG_CPLUSPLUS AC_HEADER_STDC dnl SID compile time requirements -AC_CHECK_HEADERS(sstream strstream.h ext/hash_map hash_map) +AC_CHECK_HEADERS(sstream strstream.h) AC_CHECK_FUNCS(strerror) dnl debugging functions @@ -44,7 +44,7 @@ if test "${sid_cv_cctype_std}" = "yes"; then AC_DEFINE(STD_CCTYPE, 1, [Define if std:: prefix works for functions]) fi AC_MSG_RESULT([$sid_cv_cctype_std]) - + AC_MSG_CHECKING([whether __builtin_expect is supported]) AC_CACHE_VAL(sid_cv_builtin_expect, AC_TRY_COMPILE([],[ diff --git a/sid/include/sidattrutil.h b/sid/include/sidattrutil.h index 517375fab2..e23e2b6e05 100644 --- a/sid/include/sidattrutil.h +++ b/sid/include/sidattrutil.h @@ -2,7 +2,7 @@ // mappings between application objects and their string // representations. -*- C++ -*- -// Copyright (C) 1999, 2000 Red Hat. +// Copyright (C) 1999, 2000, 2002 Red Hat. // This file is part of SID and is licensed under the GPL. // See the file COPYING.SID for conditions for redistribution. @@ -27,18 +27,8 @@ #include - -#ifdef HAVE_EXT_HASH_MAP -#include -#define HAVE_HASHING 1 -#else -#ifdef HAVE_HASH_MAP -#include -#define HAVE_HASHING 1 -#else +// ? ? std::? __gnu_cxx::? Too much hassle. #undef HAVE_HASHING -#endif -#endif #if HAVE_SSTREAM #include @@ -693,7 +683,7 @@ make_attribute (const sid::any_int& value) operator () (const std::string& s) const { // XXX: improve? - return std::hash () (s.c_str ()); + return hash () (s.c_str ()); } }; #endif @@ -705,7 +695,7 @@ make_attribute (const sid::any_int& value) private: // use hash table for this, if available #ifdef HAVE_HASHING - typedef std::hash_map attribute_map_t; + typedef hash_map attribute_map_t; #else typedef std::map attribute_map_t; #endif diff --git a/sid/include/sidconfutil.in b/sid/include/sidconfutil.in index 63fca35372..2ffae0b820 100644 --- a/sid/include/sidconfutil.in +++ b/sid/include/sidconfutil.in @@ -6,12 +6,6 @@ /* Define if you have the strerror function. */ #undef HAVE_STRERROR -/* Define if you have the header file. */ -#undef HAVE_EXT_HASH_MAP - -/* Define if you have the header file. */ -#undef HAVE_HASH_MAP - /* Define if you have the header file. */ #undef HAVE_SSTREAM diff --git a/sid/include/sidcpuutil.h b/sid/include/sidcpuutil.h index 711e0e8abe..fff5900e59 100644 --- a/sid/include/sidcpuutil.h +++ b/sid/include/sidcpuutil.h @@ -226,11 +226,7 @@ namespace sidutil std::ofstream::open (filename.c_str (), std::ios::app); cout_p = false; } - private: bool cout_p; - - template friend - basic_cpu::cpu_trace_stream& operator<< (basic_cpu::cpu_trace_stream& s, T t); }; template friend diff --git a/sid/include/sidmiscutil.h b/sid/include/sidmiscutil.h index 8bc63d0a75..7a70bb4557 100644 --- a/sid/include/sidmiscutil.h +++ b/sid/include/sidmiscutil.h @@ -1,6 +1,6 @@ // sidmiscutil.h - Useful utility classes. -*- C++ -*- -// Copyright (C) 1999-2001 Red Hat. +// Copyright (C) 1999-2002 Red Hat. // This file is part of SID and is licensed under the GPL. // See the file COPYING.SID for conditions for redistribution. @@ -40,10 +40,10 @@ namespace sidutil bool find(const Obj1& one, Obj2& two) const { - forward_t::const_iterator it = this->forward.find(one); + typename forward_t::const_iterator it = this->forward.find(one); if (it != this->forward.end()) { - backward_t::const_iterator ti = this->backward.find(it->second); + typename backward_t::const_iterator ti = this->backward.find(it->second); assert (ti != this->backward.end()); two = it->second; return true; @@ -56,10 +56,10 @@ namespace sidutil bool find(const Obj2& two, Obj1& one) const { - backward_t::iterator ti = this->backward.find(two); + typename backward_t::iterator ti = this->backward.find(two); if (ti != this->backward.end()) { - forward_t::const_iterator it = this->forward.find(ti->second); + typename forward_t::const_iterator it = this->forward.find(ti->second); assert (it != this->forward.end()); one = ti->second; return true; -- 2.11.0