Changeset 727 in dev


Ignore:
Timestamp:
Aug 19, 2008, 11:11:27 PM (16 years ago)
Author:
イグトランス (egtra)
Message:

SlideStringの実装をText::SlideStringに、SlideBufferをmemmoveにした。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ab5.0/abdev/BasicCompiler_Common/StrOperation.cpp

    r644 r727  
    164164}
    165165void SlideString(char *buffer, int slide){
    166     char *temp;
    167     temp=(char *)malloc(lstrlen(buffer)+1);
    168     lstrcpy(temp,buffer);
    169     lstrcpy(buffer+slide,temp);
    170     free(temp);
     166    Text::SlideString(buffer,slide);
    171167}
    172168void SlideBuffer(char *buffer,int length,int slide){
    173     void *temp;
    174     temp=malloc(length+1);
    175     memcpy(temp,buffer,length);
    176     memcpy(buffer+slide,temp,length);
    177     free(temp);
     169    memmove(buffer+slide,buffer,length);
    178170}
    179171
     
    415407    }
    416408
    417     static std::string resultStr = "";
    418     resultStr = temporary;
     409    static std::string resultStr = temporary;
    419410
    420411    free( temporary );
     
    438429    BROWSEINFO BrowseInfo;
    439430    LPITEMIDLIST pidlBrowse;
    440     LPMALLOC g_pMalloc;
    441431    char temporary[MAX_PATH];
    442432
     
    451441    pidlBrowse=SHBrowseForFolder(&BrowseInfo);
    452442    if(pidlBrowse){
    453         if(SHGetMalloc(&g_pMalloc)!=0) return 0;
    454         SHGetPathFromIDList(pidlBrowse,folder);
    455         g_pMalloc->Free(pidlBrowse);
    456         g_pMalloc->Release();
    457         return 1;
     443        BOOL ret = SHGetPathFromIDList(pidlBrowse,folder);
     444        CoTaskMemFree(pidlBrowse);
     445        return ret;
    458446    }
    459447    return 0;
Note: See TracChangeset for help on using the changeset viewer.