VirtualBox

Changeset 1005 in kBuild for trunk/src/kObjCache


Ignore:
Timestamp:
Jun 2, 2007 1:54:25 PM (18 years ago)
Author:
bird
Message:

debugging. kind of working now...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kObjCache/kObjCache.c

    r1003 r1005  
    6262/** The max line length in a cache file. */
    6363#define KOBJCACHE_MAX_LINE_LEN  16384
     64#if defined(__WIN__)
     65# define PATH_SLASH '\\'
     66#else
     67# define PATH_SLASH '/'
     68#endif
     69#if defined(__OS2__) || defined(__WIN__)
     70# define IS_SLASH(ch)       ((ch) == '/' || (ch) == '\\')
     71# define IS_SLASH_DRV(ch)   ((ch) == '/' || (ch) == '\\' || (ch) == ':')
     72#else
     73# define IS_SLASH(ch)       ((ch) == '/')
     74# define IS_SLASH_DRV(ch)   ((ch) == '/')
     75#endif
     76
    6477
    6578
     
    578591    kObjCacheVerbose(pEntry, "precompiled file is %lu bytes long\n", (unsigned long)pEntry->cbNewCppMapping);
    579592
     593    memset(&pEntry->NewSum, 0, sizeof(pEntry->NewSum));
    580594    pEntry->NewSum.crc32 = crc32(0, pEntry->pszNewCppMapping, pEntry->cbNewCppMapping);
    581595    MD5Init(&MD5Ctx);
     
    827841    const char *pszFilename = strchr(pszPath, '\0') - 1;
    828842    while (     pszFilename > pszPath
    829 #if defined(__OS2__) || defined(__WIN__)
    830            &&   pszFilename[-1] != ':' && pszFilename[-1] != '/' && pszFilename[-1] != '\\')
    831 #else
    832            &&   pszFilename[-1] != '/')
    833 #endif
     843           &&   !IS_SLASH_DRV(pszFilename[-1]))
    834844        pszFilename--;
    835845    return pszFilename;
     
    850860    char *pszBuf = xmalloc(cchName + cchDir + 2);
    851861    memcpy(pszBuf, pszDir, cchDir);
    852 #if defined(__OS2__) || defined(__WIN__)
    853     if (cchDir > 0 && pszDir[cchDir - 1] != '/' && pszDir[cchDir - 1] != '\\' && pszDir[cchDir - 1] != ':')
    854 #else
    855     if (cchDir > 0 && pszDir[cchDir - 1] != '/')
    856 #endif
    857         pszBuf[cchDir++] = '/';
     862    if (cchDir > 0 && !IS_SLASH_DRV(pszDir[cchDir - 1]))
     863        pszBuf[cchDir++] = PATH_SLASH;
    858864    memcpy(pszBuf + cchDir, pszName, cchName + 1);
    859865    return pszBuf;
     
    937943    if (pszRet)
    938944    {
    939 #if defined(__OS2__) || defined(__WIN__)
    940         while (*pszRet == ':' || *pszRet == '/' || *pszRet == '\\')
    941 #else
    942         while (*pszRet == '/')
    943 #endif
     945        while (IS_SLASH_DRV(*pszRet))
    944946            pszRet++;
    945947        pszRet = xstrdup(pszRet);
     
    10021004    char *pszOldPath = MakePathFromDirAndFile(pszOldName, pszDir);
    10031005    char *pszNewPath = MakePathFromDirAndFile(pszNewName, pszDir);
    1004     int rc = rename(pszOldName, pszNewName);
     1006    int rc = rename(pszOldPath, pszNewPath);
    10051007    free(pszOldPath);
    10061008    free(pszNewPath);
     
    10451047    int SavedErrno;
    10461048    char *pszPath = MakePathFromDirAndFile(pszName, pszDir);
    1047     int fd = open(pszName, O_RDONLY | O_BINARY);
     1049    int fd = open(pszPath, O_RDONLY | O_BINARY);
    10481050    if (fd >= 0)
    10491051    {
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette