Remove unneeded struct keyword for typedef'd structs

Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
This commit is contained in:
Yury V. Zaytsev 2016-03-03 20:51:40 +01:00 committed by Andrew Borodin
parent 561923d643
commit a8f512c12c
30 changed files with 85 additions and 95 deletions

View File

@ -163,6 +163,8 @@
#define DEFAULT_CHARSET "ASCII"
#include "lib/timer.h" /* mc_timer_t */
/*** enums ***************************************************************************************/
/* run mode and params */
@ -180,7 +182,7 @@ typedef struct
{
mc_run_mode_t mc_run_mode;
/* global timer */
struct mc_timer_t *timer;
mc_timer_t *timer;
/* Used so that widgets know if they are being destroyed or shut down */
gboolean midnight_shutdown;

View File

@ -69,11 +69,11 @@
/*** file scope type declarations ****************************************************************/
struct lock_s
typedef struct
{
char *who;
pid_t pid;
};
} lock_s;
/*** file scope variables ************************************************************************/
@ -135,13 +135,13 @@ lock_build_symlink_name (const vfs_path_t * fname_vpath)
* Extract pid from user@host.domain.pid string
*/
static struct lock_s *
static lock_s *
lock_extract_info (const char *str)
{
size_t i, len;
const char *p, *s;
static char pid[PID_BUF_SIZE], who[BUF_SIZE];
static struct lock_s lock;
static lock_s lock;
len = strlen (str);
@ -201,7 +201,7 @@ lock_file (const vfs_path_t * fname_vpath)
{
char *lockfname = NULL, *newlock, *msg;
struct stat statbuf;
struct lock_s *lockinfo;
lock_s *lockinfo;
gboolean is_local;
gboolean symlink_ok = FALSE;
const char *elpath;

View File

@ -974,7 +974,7 @@ custom_canonicalize_pathname (char *path, CANON_PATH_FLAGS flags)
&& strncmp (s - url_delim_len, VFS_PATH_URL_DELIMITER, url_delim_len) == 0)
{
char *vfs_prefix = s - url_delim_len;
struct vfs_class *vclass;
vfs_class *vclass;
while (vfs_prefix > lpath && !IS_PATH_SEP (*--vfs_prefix))
;

View File

@ -61,7 +61,7 @@
/* TODO: move it to separate private .h */
extern GString *vfs_str_buffer;
extern struct vfs_class *current_vfs;
extern vfs_class *current_vfs;
extern struct dirent *mc_readdir_result;
/*** global variables ****************************************************************************/

View File

@ -63,13 +63,13 @@
extern struct dirent *mc_readdir_result;
extern GPtrArray *vfs__classes_list;
extern GString *vfs_str_buffer;
extern struct vfs_class *current_vfs;
extern vfs_class *current_vfs;
/*** global variables ****************************************************************************/
GPtrArray *vfs__classes_list = NULL;
GString *vfs_str_buffer = NULL;
struct vfs_class *current_vfs = NULL;
vfs_class *current_vfs = NULL;
/*** file scope macro definitions ****************************************************************/
@ -86,7 +86,7 @@ struct vfs_class *current_vfs = NULL;
struct vfs_openfile
{
int handle;
struct vfs_class *vclass;
vfs_class *vclass;
void *fsinfo;
};

View File

@ -262,7 +262,7 @@ buttonbar_new (gboolean visible)
void
buttonbar_set_label (WButtonBar * bb, int idx, const char *text,
const struct global_keymap_t *keymap, const Widget * receiver)
const global_keymap_t * keymap, const Widget * receiver)
{
if ((bb != NULL) && (idx >= 1) && (idx <= BUTTONBAR_LABELS_NUM))
{

View File

@ -19,8 +19,6 @@
/*** structures declarations (and typedefs of structures)*****************************************/
struct global_keymap_t;
typedef struct WButtonBar
{
Widget widget;
@ -34,15 +32,13 @@ typedef struct WButtonBar
} labels[BUTTONBAR_LABELS_NUM];
} WButtonBar;
struct global_keymap_t;
/*** global variables defined in .c file *********************************************************/
/*** declarations of public functions ************************************************************/
WButtonBar *buttonbar_new (gboolean visible);
void buttonbar_set_label (WButtonBar * bb, int idx, const char *text,
const struct global_keymap_t *keymap, const Widget * receiver);
const global_keymap_t * keymap, const Widget * receiver);
WButtonBar *find_buttonbar (const WDialog * h);
/*** inline functions ****************************************************************************/

View File

@ -16,8 +16,8 @@ extern WDialog *midnight_dlg;
/*** declarations of public functions ************************************************************/
void dialog_switch_add (struct WDialog *h);
void dialog_switch_remove (struct WDialog *h);
void dialog_switch_add (WDialog * h);
void dialog_switch_remove (WDialog * h);
size_t dialog_switch_num (void);
void dialog_switch_next (void);

View File

@ -189,7 +189,7 @@ void update_cursor (WDialog * h);
/* --------------------------------------------------------------------------------------------- */
static inline unsigned long
dlg_get_current_widget_id (const struct WDialog *h)
dlg_get_current_widget_id (const WDialog * h)
{
return WIDGET (h->current->data)->id;
}

View File

@ -165,7 +165,7 @@ history_get (const char *input_name)
* Load history from the mc_config
*/
GList *
history_load (struct mc_config_t * cfg, const char *name)
history_load (mc_config_t * cfg, const char *name)
{
size_t i;
GList *hist = NULL;
@ -228,7 +228,7 @@ history_load (struct mc_config_t * cfg, const char *name)
* Save history to the mc_config, but don't save config to file
*/
void
history_save (struct mc_config_t *cfg, const char *name, GList * h)
history_save (mc_config_t * cfg, const char *name, GList * h)
{
GIConv conv = INVALID_CONV;
GString *buffer;

View File

@ -6,15 +6,14 @@
#ifndef MC__WIDGET_HISTORY_H
#define MC__WIDGET_HISTORY_H
#include "lib/mcconfig.h" /* mc_config_t */
/*** typedefs(not structures) and defined constants **********************************************/
/*** enums ***************************************************************************************/
/*** structures declarations (and typedefs of structures)*****************************************/
/* forward declaration */
struct mc_config_t;
/*** global variables defined in .c file *********************************************************/
extern int num_history_items_recorded;
@ -24,9 +23,9 @@ extern int num_history_items_recorded;
/* read history to the mc_config, but don't save config to file */
GList *history_get (const char *input_name);
/* load history from the mc_config */
GList *history_load (struct mc_config_t *cfg, const char *name);
GList *history_load (mc_config_t * cfg, const char *name);
/* save history to the mc_config, but don't save config to file */
void history_save (struct mc_config_t *cfg, const char *name, GList * h);
void history_save (mc_config_t * cfg, const char *name, GList * h);
/* for repositioning of history dialog we should pass widget to this
* function, as position of history dialog depends on widget's position */
char *history_show (GList ** history, Widget * widget, int current);

View File

@ -16,8 +16,8 @@
typedef struct
{
struct WDialog *dlg;
struct WListbox *list;
WDialog *dlg;
WListbox *list;
} Listbox;
/*** global variables defined in .c file *********************************************************/

View File

@ -105,7 +105,7 @@ struct Widget
widget_cb_fn callback;
mouse_h mouse;
void (*set_options) (Widget * w, widget_options_t options, gboolean enable);
struct WDialog *owner;
WDialog *owner;
};
/* structure for label (caption) with hotkey, if original text does not contain

View File

@ -115,7 +115,7 @@ query_default_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm,
/* --------------------------------------------------------------------------------------------- */
/** Create message dialog */
static struct WDialog *
static WDialog *
do_create_message (int flags, const char *title, const char *text)
{
char *p;
@ -378,7 +378,7 @@ query_set_sel (int new_sel)
* dlg_destroy() to dismiss it. Not safe to call from background.
*/
struct WDialog *
WDialog *
create_message (int flags, const char *title, const char *text, ...)
{
va_list args;

View File

@ -78,8 +78,8 @@ void query_set_sel (int new_sel);
/* Create message box but don't dismiss it yet, not background safe */
/* *INDENT-OFF* */
struct WDialog *create_message (int flags, const char *title, const char *text, ...)
G_GNUC_PRINTF (3, 4);
WDialog *create_message (int flags, const char *title, const char *text, ...)
G_GNUC_PRINTF (3, 4);
/* Show message box, background safe */
void message (int flags, const char *title, const char *text, ...) G_GNUC_PRINTF (3, 4);

View File

@ -76,7 +76,7 @@ static int parent_fd;
/* File descriptor for messages from our parent */
static int from_parent_fd;
struct TaskList *task_list = NULL;
TaskList *task_list = NULL;
static int background_attention (int fd, void *closure);
@ -211,7 +211,7 @@ background_attention (int fd, void *closure)
int argc, i, status;
char *data[MAXCALLARGS];
ssize_t bytes, ret;
struct TaskList *p;
TaskList *p;
int to_child_fd = -1;
enum ReturnType type;

View File

@ -31,7 +31,7 @@ typedef struct TaskList
/*** global variables defined in .c file *********************************************************/
extern struct TaskList *task_list;
extern TaskList *task_list;
/*** declarations of public functions ************************************************************/

View File

@ -113,9 +113,6 @@ typedef struct edit_stack_type
vfs_path_t *filename_vpath;
} edit_stack_type;
struct Widget;
struct WMenuBar;
/*** global variables defined in .c file *********************************************************/
extern const char VERTICAL_MAGIC[5];
@ -146,7 +143,7 @@ gboolean edit_widget_is_editor (const Widget * w);
gboolean edit_drop_hotkey_menu (WDialog * h, int key);
void edit_menu_cmd (WDialog * h);
void user_menu (WEdit * edit, const char *menu_file, int selected_entry);
void edit_init_menu (struct WMenuBar *menubar);
void edit_init_menu (WMenuBar * menubar);
void edit_save_mode_cmd (void);
off_t edit_move_forward3 (const WEdit * edit, off_t current, long cols, off_t upto);
void edit_scroll_screen_over_cursor (WEdit * edit);

View File

@ -84,11 +84,11 @@ int visible_tabs = 1, visible_tws = 1;
/*** file scope type declarations ****************************************************************/
struct line_s
typedef struct
{
unsigned int ch;
unsigned int style;
};
} line_s;
/*** file scope variables ************************************************************************/
@ -390,11 +390,11 @@ edit_draw_window_icons (const WEdit * edit, int color)
static inline void
print_to_widget (WEdit * edit, long row, int start_col, int start_col_real,
long end_col, struct line_s line[], char *status, int bookmarked)
long end_col, line_s line[], char *status, int bookmarked)
{
Widget *w = WIDGET (edit);
struct line_s *p;
line_s *p;
int x = start_col_real;
int x1 = start_col + EDIT_TEXT_HORIZONTAL_OFFSET + option_line_state_width;
@ -512,8 +512,8 @@ edit_draw_this_line (WEdit * edit, off_t b, long row, long start_col, long end_c
{
Widget *w = WIDGET (edit);
struct line_s line[MAX_LINE_LEN];
struct line_s *p = line;
line_s line[MAX_LINE_LEN];
line_s *p = line;
off_t m1 = 0, m2 = 0, q;
int col, start_col_real;

View File

@ -286,7 +286,7 @@ edit_drop_menu_cmd (WDialog * h, int which)
/* --------------------------------------------------------------------------------------------- */
void
edit_init_menu (struct WMenuBar *menubar)
edit_init_menu (WMenuBar * menubar)
{
menubar_add_menu (menubar,
create_menu (_("&File"), create_file_menu (), "[Internal File Editor]"));

View File

@ -57,38 +57,36 @@ typedef struct aspell_struct
static GModule *spell_module = NULL;
static spell_t *global_speller = NULL;
static struct AspellConfig *(*mc_new_aspell_config) (void);
static int (*mc_aspell_config_replace) (struct AspellConfig * ths, const char *key,
const char *value);
static struct AspellCanHaveError *(*mc_new_aspell_speller) (struct AspellConfig * config);
static unsigned int (*mc_aspell_error_number) (const struct AspellCanHaveError * ths);
static const char *(*mc_aspell_speller_error_message) (const struct AspellSpeller * ths);
static const struct AspellError *(*mc_aspell_speller_error) (const struct AspellSpeller * ths);
static AspellConfig *(*mc_new_aspell_config) (void);
static int (*mc_aspell_config_replace) (AspellConfig * ths, const char *key, const char *value);
static AspellCanHaveError *(*mc_new_aspell_speller) (AspellConfig * config);
static unsigned int (*mc_aspell_error_number) (const AspellCanHaveError * ths);
static const char *(*mc_aspell_speller_error_message) (const AspellSpeller * ths);
static const AspellError *(*mc_aspell_speller_error) (const AspellSpeller * ths);
static struct AspellSpeller *(*mc_to_aspell_speller) (struct AspellCanHaveError * obj);
static int (*mc_aspell_speller_check) (struct AspellSpeller * ths, const char *word, int word_size);
static const struct AspellWordList *(*mc_aspell_speller_suggest) (struct AspellSpeller * ths,
const char *word, int word_size);
static struct AspellStringEnumeration *(*mc_aspell_word_list_elements) (const struct AspellWordList
* ths);
static const char *(*mc_aspell_config_retrieve) (struct AspellConfig * ths, const char *key);
static void (*mc_delete_aspell_speller) (struct AspellSpeller * ths);
static void (*mc_delete_aspell_config) (struct AspellConfig * ths);
static void (*mc_delete_aspell_can_have_error) (struct AspellCanHaveError * ths);
static const char *(*mc_aspell_error_message) (const struct AspellCanHaveError * ths);
static void (*mc_delete_aspell_string_enumeration) (struct AspellStringEnumeration * ths);
static struct AspellDictInfoEnumeration *(*mc_aspell_dict_info_list_elements)
(const struct AspellDictInfoList * ths);
static struct AspellDictInfoList *(*mc_get_aspell_dict_info_list) (struct AspellConfig * config);
static const struct AspellDictInfo *(*mc_aspell_dict_info_enumeration_next)
(struct AspellDictInfoEnumeration * ths);
static const char *(*mc_aspell_string_enumeration_next) (struct AspellStringEnumeration * ths);
static void (*mc_delete_aspell_dict_info_enumeration) (struct AspellDictInfoEnumeration * ths);
static unsigned int (*mc_aspell_word_list_size) (const struct AspellWordList * ths);
static const struct AspellError *(*mc_aspell_error) (const struct AspellCanHaveError * ths);
static int (*mc_aspell_speller_add_to_personal) (struct AspellSpeller * ths, const char *word,
static AspellSpeller *(*mc_to_aspell_speller) (AspellCanHaveError * obj);
static int (*mc_aspell_speller_check) (AspellSpeller * ths, const char *word, int word_size);
static const AspellWordList *(*mc_aspell_speller_suggest) (AspellSpeller * ths,
const char *word, int word_size);
static AspellStringEnumeration *(*mc_aspell_word_list_elements) (const struct AspellWordList * ths);
static const char *(*mc_aspell_config_retrieve) (AspellConfig * ths, const char *key);
static void (*mc_delete_aspell_speller) (AspellSpeller * ths);
static void (*mc_delete_aspell_config) (AspellConfig * ths);
static void (*mc_delete_aspell_can_have_error) (AspellCanHaveError * ths);
static const char *(*mc_aspell_error_message) (const AspellCanHaveError * ths);
static void (*mc_delete_aspell_string_enumeration) (AspellStringEnumeration * ths);
static AspellDictInfoEnumeration *(*mc_aspell_dict_info_list_elements)
(const AspellDictInfoList * ths);
static AspellDictInfoList *(*mc_get_aspell_dict_info_list) (AspellConfig * config);
static const AspellDictInfo *(*mc_aspell_dict_info_enumeration_next)
(AspellDictInfoEnumeration * ths);
static const char *(*mc_aspell_string_enumeration_next) (AspellStringEnumeration * ths);
static void (*mc_delete_aspell_dict_info_enumeration) (AspellDictInfoEnumeration * ths);
static unsigned int (*mc_aspell_word_list_size) (const AspellWordList * ths);
static const AspellError *(*mc_aspell_error) (const AspellCanHaveError * ths);
static int (*mc_aspell_speller_add_to_personal) (AspellSpeller * ths, const char *word,
int word_size);
static int (*mc_aspell_speller_save_all_word_lists) (struct AspellSpeller * ths);
static int (*mc_aspell_speller_save_all_word_lists) (AspellSpeller * ths);
static struct
{

View File

@ -74,7 +74,7 @@
/*** file scope variables ************************************************************************/
static struct WDialog *ch_dlg;
static WDialog *ch_dlg;
static struct
{

View File

@ -281,7 +281,7 @@ info_show_info (WInfo * info)
static void
info_hook (void *data)
{
struct WInfo *info = (struct WInfo *) data;
WInfo *info = (WInfo *) data;
Widget *other_widget;
other_widget = get_panel_widget (get_current_index ());
@ -299,7 +299,7 @@ info_hook (void *data)
static cb_ret_t
info_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *data)
{
struct WInfo *info = (struct WInfo *) w;
WInfo *info = (WInfo *) w;
switch (msg)
{

View File

@ -1006,7 +1006,7 @@ set_display_type (int num, panel_view_mode_t type)
else
file_name = "";
mcview_load ((struct WView *) new_widget, 0, file_name, 0, 0, 0);
mcview_load ((WView *) new_widget, 0, file_name, 0, 0, 0);
break;
default:
@ -1199,7 +1199,7 @@ get_display_type (int idx)
/* --------------------------------------------------------------------------------------------- */
struct Widget *
Widget *
get_panel_widget (int idx)
{
return panels[idx].widget;

View File

@ -70,7 +70,7 @@ int get_current_index (void);
int get_other_index (void);
const char *get_nth_panel_name (int num);
struct Widget *get_panel_widget (int idx);
Widget *get_panel_widget (int idx);
WPanel *get_other_panel (void);

View File

@ -1319,7 +1319,7 @@ sync_tree (const vfs_path_t * vpath)
/* --------------------------------------------------------------------------------------------- */
WTree *
find_tree (struct WDialog *h)
find_tree (WDialog * h)
{
return (WTree *) find_widget_type (h, tree_callback);
}

View File

@ -20,8 +20,6 @@ typedef struct WTree WTree;
extern WTree *the_tree;
extern int xtree_mode;
struct WDialog;
/*** declarations of public functions ************************************************************/
WTree *tree_new (int y, int x, int lines, int cols, gboolean is_panel);
@ -31,7 +29,7 @@ const vfs_path_t *tree_selected_name (const WTree * tree);
void sync_tree (const vfs_path_t * vpath);
WTree *find_tree (struct WDialog *h);
WTree *find_tree (WDialog * h);
/*** inline functions ****************************************************************************/
#endif /* MC__TREE_H */

View File

@ -728,7 +728,7 @@ check_format_var (const char *p, char **v)
/* --------------------------------------------------------------------------------------------- */
char *
expand_format (const struct WEdit *edit_widget, char c, gboolean do_quote)
expand_format (const WEdit * edit_widget, char c, gboolean do_quote)
{
WPanel *panel = NULL;
char *(*quote_func) (const char *, gboolean);
@ -914,7 +914,7 @@ expand_format (const struct WEdit *edit_widget, char c, gboolean do_quote)
*/
gboolean
user_menu_cmd (const struct WEdit * edit_widget, const char *menu_file, int selected_entry)
user_menu_cmd (const WEdit * edit_widget, const char *menu_file, int selected_entry)
{
char *p;
char *data, **entries;

View File

@ -7,20 +7,20 @@
#include "lib/global.h"
#include "src/editor/edit.h" /* WEdit */
/*** typedefs(not structures) and defined constants **********************************************/
/*** enums ***************************************************************************************/
/*** structures declarations (and typedefs of structures)*****************************************/
struct WEdit;
/*** global variables defined in .c file *********************************************************/
/*** declarations of public functions ************************************************************/
gboolean user_menu_cmd (const struct WEdit *edit_widget, const char *menu_file, int selected_entry);
char *expand_format (const struct WEdit *edit_widget, char c, gboolean do_quote);
gboolean user_menu_cmd (const WEdit * edit_widget, const char *menu_file, int selected_entry);
char *expand_format (const WEdit * edit_widget, char c, gboolean do_quote);
int check_format_view (const char *);
int check_format_var (const char *, char **);
int check_format_cd (const char *);

View File

@ -71,7 +71,7 @@ quiet_quit_cmd (void)
}
char *
expand_format (const struct WEdit *edit_widget, char c, gboolean do_quote)
expand_format (const WEdit * edit_widget, char c, gboolean do_quote)
{
(void) edit_widget;
(void) c;