VirtualBox

Changeset 62722 in vbox for trunk/src/VBox/Runtime/testcase


Ignore:
Timestamp:
Jul 30, 2016 12:00:14 AM (8 years ago)
Author:
vboxsync
Message:

IPRT/testcases: warnings

Location:
trunk/src/VBox/Runtime/testcase
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/testcase/tstPrfRT.cpp

    r62571 r62722  
    7171    AssertCompile(((cIterations) % 8) == 0); \
    7272    /* Min and max value. */ \
    73     for (i = 0, u64MinTS = ~0, u64MaxTS = 0; i < (cIterations); i++) \
     73    for (i = 0, u64MinTS = UINT64_MAX, u64MaxTS = 0; i < (cIterations); i++) \
    7474    { \
    7575        { preexpr } \
     
    124124
    125125# define ITERATE(preexpr, expr, postexpr, cIterations) \
    126     for (i = 0, u64TotalTS = 0, u64MinTS = ~0, u64MaxTS = 0; i < (cIterations); i++) \
     126    for (i = 0, u64TotalTS = 0, u64MinTS = UINT64_MAX, u64MaxTS = 0; i < (cIterations); i++) \
    127127    { \
    128128        { preexpr } \
     
    151151    uint64_t    u64MinTS;
    152152    uint64_t    u64MaxTS;
    153     unsigned    i;
     153    uint32_t    i;
    154154
    155155    RTEXITCODE rcExit = RTTestInitExAndCreate(argc, &argv, argc == 2 ? RTR3INIT_FLAGS_SUPLIB : 0, "tstRTPrf", &g_hTest);
     
    161161     * RTTimeNanoTS, RTTimeProgramNanoTS, RTTimeMilliTS, and RTTimeProgramMilliTS.
    162162     */
    163     ITERATE(RT_NOTHING, RTTimeNanoTS();, RT_NOTHING, _1M * 32);
     163    ITERATE(RT_NOTHING, RTTimeNanoTS();, RT_NOTHING, _32M);
    164164    PrintResult(u64TotalTS, u64MaxTS, u64MinTS, i, "RTTimeNanoTS");
    165165
    166     ITERATE(RT_NOTHING, RTTimeProgramNanoTS();, RT_NOTHING, 1000000);
     166    ITERATE(RT_NOTHING, RTTimeProgramNanoTS();, RT_NOTHING, UINT32_C(1000000));
    167167    PrintResult(u64TotalTS, u64MaxTS, u64MinTS, i, "RTTimeProgramNanoTS");
    168168
    169     ITERATE(RT_NOTHING, RTTimeMilliTS();, RT_NOTHING, 1000000);
     169    ITERATE(RT_NOTHING, RTTimeMilliTS();, RT_NOTHING, UINT32_C(1000000));
    170170    PrintResult(u64TotalTS, u64MaxTS, u64MinTS, i, "RTTimeMilliTS");
    171171
    172     ITERATE(RT_NOTHING, RTTimeProgramMilliTS();, RT_NOTHING, 1000000);
     172    ITERATE(RT_NOTHING, RTTimeProgramMilliTS();, RT_NOTHING, UINT32_C(1000000));
    173173    PrintResult(u64TotalTS, u64MaxTS, u64MinTS, i, "RTTimeProgramMilliTS");
    174174
     
    177177     */
    178178    RTTIMESPEC Time;
    179     ITERATE(RT_NOTHING, RTTimeNow(&Time);, RT_NOTHING, 1000000);
     179    ITERATE(RT_NOTHING, RTTimeNow(&Time);, RT_NOTHING, UINT32_C(1000000));
    180180    PrintResult(u64TotalTS, u64MaxTS, u64MinTS, i, "RTTimeNow");
    181181
     
    183183     * RTLogDefaultInstance()
    184184     */
    185     ITERATE(RT_NOTHING, RTLogDefaultInstance();, RT_NOTHING, 1000000);
     185    ITERATE(RT_NOTHING, RTLogDefaultInstance();, RT_NOTHING, UINT32_C(1000000));
    186186    PrintResult(u64TotalTS, u64MaxTS, u64MinTS, i, "RTLogDefaultInstance");
    187187
     
    189189     * RTThreadSelf and RTThreadNativeSelf
    190190     */
    191     ITERATE(RT_NOTHING, RTThreadSelf();, RT_NOTHING, 1000000);
     191    ITERATE(RT_NOTHING, RTThreadSelf();, RT_NOTHING, UINT32_C(1000000));
    192192    PrintResult(u64TotalTS, u64MaxTS, u64MinTS, i, "RTThreadSelf");
    193193
    194     ITERATE(RT_NOTHING, RTThreadNativeSelf();, RT_NOTHING, 1000000);
     194    ITERATE(RT_NOTHING, RTThreadNativeSelf();, RT_NOTHING, UINT32_C(1000000));
    195195    PrintResult(u64TotalTS, u64MaxTS, u64MinTS, i, "RTThreadNativeSelf");
    196196
     
    199199     * Registers vs stack.
    200200     */
    201     ITERATE(RT_NOTHING, tstRTPRfARegisterAccess();, RT_NOTHING, 1000);
     201    ITERATE(RT_NOTHING, tstRTPRfARegisterAccess();, RT_NOTHING, UINT32_C(1000));
    202202    uint64_t const cRegTotal = u64TotalTS;
    203203    //PrintResult(u64TotalTS, u64MaxTS, u64MinTS, i, "Register only algorithm");
    204204
    205     ITERATE(RT_NOTHING, tstRTPRfAMemoryAccess();, RT_NOTHING, 1000);
     205    ITERATE(RT_NOTHING, tstRTPRfAMemoryAccess();, RT_NOTHING, UINT32_C(1000));
    206206    uint64_t const cMemTotal = u64TotalTS;
    207207    //PrintResult(u64TotalTS, u64MaxTS, u64MinTS, i, "Memory only algorithm");
    208208
    209     ITERATE(RT_NOTHING, tstRTPRfAMemoryUnalignedAccess();, RT_NOTHING, 1000);
     209    ITERATE(RT_NOTHING, tstRTPRfAMemoryUnalignedAccess();, RT_NOTHING, UINT32_C(1000));
    210210    uint64_t const cMemUnalignedTotal = u64TotalTS;
    211211    //PrintResult(u64TotalTS, u64MaxTS, u64MinTS, i, "Memory only algorithm");
  • trunk/src/VBox/Runtime/testcase/tstSemPingPong.cpp

    r62571 r62722  
    5252    RT_NOREF_PV(hThread);
    5353
    54     int rc;
     54    int rc = VINF_SUCCESS; /* (MSC powers of deduction are rather weak. sigh) */
    5555    PRTPINGPONG pPP = (PRTPINGPONG)pvPP;
    5656    for (uint32_t i = 0; i < TSTSEMPINGPONG_ITERATIONS; i++)
  • trunk/src/VBox/Runtime/testcase/tstUtf8.cpp

    r62477 r62722  
    10381038    do { \
    10391039        const char *pszRet = expr; \
    1040         if (   (pszRet != NULL && (expect) == NULL) \
    1041             || (pszRet == NULL && (expect) != NULL) \
    1042             || strcmp(pszRet, (expect)) \
     1040        const char *pszExpect = (expect); \
     1041        if (   (pszRet != NULL && pszExpect == NULL) \
     1042            || (pszRet == NULL && pszExpect != NULL) \
     1043            || strcmp(pszRet, pszExpect) \
    10431044            ) \
    1044             RTTestFailed(hTest, "%d: %#x -> %s expected %s", __LINE__, #expr, pszRet, (expect)); \
     1045            RTTestFailed(hTest, "%d: %#x -> %s expected %s", __LINE__, #expr, pszRet, pszExpect); \
    10451046    } while (0)
    10461047
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