From a29502ed0d28314533bfbbb380e7ed668e6e71c1 Mon Sep 17 00:00:00 2001 From: Oliver Schmidt Date: Tue, 6 Oct 2015 16:25:42 +0200 Subject: [PATCH] Changed 'data' casting for 'ctk_signal_keypress'. In these cases data was set as `process_post_synch(window->owner, ctk_signal_keypress, (process_data_t)(size_t)c);` so it seems reasonable to cast "back" to `size_t`. Additionally the comparison can be limited to `char`. See i.e. calcc for reference: ``` if(ev == ctk_signal_keypress) { if((char)(size_t)data >= '0' && (char)(size_t)data <= '9') { ``` --- core/ctk/ctk-filedialog.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/ctk/ctk-filedialog.c b/core/ctk/ctk-filedialog.c index f8626eab9..ca4bf523e 100644 --- a/core/ctk/ctk-filedialog.c +++ b/core/ctk/ctk-filedialog.c @@ -155,14 +155,14 @@ ctk_filedialog_eventhandler(struct ctk_filedialog_state *s, } return 1; } else if(ev == ctk_signal_keypress) { - if((unsigned long)data == CH_CURS_UP) { + if((char)(size_t)data == CH_CURS_UP) { clearptr(); if(fileptr > 0) { --fileptr; } showptr(); return 1; - } else if((unsigned long)data == CH_CURS_DOWN) { + } else if((char)(size_t)data == CH_CURS_DOWN) { clearptr(); if(fileptr < FILES_HEIGHT - 1) { ++fileptr;