Changeset 107561 in vbox for trunk/src/VBox
- Timestamp:
- Jan 9, 2025 9:02:37 AM (10 days ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Storage/testcase/vbox-img.cpp
r106061 r107561 145 145 static DECLCALLBACK(int) handleVDMessage(void *pvUser, const char *pszFormat, va_list va) 146 146 { 147 NOREF(pvUser);147 RT_NOREF(pvUser); 148 148 RTPrintfV(pszFormat, va); 149 149 return VINF_SUCCESS; … … 161 161 va_end(args); 162 162 printUsage(g_pStdErr); 163 return 1;163 return RTEXITCODE_SYNTAX; 164 164 } 165 165 … … 171 171 RTMsgErrorV(pszFormat, args); 172 172 va_end(args); 173 return 1;173 return RTEXITCODE_FAILURE; 174 174 } 175 175 … … 534 534 static DECLCALLBACK(int) convInClose(void *pvUser, void *pStorage) 535 535 { 536 NOREF(pvUser);536 RT_NOREF(pvUser); 537 537 AssertPtrReturn(pStorage, VERR_INVALID_POINTER); 538 538 PFILEIOSTATE pFS = (PFILEIOSTATE)pStorage; … … 545 545 static DECLCALLBACK(int) convInDelete(void *pvUser, const char *pcszFilename) 546 546 { 547 NOREF(pvUser);548 NOREF(pcszFilename);547 RT_NOREF(pvUser); 548 RT_NOREF(pcszFilename); 549 549 AssertFailedReturn(VERR_NOT_SUPPORTED); 550 550 } … … 552 552 static DECLCALLBACK(int) convInMove(void *pvUser, const char *pcszSrc, const char *pcszDst, unsigned fMove) 553 553 { 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); 558 558 AssertFailedReturn(VERR_NOT_SUPPORTED); 559 559 } … … 561 561 static DECLCALLBACK(int) convInGetFreeSpace(void *pvUser, const char *pcszFilename, int64_t *pcbFreeSpace) 562 562 { 563 NOREF(pvUser);564 NOREF(pcszFilename);563 RT_NOREF(pvUser); 564 RT_NOREF(pcszFilename); 565 565 AssertPtrReturn(pcbFreeSpace, VERR_INVALID_POINTER); 566 566 *pcbFreeSpace = 0; … … 570 570 static DECLCALLBACK(int) convInGetModificationTime(void *pvUser, const char *pcszFilename, PRTTIMESPEC pModificationTime) 571 571 { 572 NOREF(pvUser);573 NOREF(pcszFilename);572 RT_NOREF(pvUser); 573 RT_NOREF(pcszFilename); 574 574 AssertPtrReturn(pModificationTime, VERR_INVALID_POINTER); 575 575 AssertFailedReturn(VERR_NOT_SUPPORTED); … … 578 578 static DECLCALLBACK(int) convInGetSize(void *pvUser, void *pStorage, uint64_t *pcbSize) 579 579 { 580 NOREF(pvUser);581 NOREF(pStorage);580 RT_NOREF(pvUser); 581 RT_NOREF(pStorage); 582 582 AssertPtrReturn(pcbSize, VERR_INVALID_POINTER); 583 583 AssertFailedReturn(VERR_NOT_SUPPORTED); … … 586 586 static DECLCALLBACK(int) convInSetSize(void *pvUser, void *pStorage, uint64_t cbSize) 587 587 { 588 NOREF(pvUser);589 NOREF(pStorage);590 NOREF(cbSize);588 RT_NOREF(pvUser); 589 RT_NOREF(pStorage); 590 RT_NOREF(cbSize); 591 591 AssertFailedReturn(VERR_NOT_SUPPORTED); 592 592 } … … 595 595 void *pvBuffer, size_t cbBuffer, size_t *pcbRead) 596 596 { 597 NOREF(pvUser);597 RT_NOREF(pvUser); 598 598 AssertPtrReturn(pStorage, VERR_INVALID_POINTER); 599 599 AssertPtrReturn(pvBuffer, VERR_INVALID_POINTER); … … 682 682 size_t *pcbWritten) 683 683 { 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); 689 689 AssertPtrReturn(pvBuffer, VERR_INVALID_POINTER); 690 690 AssertFailedReturn(VERR_NOT_SUPPORTED); … … 693 693 static DECLCALLBACK(int) convInFlush(void *pvUser, void *pStorage) 694 694 { 695 NOREF(pvUser);696 NOREF(pStorage);695 RT_NOREF(pvUser); 696 RT_NOREF(pStorage); 697 697 return VINF_SUCCESS; 698 698 } … … 729 729 static DECLCALLBACK(int) convStdOutClose(void *pvUser, void *pStorage) 730 730 { 731 NOREF(pvUser);731 RT_NOREF(pvUser); 732 732 AssertPtrReturn(pStorage, VERR_INVALID_POINTER); 733 733 PFILEIOSTATE pFS = (PFILEIOSTATE)pStorage; … … 760 760 static DECLCALLBACK(int) convStdOutDelete(void *pvUser, const char *pcszFilename) 761 761 { 762 NOREF(pvUser);763 NOREF(pcszFilename);762 RT_NOREF(pvUser); 763 RT_NOREF(pcszFilename); 764 764 AssertFailedReturn(VERR_NOT_SUPPORTED); 765 765 } … … 767 767 static DECLCALLBACK(int) convStdOutMove(void *pvUser, const char *pcszSrc, const char *pcszDst, unsigned fMove) 768 768 { 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); 773 773 AssertFailedReturn(VERR_NOT_SUPPORTED); 774 774 } … … 776 776 static DECLCALLBACK(int) convStdOutGetFreeSpace(void *pvUser, const char *pcszFilename, int64_t *pcbFreeSpace) 777 777 { 778 NOREF(pvUser);779 NOREF(pcszFilename);778 RT_NOREF(pvUser); 779 RT_NOREF(pcszFilename); 780 780 AssertPtrReturn(pcbFreeSpace, VERR_INVALID_POINTER); 781 781 *pcbFreeSpace = INT64_MAX; … … 785 785 static DECLCALLBACK(int) convStdOutGetModificationTime(void *pvUser, const char *pcszFilename, PRTTIMESPEC pModificationTime) 786 786 { 787 NOREF(pvUser);788 NOREF(pcszFilename);787 RT_NOREF(pvUser); 788 RT_NOREF(pcszFilename); 789 789 AssertPtrReturn(pModificationTime, VERR_INVALID_POINTER); 790 790 AssertFailedReturn(VERR_NOT_SUPPORTED); … … 793 793 static DECLCALLBACK(int) convStdOutGetSize(void *pvUser, void *pStorage, uint64_t *pcbSize) 794 794 { 795 NOREF(pvUser);796 NOREF(pStorage);795 RT_NOREF(pvUser); 796 RT_NOREF(pStorage); 797 797 AssertPtrReturn(pcbSize, VERR_INVALID_POINTER); 798 798 AssertFailedReturn(VERR_NOT_SUPPORTED); … … 809 809 size_t *pcbRead) 810 810 { 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); 816 816 AssertPtrReturn(pvBuffer, VERR_INVALID_POINTER); 817 817 AssertFailedReturn(VERR_NOT_SUPPORTED); … … 821 821 size_t *pcbWritten) 822 822 { 823 NOREF(pvUser);823 RT_NOREF(pvUser); 824 824 AssertPtrReturn(pStorage, VERR_INVALID_POINTER); 825 825 AssertPtrReturn(pvBuffer, VERR_INVALID_POINTER); … … 867 867 static DECLCALLBACK(int) convStdOutFlush(void *pvUser, void *pStorage) 868 868 { 869 NOREF(pvUser);870 NOREF(pStorage);869 RT_NOREF(pvUser); 870 RT_NOREF(pStorage); 871 871 return VINF_SUCCESS; 872 872 } … … 903 903 static DECLCALLBACK(int) convFileOutClose(void *pvUser, void *pStorage) 904 904 { 905 NOREF(pvUser);905 RT_NOREF(pvUser); 906 906 AssertPtrReturn(pStorage, VERR_INVALID_POINTER); 907 907 PFILEIOSTATE pFS = (PFILEIOSTATE)pStorage; … … 920 920 static DECLCALLBACK(int) convFileOutDelete(void *pvUser, const char *pcszFilename) 921 921 { 922 NOREF(pvUser);923 NOREF(pcszFilename);922 RT_NOREF(pvUser); 923 RT_NOREF(pcszFilename); 924 924 AssertFailedReturn(VERR_NOT_SUPPORTED); 925 925 } … … 927 927 static DECLCALLBACK(int) convFileOutMove(void *pvUser, const char *pcszSrc, const char *pcszDst, unsigned fMove) 928 928 { 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); 933 933 AssertFailedReturn(VERR_NOT_SUPPORTED); 934 934 } … … 936 936 static DECLCALLBACK(int) convFileOutGetFreeSpace(void *pvUser, const char *pcszFilename, int64_t *pcbFreeSpace) 937 937 { 938 NOREF(pvUser);939 NOREF(pcszFilename);938 RT_NOREF(pvUser); 939 RT_NOREF(pcszFilename); 940 940 AssertPtrReturn(pcbFreeSpace, VERR_INVALID_POINTER); 941 941 *pcbFreeSpace = INT64_MAX; … … 945 945 static DECLCALLBACK(int) convFileOutGetModificationTime(void *pvUser, const char *pcszFilename, PRTTIMESPEC pModificationTime) 946 946 { 947 NOREF(pvUser);948 NOREF(pcszFilename);947 RT_NOREF(pvUser); 948 RT_NOREF(pcszFilename); 949 949 AssertPtrReturn(pModificationTime, VERR_INVALID_POINTER); 950 950 AssertFailedReturn(VERR_NOT_SUPPORTED); … … 953 953 static DECLCALLBACK(int) convFileOutGetSize(void *pvUser, void *pStorage, uint64_t *pcbSize) 954 954 { 955 NOREF(pvUser);956 NOREF(pStorage);955 RT_NOREF(pvUser); 956 RT_NOREF(pStorage); 957 957 AssertPtrReturn(pcbSize, VERR_INVALID_POINTER); 958 958 AssertFailedReturn(VERR_NOT_SUPPORTED); … … 961 961 static DECLCALLBACK(int) convFileOutSetSize(void *pvUser, void *pStorage, uint64_t cbSize) 962 962 { 963 NOREF(pvUser);963 RT_NOREF(pvUser); 964 964 AssertPtrReturn(pStorage, VERR_INVALID_POINTER); 965 965 PFILEIOSTATE pFS = (PFILEIOSTATE)pStorage; … … 974 974 size_t *pcbRead) 975 975 { 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); 981 981 AssertPtrReturn(pvBuffer, VERR_INVALID_POINTER); 982 982 AssertFailedReturn(VERR_NOT_SUPPORTED); … … 986 986 size_t *pcbWritten) 987 987 { 988 NOREF(pvUser);988 RT_NOREF(pvUser); 989 989 AssertPtrReturn(pStorage, VERR_INVALID_POINTER); 990 990 AssertPtrReturn(pvBuffer, VERR_INVALID_POINTER); … … 1035 1035 static DECLCALLBACK(int) convFileOutFlush(void *pvUser, void *pStorage) 1036 1036 { 1037 NOREF(pvUser);1038 NOREF(pStorage);1037 RT_NOREF(pvUser); 1038 RT_NOREF(pStorage); 1039 1039 return VINF_SUCCESS; 1040 1040 } … … 2059 2059 int main(int argc, char *argv[]) 2060 2060 { 2061 int exitcode = 0;2062 2063 2061 int rc = RTR3InitExe(argc, &argv, RTR3INIT_FLAGS_STANDALONE_APP); 2064 2062 if (RT_FAILURE(rc)) … … 2122 2120 rc = VDInterfaceAdd(&vdInterfaceError.Core, "VBoxManage_IError", VDINTERFACETYPE_ERROR, 2123 2121 NULL, sizeof(VDINTERFACEERROR), &pVDIfs); 2122 if (RT_FAILURE(rc)) 2123 { 2124 errorSyntax("VDInterfaceAdd() failed! rc=%Rrc\n", rc); 2125 return RTEXITCODE_FAILURE; 2126 } 2124 2127 2125 2128 rc = VDInit(); … … 2127 2130 { 2128 2131 errorSyntax("Initializing backends failed! rc=%Rrc\n", rc); 2129 return 1;2132 return RTEXITCODE_FAILURE; 2130 2133 } 2131 2134 … … 2154 2157 }; 2155 2158 2159 int rcExit = VINF_SUCCESS; 2160 2156 2161 HandlerArg handlerArg = { 0, NULL }; 2157 2162 int commandIndex; … … 2163 2168 handlerArg.argv = &argv[iCmdArg]; 2164 2169 2165 exitcode= s_commandHandlers[commandIndex].handler(&handlerArg);2170 rcExit = s_commandHandlers[commandIndex].handler(&handlerArg); 2166 2171 break; 2167 2172 } … … 2170 2175 { 2171 2176 errorSyntax("Invalid command '%s'", argv[iCmd]); 2172 return 1;2177 return RTEXITCODE_SYNTAX; 2173 2178 } 2174 2179 … … 2177 2182 { 2178 2183 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; 2183 2188 } 2184 2189
Note:
See TracChangeset
for help on using the changeset viewer.