Skip to content

Commit 7600e1a

Browse files
committed
Fix warnings and minor issues
1 parent d3d9b2d commit 7600e1a

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/caliper/Caliper.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,8 @@ struct Caliper::GlobalData
353353
delete ptr;
354354
ptr = tmp;
355355
}
356+
357+
s_init_hooks = nullptr;
356358
}
357359

358360
// --- data

src/services/libpfm/Libpfm.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -168,17 +168,17 @@ class LibpfmService
168168
static void sigio_handler(int sig, siginfo_t *info, void *extra) {
169169
perf_event_desc_t *fdx = 0;
170170
struct perf_event_header ehdr;
171-
int fd, i, ret;
172171

173-
fd = info->si_fd;
172+
int fd = info->si_fd;
174173

175-
ret = ioctl(fd, PERF_EVENT_IOC_DISABLE, 0);
174+
int ret = ioctl(fd, PERF_EVENT_IOC_DISABLE, 0);
176175
if (ret)
177176
Log(0).stream() << "libpfm: cannot stop sampling for handling" << std::endl;
178177

179178
sI->signals_received++;
180179

181-
for (i=0; i<sT.num_events; i++) {
180+
int i = 0;
181+
for (i = 0; i<sT.num_events; i++) {
182182
if (fd == sT.fds[i].fd) {
183183
fdx = &sT.fds[i];
184184
break;
@@ -351,7 +351,7 @@ class LibpfmService
351351
}
352352

353353
int end_thread_sampling() {
354-
int ret;
354+
int ret = 0;
355355
size_t pgsz = sysconf(_SC_PAGESIZE);
356356

357357
for (int i=0; i<sT.num_events; i++) {

0 commit comments

Comments
 (0)