VirtualBox

Changeset 20859 in vbox


Ignore:
Timestamp:
Jun 23, 2009 5:29:34 PM (15 years ago)
Author:
vboxsync
Message:

IPRT: Increased the logger buffer and replaced a bunch RTUINT with uint32_t (same type).

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/log.h

    r20853 r20859  
    220220    /** Pointer to temporary scratch buffer.
    221221     * This is used to format the log messages. */
    222     char                    achScratch[16384];
     222    char                    achScratch[32768];
    223223    /** Current scratch buffer position. */
    224     RTUINT                  offScratch;
     224    uint32_t                offScratch;
    225225    /** This is set if a prefix is pending. */
    226     RTUINT                  fPendingPrefix;
     226    uint32_t                fPendingPrefix;
    227227    /** Pointer to the logger function.
    228228     * This is actually pointer to a wrapper which will push a pointer to the
     
    235235    uint32_t                u32Magic;
    236236    /** Logger instance flags - RTLOGFLAGS. */
    237     RTUINT                  fFlags;
     237    uint32_t                fFlags;
    238238    /** Number of groups in the afGroups member. */
    239     RTUINT                  cGroups;
     239    uint32_t                cGroups;
    240240    /** Group flags array - RTLOGGRPFLAGS.
    241241     * This member have variable length and may extend way beyond
    242242     * the declared size of 1 entry. */
    243     RTUINT                  afGroups[1];
     243    uint32_t                afGroups[1];
    244244};
    245245
     
    257257    /** Pointer to temporary scratch buffer.
    258258     * This is used to format the log messages. */
    259     char                    achScratch[16384];
     259    char                    achScratch[32768];
    260260    /** Current scratch buffer position. */
    261     RTUINT                  offScratch;
     261    uint32_t                offScratch;
    262262    /** This is set if a prefix is pending. */
    263     RTUINT                  fPendingPrefix;
     263    uint32_t                fPendingPrefix;
    264264    /** Pointer to the logger function.
    265265     * This is actually pointer to a wrapper which will push a pointer to the
     
    279279    uint32_t                u32Magic;
    280280    /** Logger instance flags - RTLOGFLAGS. */
    281     RTUINT                  fFlags;
     281    uint32_t                fFlags;
    282282    /** Destination flags - RTLOGDEST. */
    283     RTUINT                  fDestFlags;
     283    uint32_t                fDestFlags;
    284284    /** Handle to log file (if open). */
    285285    RTFILE                  File;
     
    292292    /** The max number of groups that there is room for in afGroups and papszGroups.
    293293     * Used by RTLogCopyGroupAndFlags(). */
    294     RTUINT                  cMaxGroups;
     294    uint32_t                cMaxGroups;
    295295    /** Number of groups in the afGroups and papszGroups members. */
    296     RTUINT                  cGroups;
     296    uint32_t                cGroups;
    297297    /** Group flags array - RTLOGGRPFLAGS.
    298298     * This member have variable length and may extend way beyond
    299299     * the declared size of 1 entry. */
    300     RTUINT                  afGroups[1];
     300    uint32_t                afGroups[1];
    301301};
    302302
     
    13131313 * @param   ...                 Format arguments.
    13141314 */
    1315 RTDECL(int) RTLogCreate(PRTLOGGER *ppLogger, RTUINT fFlags, const char *pszGroupSettings,
     1315RTDECL(int) RTLogCreate(PRTLOGGER *ppLogger, uint32_t fFlags, const char *pszGroupSettings,
    13161316                        const char *pszEnvVarBase, unsigned cGroups, const char * const * papszGroups,
    1317                         RTUINT fDestFlags, const char *pszFilenameFmt, ...);
     1317                        uint32_t fDestFlags, const char *pszFilenameFmt, ...);
    13181318
    13191319/**
     
    13351335 * @param   ...                 Format arguments.
    13361336 */
    1337 RTDECL(int) RTLogCreateEx(PRTLOGGER *ppLogger, RTUINT fFlags, const char *pszGroupSettings,
     1337RTDECL(int) RTLogCreateEx(PRTLOGGER *ppLogger, uint32_t fFlags, const char *pszGroupSettings,
    13381338                          const char *pszEnvVarBase, unsigned cGroups, const char * const * papszGroups,
    1339                           RTUINT fDestFlags, char *pszErrorMsg, size_t cchErrorMsg, const char *pszFilenameFmt, ...);
     1339                          uint32_t fDestFlags, char *pszErrorMsg, size_t cchErrorMsg, const char *pszFilenameFmt, ...);
    13401340
    13411341/**
     
    13571357 * @param   args                Format arguments.
    13581358 */
    1359 RTDECL(int) RTLogCreateExV(PRTLOGGER *ppLogger, RTUINT fFlags, const char *pszGroupSettings,
     1359RTDECL(int) RTLogCreateExV(PRTLOGGER *ppLogger, uint32_t fFlags, const char *pszGroupSettings,
    13601360                           const char *pszEnvVarBase, unsigned cGroups, const char * const * papszGroups,
    1361                            RTUINT fDestFlags, char *pszErrorMsg, size_t cchErrorMsg, const char *pszFilenameFmt, va_list args);
     1361                           uint32_t fDestFlags, char *pszErrorMsg, size_t cchErrorMsg, const char *pszFilenameFmt, va_list args);
    13621362
    13631363/**
     
    13731373 * @param   fDestFlags          The destination flags.
    13741374 */
    1375 RTDECL(int) RTLogCreateForR0(PRTLOGGER pLogger, size_t cbLogger, PFNRTLOGGER pfnLogger, PFNRTLOGFLUSH pfnFlush, RTUINT fFlags, RTUINT fDestFlags);
     1375RTDECL(int) RTLogCreateForR0(PRTLOGGER pLogger, size_t cbLogger, PFNRTLOGGER pfnLogger, PFNRTLOGFLUSH pfnFlush, uint32_t fFlags, uint32_t fDestFlags);
    13761376
    13771377/**
     
    14001400 */
    14011401RTDECL(int) RTLogCloneRC(PRTLOGGER pLogger, PRTLOGGERRC pLoggerRC, size_t cbLoggerRC,
    1402                          RTRCPTR pfnLoggerRCPtr, RTRCPTR pfnFlushRCPtr, RTUINT fFlags);
     1402                         RTRCPTR pfnLoggerRCPtr, RTRCPTR pfnFlushRCPtr, uint32_t fFlags);
    14031403
    14041404/**
  • trunk/src/VBox/Runtime/common/log/log.cpp

    r20853 r20859  
    192192 * @param   ...                 Format arguments.
    193193 */
    194 RTDECL(int) RTLogCreateExV(PRTLOGGER *ppLogger, RTUINT fFlags, const char *pszGroupSettings,
     194RTDECL(int) RTLogCreateExV(PRTLOGGER *ppLogger, uint32_t fFlags, const char *pszGroupSettings,
    195195                           const char *pszEnvVarBase, unsigned cGroups, const char * const * papszGroups,
    196                            RTUINT fDestFlags, char *pszErrorMsg, size_t cchErrorMsg, const char *pszFilenameFmt, va_list args)
     196                           uint32_t fDestFlags, char *pszErrorMsg, size_t cchErrorMsg, const char *pszFilenameFmt, va_list args)
    197197{
    198198    int        rc;
     
    505505 * @param   ...                 Format arguments.
    506506 */
    507 RTDECL(int) RTLogCreate(PRTLOGGER *ppLogger, RTUINT fFlags, const char *pszGroupSettings,
     507RTDECL(int) RTLogCreate(PRTLOGGER *ppLogger, uint32_t fFlags, const char *pszGroupSettings,
    508508                        const char *pszEnvVarBase, unsigned cGroups, const char * const * papszGroups,
    509                         RTUINT fDestFlags, const char *pszFilenameFmt, ...)
     509                        uint32_t fDestFlags, const char *pszFilenameFmt, ...)
    510510{
    511511    va_list args;
     
    536536 * @param   ...                 Format arguments.
    537537 */
    538 RTDECL(int) RTLogCreateEx(PRTLOGGER *ppLogger, RTUINT fFlags, const char *pszGroupSettings,
     538RTDECL(int) RTLogCreateEx(PRTLOGGER *ppLogger, uint32_t fFlags, const char *pszGroupSettings,
    539539                          const char *pszEnvVarBase, unsigned cGroups, const char * const * papszGroups,
    540                           RTUINT fDestFlags,  char *pszErrorMsg, size_t cchErrorMsg, const char *pszFilenameFmt, ...)
     540                          uint32_t fDestFlags,  char *pszErrorMsg, size_t cchErrorMsg, const char *pszFilenameFmt, ...)
    541541{
    542542    va_list args;
     
    560560{
    561561    int            rc;
    562     RTUINT         iGroup;
     562    uint32_t       iGroup;
    563563    RTSEMFASTMUTEX MutexSem;
    564564
     
    642642 */
    643643RTDECL(int) RTLogCloneRC(PRTLOGGER pLogger, PRTLOGGERRC pLoggerRC, size_t cbLoggerRC,
    644                          RTRCPTR pfnLoggerRCPtr, RTRCPTR pfnFlushRCPtr, RTUINT fFlags)
     644                         RTRCPTR pfnLoggerRCPtr, RTRCPTR pfnFlushRCPtr, uint32_t fFlags)
    645645{
    646646    /*
     
    779779 * @param   fDestFlags          The destination flags.
    780780 */
    781 RTDECL(int) RTLogCreateForR0(PRTLOGGER pLogger, size_t cbLogger, PFNRTLOGGER pfnLogger, PFNRTLOGFLUSH pfnFlush, RTUINT fFlags, RTUINT fDestFlags)
     781RTDECL(int) RTLogCreateForR0(PRTLOGGER pLogger, size_t cbLogger, PFNRTLOGGER pfnLogger, PFNRTLOGFLUSH pfnFlush,
     782                             uint32_t fFlags, uint32_t fDestFlags)
    782783{
    783784    /*
     
    803804    pLogger->pszFilename  = NULL;
    804805    pLogger->papszGroups  = NULL;
    805     pLogger->cMaxGroups   = (RTUINT)((cbLogger - RT_OFFSETOF(RTLOGGER, afGroups[0])) / sizeof(pLogger->afGroups[0]));
     806    pLogger->cMaxGroups   = (uint32_t)((cbLogger - RT_OFFSETOF(RTLOGGER, afGroups[0])) / sizeof(pLogger->afGroups[0]));
    806807    pLogger->cGroups      = 1;
    807808    pLogger->afGroups[0]  = 0;
     
    17561757            uint32_t cb = sizeof(pThis->achScratch) - pThis->offScratch - 1; /* minus 1 - for the string terminator. */
    17571758            if (cb > cbChars)
    1758                 cb = (RTUINT)cbChars;
     1759                cb = (uint32_t)cbChars;
    17591760
    17601761            /* copy */
     
    19001901
    19011902            /* advance */
    1902             pLogger->offScratch += (RTUINT)cb;
     1903            pLogger->offScratch += (uint32_t)cb;
    19031904            cbRet += cb;
    19041905            cbChars -= cb;
     
    22582259                cb = psz - &pLogger->achScratch[pLogger->offScratch];
    22592260                Assert(cb <= 198);
    2260                 pLogger->offScratch += (RTUINT)cb;
     2261                pLogger->offScratch += (uint32_t)cb;
    22612262                cb = sizeof(pLogger->achScratch) - pLogger->offScratch - 1;
    22622263            }
     
    22982299
    22992300            /* advance */
    2300             pLogger->offScratch += (RTUINT)cb;
     2301            pLogger->offScratch += (uint32_t)cb;
    23012302            cbRet += cb;
    23022303            cbChars -= cb;
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