From df89544baabcccb8a1edc70538d066e969d4660b Mon Sep 17 00:00:00 2001 From: zergtmn Date: Wed, 16 Mar 2011 20:02:29 +0500 Subject: [PATCH] [11261] Get rid of two const_casts by storing const char* instead of char* --- src/shared/Database/Field.h | 10 +++++----- src/shared/revision_nr.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/shared/Database/Field.h b/src/shared/Database/Field.h index 073effb02..b9df92c4b 100644 --- a/src/shared/Database/Field.h +++ b/src/shared/Database/Field.h @@ -35,7 +35,7 @@ class Field }; Field() : mValue(NULL), mType(DB_TYPE_UNKNOWN) {} - Field(const char *value, enum DataTypes type) : mType(type) { mValue = const_cast(value); } + Field(const char* value, enum DataTypes type) : mValue(value), mType(type) {} ~Field() {} @@ -69,13 +69,13 @@ class Field void SetType(enum DataTypes type) { mType = type; } //no need for memory allocations to store resultset field strings //all we need is to cache pointers returned by different DBMS APIs - void SetValue(const char *value) { mValue = const_cast(value); }; + void SetValue(const char* value) { mValue = value; }; private: - Field(Field &f); - Field& operator=(const Field& ); + Field(Field const&); + Field& operator=(Field const&); - char *mValue; + const char* mValue; enum DataTypes mType; }; #endif diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index e7ce7a5e7..e19806672 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "11260" + #define REVISION_NR "11261" #endif // __REVISION_NR_H__