Changeset 55 in dev for BasicCompiler_Common
- Timestamp:
- Feb 13, 2007, 3:14:57 AM (18 years ago)
- Location:
- BasicCompiler_Common
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler_Common/BasicCompiler.cpp
r15 r55 691 691 else if(lstrcmp(temp2,"dll")==0) bDll=1; 692 692 693 //Unicode 694 else if( lstrcmp( temp2, "unicode" ) ==0 ) isUnicode = true; 695 693 696 //埋め込み型コンパイラビュー 694 697 else if(lstrcmp(temp2,"clip_compile_view")==0) bClipCompileView=1; -
BasicCompiler_Common/BasicCompiler.h
r15 r55 82 82 83 83 BOOL bDll; 84 bool isUnicode = false; 84 85 85 86 char *basbuf; -
BasicCompiler_Common/BasicFixed.h
r46 r55 19 19 20 20 //整数型 21 #define DEF_ CHAR0x0000000121 #define DEF_SBYTE 0x00000001 22 22 #define DEF_BYTE 0x00000002 23 23 #define DEF_INTEGER 0x00000003 … … 32 32 #define DEF_DOUBLE 0x0000000A 33 33 34 //文字型 35 #define DEF_CHAR 0x0000000B 36 34 37 //bool型 35 #define DEF_BOOLEAN 0x0000000 B38 #define DEF_BOOLEAN 0x0000000C 36 39 37 40 //文字列型 38 #define DEF_STRING 0x0000000 C41 #define DEF_STRING 0x0000000D 39 42 40 43 //ポインタ型 41 #define DEF_PTR_VOID 0x0000000 D42 #define DEF_PTR_PROC 0x0000000 E44 #define DEF_PTR_VOID 0x0000000E 45 #define DEF_PTR_PROC 0x0000000F 43 46 44 47 //特殊型 -
BasicCompiler_Common/NumOpe_GetType.cpp
r50 r55 5 5 switch(size){ 6 6 case 1: 7 if(bSigned) return DEF_ CHAR;7 if(bSigned) return DEF_SBYTE; 8 8 else return DEF_BYTE; 9 9 break; -
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型 -
BasicCompiler_Common/calculation.cpp
r50 r55 162 162 if(IsSignedType(type1)||IsSignedType(type2)){ 163 163 //符号あり 164 if(size1==sizeof(char)) return DEF_ CHAR;164 if(size1==sizeof(char)) return DEF_SBYTE; 165 165 if(size1==sizeof(short)) return DEF_INTEGER; 166 166 if(size1==sizeof(long)) return DEF_LONG; … … 362 362 363 363 if(IsSignedType(AnswerType)){ 364 if(AnswerType==DEF_ CHAR&&(i64stack[sp-2]<CHAR_MIN||CHAR_MAX<i64stack[sp-2])){364 if(AnswerType==DEF_SBYTE&&(i64stack[sp-2]<CHAR_MIN||CHAR_MAX<i64stack[sp-2])){ 365 365 //符号有り8ビット値をはみ出したとき 366 366 AnswerType=DEF_INTEGER; … … 604 604 } 605 605 } 606 else if(i2==DEF_INTEGER ){606 else if(i2==DEF_INTEGER || (isUnicode&&i2==DEF_CHAR)){ 607 607 short shortData; 608 608 if(i3=ReadProcessMemory(hDebugProcess,offset,&shortData,sizeof(short),&stAccBytes)){ … … 616 616 } 617 617 } 618 else if(i2==DEF_ CHAR){618 else if(i2==DEF_SBYTE || (isUnicode==false&&i2==DEF_CHAR)){ 619 619 char charData; 620 620 if(i3=ReadProcessMemory(hDebugProcess,offset,&charData,sizeof(char),&stAccBytes)){ -
BasicCompiler_Common/common.h
r50 r55 88 88 extern char BasicSystemDir[MAX_PATH]; 89 89 extern int cp; 90 extern bool isUnicode; 90 91 91 92 -
BasicCompiler_Common/preprocessor.cpp
r43 r55 79 79 } 80 80 81 extern bool isUnicode; 82 if( isUnicode ){ 83 add( "UNICODE" ); 84 } 85 81 86 char temporary[255]; 82 87 sprintf(temporary,"_AB_VER%d",MAJOR_VER);
Note:
See TracChangeset
for help on using the changeset viewer.