diff options
author | Aliaksey Kandratsenka <alk@tut.by> | 2013-08-17 15:52:53 +0300 |
---|---|---|
committer | Aliaksey Kandratsenka <alk@tut.by> | 2013-08-17 15:59:08 +0300 |
commit | 6d00cbce92c5576b4bcf07a2b5634b4dcfa14f8a (patch) | |
tree | d90fcf8c6a2ea5bd4a313a152ff01d0ebcf22625 | |
parent | 7d8d522d737f6c55169264b35ebe0be1f9b23efd (diff) | |
download | gperftools-6d00cbce92c5576b4bcf07a2b5634b4dcfa14f8a.tar.gz |
issue-561: don't cast function pointer to void *
Which gcc-3.4 (as shipped in rhel 4) doesn't like.
Cast to void * was originally added to avoid issue on OSX which
doesn't have sighandler_t.
In that place we only need to know if it's null or not. So casting to
intptr_t looks like simplest possible way to achieve that.
-rw-r--r-- | src/profiler.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/profiler.cc b/src/profiler.cc index a9442dc..eb54be6 100644 --- a/src/profiler.cc +++ b/src/profiler.cc @@ -205,9 +205,9 @@ CpuProfiler::CpuProfiler() if (signal_number_str != NULL) { long int signal_number = strtol(signal_number_str, NULL, 10); if (signal_number >= 1 && signal_number <= 64) { - void *old_signal_handler = reinterpret_cast<void *>(signal(signal_number, CpuProfilerSwitch)); - if (old_signal_handler == NULL) { - RAW_LOG(INFO,"Using signal %d as cpu profiling switch", signal_number); + intptr_t old_signal_handler = reinterpret_cast<intptr_t>(signal(signal_number, CpuProfilerSwitch)); + if (old_signal_handler == 0) { + RAW_LOG(INFO,"Using signal %d as cpu profiling switch", signal_number); } else { RAW_LOG(FATAL, "Signal %d already in use\n", signal_number); } |