From 26c176c839a749a8ca2b9530909248a64ef429aa Mon Sep 17 00:00:00 2001 From: "Alfred E. Heggestad" Date: Sun, 31 Jul 2016 22:17:47 +0200 Subject: use KEYCODE_REL instead of 0x00 --- src/audio.c | 2 +- src/call.c | 4 ++-- src/cmd.c | 7 +++---- 3 files changed, 6 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 2b5be6e..c373cb8 100644 --- a/src/audio.c +++ b/src/audio.c @@ -1317,7 +1317,7 @@ int audio_send_digit(struct audio *a, char key) if (!a) return EINVAL; - if (key > 0) { + if (key != KEYCODE_REL) { info("audio: send DTMF digit: '%c'\n", key); err = telev_send(a->telev, telev_digit2code(key), false); } diff --git a/src/call.c b/src/call.c index 880a7d0..db6cb84 100644 --- a/src/call.c +++ b/src/call.c @@ -994,7 +994,7 @@ int call_info(struct re_printf *pf, const struct call *call) * Send a DTMF digit to the peer * * @param call Call object - * @param key DTMF digit to send (0x00 for key release) + * @param key DTMF digit to send (KEYCODE_REL for key release) * * @return 0 if success, otherwise errorcode */ @@ -1135,7 +1135,7 @@ static void dtmfend_handler(void *arg) struct call *call = arg; if (call->dtmfh) - call->dtmfh(call, 0x00, call->arg); + call->dtmfh(call, KEYCODE_REL, call->arg); } diff --git a/src/cmd.c b/src/cmd.c index 5fdc59f..9143a3e 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -11,7 +11,6 @@ enum { - REL = 0x00, ESC = 0x1b, DEL = 0x7f, }; @@ -140,7 +139,7 @@ static int editor_input(struct mbuf *mb, char key, *del = true; return re_hprintf(pf, "\nCancel\n"); - case REL: + case KEYCODE_REL: break; case '\n': @@ -274,7 +273,7 @@ int cmd_process(struct cmd_ctx **ctxp, char key, struct re_printf *pf, /* are we in edit-mode? */ if (ctxp && *ctxp) { - if (key == REL) + if (key == KEYCODE_REL) return 0; return cmd_process_edit(ctxp, key, pf, data); @@ -306,7 +305,7 @@ int cmd_process(struct cmd_ctx **ctxp, char key, struct re_printf *pf, return cmd->h(pf, &arg); } - if (key == REL) + if (key == KEYCODE_REL) return 0; return cmd_print(pf, NULL); -- cgit v1.2.3