Changeset 102345 in vbox
- Timestamp:
- Nov 27, 2023 6:48:07 PM (12 months ago)
- Location:
- trunk/src/libs/xpcom18a4
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/libs/xpcom18a4/ipc/ipcd/daemon/src/ipcdUnix.cpp
r102343 r102345 59 59 #include <errno.h> 60 60 61 #include "prprf.h"62 63 61 #include "ipcConfig.h" 64 62 #include "ipcMessage.h" … … 205 203 // 206 204 char buf[32]; 207 int nb = PR_snprintf(buf, sizeof(buf), "%u\n", (unsigned long) getpid()); 208 write(ipcLockFD, buf, nb); 205 ssize_t nb = RTStrPrintf2(buf, sizeof(buf), "%u\n", (unsigned long) getpid()); 206 if (nb <= 0) 207 return ELockFileOpen; 208 write(ipcLockFD, buf, (size_t)nb); 209 209 210 210 return EOk; -
trunk/src/libs/xpcom18a4/ipc/ipcd/shared/src/ipcConfig.h
r3372 r102345 39 39 #define ipcProto_h__ 40 40 41 #if defined(XP_WIN)42 //43 // use WM_COPYDATA messages44 //45 #include "prprf.h"46 47 #define IPC_WINDOW_CLASS "Mozilla:IPCWindowClass"48 #define IPC_WINDOW_NAME "Mozilla:IPCWindow"49 #define IPC_CLIENT_WINDOW_CLASS "Mozilla:IPCAppWindowClass"50 #define IPC_CLIENT_WINDOW_NAME_PREFIX "Mozilla:IPCAppWindow:"51 #define IPC_SYNC_EVENT_NAME "Local\\MozillaIPCSyncEvent"52 #ifndef IPC_DAEMON_APP_NAME53 #define IPC_DAEMON_APP_NAME "mozilla-ipcd.exe"54 #endif55 #define IPC_PATH_SEP_CHAR '\\'56 #define IPC_MODULES_DIR "ipc\\modules"57 58 #define IPC_CLIENT_WINDOW_NAME_MAXLEN (sizeof(IPC_CLIENT_WINDOW_NAME_PREFIX) + 20)59 60 // writes client name into buf. buf must be at least61 // IPC_CLIENT_WINDOW_NAME_MAXLEN bytes in length.62 inline void IPC_GetClientWindowName(PRUint32 pid, char *buf)63 {64 PR_snprintf(buf, IPC_CLIENT_WINDOW_NAME_MAXLEN, "%s%u",65 IPC_CLIENT_WINDOW_NAME_PREFIX, pid);66 }67 68 #else69 41 #include "nscore.h" 70 42 // … … 89 61 NS_HIDDEN_(void) IPC_GetDefaultSocketPath(char *buf, PRUint32 bufLen); 90 62 91 #endif92 93 63 // common shared configuration values 94 64 -
trunk/src/libs/xpcom18a4/java/src/nsJavaWrapper.cpp
r102014 r102345 49 49 #include "nsProxyRelease.h" 50 50 51 #include <iprt/string.h> 52 51 53 static nsID nullID = {0, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0}}; 52 54 … … 1503 1505 nsXPIDLCString emsg; 1504 1506 ex->GetMessage(getter_Copies(emsg)); 1505 PR_snprintf(msg, msgSize, "%s",1506 emsg.get());1507 RTStrPrintf2(msg, msgSize, "%s", 1508 emsg.get()); 1507 1509 gotMsg = true; 1508 1510 } … … 1516 1518 if (strncmp(pMsg->pszMsgFull, "Unknown", 7) != 0) 1517 1519 { 1518 PR_snprintf(msg, msgSize, "%s (%s)",1519 pMsg->pszMsgFull, pMsg->pszDefine);1520 RTStrPrintf2(msg, msgSize, "%s (%s)", 1521 pMsg->pszMsgFull, pMsg->pszDefine); 1520 1522 gotMsg = true; 1521 1523 } … … 1524 1526 if (!gotMsg) 1525 1527 { 1526 PR_snprintf(msg, msgSize, "Error 0x%x in module 0x%x",1527 NS_ERROR_GET_CODE(r), NS_ERROR_GET_MODULE(r));1528 RTStrPrintf2(msg, msgSize, "Error 0x%x in module 0x%x", 1529 NS_ERROR_GET_CODE(r), NS_ERROR_GET_MODULE(r)); 1528 1530 } 1529 1531 } -
trunk/src/libs/xpcom18a4/xpcom/base/nsID.cpp
r28914 r102345 37 37 * ***** END LICENSE BLOCK ***** */ 38 38 #include "nsID.h" 39 #include "prprf.h"40 39 #include "prmem.h" 40 41 #include <iprt/string.h> 41 42 42 43 static const char gIDFormat[] = … … 130 131 131 132 if (res != NULL) { 132 PR_snprintf(res, 39, gIDFormat,133 m0, (PRUint32) m1, (PRUint32) m2,134 (PRUint32) m3[0], (PRUint32) m3[1], (PRUint32) m3[2],135 (PRUint32) m3[3], (PRUint32) m3[4], (PRUint32) m3[5],136 (PRUint32) m3[6], (PRUint32) m3[7]);133 RTStrPrintf2(res, 39, gIDFormat, 134 m0, (PRUint32) m1, (PRUint32) m2, 135 (PRUint32) m3[0], (PRUint32) m3[1], (PRUint32) m3[2], 136 (PRUint32) m3[3], (PRUint32) m3[4], (PRUint32) m3[5], 137 (PRUint32) m3[6], (PRUint32) m3[7]); 137 138 } 138 139 return res; … … 142 143 void nsID::ToProvidedString(char (&dest)[NSID_LENGTH]) const 143 144 { 144 PR_snprintf(dest, NSID_LENGTH, gIDFormat,145 m0, (PRUint32) m1, (PRUint32) m2,146 (PRUint32) m3[0], (PRUint32) m3[1], (PRUint32) m3[2],147 (PRUint32) m3[3], (PRUint32) m3[4], (PRUint32) m3[5],148 (PRUint32) m3[6], (PRUint32) m3[7]);145 RTStrPrintf2(dest, NSID_LENGTH, gIDFormat, 146 m0, (PRUint32) m1, (PRUint32) m2, 147 (PRUint32) m3[0], (PRUint32) m3[1], (PRUint32) m3[2], 148 (PRUint32) m3[3], (PRUint32) m3[4], (PRUint32) m3[5], 149 (PRUint32) m3[6], (PRUint32) m3[7]); 149 150 } 150 151 #endif -
trunk/src/libs/xpcom18a4/xpcom/components/nsComponentManager.cpp
r102197 r102345 148 148 static void GetIDString(const nsID& aCID, char buf[UID_STRING_LENGTH]) 149 149 { 150 PR_snprintf(buf, UID_STRING_LENGTH, gIDFormat,151 aCID.m0, (PRUint32) aCID.m1, (PRUint32) aCID.m2,152 (PRUint32) aCID.m3[0], (PRUint32) aCID.m3[1],153 (PRUint32) aCID.m3[2], (PRUint32) aCID.m3[3],154 (PRUint32) aCID.m3[4], (PRUint32) aCID.m3[5],155 (PRUint32) aCID.m3[6], (PRUint32) aCID.m3[7]);150 RTStrPrintf2(buf, UID_STRING_LENGTH, gIDFormat, 151 aCID.m0, (PRUint32) aCID.m1, (PRUint32) aCID.m2, 152 (PRUint32) aCID.m3[0], (PRUint32) aCID.m3[1], 153 (PRUint32) aCID.m3[2], (PRUint32) aCID.m3[3], 154 (PRUint32) aCID.m3[4], (PRUint32) aCID.m3[5], 155 (PRUint32) aCID.m3[6], (PRUint32) aCID.m3[7]); 156 156 } 157 157 -
trunk/src/libs/xpcom18a4/xpcom/ds/nsSupportsPrimitives.cpp
r1 r102345 36 36 * 37 37 * ***** END LICENSE BLOCK ***** */ 38 #include <iprt/string.h> 38 39 39 40 #include "nsSupportsPrimitives.h" 40 41 #include "nsCRT.h" 41 42 #include "nsMemory.h" 42 #include "prprf.h"43 43 #include "nsIInterfaceInfoManager.h" 44 44 #include "nsDependentString.h" … … 256 256 char buf[size]; 257 257 258 PR_snprintf(buf, size, "%u", (PRUint16) mData);258 RTStrPrintf2(buf, size, "%u", (PRUint16) mData); 259 259 260 260 char* result = (char*) nsMemory::Clone(buf, … … 301 301 char buf[size]; 302 302 303 PR_snprintf(buf, size, "%u", (int) mData);303 RTStrPrintf2(buf, size, "%u", (int) mData); 304 304 305 305 char* result = (char*) nsMemory::Clone(buf, … … 346 346 char buf[size]; 347 347 348 PR_snprintf(buf, size, "%lu", mData);348 RTStrPrintf2(buf, size, "%lu", mData); 349 349 350 350 char* result = (char*) nsMemory::Clone(buf, … … 391 391 char buf[size]; 392 392 393 PR_snprintf(buf, size, "%llu", mData);393 RTStrPrintf2(buf, size, "%llu", mData); 394 394 395 395 char* result = (char*) nsMemory::Clone(buf, … … 436 436 char buf[size]; 437 437 438 PR_snprintf(buf, size, "%llu", mData);438 RTStrPrintf2(buf, size, "%llu", mData); 439 439 440 440 char* result = (char*) nsMemory::Clone(buf, … … 526 526 char buf[size]; 527 527 528 PR_snprintf(buf, size, "%d", mData);528 RTStrPrintf2(buf, size, "%d", mData); 529 529 530 530 char* result = (char*) nsMemory::Clone(buf, … … 571 571 char buf[size]; 572 572 573 PR_snprintf(buf, size, "%ld", mData);573 RTStrPrintf2(buf, size, "%ld", mData); 574 574 575 575 char* result = (char*) nsMemory::Clone(buf, … … 616 616 char buf[size]; 617 617 618 PR_snprintf(buf, size, "%lld", mData);618 RTStrPrintf2(buf, size, "%lld", mData); 619 619 620 620 char* result = (char*) nsMemory::Clone(buf, … … 661 661 char buf[size]; 662 662 663 PR_snprintf(buf, size, "%f", (double) mData);663 RTStrPrintf2(buf, size, "%f", (double) mData); 664 664 665 665 char* result = (char*) nsMemory::Clone(buf, … … 706 706 char buf[size]; 707 707 708 PR_snprintf(buf, size, "%f", mData);708 RTStrPrintf2(buf, size, "%f", mData); 709 709 710 710 char* result = (char*) nsMemory::Clone(buf, -
trunk/src/libs/xpcom18a4/xpcom/ds/nsVariant.cpp
r102005 r102345 42 42 #include "nsVariant.h" 43 43 #include "nsString.h" 44 #include "prprf.h"45 44 #include <math.h> 46 45 #include "nsCRT.h" … … 816 815 return NS_OK; 817 816 818 // the rest can be PR_smprintf'dand use common code.817 // the rest can use RTStrAPrintf() and use common code. 819 818 820 819 #define CASE__SMPRINTF_NUMBER(type_, format_, cast_, member_) \ 821 820 case nsIDataType :: type_ : \ 822 ptr = PR_smprintf(format_ , (cast_) data.u. member_ ); \821 RTStrAPrintf(&ptr, format_ , (cast_) data.u. member_ ); \ 823 822 break; 824 823 … … 847 846 return NS_ERROR_OUT_OF_MEMORY; 848 847 outString.Assign(ptr); 849 PR_smprintf_free(ptr);848 RTStrFree(ptr); 850 849 return NS_OK; 851 850 } -
trunk/src/libs/xpcom18a4/xpcom/string/src/nsPrintfCString.cpp
r1 r102345 39 39 #include "nsPrintfCString.h" 40 40 #include <stdarg.h> 41 #include "prprf.h"42 41 42 #include <iprt/string.h> 43 43 44 44 // though these classes define a fixed buffer, they do not set the F_FIXED … … 58 58 59 59 va_start(ap, format); 60 mLength = PR_vsnprintf(mData, physical_capacity, format, ap); 60 ssize_t cch = RTStrPrintf2V(mData, physical_capacity, format, ap); 61 Assert(cch > 0); 62 mLength = (size_type)cch; 61 63 va_end(ap); 62 64 } … … 79 81 80 82 va_start(ap, format); 81 mLength = PR_vsnprintf(mData, physical_capacity, format, ap); 83 ssize_t cch = RTStrPrintf2V(mData, physical_capacity, format, ap); 84 Assert(cch > 0); 85 mLength = (size_type)cch; 82 86 va_end(ap); 83 87 } -
trunk/src/libs/xpcom18a4/xpcom/string/src/nsStringObsolete.cpp
r102006 r102345 51 51 #include "nsCRT.h" 52 52 #include "nsUTF8Utils.h" 53 #include "prprf.h"54 53 55 54 #include <iprt/assert.h> … … 1132 1131 fmt = "%x"; 1133 1132 } 1134 PR_snprintf(buf, sizeof(buf), fmt, aInteger);1133 RTStrPrintf2(buf, sizeof(buf), fmt, aInteger); 1135 1134 Append(buf); 1136 1135 } … … 1152 1151 fmt = "%x"; 1153 1152 } 1154 PR_snprintf(buf, sizeof(buf), fmt, aInteger);1153 RTStrPrintf2(buf, sizeof(buf), fmt, aInteger); 1155 1154 AppendASCIItoUTF16(buf, *this); 1156 1155 } … … 1172 1171 fmt = "%llx"; 1173 1172 } 1174 PR_snprintf(buf, sizeof(buf), fmt, aInteger);1173 RTStrPrintf2(buf, sizeof(buf), fmt, aInteger); 1175 1174 Append(buf); 1176 1175 } … … 1192 1191 fmt = "%llx"; 1193 1192 } 1194 PR_snprintf(buf, sizeof(buf), fmt, aInteger);1193 RTStrPrintf2(buf, sizeof(buf), fmt, aInteger); 1195 1194 AppendASCIItoUTF16(buf, *this); 1196 1195 } -
trunk/src/libs/xpcom18a4/xpcom/tests/TestAtoms.cpp
r41166 r102345 38 38 #include "nsString.h" 39 39 #include "nsReadableUtils.h" 40 #include "prprf.h"41 40 #include "prtime.h" 42 41 #include <stdio.h> 42 43 #include <iprt/string.h> 43 44 44 45 extern "C" int _CrtSetDbgFlag(int); … … 114 115 LL_SUB(dtor, end3, end2); 115 116 char buf[500]; 116 PR_snprintf(buf, sizeof(buf), "making %d ident strings took %lldms",117 count, creates);117 RTStrPrintf2(buf, sizeof(buf), "making %d ident strings took %lldms", 118 count, creates); 118 119 puts(buf); 119 PR_snprintf(buf, sizeof(buf), "%d new idents took %lldms",120 count, finds);120 RTStrPrintf2(buf, sizeof(buf), "%d new idents took %lldms", 121 count, finds); 121 122 puts(buf); 122 PR_snprintf(buf, sizeof(buf), "%d ident lookups took %lldms",123 count, lookups);123 RTStrPrintf2(buf, sizeof(buf), "%d ident lookups took %lldms", 124 count, lookups); 124 125 puts(buf); 125 PR_snprintf(buf, sizeof(buf), "dtor took %lldusec", dtor);126 RTStrPrintf2(buf, sizeof(buf), "dtor took %lldusec", dtor); 126 127 puts(buf); 127 128 -
trunk/src/libs/xpcom18a4/xpcom/threads/nsEventQueue.cpp
r102016 r102345 46 46 47 47 #ifdef NS_DEBUG 48 #include "prprf.h"48 #include <iprt/string.h> 49 49 #endif 50 50 … … 465 465 if (depth > 5) { 466 466 char warning[80]; 467 PR_snprintf(warning, sizeof(warning),468 "event queue chain length is %d. this is almost certainly a leak.", depth);467 RTStrPrintf2(warning, sizeof(warning), 468 "event queue chain length is %d. this is almost certainly a leak.", depth); 469 469 NS_WARNING(warning); 470 470 }
Note:
See TracChangeset
for help on using the changeset viewer.