Skip to content

Commit

Permalink
Merge pull request #748 from intel/push-2024-05-22
Browse files Browse the repository at this point in the history
Push 2024 05 22
  • Loading branch information
rdementi authored May 23, 2024
2 parents 36e8ec5 + 2dfbd5f commit e9a1f39
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 11 deletions.
6 changes: 1 addition & 5 deletions src/cpucounters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4432,11 +4432,7 @@ std::string PCM::getCPUFamilyModelString(const uint32 cpu_family_, const uint32
{
char buffer[sizeof(int)*4*3+6];
std::fill(buffer, buffer + sizeof(buffer), 0);
#ifdef _MSC_VER
sprintf_s(buffer,sizeof(buffer),"GenuineIntel-%d-%2X-%X", cpu_family_, cpu_model_, cpu_stepping_);
#else
snprintf(buffer,sizeof(buffer),"GenuineIntel-%d-%2X-%X", cpu_family_, cpu_model_, cpu_stepping_);
#endif
std::snprintf(buffer,sizeof(buffer),"GenuineIntel-%d-%2X-%X", cpu_family_, cpu_model_, cpu_stepping_);
std::string result(buffer);
return result;
}
Expand Down
1 change: 0 additions & 1 deletion src/pcm-accel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

#include "pcm-accel-common.h"
#ifdef _MSC_VER
#pragma warning(disable : 4996) // for sprintf
#include <windows.h>
#include "windows/windriver.h"
#else
Expand Down
1 change: 0 additions & 1 deletion src/pcm-iio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include "cpucounters.h"

#ifdef _MSC_VER
#pragma warning(disable : 4996) // for sprintf
#include <windows.h>
#include "windows/windriver.h"
#else
Expand Down
1 change: 0 additions & 1 deletion src/pcm-latency.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
// written by Subhiksha Ravisundar
#include "cpucounters.h"
#ifdef _MSC_VER
#pragma warning(disable : 4996) // for sprintf
#include <windows.h>
#include "windows/windriver.h"
#else
Expand Down
1 change: 0 additions & 1 deletion src/pcm-lspci.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
// written by Patrick Lu
#include "cpucounters.h"
#ifdef _MSC_VER
#pragma warning(disable : 4996) // for sprintf
#include <windows.h>
#include "windows/windriver.h"
#else
Expand Down
4 changes: 2 additions & 2 deletions src/pcm-msr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ int mainThrows(int argc, char * argv[])
uint64 value2 = value;
extractBitsPrintHelper(bits, value, dec);
char cname[100];
if (core_in_dec) sprintf(cname,"%d",core);
else sprintf(cname,"0x%x",core);
if (core_in_dec) std::snprintf(cname, sizeof(cname), "%d", core);
else std::snprintf(cname, sizeof(cname), "0x%x", core);
std::cout << " from MSR " << msr << " on core " << cname << "\n";
auto itx = it;
itx++;
Expand Down
3 changes: 3 additions & 0 deletions src/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
#include <map>
#include <unordered_map>

#ifdef __linux__
#include <unistd.h>
#endif
namespace pcm {
std::string safe_getenv(const char* env);
}
Expand Down

0 comments on commit e9a1f39

Please sign in to comment.