[Gridflow-cvs] [svn] commit: r5714 - in /trunk/src: gridflow.hxx number.cxx

svn-gridflow at artengine.ca svn-gridflow at artengine.ca
Wed Jul 14 21:35:56 EDT 2010


Author: matju
Date: Wed Jul 14 21:35:54 2010
New Revision: 5714

Log:
remove long abbreviations (u8 i16 i32 i64 f32 f64) for numtypes

Modified:
    trunk/src/gridflow.hxx
    trunk/src/number.cxx

Modified: trunk/src/gridflow.hxx
==============================================================================
--- trunk/src/gridflow.hxx (original)
+++ trunk/src/gridflow.hxx Wed Jul 14 21:35:54 2010
@@ -387,15 +387,15 @@
 #define NONLITE(x...) x
 #endif
 #define NUMBER_TYPES(MACRO) \
-	MACRO(uint8, 8,NT_UNSIGNED, "u8,b") \
-	MACRO(int16,16,0,           "i16,s") \
-	MACRO(int32,32,0,           "i32,i") \
-	MACRO(int64,64,NT_NOTLITE,  "i64,l") \
-	MACRO(float32,32,NT_FLOAT,  "f32,f") \
-	MACRO(float64,64,NT_NOTLITE|NT_FLOAT, "f64,d")
+	MACRO(b,uint8, 8,NT_UNSIGNED) \
+	MACRO(s,int16,16,0          ) \
+	MACRO(i,int32,32,0          ) \
+	MACRO(l,int64,64,NT_NOTLITE ) \
+	MACRO(f,float32,32,NT_FLOAT ) \
+	MACRO(d,float64,64,NT_NOTLITE|NT_FLOAT)
 
 enum NumberTypeE {
-#define FOO(_sym_,args...) _sym_##_e,
+#define FOO(ABBR,SYM,SIZE,FLAGS) SYM##_e,
 NUMBER_TYPES(FOO)
 #undef FOO
 number_type_table_end
@@ -407,13 +407,13 @@
 #undef FOO
 
 struct NumberType : CObject {
+	const char *alias;
 	const char *name;
 	int size;
 	int flags;
-	const char *aliases;
 	NumberTypeE index;
-	NumberType(const char *name_, int size_, int flags_, const char *aliases_) :
-		name(name_), size(size_), flags(flags_), aliases(aliases_) {}
+	NumberType(const char *alias_, const char *name_, int size_, int flags_) :
+		alias(alias_), name(name_), size(size_), flags(flags_) {}
 };
 
 NumberTypeE NumberTypeE_find (string sym);

Modified: trunk/src/number.cxx
==============================================================================
--- trunk/src/number.cxx (original)
+++ trunk/src/number.cxx Wed Jul 14 21:35:54 2010
@@ -40,7 +40,7 @@
 
 #ifdef PASS1
 NumberType number_type_table[] = {
-#define FOO(_sym_,_size_,_flags_,args...) NumberType( #_sym_, _size_, _flags_, args ),
+#define FOO(ABBR,SYM,SIZE,FLAGS) NumberType(#ABBR,#SYM,SIZE,FLAGS),
 NUMBER_TYPES(FOO)
 #undef FOO
 };
@@ -426,7 +426,7 @@
 	for (int i=0; i<COUNT(number_type_table); i++) {
 		number_type_table[i].index = (NumberTypeE) i;
 		char a[64];
-		strcpy(a,number_type_table[i].aliases);
+		strcpy(a,number_type_table[i].alias);
 		char *b = strchr(a,',');
 		if (b) {
 			*b=0;



More information about the Gridflow-cvs mailing list