VirtualBox

Changeset 107561 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jan 9, 2025 9:02:37 AM (10 days ago)
Author:
vboxsync
Message:

src/VBox/Storage/testcase/vbox-img.cpp: Fixed warnings found by Parfait (assignment unused). Lots of renaming, needs further cleanup. jiraref:VBP-1424

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Storage/testcase/vbox-img.cpp

    r106061 r107561  
    145145static DECLCALLBACK(int) handleVDMessage(void *pvUser, const char *pszFormat, va_list va)
    146146{
    147     NOREF(pvUser);
     147    RT_NOREF(pvUser);
    148148    RTPrintfV(pszFormat, va);
    149149    return VINF_SUCCESS;
     
    161161    va_end(args);
    162162    printUsage(g_pStdErr);
    163     return 1;
     163    return RTEXITCODE_SYNTAX;
    164164}
    165165
     
    171171    RTMsgErrorV(pszFormat, args);
    172172    va_end(args);
    173     return 1;
     173    return RTEXITCODE_FAILURE;
    174174}
    175175
     
    534534static DECLCALLBACK(int) convInClose(void *pvUser, void *pStorage)
    535535{
    536     NOREF(pvUser);
     536    RT_NOREF(pvUser);
    537537    AssertPtrReturn(pStorage, VERR_INVALID_POINTER);
    538538    PFILEIOSTATE pFS = (PFILEIOSTATE)pStorage;
     
    545545static DECLCALLBACK(int) convInDelete(void *pvUser, const char *pcszFilename)
    546546{
    547     NOREF(pvUser);
    548     NOREF(pcszFilename);
     547    RT_NOREF(pvUser);
     548    RT_NOREF(pcszFilename);
    549549    AssertFailedReturn(VERR_NOT_SUPPORTED);
    550550}
     
    552552static DECLCALLBACK(int) convInMove(void *pvUser, const char *pcszSrc, const char *pcszDst, unsigned fMove)
    553553{
    554     NOREF(pvUser);
    555     NOREF(pcszSrc);
    556     NOREF(pcszDst);
    557     NOREF(fMove);
     554    RT_NOREF(pvUser);
     555    RT_NOREF(pcszSrc);
     556    RT_NOREF(pcszDst);
     557    RT_NOREF(fMove);
    558558    AssertFailedReturn(VERR_NOT_SUPPORTED);
    559559}
     
    561561static DECLCALLBACK(int) convInGetFreeSpace(void *pvUser, const char *pcszFilename, int64_t *pcbFreeSpace)
    562562{
    563     NOREF(pvUser);
    564     NOREF(pcszFilename);
     563    RT_NOREF(pvUser);
     564    RT_NOREF(pcszFilename);
    565565    AssertPtrReturn(pcbFreeSpace, VERR_INVALID_POINTER);
    566566    *pcbFreeSpace = 0;
     
    570570static DECLCALLBACK(int) convInGetModificationTime(void *pvUser, const char *pcszFilename, PRTTIMESPEC pModificationTime)
    571571{
    572     NOREF(pvUser);
    573     NOREF(pcszFilename);
     572    RT_NOREF(pvUser);
     573    RT_NOREF(pcszFilename);
    574574    AssertPtrReturn(pModificationTime, VERR_INVALID_POINTER);
    575575    AssertFailedReturn(VERR_NOT_SUPPORTED);
     
    578578static DECLCALLBACK(int) convInGetSize(void *pvUser, void *pStorage, uint64_t *pcbSize)
    579579{
    580     NOREF(pvUser);
    581     NOREF(pStorage);
     580    RT_NOREF(pvUser);
     581    RT_NOREF(pStorage);
    582582    AssertPtrReturn(pcbSize, VERR_INVALID_POINTER);
    583583    AssertFailedReturn(VERR_NOT_SUPPORTED);
     
    586586static DECLCALLBACK(int) convInSetSize(void *pvUser, void *pStorage, uint64_t cbSize)
    587587{
    588     NOREF(pvUser);
    589     NOREF(pStorage);
    590     NOREF(cbSize);
     588    RT_NOREF(pvUser);
     589    RT_NOREF(pStorage);
     590    RT_NOREF(cbSize);
    591591    AssertFailedReturn(VERR_NOT_SUPPORTED);
    592592}
     
    595595                                    void *pvBuffer, size_t cbBuffer, size_t *pcbRead)
    596596{
    597     NOREF(pvUser);
     597    RT_NOREF(pvUser);
    598598    AssertPtrReturn(pStorage, VERR_INVALID_POINTER);
    599599    AssertPtrReturn(pvBuffer, VERR_INVALID_POINTER);
     
    682682                                     size_t *pcbWritten)
    683683{
    684     NOREF(pvUser);
    685     NOREF(pStorage);
    686     NOREF(uOffset);
    687     NOREF(cbBuffer);
    688     NOREF(pcbWritten);
     684    RT_NOREF(pvUser);
     685    RT_NOREF(pStorage);
     686    RT_NOREF(uOffset);
     687    RT_NOREF(cbBuffer);
     688    RT_NOREF(pcbWritten);
    689689    AssertPtrReturn(pvBuffer, VERR_INVALID_POINTER);
    690690    AssertFailedReturn(VERR_NOT_SUPPORTED);
     
    693693static DECLCALLBACK(int) convInFlush(void *pvUser, void *pStorage)
    694694{
    695     NOREF(pvUser);
    696     NOREF(pStorage);
     695    RT_NOREF(pvUser);
     696    RT_NOREF(pStorage);
    697697    return VINF_SUCCESS;
    698698}
     
    729729static DECLCALLBACK(int) convStdOutClose(void *pvUser, void *pStorage)
    730730{
    731     NOREF(pvUser);
     731    RT_NOREF(pvUser);
    732732    AssertPtrReturn(pStorage, VERR_INVALID_POINTER);
    733733    PFILEIOSTATE pFS = (PFILEIOSTATE)pStorage;
     
    760760static DECLCALLBACK(int) convStdOutDelete(void *pvUser, const char *pcszFilename)
    761761{
    762     NOREF(pvUser);
    763     NOREF(pcszFilename);
     762    RT_NOREF(pvUser);
     763    RT_NOREF(pcszFilename);
    764764    AssertFailedReturn(VERR_NOT_SUPPORTED);
    765765}
     
    767767static DECLCALLBACK(int) convStdOutMove(void *pvUser, const char *pcszSrc, const char *pcszDst, unsigned fMove)
    768768{
    769     NOREF(pvUser);
    770     NOREF(pcszSrc);
    771     NOREF(pcszDst);
    772     NOREF(fMove);
     769    RT_NOREF(pvUser);
     770    RT_NOREF(pcszSrc);
     771    RT_NOREF(pcszDst);
     772    RT_NOREF(fMove);
    773773    AssertFailedReturn(VERR_NOT_SUPPORTED);
    774774}
     
    776776static DECLCALLBACK(int) convStdOutGetFreeSpace(void *pvUser, const char *pcszFilename, int64_t *pcbFreeSpace)
    777777{
    778     NOREF(pvUser);
    779     NOREF(pcszFilename);
     778    RT_NOREF(pvUser);
     779    RT_NOREF(pcszFilename);
    780780    AssertPtrReturn(pcbFreeSpace, VERR_INVALID_POINTER);
    781781    *pcbFreeSpace = INT64_MAX;
     
    785785static DECLCALLBACK(int) convStdOutGetModificationTime(void *pvUser, const char *pcszFilename, PRTTIMESPEC pModificationTime)
    786786{
    787     NOREF(pvUser);
    788     NOREF(pcszFilename);
     787    RT_NOREF(pvUser);
     788    RT_NOREF(pcszFilename);
    789789    AssertPtrReturn(pModificationTime, VERR_INVALID_POINTER);
    790790    AssertFailedReturn(VERR_NOT_SUPPORTED);
     
    793793static DECLCALLBACK(int) convStdOutGetSize(void *pvUser, void *pStorage, uint64_t *pcbSize)
    794794{
    795     NOREF(pvUser);
    796     NOREF(pStorage);
     795    RT_NOREF(pvUser);
     796    RT_NOREF(pStorage);
    797797    AssertPtrReturn(pcbSize, VERR_INVALID_POINTER);
    798798    AssertFailedReturn(VERR_NOT_SUPPORTED);
     
    809809                                        size_t *pcbRead)
    810810{
    811     NOREF(pvUser);
    812     NOREF(pStorage);
    813     NOREF(uOffset);
    814     NOREF(cbBuffer);
    815     NOREF(pcbRead);
     811    RT_NOREF(pvUser);
     812    RT_NOREF(pStorage);
     813    RT_NOREF(uOffset);
     814    RT_NOREF(cbBuffer);
     815    RT_NOREF(pcbRead);
    816816    AssertPtrReturn(pvBuffer, VERR_INVALID_POINTER);
    817817    AssertFailedReturn(VERR_NOT_SUPPORTED);
     
    821821                                         size_t *pcbWritten)
    822822{
    823     NOREF(pvUser);
     823    RT_NOREF(pvUser);
    824824    AssertPtrReturn(pStorage, VERR_INVALID_POINTER);
    825825    AssertPtrReturn(pvBuffer, VERR_INVALID_POINTER);
     
    867867static DECLCALLBACK(int) convStdOutFlush(void *pvUser, void *pStorage)
    868868{
    869     NOREF(pvUser);
    870     NOREF(pStorage);
     869    RT_NOREF(pvUser);
     870    RT_NOREF(pStorage);
    871871    return VINF_SUCCESS;
    872872}
     
    903903static DECLCALLBACK(int) convFileOutClose(void *pvUser, void *pStorage)
    904904{
    905     NOREF(pvUser);
     905    RT_NOREF(pvUser);
    906906    AssertPtrReturn(pStorage, VERR_INVALID_POINTER);
    907907    PFILEIOSTATE pFS = (PFILEIOSTATE)pStorage;
     
    920920static DECLCALLBACK(int) convFileOutDelete(void *pvUser, const char *pcszFilename)
    921921{
    922     NOREF(pvUser);
    923     NOREF(pcszFilename);
     922    RT_NOREF(pvUser);
     923    RT_NOREF(pcszFilename);
    924924    AssertFailedReturn(VERR_NOT_SUPPORTED);
    925925}
     
    927927static DECLCALLBACK(int) convFileOutMove(void *pvUser, const char *pcszSrc, const char *pcszDst, unsigned fMove)
    928928{
    929     NOREF(pvUser);
    930     NOREF(pcszSrc);
    931     NOREF(pcszDst);
    932     NOREF(fMove);
     929    RT_NOREF(pvUser);
     930    RT_NOREF(pcszSrc);
     931    RT_NOREF(pcszDst);
     932    RT_NOREF(fMove);
    933933    AssertFailedReturn(VERR_NOT_SUPPORTED);
    934934}
     
    936936static DECLCALLBACK(int) convFileOutGetFreeSpace(void *pvUser, const char *pcszFilename, int64_t *pcbFreeSpace)
    937937{
    938     NOREF(pvUser);
    939     NOREF(pcszFilename);
     938    RT_NOREF(pvUser);
     939    RT_NOREF(pcszFilename);
    940940    AssertPtrReturn(pcbFreeSpace, VERR_INVALID_POINTER);
    941941    *pcbFreeSpace = INT64_MAX;
     
    945945static DECLCALLBACK(int) convFileOutGetModificationTime(void *pvUser, const char *pcszFilename, PRTTIMESPEC pModificationTime)
    946946{
    947     NOREF(pvUser);
    948     NOREF(pcszFilename);
     947    RT_NOREF(pvUser);
     948    RT_NOREF(pcszFilename);
    949949    AssertPtrReturn(pModificationTime, VERR_INVALID_POINTER);
    950950    AssertFailedReturn(VERR_NOT_SUPPORTED);
     
    953953static DECLCALLBACK(int) convFileOutGetSize(void *pvUser, void *pStorage, uint64_t *pcbSize)
    954954{
    955     NOREF(pvUser);
    956     NOREF(pStorage);
     955    RT_NOREF(pvUser);
     956    RT_NOREF(pStorage);
    957957    AssertPtrReturn(pcbSize, VERR_INVALID_POINTER);
    958958    AssertFailedReturn(VERR_NOT_SUPPORTED);
     
    961961static DECLCALLBACK(int) convFileOutSetSize(void *pvUser, void *pStorage, uint64_t cbSize)
    962962{
    963     NOREF(pvUser);
     963    RT_NOREF(pvUser);
    964964    AssertPtrReturn(pStorage, VERR_INVALID_POINTER);
    965965    PFILEIOSTATE pFS = (PFILEIOSTATE)pStorage;
     
    974974                                         size_t *pcbRead)
    975975{
    976     NOREF(pvUser);
    977     NOREF(pStorage);
    978     NOREF(uOffset);
    979     NOREF(cbBuffer);
    980     NOREF(pcbRead);
     976    RT_NOREF(pvUser);
     977    RT_NOREF(pStorage);
     978    RT_NOREF(uOffset);
     979    RT_NOREF(cbBuffer);
     980    RT_NOREF(pcbRead);
    981981    AssertPtrReturn(pvBuffer, VERR_INVALID_POINTER);
    982982    AssertFailedReturn(VERR_NOT_SUPPORTED);
     
    986986                                          size_t *pcbWritten)
    987987{
    988     NOREF(pvUser);
     988    RT_NOREF(pvUser);
    989989    AssertPtrReturn(pStorage, VERR_INVALID_POINTER);
    990990    AssertPtrReturn(pvBuffer, VERR_INVALID_POINTER);
     
    10351035static DECLCALLBACK(int) convFileOutFlush(void *pvUser, void *pStorage)
    10361036{
    1037     NOREF(pvUser);
    1038     NOREF(pStorage);
     1037    RT_NOREF(pvUser);
     1038    RT_NOREF(pStorage);
    10391039    return VINF_SUCCESS;
    10401040}
     
    20592059int main(int argc, char *argv[])
    20602060{
    2061     int exitcode = 0;
    2062 
    20632061    int rc = RTR3InitExe(argc, &argv, RTR3INIT_FLAGS_STANDALONE_APP);
    20642062    if (RT_FAILURE(rc))
     
    21222120    rc = VDInterfaceAdd(&vdInterfaceError.Core, "VBoxManage_IError", VDINTERFACETYPE_ERROR,
    21232121                        NULL, sizeof(VDINTERFACEERROR), &pVDIfs);
     2122    if (RT_FAILURE(rc))
     2123    {
     2124        errorSyntax("VDInterfaceAdd() failed! rc=%Rrc\n", rc);
     2125        return RTEXITCODE_FAILURE;
     2126    }
    21242127
    21252128    rc = VDInit();
     
    21272130    {
    21282131        errorSyntax("Initializing backends failed! rc=%Rrc\n", rc);
    2129         return 1;
     2132        return RTEXITCODE_FAILURE;
    21302133    }
    21312134
     
    21542157    };
    21552158
     2159    int rcExit = VINF_SUCCESS;
     2160
    21562161    HandlerArg handlerArg = { 0, NULL };
    21572162    int commandIndex;
     
    21632168            handlerArg.argv = &argv[iCmdArg];
    21642169
    2165             exitcode = s_commandHandlers[commandIndex].handler(&handlerArg);
     2170            rcExit = s_commandHandlers[commandIndex].handler(&handlerArg);
    21662171            break;
    21672172        }
     
    21702175    {
    21712176        errorSyntax("Invalid command '%s'", argv[iCmd]);
    2172         return 1;
     2177        return RTEXITCODE_SYNTAX;
    21732178    }
    21742179
     
    21772182    {
    21782183        errorSyntax("Unloading backends failed! rc=%Rrc\n", rc);
    2179         return 1;
    2180     }
    2181 
    2182     return exitcode;
     2184        return RTEXITCODE_FAILURE;
     2185    }
     2186
     2187    return rcExit;
    21832188}
    21842189
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