From 0f30f05e167bcdfbc2b590d8ca795b4fb4f4f016 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Sat, 23 Feb 2019 12:18:15 -0800 Subject: [PATCH] Remove EVENT_ANY_SIGNAL This appeared to have been intended to allow functions to handle all signals, but this has not been exposed and it doesn't seem useful. --- src/event.cpp | 13 +------------ src/event.h | 3 --- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/src/event.cpp b/src/event.cpp index 62db87a9e..adb361389 100644 --- a/src/event.cpp +++ b/src/event.cpp @@ -73,7 +73,6 @@ static int event_match(const event_t &classv, const event_t &instance) { switch (classv.type) { case EVENT_SIGNAL: { - if (classv.param1.signal == EVENT_ANY_SIGNAL) return 1; return classv.param1.signal == instance.param1.signal; } case EVENT_VARIABLE: { @@ -177,8 +176,6 @@ static void show_all_handlers(void) { /// function will fire if the \c event is an event handler. static wcstring event_desc_compact(const event_t &event) { wcstring res; - wchar_t const *temp; - int sig; switch (event.type) { case EVENT_ANY: { res = L"EVENT_ANY"; @@ -193,15 +190,7 @@ static wcstring event_desc_compact(const event_t &event) { break; } case EVENT_SIGNAL: { - sig = event.param1.signal; - if (sig == EVENT_ANY_SIGNAL) { - temp = L"[all signals]"; - } else if (sig == 0) { - temp = L"not set"; - } else { - temp = sig2wcs(sig); - } - res = format_string(L"EVENT_SIGNAL(%ls)", temp); + res = format_string(L"EVENT_SIGNAL(%ls)", sig2wcs(event.param1.signal)); break; } case EVENT_EXIT: { diff --git a/src/event.h b/src/event.h index c28328810..e196c2805 100644 --- a/src/event.h +++ b/src/event.h @@ -15,9 +15,6 @@ #include "common.h" #include "io.h" -/// The signal number that is used to match any signal. -#define EVENT_ANY_SIGNAL -1 - /// The process id that is used to match any process id. #define EVENT_ANY_PID 0