[PPL-devel] [GIT] ppl/ppl(master): Avoided non-constant pointers to function.
Roberto Bagnara
bagnara at cs.unipr.it
Mon Aug 20 16:52:52 CEST 2012
Module: ppl/ppl
Branch: master
Commit: d75793538dc649e9d985d16095a5a445fba4cd26
URL: http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=d75793538dc649e9d985d16095a5a445fba4cd26
Author: Roberto Bagnara <bagnara at cs.unipr.it>
Date: Mon Aug 20 16:51:41 2012 +0200
Avoided non-constant pointers to function.
Detected by ECLAIR service funpntr.
---
demos/ppl_lcdd/ppl_lcdd.cc | 2 +-
src/Watchdog_defs.hh | 2 +-
src/Watchdog_inlines.hh | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/demos/ppl_lcdd/ppl_lcdd.cc b/demos/ppl_lcdd/ppl_lcdd.cc
index d492f33..97d4a20 100644
--- a/demos/ppl_lcdd/ppl_lcdd.cc
+++ b/demos/ppl_lcdd/ppl_lcdd.cc
@@ -298,7 +298,7 @@ warning(const char* format, ...) {
#ifdef PPL_LCDD_SUPPORTS_LIMIT_ON_CPU_TIME
-extern "C" typedef void (*sig_handler_type)(int);
+extern "C" typedef void (* const sig_handler_type)(int);
void
set_alarm_on_cpu_time(const unsigned long seconds, sig_handler_type handler) {
diff --git a/src/Watchdog_defs.hh b/src/Watchdog_defs.hh
index 9ff258b..003d5be 100644
--- a/src/Watchdog_defs.hh
+++ b/src/Watchdog_defs.hh
@@ -57,7 +57,7 @@ public:
Constructor: if not reset, the watchdog will trigger after \p csecs
centiseconds, invoking handler \p function.
*/
- Watchdog(long csecs, void (*function)());
+ Watchdog(long csecs, void (* const function)());
//! Destructor.
~Watchdog();
diff --git a/src/Watchdog_inlines.hh b/src/Watchdog_inlines.hh
index 8522fca..8244922 100644
--- a/src/Watchdog_inlines.hh
+++ b/src/Watchdog_inlines.hh
@@ -48,7 +48,7 @@ Watchdog::Watchdog(long csecs,
}
inline
-Watchdog::Watchdog(long csecs, void (*function)())
+Watchdog::Watchdog(long csecs, void (* const function)())
: expired(false),
handler(*new Implementation::Watchdog::Handler_Function(function)) {
if (csecs == 0)
More information about the PPL-devel
mailing list