src/process/do_process.cpp: Add suffix `u` to `4294967295` to signify an unsigned number
Paul Menzel
PATCH 1/1 src/process/do_process.cpp: Add suffix `u` to `4294967295` to signify an unsigned number
Date: Sat, 2 Feb 2013 22:32:20 +0100
The C++ compiler
$ g++ --version
g++-4.7.real (Debian 4.7.2-15) 4.7.2
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.reports the following warning.
$ make
[…]
CXX process/powertop-do_process.o
process/do_process.cpp:595:3: warning: this decimal constant is unsigned only in ISO C90 [enabled by default]
[…]Adding the suffix to the constant gets rid of the warning [1].
--- src/process/do_process.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
src/process/do_process.cpp +1 -1
@@ -579,7 +579,7 @@ void perf_process_bundle::handle_trace_point(void *trace, int cpu, uint64_t time } else if (strcmp(event->name, "cpu_idle") == 0) { ret = pevent_get_field_val(NULL, event, "state", &rec, &val, 0); - if (val == 4294967295) + if (val == 4294967295u) consume_blame(cpu); else set_wakeup_pending(cpu);
Signature · 1 line
1.7.10.4
Sergey Senozhatsky
NAKQuoted 29 lines · Paul Menzel
The C++ compiler
$ g++ --version g++-4.7.real (Debian 4.7.2-15) 4.7.2 Copyright (C) 2012 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.reports the following warning.
$ make […] CXX process/powertop-do_process.o process/do_process.cpp:595:3: warning: this decimal constant is unsigned only in ISO C90 [enabled by default] […]Adding the suffix to the constant gets rid of the warning [1].
--- src/process/do_process.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)src/process/do_process.cpp +0
-0
src/process/do_process.cpp void perf_process_bundle::handle_trace_point(void *trace, int cpu, uint64_t time · line 582
Quoted 5 lines
src/process/do_process.cpp +1
-1@@ -579,7 +579,7 @@ void perf_process_bundle::handle_trace_point(void *trace, int cpu, uint64_t time } else if (strcmp(event->name, "cpu_idle") == 0) { ret = pevent_get_field_val(NULL, event, "state", &rec, &val, 0); - if (val == 4294967295) + if (val == 4294967295u)
NACK.
the same point: cpu_idle tracepoint defined as
TP_PROTO(unsigned int state, unsigned int cpu_id)
please use `== (unsigned int)-1'.
+ we need there `-1' return code check from pevent_get_field_val() before we test val.
-ss
Quoted 12 lines
src/process/do_process.cpp +0
-0consume_blame(cpu); else set_wakeup_pending(cpu);Signature · 8 lines
1.7.10.4 _______________________________________________ PowerTop mailing list PowerTop(a)lists.01.org https://lists.01.org/mailman/listinfo/powertop