VirtualBox

Changeset 31869 in vbox for trunk/src


Ignore:
Timestamp:
Aug 23, 2010 3:22:50 PM (14 years ago)
Author:
vboxsync
Message:

coredumper-solaris.cpp: RTFileGetSize returns uint64_t and this cannot be safely cast to size_t! Please fix.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/solaris/coredumper-solaris.cpp

    r31862 r31869  
    7878
    7979
    80 /** 
    81  * Wrapper function to write IPRT format style string to the syslog. 
    82  * 
    83  * @param pszFormat         Format string 
     80/**
     81 * Wrapper function to write IPRT format style string to the syslog.
     82 *
     83 * @param pszFormat         Format string
    8484 */
    8585static void rtCoreDumperSysLogWrapper(const char *pszFormat, ...)
     
    199199static size_t GetFileSize(const char *pszPath)
    200200{
    201     size_t cb = 0;
     201    uint64_t cb = 0;
    202202    RTFILE hFile;
    203203    int rc = RTFileOpen(&hFile, pszPath, RTFILE_O_OPEN | RTFILE_O_READ);
    204204    if (RT_SUCCESS(rc))
    205205    {
    206         RTFileGetSize(hFile, (uint64_t *)&cb);
     206        RTFileGetSize(hFile, &cb);
    207207        RTFileClose(hFile);
    208208    }
    209209    else
    210210        CORELOGRELSYS((CORELOG_NAME "GetFileSize failed to open %s rc=%Rrc\n", pszPath, rc));
    211     return cb;
     211    return cb < ~(size_t)0 ? (size_t)cb : ~(size_t)0;
    212212}
    213213
     
    351351    if (RT_SUCCESS(rc))
    352352    {
    353         RTFileGetSize(hFile, (uint64_t *)pcb);
     353        RTFileGetSize(hFile, (uint64_t *)pcb); /** @todo size_t != uint64_t! */
    354354        if (*pcb > 0)
    355355        {
     
    515515
    516516    size_t cbAuxFile = 0;
    517     RTFileGetSize(hFile, (uint64_t *)&cbAuxFile);
     517    RTFileGetSize(hFile, (uint64_t *)&cbAuxFile);  /** @todo size_t != uint64_t! */
    518518    if (cbAuxFile >= sizeof(auxv_t))
    519519    {
     
    607607         */
    608608        size_t cbMapFile = 0;
    609         RTFileGetSize(hFile, (uint64_t *)&cbMapFile);
     609        RTFileGetSize(hFile, (uint64_t *)&cbMapFile);  /** @todo size_t != uint64_t! */
    610610        if (cbMapFile >= sizeof(prmap_t))
    611611        {
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