* [Powertop] [PATCH] intel_cpus.cpp: Change open parameter to const char *
@ 2019-03-31 3:21 Rosen Penev
0 siblings, 0 replies; 2+ messages in thread
From: Rosen Penev @ 2019-03-31 3:21 UTC (permalink / raw)
To: powertop
[-- Attachment #1: Type: text/plain, Size: 817 bytes --]
ifstream::open takes std::string starting with C++11, not before.
This fixes compilation with uClibc++ and potentially other older libraries
Signed-off-by: Rosen Penev <rosenp(a)gmail.com>
---
src/cpu/intel_cpus.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/cpu/intel_cpus.cpp b/src/cpu/intel_cpus.cpp
index 0030dba..4dffadc 100644
--- a/src/cpu/intel_cpus.cpp
+++ b/src/cpu/intel_cpus.cpp
@@ -92,7 +92,7 @@ int is_supported_intel_cpu(int model, int cpu)
int is_intel_pstate_driver_loaded()
{
- const string filename("/sys/devices/system/cpu/cpu0/cpufreq/scaling_driver");
+ const char *filename = "/sys/devices/system/cpu/cpu0/cpufreq/scaling_driver";
const string intel_pstate("intel_pstate");
char line[32] = { '\0' };
ifstream file;
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Powertop] [PATCH] intel_cpus.cpp: Change open parameter to const char *
@ 2019-04-01 17:05 Kammela, Gayatri
0 siblings, 0 replies; 2+ messages in thread
From: Kammela, Gayatri @ 2019-04-01 17:05 UTC (permalink / raw)
To: powertop
[-- Attachment #1: Type: text/plain, Size: 1327 bytes --]
Thanks, Applied!
> -----Original Message-----
> From: PowerTop [mailto:powertop-bounces(a)lists.01.org] On Behalf Of
> Rosen Penev
> Sent: Saturday, March 30, 2019 8:22 PM
> To: powertop(a)lists.01.org
> Subject: [Powertop] [PATCH] intel_cpus.cpp: Change open parameter to
> const char *
>
> ifstream::open takes std::string starting with C++11, not before.
>
> This fixes compilation with uClibc++ and potentially other older libraries
>
> Signed-off-by: Rosen Penev <rosenp(a)gmail.com>
> ---
> src/cpu/intel_cpus.cpp | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/cpu/intel_cpus.cpp b/src/cpu/intel_cpus.cpp index
> 0030dba..4dffadc 100644
> --- a/src/cpu/intel_cpus.cpp
> +++ b/src/cpu/intel_cpus.cpp
> @@ -92,7 +92,7 @@ int is_supported_intel_cpu(int model, int cpu)
>
> int is_intel_pstate_driver_loaded()
> {
> - const string
> filename("/sys/devices/system/cpu/cpu0/cpufreq/scaling_driver");
> + const char *filename =
> +"/sys/devices/system/cpu/cpu0/cpufreq/scaling_driver";
> const string intel_pstate("intel_pstate");
> char line[32] = { '\0' };
> ifstream file;
> --
> 2.17.1
>
> _______________________________________________
> PowerTop mailing list
> PowerTop(a)lists.01.org
> https://lists.01.org/mailman/listinfo/powertop
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-04-01 17:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-31 3:21 [Powertop] [PATCH] intel_cpus.cpp: Change open parameter to const char * Rosen Penev
2019-04-01 17:05 Kammela, Gayatri
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).