Changeset 55 in dev for BasicCompiler_Common/Variable.cpp
- Timestamp:
- Feb 13, 2007, 3:14:57 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler_Common/Variable.cpp
r51 r55 27 27 BOOL IsSignedType(int type){ 28 28 switch(type){ 29 case DEF_ CHAR:29 case DEF_SBYTE: 30 30 case DEF_INTEGER: 31 31 case DEF_LONG: … … 33 33 case DEF_SINGLE: 34 34 case DEF_DOUBLE: 35 case DEF_CHAR: 35 36 return 1; 36 37 default: … … 41 42 BOOL IsNaturalWholeNumberType(int type){ 42 43 switch(type){ 43 case DEF_ CHAR:44 case DEF_SBYTE: 44 45 case DEF_BYTE: 45 46 case DEF_INTEGER: … … 49 50 case DEF_INT64: 50 51 case DEF_QWORD: 52 case DEF_CHAR: 51 53 return 1; 52 54 default: … … 89 91 switch(type){ 90 92 case DEF_BYTE: 91 return DEF_ CHAR;93 return DEF_SBYTE; 92 94 case DEF_WORD: 93 95 return DEF_INTEGER; … … 108 110 int GetUnsignedType(int type){ 109 111 switch(type){ 110 case DEF_ CHAR:112 case DEF_SBYTE: 111 113 return DEF_BYTE; 112 114 case DEF_INTEGER: … … 116 118 case DEF_INT64: 117 119 return DEF_QWORD; 120 case DEF_CHAR: 121 if( isUnicode ) return DEF_WORD; 122 return DEF_BYTE; 118 123 } 119 124 return type; … … 136 141 else if(type==DEF_INTEGER||type==DEF_WORD) 137 142 return sizeof(WORD); 138 else if(type==DEF_ CHAR||type==DEF_BYTE || type == DEF_BOOLEAN)143 else if(type==DEF_SBYTE||type==DEF_BYTE || type == DEF_BOOLEAN) 139 144 return sizeof(BYTE); 140 145 … … 142 147 else if(type==DEF_DOUBLE) return sizeof(double); 143 148 else if(type==DEF_SINGLE) return sizeof(float); 149 150 //文字型 151 else if( type == DEF_CHAR ){ 152 if( isUnicode ) return sizeof( WORD ); 153 return sizeof( BYTE ); 154 } 144 155 145 156 //ポインタ型 … … 178 189 179 190 //整数型 180 if(lstrcmpi(TypeName," Char")==0) return DEF_CHAR;191 if(lstrcmpi(TypeName,"SByte")==0) return DEF_SBYTE; 181 192 else if(lstrcmpi(TypeName,"Byte")==0) return DEF_BYTE; 182 193 else if(lstrcmpi(TypeName,"Integer")==0) return DEF_INTEGER; … … 191 202 else if(lstrcmpi(TypeName,"Double")==0) return DEF_DOUBLE; 192 203 204 //文字型 205 else if( lstrcmpi( TypeName, "Char" ) == 0 ) return DEF_CHAR; 206 193 207 //bool型 194 208 else if( lstrcmpi( TypeName, "Boolean" ) == 0 ) return DEF_BOOLEAN; … … 248 262 249 263 //整数型 250 if(type==DEF_ CHAR) lstrcpy(name,"Char");264 if(type==DEF_SBYTE) lstrcpy(name,"SByte"); 251 265 else if(type==DEF_BYTE) lstrcpy(name,"Byte"); 252 266 else if(type==DEF_INTEGER) lstrcpy(name,"Integer"); … … 260 274 else if(type==DEF_SINGLE) lstrcpy(name,"Single"); 261 275 else if(type==DEF_DOUBLE) lstrcpy(name,"Double"); 276 277 //文字型 278 else if(type==DEF_CHAR) lstrcpy(name,"Char"); 262 279 263 280 //bool型
Note:
See TracChangeset
for help on using the changeset viewer.