@@ -49,11 +49,11 @@ void MethodStatsEmitter::Emit(int methodNumber, MethodContext* mc, ULONGLONG fir
4949 if (mc->dumpMethodMD5HashToBuffer (md5Hash, MD5_HASH_BUFFER_SIZE) != MD5_HASH_BUFFER_SIZE)
5050 md5Hash[0 ] = 0 ;
5151
52- charCount += sprintf_s (rowData + charCount, _countof (rowData) - charCount, " %s," , md5Hash);
52+ charCount += sprintf_s (rowData + charCount, ARRAY_SIZE (rowData) - charCount, " %s," , md5Hash);
5353 }
5454 if (strchr (statsTypes, ' *' ) != NULL || strchr (statsTypes, ' n' ) != NULL || strchr (statsTypes, ' N' ) != NULL )
5555 {
56- charCount += sprintf_s (rowData + charCount, _countof (rowData) - charCount, " %d," , methodNumber);
56+ charCount += sprintf_s (rowData + charCount, ARRAY_SIZE (rowData) - charCount, " %d," , methodNumber);
5757 }
5858 if (strchr (statsTypes, ' *' ) != NULL || strchr (statsTypes, ' i' ) != NULL || strchr (statsTypes, ' I' ) != NULL )
5959 {
@@ -63,7 +63,7 @@ void MethodStatsEmitter::Emit(int methodNumber, MethodContext* mc, ULONGLONG fir
6363 CORINFO_OS os = CORINFO_WINNT;
6464 mc->repCompileMethod (&info, &flags, &os);
6565
66- charCount += sprintf_s (rowData + charCount, _countof (rowData) - charCount, " %d," , info.ILCodeSize );
66+ charCount += sprintf_s (rowData + charCount, ARRAY_SIZE (rowData) - charCount, " %d," , info.ILCodeSize );
6767 }
6868 if (strchr (statsTypes, ' *' ) != NULL || strchr (statsTypes, ' a' ) != NULL || strchr (statsTypes, ' A' ) != NULL )
6969 {
@@ -76,12 +76,12 @@ void MethodStatsEmitter::Emit(int methodNumber, MethodContext* mc, ULONGLONG fir
7676 else
7777 codeSize = 0 ; // this is likely a thin mc
7878
79- charCount += sprintf_s (rowData + charCount, _countof (rowData) - charCount, " %d," , codeSize);
79+ charCount += sprintf_s (rowData + charCount, ARRAY_SIZE (rowData) - charCount, " %d," , codeSize);
8080 }
8181 if (strchr (statsTypes, ' *' ) != NULL || strchr (statsTypes, ' t' ) != NULL || strchr (statsTypes, ' T' ) != NULL )
8282 {
8383 charCount +=
84- sprintf_s (rowData + charCount, _countof (rowData) - charCount, " %llu,%llu," , firstTime, secondTime);
84+ sprintf_s (rowData + charCount, ARRAY_SIZE (rowData) - charCount, " %llu,%llu," , firstTime, secondTime);
8585 }
8686
8787 // get rid of the final ',' and replace it with a '\n'
@@ -106,15 +106,15 @@ void MethodStatsEmitter::SetStatsTypes(char* types)
106106 DWORD bytesWritten = 0 ;
107107
108108 if (strchr (statsTypes, ' *' ) != NULL || strchr (statsTypes, ' h' ) != NULL || strchr (statsTypes, ' H' ) != NULL )
109- charCount += sprintf_s (rowHeader + charCount, _countof (rowHeader) - charCount, " HASH," );
109+ charCount += sprintf_s (rowHeader + charCount, ARRAY_SIZE (rowHeader) - charCount, " HASH," );
110110 if (strchr (statsTypes, ' *' ) != NULL || strchr (statsTypes, ' n' ) != NULL || strchr (statsTypes, ' N' ) != NULL )
111- charCount += sprintf_s (rowHeader + charCount, _countof (rowHeader) - charCount, " METHOD_NUMBER," );
111+ charCount += sprintf_s (rowHeader + charCount, ARRAY_SIZE (rowHeader) - charCount, " METHOD_NUMBER," );
112112 if (strchr (statsTypes, ' *' ) != NULL || strchr (statsTypes, ' i' ) != NULL || strchr (statsTypes, ' I' ) != NULL )
113- charCount += sprintf_s (rowHeader + charCount, _countof (rowHeader) - charCount, " IL_CODE_SIZE," );
113+ charCount += sprintf_s (rowHeader + charCount, ARRAY_SIZE (rowHeader) - charCount, " IL_CODE_SIZE," );
114114 if (strchr (statsTypes, ' *' ) != NULL || strchr (statsTypes, ' a' ) != NULL || strchr (statsTypes, ' A' ) != NULL )
115- charCount += sprintf_s (rowHeader + charCount, _countof (rowHeader) - charCount, " ASM_CODE_SIZE," );
115+ charCount += sprintf_s (rowHeader + charCount, ARRAY_SIZE (rowHeader) - charCount, " ASM_CODE_SIZE," );
116116 if (strchr (statsTypes, ' *' ) != NULL || strchr (statsTypes, ' t' ) != NULL || strchr (statsTypes, ' T' ) != NULL )
117- charCount += sprintf_s (rowHeader + charCount, _countof (rowHeader) - charCount, " Time1,Time2," );
117+ charCount += sprintf_s (rowHeader + charCount, ARRAY_SIZE (rowHeader) - charCount, " Time1,Time2," );
118118
119119 // get rid of the final ',' and replace it with a '\n'
120120 rowHeader[charCount - 1 ] = ' \n ' ;
0 commit comments