Changeset 635 in dev for trunk


Ignore:
Timestamp:
Jun 7, 2008, 10:57:53 AM (16 years ago)
Author:
dai_9181
Message:

リファクタリング(ヒープ制御をstlに置き換え)

Location:
trunk/ab5.0/abdev/ab_common/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ab5.0/abdev/ab_common/src/Lexical/Source.cpp

    r623 r635  
    2323//////////////////////////////////////
    2424class CRequireFiles{
    25     char **ppFilePath;
    26     int count;
     25    Jenga::Common::Strings filepaths;
    2726public:
    28     CRequireFiles(){
    29         ppFilePath = (char **)malloc( 1 );
    30         count = 0;
    31     }
    32     ~CRequireFiles(){
    33         for( int i = 0; i < count; i++ ){
    34             free( ppFilePath[i] );
    35         }
    36         free( ppFilePath );
    37     }
     27
    3828    void clear(){
    39         for( int i = 0; i < count; i++ ){
    40             free( ppFilePath[i] );
    41         }
    42         free( ppFilePath );
    43 
    44         ppFilePath = (char **)malloc( 1 );
    45         count = 0;
     29        filepaths.clear();
    4630    }
    4731    bool IsIncluded( const char *includeFilePath ){
     
    5539        }
    5640
    57         for( int i=0; i<count; i++ ){
    58             if( lstrcmpi( ppFilePath[i], tempPath ) == 0 ){
     41        BOOST_FOREACH( const std::string &filepath, filepaths )
     42        {
     43            if( lstrcmpi( filepath.c_str(), tempPath ) == 0 )
     44            {
    5945                return true;
    6046            }
     
    7662
    7763        //追加
    78         ppFilePath = (char **)realloc(ppFilePath, ( count + 1 ) * sizeof(char *) );
    79         ppFilePath[count] = (char *)malloc( lstrlen(tempPath) + 1 );
    80         lstrcpy( ppFilePath[count], tempPath );
    81         count++;
     64        filepaths.push_back( tempPath );
    8265    }
    8366};
     
    11699    add(temporary);
    117100}
    118 BOOL CDefine::add(char *name){
    119     extern HANDLE hHeap;
    120 
     101BOOL CDefine::add(char *name)
     102{
    121103    //重複チェック
    122104    if(check(name)) return 0;
     
    535517}
    536518
    537 void BasicSource::DirectiveIncludeOrRequire( const std::string &mainSourceFilePath, const std::string &includeDirPath ){
    538     extern HANDLE hHeap;
     519void BasicSource::DirectiveIncludeOrRequire( const std::string &mainSourceFilePath, const std::string &includeDirPath )
     520{
    539521    int i,i2,i3,sw1,LineNum,FileLayer[255],layer,LastFileByte[255];
    540522    char temporary[MAX_PATH],temp2[MAX_PATH+255],*LayerDir[255];
  • trunk/ab5.0/abdev/ab_common/src/ResourceManager/ResourceManager.cpp

    r623 r635  
    2828    }
    2929    i2=GetFileSize(hFile,NULL);
    30     extern HANDLE hHeap;
    3130    char *_buf = (char *)malloc(i2+i2);
    3231    ReadFile(hFile,_buf,i2,(DWORD *)&i3,NULL);
Note: See TracChangeset for help on using the changeset viewer.