Lots 'n lots of STL fixes to make it compiling for GCC 4+

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18152 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ithamar R. Adema 2006-07-14 20:51:34 +00:00
parent cf2ef43abd
commit 23e6780695
41 changed files with 120 additions and 83 deletions

View File

@ -30,9 +30,9 @@ class DiagramBox;
class DiagramItem
{
friend DiagramItemGroup;
friend DiagramView;
friend DiagramBox;
friend class DiagramItemGroup;
friend class DiagramView;
friend class DiagramBox;
public: // *** types

View File

@ -24,7 +24,7 @@ class DiagramEndPoint;
class DiagramWire : public DiagramItem
{
friend DiagramView;
friend class DiagramView;
public: // *** ctor/dtor

View File

@ -11,6 +11,7 @@ SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) RouteApp ] ;
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) TipManager ] ;
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) TransportView ] ;
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) support ] ;
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) expat xmlparse ] ;
SubDirCcFlags -DCORTEX_NAMESPACE=cortex ;

View File

@ -32,6 +32,8 @@
#include <MediaDefs.h>
#include <MediaRoster.h>
using namespace std;
__USE_CORTEX_NAMESPACE
#include <Debug.h>

View File

@ -40,8 +40,8 @@ class NodeRef;
class Connection {
// rather incestuous set of classes we've got here...
friend NodeRef;
friend NodeManager;
friend class NodeRef;
friend class NodeManager;
public: // *** types & constants
enum flag_t {

View File

@ -18,6 +18,8 @@
#include "node_manager_impl.h"
#include "functional_tools.h"
using namespace std;
__USE_CORTEX_NAMESPACE
#define D_METHOD(x) //PRINT (x)
#define D_ROSTER(x) //PRINT (x)

View File

@ -104,8 +104,8 @@ class NodeGroup :
typedef ObservableHandler _inherited;
friend NodeManager;
friend NodeRef;
friend class NodeManager;
friend class NodeRef;
public: // *** messages
enum message_t {
@ -542,7 +542,7 @@ private: // *** members
BString m_name;
// group contents
typedef vector<NodeRef*> node_set;
typedef std::vector<NodeRef*> node_set;
node_set m_nodes;
// flags & state

View File

@ -21,6 +21,8 @@
#include "node_manager_impl.h"
using namespace std;
__USE_CORTEX_NAMESPACE
#define D_METHOD(x) //PRINT (x)

View File

@ -71,9 +71,9 @@ class NodeManager :
// primary parent class:
typedef ObservableLooper _inherited;
friend NodeGroup;
friend NodeRef;
friend Connection;
friend class NodeGroup;
friend class NodeRef;
friend class Connection;
public: // *** messages
// [13aug99]
@ -521,17 +521,17 @@ private: // *** internal messages
private: // *** members
// the main NodeRef store
typedef map<media_node_id, NodeRef*> node_ref_map;
typedef std::map<media_node_id, NodeRef*> node_ref_map;
node_ref_map m_nodeRefMap;
// the Connection stores (connections are indexed by both
// source and destination node ID)
typedef multimap<media_node_id, Connection*> con_map;
typedef std::multimap<media_node_id, Connection*> con_map;
con_map m_conSourceMap;
con_map m_conDestinationMap;
// the NodeGroup store
typedef vector<NodeGroup*> node_group_set;
typedef std::vector<NodeGroup*> node_group_set;
node_group_set m_nodeGroupSet;
// common system nodes

View File

@ -25,6 +25,8 @@
// -------------------------------------------------------- //
using namespace std;
__USE_CORTEX_NAMESPACE
#define D_METHOD(x) //PRINT (x)

View File

@ -44,8 +44,8 @@ class NodeRef :
typedef ObservableHandler _inherited;
friend NodeManager;
friend NodeGroup;
friend class NodeManager;
friend class NodeGroup;
public: // *** messages
enum message_t {
@ -212,11 +212,11 @@ public: // *** connection access
// connection access: vector versions
status_t getInputConnections(
vector<Connection>& ioConnections,
std::vector<Connection>& ioConnections,
media_type filterType=B_MEDIA_UNKNOWN_TYPE) const;
status_t getOutputConnections(
vector<Connection>& ioConnections,
std::vector<Connection>& ioConnections,
media_type filterType=B_MEDIA_UNKNOWN_TYPE) const;
// connection access: flat array versions
@ -326,19 +326,19 @@ public: // *** BMediaRoster wrappers & convenience methods
// calls.)
status_t getFreeInputs(
vector<media_input>& ioInputs,
std::vector<media_input>& ioInputs,
media_type filterType=B_MEDIA_UNKNOWN_TYPE) const;
status_t getConnectedInputs(
vector<media_input>& ioInputs,
std::vector<media_input>& ioInputs,
media_type filterType=B_MEDIA_UNKNOWN_TYPE) const;
status_t getFreeOutputs(
vector<media_output>& ioOutputs,
std::vector<media_output>& ioOutputs,
media_type filterType=B_MEDIA_UNKNOWN_TYPE) const;
status_t getConnectedOutputs(
vector<media_output>& ioOutputs,
std::vector<media_output>& ioOutputs,
media_type filterType=B_MEDIA_UNKNOWN_TYPE) const;
@ -408,13 +408,13 @@ protected: // *** endpoint-fixing operations (no lock required)
media_input* inputs,
int32 count) const;
void _fixInputs(
vector<media_input>& inputs) const;
std::vector<media_input>& inputs) const;
void _fixOutputs(
media_output* outputs,
int32 count) const;
void _fixOutputs(
vector<media_output>& outputs) const;
std::vector<media_output>& outputs) const;
protected: // *** internal/NodeManager operations (LOCK REQUIRED)
@ -608,7 +608,7 @@ private: // *** members
bigtime_t m_positionUpdatePeriod;
static const bigtime_t s_defaultPositionUpdatePeriod = 50000LL;
MultiInvoker m_positionInvoker;
::MultiInvoker m_positionInvoker;
bigtime_t m_tpLastPositionUpdate;
bigtime_t m_lastPosition;

View File

@ -52,7 +52,7 @@ public: // *** public members
bool hasContent;
};
typedef list<element_entry> element_list;
typedef std::list<element_entry> element_list;
element_list m_elementStack;
public: // *** XML formatting helpers
@ -228,7 +228,7 @@ private: // members
IPersistent* object;
};
typedef list<object_entry> object_list;
typedef std::list<object_entry> object_list;
object_list m_objectStack;
private:

View File

@ -4,6 +4,8 @@
#include "ImportContext.h"
#include "xmlparse.h"
using namespace std;
__USE_CORTEX_NAMESPACE
// -------------------------------------------------------- //

View File

@ -31,7 +31,7 @@ public: // *** types
public: // *** ctor/dtor
virtual ~ImportContext();
ImportContext(
list<BString>& errors);
std::list<BString>& errors);
public: // *** accessors
@ -43,7 +43,7 @@ public: // *** accessors
// (returns 0 if the stack is empty or the current element is top-level)
const char* parentElement() const;
list<BString>& errors() const;
std::list<BString>& errors() const;
const state_t state() const;
public: // *** error-reporting operations
@ -64,11 +64,11 @@ protected: // *** internal operations
private: // *** members
state_t m_state;
list<BString>& m_errors;
std::list<BString>& m_errors;
list<BString> m_elementStack;
typedef pair<const char*, IPersistent*> object_entry;
list<object_entry> m_objectStack;
std::list<BString> m_elementStack;
typedef std::pair<const char*, IPersistent*> object_entry;
std::list<object_entry> m_objectStack;
void* m_pParser;
};

View File

@ -7,6 +7,8 @@
#include <Autolock.h>
#include <Debug.h>
using namespace std;
__USE_CORTEX_NAMESPACE
// -------------------------------------------------------- //

View File

@ -31,7 +31,7 @@ public: // *** ctor/dtor
// constructs a format-guessing Importer (uses the
// DocumentType registry)
Importer(
list<BString>& errors);
std::list<BString>& errors);
// the Importer takes ownership of the given context!
Importer(
@ -40,7 +40,7 @@ public: // *** ctor/dtor
// constructs a manual Importer; the given root
// object is populated
Importer(
list<BString>& errors,
std::list<BString>& errors,
IPersistent* rootObject,
XML::DocumentType* docType);

View File

@ -11,6 +11,8 @@
#include <vector>
#include <utility>
using namespace std;
__USE_CORTEX_NAMESPACE
// -------------------------------------------------------- //
@ -546,4 +548,4 @@ status_t MessageIO::_exportField(
return B_OK;
}
// END -- MessageIO.cpp --
// END -- MessageIO.cpp --

View File

@ -10,6 +10,8 @@
#include "array_delete.h"
#include "set_tools.h"
using namespace std;
__USE_CORTEX_NAMESPACE
// -------------------------------------------------------- //

View File

@ -35,6 +35,8 @@
#include "cortex_defs.h"
__BEGIN_CORTEX_NAMESPACE
class Importer;
// -------------------------------------------------------- //
// class XML
// -------------------------------------------------------- //
@ -65,7 +67,7 @@ public: // *** import/export operations
static status_t Identify(
BDataIO* stream,
DocumentType** outType,
list<BString>* outErrors);
std::list<BString>* outErrors);
// create & populate the root object from the given
// XML stream.
@ -78,7 +80,7 @@ public: // *** import/export operations
static status_t Read(
BDataIO* stream,
IPersistent** outObject,
list<BString>* outErrors);
std::list<BString>* outErrors);
static status_t Read(
BDataIO* stream,
@ -99,7 +101,7 @@ public: // *** import/export operations
BDataIO* stream,
IPersistent* rootObject,
XML::DocumentType* documentType,
list<BString>* outErrors);
std::list<BString>* outErrors);
static status_t Read(
BDataIO* stream,
@ -117,7 +119,7 @@ public: // *** import/export operations
private: // static members
typedef map<BString, DocumentType*> doc_type_map;
typedef std::map<BString, DocumentType*> doc_type_map;
static doc_type_map s_docTypeMap;
static BLocker s_docTypeLock;
@ -126,7 +128,7 @@ private: // implementation
static status_t _DoRead(
BDataIO* stream,
Importer& i,
list<BString>* outErrors); //nyi
std::list<BString>* outErrors); //nyi
};
// -------------------------------------------------------- //
@ -162,7 +164,7 @@ public: // *** 'factory' interface
private: // implementation
typedef set<XMLElementMapping*, _mapping_ptr_less> mapping_set;
typedef std::set<XMLElementMapping*, _mapping_ptr_less> mapping_set;
mapping_set m_mappingSet;
};

View File

@ -50,7 +50,7 @@ public:
};
// compare pointers to Mappings by element name
struct _mapping_ptr_less : public binary_function<XMLElementMapping*,XMLElementMapping*,bool> {
struct _mapping_ptr_less : public std::binary_function<XMLElementMapping*,XMLElementMapping*,bool> {
public:
bool operator()(const XMLElementMapping* a, const XMLElementMapping* b) const {
return a->element < b->element;

View File

@ -11,6 +11,8 @@
#include <vector>
#include <Debug.h>
using namespace std;
__USE_CORTEX_NAMESPACE
// -------------------------------------------------------- //
@ -496,4 +498,4 @@ void ConnectionIO::xmlImportChildComplete(
m_importState = IMPORT_NONE;
}
// END -- ConnectionIO.cpp --
// END -- ConnectionIO.cpp --

View File

@ -10,6 +10,7 @@ SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) Persistence Wrappers ] ;
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) TipManager ] ;
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) TransportView ] ;
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) support ] ;
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) expat xmlparse ] ;
SubDirCcFlags -DCORTEX_NAMESPACE=cortex ;

View File

@ -67,8 +67,8 @@ public: // *** operations
private: // implementation
// the node/key set
typedef pair<BString,media_node_id> node_entry;
typedef vector<node_entry> node_set;
typedef std::pair<BString,media_node_id> node_entry;
typedef std::vector<node_entry> node_set;
node_set m_nodes;
// next node key value
@ -76,4 +76,4 @@ private: // implementation
};
__END_CORTEX_NAMESPACE
#endif /*__NodeSetIOContext_H__*/
#endif /*__NodeSetIOContext_H__*/

View File

@ -31,6 +31,8 @@
extern "C" void SetNewLeakChecking(bool);
extern "C" void SetMallocLeakChecking(bool);
using namespace std;
__USE_CORTEX_NAMESPACE
const char* const RouteApp::s_settingsDirectory = "Cortex";

View File

@ -31,6 +31,8 @@
#include "set_tools.h"
using namespace std;
__USE_CORTEX_NAMESPACE
#define D_METHOD(x) //PRINT (x)

View File

@ -185,7 +185,7 @@ private: // implementation
// KEY:
// high 32 bits: media_node_id
// low 32 bits: icon_size
typedef map<uint64, MediaIcon*> icon_map;
typedef std::map<uint64, MediaIcon*> icon_map;
icon_map m_iconMap;
// class import_state* m_importState;
@ -208,4 +208,4 @@ private:
};
__END_CORTEX_NAMESPACE
#endif /*__RouteAppNodeManager_H__*/
#endif /*__RouteAppNodeManager_H__*/

View File

@ -326,7 +326,7 @@ StatusView::drawInto(BView *v, BRect updateRect)
void StatusView::setMessage(
BString &title,
BString &details,
status_t error = B_OK) {
status_t error) {
D_OPERATION(("StatusView::setMessage(%s)\n", title.String()));
// get the tip manager instance and reset

View File

@ -15,6 +15,8 @@
//#include "debug_tools.h"
using namespace std;
__USE_CORTEX_NAMESPACE
// -------------------------------------------------------- //

View File

@ -102,7 +102,7 @@ class tip_entry_ptr_less_fn { public:
}
};
typedef set<tip_entry*, tip_entry_ptr_less_fn > tip_entry_set;
typedef std::set<tip_entry*, tip_entry_ptr_less_fn > tip_entry_set;
// -------------------------------------------------------- //
// _ViewEntry
@ -144,7 +144,7 @@ public: // *** interface
// match the given point (in target's view coordinates)
// against tips in this view and child views.
pair<BView*, const tip_entry*> match(
std::pair<BView*, const tip_entry*> match(
BPoint point,
BPoint screenPoint);
@ -168,7 +168,7 @@ private:
_ViewEntry* m_parent;
// [e.moon 13oct99] child view list now stores pointers
list<_ViewEntry*> m_childViews;
std::list<_ViewEntry*> m_childViews;
tip_entry_set m_tips;
};
@ -208,7 +208,7 @@ public: // *** interface
// match the given point (in screen coordinates)
// against tips in this view and child views.
pair<BView*, const tip_entry*> match(
std::pair<BView*, const tip_entry*> match(
BPoint screenPoint);
BWindow* target() const { return m_target; }
@ -222,7 +222,7 @@ private:
BWindow* m_target;
// view subtrees with tip entries
list<_ViewEntry*> m_views;
std::list<_ViewEntry*> m_views;
};
// -------------------------------------------------------- //
@ -318,7 +318,7 @@ private: // implementation
TipManager* m_manager;
// set of window entries containing one or more bound tip rectangles
list<_WindowEntry*> m_windows;
std::list<_WindowEntry*> m_windows;
// update message source
BMessageRunner* m_messageRunner;

View File

@ -7,6 +7,8 @@
#include <cmath>
#include <cstring>
using namespace std;
__USE_CORTEX_NAMESPACE
// -------------------------------------------------------- //
@ -205,4 +207,4 @@ float TipView::_textHeight() {
return height;
}
// END -- TipView.cpp --
// END -- TipView.cpp --

View File

@ -60,7 +60,7 @@ private: // implementation
rgb_color m_viewColor;
typedef vector<int32> line_set;
typedef std::vector<int32> line_set;
line_set m_lineSet;
private:
@ -81,4 +81,4 @@ private:
};
__END_CORTEX_NAMESPACE
#endif /*__TipView_H__*/
#endif /*__TipView_H__*/

View File

@ -13,7 +13,7 @@ __USE_CORTEX_NAMESPACE
TipWindow::~TipWindow() {}
TipWindow::TipWindow(
const char* text=0) :
const char* text) :
BWindow(
BRect(0,0,0,0),
"TipWindow",
@ -125,4 +125,4 @@ void TipWindow::_destroyTipView() {
m_tipView = 0;
}
// END -- TipWindow.cpp --
// END -- TipWindow.cpp --

View File

@ -26,6 +26,8 @@
#include <algorithm>
#include <functional>
using namespace std;
__USE_CORTEX_NAMESPACE
// -------------------------------------------------------- //

View File

@ -124,8 +124,8 @@ protected: // *** layout
void _updateLayout();
private:
friend _GroupInfoView;
friend TransportWindow;
friend class _GroupInfoView;
friend class TransportWindow;
// logical
NodeManager* m_manager;
@ -145,7 +145,7 @@ private:
BButton* m_stopButton;
BButton* m_prerollButton;
typedef list<BInvoker*> target_set;
typedef std::list<BInvoker*> target_set;
target_set m_localTargets;
target_set m_groupTargets;

View File

@ -13,6 +13,8 @@
#include <functional>
#include <cstdio>
using namespace std;
__USE_CORTEX_NAMESPACE
// -------------------------------------------------------- //

View File

@ -344,7 +344,7 @@ protected: // impl. members
// the set of visible segments and other child views,
// in left-to-right. top-to-bottom order
typedef vector<ValCtrlLayoutEntry> layout_set;
typedef std::vector<ValCtrlLayoutEntry> layout_set;
layout_set m_layoutSet;
// true if value has been changed since last request

View File

@ -8,6 +8,8 @@
#include <strstream>
using namespace std;
string point_to_string(const BPoint& p) {
strstream out;
out << '(' << p.x << ',' << p.y << ')';

View File

@ -24,9 +24,9 @@
#include <Point.h>
#include <Rect.h>
string point_to_string(const BPoint& p);
string rect_to_string(const BRect& r);
string id_to_string(uint32 n);
std::string point_to_string(const BPoint& p);
std::string rect_to_string(const BRect& r);
std::string id_to_string(uint32 n);
void show_alert(char* pFormat, ...); //nyi

View File

@ -28,7 +28,7 @@ __BEGIN_CORTEX_NAMESPACE
// 27jul99: functor adaptor "call a given method of a given object with argument"
template<class _retT, class _subjectT, class _objectT>
class bound_method_t : public unary_function<_objectT*, _retT> {
class bound_method_t : public std::unary_function<_objectT*, _retT> {
public:
explicit bound_method_t(
// the bound instance on which the method will be called
@ -47,7 +47,7 @@ private:
// 27jul99: functor adaptor "call a given method of a given object with argument"
template<class _retT, class _subjectT, class _objectT>
class bound_const_method_t : public unary_function<const _objectT*, _retT> {
class bound_const_method_t : public std::unary_function<const _objectT*, _retT> {
public:
explicit bound_const_method_t(
// the bound instance on which the method will be called
@ -65,7 +65,7 @@ private:
};
template<class _retT, class _subjectT, class _objectT>
class bound_method_ref_t : public unary_function<_objectT&, _retT> {
class bound_method_ref_t : public std::unary_function<_objectT&, _retT> {
public:
explicit bound_method_ref_t(
// the bound instance on which the method will be called
@ -83,7 +83,7 @@ private:
};
template<class _retT, class _subjectT, class _objectT>
class bound_const_method_ref_t : public unary_function<const _objectT&, _retT> {
class bound_const_method_ref_t : public std::unary_function<const _objectT&, _retT> {
public:
explicit bound_const_method_ref_t(
// the bound instance on which the method will be called
@ -105,7 +105,7 @@ private:
// 27jul99: functor adaptor "call a given method of a given object with argument"
// + an additional argument
template<class _retT, class _subjectT, class _objectT, class _arg1T>
class bound_method1_t : public binary_function<_objectT*,_arg1T,_retT> {
class bound_method1_t : public std::binary_function<_objectT*,_arg1T,_retT> {
public:
explicit bound_method1_t(
// the bound instance on which the method will be called
@ -125,7 +125,7 @@ private:
// 27jul99: functor adaptor "call a given method of a given object with argument"
template<class _retT, class _subjectT, class _objectT, class _arg1T>
class bound_const_method1_t : public binary_function<const _objectT*,_arg1T,_retT> {
class bound_const_method1_t : public std::binary_function<const _objectT*,_arg1T,_retT> {
public:
explicit bound_const_method1_t(
// the bound instance on which the method will be called
@ -143,7 +143,7 @@ private:
};
template<class _retT, class _subjectT, class _objectT, class _arg1T>
class bound_method_ref1_t : public binary_function<_objectT&,_arg1T,_retT> {
class bound_method_ref1_t : public std::binary_function<_objectT&,_arg1T,_retT> {
public:
explicit bound_method_ref1_t(
// the bound instance on which the method will be called
@ -161,7 +161,7 @@ private:
};
template<class _retT, class _subjectT, class _objectT, class _arg1T>
class bound_const_method_ref1_t : public binary_function<const _objectT&,_arg1T,_retT> {
class bound_const_method_ref1_t : public std::binary_function<const _objectT&,_arg1T,_retT> {
public:
explicit bound_const_method_ref1_t(
// the bound instance on which the method will be called

View File

@ -9,6 +9,7 @@
#define __Observe_H__
#include <Messenger.h>
#include <Debug.h>
#include "cortex_defs.h"
__BEGIN_CORTEX_NAMESPACE
@ -159,7 +160,7 @@ public: // interface
_observer_messenger,
_target_messenger,
reply,
timeout);
_timeout);
if(err < B_OK) {
PRINT((
"! observer_handle<>::release(): remove_observer() failed:\n"

View File

@ -37,10 +37,10 @@ void ptr_map_delete(iter begin, iter end) {
// a simple equality-test functor for maps
template<class key, class value>
class map_value_equal_to :
public binary_function<pair<key,value>, value, bool> {
public std::binary_function<std::pair<key,value>, value, bool> {
public:
bool operator()(const pair<key,value>& p, const value& v) const {
bool operator()(const std::pair<key,value>& p, const value& v) const {
return p.second == v;
}
};
@ -55,7 +55,7 @@ public:
//
//public:
// map_value_predicate_t(const unary_function<const value, bool>& _fn) : fn(_fn) {}
// bool operator()(const pair<key,value>& p) const {
// bool operator()(const std::pair<key,value>& p) const {
// return fn(p.second);
// }
//};
@ -79,7 +79,7 @@ void map_value_copy(input_iter begin, input_iter end, output_iter to) {
// adapt a unary functor to a map (eek)
template <class pairT, class opT>
class unary_map_function_t :
public unary_function<typename opT::argument_type, typename opT::result_type> {
public std::unary_function<typename opT::argument_type, typename opT::result_type> {
opT f;
@ -102,4 +102,4 @@ unary_map_function(
__END_CORTEX_NAMESPACE
#endif /* __SET_TOOLS_H__ */
#endif /* __SET_TOOLS_H__ */