mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 19:37:02 +00:00
[11261] Get rid of two const_casts by storing const char* instead of char*
This commit is contained in:
parent
b588ea9db3
commit
df89544baa
2 changed files with 6 additions and 6 deletions
|
|
@ -35,7 +35,7 @@ class Field
|
||||||
};
|
};
|
||||||
|
|
||||||
Field() : mValue(NULL), mType(DB_TYPE_UNKNOWN) {}
|
Field() : mValue(NULL), mType(DB_TYPE_UNKNOWN) {}
|
||||||
Field(const char *value, enum DataTypes type) : mType(type) { mValue = const_cast<char * >(value); }
|
Field(const char* value, enum DataTypes type) : mValue(value), mType(type) {}
|
||||||
|
|
||||||
~Field() {}
|
~Field() {}
|
||||||
|
|
||||||
|
|
@ -69,13 +69,13 @@ class Field
|
||||||
void SetType(enum DataTypes type) { mType = type; }
|
void SetType(enum DataTypes type) { mType = type; }
|
||||||
//no need for memory allocations to store resultset field strings
|
//no need for memory allocations to store resultset field strings
|
||||||
//all we need is to cache pointers returned by different DBMS APIs
|
//all we need is to cache pointers returned by different DBMS APIs
|
||||||
void SetValue(const char *value) { mValue = const_cast<char * >(value); };
|
void SetValue(const char* value) { mValue = value; };
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Field(Field &f);
|
Field(Field const&);
|
||||||
Field& operator=(const Field& );
|
Field& operator=(Field const&);
|
||||||
|
|
||||||
char *mValue;
|
const char* mValue;
|
||||||
enum DataTypes mType;
|
enum DataTypes mType;
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "11260"
|
#define REVISION_NR "11261"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue