From 706d22e07004af4098e55fb6bd98c8ce709cdb1d Mon Sep 17 00:00:00 2001 From: cignoni Date: Fri, 2 Dec 2005 00:47:15 +0000 Subject: [PATCH] Enforced consistence of const parameters among all the funcs --- apps/trimeshinfo/Node.h | 2 +- apps/trimeshinfo/SlotsNode.h | 8 ++++---- apps/trimeshinfo/XMLTree.h | 28 ++++++++++++++-------------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/apps/trimeshinfo/Node.h b/apps/trimeshinfo/Node.h index f841d4b0..bf094158 100644 --- a/apps/trimeshinfo/Node.h +++ b/apps/trimeshinfo/Node.h @@ -75,4 +75,4 @@ enum values {VALUE_INTEGER, VALUE_FLOAT, VALUE_BOOL, VALUE_STRING}; //#define INSTANCES_NODE 9; //#define INSTANCE_NODE 10; -#endif \ No newline at end of file +#endif diff --git a/apps/trimeshinfo/SlotsNode.h b/apps/trimeshinfo/SlotsNode.h index fecaefec..1902479c 100644 --- a/apps/trimeshinfo/SlotsNode.h +++ b/apps/trimeshinfo/SlotsNode.h @@ -32,7 +32,7 @@ class EntryNode: public Node public: EntryNode(void){node_type = ENTRY_NODE; type = "empty";}; int node_type; - char* type; + const char* type; ValueNode value; void addValue(ValueNode vn); void setEntry(EntryNode en); @@ -64,12 +64,12 @@ class OwnSlotNode: public Node public: OwnSlotNode(void){node_type = OWNSLOT_NODE; name = "empty";}; int node_type; - char* name; + const char* name; EntryNode entry; virtual void printNode(); virtual int qualifyNode(); void addEntry(EntryNode en); - void setName(char* s){name = s;}; + void setName(const char* s){name = s;}; }; void OwnSlotNode::printNode() @@ -147,4 +147,4 @@ void SlotsNode::printNode() } int SlotsNode::qualifyNode() -{return node_type;} \ No newline at end of file +{return node_type;} diff --git a/apps/trimeshinfo/XMLTree.h b/apps/trimeshinfo/XMLTree.h index a28b4f1d..82641e6b 100644 --- a/apps/trimeshinfo/XMLTree.h +++ b/apps/trimeshinfo/XMLTree.h @@ -40,22 +40,22 @@ public: MainNode(void){node_type = MAIN_NODE;}; int node_type; - list > headers; + list > headers; - void addHeaders(char* str, char*val); + void addHeaders(const char* str, const char*val); virtual void printNode(); virtual int qualifyNode(); }; -void MainNode::addHeaders(char* str, char*val) +void MainNode::addHeaders(const char* str, const char*val) { - headers.push_back(pair(str,val)); + headers.push_back(pair(str,val)); } void MainNode::printNode() { cout<<"MainNode: node_type is "< >::iterator it; + list >::iterator it; for(it = headers.begin(); it!= headers.end(); ++it) { cout<<"MainNode: First element is "<< it->first<<"\n"; @@ -80,13 +80,13 @@ public: // methods void initializeMain(); void finalizeMain(); - void addHeaders(char* str, char*val); + void addHeaders(const char* str, const char*val); void addSlots(SlotNode* sn); // void addFacets(); void addClasses(ClassNode* cn); void addInstances(InstanceNode* in); - void addNode(char* s, int value_type, char* name); + void addNode(const char* s, int value_type, const char* name); void printXMLTree(); @@ -98,7 +98,7 @@ void XMLTree::initializeMain() MainNode* mn = new MainNode; //NodeGroup* ng = new NodeGroup; - mn->headers.push_back(pair("protegekb","")); + mn->headers.push_back(pair("protegekb","")); char* s1 = "http://www.w3.org/2001/XMLSchema-instance"; char* s2 = new(char[25]); @@ -136,16 +136,16 @@ void XMLTree::finalizeMain() addInstances(in); MainNode* mn = new MainNode; - mn->headers.push_back(pair("/",XML_SCHEMA_NAME)); + mn->headers.push_back(pair("/",XML_SCHEMA_NAME)); root.Sons.push_back(mn); } -void XMLTree::addHeaders(char* str, char*val) +void XMLTree::addHeaders(const char* str, const char*val) { MainNode* mn = (MainNode*) root.Sons.front(); - mn->headers.push_back(pair(str,val)); + mn->headers.push_back(pair(str,val)); } void XMLTree::addSlots(SlotNode* sn) @@ -166,7 +166,7 @@ void XMLTree::addClasses(ClassNode* cn) root.Sons.push_back(cn0); } -void XMLTree::addNode(char* s, int value_type, char* name) +void XMLTree::addNode(const char* s, int value_type, const char* name) { ValueNode* vn = new ValueNode; @@ -227,7 +227,7 @@ void XMLTree::printXMLTree() list::iterator it; list::iterator it2; list::iterator it3; - list >::iterator lit; + list >::iterator lit; MainNode* mn; SlotsNode* sns; SlotNode* sn; @@ -337,4 +337,4 @@ void XMLTree::printXMLTree() ++nn; } fclose(fp); -} \ No newline at end of file +}