diff options
author | Dave Davenport <qball@gmpclient.org> | 2017-04-23 15:17:15 +0200 |
---|---|---|
committer | Dave Davenport <qball@gmpclient.org> | 2017-04-23 15:17:15 +0200 |
commit | fb318f0ff806e8e5b0a6770ca4037b3c2e1857bb (patch) | |
tree | 535f0d3a74e982c79493676636b1bafe44444211 | |
parent | dd715fa1ad0d22f179b0bcbbf8dd37a9279e9832 (diff) |
Cleanups, fix arguments mismatch
-rw-r--r-- | include/helper.h | 2 | ||||
-rw-r--r-- | include/mode.h | 4 | ||||
-rw-r--r-- | include/theme.h | 8 | ||||
-rw-r--r-- | include/view.h | 4 | ||||
-rw-r--r-- | include/widgets/textbox.h | 4 | ||||
-rw-r--r-- | include/widgets/widget.h | 8 | ||||
-rw-r--r-- | source/helper.c | 11 | ||||
-rw-r--r-- | source/mode.c | 4 | ||||
-rw-r--r-- | source/theme.c | 2 | ||||
-rw-r--r-- | source/view.c | 22 |
10 files changed, 34 insertions, 35 deletions
diff --git a/include/helper.h b/include/helper.h index 6eab8d1f..246cc737 100644 --- a/include/helper.h +++ b/include/helper.h @@ -208,7 +208,7 @@ unsigned int levenshtein ( const char *needle, const glong needlelen, const char * * @returns the converted UTF-8 string */ -char * rofi_force_utf8 ( gchar *data, ssize_t length ); +char * rofi_force_utf8 ( const gchar *data, ssize_t length ); /** * @param input the char array holding latin text diff --git a/include/mode.h b/include/mode.h index 718f6839..fe237351 100644 --- a/include/mode.h +++ b/include/mode.h @@ -99,13 +99,13 @@ int mode_init ( Mode *mode ); void mode_destroy ( Mode *mode ); /** - * @param sw The mode to query + * @param mode The mode to query * * Get the number of entries in the mode. * * @returns an unsigned in with the number of entries. */ -unsigned int mode_get_num_entries ( const Mode *sw ); +unsigned int mode_get_num_entries ( const Mode *mode ); /** * @param mode The mode to query diff --git a/include/theme.h b/include/theme.h index e5cb0e83..7351577d 100644 --- a/include/theme.h +++ b/include/theme.h @@ -244,11 +244,11 @@ Property *rofi_theme_property_create ( PropertyType type ); void rofi_theme_property_free ( Property *p ); /** - * @param wid + * @param widget * * Free the widget and alll children. */ -void rofi_theme_free ( ThemeWidget *wid ); +void rofi_theme_free ( ThemeWidget *widget ); /** * @param file filename to parse. @@ -445,10 +445,10 @@ gboolean rofi_theme_is_empty ( void ); void rofi_theme_convert_old ( void ); /** - * @param filename File name passed to option. + * @param file File name passed to option. * * @returns path to theme or copy of filename if not found. */ -char *helper_get_theme_path ( const char *filename ); +char *helper_get_theme_path ( const char *file ); #endif #endif diff --git a/include/view.h b/include/view.h index 82f52f3c..64bc1d1a 100644 --- a/include/view.h +++ b/include/view.h @@ -60,14 +60,14 @@ typedef enum /** * @param sw the Mode to show. * @param input A pointer to a string where the inputted data is placed. - * @param flags Flags indicating state of the menu. + * @param menu_flags Flags indicating state of the menu. * @param finalize the finailze callback * * Main menu callback. * * @returns The command issued (see MenuReturn) */ -RofiViewState *rofi_view_create ( Mode *sw, const char *input, MenuFlags flags, void ( *finalize )( RofiViewState * ) ); +RofiViewState *rofi_view_create ( Mode *sw, const char *input, MenuFlags menu_flags, void ( *finalize )( RofiViewState * ) ); /** * @param state The Menu Handle diff --git a/include/widgets/textbox.h b/include/widgets/textbox.h index 814202f0..b25b4c02 100644 --- a/include/widgets/textbox.h +++ b/include/widgets/textbox.h @@ -168,13 +168,13 @@ void textbox_cursor ( textbox *tb, int pos ); /** * @param tb Handle to the textbox - * @param pos The position to insert the string at + * @param char_pos The position to insert the string at * @param str The string to insert. * @param slen The length of the string. * * Insert the string str at position pos. */ -void textbox_insert ( textbox *tb, const int pos, const char *str, const int slen ); +void textbox_insert ( textbox *tb, const int char_pos, const char *str, const int slen ); /** * Setup the cached fonts. This is required to do diff --git a/include/widgets/widget.h b/include/widgets/widget.h index 9ab72ff4..1c172bf0 100644 --- a/include/widgets/widget.h +++ b/include/widgets/widget.h @@ -98,7 +98,7 @@ void widget_disable ( widget *widget ); void widget_enable ( widget *widget ); /** - * @param widget tb Handle to the widget + * @param widget widget Handle to the widget * @param d The cairo object used to draw itself. * * Render the textbox. @@ -110,7 +110,7 @@ void widget_draw ( widget *widget, cairo_t *d ); * * Free the widget and all allocated memory. */ -void widget_free ( widget *widget ); +void widget_free ( widget *wid ); /** * @param widget The widget toresize @@ -157,12 +157,12 @@ int widget_get_x_pos ( widget *widget ); */ void widget_update ( widget *widget ); /** - * @param widget The widget handle + * @param wid The widget handle * * Indicate that the widget needs to be redrawn. * This is done by setting the redraw flag on the toplevel widget. */ -void widget_queue_redraw ( widget *widget ); +void widget_queue_redraw ( widget *wid ); /** * @param wid The widget handle * diff --git a/source/helper.c b/source/helper.c index ac95252b..bf054ea4 100644 --- a/source/helper.c +++ b/source/helper.c @@ -310,7 +310,7 @@ const char ** find_arg_strv ( const char *const key ) const char **retv = NULL; int length = 0; for ( int i = 0; i < stored_argc; i++ ) { - if ( strcasecmp ( stored_argv[i], key ) == 0 && i < ( stored_argc - 1 ) ) { + if ( i < ( stored_argc - 1 ) && strcasecmp ( stored_argv[i], key ) == 0 ) { length++; } } @@ -318,7 +318,7 @@ const char ** find_arg_strv ( const char *const key ) retv = g_malloc0 ( ( length + 1 ) * sizeof ( char* ) ); int index = 0; for ( int i = 0; i < stored_argc; i++ ) { - if ( strcasecmp ( stored_argv[i], key ) == 0 && i < ( stored_argc - 1 ) ) { + if ( i < ( stored_argc - 1 ) && strcasecmp ( stored_argv[i], key ) == 0 ) { retv[index++] = stored_argv[i + 1]; } } @@ -715,17 +715,16 @@ char * rofi_latin_to_utf8_strdup ( const char *input, gssize length ) return g_convert_with_fallback ( input, length, "UTF-8", "latin1", "\uFFFD", NULL, &slength, NULL ); } -char * rofi_force_utf8 ( gchar *start, ssize_t length ) +char * rofi_force_utf8 ( const gchar *data, ssize_t length ) { - if ( start == NULL ) { + if ( data == NULL ) { return NULL; } - const char *data = start; const char *end; GString *string; if ( g_utf8_validate ( data, length, &end ) ) { - return g_memdup ( start, length + 1 ); + return g_memdup ( data, length + 1 ); } string = g_string_sized_new ( length + 16 ); diff --git a/source/mode.c b/source/mode.c index f6ce6210..a7e552d3 100644 --- a/source/mode.c +++ b/source/mode.c @@ -61,13 +61,13 @@ unsigned int mode_get_num_entries ( const Mode *mode ) return mode->_get_num_entries ( mode ); } -char * mode_get_display_value ( const Mode *mode, unsigned int selected_line, int *state, GList **list, int get_entry ) +char * mode_get_display_value ( const Mode *mode, unsigned int selected_line, int *state, GList **attribute_list, int get_entry ) { g_assert ( mode != NULL ); g_assert ( state != NULL ); g_assert ( mode->_get_display_value != NULL ); - return mode->_get_display_value ( mode, selected_line, state, list, get_entry ); + return mode->_get_display_value ( mode, selected_line, state, attribute_list, get_entry ); } char * mode_get_completion ( const Mode *mode, unsigned int selected_line ) diff --git a/source/theme.c b/source/theme.c index 00161e78..1ed0da63 100644 --- a/source/theme.c +++ b/source/theme.c @@ -62,7 +62,7 @@ const char *PropertyTypeName[] = { /** Highlight */ "Highlight", }; -void yyerror ( YYLTYPE *ylloc, const char *, const char * ); +void yyerror ( YYLTYPE *yylloc, const char *, const char * ); static gboolean distance_compare ( Distance d, Distance e ) { return d.type == e.type && d.distance == e.distance && d.style == e.style; diff --git a/source/view.c b/source/view.c index 0ee8f17d..ba6b8ff2 100644 --- a/source/view.c +++ b/source/view.c @@ -1416,13 +1416,13 @@ static void rofi_view_handle_keypress ( RofiViewState *state, xkb_stuff *xkb, xc } } -void rofi_view_itterrate ( RofiViewState *state, xcb_generic_event_t *ev, xkb_stuff *xkb ) +void rofi_view_itterrate ( RofiViewState *state, xcb_generic_event_t *event, xkb_stuff *xkb ) { - switch ( ev->response_type & ~0x80 ) + switch ( event->response_type & ~0x80 ) { case XCB_CONFIGURE_NOTIFY: { - xcb_configure_notify_event_t *xce = (xcb_configure_notify_event_t *) ev; + xcb_configure_notify_event_t *xce = (xcb_configure_notify_event_t *) event; if ( xce->window == CacheState.main_window ) { if ( state->x != xce->x || state->y != xce->y ) { state->x = xce->x; @@ -1454,19 +1454,19 @@ void rofi_view_itterrate ( RofiViewState *state, xcb_generic_event_t *ev, xkb_st if ( config.click_to_exit == TRUE ) { state->mouse_seen = TRUE; } - xcb_motion_notify_event_t xme = *( (xcb_motion_notify_event_t *) ev ); + xcb_motion_notify_event_t xme = *( (xcb_motion_notify_event_t *) event ); if ( widget_motion_notify ( WIDGET ( state->main_window ), &xme ) ) { return; } break; } case XCB_BUTTON_PRESS: - rofi_view_mouse_navigation ( state, (xcb_button_press_event_t *) ev ); + rofi_view_mouse_navigation ( state, (xcb_button_press_event_t *) event ); break; case XCB_BUTTON_RELEASE: if ( config.click_to_exit == TRUE ) { if ( ( CacheState.flags & MENU_NORMAL_WINDOW ) == 0 ) { - xcb_button_release_event_t *bre = (xcb_button_release_event_t *) ev; + xcb_button_release_event_t *bre = (xcb_button_release_event_t *) event; if ( ( state->mouse_seen == FALSE ) && ( bre->event != CacheState.main_window ) ) { state->quit = TRUE; state->retv = MENU_CANCEL; @@ -1477,11 +1477,11 @@ void rofi_view_itterrate ( RofiViewState *state, xcb_generic_event_t *ev, xkb_st break; // Paste event. case XCB_SELECTION_NOTIFY: - rofi_view_paste ( state, (xcb_selection_notify_event_t *) ev ); + rofi_view_paste ( state, (xcb_selection_notify_event_t *) event ); break; case XCB_KEYMAP_NOTIFY: { - xcb_keymap_notify_event_t *kne = (xcb_keymap_notify_event_t *) ev; + xcb_keymap_notify_event_t *kne = (xcb_keymap_notify_event_t *) event; guint modstate = x11_get_current_mask ( xkb ); for ( gint32 by = 0; by < 31; ++by ) { for ( gint8 bi = 0; bi < 7; ++bi ) { @@ -1495,11 +1495,11 @@ void rofi_view_itterrate ( RofiViewState *state, xcb_generic_event_t *ev, xkb_st break; } case XCB_KEY_PRESS: - rofi_view_handle_keypress ( state, xkb, (xcb_key_press_event_t *) ev ); + rofi_view_handle_keypress ( state, xkb, (xcb_key_press_event_t *) event ); break; case XCB_KEY_RELEASE: { - xcb_key_release_event_t *xkre = (xcb_key_release_event_t *) ev; + xcb_key_release_event_t *xkre = (xcb_key_release_event_t *) event; unsigned int modstate = x11_canonalize_mask ( xkre->state ); if ( modstate == 0 ) { abe_trigger_release ( ); @@ -1515,7 +1515,7 @@ void rofi_view_itterrate ( RofiViewState *state, xcb_generic_event_t *ev, xkb_st } rofi_view_update ( state, TRUE ); - if ( ( ev->response_type & ~0x80 ) == XCB_EXPOSE && CacheState.repaint_source == 0 ) { + if ( ( event->response_type & ~0x80 ) == XCB_EXPOSE && CacheState.repaint_source == 0 ) { CacheState.repaint_source = g_idle_add_full ( G_PRIORITY_HIGH_IDLE, rofi_view_repaint, NULL, NULL ); } } |