Add constness to Parms::m_xml

This commit is contained in:
Ai Lin Chia
2016-04-17 23:25:19 +02:00
parent 853a4b9570
commit e3fbd4ba9e
3 changed files with 7 additions and 7 deletions

@ -164,7 +164,7 @@ class Parm {
const char *m_desc; // description of variable displayed on admin gui page
const char *m_cgi; // cgi name, contains %i if an array
char *m_xml; // default to rendition of m_title if NULL
const char *m_xml; // default to rendition of m_title if NULL
int32_t m_off; // this variable's offset into the CollectionRec class
char m_colspan;
char m_type; // TYPE_BOOL, TYPE_LONG, ...

@ -113,10 +113,10 @@ int32_t Xml::getEndNode ( int32_t num ) {
return i;
}
int64_t Xml::getCompoundHash ( char *s , int32_t len ) const {
int64_t Xml::getCompoundHash ( const char *s , int32_t len ) const {
// setup
char *p = s;
char *start = s;
const char *p = s;
const char *start = s;
int32_t i = 0;
int64_t h = 0;
loop:
@ -139,7 +139,7 @@ int64_t Xml::getCompoundHash ( char *s , int32_t len ) const {
// . return -1 if not found
// . "tagName" is compound (i.e. "myhouse.myroom" )
int32_t Xml::getNodeNum ( int32_t n0 , int32_t n1 , char *tagName , int32_t tagNameLen ) const {
int32_t Xml::getNodeNum ( int32_t n0 , int32_t n1 , const char *tagName , int32_t tagNameLen ) const {
// . since i changed the hash to a zobrist hash, hashing
// "dns.ip" is not the same as hashing "dns" then "." then "ip"
// by passing the hash of the last to the next as the startHash

4
Xml.h

@ -56,7 +56,7 @@ public:
// . obsolete compound name = myhouse[0].bedroom[2].nightstand[1]
// . returns -1 if not found
// . only searches nodes in [n0,n1] node range
int32_t getNodeNum( int32_t n0, int32_t n1, char *tagName, int32_t tagNameLen ) const;
int32_t getNodeNum( int32_t n0, int32_t n1, const char *tagName, int32_t tagNameLen ) const;
// . get the back tag node for a given node
int32_t getEndNode ( int32_t num );
@ -169,7 +169,7 @@ public:
private:
// used because "s" may have words separated by periods
int64_t getCompoundHash( char *s, int32_t len ) const;
int64_t getCompoundHash( const char *s, int32_t len ) const;
XmlNode *m_nodes;
int32_t m_numNodes;