summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChih-Hung Hsieh <chh@google.com>2018-08-13 10:31:02 -0700
committerChih-Hung Hsieh <chh@google.com>2018-08-13 10:31:02 -0700
commit842807974fa516af92dd36b0a00c25c418d6e256 (patch)
treef1ef95ec93705f3d25283f4541cbe3ff5992fee9
parent9d3d54a4642c0b7047fda7555d1eec164b0fd052 (diff)
downloadextras-842807974fa516af92dd36b0a00c25c418d6e256.tar.gz
Replace short with int16_t.
Bug: 112478838 Test: build with WITH_TIDY=1 Change-Id: I6618efb1b005dd4194c010da9101d7899c40d30d
-rw-r--r--simpleperf/IOEventLoop.cpp4
-rw-r--r--simpleperf/IOEventLoop.h5
2 files changed, 5 insertions, 4 deletions
diff --git a/simpleperf/IOEventLoop.cpp b/simpleperf/IOEventLoop.cpp
index 92d3afe0..102bc6d2 100644
--- a/simpleperf/IOEventLoop.cpp
+++ b/simpleperf/IOEventLoop.cpp
@@ -92,7 +92,7 @@ bool IOEventLoop::EnsureInit() {
return true;
}
-void IOEventLoop::EventCallbackFn(int, short, void* arg) {
+void IOEventLoop::EventCallbackFn(int, int16_t, void* arg) {
IOEvent* e = static_cast<IOEvent*>(arg);
if (!e->callback()) {
e->loop->has_error_ = true;
@@ -144,7 +144,7 @@ IOEventRef IOEventLoop::AddPeriodicEvent(timeval duration, const std::function<b
return AddEvent(-1, EV_PERSIST, &duration, callback);
}
-IOEventRef IOEventLoop::AddEvent(int fd_or_sig, short events, timeval* timeout,
+IOEventRef IOEventLoop::AddEvent(int fd_or_sig, int16_t events, timeval* timeout,
const std::function<bool()>& callback) {
if (!EnsureInit()) {
return nullptr;
diff --git a/simpleperf/IOEventLoop.h b/simpleperf/IOEventLoop.h
index 3a15d05c..ee9014ae 100644
--- a/simpleperf/IOEventLoop.h
+++ b/simpleperf/IOEventLoop.h
@@ -17,6 +17,7 @@
#ifndef SIMPLE_PERF_IOEVENT_LOOP_H_
#define SIMPLE_PERF_IOEVENT_LOOP_H_
+#include <stdint.h>
#include <time.h>
#include <functional>
@@ -76,9 +77,9 @@ class IOEventLoop {
private:
bool EnsureInit();
- IOEventRef AddEvent(int fd_or_sig, short events, timeval* timeout,
+ IOEventRef AddEvent(int fd_or_sig, int16_t events, timeval* timeout,
const std::function<bool()>& callback);
- static void EventCallbackFn(int, short, void*);
+ static void EventCallbackFn(int, int16_t, void*);
event_base* ebase_;
std::vector<std::unique_ptr<IOEvent>> events_;