diff --git a/src/coreclr/debug/daccess/enummem.cpp b/src/coreclr/debug/daccess/enummem.cpp index b8b505744ad995..d771b06dcf5b57 100644 --- a/src/coreclr/debug/daccess/enummem.cpp +++ b/src/coreclr/debug/daccess/enummem.cpp @@ -2050,7 +2050,7 @@ ClrDataAccess::EnumMemoryRegions(IN ICLRDataEnumMemoryRegionsCallback* callback, fprintf(fp, "Total = %g msec\n" "ReadVirtual = %g msec\n" "StackWalk = %g msec; Find: %g msec\n" - "Find = %g msec; Hash = %g msec; Calls = %I64u; Hits = %I64u; Not found = %I64u\n\n=====\n", + "Find = %g msec; Hash = %g msec; Calls = %llu; Hits = %llu; Not found = %llu\n\n=====\n", (float) (1000*g_nTotalTime/nClockFrequency.QuadPart), (float) (1000*g_nReadVirtualTotalTime/nClockFrequency.QuadPart), (float) (1000*g_nStackTotalTime/nClockFrequency.QuadPart), (float) (1000*g_nFindStackTotalTime/nClockFrequency.QuadPart), diff --git a/src/coreclr/debug/di/process.cpp b/src/coreclr/debug/di/process.cpp index 51f3e6317bd925..206a5df26c1edc 100644 --- a/src/coreclr/debug/di/process.cpp +++ b/src/coreclr/debug/di/process.cpp @@ -12296,7 +12296,7 @@ Reaction CordbProcess::Triage1stChanceNonSpecial(CordbUnmanagedThread * pUnmanag (addrType == IDacDbiInterface::kAddressRuntimeManagedCode) || (addrType == IDacDbiInterface::kAddressRuntimeUnmanagedCode)); - STRESS_LOG2(LF_CORDB, LL_INFO1000, "W32ET::W32EL: IsCorCode(0x%I64p)=%d\n", address, fIsCorCode); + STRESS_LOG2(LF_CORDB, LL_INFO1000, "W32ET::W32EL: IsCorCode(0x%p)=%d\n", address, fIsCorCode); if (fIsCorCode) diff --git a/src/coreclr/gc/handletable.cpp b/src/coreclr/gc/handletable.cpp index 0af5d3ed9f4641..5979f9646499ce 100644 --- a/src/coreclr/gc/handletable.cpp +++ b/src/coreclr/gc/handletable.cpp @@ -1120,14 +1120,14 @@ void DEBUG_LogScanningStatistics(HandleTable *pTable, uint32_t level) // dump the generation number and the number of blocks scanned LOG((LF_GC, level, "--------------------------------------------------------------\n")); LOG((LF_GC, level, " Condemned Generation = %d\n", i)); - LOG((LF_GC, level, " Blocks Scanned = %I64u\n", totalBlocksScanned)); + LOG((LF_GC, level, " Blocks Scanned = %llu\n", totalBlocksScanned)); // if we scanned any blocks in this generation then dump some interesting numbers if (totalBlocksScanned) { - LOG((LF_GC, level, " Blocks Examined = %I64u\n", pTable->_DEBUG_TotalBlocksScannedNonTrivially[i])); - LOG((LF_GC, level, " Slots Scanned = %I64u\n", pTable->_DEBUG_TotalHandleSlotsScanned [i])); - LOG((LF_GC, level, " Handles Scanned = %I64u\n", pTable->_DEBUG_TotalHandlesActuallyScanned [i])); + LOG((LF_GC, level, " Blocks Examined = %llu\n", pTable->_DEBUG_TotalBlocksScannedNonTrivially[i])); + LOG((LF_GC, level, " Slots Scanned = %llu\n", pTable->_DEBUG_TotalHandleSlotsScanned [i])); + LOG((LF_GC, level, " Handles Scanned = %llu\n", pTable->_DEBUG_TotalHandlesActuallyScanned [i])); double blocksScanned = (double) totalBlocksScanned; double blocksExamined = (double) pTable->_DEBUG_TotalBlocksScannedNonTrivially[i]; diff --git a/src/coreclr/gcinfo/gcinfoencoder.cpp b/src/coreclr/gcinfo/gcinfoencoder.cpp index d4596334bd3dc4..58ce1b5bcf7f17 100644 --- a/src/coreclr/gcinfo/gcinfoencoder.cpp +++ b/src/coreclr/gcinfo/gcinfoencoder.cpp @@ -384,45 +384,45 @@ void GcInfoSize::Log(DWORD level, const char * header) LogSpew(LF_GCINFO, level, header); LogSpew(LF_GCINFO, level, "---COUNTS---\n"); - LogSpew(LF_GCINFO, level, "NumMethods: %Iu\n", NumMethods); - LogSpew(LF_GCINFO, level, "NumCallSites: %Iu\n", NumCallSites); - LogSpew(LF_GCINFO, level, "NumRanges: %Iu\n", NumRanges); - LogSpew(LF_GCINFO, level, "NumRegs: %Iu\n", NumRegs); - LogSpew(LF_GCINFO, level, "NumStack: %Iu\n", NumStack); - LogSpew(LF_GCINFO, level, "NumUntracked: %Iu\n", NumUntracked); - LogSpew(LF_GCINFO, level, "NumTransitions: %Iu\n", NumTransitions); - LogSpew(LF_GCINFO, level, "SizeOfCode: %Iu\n", SizeOfCode); - LogSpew(LF_GCINFO, level, "EncInfoSize: %Iu\n", EncInfoSize); + LogSpew(LF_GCINFO, level, "NumMethods: %zu\n", NumMethods); + LogSpew(LF_GCINFO, level, "NumCallSites: %zu\n", NumCallSites); + LogSpew(LF_GCINFO, level, "NumRanges: %zu\n", NumRanges); + LogSpew(LF_GCINFO, level, "NumRegs: %zu\n", NumRegs); + LogSpew(LF_GCINFO, level, "NumStack: %zu\n", NumStack); + LogSpew(LF_GCINFO, level, "NumUntracked: %zu\n", NumUntracked); + LogSpew(LF_GCINFO, level, "NumTransitions: %zu\n", NumTransitions); + LogSpew(LF_GCINFO, level, "SizeOfCode: %zu\n", SizeOfCode); + LogSpew(LF_GCINFO, level, "EncInfoSize: %zu\n", EncInfoSize); LogSpew(LF_GCINFO, level, "---SIZES(bits)---\n"); - LogSpew(LF_GCINFO, level, "Total: %Iu\n", TotalSize); - LogSpew(LF_GCINFO, level, "UntrackedSlot: %Iu\n", UntrackedSlotSize); - LogSpew(LF_GCINFO, level, "NumUntracked: %Iu\n", NumUntrackedSize); - LogSpew(LF_GCINFO, level, "Flags: %Iu\n", FlagsSize); - LogSpew(LF_GCINFO, level, "CodeLength: %Iu\n", CodeLengthSize); - LogSpew(LF_GCINFO, level, "Prolog/Epilog: %Iu\n", ProEpilogSize); - LogSpew(LF_GCINFO, level, "SecObj: %Iu\n", SecObjSize); - LogSpew(LF_GCINFO, level, "GsCookie: %Iu\n", GsCookieSize); - LogSpew(LF_GCINFO, level, "PspSym: %Iu\n", PspSymSize); - LogSpew(LF_GCINFO, level, "GenericsCtx: %Iu\n", GenericsCtxSize); - LogSpew(LF_GCINFO, level, "StackBase: %Iu\n", StackBaseSize); - LogSpew(LF_GCINFO, level, "FixedArea: %Iu\n", FixedAreaSize); - LogSpew(LF_GCINFO, level, "ReversePInvokeFrame: %Iu\n", ReversePInvokeFrameSize); - LogSpew(LF_GCINFO, level, "NumCallSites: %Iu\n", NumCallSitesSize); - LogSpew(LF_GCINFO, level, "NumRanges: %Iu\n", NumRangesSize); - LogSpew(LF_GCINFO, level, "CallSiteOffsets: %Iu\n", CallSitePosSize); - LogSpew(LF_GCINFO, level, "Ranges: %Iu\n", RangeSize); - LogSpew(LF_GCINFO, level, "NumRegs: %Iu\n", NumRegsSize); - LogSpew(LF_GCINFO, level, "NumStack: %Iu\n", NumStackSize); - LogSpew(LF_GCINFO, level, "RegSlots: %Iu\n", RegSlotSize); - LogSpew(LF_GCINFO, level, "StackSlots: %Iu\n", StackSlotSize); - LogSpew(LF_GCINFO, level, "CallSiteStates: %Iu\n", CallSiteStateSize); - LogSpew(LF_GCINFO, level, "EhOffsets: %Iu\n", EhPosSize); - LogSpew(LF_GCINFO, level, "EhStates: %Iu\n", EhStateSize); - LogSpew(LF_GCINFO, level, "ChunkPointers: %Iu\n", ChunkPtrSize); - LogSpew(LF_GCINFO, level, "ChunkMasks: %Iu\n", ChunkMaskSize); - LogSpew(LF_GCINFO, level, "ChunkFinalStates: %Iu\n", ChunkFinalStateSize); - LogSpew(LF_GCINFO, level, "Transitions: %Iu\n", ChunkTransitionSize); + LogSpew(LF_GCINFO, level, "Total: %zu\n", TotalSize); + LogSpew(LF_GCINFO, level, "UntrackedSlot: %zu\n", UntrackedSlotSize); + LogSpew(LF_GCINFO, level, "NumUntracked: %zu\n", NumUntrackedSize); + LogSpew(LF_GCINFO, level, "Flags: %zu\n", FlagsSize); + LogSpew(LF_GCINFO, level, "CodeLength: %zu\n", CodeLengthSize); + LogSpew(LF_GCINFO, level, "Prolog/Epilog: %zu\n", ProEpilogSize); + LogSpew(LF_GCINFO, level, "SecObj: %zu\n", SecObjSize); + LogSpew(LF_GCINFO, level, "GsCookie: %zu\n", GsCookieSize); + LogSpew(LF_GCINFO, level, "PspSym: %zu\n", PspSymSize); + LogSpew(LF_GCINFO, level, "GenericsCtx: %zu\n", GenericsCtxSize); + LogSpew(LF_GCINFO, level, "StackBase: %zu\n", StackBaseSize); + LogSpew(LF_GCINFO, level, "FixedArea: %zu\n", FixedAreaSize); + LogSpew(LF_GCINFO, level, "ReversePInvokeFrame: %zu\n", ReversePInvokeFrameSize); + LogSpew(LF_GCINFO, level, "NumCallSites: %zu\n", NumCallSitesSize); + LogSpew(LF_GCINFO, level, "NumRanges: %zu\n", NumRangesSize); + LogSpew(LF_GCINFO, level, "CallSiteOffsets: %zu\n", CallSitePosSize); + LogSpew(LF_GCINFO, level, "Ranges: %zu\n", RangeSize); + LogSpew(LF_GCINFO, level, "NumRegs: %zu\n", NumRegsSize); + LogSpew(LF_GCINFO, level, "NumStack: %zu\n", NumStackSize); + LogSpew(LF_GCINFO, level, "RegSlots: %zu\n", RegSlotSize); + LogSpew(LF_GCINFO, level, "StackSlots: %zu\n", StackSlotSize); + LogSpew(LF_GCINFO, level, "CallSiteStates: %zu\n", CallSiteStateSize); + LogSpew(LF_GCINFO, level, "EhOffsets: %zu\n", EhPosSize); + LogSpew(LF_GCINFO, level, "EhStates: %zu\n", EhStateSize); + LogSpew(LF_GCINFO, level, "ChunkPointers: %zu\n", ChunkPtrSize); + LogSpew(LF_GCINFO, level, "ChunkMasks: %zu\n", ChunkMaskSize); + LogSpew(LF_GCINFO, level, "ChunkFinalStates: %zu\n", ChunkFinalStateSize); + LogSpew(LF_GCINFO, level, "Transitions: %zu\n", ChunkTransitionSize); } } @@ -2266,8 +2266,8 @@ lExitSuccess:; m_CurrentMethodSize.Log(LL_INFO100, "=== PartiallyInterruptible method breakdown ===\r\n"); g_PiGcInfoSize.Log(LL_INFO10, "=== PartiallyInterruptible global breakdown ===\r\n"); } - LogSpew(LF_GCINFO, LL_INFO10, "Total SlimHeaders: %Iu\n", g_NumSlimHeaders); - LogSpew(LF_GCINFO, LL_INFO10, "NumMethods: %Iu\n", g_NumFatHeaders); + LogSpew(LF_GCINFO, LL_INFO10, "Total SlimHeaders: %zu\n", g_NumSlimHeaders); + LogSpew(LF_GCINFO, LL_INFO10, "NumMethods: %zu\n", g_NumFatHeaders); #endif } diff --git a/src/coreclr/ilasm/main.cpp b/src/coreclr/ilasm/main.cpp index 39bf5f11b5d225..f51644ca848974 100644 --- a/src/coreclr/ilasm/main.cpp +++ b/src/coreclr/ilasm/main.cpp @@ -173,7 +173,7 @@ extern "C" int _cdecl wmain(int argc, _In_ WCHAR **argv) #endif { printf("\n.NET IL Assembler version " CLR_PRODUCT_VERSION); - printf("\n%S\n\n", VER_LEGALCOPYRIGHT_LOGO_STR_L); + printf("\n%s\n\n", VER_LEGALCOPYRIGHT_LOGO_STR); goto PrintUsageAndExit; ErrorExit: @@ -391,7 +391,7 @@ extern "C" int _cdecl wmain(int argc, _In_ WCHAR **argv) pAsm->m_wzResourceFile = pStr; } else - printf("Multiple resource files not allowed. Option %ls skipped\n",argv[i]); + printf("Multiple resource files not allowed. Last RES option skipped\n"); } else if (!_stricmp(szOpt, "KEY")) { @@ -665,7 +665,7 @@ extern "C" int _cdecl wmain(int argc, _In_ WCHAR **argv) if(bLogo) { printf("\n.NET IL Assembler. Version " CLR_PRODUCT_VERSION); - printf("\n%S", VER_LEGALCOPYRIGHT_LOGO_STR_L); + printf("\n%s", VER_LEGALCOPYRIGHT_LOGO_STR); } pAsm->SetDLL(IsDLL); @@ -848,14 +848,14 @@ extern "C" int _cdecl wmain(int argc, _In_ WCHAR **argv) wcscpy_s(pc+1,4,W("PDB")); #ifdef TARGET_WINDOWS - _wremove(wzOutputFilename); + _wremove(wzOutputFilename); #else MAKE_UTF8PTR_FROMWIDE_NOTHROW(szOutputFilename, wzOutputFilename); if (szOutputFilename != NULL) { remove(szOutputFilename); } -#endif +#endif } if (exitval == 0) { diff --git a/src/coreclr/ildasm/dasm.cpp b/src/coreclr/ildasm/dasm.cpp index 425f29e9222ab8..9f6c006015e544 100644 --- a/src/coreclr/ildasm/dasm.cpp +++ b/src/coreclr/ildasm/dasm.cpp @@ -1890,7 +1890,7 @@ BYTE* PrettyPrintCABlobValue(PCCOR_SIGNATURE &typePtr, for(n=0; n < numElements; n++) { if(n) appendStr(out," "); - sprintf_s(str,64,"%I64d",GET_UNALIGNED_VAL64(dataPtr)); + sprintf_s(str,64,"%lld",GET_UNALIGNED_VAL64(dataPtr)); appendStr(out,str); dataPtr +=8; } @@ -1902,7 +1902,7 @@ BYTE* PrettyPrintCABlobValue(PCCOR_SIGNATURE &typePtr, for(n=0; n < numElements; n++) { if(n) appendStr(out," "); - sprintf_s(str,64,"%I64d",(ULONGLONG)GET_UNALIGNED_VAL64(dataPtr)); + sprintf_s(str,64,"%lld",(ULONGLONG)GET_UNALIGNED_VAL64(dataPtr)); appendStr(out,str); dataPtr +=8; } @@ -1938,7 +1938,7 @@ BYTE* PrettyPrintCABlobValue(PCCOR_SIGNATURE &typePtr, // Must compare as underlying bytes, not floating point otherwise optimizer will // try to enregister and compare 80-bit precision number with 64-bit precision number!!!! if((*(ULONGLONG*)&df != (ULONGLONG)GET_UNALIGNED_VAL64(dataPtr))||IsSpecialNumber(str)) - sprintf_s(str, 64, "0x%I64X",(ULONGLONG)GET_UNALIGNED_VAL64(dataPtr)); + sprintf_s(str, 64, "0x%llX",(ULONGLONG)GET_UNALIGNED_VAL64(dataPtr)); appendStr(out,str); dataPtr +=8; } @@ -2597,10 +2597,10 @@ void DumpDefaultValue(mdToken tok, __inout __nullterminated char* szString, void szptr+=sprintf_s(szptr,SZSTRING_REMAINING_SIZE(szptr),"(%s)", KEYWORD((char *)(MDDV.m_byteValue ? "true" : "false"))); break; case ELEMENT_TYPE_I8: - szptr+=sprintf_s(szptr,SZSTRING_REMAINING_SIZE(szptr)," = %s(0x%I64X)",KEYWORD("int64"),MDDV.m_ullValue); + szptr+=sprintf_s(szptr,SZSTRING_REMAINING_SIZE(szptr)," = %s(0x%llX)",KEYWORD("int64"),MDDV.m_ullValue); break; case ELEMENT_TYPE_U8: - szptr+=sprintf_s(szptr,SZSTRING_REMAINING_SIZE(szptr)," = %s(0x%I64X)",KEYWORD("uint64"),MDDV.m_ullValue); + szptr+=sprintf_s(szptr,SZSTRING_REMAINING_SIZE(szptr)," = %s(0x%llX)",KEYWORD("uint64"),MDDV.m_ullValue); break; case ELEMENT_TYPE_R4: { @@ -2627,7 +2627,7 @@ void DumpDefaultValue(mdToken tok, __inout __nullterminated char* szString, void if((*(ULONGLONG*)&df == MDDV.m_ullValue)&&!IsSpecialNumber(szf)) szptr+=sprintf_s(szptr,SZSTRING_REMAINING_SIZE(szptr)," = %s(%s)",KEYWORD("float64"),szf); else - szptr+=sprintf_s(szptr,SZSTRING_REMAINING_SIZE(szptr), " = %s(0x%I64X) // %s",KEYWORD("float64"),MDDV.m_ullValue,szf); + szptr+=sprintf_s(szptr,SZSTRING_REMAINING_SIZE(szptr), " = %s(0x%llX) // %s",KEYWORD("float64"),MDDV.m_ullValue,szf); } break; @@ -3743,7 +3743,7 @@ BOOL DumpMethod(mdToken FuncToken, const char *pszClassName, DWORD dwEntryPointT sprintf_s(pszArgname[j].name,16,"A_%d",g_fThisIsInstanceMethod ? j+1 : j); } }// end for( along the argnames) - sprintf_s(szArgPrefix,MAX_PREFIX_SIZE,"@%Id0",(size_t)pszArgname); + sprintf_s(szArgPrefix,MAX_PREFIX_SIZE,"@%zd0",(size_t)pszArgname); } //end if (ulArgs) g_pImport->EnumClose(&hArgEnum); } diff --git a/src/coreclr/ildasm/dasm.rc b/src/coreclr/ildasm/dasm.rc index 057398fe5253be..46c62cebd80be5 100644 --- a/src/coreclr/ildasm/dasm.rc +++ b/src/coreclr/ildasm/dasm.rc @@ -127,7 +127,6 @@ END STRINGTABLE DISCARDABLE BEGIN - IDS_USAGE_40 L" /ALL Combination of /HEADER, /BYTES, /TOKENS\n\n" IDS_USAGE_41 L"\nOption key is '-' or '/', options are recognized by first 3 characters\n\n" IDS_USAGE_42 L"Example: ildasm /tok /byt myfile.exe /out=myfile.il\n\n" IDS_USAGE_43 L"\n\nPress any key to close the console window..." @@ -203,8 +202,6 @@ END STRINGTABLE DISCARDABLE BEGIN - IDS_E_MULTIPLEINPUT L"MULTIPLE INPUT FILES SPECIFIED\n\n" - IDS_E_INVALIDOPTION L"INVALID COMMAND LINE OPTION: %s\n\n" IDS_W_CREATEDW32RES L"WARNING: Created Win32 resource file %s" IDS_E_CORRUPTW32RES L"ERROR: Corrupt Win32 resources" IDS_E_CANTOPENW32RES L"ERROR: Unable to open file %s" diff --git a/src/coreclr/ildasm/dis.cpp b/src/coreclr/ildasm/dis.cpp index bc6a40e6d3cd8c..81ccc1928b8ff3 100644 --- a/src/coreclr/ildasm/dis.cpp +++ b/src/coreclr/ildasm/dis.cpp @@ -1029,7 +1029,7 @@ BOOL Disassemble(IMDInternalImport *pImport, BYTE *ILHeader, void *GUICookie, md LoadScope(pRootScope,&daScope,&ulScopes); qsort(&daScope[0],ulScopes,sizeof(LexScope),cmpLexScope); OpenScope(pRootScope,pszLVname,ulVars); - sprintf_s(szVarPrefix,MAX_PREFIX_SIZE,"@%Id0",(size_t)pszLVname); + sprintf_s(szVarPrefix,MAX_PREFIX_SIZE,"@%zd0",(size_t)pszLVname); #ifndef SHOW_LEXICAL_SCOPES for(unsigned jjj = 0; jjj < ulScopes; jjj++) @@ -1540,7 +1540,7 @@ BOOL Disassemble(IMDInternalImport *pImport, BYTE *ILHeader, void *GUICookie, md PadTheString; } - szptr+=sprintf_s(szptr,SZSTRING_REMAINING_SIZE(szptr), "%-10s 0x%I64x", pszInstrName, v); + szptr+=sprintf_s(szptr,SZSTRING_REMAINING_SIZE(szptr), "%-10s 0x%llx", pszInstrName, v); PC += 8; break; } diff --git a/src/coreclr/ildasm/resource.h b/src/coreclr/ildasm/resource.h index 4995b4d28b85d9..64c246d2ca8a29 100644 --- a/src/coreclr/ildasm/resource.h +++ b/src/coreclr/ildasm/resource.h @@ -136,8 +136,6 @@ #define IDS_E_MDIIMPORT 456 #define IDS_E_NOMANIFEST 457 -#define IDS_E_MULTIPLEINPUT 458 -#define IDS_E_INVALIDOPTION 459 #define IDS_W_CREATEDW32RES 470 #define IDS_E_CORRUPTW32RES 471 #define IDS_E_CANTOPENW32RES 472 diff --git a/src/coreclr/ildasm/windasm.cpp b/src/coreclr/ildasm/windasm.cpp index 490abb53775c89..d85e5277e45171 100644 --- a/src/coreclr/ildasm/windasm.cpp +++ b/src/coreclr/ildasm/windasm.cpp @@ -94,22 +94,22 @@ FILE* OpenOutput(_In_ __nullterminated const char* szFileName); void PrintLogo() { printf(".NET IL Disassembler. Version " CLR_PRODUCT_VERSION); - printf("\n%S\n\n", VER_LEGALCOPYRIGHT_LOGO_STR_L); + printf("\n%s\n\n", VER_LEGALCOPYRIGHT_LOGO_STR); } void SyntaxCon() { DWORD l; - for(l=IDS_USAGE_01; l<= IDS_USAGE_23; l++) printf(RstrANSI(l)); + for(l=IDS_USAGE_01; l<= IDS_USAGE_23; l++) printf("%s", RstrANSI(l)); if(g_fTDC) { - for(l=IDS_USAGE_24; l<= IDS_USAGE_32; l++) printf(RstrANSI(l)); - for(l=IDS_USAGE_34; l<= IDS_USAGE_36; l++) printf(RstrANSI(l)); - for(l=IDS_USAGE_37; l<= IDS_USAGE_39; l++) printf(RstrANSI(l)); + for(l=IDS_USAGE_24; l<= IDS_USAGE_32; l++) printf("%s", RstrANSI(l)); + for(l=IDS_USAGE_34; l<= IDS_USAGE_36; l++) printf("%s", RstrANSI(l)); + for(l=IDS_USAGE_37; l<= IDS_USAGE_39; l++) printf("%s", RstrANSI(l)); } - else printf(RstrANSI(IDS_USAGE_40)); - for(l=IDS_USAGE_41; l<= IDS_USAGE_42; l++) printf(RstrANSI(l)); + else printf(" /ALL Combination of /HEADER, /BYTES, /TOKENS\n\n"); + for(l=IDS_USAGE_41; l<= IDS_USAGE_42; l++) printf("%s", RstrANSI(l)); } @@ -403,7 +403,7 @@ int ProcessOneArg(_In_ __nullterminated char* szArg, _Out_ char** ppszObjFileNam else { PrintLogo(); - printf(RstrANSI(IDS_E_INVALIDOPTION),szArg); //"INVALID COMMAND LINE OPTION: %s\n\n",szArg); + printf("INVALID COMMAND LINE OPTION: %s\n\n",szArg); return -1; } } @@ -412,7 +412,7 @@ int ProcessOneArg(_In_ __nullterminated char* szArg, _Out_ char** ppszObjFileNam if(g_szInputFile[0]) { PrintLogo(); - printf(RstrANSI(IDS_E_MULTIPLEINPUT)); //"MULTIPLE INPUT FILES SPECIFIED\n\n"); + printf("MULTIPLE INPUT FILES SPECIFIED\n\n"); return -1; // check if it was already specified } szArg = CheckForDQuotes(szArg); diff --git a/src/coreclr/inc/clrversion.h b/src/coreclr/inc/clrversion.h index 5058a47d6d3878..841fb24f126009 100644 --- a/src/coreclr/inc/clrversion.h +++ b/src/coreclr/inc/clrversion.h @@ -26,4 +26,3 @@ #define VER_FILEVERSION_STR_L QUOTE_MACRO_L(RuntimeFileMajorVersion.RuntimeFileMinorVersion.RuntimeFileBuildVersion.RuntimeFileRevisionVersion) #define VER_LEGALCOPYRIGHT_LOGO_STR "Copyright (c) Microsoft Corporation. All rights reserved." -#define VER_LEGALCOPYRIGHT_LOGO_STR_L L"Copyright (c) Microsoft Corporation. All rights reserved." diff --git a/src/coreclr/inc/formattype.cpp b/src/coreclr/inc/formattype.cpp index a1b2e043ee3c69..6a79d4b6e5f354 100644 --- a/src/coreclr/inc/formattype.cpp +++ b/src/coreclr/inc/formattype.cpp @@ -1507,7 +1507,7 @@ char* DumpMarshaling(IMDInternalImport* pImport, buf.AppendASCII(" }) "); char * tgt = szString + strlen(szString); - int sprintf_ret = sprintf_s(tgt, cchszString - (tgt - szString), "%S", buf.GetUnicode()); + int sprintf_ret = sprintf_s(tgt, cchszString - (tgt - szString), "%s", buf.GetUTF8()); if (sprintf_ret == -1) { // Hit an error. Oh well, nothing to do... @@ -1521,7 +1521,7 @@ char* DumpMarshaling(IMDInternalImport* pImport, else { char * tgt = szString + strlen(szString); - int sprintf_ret = sprintf_s(tgt, cchszString - (tgt - szString), "%S", buf.GetUnicode()); + int sprintf_ret = sprintf_s(tgt, cchszString - (tgt - szString), "%s", buf.GetUTF8()); if (sprintf_ret == -1) { // There was an error, possibly with converting the Unicode characters. diff --git a/src/coreclr/inc/gcmsg.inl b/src/coreclr/inc/gcmsg.inl index f6e1f7227a1c45..bb95800a015f48 100644 --- a/src/coreclr/inc/gcmsg.inl +++ b/src/coreclr/inc/gcmsg.inl @@ -44,13 +44,13 @@ static const char* gcDetailedStartMsg() { STATIC_CONTRACT_LEAF; - return "*GC* %d(gen0:%d)(%d)(alloc: %Id)(%s)(%d)"; + return "*GC* %d(gen0:%d)(%d)(alloc: %zd)(%s)(%d)"; } static const char* gcDetailedEndMsg() { STATIC_CONTRACT_LEAF; - return "*EGC* %Id(gen0:%Id)(%Id)(%d)(%s)(%s)(%s)(ml: %d->%d)"; + return "*EGC* %zd(gen0:%zd)(%zd)(%d)(%s)(%s)(%s)(ml: %d->%d)"; } static const char* gcStartMarkMsg() @@ -80,7 +80,7 @@ static const char* gcStartCompactMsg() { STATIC_CONTRACT_LEAF; - return "---- Compact Phase on heap %d: %Ix(%Ix)----"; + return "---- Compact Phase on heap %d: %zx(%zx)----"; } static const char* gcEndCompactMsg() @@ -92,31 +92,31 @@ static const char* gcMemCopyMsg() { STATIC_CONTRACT_LEAF; - return " mc: [%Ix->%Ix, %Ix->%Ix["; + return " mc: [%zx->%zx, %zx->%zx["; } static const char* gcPlanPlugMsg() { STATIC_CONTRACT_LEAF; - return "(%Ix)[%Ix->%Ix, NA: [%Ix(%Id), %Ix[: %Ix(%d), x: %Ix (%s)"; + return "(%zx)[%zx->%zx, NA: [%zx(%zd), %zx[: %zx(%d), x: %zx (%s)"; } static const char* gcPlanPinnedPlugMsg() { STATIC_CONTRACT_LEAF; - return "(%Ix)PP: [%Ix, %Ix[%Ix](m:%d)"; + return "(%zx)PP: [%zx, %zx[%zx](m:%d)"; } static const char* gcDesiredNewAllocationMsg() { STATIC_CONTRACT_LEAF; - return "h%d g%d surv: %Id current: %Id alloc: %Id (%d%%) f: %d%% new-size: %Id new-alloc: %Id"; + return "h%d g%d surv: %zd current: %zd alloc: %zd (%d%%) f: %d%% new-size: %zd new-alloc: %zd"; } static const char* gcMakeUnusedArrayMsg() { STATIC_CONTRACT_LEAF; - return "Making unused array [%Ix, %Ix["; + return "Making unused array [%zx, %zx["; } static const char* gcStartBgcThread() diff --git a/src/coreclr/jit/assertionprop.cpp b/src/coreclr/jit/assertionprop.cpp index 980bfcfb5dd97a..2c3fca0a28b233 100644 --- a/src/coreclr/jit/assertionprop.cpp +++ b/src/coreclr/jit/assertionprop.cpp @@ -4235,7 +4235,7 @@ GenTree* Compiler::optAssertionPropGlobal_RelOp(ASSERT_VALARG_TP assertions, Gen } else if (op1->TypeGet() == TYP_LONG) { - printf("%I64d\n", vnStore->ConstantValue(vnCns)); + printf("%lld\n", vnStore->ConstantValue(vnCns)); } else if (op1->TypeGet() == TYP_DOUBLE) { diff --git a/src/coreclr/jit/compiler.cpp b/src/coreclr/jit/compiler.cpp index 41235431b38f62..78fff4c4321747 100644 --- a/src/coreclr/jit/compiler.cpp +++ b/src/coreclr/jit/compiler.cpp @@ -8607,7 +8607,7 @@ void JitTimer::PrintCsvMethodStats(Compiler* comp) { totCycles += m_info.m_cyclesByPhase[i]; } - fprintf(s_csvFile, "%I64u,", m_info.m_cyclesByPhase[i]); + fprintf(s_csvFile, "%llu,", m_info.m_cyclesByPhase[i]); if ((JitConfig.JitMeasureIR() != 0) && PhaseReportsIRSize[i]) { @@ -8618,9 +8618,9 @@ void JitTimer::PrintCsvMethodStats(Compiler* comp) comp->m_inlineStrategy->DumpCsvData(s_csvFile); fprintf(s_csvFile, "%u,", comp->info.compNativeCodeSize); - fprintf(s_csvFile, "%Iu,", comp->compInfoBlkSize); - fprintf(s_csvFile, "%Iu,", comp->compGetArenaAllocator()->getTotalBytesAllocated()); - fprintf(s_csvFile, "%I64u,", m_info.m_totalCycles); + fprintf(s_csvFile, "%zu,", comp->compInfoBlkSize); + fprintf(s_csvFile, "%zu,", comp->compGetArenaAllocator()->getTotalBytesAllocated()); + fprintf(s_csvFile, "%llu,", m_info.m_totalCycles); fprintf(s_csvFile, "%f\n", CachedCyclesPerSecond()); fflush(s_csvFile); diff --git a/src/coreclr/jit/disasm.cpp b/src/coreclr/jit/disasm.cpp index 10fb136eb2b364..5f01c4eea6d72c 100644 --- a/src/coreclr/jit/disasm.cpp +++ b/src/coreclr/jit/disasm.cpp @@ -389,7 +389,7 @@ size_t DisAssembler::disCchFixupMember( if (anyReloc) { // Make instructions like "mov rcx, 7FE8247A638h" diffable. - swprintf_s(wz, cchMax, W("%IXh"), dspAddr(targetAddr)); + swprintf_s(wz, cchMax, W("%zXh"), dspAddr(targetAddr)); break; } @@ -494,7 +494,7 @@ size_t DisAssembler::disCchFixupMember( * "addr" is the address of the immediate */ // Make instructions like "mov rcx, 7FE8247A638h" diffable. - swprintf_s(wz, cchMax, W("%IXh"), dspAddr(targetAddr)); + swprintf_s(wz, cchMax, W("%zXh"), dspAddr(targetAddr)); break; } @@ -913,9 +913,9 @@ size_t DisAssembler::CbDisassemble(DIS* pdis, if (cb == 0) { - DISASM_DUMP("CbDisassemble offs %Iu addr %I64u\n", offs, addr); + DISASM_DUMP("CbDisassemble offs %zu addr %llu\n", offs, addr); // assert(!"can't disassemble instruction!!!"); - fprintf(pfile, "MSVCDIS can't disassemble instruction @ offset %Iu (0x%02x)!!!\n", offs, offs); + fprintf(pfile, "MSVCDIS can't disassemble instruction @ offset %zu (0x%02zx)!!!\n", offs, offs); #if defined(TARGET_ARM64) fprintf(pfile, "%08Xh\n", *(unsigned int*)pb); return 4; diff --git a/src/coreclr/jit/emitxarch.cpp b/src/coreclr/jit/emitxarch.cpp index 6530f535d71106..3ff690302d9a9f 100644 --- a/src/coreclr/jit/emitxarch.cpp +++ b/src/coreclr/jit/emitxarch.cpp @@ -9626,7 +9626,7 @@ void emitter::emitDispReloc(ssize_t value) } else { - printf("(reloc 0x%Ix)", emitComp->dspPtr(value)); + printf("(reloc 0x%zx)", emitComp->dspPtr(value)); } } @@ -10163,11 +10163,11 @@ void emitter::emitDispIns( } else if ((val > 0) || (val < -0xFFFFFF)) { - printf("0x%IX", (ssize_t)val); + printf("0x%zX", (ssize_t)val); } else { // (val < 0) - printf("-0x%IX", (ssize_t)-val); + printf("-0x%zX", (ssize_t)-val); } emitDispCommentForHandle(srcVal, id->idDebugOnlyInfo()->idMemCookie, id->idDebugOnlyInfo()->idFlags); } diff --git a/src/coreclr/jit/unwind.cpp b/src/coreclr/jit/unwind.cpp index ea9ee5787aaa79..12114916f5362c 100644 --- a/src/coreclr/jit/unwind.cpp +++ b/src/coreclr/jit/unwind.cpp @@ -400,7 +400,7 @@ void Compiler::DumpCfiInfo(bool isHotCode, printf(" CodeOffset: 0x%02X Op: AdjustCfaOffset Offset:0x%X\n", codeOffset, offset); break; default: - printf(" Unrecognized CFI_CODE: 0x%IX\n", *(UINT64*)pCode); + printf(" Unrecognized CFI_CODE: 0x%llX\n", *(UINT64*)pCode); break; } } diff --git a/src/coreclr/md/enc/stgtiggerstorage.cpp b/src/coreclr/md/enc/stgtiggerstorage.cpp index a216961ffe6e4a..4c9869eb8caa23 100644 --- a/src/coreclr/md/enc/stgtiggerstorage.cpp +++ b/src/coreclr/md/enc/stgtiggerstorage.cpp @@ -967,7 +967,7 @@ ULONG TiggerStorage::PrintSizeInfo(bool verbose) for (int i = 0; i < m_StgHdr.GetiStreams(); i++) { pNext = storStream->NextStream(); - printf("Stream #%d (%s) Header: %zd, Data: %lu\n",i,storStream->GetName(), (size_t)((BYTE*)pNext - (BYTE*)storStream), storStream->GetSize()); + printf("Stream #%d (%s) Header: %zd, Data: %u\n",i,storStream->GetName(), (size_t)((BYTE*)pNext - (BYTE*)storStream), storStream->GetSize()); total += storStream->GetSize(); storStream = pNext; } diff --git a/src/coreclr/pal/src/cruntime/printfcpp.cpp b/src/coreclr/pal/src/cruntime/printfcpp.cpp index a2b9c8f004dee7..198d26ed740e96 100644 --- a/src/coreclr/pal/src/cruntime/printfcpp.cpp +++ b/src/coreclr/pal/src/cruntime/printfcpp.cpp @@ -359,8 +359,6 @@ BOOL Internal_ExtractFormatA(CPalThread *pthrCurrent, LPCSTR *Fmt, LPSTR Out, LP *Out++ = '1'; *Out++ = '6'; } - /* native *printf does not support %I64p - (actually %llp), so we need to cheat a little bit */ *Out++ = 'l'; *Out++ = 'l'; } diff --git a/src/coreclr/pal/src/map/virtual.cpp b/src/coreclr/pal/src/map/virtual.cpp index e11f39cd4be16f..ad5fc4ce9aaa6e 100644 --- a/src/coreclr/pal/src/map/virtual.cpp +++ b/src/coreclr/pal/src/map/virtual.cpp @@ -1276,7 +1276,7 @@ PAL_VirtualReserveFromExecutableMemoryAllocatorWithinRange( #ifdef HOST_64BIT PERF_ENTRY(PAL_VirtualReserveFromExecutableMemoryAllocatorWithinRange); ENTRY( - "PAL_VirtualReserveFromExecutableMemoryAllocatorWithinRange(lpBeginAddress = %p, lpEndAddress = %p, dwSize = %Iu, fStoreAllocationInfo = %d)\n", + "PAL_VirtualReserveFromExecutableMemoryAllocatorWithinRange(lpBeginAddress = %p, lpEndAddress = %p, dwSize = %zu, fStoreAllocationInfo = %d)\n", lpBeginAddress, lpEndAddress, dwSize, diff --git a/src/coreclr/pal/src/thread/thread.cpp b/src/coreclr/pal/src/thread/thread.cpp index 6d614b7e37ed56..0daa011e6fc636 100644 --- a/src/coreclr/pal/src/thread/thread.cpp +++ b/src/coreclr/pal/src/thread/thread.cpp @@ -572,7 +572,7 @@ CorUnix::InternalCreateThread( // When coming here from the public API surface, the incoming value is originally a nonnegative signed int32, so // this shouldn't happen ASSERT( - "Couldn't align the requested stack size (%Iu) to the page size because the stack size was too large\n", + "Couldn't align the requested stack size (%zu) to the page size because the stack size was too large\n", alignedStackSize); palError = ERROR_INVALID_PARAMETER; goto EXIT; @@ -645,10 +645,10 @@ CorUnix::InternalCreateThread( alignedStackSize = MinStackSize; } - TRACE("setting thread stack size to %Iu\n", alignedStackSize); + TRACE("setting thread stack size to %zu\n", alignedStackSize); if (0 != pthread_attr_setstacksize(&pthreadAttr, alignedStackSize)) { - ERROR("couldn't set pthread stack size to %Iu\n", alignedStackSize); + ERROR("couldn't set pthread stack size to %zu\n", alignedStackSize); palError = ERROR_INTERNAL_ERROR; goto EXIT; } diff --git a/src/coreclr/tools/StressLogAnalyzer/StressLogPlugin.cpp b/src/coreclr/tools/StressLogAnalyzer/StressLogPlugin.cpp index 4a4141490e6be9..eb276755d21884 100644 --- a/src/coreclr/tools/StressLogAnalyzer/StressLogPlugin.cpp +++ b/src/coreclr/tools/StressLogAnalyzer/StressLogPlugin.cpp @@ -562,7 +562,7 @@ static volatile LONG64 s_msgCount = 0; static volatile LONG64 s_totalMsgCount = 0; static double s_timeFilterStart = 0; static double s_timeFilterEnd = 0; -static WCHAR* s_outputFileName = nullptr; +static const char* s_outputFileName = nullptr; static StressLog::StressLogHeader* s_hdr; @@ -591,7 +591,7 @@ void Usage() printf(" -f: print the raw format strings along with the message\n"); printf(" (useful to search for the format string in the source code)\n"); printf(" -f:: search for a specific format string\n"); - printf(" e.g. '-f:\"<%%Ix>:%%Ix\"'\n"); + printf(" e.g. '-f:\"<%%zx>:%%zx\"'\n"); printf("\n"); printf(" -i:: ignore messages from log facilities\n"); printf(" e.g. '-i:7ffe' means ignore messages from anything but LF_GC\n"); @@ -779,10 +779,7 @@ bool ParseOptions(int argc, char* argv[]) case 'O': if (arg[2] == ':') { - WCHAR* buffer = new WCHAR[1000]; - if (MultiByteToWideChar(CP_ACP, 0, &arg[3], -1, buffer, 1000) == 0) - return false; - s_outputFileName = buffer; + s_outputFileName = &arg[3]; } else { @@ -1036,14 +1033,14 @@ DWORD WINAPI ProcessStresslogWorker(LPVOID) { wrappedWriteThreadCount++; } - // printf("thread: %Ix\n", tsl->threadId); + // printf("thread: %zx\n", tsl->threadId); StressMsg* msg = StressLog::TranslateMemoryMappedPointer(tsl->curPtr); StressLogChunk* slc = StressLog::TranslateMemoryMappedPointer(tsl->curWriteChunk); int chunkCount = 0; StressMsg* prevMsg = nullptr; while (true) { - // printf("stress log chunk %Ix\n", (size_t)slc); + // printf("stress log chunk %zx\n", (size_t)slc); if (!slc->IsValid()) { printf("oops, invalid stress log chunk\n"); @@ -1399,9 +1396,9 @@ int ProcessStressLog(void* baseAddress, int argc, char* argv[]) FILE* outputFile = stdout; if (s_outputFileName != nullptr) { - if (_wfopen_s(&outputFile, s_outputFileName, W("w")) != 0) + if (fopen_s(&outputFile, s_outputFileName, "w") != 0) { - printf("could not create output file %S\n", s_outputFileName); + printf("could not create output file %s\n", s_outputFileName); outputFile = stdout; } } @@ -1485,7 +1482,7 @@ int ProcessStressLog(void* baseAddress, int argc, char* argv[]) (double)usedSize / (1024 * 1024 * 1024), (double)availSize/ (1024 * 1024 * 1024), s_threadStressLogCount, (int)s_wrappedWriteThreadCount); if (hdr->threadsWithNoLog != 0) - printf("%Id threads did not get a log!\n", hdr->threadsWithNoLog); + printf("%lld threads did not get a log!\n", hdr->threadsWithNoLog); printf("Number of messages examined: "); PrintFriendlyNumber(s_totalMsgCount); printf(", printed: "); PrintFriendlyNumber(s_msgCount); printf("\n"); delete[] s_threadMsgBuf; diff --git a/src/coreclr/tools/metainfo/mdinfo.cpp b/src/coreclr/tools/metainfo/mdinfo.cpp index 6d35f03e8d9faa..9f3e16f5d70d5f 100644 --- a/src/coreclr/tools/metainfo/mdinfo.cpp +++ b/src/coreclr/tools/metainfo/mdinfo.cpp @@ -360,7 +360,7 @@ void MDInfo::DisplayMD() // WriteLine("Unresolved MemberRefs"); // DisplayMemberRefs(0x00000001, "\t"); - VWrite("\n\nCoff symbol name overhead: %Iu\n", g_cbCoffNames); + VWrite("\n\nCoff symbol name overhead: %zu\n", g_cbCoffNames); } WriteLine("==========================================================="); if (m_DumpFilter & dumpUnsat) @@ -2196,7 +2196,7 @@ LPCWSTR MDInfo::VariantAsString(VARIANT *pVariant) // Set variant type to bstr. V_VT(pVariant) = VT_BSTR; // Create the ansi string. - sprintf_s(szStr, 32, "%I64d", V_CY(pVariant).int64); + sprintf_s(szStr, 32, "%lld", V_CY(pVariant).int64); // Convert to unicode. WszMultiByteToWideChar(CP_ACP, 0, szStr, -1, wszStr, 32); // convert to bstr and set variant value. diff --git a/src/coreclr/tools/superpmi/mcs/verbildump.cpp b/src/coreclr/tools/superpmi/mcs/verbildump.cpp index 506d14e587f992..e29b92ac277025 100644 --- a/src/coreclr/tools/superpmi/mcs/verbildump.cpp +++ b/src/coreclr/tools/superpmi/mcs/verbildump.cpp @@ -909,8 +909,7 @@ char* DumpAttributeToConsoleBare(DWORD attribute) #define ifPrint(s, t) \ else if ((s & attribute) == s) \ { \ - printf(t); \ - printf(" "); \ + printf("%s ", t); \ } if (0) diff --git a/src/coreclr/tools/superpmi/superpmi-shared/lightweightmap.h b/src/coreclr/tools/superpmi/superpmi-shared/lightweightmap.h index e696f469d17dfa..28b61e6eb8eb4e 100644 --- a/src/coreclr/tools/superpmi/superpmi-shared/lightweightmap.h +++ b/src/coreclr/tools/superpmi/superpmi-shared/lightweightmap.h @@ -265,7 +265,7 @@ class LightWeightMap : public LightWeightMapBuffer // If we have RTTI, we can make this assert report the correct type. No RTTI, though, when // built with .NET Core, especially when built against the PAL. - AssertCodeMsg((unsigned int)(ptr - rawData) == size, EXCEPTIONCODE_LWM, "%s - Ended with unexpected sizes %Ix != %x", + AssertCodeMsg((unsigned int)(ptr - rawData) == size, EXCEPTIONCODE_LWM, "%s - Ended with unexpected sizes %zx != %x", "Unknown type" /*typeid(_Item).name()*/, ptr - rawData, size); } @@ -549,7 +549,7 @@ class DenseLightWeightMap : public LightWeightMapBuffer ptr += bufferLength * sizeof(unsigned char); } - AssertCodeMsg((unsigned int)(ptr - rawData) == size, EXCEPTIONCODE_LWM, "Ended with unexpected sizes %Ix != %x", + AssertCodeMsg((unsigned int)(ptr - rawData) == size, EXCEPTIONCODE_LWM, "Ended with unexpected sizes %zx != %x", ptr - rawData, size); } @@ -609,7 +609,7 @@ class DenseLightWeightMap : public LightWeightMapBuffer delete[] tItems; } - AssertCodeMsg((unsigned int)(ptr - rawData) == size, EXCEPTIONCODE_LWM, "Ended with unexpected sizes %Ix != %x", + AssertCodeMsg((unsigned int)(ptr - rawData) == size, EXCEPTIONCODE_LWM, "Ended with unexpected sizes %zx != %x", ptr - rawData, size); } @@ -656,7 +656,7 @@ class DenseLightWeightMap : public LightWeightMapBuffer ptr += bufferLength * sizeof(unsigned char); } - AssertCodeMsg(ptr == (bytes + size), EXCEPTIONCODE_LWM, "Ended with unexpected sizes %Ix != %x", ptr - bytes, + AssertCodeMsg(ptr == (bytes + size), EXCEPTIONCODE_LWM, "Ended with unexpected sizes %zx != %x", ptr - bytes, size); return size; } diff --git a/src/coreclr/unwinder/amd64/dbs_stack_x64.cpp b/src/coreclr/unwinder/amd64/dbs_stack_x64.cpp index c76956e663e630..e60e7c33fa1048 100644 --- a/src/coreclr/unwinder/amd64/dbs_stack_x64.cpp +++ b/src/coreclr/unwinder/amd64/dbs_stack_x64.cpp @@ -127,10 +127,10 @@ Routine Description: MachineFrame = FALSE; PrologOffset = (ULONG)(ControlPc - (FunctionEntry->BeginAddress + ImageBase)); - m_Services->Status(1, "Prol: RIP %I64X, 0x%X bytes in function at %I64X\n", + m_Services->Status(1, "Prol: RIP %llX, 0x%X bytes in function at %llX\n", ControlPc, PrologOffset, FunctionEntry->BeginAddress + ImageBase); - m_Services->Status(1, "Prol: Read unwind info at %I64X\n", + m_Services->Status(1, "Prol: Read unwind info at %llX\n", FunctionEntry->UnwindInfoAddress + ImageBase); if ((Status = @@ -147,7 +147,7 @@ Routine Description: while (Index < UnwindInfo->CountOfCodes) { - m_Services->Status(1, " %02X: Code %X offs %03X, RSP %I64X\n", + m_Services->Status(1, " %02X: Code %X offs %03X, RSP %llX\n", Index, UnwindInfo->UnwindCode[Index].UnwindOp, UnwindInfo->UnwindCode[Index].CodeOffset, ContextRecord->Rsp); @@ -182,7 +182,7 @@ Routine Description: &IntegerRegister[OpInfo], sizeof(ULONG64))) != S_OK) { m_Services->Status(1, "Prol: Op %X memory " - "read failed at %I64X\n", + "read failed at %llX\n", UnwindOp, IntegerAddress); goto Fail; } @@ -249,7 +249,7 @@ Routine Description: &IntegerRegister[OpInfo], sizeof(ULONG64))) != S_OK) { m_Services->Status(1, "Prol: Op %X memory read " - "failed at %I64X\n", + "failed at %llX\n", UnwindOp, IntegerAddress); goto Fail; } @@ -272,7 +272,7 @@ Routine Description: &IntegerRegister[OpInfo], sizeof(ULONG64))) != S_OK) { m_Services->Status(1, "Prol: Op %X memory read " - "failed at %I64X\n", + "failed at %llX\n", UnwindOp, IntegerAddress); goto Fail; } @@ -295,7 +295,7 @@ Routine Description: &FloatingRegister[OpInfo].Low, sizeof(ULONG64))) != S_OK) { m_Services->Status(1, "Prol: Op %X memory read " - "failed at %I64X\n", + "failed at %llX\n", UnwindOp, FloatingAddress); goto Fail; } @@ -319,7 +319,7 @@ Routine Description: &FloatingRegister[OpInfo].Low, sizeof(ULONG64))) != S_OK) { m_Services->Status(1, "Prol: Op %X memory read " - "failed at %I64X\n", + "failed at %llX\n", UnwindOp, FloatingAddress); goto Fail; } @@ -341,7 +341,7 @@ Routine Description: &FloatingRegister[OpInfo], sizeof(AMD64_M128))) != S_OK) { m_Services->Status(1, "Prol: Op %X memory read " - "failed at %I64X\n", + "failed at %llX\n", UnwindOp, FloatingAddress); goto Fail; } @@ -364,7 +364,7 @@ Routine Description: &FloatingRegister[OpInfo], sizeof(AMD64_M128))) != S_OK) { m_Services->Status(1, "Prol: Op %X memory read " - "failed at %I64X\n", + "failed at %llX\n", UnwindOp, FloatingAddress); goto Fail; } @@ -395,7 +395,7 @@ Routine Description: &ContextRecord->Rip, sizeof(ULONG64))) != S_OK) { m_Services->Status(1, "Prol: Op %X memory " - "read 1 failed at %I64X\n", + "read 1 failed at %llX\n", UnwindOp, ReturnAddress); goto Fail; } @@ -404,7 +404,7 @@ Routine Description: &ContextRecord->Rsp, sizeof(ULONG64))) != S_OK) { m_Services->Status(1, "Prol: Op %X memory " - "read 2 failed at %I64X\n", + "read 2 failed at %llX\n", UnwindOp, StackAddress); goto Fail; } @@ -480,7 +480,7 @@ Routine Description: ChainEntry = (_PIMAGE_RUNTIME_FUNCTION_ENTRY) &UnwindInfo->UnwindCode[Index]; - m_Services->Status(1, " Chain with entry at %I64X\n", + m_Services->Status(1, " Chain with entry at %llX\n", FunctionEntry->UnwindInfoAddress + ImageBase + (ULONG64)((PUCHAR)&UnwindInfo->UnwindCode[Index] - (PUCHAR)UnwindInfo)); @@ -507,7 +507,7 @@ Routine Description: ContextRecord->Rsp += 8; } - m_Services->Status(1, "Prol: Returning with RIP %I64X, RSP %I64X\n", + m_Services->Status(1, "Prol: Returning with RIP %llX, RSP %llX\n", ContextRecord->Rip, ContextRecord->Rsp); return S_OK; } @@ -660,7 +660,7 @@ Routine Description: if ((Status = m_Services-> ReadMemory(ControlPc, InstrBuffer, sizeof(InstrBuffer), &InstrBytes)) != S_OK) { - m_Services->Status(1, "Unable to read instruction stream at %I64X\n", + m_Services->Status(1, "Unable to read instruction stream at %llX\n", ControlPc); // We need the code to look for epilogue ops. @@ -966,7 +966,7 @@ Routine Description: ReadAllMemory(ContextRecord->Rsp, &IntegerRegister[RegisterNumber], sizeof(ULONG64))) != S_OK) { - m_Services->Status(1, "Unable to read stack at %I64X\n", + m_Services->Status(1, "Unable to read stack at %llX\n", ContextRecord->Rsp); return Status; } @@ -987,7 +987,7 @@ Routine Description: ReadAllMemory(ContextRecord->Rsp, &IntegerRegister[RegisterNumber], sizeof(ULONG64))) != S_OK) { - m_Services->Status(1, "Unable to read stack at %I64X\n", + m_Services->Status(1, "Unable to read stack at %llX\n", ContextRecord->Rsp); return Status; } @@ -1011,7 +1011,7 @@ Routine Description: ReadAllMemory(ContextRecord->Rsp, &ContextRecord->Rip, sizeof(ULONG64))) != S_OK) { - m_Services->Status(1, "Unable to read stack at %I64X\n", + m_Services->Status(1, "Unable to read stack at %llX\n", ContextRecord->Rsp); return Status; } @@ -1467,7 +1467,7 @@ DbsX64StackUnwinder::BaseUnwind(void) // directly to the return address. // - m_Services->Status(1, "Leaf %I64X RSP %I64X\n", + m_Services->Status(1, "Leaf %llX RSP %llX\n", m_Context.Rip, m_Context.Rsp); if ((Status = m_Services-> diff --git a/src/coreclr/utilcode/debug.cpp b/src/coreclr/utilcode/debug.cpp index eadce8075bdaf4..dfc323744363c0 100644 --- a/src/coreclr/utilcode/debug.cpp +++ b/src/coreclr/utilcode/debug.cpp @@ -265,9 +265,9 @@ bool _DbgBreakCheck( OutputDebugStringUtf8("\n"); OutputDebugStringUtf8(szExpr); OutputDebugStringUtf8("\n"); - printf(szLowMemoryAssertMessage); + printf("%s", szLowMemoryAssertMessage); printf("\n"); - printf(szFile); + printf("%s", szFile); printf("\n"); printf("%s", szExpr); printf("\n"); @@ -524,7 +524,7 @@ void DECLSPEC_NORETURN __FreeBuildAssertFail(const char *szFile, int iLine, cons OutputDebugStringUtf8(buffer.GetUTF8()); // Write out the error to the console - printf(buffer.GetUTF8()); + printf("%s", buffer.GetUTF8()); // Log to the stress log. Note that we can't include the szExpr b/c that // may not be a string literal (particularly for formatt-able asserts). diff --git a/src/coreclr/utilcode/executableallocator.cpp b/src/coreclr/utilcode/executableallocator.cpp index 078800995d1334..dbaf2f52ebac2f 100644 --- a/src/coreclr/utilcode/executableallocator.cpp +++ b/src/coreclr/utilcode/executableallocator.cpp @@ -81,15 +81,15 @@ void ExecutableAllocator::DumpHolderUsage() LARGE_INTEGER freq; QueryPerformanceFrequency(&freq); - fprintf(stderr, "Map time with lock sum: %I64dms\n", g_mapTimeWithLockSum / (freq.QuadPart / 1000)); - fprintf(stderr, "Map time sum: %I64dms\n", g_mapTimeSum / (freq.QuadPart / 1000)); - fprintf(stderr, "Map find RX time sum: %I64dms\n", g_mapFindRXTimeSum / (freq.QuadPart / 1000)); - fprintf(stderr, "Map create time sum: %I64dms\n", g_mapCreateTimeSum / (freq.QuadPart / 1000)); - fprintf(stderr, "Unmap time with lock sum: %I64dms\n", g_unmapTimeWithLockSum / (freq.QuadPart / 1000)); - fprintf(stderr, "Unmap time sum: %I64dms\n", g_unmapTimeSum / (freq.QuadPart / 1000)); - - fprintf(stderr, "Reserve count: %I64d\n", g_reserveCount); - fprintf(stderr, "Release count: %I64d\n", g_releaseCount); + fprintf(stderr, "Map time with lock sum: %lldms\n", g_mapTimeWithLockSum / (freq.QuadPart / 1000)); + fprintf(stderr, "Map time sum: %lldms\n", g_mapTimeSum / (freq.QuadPart / 1000)); + fprintf(stderr, "Map find RX time sum: %lldms\n", g_mapFindRXTimeSum / (freq.QuadPart / 1000)); + fprintf(stderr, "Map create time sum: %lldms\n", g_mapCreateTimeSum / (freq.QuadPart / 1000)); + fprintf(stderr, "Unmap time with lock sum: %lldms\n", g_unmapTimeWithLockSum / (freq.QuadPart / 1000)); + fprintf(stderr, "Unmap time sum: %lldms\n", g_unmapTimeSum / (freq.QuadPart / 1000)); + + fprintf(stderr, "Reserve count: %lld\n", g_reserveCount); + fprintf(stderr, "Release count: %lld\n", g_releaseCount); fprintf(stderr, "ExecutableWriterHolder usage:\n"); diff --git a/src/coreclr/utilcode/loaderheap.cpp b/src/coreclr/utilcode/loaderheap.cpp index c2514efe39b6ee..56da111506a34d 100644 --- a/src/coreclr/utilcode/loaderheap.cpp +++ b/src/coreclr/utilcode/loaderheap.cpp @@ -1997,7 +1997,7 @@ void UnlockedLoaderHeap::DumpFreeList() } } - printf("Addr = %pxh, Size = %lxh", pBlock, ((ULONG)dwsize)); + printf("Addr = %pxh, Size = %xh", pBlock, ((ULONG)dwsize)); if (ccbad) printf(" *** ERROR: NOT CC'd ***"); if (sizeunaligned) printf(" *** ERROR: size not a multiple of ALLOC_ALIGN_CONSTANT ***"); printf("\n"); diff --git a/src/coreclr/vm/clrex.cpp b/src/coreclr/vm/clrex.cpp index 645687b28f5c6e..a8440f3f927a86 100644 --- a/src/coreclr/vm/clrex.cpp +++ b/src/coreclr/vm/clrex.cpp @@ -1136,8 +1136,8 @@ void EEResourceException::GetMessage(SString &result) // since we don't want to call managed code here. // - result.Printf("%s (message resource %S)", - CoreLibBinder::GetExceptionName(m_kind), m_resourceName.GetUnicode()); + result.Printf("%s (message resource %s)", + CoreLibBinder::GetExceptionName(m_kind), m_resourceName.GetUTF8()); } BOOL EEResourceException::GetThrowableMessage(SString &result) diff --git a/src/coreclr/vm/comutilnative.cpp b/src/coreclr/vm/comutilnative.cpp index dbe8bc0b7c3bcd..99e51aae7397ea 100644 --- a/src/coreclr/vm/comutilnative.cpp +++ b/src/coreclr/vm/comutilnative.cpp @@ -1279,7 +1279,7 @@ void GCInterface::AddMemoryPressure(UINT64 bytesAllocated) UINT64 add = m_addPressure[0] + m_addPressure[1] + m_addPressure[2] + m_addPressure[3] - m_addPressure[p]; UINT64 rem = m_remPressure[0] + m_remPressure[1] + m_remPressure[2] + m_remPressure[3] - m_remPressure[p]; - STRESS_LOG4(LF_GCINFO, LL_INFO10000, "AMP Add: %I64u => added=%I64u total_added=%I64u total_removed=%I64u", + STRESS_LOG4(LF_GCINFO, LL_INFO10000, "AMP Add: %llu => added=%llu total_added=%llu total_removed=%llu", bytesAllocated, newMemValue, add, rem); SendEtwAddMemoryPressureEvent(bytesAllocated); @@ -1321,7 +1321,7 @@ void GCInterface::AddMemoryPressure(UINT64 bytesAllocated) // last check - if we would exceed 20% of GC "duty cycle", do not trigger GC at this time if ((size_t)(pGCHeap->GetNow() - pGCHeap->GetLastGCStartTime(2)) > (pGCHeap->GetLastGCDuration(2) * 5)) { - STRESS_LOG6(LF_GCINFO, LL_INFO10000, "AMP Budget: pressure=%I64u ? budget=%I64u (total_added=%I64u, total_removed=%I64u, mng_heap=%I64u) pos=%d", + STRESS_LOG6(LF_GCINFO, LL_INFO10000, "AMP Budget: pressure=%llu ? budget=%llu (total_added=%llu, total_removed=%llu, mng_heap=%llu) pos=%d", newMemValue, budget, add, rem, heapOver3 * 3, m_iteration); GarbageCollectModeAny(2); @@ -1360,7 +1360,7 @@ void GCInterface::RemoveMemoryPressure(UINT64 bytesAllocated) InterlockedAdd(&m_remPressure[p], bytesAllocated); - STRESS_LOG2(LF_GCINFO, LL_INFO10000, "AMP Remove: %I64u => removed=%I64u", + STRESS_LOG2(LF_GCINFO, LL_INFO10000, "AMP Remove: %llu => removed=%llu", bytesAllocated, m_remPressure[p]); } diff --git a/src/coreclr/vm/eedbginterfaceimpl.cpp b/src/coreclr/vm/eedbginterfaceimpl.cpp index 6dfeb8b46f57bb..313f240ede1903 100644 --- a/src/coreclr/vm/eedbginterfaceimpl.cpp +++ b/src/coreclr/vm/eedbginterfaceimpl.cpp @@ -1230,7 +1230,7 @@ bool EEDbgInterfaceImpl::TraceFrame(Thread *thread, SUPPRESS_ALLOCATION_ASSERTS_IN_THIS_SCOPE; FAULT_NOT_FATAL(); SString buffer; - StubManager::DbgWriteLog(" td=%S\n", trace->DbgToString(buffer)); + StubManager::DbgWriteLog(" td=%s\n", trace->DbgToString(buffer)); } else { @@ -1276,7 +1276,7 @@ bool EEDbgInterfaceImpl::TraceManager(Thread *thread, // Should never be on helper thread FAULT_NOT_FATAL(); SString buffer; - StubManager::DbgWriteLog(" td=%S\n", trace->DbgToString(buffer)); + StubManager::DbgWriteLog(" td=%s\n", trace->DbgToString(buffer)); } else { diff --git a/src/coreclr/vm/gcheaputilities.cpp b/src/coreclr/vm/gcheaputilities.cpp index 817179eb2f017f..a7e96f23573af3 100644 --- a/src/coreclr/vm/gcheaputilities.cpp +++ b/src/coreclr/vm/gcheaputilities.cpp @@ -168,8 +168,9 @@ HMODULE LoadStandaloneGc(LPCWSTR libFileName) PathString libPath = GetInternalSystemDirectory(); libPath.Append(libFileName); + LOG((LF_GC, LL_INFO100, "Loading standalone GC from path %s\n", libPath.GetUTF8())); + LPCWSTR libraryName = libPath.GetUnicode(); - LOG((LF_GC, LL_INFO100, "Loading standalone GC from path %S\n", libraryName)); return CLRLoadLibrary(libraryName); } #endif // FEATURE_STANDALONE_GC diff --git a/src/coreclr/vm/generics.cpp b/src/coreclr/vm/generics.cpp index aed942fb78a995..1ccf8128445a1a 100644 --- a/src/coreclr/vm/generics.cpp +++ b/src/coreclr/vm/generics.cpp @@ -185,7 +185,7 @@ ClassLoader::CreateTypeHandleForNonCanonicalGenericInstantiation( { StackSString debugTypeKeyName; TypeString::AppendTypeKeyDebug(debugTypeKeyName, pTypeKey); - LOG((LF_CLASSLOADER, LL_INFO1000, "GENERICS: New instantiation requested: %S\n", debugTypeKeyName.GetUnicode())); + LOG((LF_CLASSLOADER, LL_INFO1000, "GENERICS: New instantiation requested: %s\n", debugTypeKeyName.GetUTF8())); if (g_pConfig->ShouldBreakOnInstantiation(debugTypeKeyName.GetUTF8())) CONSISTENCY_CHECK_MSGF(false, ("BreakOnInstantiation: typename '%s' ", debugTypeKeyName.GetUTF8())); diff --git a/src/coreclr/vm/genmeth.cpp b/src/coreclr/vm/genmeth.cpp index da38d13e1d624e..44f99a84c24fe7 100644 --- a/src/coreclr/vm/genmeth.cpp +++ b/src/coreclr/vm/genmeth.cpp @@ -380,8 +380,8 @@ InstantiatedMethodDesc::NewInstantiatedMethodDesc(MethodTable *pExactMT, TypeString::AppendMethodDebug(name, pGenericMDescInRepMT); DWORD dictionarySlotSize; DWORD dictionaryAllocSize = DictionaryLayout::GetDictionarySizeFromLayout(pGenericMDescInRepMT->GetNumGenericMethodArgs(), pDL, &dictionarySlotSize); - LOG((LF_JIT, LL_INFO1000, "GENERICS: Created new dictionary layout for dictionary of slot size %d / alloc size %d for %S\n", - dictionarySlotSize, dictionaryAllocSize, name.GetUnicode())); + LOG((LF_JIT, LL_INFO1000, "GENERICS: Created new dictionary layout for dictionary of slot size %d / alloc size %d for %s\n", + dictionarySlotSize, dictionaryAllocSize, name.GetUTF8())); } #endif // _DEBUG } diff --git a/src/coreclr/vm/ildump.h b/src/coreclr/vm/ildump.h index 86a028355bde8f..c3e1b4ab842759 100644 --- a/src/coreclr/vm/ildump.h +++ b/src/coreclr/vm/ildump.h @@ -37,9 +37,9 @@ IL_OPCODE(0x1d, "ldc.i4.7 ", 0, ILDUMP_VOID, "", 0) IL_OPCODE(0x1e, "ldc.i4.8 ", 0, ILDUMP_VOID, "", 0) IL_OPCODE(0x1f, "ldc.i4.s ", 1, BYTE, "%d", 0) IL_OPCODE(0x20, "ldc.i4 ", 4, UNALIGNED INT32, "0x%08x", 0) -IL_OPCODE(0x21, "ldc.i8 ", 8, UNALIGNED INT64, "0x%I64x", 0) +IL_OPCODE(0x21, "ldc.i8 ", 8, UNALIGNED INT64, "0x%llx", 0) IL_OPCODE(0x22, "ldc.r4 ", 4, UNALIGNED INT32, "0x%08x", 0) -IL_OPCODE(0x23, "ldc.r8 ", 8, UNALIGNED INT64, "0x%I64x", 0) +IL_OPCODE(0x23, "ldc.r8 ", 8, UNALIGNED INT64, "0x%llx", 0) IL_OPCODE(0x25, "dup ", 0, ILDUMP_VOID, "", 0) IL_OPCODE(0x26, "pop ", 0, ILDUMP_VOID, "", 0) IL_OPCODE(0x27, "jmp ", 4, UNALIGNED INT32, "0x%08x", 0) diff --git a/src/coreclr/vm/jitinterface.cpp b/src/coreclr/vm/jitinterface.cpp index 9c8d9cbe59c0b5..64bbc15f8e99e0 100644 --- a/src/coreclr/vm/jitinterface.cpp +++ b/src/coreclr/vm/jitinterface.cpp @@ -8174,15 +8174,15 @@ void CEEInfo::reportInliningDecision (CORINFO_METHOD_HANDLE inlinerHnd, if (dontInline(inlineResult)) { LOG((LF_JIT, LL_INFO100000, - "While compiling '%S', inline of '%S' into '%S' failed because: '%s'.\n", - currentMethodName.GetUnicode(), inlineeMethodName.GetUnicode(), - inlinerMethodName.GetUnicode(), reason)); + "While compiling '%s', inline of '%s' into '%s' failed because: '%s'.\n", + currentMethodName.GetUTF8(), inlineeMethodName.GetUTF8(), + inlinerMethodName.GetUTF8(), reason)); } else if(inlineResult == INLINE_PASS) { - LOG((LF_JIT, LL_INFO100000, "While compiling '%S', inline of '%S' into '%S' succeeded.\n", - currentMethodName.GetUnicode(), inlineeMethodName.GetUnicode(), - inlinerMethodName.GetUnicode())); + LOG((LF_JIT, LL_INFO100000, "While compiling '%s', inline of '%s' into '%s' succeeded.\n", + currentMethodName.GetUTF8(), inlineeMethodName.GetUTF8(), + inlinerMethodName.GetUTF8())); } } @@ -8419,9 +8419,9 @@ void CEEInfo::reportTailCallDecision (CORINFO_METHOD_HANDLE callerHnd, if (tailCallResult == TAILCALL_FAIL) { LOG((LF_JIT, LL_INFO100000, - "While compiling '%S', %Splicit tail call from '%S' to '%S' failed because: '%s'.\n", - currentMethodName.GetUnicode(), fIsTailPrefix ? W("ex") : W("im"), - callerMethodName.GetUnicode(), calleeMethodName.GetUnicode(), reason)); + "While compiling '%s', %splicit tail call from '%s' to '%s' failed because: '%s'.\n", + currentMethodName.GetUTF8(), fIsTailPrefix ? "ex" : "im", + callerMethodName.GetUTF8(), calleeMethodName.GetUTF8(), reason)); } else { @@ -8430,9 +8430,9 @@ void CEEInfo::reportTailCallDecision (CORINFO_METHOD_HANDLE callerHnd, }; _ASSERTE(tailCallResult >= 0 && (size_t)tailCallResult < ARRAY_SIZE(tailCallType)); LOG((LF_JIT, LL_INFO100000, - "While compiling '%S', %Splicit tail call from '%S' to '%S' generated as a %s.\n", - currentMethodName.GetUnicode(), fIsTailPrefix ? W("ex") : W("im"), - callerMethodName.GetUnicode(), calleeMethodName.GetUnicode(), tailCallType[tailCallResult])); + "While compiling '%s', %splicit tail call from '%s' to '%s' generated as a %s.\n", + currentMethodName.GetUTF8(), fIsTailPrefix ? "ex" : "im", + callerMethodName.GetUTF8(), calleeMethodName.GetUTF8(), tailCallType[tailCallResult])); } } @@ -13098,7 +13098,7 @@ PCODE UnsafeJitFunction(PrepareCodeConfig* config, if (LoggingOn(LF_JIT, LL_INFO10000)) TypeString::AppendMethodDebug(methodString, ftn); - LOG((LF_JIT, LL_INFO10000, "{ Jitting method (%p) %S %s\n", ftn, methodString.GetUnicode(), ftn->m_pszDebugMethodSignature)); + LOG((LF_JIT, LL_INFO10000, "{ Jitting method (%p) %s %s\n", ftn, methodString.GetUTF8(), ftn->m_pszDebugMethodSignature)); } #if 0 @@ -13133,7 +13133,7 @@ PCODE UnsafeJitFunction(PrepareCodeConfig* config, if (LoggingOn(LF_VERIFIER, LL_INFO100)) TypeString::AppendMethodDebug(methodString, ftn); - LOG((LF_VERIFIER, LL_INFO100, "{ Will verify method (%p) %S %s\n", ftn, methodString.GetUnicode(), ftn->m_pszDebugMethodSignature)); + LOG((LF_VERIFIER, LL_INFO100, "{ Will verify method (%p) %s %s\n", ftn, methodString.GetUTF8(), ftn->m_pszDebugMethodSignature)); } #endif //_DEBUG diff --git a/src/coreclr/vm/methodtable.cpp b/src/coreclr/vm/methodtable.cpp index d42d4e3efc1453..aee002516bda24 100644 --- a/src/coreclr/vm/methodtable.cpp +++ b/src/coreclr/vm/methodtable.cpp @@ -4771,7 +4771,7 @@ void MethodTable::DoFullyLoad(Generics::RecursionGraph * const pVisited, const { SString name; TypeString::AppendTypeDebug(name, this); - LOG((LF_CLASSLOADER, LL_INFO10000, "PHASEDLOAD: Completed full dependency load of type %S\n", name.GetUnicode())); + LOG((LF_CLASSLOADER, LL_INFO10000, "PHASEDLOAD: Completed full dependency load of type %s\n", name.GetUTF8())); } #endif diff --git a/src/coreclr/vm/methodtablebuilder.cpp b/src/coreclr/vm/methodtablebuilder.cpp index be4fee76f2f3f3..0adbf52d386553 100644 --- a/src/coreclr/vm/methodtablebuilder.cpp +++ b/src/coreclr/vm/methodtablebuilder.cpp @@ -1355,10 +1355,10 @@ MethodTableBuilder::BuildMethodTableThrowing( pszDebugName = (LPCUTF8)name; } - LOG((LF_CLASSLOADER, LL_INFO1000, "Loading class \"%s%s%S\" from module \"%ws\" in domain 0x%p %s\n", + LOG((LF_CLASSLOADER, LL_INFO1000, "Loading class \"%s%s%s\" from module \"%ws\" in domain 0x%p %s\n", *pszDebugNamespace ? pszDebugNamespace : "", *pszDebugNamespace ? NAMESPACE_SEPARATOR_STR : "", - debugName.GetUnicode(), + debugName.GetUTF8(), pModule->GetDebugName(), pModule->GetDomain(), (pModule->IsSystem()) ? "System Domain" : "" diff --git a/src/coreclr/vm/multicorejit.cpp b/src/coreclr/vm/multicorejit.cpp index 754d4e9297696a..3526ef15c7bb6d 100644 --- a/src/coreclr/vm/multicorejit.cpp +++ b/src/coreclr/vm/multicorejit.cpp @@ -155,7 +155,7 @@ HRESULT MulticoreJitRecorder::WriteOutput() { CFileStream fileStream; - if (SUCCEEDED(hr = fileStream.OpenForWrite(m_fullFileName))) + if (SUCCEEDED(hr = fileStream.OpenForWrite(m_fullFileName.GetUnicode()))) { hr = WriteOutput(& fileStream); } diff --git a/src/coreclr/vm/nativeimage.cpp b/src/coreclr/vm/nativeimage.cpp index 1bfd266164bcaf..0844ca510f314f 100644 --- a/src/coreclr/vm/nativeimage.cpp +++ b/src/coreclr/vm/nativeimage.cpp @@ -67,7 +67,7 @@ void NativeImage::Initialize(READYTORUN_HEADER *pHeader, LoaderAllocator *pLoade m_pReadyToRunInfo = new ReadyToRunInfo(/*pModule*/ NULL, pLoaderAllocator, m_pImageLayout, pHeader, this, pamTracker); m_pComponentAssemblies = m_pReadyToRunInfo->FindSection(ReadyToRunSectionType::ComponentAssemblies); m_componentAssemblyCount = m_pComponentAssemblies->Size / sizeof(READYTORUN_COMPONENT_ASSEMBLIES_ENTRY); - + // Check if the current module's image has native manifest metadata, otherwise the current->GetNativeAssemblyImport() asserts. m_pManifestMetadata = LoadManifestMetadata(); @@ -82,12 +82,12 @@ void NativeImage::Initialize(READYTORUN_HEADER *pHeader, LoaderAllocator *pLoade m_assemblySimpleNameToIndexMap.Add(AssemblyNameIndex(assemblyName, m_manifestAssemblyCount)); m_manifestAssemblyCount++; } - + // When a composite image contributes to a larger version bubble, its manifest assembly // count may exceed its component assembly count as it may contain references to // assemblies outside of the composite image that are part of its version bubble. _ASSERTE(m_manifestAssemblyCount >= m_componentAssemblyCount); - + S_SIZE_T dwAllocSize = S_SIZE_T(sizeof(PTR_Assembly)) * S_SIZE_T(m_manifestAssemblyCount); // Note: Memory allocated on loader heap is zero filled @@ -195,7 +195,7 @@ NativeImage *NativeImage::Open( fullPath.Append(DIRECTORY_SEPARATOR_CHAR_W); fullPath += compositeImageFileName; - + EX_TRY { peLoadedImage = PEImageLayout::LoadNative(fullPath); @@ -212,9 +212,9 @@ NativeImage *NativeImage::Open( if (peLoadedImage.IsNull()) { // Failed to locate the native composite R2R image - LOG((LF_LOADER, LL_ALWAYS, "LOADER: failed to load native image '%s' for component assembly '%S' using search paths: '%S'\n", + LOG((LF_LOADER, LL_ALWAYS, "LOADER: failed to load native image '%s' for component assembly '%s' using search paths: '%S'\n", nativeImageFileName, - path.GetUnicode(), + path.GetUTF8(), searchPathsConfig != nullptr ? searchPathsConfig : W(""))); RaiseFailFastException(nullptr, nullptr, 0); } diff --git a/src/coreclr/vm/pendingload.cpp b/src/coreclr/vm/pendingload.cpp index 1bc384befab56c..ddfad3fb792a12 100644 --- a/src/coreclr/vm/pendingload.cpp +++ b/src/coreclr/vm/pendingload.cpp @@ -217,7 +217,7 @@ void PendingTypeLoadTable::Dump() SString name; TypeKey entryTypeKey = pSearch->pData->GetTypeKey(); TypeString::AppendTypeKeyDebug(name, &entryTypeKey); - LOG((LF_CLASSLOADER, LL_INFO10000, " Entry %S with handle %p at level %s\n", name.GetUnicode(), pSearch->pData->m_typeHandle.AsPtr(), + LOG((LF_CLASSLOADER, LL_INFO10000, " Entry %s with handle %p at level %s\n", name.GetUTF8(), pSearch->pData->m_typeHandle.AsPtr(), pSearch->pData->m_typeHandle.IsNull() ? "not-applicable" : classLoadLevelName[pSearch->pData->m_typeHandle.GetLoadLevel()])); } } diff --git a/src/coreclr/vm/perfinfo.cpp b/src/coreclr/vm/perfinfo.cpp index 85e44ac8668dac..0452f413f41d11 100644 --- a/src/coreclr/vm/perfinfo.cpp +++ b/src/coreclr/vm/perfinfo.cpp @@ -22,12 +22,12 @@ PerfInfo::PerfInfo(int pid) } SString path; - path.Printf("%Sperfinfo-%d.map", tempPath.GetUnicode(), pid); + path.Printf("%sperfinfo-%d.map", tempPath.GetUTF8(), pid); OpenFile(path); } // Logs image loads into the process' perfinfo-%d.map file -void PerfInfo::LogImage(PEAssembly* pPEAssembly, WCHAR* guid) +void PerfInfo::LogImage(PEAssembly* pPEAssembly, CHAR* guid) { CONTRACTL { @@ -55,7 +55,7 @@ void PerfInfo::LogImage(PEAssembly* pPEAssembly, WCHAR* guid) } } - value.Printf("%S%c%S%c%p", path.GetUnicode(), sDelimiter, guid, sDelimiter, baseAddr); + value.Printf("%s%c%s%c%p", path.GetUTF8(), sDelimiter, guid, sDelimiter, baseAddr); SString command; command.Printf("%s", "ImageLoad"); @@ -80,8 +80,8 @@ void PerfInfo::WriteLine(SString& type, SString& value) } SString line; - line.Printf("%S%c%S%c\n", - type.GetUnicode(), sDelimiter, value.GetUnicode(), sDelimiter); + line.Printf("%s%c%s%c\n", + type.GetUTF8(), sDelimiter, value.GetUTF8(), sDelimiter); EX_TRY { diff --git a/src/coreclr/vm/perfinfo.h b/src/coreclr/vm/perfinfo.h index 16b06865925c64..02624008af66f3 100644 --- a/src/coreclr/vm/perfinfo.h +++ b/src/coreclr/vm/perfinfo.h @@ -22,7 +22,7 @@ class PerfInfo { public: PerfInfo(int pid); ~PerfInfo(); - void LogImage(PEAssembly* pPEAssembly, WCHAR* guid); + void LogImage(PEAssembly* pPEAssembly, CHAR* guid); private: CFileStream* m_Stream; diff --git a/src/coreclr/vm/perfmap.cpp b/src/coreclr/vm/perfmap.cpp index 62872b67e42377..b68cffad7bc73d 100644 --- a/src/coreclr/vm/perfmap.cpp +++ b/src/coreclr/vm/perfmap.cpp @@ -244,10 +244,10 @@ void PerfMap::LogImage(PEAssembly * pPEAssembly) EX_TRY { - WCHAR wszSignature[39]; - GetNativeImageSignature(pPEAssembly, wszSignature, ARRAY_SIZE(wszSignature)); + CHAR szSignature[GUID_STR_BUFFER_LEN]; + GetNativeImageSignature(pPEAssembly, szSignature, ARRAY_SIZE(szSignature)); - m_PerfInfo->LogImage(pPEAssembly, wszSignature); + m_PerfInfo->LogImage(pPEAssembly, szSignature); } EX_CATCH{} EX_END_CATCH(SwallowAllExceptions); } @@ -356,21 +356,21 @@ void PerfMap::LogStubs(const char* stubType, const char* stubOwner, PCODE pCode, EX_CATCH{} EX_END_CATCH(SwallowAllExceptions); } -void PerfMap::GetNativeImageSignature(PEAssembly * pPEAssembly, WCHAR * pwszSig, unsigned int nSigSize) +void PerfMap::GetNativeImageSignature(PEAssembly * pPEAssembly, CHAR * pszSig, unsigned int nSigSize) { CONTRACTL{ PRECONDITION(pPEAssembly != nullptr); - PRECONDITION(pwszSig != nullptr); - PRECONDITION(nSigSize >= 39); + PRECONDITION(pszSig != nullptr); + PRECONDITION(nSigSize >= GUID_STR_BUFFER_LEN); } CONTRACTL_END; // We use the MVID as the signature, since ready to run images // don't have a native image signature. GUID mvid; pPEAssembly->GetMVID(&mvid); - if(!GuidToLPWSTR(mvid, pwszSig, nSigSize)) + if(!GuidToLPSTR(mvid, pszSig, nSigSize)) { - pwszSig[0] = '\0'; + pszSig[0] = '\0'; } } @@ -387,13 +387,13 @@ NativeImagePerfMap::NativeImagePerfMap(Assembly * pAssembly, BSTR pDestPath) // Get the native image signature (GUID). // Used to ensure that we match symbols to the correct NGEN image. - WCHAR wszSignature[39]; - GetNativeImageSignature(pAssembly->GetPEAssembly(), wszSignature, ARRAY_SIZE(wszSignature)); + CHAR szSignature[GUID_STR_BUFFER_LEN]; + GetNativeImageSignature(pAssembly->GetPEAssembly(), szSignature, ARRAY_SIZE(szSignature)); // Build the path to the perfmap file, which consists of .ni..map. // Example: /tmp/System.Private.CoreLib.ni.{GUID}.map SString sDestPerfMapPath; - sDestPerfMapPath.Printf("%S%s.ni.%S.map", pDestPath, lpcSimpleName, wszSignature); + sDestPerfMapPath.Printf("%S%s.ni.%s.map", pDestPath, lpcSimpleName, szSignature); // Open the perf map file. OpenFile(sDestPerfMapPath); diff --git a/src/coreclr/vm/perfmap.h b/src/coreclr/vm/perfmap.h index 587a776e682760..b04568341ecab4 100644 --- a/src/coreclr/vm/perfmap.h +++ b/src/coreclr/vm/perfmap.h @@ -60,7 +60,7 @@ class PerfMap void LogImage(PEAssembly * pPEAssembly); // Get the image signature and store it as a string. - static void GetNativeImageSignature(PEAssembly * pPEAssembly, WCHAR * pwszSig, unsigned int nSigSize); + static void GetNativeImageSignature(PEAssembly * pPEAssembly, CHAR * pszSig, unsigned int nSigSize); public: // Initialize the map for the current process. diff --git a/src/coreclr/vm/qcall.h b/src/coreclr/vm/qcall.h index ab5e4b4cb2b2ef..c8c890f438831e 100644 --- a/src/coreclr/vm/qcall.h +++ b/src/coreclr/vm/qcall.h @@ -95,7 +95,7 @@ // COMPlusThrow(kArgumentException, L"InvalidFlags"); // // // No need to worry about GC moving strings passed into QCall. Marshaling pins them for us. -// printf("%S", wszString); +// wprintf("%s", wszString); // // // This is the most efficient way to return strings back to managed code. No need to use StringBuilder. // retString.Set(L"Hello"); diff --git a/src/coreclr/vm/readytoruninfo.cpp b/src/coreclr/vm/readytoruninfo.cpp index 2284a9f0e7d456..aad72b92ef1e22 100644 --- a/src/coreclr/vm/readytoruninfo.cpp +++ b/src/coreclr/vm/readytoruninfo.cpp @@ -429,7 +429,7 @@ static void LogR2r(const char *msg, PEAssembly *pPEAssembly) if (r2rLogFile == NULL) return; - fprintf(r2rLogFile, "%s: \"%S\".\n", msg, pPEAssembly->GetPath().GetUnicode()); + fprintf(r2rLogFile, "%s: \"%s\".\n", msg, pPEAssembly->GetPath().GetUTF8()); fflush(r2rLogFile); } diff --git a/src/coreclr/vm/stublink.cpp b/src/coreclr/vm/stublink.cpp index 7111f83653583f..58048bfb1ab8c2 100644 --- a/src/coreclr/vm/stublink.cpp +++ b/src/coreclr/vm/stublink.cpp @@ -2465,15 +2465,15 @@ VOID ArgBasedStubCache::Dump() CONTRACTL_END; printf("--------------------------------------------------------------\n"); - printf("ArgBasedStubCache dump (%lu fixed entries):\n", m_numFixedSlots); + printf("ArgBasedStubCache dump (%u fixed entries):\n", m_numFixedSlots); for (UINT32 i = 0; i < m_numFixedSlots; i++) { - printf(" Fixed slot %lu: ", (ULONG)i); + printf(" Fixed slot %u: ", (ULONG)i); Stub *pStub = m_aStub[i]; if (!pStub) { printf("empty\n"); } else { - printf("%zxh - refcount is %lu\n", + printf("%zxh - refcount is %u\n", (size_t)(pStub->GetEntryPoint()), (ULONG)( *( ( ((ULONG*)(pStub->GetEntryPoint())) - 1)))); } @@ -2483,9 +2483,9 @@ VOID ArgBasedStubCache::Dump() pSlotEntry != NULL; pSlotEntry = pSlotEntry->m_pNext) { - printf(" Dyna. slot %lu: ", (ULONG)(pSlotEntry->m_key)); + printf(" Dyna. slot %u: ", (ULONG)(pSlotEntry->m_key)); Stub *pStub = pSlotEntry->m_pStub; - printf("%zxh - refcount is %lu\n", + printf("%zxh - refcount is %u\n", (size_t)(pStub->GetEntryPoint()), (ULONG)( *( ( ((ULONG*)(pStub->GetEntryPoint())) - 1)))); diff --git a/src/coreclr/vm/stubmgr.cpp b/src/coreclr/vm/stubmgr.cpp index 94bc431533055c..fcf9838e9e2355 100644 --- a/src/coreclr/vm/stubmgr.cpp +++ b/src/coreclr/vm/stubmgr.cpp @@ -53,7 +53,7 @@ void LogTraceDestination(const char * szHint, PCODE stubAddr, TraceDestination * #ifdef _DEBUG // Get a string representation of this TraceDestination // Uses the supplied buffer to store the memory (or may return a string literal). -const WCHAR * TraceDestination::DbgToString(SString & buffer) +const CHAR * TraceDestination::DbgToString(SString & buffer) { CONTRACTL { @@ -63,12 +63,12 @@ const WCHAR * TraceDestination::DbgToString(SString & buffer) } CONTRACTL_END; - const WCHAR * pValue = W("unknown"); + const CHAR * pValue = "unknown"; #ifndef DACCESS_COMPILE if (!StubManager::IsStubLoggingEnabled()) { - return W(""); + return ""; } // Now that we know we're not interop-debugging, we can safely call new. SUPPRESS_ALLOCATION_ASSERTS_IN_THIS_SCOPE; @@ -82,50 +82,50 @@ const WCHAR * TraceDestination::DbgToString(SString & buffer) { case TRACE_ENTRY_STUB: buffer.Printf("TRACE_ENTRY_STUB(addr=0x%p)", GetAddress()); - pValue = buffer.GetUnicode(); + pValue = buffer.GetUTF8(); break; case TRACE_STUB: buffer.Printf("TRACE_STUB(addr=0x%p)", GetAddress()); - pValue = buffer.GetUnicode(); + pValue = buffer.GetUTF8(); break; case TRACE_UNMANAGED: buffer.Printf("TRACE_UNMANAGED(addr=0x%p)", GetAddress()); - pValue = buffer.GetUnicode(); + pValue = buffer.GetUTF8(); break; case TRACE_MANAGED: buffer.Printf("TRACE_MANAGED(addr=0x%p)", GetAddress()); - pValue = buffer.GetUnicode(); + pValue = buffer.GetUTF8(); break; case TRACE_UNJITTED_METHOD: { MethodDesc * md = this->GetMethodDesc(); buffer.Printf("TRACE_UNJITTED_METHOD(md=0x%p, %s::%s)", md, md->m_pszDebugClassName, md->m_pszDebugMethodName); - pValue = buffer.GetUnicode(); + pValue = buffer.GetUTF8(); } break; case TRACE_FRAME_PUSH: buffer.Printf("TRACE_FRAME_PUSH(addr=0x%p)", GetAddress()); - pValue = buffer.GetUnicode(); + pValue = buffer.GetUTF8(); break; case TRACE_MGR_PUSH: buffer.Printf("TRACE_MGR_PUSH(addr=0x%p, sm=%s)", GetAddress(), this->GetStubManager()->DbgGetName()); - pValue = buffer.GetUnicode(); + pValue = buffer.GetUTF8(); break; case TRACE_OTHER: - pValue = W("TRACE_OTHER"); + pValue = "TRACE_OTHER"; break; } } EX_CATCH { - pValue = W("(OOM while printing TD)"); + pValue = "(OOM while printing TD)"; } EX_END_CATCH(SwallowAllExceptions); #endif @@ -542,7 +542,7 @@ BOOL StubManager::TraceStub(PCODE stubStartAddress, TraceDestination *trace) SUPPRESS_ALLOCATION_ASSERTS_IN_THIS_SCOPE; FAULT_NOT_FATAL(); SString buffer; - DbgWriteLog(" td=%S\n", trace->DbgToString(buffer)); + DbgWriteLog(" td=%s\n", trace->DbgToString(buffer)); } else { diff --git a/src/coreclr/vm/stubmgr.h b/src/coreclr/vm/stubmgr.h index 719db338443627..49e2e837704765 100644 --- a/src/coreclr/vm/stubmgr.h +++ b/src/coreclr/vm/stubmgr.h @@ -86,7 +86,7 @@ class TraceDestination // Get a string representation of this TraceDestination // Uses the supplied buffer to store the memory (or may return a string literal). // This will also print the TD's arguments. - const WCHAR * DbgToString(SString &buffer); + const CHAR * DbgToString(SString &buffer); #endif // Initialize for unmanaged code. diff --git a/src/coreclr/vm/typehandle.cpp b/src/coreclr/vm/typehandle.cpp index 88dce11a4fc172..e3834add43d654 100644 --- a/src/coreclr/vm/typehandle.cpp +++ b/src/coreclr/vm/typehandle.cpp @@ -1561,50 +1561,50 @@ CHECK TypeHandle::CheckMatchesKey(TypeKey *pKey) const { MethodTable *pMT = AsMethodTable(); CHECK_MSGF(pMT->GetInternalCorElementType() == pKey->GetKind(), - ("CorElementType %d of Array MethodTable does not match key %S", pMT->GetArrayElementType(), typeKeyString.GetUnicode())); + ("CorElementType %d of Array MethodTable does not match key %s", pMT->GetArrayElementType(), typeKeyString.GetUTF8())); CHECK_MSGF(pMT->GetArrayElementTypeHandle() == pKey->GetElementType(), - ("Element type of Array MethodTable does not match key %S",typeKeyString.GetUnicode())); + ("Element type of Array MethodTable does not match key %s",typeKeyString.GetUTF8())); CHECK_MSGF(pMT->GetRank() == pKey->GetRank(), - ("Rank %d of Array MethodTable does not match key %S", pMT->GetRank(), typeKeyString.GetUnicode())); + ("Rank %d of Array MethodTable does not match key %s", pMT->GetRank(), typeKeyString.GetUTF8())); } else if (IsTypeDesc()) { TypeDesc *pTD = AsTypeDesc(); CHECK_MSGF(pTD->GetInternalCorElementType() == pKey->GetKind(), - ("CorElementType %d of TypeDesc does not match key %S", pTD->GetInternalCorElementType(), typeKeyString.GetUnicode())); + ("CorElementType %d of TypeDesc does not match key %s", pTD->GetInternalCorElementType(), typeKeyString.GetUTF8())); if (CorTypeInfo::IsModifier(pKey->GetKind())) { CHECK_MSGF(pTD->GetTypeParam() == pKey->GetElementType(), - ("Element type of TypeDesc does not match key %S",typeKeyString.GetUnicode())); + ("Element type of TypeDesc does not match key %s",typeKeyString.GetUTF8())); } } else { MethodTable *pMT = AsMethodTable(); - CHECK_MSGF(pMT->GetModule() == pKey->GetModule(), ("Module of MethodTable does not match key %S", typeKeyString.GetUnicode())); + CHECK_MSGF(pMT->GetModule() == pKey->GetModule(), ("Module of MethodTable does not match key %s", typeKeyString.GetUTF8())); CHECK_MSGF(pMT->GetCl() == pKey->GetTypeToken(), - ("TypeDef %x of Methodtable does not match TypeDef %x of key %S", pMT->GetCl(), pKey->GetTypeToken(), - typeKeyString.GetUnicode())); + ("TypeDef %x of Methodtable does not match TypeDef %x of key %s", pMT->GetCl(), pKey->GetTypeToken(), + typeKeyString.GetUTF8())); if (pMT->IsTypicalTypeDefinition()) { CHECK_MSGF(pKey->GetNumGenericArgs() == 0 && !pKey->HasInstantiation(), - ("Key %S for Typical MethodTable has non-zero number of generic arguments", typeKeyString.GetUnicode())); + ("Key %s for Typical MethodTable has non-zero number of generic arguments", typeKeyString.GetUTF8())); } else { CHECK_MSGF(pMT->GetNumGenericArgs() == pKey->GetNumGenericArgs(), - ("Number of generic params %d in MethodTable does not match key %S", pMT->GetNumGenericArgs(), typeKeyString.GetUnicode())); + ("Number of generic params %d in MethodTable does not match key %s", pMT->GetNumGenericArgs(), typeKeyString.GetUTF8())); if (pKey->HasInstantiation()) { for (DWORD i = 0; i < pMT->GetNumGenericArgs(); i++) { CHECK_MSGF(pMT->GetInstantiation()[i] == pKey->GetInstantiation()[i], - ("Generic argument %d in MethodTable does not match key %S", i, typeKeyString.GetUnicode())); + ("Generic argument %d in MethodTable does not match key %s", i, typeKeyString.GetUTF8())); } } } diff --git a/src/mono/dlls/dbgshim/dbgshim.cpp b/src/mono/dlls/dbgshim/dbgshim.cpp index 255626f9ee49aa..8140f1f0525589 100644 --- a/src/mono/dlls/dbgshim/dbgshim.cpp +++ b/src/mono/dlls/dbgshim/dbgshim.cpp @@ -191,21 +191,6 @@ HRESULT CreateCoreDbg(HMODULE hDBIModule, DWORD processId, int iDebuggerVersion, return hr; } -char* convertC(const WCHAR * wString) -{ - int size; - char * MultiBuffer = NULL; - - size = WideCharToMultiByte(CP_ACP,0,wString,-1,MultiBuffer,0,NULL,NULL); - MultiBuffer = (char*) malloc(size); - if (MultiBuffer == NULL) - { - return NULL; - } - WideCharToMultiByte(CP_ACP,0,wString,-1,MultiBuffer,size,NULL,NULL); - return MultiBuffer; -} - static IUnknown* pCordb = NULL; MONO_API HRESULT diff --git a/src/mono/mono/utils/mono-mmap-windows.c b/src/mono/mono/utils/mono-mmap-windows.c index 034e44aa006093..7f04666b4a4230 100644 --- a/src/mono/mono/utils/mono-mmap-windows.c +++ b/src/mono/mono/utils/mono-mmap-windows.c @@ -250,7 +250,7 @@ mono_file_map_error (size_t length, int flags, int fd, guint64 offset, void **re CloseHandle (mapping); if (error_message) { gchar *win32_error_string = format_win32_error_string (win32_error); - *error_message = g_strdup_printf ("%s failed file:%s length:0x%IX offset:0x%I64X function:%s error:%s(0x%X)\n", + *error_message = g_strdup_printf ("%s failed file:%s length:0x%zX offset:0x%llX function:%s error:%s(0x%X)\n", __func__, filepath ? filepath : "", length, offset, failed_function, win32_error_string, win32_error); g_free (win32_error_string); }