Changeset 102457 in vbox
- Timestamp:
- Dec 4, 2023 5:24:33 PM (12 months ago)
- Location:
- trunk/src/libs/xpcom18a4
- Files:
-
- 1 deleted
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/libs/xpcom18a4/Makefile.kmk
r102392 r102457 389 389 nsprpub/lib/ds/plarena.c \ 390 390 nsprpub/lib/ds/plhash.c \ 391 nsprpub/lib/libc/src/strcmp.c \392 391 nsprpub/lib/libc/src/strccmp.c \ 393 392 nsprpub/pr/src/pthreads/ptsynch.c -
trunk/src/libs/xpcom18a4/ipc/ipcd/extensions/transmngr/src/tmTransactionService.cpp
r102392 r102457 342 342 qmap = (tm_queue_mapping*) mQueueMaps[index]; 343 343 if (qmap && 344 PL_strcmp(qmap->joinedQueueName, (char*) aTrans->GetMessage()) == 0) {344 RTStrCmp(qmap->joinedQueueName, (char*) aTrans->GetMessage()) == 0) { 345 345 346 346 // set the ID in the mapping -
trunk/src/libs/xpcom18a4/nsprpub/lib/libc/include/plstr.h
r102340 r102457 63 63 64 64 #ifdef VBOX_WITH_XPCOM_NAMESPACE_CLEANUP 65 #define PL_strcmp VBoxNsplPL_strcmp66 #define PL_strncmp VBoxNsplPL_strncmp67 65 #define PL_strcasecmp VBoxNsplPL_strcasecmp 68 66 #define PL_strncasecmp VBoxNsplPL_strncasecmp 69 #define PL_strdup VBoxNsplPL_strdup70 #define PL_strfree VBoxNsplPL_strfree71 #define PL_strncpy VBoxNsplPL_strncpy72 #define PL_strncpyz VBoxNsplPL_strncpyz73 #define PL_strcaserstr VBoxNsplPL_strcaserstr74 #define PL_strcasestr VBoxNsplPL_strcasestr75 #define PL_strndup VBoxNsplPL_strndup76 67 #endif /* VBOX_WITH_XPCOM_NAMESPACE_CLEANUP */ 77 68 78 69 PR_BEGIN_EXTERN_C 79 /*80 * PL_strcmp81 *82 * Returns an integer, the sign of which -- positive, zero, or negative --83 * reflects the lexical sorting order of the two strings indicated. The84 * result is positive if the first string comes after the second. The85 * NSPR implementation is not i18n.86 */87 88 PR_EXTERN(PRIntn)89 PL_strcmp(const char *a, const char *b);90 91 /*92 * PL_strncmp93 *94 * Returns an integer, the sign of which -- positive, zero, or negative --95 * reflects the lexical sorting order of the two strings indicated, up to96 * the maximum specified. The result is positive if the first string comes97 * after the second. The NSPR implementation is not i18n. If the maximum98 * is zero, only the existance or non-existance (pointer is null) of the99 * strings is compared.100 */101 102 PR_EXTERN(PRIntn)103 PL_strncmp(const char *a, const char *b, PRUint32 max);104 105 70 /* 106 71 * PL_strcasecmp -
trunk/src/libs/xpcom18a4/vboxdeps.cpp
r102341 r102457 14 14 uintptr_t deps[] = 15 15 { 16 (uintptr_t)PL_strcmp,17 16 (uintptr_t)PL_strcasecmp, 18 17 (uintptr_t)PL_HashString, -
trunk/src/libs/xpcom18a4/xpcom/base/nsTraceRefcntImpl.cpp
r102348 r102457 320 320 static PRIntn PR_CALLBACK TotalEntries(PLHashEntry *he, PRIntn i, void *arg) { 321 321 BloatEntry* entry = (BloatEntry*)he->value; 322 if (entry && nsCRT::strcmp(entry->mClassName, "TOTAL") != 0) {322 if (entry && RTStrCmp(entry->mClassName, "TOTAL") != 0) { 323 323 entry->Total((BloatEntry*)arg); 324 324 } … … 390 390 i+1, mClassName, 391 391 (PRInt32)mClassSize, 392 ( nsCRT::strcmp(mClassName, "TOTAL"))392 (RTStrCmp(mClassName, "TOTAL")) 393 393 ?(PRInt32)((stats->mCreates - stats->mDestroys) * mClassSize) 394 394 :mTotalLeaked, … … 538 538 BloatEntry* right = NS_STATIC_CAST(BloatEntry*, entries[j]); 539 539 540 if ( PL_strcmp(left->GetClassName(), right->GetClassName()) < 0) {540 if (RTStrCmp(left->GetClassName(), right->GetClassName()) < 0) { 541 541 entries.ReplaceElementAt(right, i); 542 542 entries.ReplaceElementAt(left, j); … … 637 637 const char* value = getenv(envVar); 638 638 if (value) { 639 if ( nsCRT::strcmp(value, "1") == 0) {639 if (RTStrCmp(value, "1") == 0) { 640 640 *result = stdout; 641 641 fprintf(stdout, "### %s defined -- logging %s to stdout\n", … … 643 643 return PR_TRUE; 644 644 } 645 else if ( nsCRT::strcmp(value, "2") == 0) {645 else if (RTStrCmp(value, "2") == 0) { 646 646 *result = stderr; 647 647 fprintf(stdout, "### %s defined -- logging %s to stderr\n", -
trunk/src/libs/xpcom18a4/xpcom/components/nsComponentManager.cpp
r102345 r102457 994 994 995 995 // ignore the leading '[' 996 if (0 != PL_strcmp(values[0]+1, token))996 if (0 != RTStrCmp(values[0]+1, token)) 997 997 break; 998 998 -
trunk/src/libs/xpcom18a4/xpcom/ds/nsAtomTable.cpp
r101962 r102457 36 36 * 37 37 * ***** END LICENSE BLOCK ***** */ 38 #include <iprt/string.h> 38 39 39 40 #include "nsAtomTable.h" … … 181 182 const AtomTableEntry *he = NS_STATIC_CAST(const AtomTableEntry*, entry); 182 183 const char* keyStr = NS_STATIC_CAST(const char*, key); 183 return nsCRT::strcmp(keyStr, he->get()) == 0;184 return RTStrCmp(keyStr, he->get()) == 0; 184 185 } 185 186 -
trunk/src/libs/xpcom18a4/xpcom/ds/nsCRT.h
r102326 r102457 146 146 } 147 147 148 /// Compare s1 and s2.149 static PRInt32 strcmp(const char* s1, const char* s2) {150 return PRInt32(PL_strcmp(s1, s2));151 }152 153 static PRInt32 strncmp(const char* s1, const char* s2,154 PRUint32 aMaxLen) {155 return PRInt32(PL_strncmp(s1, s2, aMaxLen));156 }157 158 148 /// Case-insensitive string comparison. 159 149 static PRInt32 strcasecmp(const char* s1, const char* s2) { … … 169 159 result=-1; 170 160 return result; 171 }172 173 static PRInt32 strncmp(const char* s1, const char* s2, PRInt32 aMaxLen) {174 // inline the first test (assumes strings are not null):175 PRInt32 diff = ((const unsigned char*)s1)[0] - ((const unsigned char*)s2)[0];176 if (diff != 0) return diff;177 return PRInt32(PL_strncmp(s1,s2,unsigned(aMaxLen)));178 161 } 179 162 -
trunk/src/libs/xpcom18a4/xpcom/io/nsAppFileLocationProvider.cpp
r102315 r102457 37 37 * 38 38 * ***** END LICENSE BLOCK ***** */ 39 #include <iprt/string.h> 39 40 40 41 #include "nsAppFileLocationProvider.h" … … 133 134 *persistant = PR_TRUE; 134 135 135 if ( nsCRT::strcmp(prop, NS_APP_APPLICATION_REGISTRY_DIR) == 0)136 if (RTStrCmp(prop, NS_APP_APPLICATION_REGISTRY_DIR) == 0) 136 137 { 137 138 rv = GetProductDirectory(getter_AddRefs(localFile)); 138 139 } 139 else if ( nsCRT::strcmp(prop, NS_APP_APPLICATION_REGISTRY_FILE) == 0)140 else if (RTStrCmp(prop, NS_APP_APPLICATION_REGISTRY_FILE) == 0) 140 141 { 141 142 rv = GetProductDirectory(getter_AddRefs(localFile)); … … 143 144 rv = localFile->AppendNative(APP_REGISTRY_NAME); 144 145 } 145 else if ( nsCRT::strcmp(prop, NS_APP_DEFAULTS_50_DIR) == 0)146 else if (RTStrCmp(prop, NS_APP_DEFAULTS_50_DIR) == 0) 146 147 { 147 148 rv = CloneMozBinDirectory(getter_AddRefs(localFile)); … … 149 150 rv = localFile->AppendRelativeNativePath(DEFAULTS_DIR_NAME); 150 151 } 151 else if ( nsCRT::strcmp(prop, NS_APP_PREF_DEFAULTS_50_DIR) == 0)152 else if (RTStrCmp(prop, NS_APP_PREF_DEFAULTS_50_DIR) == 0) 152 153 { 153 154 rv = CloneMozBinDirectory(getter_AddRefs(localFile)); … … 158 159 } 159 160 } 160 else if ( nsCRT::strcmp(prop, NS_APP_PROFILE_DEFAULTS_50_DIR) == 0 ||161 nsCRT::strcmp(prop, NS_APP_PROFILE_DEFAULTS_NLOC_50_DIR) == 0)161 else if (RTStrCmp(prop, NS_APP_PROFILE_DEFAULTS_50_DIR) == 0 || 162 RTStrCmp(prop, NS_APP_PROFILE_DEFAULTS_NLOC_50_DIR) == 0) 162 163 { 163 164 rv = CloneMozBinDirectory(getter_AddRefs(localFile)); … … 168 169 } 169 170 } 170 else if ( nsCRT::strcmp(prop, NS_APP_USER_PROFILES_ROOT_DIR) == 0)171 else if (RTStrCmp(prop, NS_APP_USER_PROFILES_ROOT_DIR) == 0) 171 172 { 172 173 rv = GetDefaultUserProfileRoot(getter_AddRefs(localFile)); 173 174 } 174 else if ( nsCRT::strcmp(prop, NS_APP_RES_DIR) == 0)175 else if (RTStrCmp(prop, NS_APP_RES_DIR) == 0) 175 176 { 176 177 rv = CloneMozBinDirectory(getter_AddRefs(localFile)); … … 178 179 rv = localFile->AppendRelativeNativePath(RES_DIR_NAME); 179 180 } 180 else if ( nsCRT::strcmp(prop, NS_APP_CHROME_DIR) == 0)181 else if (RTStrCmp(prop, NS_APP_CHROME_DIR) == 0) 181 182 { 182 183 rv = CloneMozBinDirectory(getter_AddRefs(localFile)); … … 184 185 rv = localFile->AppendRelativeNativePath(CHROME_DIR_NAME); 185 186 } 186 else if ( nsCRT::strcmp(prop, NS_APP_PLUGINS_DIR) == 0)187 else if (RTStrCmp(prop, NS_APP_PLUGINS_DIR) == 0) 187 188 { 188 189 rv = CloneMozBinDirectory(getter_AddRefs(localFile)); … … 190 191 rv = localFile->AppendRelativeNativePath(PLUGINS_DIR_NAME); 191 192 } 192 else if ( nsCRT::strcmp(prop, NS_ENV_PLUGINS_DIR) == 0)193 else if (RTStrCmp(prop, NS_ENV_PLUGINS_DIR) == 0) 193 194 { 194 195 NS_ERROR("Don't use nsAppFileLocationProvider::GetFile(NS_ENV_PLUGINS_DIR, ...). " … … 198 199 rv = NS_NewNativeLocalFile(nsDependentCString(pathVar), PR_TRUE, getter_AddRefs(localFile)); 199 200 } 200 else if ( nsCRT::strcmp(prop, NS_USER_PLUGINS_DIR) == 0)201 else if (RTStrCmp(prop, NS_USER_PLUGINS_DIR) == 0) 201 202 { 202 203 rv = GetProductDirectory(getter_AddRefs(localFile)); … … 204 205 rv = localFile->AppendRelativeNativePath(PLUGINS_DIR_NAME); 205 206 } 206 else if ( nsCRT::strcmp(prop, NS_APP_SEARCH_DIR) == 0)207 else if (RTStrCmp(prop, NS_APP_SEARCH_DIR) == 0) 207 208 { 208 209 rv = CloneMozBinDirectory(getter_AddRefs(localFile)); … … 210 211 rv = localFile->AppendRelativeNativePath(SEARCH_DIR_NAME); 211 212 } 212 else if ( nsCRT::strcmp(prop, NS_APP_INSTALL_CLEANUP_DIR) == 0)213 else if (RTStrCmp(prop, NS_APP_INSTALL_CLEANUP_DIR) == 0) 213 214 { 214 215 // This is cloned so that embeddors will have a hook to override … … 466 467 nsresult rv = NS_ERROR_FAILURE; 467 468 468 if (! nsCRT::strcmp(prop, NS_APP_PLUGINS_DIR_LIST))469 if (!RTStrCmp(prop, NS_APP_PLUGINS_DIR_LIST)) 469 470 { 470 471 static const char* keys[] = { nsnull, NS_APP_PLUGINS_DIR, nsnull }; -
trunk/src/libs/xpcom18a4/xpcom/reflect/xptinfo/src/xptiInterfaceInfo.cpp
r102323 r102457 351 351 &mInterface->mDescriptor-> 352 352 method_descriptors[i]); 353 if ( PL_strcmp(methodName, info->GetName()) == 0) {353 if (RTStrCmp(methodName, info->GetName()) == 0) { 354 354 *index = i + mInterface->mMethodBaseIndex; 355 355 *result = info; -
trunk/src/libs/xpcom18a4/xpcom/reflect/xptinfo/src/xptiInterfaceInfoManager.cpp
r102324 r102457 588 588 for(PRUint32 i = 0; i < aWorkingSet->GetFileCount(); ++i) 589 589 { 590 if(0 == PL_strcmp(aName, aWorkingSet->GetFileAt(i).GetName()))590 if(0 == RTStrCmp(aName, aWorkingSet->GetFileAt(i).GetName())) 591 591 return i; 592 592 } … … 1358 1358 aSrcWorkingSet->GetTypelibFileName(srcEntry->GetTypelibRecord()); 1359 1359 1360 if(0 == PL_strcmp(destFilename, srcFilename) &&1360 if(0 == RTStrCmp(destFilename, srcFilename) && 1361 1361 (destEntry->GetTypelibRecord().GetZipItemIndex() == 1362 1362 srcEntry->GetTypelibRecord().GetZipItemIndex())) … … 1365 1365 // But... Let's make sure they didn't change the interface name. 1366 1366 // There are wacky developers that do stuff like that! 1367 if(0 == PL_strcmp(destEntry->GetTheName(), srcEntry->GetTheName()))1367 if(0 == RTStrCmp(destEntry->GetTheName(), srcEntry->GetTheName())) 1368 1368 return PL_DHASH_NEXT; 1369 1369 } -
trunk/src/libs/xpcom18a4/xpcom/reflect/xptinfo/src/xptiManifest.cpp
r102197 r102457 390 390 391 391 // ignore the leading '[' 392 if(0 != PL_strcmp(values[0]+1, token))392 if(0 != RTStrCmp(values[0]+1, token)) 393 393 break; 394 394 … … 462 462 463 463 // VersionLiteral 464 if(0 != PL_strcmp(values[1], g_TOKEN_Version))464 if(0 != RTStrCmp(values[1], g_TOKEN_Version)) 465 465 goto out; 466 466 … … 487 487 488 488 // AppDirLiteral 489 if(0 != PL_strcmp(values[1], g_TOKEN_AppDir))489 if(0 != RTStrCmp(values[1], g_TOKEN_AppDir)) 490 490 goto out; 491 491 -
trunk/src/libs/xpcom18a4/xpcom/reflect/xptinfo/src/xptiWorkingSet.cpp
r1 r102457 99 99 const char* str1 = ((xptiHashEntry*)entry)->value->GetTheName(); 100 100 const char* str2 = (const char*) key; 101 return str1 == str2 || 0 == PL_strcmp(str1, str2);101 return str1 == str2 || 0 == RTStrCmp(str1, str2); 102 102 } 103 103 … … 256 256 xptiFile& file = mFileArray[i]; 257 257 if(file.GetDirectory() == dir && 258 0 == PL_strcmp(name, file.GetName()))258 0 == RTStrCmp(name, file.GetName())) 259 259 { 260 260 return i; … … 310 310 { 311 311 for(PRUint32 i = 0; i < mZipItemCount;++i) 312 if(0 == PL_strcmp(name, mZipItemArray[i].GetName()))312 if(0 == RTStrCmp(name, mZipItemArray[i].GetName())) 313 313 return i; 314 314 } -
trunk/src/libs/xpcom18a4/xpcom/reflect/xptinfo/src/xptiprivate.h
r102348 r102457 44 44 45 45 #include <iprt/stream.h> 46 #include <iprt/string.h> 46 47 47 48 #include "nscore.h" … … 207 208 mSize == r.mSize && 208 209 mDate == r.mDate && 209 0 == PL_strcmp(mName, r.mName);210 0 == RTStrCmp(mName, r.mName); 210 211 } 211 212 … … 268 269 PRBool Equals(const xptiZipItem& r) const 269 270 { 270 return 0 == PL_strcmp(mName, r.mName);271 return 0 == RTStrCmp(mName, r.mName); 271 272 } 272 273 -
trunk/src/libs/xpcom18a4/xpcom/tests/TestCRT.cpp
r1 r102457 35 35 * 36 36 * ***** END LICENSE BLOCK ***** */ 37 #include <iprt/string.h> 37 38 38 39 #include "nsCRT.h" … … 60 61 static void Check(const char* s1, const char* s2, PRIntn n) 61 62 { 62 PRIntn clib = PL_strcmp(s1, s2);63 PRIntn clib_n = PL_strncmp(s1, s2, n);63 PRIntn clib = RTStrCmp(s1, s2); 64 PRIntn clib_n = RTStrNCmp(s1, s2, n); 64 65 PRIntn clib_case = PL_strcasecmp(s1, s2); 65 66 PRIntn clib_case_n = PL_strncasecmp(s1, s2, n); -
trunk/src/libs/xpcom18a4/xpcom/tests/TestID.cpp
r86425 r102457 35 35 * 36 36 * ***** END LICENSE BLOCK ***** */ 37 #include <iprt/string.h> 38 37 39 #include <stdio.h> 38 #include "plstr.h"39 40 #include "nsID.h" 40 41 #include "prmem.h" … … 67 68 return -1; 68 69 } 69 if (0 != PL_strcmp(cp, ids[4*(i/4) + 3])) {70 if (0 != RTStrCmp(cp, ids[4*(i/4) + 3])) { 70 71 fprintf(stderr, "TestID: compare of ToString failed on test #%d\n", i); 71 72 return -1;
Note:
See TracChangeset
for help on using the changeset viewer.