Changeset 417 in dev for trunk/abdev/BasicCompiler_Common
- Timestamp:
- Mar 7, 2008, 5:32:29 AM (17 years ago)
- Location:
- trunk/abdev/BasicCompiler_Common
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler_Common/include/Class.h
r412 r417 565 565 std::string GetStaticDefiningStringAsMemberTypeInfoNames() const; 566 566 std::string GetStaticDefiningStringAsMemberOffsets() const; 567 void GetReferenceOffsetsInitializeBuffer( std::string &referenceOffsetsBuffer, int &numOfReference, int baseOffset = 0 ) const; 567 568 568 569 -
trunk/abdev/BasicCompiler_Common/src/Class.cpp
r412 r417 1292 1292 // 未使用のクラスは無視する 1293 1293 continue; 1294 } 1295 1296 char referenceOffsetsBuffer[1024] = "";1294 } 1295 1296 std::string referenceOffsetsBuffer; 1297 1297 int numOfReference = 0; 1298 BOOST_FOREACH( CMember *pMember, objClass.GetDynamicMembers() ){ 1299 if( pMember->GetType().IsObject() || pMember->GetType().IsPointer() ){ 1300 if( referenceOffsetsBuffer[0] ){ 1301 lstrcat( referenceOffsetsBuffer, "," ); 1302 } 1303 1304 sprintf( referenceOffsetsBuffer + lstrlen( referenceOffsetsBuffer ), 1305 "%d", 1306 objClass.GetMemberOffset( pMember->GetName().c_str() ) ); 1307 1308 numOfReference++; 1309 } 1310 } 1298 objClass.GetReferenceOffsetsInitializeBuffer( referenceOffsetsBuffer, numOfReference ); 1311 1299 1312 1300 sprintf( temporary … … 1317 1305 , objClass.GetName().c_str() // クラス名 1318 1306 , objClass.GetFullName().c_str() // フルネーム 1319 , referenceOffsetsBuffer 1307 , referenceOffsetsBuffer.c_str() // 参照メンバオフセット配列 1320 1308 , numOfReference // 参照メンバの個数 1321 1309 ); … … 1577 1565 return result; 1578 1566 } 1567 1568 void CClass::GetReferenceOffsetsInitializeBuffer( std::string &referenceOffsetsBuffer, int &numOfReference, int baseOffset ) const 1569 { 1570 const CClass &thisClass = *this; 1571 BOOST_FOREACH( const CMember *pMember, thisClass.GetDynamicMembers() ) 1572 { 1573 if( pMember->GetType().IsObject() || pMember->GetType().IsPointer() ) 1574 { 1575 if( referenceOffsetsBuffer.size() ) 1576 { 1577 referenceOffsetsBuffer += ","; 1578 } 1579 1580 char temp[255]; 1581 sprintf( temp, "%d", baseOffset + thisClass.GetMemberOffset( pMember->GetName().c_str() ) ); 1582 referenceOffsetsBuffer += temp; 1583 1584 numOfReference++; 1585 } 1586 if( pMember->GetType().IsStruct() && !pMember->GetType().IsPointer() ) 1587 { 1588 // 構造体の実体をメンバに持つとき 1589 int baseOffset = thisClass.GetMemberOffset( pMember->GetName().c_str() ); 1590 1591 // 構造体メンバでGCによるチェックが必要な参照位置を追加 1592 pMember->GetType().GetClass().GetReferenceOffsetsInitializeBuffer( referenceOffsetsBuffer, numOfReference, baseOffset ); 1593 } 1594 } 1595 } -
trunk/abdev/BasicCompiler_Common/src/DataTable.cpp
r409 r417 293 293 BOOST_FOREACH( const std::string ¶mStr, parameters ) 294 294 { 295 if( paramStr.size() == 0 ) 296 { 297 throw; 298 } 295 299 if( paramStr[0] == '\"' ) 296 300 {
Note:
See TracChangeset
for help on using the changeset viewer.