List:Commits« Previous MessageNext Message »
From:andrey.hristov Date:November 5 2008 2:09pm
Subject:bzr commit into connector-cpp-bzr branch (andrey.hristov:202)
View as plain text  
#At bzr+ssh://ahristov@stripped/bzrroot/public/connector-cpp-bzr/trunk/

  202 andrey.hristov@stripped	2008-11-05
      Use an enum instead of static variables, saves memory
modified:
  cppconn/datatype.h

=== modified file 'cppconn/datatype.h'
--- a/cppconn/datatype.h	2008-10-17 16:54:41 +0000
+++ b/cppconn/datatype.h	2008-11-05 14:09:46 +0000
@@ -29,35 +29,37 @@ class DataType
 {
 	DataType();
 public:
-	static const int BIT = -7;
-	static const int TINYINT = -6;
-	static const int SMALLINT = 5;
-	static const int INTEGER = 4;
-	static const int BIGINT = -5;
-	static const int FLOAT = 6;
-	static const int REAL = 7;
-	static const int DOUBLE = 8;
-	static const int NUMERIC = 2;
-	static const int DECIMAL = 3;
-	static const int CHAR = 1;
-	static const int VARCHAR = 12;
-	static const int LONGVARCHAR = -1;
-	static const int DATE = 91;
-	static const int TIME = 92;
-	static const int TIMESTAMP = 93;
-	static const int BINARY = -2;
-	static const int VARBINARY = -3;
-	static const int LONGVARBINARY = -4;
-	static const int SQLNULL = 0;
-	static const int OTHER = 1111;
-	static const int OBJECT = 2000;
-	static const int DISTINCT = 2001;
-	static const int STRUCT = 2002;
-	static const int ARRAY = 2003;
-	static const int BLOB = 2004;
-	static const int CLOB = 2005;
-	static const int REF = 2006;
-	static const int BOOLEAN = 16;
+	enum {
+		BIT = -7,
+		TINYINT = -6,
+		SMALLINT = 5,
+		INTEGER = 4,
+		BIGINT = -5,
+		FLOAT = 6,
+		REAL = 7,
+		DOUBLE = 8,
+		NUMERIC = 2,
+		DECIMAL = 3,
+		CHAR = 1,
+		VARCHAR = 12,
+		LONGVARCHAR = -1,
+		DATE = 91,
+		TIME = 92,
+		TIMESTAMP = 93,
+		BINARY = -2,
+		VARBINARY = -3,
+		LONGVARBINARY = -4,
+		SQLNULL = 0,
+		OTHER = 1111,
+		OBJECT = 2000,
+		DISTINCT = 2001,
+		STRUCT = 2002,
+		ARRAY = 2003,
+		BLOB = 2004,
+		CLOB = 2005,
+		REF = 2006,
+		BOOLEAN = 16
+	};
 };
 
 }; /* namespace */

Thread
bzr commit into connector-cpp-bzr branch (andrey.hristov:202) andrey.hristov5 Nov