diff -r a47fd7c2d44e -r c547582fa0ee SConstruct --- a/SConstruct Fri Apr 06 17:51:47 2012 -0700 +++ b/SConstruct Sun Apr 08 15:03:34 2012 +0100 @@ -486,7 +486,7 @@ main['GCC'] = CXX_version and CXX_version.find('g++') >= 0 main['SUNCC'] = CXX_V and CXX_V.find('Sun C++') >= 0 main['ICC'] = CXX_V and CXX_V.find('Intel') >= 0 -main['CLANG'] = CXX_V and CXX_V.find('clang') >= 0 +main['CLANG'] = CXX_version and CXX_version.find('clang') >= 0 if main['GCC'] + main['SUNCC'] + main['ICC'] + main['CLANG'] > 1: print 'Error: How can we have two at the same time?' Exit(1) @@ -496,7 +496,6 @@ main.Append(CCFLAGS=['-pipe']) main.Append(CCFLAGS=['-fno-strict-aliasing']) main.Append(CCFLAGS=['-Wall', '-Wno-sign-compare', '-Wundef']) - main.Append(CXXFLAGS=['-Wno-deprecated']) # Read the GCC version to check for versions with bugs # Note CCVERSION doesn't work here because it is run with the CC # before we override it from the command line @@ -506,6 +505,8 @@ not compareVersions(gcc_version, '4.4.2'): print 'Info: Tree vectorizer in GCC 4.4.1 & 4.4.2 is buggy, disabling.' main.Append(CCFLAGS=['-fno-tree-vectorize']) + if compareVersions(gcc_version, '4.6') >= 0: + main.Append(CXXFLAGS=['-std=c++0x']) elif main['ICC']: pass #Fix me... add warning flags once we clean up icc warnings elif main['SUNCC']: @@ -533,6 +534,7 @@ main.Append(CCFLAGS=['-Wall', '-Wno-sign-compare', '-Wundef']) main.Append(CCFLAGS=['-Wno-tautological-compare']) main.Append(CCFLAGS=['-Wno-self-assign']) + main.Append(CXXFLAGS=['-std=c++0x']) else: print 'Error: Don\'t know what compiler options to use for your compiler.' print ' Please fix SConstruct and src/SConscript and try again.' diff -r a47fd7c2d44e -r c547582fa0ee ext/libelf/SConscript --- a/ext/libelf/SConscript Fri Apr 06 17:51:47 2012 -0700 +++ b/ext/libelf/SConscript Sun Apr 08 15:03:34 2012 +0100 @@ -32,6 +32,8 @@ Import('main') +from m5.util import compareVersions + elf_files = [] def ElfFile(filename): elf_files.append(File(filename)) @@ -91,8 +93,7 @@ m4env = main.Clone() if m4env['GCC']: - major,minor,dot = [int(x) for x in m4env['GCC_VERSION'].split('.')] - if major >= 4: + if compareVersions(m4env['GCC_VERSION'], '4') >= 0: m4env.Append(CCFLAGS=['-Wno-pointer-sign']) if m4env['CLANG']: m4env.Append(CCFLAGS=['-Wno-initializer-overrides', '-Wno-pointer-sign']) diff -r a47fd7c2d44e -r c547582fa0ee src/SConscript --- a/src/SConscript Fri Apr 06 17:51:47 2012 -0700 +++ b/src/SConscript Sun Apr 08 15:03:34 2012 +0100 @@ -790,7 +790,7 @@ namespace { -const char data_${sym}[] = { +const uint8_t data_${sym}[] = { ''') code.indent() step = 16 @@ -852,7 +852,7 @@ swig_env.Append(CCFLAGS='-Wno-sign-compare') swig_env.Append(CCFLAGS='-Wno-parentheses') swig_env.Append(CCFLAGS='-Wno-unused-label') - if compareVersions(env['GCC_VERSION'], '4.6.0') != -1: + if compareVersions(env['GCC_VERSION'], '4.6') >= 0: swig_env.Append(CCFLAGS='-Wno-unused-but-set-variable') if env['CLANG']: swig_env.Append(CCFLAGS=['-Wno-unused-label']) @@ -925,7 +925,7 @@ # Debug binary ccflags = {} -if env['GCC'] or env['CLANG']: +if env['GCC']: if sys.platform == 'sunos5': ccflags['debug'] = '-gstabs+' else: @@ -943,6 +943,11 @@ ccflags['opt'] = '-g -O' ccflags['fast'] = '-fast' ccflags['prof'] = '-fast -g -pg' +elif env['CLANG']: + ccflags['debug'] = '-g -O0' + ccflags['opt'] = '-g -O3' + ccflags['fast'] = '-O3' + ccflags['prof'] = '-O3 -g -pg' else: print 'Unknown compiler, please fix compiler options' Exit(1) diff -r a47fd7c2d44e -r c547582fa0ee src/arch/alpha/isa/main.isa --- a/src/arch/alpha/isa/main.isa Fri Apr 06 17:51:47 2012 -0700 +++ b/src/arch/alpha/isa/main.isa Sun Apr 08 15:03:34 2012 +0100 @@ -70,7 +70,7 @@ }}; output exec {{ -#include +#include #include "arch/alpha/registers.hh" #include "arch/alpha/regredir.hh" diff -r a47fd7c2d44e -r c547582fa0ee src/arch/alpha/mt.hh --- a/src/arch/alpha/mt.hh Fri Apr 06 17:51:47 2012 -0700 +++ b/src/arch/alpha/mt.hh Sun Apr 08 15:03:34 2012 +0100 @@ -44,7 +44,6 @@ #include "base/bitfield.hh" #include "base/misc.hh" #include "base/trace.hh" -using namespace std; namespace AlphaISA { diff -r a47fd7c2d44e -r c547582fa0ee src/arch/arm/isa/includes.isa --- a/src/arch/arm/isa/includes.isa Fri Apr 06 17:51:47 2012 -0700 +++ b/src/arch/arm/isa/includes.isa Sun Apr 08 15:03:34 2012 +0100 @@ -94,6 +94,6 @@ #include "sim/sim_exit.hh" using namespace ArmISA; -using std::isnan; + }}; diff -r a47fd7c2d44e -r c547582fa0ee src/arch/arm/types.hh --- a/src/arch/arm/types.hh Fri Apr 06 17:51:47 2012 -0700 +++ b/src/arch/arm/types.hh Sun Apr 08 15:03:34 2012 +0100 @@ -540,13 +540,13 @@ } // namespace ArmISA -namespace __hash_namespace { +__hash_namespace_begin template<> struct hash : public hash { size_t operator()(const ArmISA::ExtMachInst &emi) const { return hash::operator()((uint32_t)emi); }; }; -} +__hash_namespace_end #endif diff -r a47fd7c2d44e -r c547582fa0ee src/arch/mips/isa/includes.isa --- a/src/arch/mips/isa/includes.isa Fri Apr 06 17:51:47 2012 -0700 +++ b/src/arch/mips/isa/includes.isa Sun Apr 08 15:03:34 2012 +0100 @@ -45,7 +45,7 @@ }}; output decoder {{ -#include +#include #include "arch/mips/dsp.hh" #include "arch/mips/dt_constants.hh" @@ -69,7 +69,7 @@ }}; output exec {{ -#include +#include #include "arch/generic/memhelpers.hh" #include "arch/mips/dsp.hh" diff -r a47fd7c2d44e -r c547582fa0ee src/arch/power/isa/includes.isa --- a/src/arch/power/isa/includes.isa Fri Apr 06 17:51:47 2012 -0700 +++ b/src/arch/power/isa/includes.isa Sun Apr 08 15:03:34 2012 +0100 @@ -66,7 +66,6 @@ #include "cpu/thread_context.hh" using namespace PowerISA; -using std::isnan; }}; output exec {{ @@ -87,6 +86,5 @@ #include "sim/sim_exit.hh" using namespace PowerISA; -using std::isnan; }}; diff -r a47fd7c2d44e -r c547582fa0ee src/arch/power/types.hh --- a/src/arch/power/types.hh Fri Apr 06 17:51:47 2012 -0700 +++ b/src/arch/power/types.hh Sun Apr 08 15:03:34 2012 +0100 @@ -89,7 +89,7 @@ } // PowerISA namespace -namespace __hash_namespace { +__hash_namespace_begin template<> struct hash : public hash { @@ -98,6 +98,6 @@ }; }; -} // namespace __hash_namespace +__hash_namespace_end #endif // __ARCH_POWER_TYPES_HH__ diff -r a47fd7c2d44e -r c547582fa0ee src/arch/sparc/isa/decoder.isa --- a/src/arch/sparc/isa/decoder.isa Fri Apr 06 17:51:47 2012 -0700 +++ b/src/arch/sparc/isa/decoder.isa Sun Apr 08 15:03:34 2012 +0100 @@ -683,7 +683,7 @@ 0x47: FpUnimpl::fmovrqlez(); 0x51: fcmps({{ uint8_t fcc; - if (isnan(Frs1s) || isnan(Frs2s)) + if (std::isnan(Frs1s) || std::isnan(Frs2s)) fcc = 3; else if (Frs1s < Frs2s) fcc = 1; @@ -698,7 +698,7 @@ }}); 0x52: fcmpd({{ uint8_t fcc; - if (isnan(Frs1) || isnan(Frs2)) + if (std::isnan(Frs1) || std::isnan(Frs2)) fcc = 3; else if (Frs1 < Frs2) fcc = 1; @@ -714,7 +714,7 @@ 0x53: FpUnimpl::fcmpq(); 0x55: fcmpes({{ uint8_t fcc = 0; - if (isnan(Frs1s) || isnan(Frs2s)) + if (std::isnan(Frs1s) || std::isnan(Frs2s)) fault = new FpExceptionIEEE754; if (Frs1s < Frs2s) fcc = 1; @@ -727,7 +727,7 @@ }}); 0x56: fcmped({{ uint8_t fcc = 0; - if (isnan(Frs1) || isnan(Frs2)) + if (std::isnan(Frs1) || std::isnan(Frs2)) fault = new FpExceptionIEEE754; if (Frs1 < Frs2) fcc = 1; diff -r a47fd7c2d44e -r c547582fa0ee src/arch/sparc/mt.hh --- a/src/arch/sparc/mt.hh Fri Apr 06 17:51:47 2012 -0700 +++ b/src/arch/sparc/mt.hh Sun Apr 08 15:03:34 2012 +0100 @@ -44,7 +44,6 @@ #include "base/bitfield.hh" #include "base/misc.hh" #include "base/trace.hh" -using namespace std; namespace SparcISA { diff -r a47fd7c2d44e -r c547582fa0ee src/arch/sparc/tlb_map.hh --- a/src/arch/sparc/tlb_map.hh Fri Apr 06 17:51:47 2012 -0700 +++ b/src/arch/sparc/tlb_map.hh Sun Apr 08 15:03:34 2012 +0100 @@ -98,7 +98,7 @@ if (intersect(r)) return tree.end(); - return tree.insert(std::make_pair(r, d)).first; + return tree.insert(std::make_pair(r, d)).first; } size_t diff -r a47fd7c2d44e -r c547582fa0ee src/arch/x86/isa/microops/fpop.isa --- a/src/arch/x86/isa/microops/fpop.isa Fri Apr 06 17:51:47 2012 -0700 +++ b/src/arch/x86/isa/microops/fpop.isa Sun Apr 08 15:03:34 2012 +0100 @@ -285,7 +285,7 @@ // OF = SF = AF = 0 ccFlagBits = ccFlagBits & ~(OFBit | SFBit | AFBit | ZFBit | PFBit | CFBit); - if (isnan(FpSrcReg1) || isnan(FpSrcReg2)) + if (std::isnan(FpSrcReg1) || std::isnan(FpSrcReg2)) ccFlagBits = ccFlagBits | (ZFBit | PFBit | CFBit); else if(FpSrcReg1 < FpSrcReg2) ccFlagBits = ccFlagBits | CFBit; diff -r a47fd7c2d44e -r c547582fa0ee src/arch/x86/isa/microops/mediaop.isa --- a/src/arch/x86/isa/microops/mediaop.isa Fri Apr 06 17:51:47 2012 -0700 +++ b/src/arch/x86/isa/microops/mediaop.isa Sun Apr 08 15:03:34 2012 +0100 @@ -1404,7 +1404,7 @@ } uint64_t resBits = 0; - bool nanop = isnan(arg1) || isnan(arg2); + bool nanop = std::isnan(arg1) || std::isnan(arg2); switch (ext & mask(3)) { case 0: if (arg1 == arg2 && !nanop) @@ -1492,7 +1492,7 @@ // OF = SF = AF = 0 ccFlagBits = ccFlagBits & ~(OFBit | SFBit | AFBit | ZFBit | PFBit | CFBit); - if (isnan(arg1) || isnan(arg2)) + if (std::isnan(arg1) || std::isnan(arg2)) ccFlagBits = ccFlagBits | (ZFBit | PFBit | CFBit); else if(arg1 < arg2) ccFlagBits = ccFlagBits | CFBit; diff -r a47fd7c2d44e -r c547582fa0ee src/arch/x86/types.hh --- a/src/arch/x86/types.hh Fri Apr 06 17:51:47 2012 -0700 +++ b/src/arch/x86/types.hh Sun Apr 08 15:03:34 2012 +0100 @@ -280,7 +280,7 @@ } -namespace __hash_namespace { +__hash_namespace_begin template<> struct hash { size_t operator()(const X86ISA::ExtMachInst &emi) const { @@ -298,7 +298,7 @@ emi.stackSize ^ emi.dispSize; }; }; -} +__hash_namespace_end // These two functions allow ExtMachInst to be used with SERIALIZE_SCALAR // and UNSERIALIZE_SCALAR. diff -r a47fd7c2d44e -r c547582fa0ee src/base/hashmap.hh --- a/src/base/hashmap.hh Fri Apr 06 17:51:47 2012 -0700 +++ b/src/base/hashmap.hh Sun Apr 08 15:03:34 2012 +0100 @@ -1,4 +1,16 @@ /* + * Copyright (c) 2012 ARM Limited + * All rights reserved + * + * The license below extends only to copyright in the software and shall + * not be construed as granting a license to any other intellectual + * property including but not limited to intellectual property relating + * to a hardware implementation of the functionality of the software + * licensed hereunder. You may use the software subject to the license + * terms below provided that you ensure that this notice is replicated + * unmodified and in its entirety in all distributions of the software, + * modified or unmodified, in source code or in binary form. + * * Copyright (c) 2003-2005 The Regents of The University of Michigan * All rights reserved. * @@ -26,29 +38,76 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Authors: Nathan Binkert + * Andreas Hansson */ #ifndef __HASHMAP_HH__ #define __HASHMAP_HH__ -#if defined(__GNUC__) && __GNUC__ >= 3 +#if defined(__GNUC__) + +// for compatibility with non-clang compilers +#ifndef __has_include +#define __has_include(x) 0 +#endif + +// for compilers that deprecate hash_map, i.e. gcc >= 4.3 and clang, +// use unordered_map, note that this does not cover the case of a 5.x +// version of gcc +#if (defined(__clang__) && __has_include()) || \ + (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) + +// gcc >= 4.3 or clang compiled against gcc >= 4.3 headers deprecate +// the use of ext/hash_map and use unordered_map and unordered_set +#define hash_map unordered_map +#define hash_multimap unordered_multimap +#define hash_set unordered_set +#define hash_multiset unordered_multiset + +// these versions also have an existing hash function for strings +#define HAVE_STRING_HASH 1 + +// to complicate life further, gcc >= 4.3 and <= 4.5 has the +// containers in the std::tr1 namespace, and only gcc >= 4.6 and clang +// adds the final container implementation in the std namespace +#if __has_include() || (__GNUC_MINOR__ >= 6) +// clang or gcc >= 4.6 +#include +#include +// note that this assumes that -std=c++0x is added to the command line +// which is done in the SConstruct CXXFLAGS for gcc >= 4.6 and clang +#define __hash_namespace std +#define __hash_namespace_begin namespace std { +#define __hash_namespace_end } +#else +// gcc >= 4.3 and < 4.6 +#include +#include +#define __hash_namespace std::tr1 +#define __hash_namespace_begin namespace std { namespace tr1 { +#define __hash_namespace_end } } +#endif +#else +// gcc < 4.3 #include #include +#define __hash_namespace __gnu_cxx +#define __hash_namespace_begin namespace std { +#define __hash_namespace_end } +#endif #else +// non GNU compiler #include #include +#define __hash_namsepace std +#define __hash_namespace_begin namespace std { +#define __hash_namespace_end } #endif #include #include "base/types.hh" -#if defined(__GNUC__) && __GNUC__ >= 3 - #define __hash_namespace __gnu_cxx -#else - #define __hash_namespace std -#endif - namespace m5 { using ::__hash_namespace::hash_multimap; using ::__hash_namespace::hash_multiset; @@ -62,7 +121,7 @@ // Some default Hashing Functions // -namespace __hash_namespace { +__hash_namespace_begin #if defined(__APPLE__) || !defined(__LP64__) && !defined(__alpha__) && !defined(__SUNPRO_CC) template<> struct hash { @@ -79,6 +138,9 @@ }; #endif +// if the hash functions for strings are not already defined, then +// declare them here +#if !defined(HAVE_STRING_HASH) template<> struct hash { size_t operator()(const std::string &s) const { @@ -92,6 +154,7 @@ return (__stl_hash_string(r.first.c_str())) ^ r.second; } }; -} // namespace __hash_namespace +#endif +__hash_namespace_end #endif // __HASHMAP_HH__ diff -r a47fd7c2d44e -r c547582fa0ee src/base/inifile.cc --- a/src/base/inifile.cc Fri Apr 06 17:51:47 2012 -0700 +++ b/src/base/inifile.cc Sun Apr 08 15:03:34 2012 +0100 @@ -29,6 +29,7 @@ * Steve Reinhardt */ +#include #include #include #include diff -r a47fd7c2d44e -r c547582fa0ee src/base/range.hh --- a/src/base/range.hh Fri Apr 06 17:51:47 2012 -0700 +++ b/src/base/range.hh Sun Apr 08 15:03:34 2012 +0100 @@ -316,7 +316,13 @@ inline bool operator<(const Range &range, const U &pos) { - return range.end < pos; + // with -std=gnu++0x, gcc and clang get confused when range.end is + // compared to pos using the operator "<", and the parser expects it + // to be the opening bracket for a template parameter, + // i.e. range.end(...);, the reason seems to be the range-type + // iteration introduced in c++11 where begin and end are members + // that return iterators + return operator<(range.end, pos); } /** diff -r a47fd7c2d44e -r c547582fa0ee src/base/stats/text.cc --- a/src/base/stats/text.cc Fri Apr 06 17:51:47 2012 -0700 +++ b/src/base/stats/text.cc Sun Apr 08 15:03:34 2012 +0100 @@ -166,7 +166,7 @@ { stringstream val; - if (!isnan(value)) { + if (!std::isnan(value)) { if (precision != -1) val.precision(precision); else if (value == rint(value)) @@ -211,15 +211,15 @@ ScalarPrint::operator()(ostream &stream) const { if ((flags.isSet(nozero) && value == 0.0) || - (flags.isSet(nonan) && isnan(value))) + (flags.isSet(nonan) && std::isnan(value))) return; stringstream pdfstr, cdfstr; - if (!isnan(pdf)) + if (!std::isnan(pdf)) ccprintf(pdfstr, "%.2f%%", pdf * 100.0); - if (!isnan(cdf)) + if (!std::isnan(cdf)) ccprintf(cdfstr, "%.2f%%", cdf * 100.0); ccprintf(stream, "%-40s %12s %10s %10s", name, diff -r a47fd7c2d44e -r c547582fa0ee src/mem/ruby/common/Address.hh --- a/src/mem/ruby/common/Address.hh Fri Apr 06 17:51:47 2012 -0700 +++ b/src/mem/ruby/common/Address.hh Sun Apr 08 15:03:34 2012 +0100 @@ -31,6 +31,7 @@ #include #include +#include #include "base/hashmap.hh" #include "mem/ruby/common/TypeDefines.hh" @@ -201,8 +202,7 @@ return (m_address >> number); } -class Address; -namespace __hash_namespace { +__hash_namespace_begin template <> struct hash
{ size_t @@ -211,7 +211,7 @@ return (size_t)s.getAddress(); } }; -} // namespace __hash_namespace +__hash_namespace_end namespace std { template <> struct equal_to
diff -r a47fd7c2d44e -r c547582fa0ee src/mem/ruby/common/NetDest.cc --- a/src/mem/ruby/common/NetDest.cc Fri Apr 06 17:51:47 2012 -0700 +++ b/src/mem/ruby/common/NetDest.cc Sun Apr 08 15:03:34 2012 +0100 @@ -26,6 +26,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include + #include "mem/ruby/common/NetDest.hh" NetDest::NetDest() diff -r a47fd7c2d44e -r c547582fa0ee src/mem/ruby/network/fault_model/FaultModel.hh --- a/src/mem/ruby/network/fault_model/FaultModel.hh Fri Apr 06 17:51:47 2012 -0700 +++ b/src/mem/ruby/network/fault_model/FaultModel.hh Sun Apr 08 15:03:34 2012 +0100 @@ -47,7 +47,6 @@ // C++ includes #include -using namespace std; // GEM5 includes #include "params/FaultModel.hh" @@ -112,7 +111,7 @@ int number_of_buff_per_data_vc, int number_of_buff_per_ctrl_vc); - string fault_type_to_string(int fault_type_index); + std::string fault_type_to_string(int fault_type_index); // the following 2 functions are called at runtime, to get the probability // of each fault type (fault_vector) or the aggregate fault probability @@ -134,9 +133,9 @@ void print(void); private: - vector configurations; - vector routers; - vector temperature_weights; + std::vector configurations; + std::vector routers; + std::vector temperature_weights; }; #endif // __MEM_RUBY_NETWORK_FAULT_MODEL_HH__ diff -r a47fd7c2d44e -r c547582fa0ee src/mem/ruby/network/fault_model/FaultModel.cc --- a/src/mem/ruby/network/fault_model/FaultModel.cc Fri Apr 06 17:51:47 2012 -0700 +++ b/src/mem/ruby/network/fault_model/FaultModel.cc Sun Apr 08 15:03:34 2012 +0100 @@ -37,11 +37,8 @@ * Proceedings of the 48th Design Automation Conference (DAC'11) */ -// C includes -#include -#include - // C++ includes +#include #include #include #include @@ -50,6 +47,8 @@ #include "FaultModel.hh" #include "base/misc.hh" +using namespace std; + #define MAX(a,b) ((a > b) ? (a) : (b)) diff -r a47fd7c2d44e -r c547582fa0ee src/mem/ruby/network/garnet/BaseGarnetNetwork.cc --- a/src/mem/ruby/network/garnet/BaseGarnetNetwork.cc Fri Apr 06 17:51:47 2012 -0700 +++ b/src/mem/ruby/network/garnet/BaseGarnetNetwork.cc Sun Apr 08 15:03:34 2012 +0100 @@ -33,6 +33,8 @@ #include "mem/ruby/network/Topology.hh" #include "mem/ruby/network/garnet/BaseGarnetNetwork.hh" +using namespace std; + BaseGarnetNetwork::BaseGarnetNetwork(const Params *p) : Network(p) { diff -r a47fd7c2d44e -r c547582fa0ee src/mem/ruby/network/orion/OrionConfig.hh --- a/src/mem/ruby/network/orion/OrionConfig.hh Fri Apr 06 17:51:47 2012 -0700 +++ b/src/mem/ruby/network/orion/OrionConfig.hh Sun Apr 08 15:03:34 2012 +0100 @@ -37,8 +37,6 @@ #include "mem/ruby/network/orion/Type.hh" -using namespace std; - class TechParameter; class OrionConfig @@ -56,12 +54,12 @@ void set_in_buf_num_set(uint32_t in_buf_num_set_); void set_flit_width(uint32_t flit_width_); - void read_file(const string& filename_); - void print_config(ostream& out_); + void read_file(const std::string& filename_); + void print_config(std::ostream& out_); public: template - T get(const string& key_) const; + T get(const std::string& key_) const; const TechParameter* get_tech_param_ptr() const { return m_tech_param_ptr; } uint32_t get_num_in_port() const { return m_num_in_port; } uint32_t get_num_out_port() const { return m_num_out_port; } @@ -71,7 +69,7 @@ uint32_t get_flit_width() const { return m_flit_width; } private: - map m_params_map; + std::map m_params_map; TechParameter* m_tech_param_ptr; uint32_t m_num_in_port; @@ -84,28 +82,28 @@ protected: struct key_not_found { - string m_key; - key_not_found(const string& key_ = string()) : m_key(key_) + std::string m_key; + key_not_found(const std::string& key_ = string()) : m_key(key_) {} }; template - static T string_as_T(const string& str_); + static T string_as_T(const std::string& str_); template - static string T_as_string(const T& t_); + static std::string T_as_string(const T& t_); private: - static string ms_param_name[]; + static std::string ms_param_name[]; }; template T OrionConfig::get(const string& key_) const { - map::const_iterator it; + std::map::const_iterator it; it = m_params_map.find(key_); if (it == m_params_map.end()) { - cerr << key_ << " NOT FOUND!" << endl; + std::cerr << key_ << " NOT FOUND!" << std::endl; throw key_not_found(key_); } return string_as_T(it->second); @@ -140,7 +138,8 @@ } else { - cerr << "Invalid bool value: '" << str_ << "'. Treated as FALSE." << endl; + std::cerr << "Invalid bool value: '" << str_ << + "'. Treated as FALSE." << std::endl; ret = false; } return ret; diff -r a47fd7c2d44e -r c547582fa0ee src/mem/ruby/network/orion/OrionRouter.cc --- a/src/mem/ruby/network/orion/OrionRouter.cc Fri Apr 06 17:51:47 2012 -0700 +++ b/src/mem/ruby/network/orion/OrionRouter.cc Sun Apr 08 15:03:34 2012 +0100 @@ -43,6 +43,8 @@ #include "mem/ruby/network/orion/OrionConfig.hh" #include "OrionRouter.hh" +using namespace std; + OrionRouter::OrionRouter( uint32_t num_in_port_, uint32_t num_out_port_, diff -r a47fd7c2d44e -r c547582fa0ee src/mem/ruby/network/orion/TechParameter.hh --- a/src/mem/ruby/network/orion/TechParameter.hh Fri Apr 06 17:51:47 2012 -0700 +++ b/src/mem/ruby/network/orion/TechParameter.hh Sun Apr 08 15:03:34 2012 +0100 @@ -40,8 +40,6 @@ #include "mem/ruby/network/orion/Type.hh" -using namespace std; - class OrionConfig; class TechParameter diff -r a47fd7c2d44e -r c547582fa0ee src/sim/init.hh --- a/src/sim/init.hh Fri Apr 06 17:51:47 2012 -0700 +++ b/src/sim/init.hh Sun Apr 08 15:03:34 2012 +0100 @@ -36,6 +36,8 @@ */ #include +#include + #ifndef PyObject_HEAD struct _object; typedef _object PyObject; @@ -46,12 +48,12 @@ const char *filename; const char *abspath; const char *modpath; - const char *code; + const uint8_t *code; int zlen; int len; EmbeddedPython(const char *filename, const char *abspath, - const char *modpath, const char *code, int zlen, int len); + const char *modpath, const uint8_t *code, int zlen, int len); PyObject *getCode() const; bool addModule() const; diff -r a47fd7c2d44e -r c547582fa0ee src/sim/init.cc --- a/src/sim/init.cc Fri Apr 06 17:51:47 2012 -0700 +++ b/src/sim/init.cc Sun Apr 08 15:03:34 2012 +0100 @@ -113,7 +113,7 @@ EmbeddedPython *EmbeddedPython::importer = NULL; PyObject *EmbeddedPython::importerModule = NULL; EmbeddedPython::EmbeddedPython(const char *filename, const char *abspath, - const char *modpath, const char *code, int zlen, int len) + const char *modpath, const unsigned char *code, int zlen, int len) : filename(filename), abspath(abspath), modpath(modpath), code(code), zlen(zlen), len(len) {