Search callbacks should return mc_search_cbret_t not int.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2013-05-25 15:58:27 +04:00 committed by Slava Zanko
parent 41a168ab4c
commit d0955f3793
3 changed files with 9 additions and 7 deletions

View File

@ -13,8 +13,11 @@
/*** typedefs(not structures) and defined constants **********************************************/
typedef int (*mc_search_fn) (const void *user_data, gsize char_offset, int *current_char);
typedef int (*mc_update_fn) (const void *user_data, gsize char_offset);
typedef enum mc_search_cbret_t mc_search_cbret_t;
typedef mc_search_cbret_t (*mc_search_fn) (const void *user_data, gsize char_offset,
int *current_char);
typedef mc_search_cbret_t (*mc_update_fn) (const void *user_data, gsize char_offset);
#define MC_SEARCH__NUM_REPLACE_ARGS 64
@ -44,14 +47,13 @@ typedef enum
MC_SEARCH_T_GLOB
} mc_search_type_t;
typedef enum
enum mc_search_cbret_t
{
MC_SEARCH_CB_OK = 0,
MC_SEARCH_CB_INVALID = -1,
MC_SEARCH_CB_ABORT = -2,
MC_SEARCH_CB_SKIP = -3
} mc_search_cbret_t;
};
/*** structures declarations (and typedefs of structures)*****************************************/

View File

@ -327,7 +327,7 @@ void mcview_display_text (mcview_t *);
/* search.c: */
mc_search_cbret_t mcview_search_cmd_callback (const void *user_data, gsize char_offset,
int *current_char);
int mcview_search_update_cmd_callback (const void *, gsize);
mc_search_cbret_t mcview_search_update_cmd_callback (const void *user_data, gsize char_offset);
void mcview_do_search (mcview_t * view);
/*** inline functions ****************************************************************************/

View File

@ -213,7 +213,7 @@ mcview_search_cmd_callback (const void *user_data, gsize char_offset, int *curre
/* --------------------------------------------------------------------------------------------- */
int
mc_search_cbret_t
mcview_search_update_cmd_callback (const void *user_data, gsize char_offset)
{
mcview_t *view = (mcview_t *) user_data;