Changeset 288 in dev for trunk/abdev/BasicCompiler32/Compile_Var.cpp
- Timestamp:
- Aug 17, 2007, 7:36:51 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler32/Compile_Var.cpp
r276 r288 716 716 717 717 bool SetInitGlobalData(int offset,const Type &type,const Subscripts &subscripts,const char *lpszInitBuf){ 718 extern BYTE *initGlobalBuf;719 718 int i2,i3; 720 719 char temporary[VN_SIZE]; … … 820 819 821 820 if( type.IsDouble() ){ 822 *(double *)(initGlobalBuf+offset)=(double)dbl; 821 compiler.GetObjectModule().meta.GetGlobalVars().initAreaBuffer.Overwrite( 822 offset, 823 (const char *)&dbl, 824 sizeof(double) 825 ); 823 826 } 824 827 else if( type.IsSingle() ){ 825 *(float *)(initGlobalBuf+offset)=(float)dbl; 828 float flt = (float)dbl; 829 compiler.GetObjectModule().meta.GetGlobalVars().initAreaBuffer.Overwrite( 830 offset, 831 (const char *)&flt, 832 sizeof(float) 833 ); 826 834 } 827 835 else if( type.Is64() ){ 828 *(_int64 *)(initGlobalBuf+offset)=i64data; 836 compiler.GetObjectModule().meta.GetGlobalVars().initAreaBuffer.Overwrite( 837 offset, 838 (const char *)&i64data, 839 sizeof(_int64) 840 ); 829 841 } 830 842 else if( type.IsLong() || type.IsDWord() || type.IsPointer() ){ … … 844 856 } 845 857 else{ 846 *(DWORD *)(initGlobalBuf+offset)=(DWORD)i64data; 858 long l = (long)i64data; 859 compiler.GetObjectModule().meta.GetGlobalVars().initAreaBuffer.Overwrite( 860 offset, 861 (const char *)&l, 862 sizeof(long) 863 ); 847 864 } 848 865 } 849 866 else if( type.IsWord() || type.IsInteger() ){ 850 *(WORD *)(initGlobalBuf+offset)=(WORD)i64data; 867 short s = (short)i64data; 868 compiler.GetObjectModule().meta.GetGlobalVars().initAreaBuffer.Overwrite( 869 offset, 870 (const char *)&s, 871 sizeof(short) 872 ); 851 873 } 852 874 else if( type.IsSByte() || type.IsByte() || type.IsBoolean() ){ 853 *(BYTE *)(initGlobalBuf+offset)=(BYTE)i64data; 875 char c = (char)i64data; 876 compiler.GetObjectModule().meta.GetGlobalVars().initAreaBuffer.Overwrite( 877 offset, 878 (const char *)&c, 879 sizeof(char) 880 ); 854 881 } 855 882 … … 1093 1120 // 呼び出し側のオフセットズレを考慮する 1094 1121 1095 if( 0 == ( UserProc::CompilingUserProc().RealParams().GetMemorySize() + PTR_SIZE /*ret分*/ ) % alignment ){1122 if( 0 == ( UserProc::CompilingUserProc().RealParams().GetMemorySize() + PTR_SIZE /* ret分 */ ) % alignment ){ 1096 1123 AllLocalVarSize += PTR_SIZE; 1097 1124 }
Note:
See TracChangeset
for help on using the changeset viewer.