Changeset 46326 in vbox
- Timestamp:
- May 30, 2013 12:16:53 PM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 86097
- Location:
- trunk/src/VBox
- Files:
-
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxService/VBoxService.cpp
r44872 r46326 861 861 bool fFound = false; 862 862 863 if (cch > sizeof("enable-") && !memcmp(psz, "enable-", sizeof("enable-") - 1))863 if (cch > sizeof("enable-") && !memcmp(psz, RT_STR_TUPLE("enable-"))) 864 864 for (unsigned j = 0; !fFound && j < RT_ELEMENTS(g_aServices); j++) 865 865 if ((fFound = !RTStrICmp(psz + sizeof("enable-") - 1, g_aServices[j].pDesc->pszName))) 866 866 g_aServices[j].fEnabled = true; 867 867 868 if (cch > sizeof("disable-") && !memcmp(psz, "disable-", sizeof("disable-") - 1))868 if (cch > sizeof("disable-") && !memcmp(psz, RT_STR_TUPLE("disable-"))) 869 869 for (unsigned j = 0; !fFound && j < RT_ELEMENTS(g_aServices); j++) 870 870 if ((fFound = !RTStrICmp(psz + sizeof("disable-") - 1, g_aServices[j].pDesc->pszName))) 871 871 g_aServices[j].fEnabled = false; 872 872 873 if (cch > sizeof("only-") && !memcmp(psz, "only-", sizeof("only-") - 1))873 if (cch > sizeof("only-") && !memcmp(psz, RT_STR_TUPLE("only-"))) 874 874 for (unsigned j = 0; j < RT_ELEMENTS(g_aServices); j++) 875 875 { -
trunk/src/VBox/Devices/Network/DrvIntNet.cpp
r44528 r46326 1661 1661 if ( !OpenReq.szTrunk[0] 1662 1662 && OpenReq.enmTrunkType == kIntNetTrunkType_None 1663 && !strncmp(pThis->szNetwork, "if=en", sizeof("if=en") - 1)1663 && !strncmp(pThis->szNetwork, RT_STR_TUPLE("if=en")) 1664 1664 && RT_C_IS_DIGIT(pThis->szNetwork[sizeof("if=en") - 1]) 1665 1665 && !pThis->szNetwork[sizeof("if=en")]) … … 1671 1671 if ( !OpenReq.szTrunk[0] 1672 1672 && OpenReq.enmTrunkType == kIntNetTrunkType_None 1673 && !strncmp(pThis->szNetwork, "wif=en", sizeof("wif=en") - 1)1673 && !strncmp(pThis->szNetwork, RT_STR_TUPLE("wif=en")) 1674 1674 && RT_C_IS_DIGIT(pThis->szNetwork[sizeof("wif=en") - 1]) 1675 1675 && !pThis->szNetwork[sizeof("wif=en")]) -
trunk/src/VBox/Devices/USB/linux/USBProxyDevice-linux.cpp
r44528 r46326 477 477 478 478 /* Skip ahead to 'Bus' and compare */ 479 psz = RTStrStripL(psz + 2); Assert(!strncmp(psz, "Bus=", 4));479 psz = RTStrStripL(psz + 2); Assert(!strncmp(psz, RT_STR_TUPLE("Bus="))); 480 480 psz = RTStrStripL(psz + 4); 481 481 char *pszNext; … … 625 625 */ 626 626 #ifdef VBOX_USB_WITH_SYSFS 627 fUsingSysfs = strncmp(pszAddress, "sysfs:", sizeof("sysfs:") - 1) == 0;627 fUsingSysfs = strncmp(pszAddress, RT_STR_TUPLE("sysfs:")) == 0; 628 628 if (fUsingSysfs) 629 629 { … … 949 949 * "SerialNumber=" 950 950 */ 951 if ( strncmp(psz, "SerialNumber=", sizeof("SerialNumber=") - 1))951 if (strncmp(psz, RT_STR_TUPLE("SerialNumber="))) 952 952 break; 953 953 -
trunk/src/VBox/HostDrivers/Support/SUPLib.cpp
r44528 r46326 1673 1673 /** @todo is this actually used??? */ 1674 1674 /* skip the 64-bit ELF import prefix first. */ 1675 if (!strncmp(pszSymbol, "SUPR0$", sizeof("SUPR0$") - 1))1675 if (!strncmp(pszSymbol, RT_STR_TUPLE("SUPR0$"))) 1676 1676 pszSymbol += sizeof("SUPR0$") - 1; 1677 1677 -
trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp
r45971 r46326 298 298 szProdName[0] = '\0'; 299 299 RTSystemQueryDmiString(RTSYSDMISTR_PRODUCT_NAME, szProdName, sizeof(szProdName)); 300 if ( ( !strncmp(szProdName, "Mac", 3)301 || !strncmp(szProdName, "iMac", 4)302 || !strncmp(szProdName, "iMac", 4)303 || !strncmp(szProdName, "Xserve", 6)300 if ( ( !strncmp(szProdName, RT_STR_TUPLE("Mac")) 301 || !strncmp(szProdName, RT_STR_TUPLE("iMac")) 302 || !strncmp(szProdName, RT_STR_TUPLE("iMac")) 303 || !strncmp(szProdName, RT_STR_TUPLE("Xserve")) 304 304 ) 305 305 && !strchr(szProdName, ' ') /* no spaces */ … … 2933 2933 2934 2934 /* check for type prefix first. */ 2935 if (!strncmp(strCFGMValueUtf8.c_str(), "string:", sizeof("string:") - 1))2935 if (!strncmp(strCFGMValueUtf8.c_str(), RT_STR_TUPLE("string:"))) 2936 2936 InsertConfigString(pNode, pszCFGMValueName, strCFGMValueUtf8.c_str() + sizeof("string:") - 1); 2937 else if (!strncmp(strCFGMValueUtf8.c_str(), "integer:", sizeof("integer:") - 1))2937 else if (!strncmp(strCFGMValueUtf8.c_str(), RT_STR_TUPLE("integer:"))) 2938 2938 { 2939 2939 rc = RTStrToUInt64Full(strCFGMValueUtf8.c_str() + sizeof("integer:") - 1, 0, &u64Value); … … 2941 2941 rc = CFGMR3InsertInteger(pNode, pszCFGMValueName, u64Value); 2942 2942 } 2943 else if (!strncmp(strCFGMValueUtf8.c_str(), "bytes:", sizeof("bytes:") - 1))2943 else if (!strncmp(strCFGMValueUtf8.c_str(), RT_STR_TUPLE("bytes:"))) 2944 2944 { 2945 2945 char const *pszBase64 = strCFGMValueUtf8.c_str() + sizeof("bytes:") - 1; … … 4349 4349 * interface via the current FreeBSD vboxnetflt implementation. 4350 4350 */ 4351 if (!strncmp(pszBridgedIfName, "tap", sizeof "tap" - 1)) {4351 if (!strncmp(pszBridgedIfName, RT_STR_TUPLE("tap"))) { 4352 4352 hrc = attachToTapInterface(aNetworkAdapter); 4353 4353 if (FAILED(hrc)) -
trunk/src/VBox/Main/src-client/ConsoleImplTeleporter.cpp
r44528 r46326 240 240 return S_OK; 241 241 242 if (!strncmp(szMsg, "NACK=", sizeof("NACK=") - 1))242 if (!strncmp(szMsg, RT_STR_TUPLE("NACK="))) 243 243 { 244 244 char *pszMsgText = strchr(szMsg, ';'); -
trunk/src/VBox/Main/src-helper-apps/VBoxExtPackHelperApp.cpp
r42708 r46326 1088 1088 if ( pszMarker 1089 1089 && ( !strcmp(pszMarker, "-_-uninst") 1090 || !strncmp(pszMarker, "-_-inst", sizeof("-_-inst") - 1)))1090 || !strncmp(pszMarker, RT_STR_TUPLE("-_-inst")))) 1091 1091 fCandidate = VBoxExtPackIsValidMangledName(Entry.szName, pszMarker - &Entry.szName[0]); 1092 1092 if (fCandidate) -
trunk/src/VBox/Main/src-server/HostImpl.cpp
r45367 r46326 2278 2278 char *pszSlice = solarisGetSliceFromPath(pszDevLinkPath); 2279 2279 if ( pszSlice && !strcmp(pszSlice, "s2") 2280 && !strncmp(pszDevLinkPath, "/dev/rdsk", sizeof("/dev/rdsk") - 1)) /* We want only raw disks */2280 && !strncmp(pszDevLinkPath, RT_STR_TUPLE("/dev/rdsk"))) /* We want only raw disks */ 2281 2281 { 2282 2282 /* … … 2730 2730 // skip devices we are not interested in 2731 2731 if ((*mountName && mountName[0] == '/') && // skip 'fake' devices (like -hosts, proc, fd, swap) 2732 (*mountFSType && (strncmp(mountFSType, "devfs", 5) != 0 && // skip devfs (i.e. /devices)2733 strncmp(mountFSType, "dev", 3) != 0 && // skip dev (i.e. /dev)2734 strncmp(mountFSType, "lofs", 4) != 0))) // skip loop-back file-system (lofs)2732 (*mountFSType && (strncmp(mountFSType, RT_STR_TUPLE("devfs")) != 0 && // skip devfs (i.e. /devices) 2733 strncmp(mountFSType, RT_STR_TUPLE("dev")) != 0 && // skip dev (i.e. /dev) 2734 strncmp(mountFSType, RT_STR_TUPLE("lofs")) != 0))) // skip loop-back file-system (lofs) 2735 2735 { 2736 2736 char *rawDevName = getfullrawname((char *)mountName); -
trunk/src/VBox/Main/src-server/linux/USBGetDevices.cpp
r45367 r46326 358 358 pszValue = RTStrStripL(pszValue); 359 359 /* verified with Linux 2.4.0 ... Linux 2.6.25 */ 360 if (!strncmp(pszValue, "1.5", 3))360 if (!strncmp(pszValue, RT_STR_TUPLE("1.5"))) 361 361 *pSpd = USBDEVICESPEED_LOW; 362 else if (!strncmp(pszValue, "12 ", 3))362 else if (!strncmp(pszValue, RT_STR_TUPLE("12 "))) 363 363 *pSpd = USBDEVICESPEED_FULL; 364 else if (!strncmp(pszValue, "480", 3))364 else if (!strncmp(pszValue, RT_STR_TUPLE("480"))) 365 365 *pSpd = USBDEVICESPEED_HIGH; 366 366 else … … 1123 1123 { 1124 1124 /* No -/. so it must be a root hub. Check that it's usb<something>. */ 1125 if (strncmp(pszLastComp, "usb", sizeof("usb") - 1) != 0)1125 if (strncmp(pszLastComp, RT_STR_TUPLE("usb")) != 0) 1126 1126 { 1127 1127 Log(("usbGetPortFromSysfsPath(%s): failed [2]\n", pszPath)); -
trunk/src/VBox/Main/testcase/tstAPI.cpp
r43445 r46326 1158 1158 #endif 1159 1159 1160 #if 01160 #if 1 1161 1161 do { 1162 1162 // Get host -
trunk/src/VBox/Main/webservice/split-soapC.cpp
r44529 r46326 140 140 141 141 /* process nesting depth information */ 142 if (!strncmp(pLine, "#if", 3))142 if (!strncmp(pLine, RT_STR_TUPLE("#if"))) 143 143 cIfNesting++; 144 else if (!strncmp(pLine, "#endif", 6))144 else if (!strncmp(pLine, RT_STR_TUPLE("#endif"))) 145 145 { 146 146 cIfNesting--; … … 164 164 165 165 /* look for static variables used for enum conversion. */ 166 if (!strncmp(pLine, "static const struct soap_code_map", sizeof("static const struct soap_code_map") - 1))166 if (!strncmp(pLine, RT_STR_TUPLE("static const struct soap_code_map"))) 167 167 cLinesSinceStaticMap = 0; 168 168 else -
trunk/src/VBox/Runtime/common/string/strformatrt.cpp
r45236 r46326 559 559 const char *psz = pszLastSep = va_arg(*pArgs, const char *); 560 560 if (!VALID_PTR(psz)) 561 return pfnOutput(pvArgOutput, "<null>", sizeof("<null>") - 1);561 return pfnOutput(pvArgOutput, RT_STR_TUPLE("<null>")); 562 562 563 563 while ((ch = *psz) != '\0') … … 603 603 const char *psz = pszStart = va_arg(*pArgs, const char *); 604 604 if (!VALID_PTR(psz)) 605 return pfnOutput(pvArgOutput, "<null>", sizeof("<null>") - 1);605 return pfnOutput(pvArgOutput, RT_STR_TUPLE("<null>")); 606 606 607 607 while ((ch = *psz) != '\0' && ch != '(') … … 708 708 } 709 709 else 710 return pfnOutput(pvArgOutput, "<null>", sizeof("<null>") - 1);710 return pfnOutput(pvArgOutput, RT_STR_TUPLE("<null>")); 711 711 break; 712 712 } … … 904 904 */ 905 905 if ((s_aTypes[i].fFlags & RTST_FLAGS_POINTER) && !VALID_PTR(u.pv)) 906 return pfnOutput(pvArgOutput, "<null>", sizeof("<null>") - 1);906 return pfnOutput(pvArgOutput, RT_STR_TUPLE("<null>")); 907 907 908 908 /* -
trunk/src/VBox/Runtime/common/string/strformattype.cpp
r44529 r46326 467 467 rtstrFormatTypeReadUnlock(); 468 468 469 cch = pfnOutput(pvArgOutput, "<missing:%R[", sizeof("<missing:%R[") - 1);469 cch = pfnOutput(pvArgOutput, RT_STR_TUPLE("<missing:%R[")); 470 470 cch += pfnOutput(pvArgOutput, pszType, pszTypeEnd - pszType); 471 cch += pfnOutput(pvArgOutput, "]>", sizeof("]>") - 1);471 cch += pfnOutput(pvArgOutput, RT_STR_TUPLE("]>")); 472 472 } 473 473 -
trunk/src/VBox/Runtime/r3/linux/mp-linux.cpp
r46144 r46326 83 83 { 84 84 char *psz; 85 if ( !strncmp(sz, "processor", 9)85 if ( !strncmp(sz, RT_STR_TUPLE("processor")) 86 86 && (sz[10] == ' ' || sz[10] == '\t' || sz[10] == ':') 87 87 && (psz = strchr(sz, ':'))) … … 94 94 } 95 95 else if ( idCpu == idCpuFound 96 && !strncmp(sz, "cpu MHz", 7)96 && !strncmp(sz, RT_STR_TUPLE("cpu MHz")) 97 97 && (sz[10] == ' ' || sz[10] == '\t' || sz[10] == ':') 98 98 && (psz = strchr(sz, ':'))) -
trunk/src/VBox/Runtime/testcase/tstLdr-4.cpp
r44528 r46326 126 126 for (i = 0; i < RT_ELEMENTS(aLoads); i++) 127 127 { 128 if (!strncmp(aLoads[i].pszName, "kLdr-", sizeof("kLdr-") - 1))128 if (!strncmp(aLoads[i].pszName, RT_STR_TUPLE("kLdr-"))) 129 129 rc = RTLdrOpenkLdr(pszFilename, 0, RTLDRARCH_WHATEVER, &aLoads[i].hLdrMod); 130 130 else -
trunk/src/VBox/Runtime/testcase/tstLdr.cpp
r44528 r46326 122 122 /* open it */ 123 123 int rc; 124 if (!strncmp(aLoads[i].pszName, "kLdr-", sizeof("kLdr-") - 1))124 if (!strncmp(aLoads[i].pszName, RT_STR_TUPLE("kLdr-"))) 125 125 rc = RTLdrOpenkLdr(pszFilename, 0, RTLDRARCH_WHATEVER, &aLoads[i].hLdrMod); 126 126 else -
trunk/src/VBox/Runtime/testcase/tstR0ThreadPreemptionDriver.cpp
r45542 r46326 147 147 if (RT_FAILURE(rc)) 148 148 return RTTestSummaryAndDestroy(hTest); 149 RTTESTI_CHECK_MSG(!strncmp(Req.szMsg, "!42failure42", sizeof("!42failure42") - 1), ("%s", Req.szMsg));150 if (strncmp(Req.szMsg, "!42failure42", sizeof("!42failure42") - 1))149 RTTESTI_CHECK_MSG(!strncmp(Req.szMsg, RT_STR_TUPLE("!42failure42")), ("%s", Req.szMsg)); 150 if (strncmp(Req.szMsg, RT_STR_TUPLE("!42failure42"))) 151 151 return RTTestSummaryAndDestroy(hTest); 152 152 -
trunk/src/VBox/Runtime/testcase/tstRTR0DbgKrnlInfoDriver.cpp
r41947 r46326 121 121 if (RT_FAILURE(rc)) 122 122 return RTTestSummaryAndDestroy(hTest); 123 RTTESTI_CHECK_MSG(!strncmp(Req.szMsg, "!42failure42", sizeof("!42failure42") - 1), ("%s", Req.szMsg));124 if (strncmp(Req.szMsg, "!42failure42", sizeof("!42failure42") - 1))123 RTTESTI_CHECK_MSG(!strncmp(Req.szMsg, RT_STR_TUPLE("!42failure42")), ("%s", Req.szMsg)); 124 if (strncmp(Req.szMsg, RT_STR_TUPLE("!42failure42"))) 125 125 return RTTestSummaryAndDestroy(hTest); 126 126 -
trunk/src/VBox/Runtime/testcase/tstRTR0MemUserKernelDriver.cpp
r44529 r46326 122 122 if (RT_FAILURE(rc)) 123 123 return RTTestSummaryAndDestroy(hTest); 124 RTTESTI_CHECK_MSG(!strncmp(Req.szMsg, "!42failure42", sizeof("!42failure42") - 1), ("%s", Req.szMsg));125 if (strncmp(Req.szMsg, "!42failure42", sizeof("!42failure42") - 1))124 RTTESTI_CHECK_MSG(!strncmp(Req.szMsg, RT_STR_TUPLE("!42failure42")), ("%s", Req.szMsg)); 125 if (strncmp(Req.szMsg, RT_STR_TUPLE("!42failure42"))) 126 126 return RTTestSummaryAndDestroy(hTest); 127 127 -
trunk/src/VBox/Runtime/testcase/tstRTR0SemMutexDriver.cpp
r44528 r46326 238 238 if (RT_FAILURE(rc)) 239 239 return RTTestSummaryAndDestroy(hTest); 240 RTTESTI_CHECK_MSG(!strncmp(Req.szMsg, "!42failure42", sizeof("!42failure42") - 1), ("%s", Req.szMsg));241 if (strncmp(Req.szMsg, "!42failure42", sizeof("!42failure42") - 1))240 RTTESTI_CHECK_MSG(!strncmp(Req.szMsg, RT_STR_TUPLE("!42failure42")), ("%s", Req.szMsg)); 241 if (strncmp(Req.szMsg, RT_STR_TUPLE("!42failure42"))) 242 242 return RTTestSummaryAndDestroy(hTest); 243 243 -
trunk/src/VBox/VMM/VMMAll/PGMAll.cpp
r46125 r46326 2659 2659 } 2660 2660 else 2661 cch = pfnOutput(pvArgOutput, "<bad-pgmpage-ptr>", sizeof("<bad-pgmpage-ptr>") - 1);2661 cch = pfnOutput(pvArgOutput, RT_STR_TUPLE("<bad-pgmpage-ptr>")); 2662 2662 NOREF(pszType); NOREF(cchWidth); NOREF(pvUser); 2663 2663 return cch; … … 2681 2681 } 2682 2682 else 2683 cch = pfnOutput(pvArgOutput, "<bad-pgmramrange-ptr>", sizeof("<bad-pgmramrange-ptr>") - 1);2683 cch = pfnOutput(pvArgOutput, RT_STR_TUPLE("<bad-pgmramrange-ptr>")); 2684 2684 NOREF(pszType); NOREF(cchWidth); NOREF(cchPrecision); NOREF(pvUser); NOREF(fFlags); 2685 2685 return cch; -
trunk/src/VBox/VMM/VMMAll/VMMAll.cpp
r45749 r46326 94 94 } 95 95 if (cCpus == 0) 96 return pfnOutput(pvArgOutput, "<empty>", sizeof("<empty>") - 1);96 return pfnOutput(pvArgOutput, RT_STR_TUPLE("<empty>")); 97 97 if (cCpus == RT_ELEMENTS(pSet->au32Bitmap) * 32) 98 return pfnOutput(pvArgOutput, "<full>", sizeof("<full>") - 1);98 return pfnOutput(pvArgOutput, RT_STR_TUPLE("<full>")); 99 99 100 100 /* -
trunk/src/VBox/VMM/VMMR0/GVMMR0.cpp
r44528 r46326 545 545 * String switch time! 546 546 */ 547 if (strncmp(pszName, "/GVMM/", sizeof("/GVMM/") - 1))547 if (strncmp(pszName, RT_STR_TUPLE("/GVMM/"))) 548 548 return VERR_CFGM_VALUE_NOT_FOUND; /* borrow status codes from CFGM... */ 549 549 int rc = VINF_SUCCESS; … … 613 613 * String switch time! 614 614 */ 615 if (strncmp(pszName, "/GVMM/", sizeof("/GVMM/") - 1))615 if (strncmp(pszName, RT_STR_TUPLE("/GVMM/"))) 616 616 return VERR_CFGM_VALUE_NOT_FOUND; /* borrow status codes from CFGM... */ 617 617 int rc = VINF_SUCCESS; -
trunk/src/VBox/VMM/VMMR3/CPUM.cpp
r46165 r46326 3026 3026 else 3027 3027 { 3028 if (!strncmp(pszArgs, "verbose", sizeof("verbose") - 1))3028 if (!strncmp(pszArgs, RT_STR_TUPLE("verbose"))) 3029 3029 { 3030 3030 pszArgs += 7; 3031 3031 *penmType = CPUMDUMPTYPE_VERBOSE; 3032 3032 } 3033 else if (!strncmp(pszArgs, "terse", sizeof("terse") - 1))3033 else if (!strncmp(pszArgs, RT_STR_TUPLE("terse"))) 3034 3034 { 3035 3035 pszArgs += 5; 3036 3036 *penmType = CPUMDUMPTYPE_TERSE; 3037 3037 } 3038 else if (!strncmp(pszArgs, "default", sizeof("default") - 1))3038 else if (!strncmp(pszArgs, RT_STR_TUPLE("default"))) 3039 3039 { 3040 3040 pszArgs += 7; -
trunk/src/VBox/VMM/VMMR3/DBGFLog.cpp
r44528 r46326 42 42 PRTLOGGER pLogger; 43 43 const char *psz = *ppsz; 44 if (!strncmp(psz, "release:", sizeof("release:") - 1))44 if (!strncmp(psz, RT_STR_TUPLE("release:"))) 45 45 { 46 46 *ppsz += sizeof("release:") - 1; … … 49 49 else 50 50 { 51 if (!strncmp(psz, "debug:", sizeof("debug:") - 1))51 if (!strncmp(psz, RT_STR_TUPLE("debug:"))) 52 52 *ppsz += sizeof("debug:") - 1; 53 53 pLogger = RTLogDefaultInstance(); -
trunk/src/VBox/VMM/VMMR3/FTM.cpp
r44529 r46326 198 198 static int ftmR3TcpWriteACK(PVM pVM) 199 199 { 200 int rc = RTTcpWrite(pVM->ftm.s.hSocket, "ACK\n", sizeof("ACK\n") - 1);200 int rc = RTTcpWrite(pVM->ftm.s.hSocket, RT_STR_TUPLE("ACK\n")); 201 201 if (RT_FAILURE(rc)) 202 202 { … … 286 286 return VINF_SUCCESS; 287 287 288 if (!strncmp(szMsg, "NACK=", sizeof("NACK=") - 1))288 if (!strncmp(szMsg, RT_STR_TUPLE("NACK="))) 289 289 { 290 290 char *pszMsgText = strchr(szMsg, ';'); … … 334 334 static int ftmR3TcpSubmitCommand(PVM pVM, const char *pszCommand, bool fWaitForAck = true) 335 335 { 336 int rc = RTTcpSgWriteL(pVM->ftm.s.hSocket, 2, pszCommand, strlen(pszCommand), "\n", sizeof("\n") - 1);336 int rc = RTTcpSgWriteL(pVM->ftm.s.hSocket, 2, pszCommand, strlen(pszCommand), RT_STR_TUPLE("\n")); 337 337 if (RT_FAILURE(rc)) 338 338 return rc;
Note:
See TracChangeset
for help on using the changeset viewer.