Skip to content

Commit

Permalink
formatting: step 6 - manual tweaks
Browse files Browse the repository at this point in the history
* Reformat tests with magic comma
* Remove macro guards causing unstable formatting

```
find . -type file -name '*.[ch]' | xargs sed -i '' -E 's|# *endif.+//.+$|#endif|g'
```

Signed-off-by: Yury V. Zaytsev <[email protected]>
  • Loading branch information
zyv authored and aborodin committed Feb 1, 2025
1 parent 0233886 commit 6aa575c
Show file tree
Hide file tree
Showing 238 changed files with 3,328 additions and 1,903 deletions.
2 changes: 1 addition & 1 deletion lib/charsets.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,4 @@ str_convert_to_display (const char *str)

/* --------------------------------------------------------------------------------------------- */

#endif // MC__CHARSETS_H
#endif
2 changes: 1 addition & 1 deletion lib/event-types.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,4 @@ typedef struct

/*** inline functions ****************************************************************************/

#endif // MC__EVENT_TYPES_H
#endif
2 changes: 1 addition & 1 deletion lib/event.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ gboolean mc_event_raise (const gchar *, const gchar *, gpointer);

/*** inline functions ****************************************************************************/

#endif // MC__EVENT_H
#endif
2 changes: 1 addition & 1 deletion lib/event/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ mc_event_callback_t *mc_event_is_callback_in_array (GPtrArray *callbacks,
gpointer event_init_data);

/*** inline functions ****************************************************************************/
#endif // MC_EVENT_INTERNAL_H
#endif
2 changes: 1 addition & 1 deletion lib/file-entry.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ typedef struct
/*** inline functions ****************************************************************************/
/* --------------------------------------------------------------------------------------------- */

#endif // MC__FILE_ENTRY_H
#endif
2 changes: 1 addition & 1 deletion lib/filehighlight.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ void mc_fhl_clear (mc_fhl_t *fhl);

/*** inline functions ****************************************************************************/

#endif // MC__FILEHIGHLIGHT_H
#endif
12 changes: 8 additions & 4 deletions lib/filehighlight/ini-file-read.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,14 @@ mc_fhl_parse_get_file_type_id (mc_fhl_t *fhl, const gchar *group_name)
{
mc_fhl_filter_t *mc_filter;

const gchar *types[] = { "FILE", "FILE_EXE", "DIR", "LINK_DIR",
"LINK", "HARDLINK", "SYMLINK", "STALE_LINK",
"DEVICE", "DEVICE_BLOCK", "DEVICE_CHAR", "SPECIAL",
"SPECIAL_SOCKET", "SPECIAL_FIFO", "SPECIAL_DOOR", NULL };
const gchar *types[] = {
"FILE", "FILE_EXE", //
"DIR", "LINK_DIR", //
"LINK", "HARDLINK", "SYMLINK", "STALE_LINK", //
"DEVICE", "DEVICE_BLOCK", "DEVICE_CHAR", //
"SPECIAL", "SPECIAL_SOCKET", "SPECIAL_FIFO", "SPECIAL_DOOR", //
NULL,
};
int i;
gchar *param_type;

Expand Down
2 changes: 1 addition & 1 deletion lib/filehighlight/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ gboolean mc_fhl_init_from_standard_files (mc_fhl_t *fhl);

/*** inline functions ****************************************************************************/

#endif // MC__FILEHIGHLIGHT_INTERNAL_H
#endif
8 changes: 4 additions & 4 deletions lib/glibcompat.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ g_ptr_array_find_with_equal_func (GPtrArray *haystack, gconstpointer needle, GEq

return FALSE;
}
#endif // ! GLIB_CHECK_VERSION (2, 54, 0)
#endif

/* --------------------------------------------------------------------------------------------- */

Expand Down Expand Up @@ -162,7 +162,7 @@ g_clear_list (GList **list_ptr, GDestroyNotify destroy)
}
}

#endif // ! GLIB_CHECK_VERSION (2, 63, 3)
#endif

/* --------------------------------------------------------------------------------------------- */

Expand All @@ -187,7 +187,7 @@ g_queue_clear_full (GQueue *queue, GDestroyNotify free_func)

g_queue_clear (queue);
}
#endif // ! GLIB_CHECK_VERSION (2, 60, 0)
#endif

/* --------------------------------------------------------------------------------------------- */

Expand Down Expand Up @@ -222,7 +222,7 @@ g_string_new_take (char *init)

return string;
}
#endif // ! GLIB_CHECK_VERSION (2, 77, 0)
#endif

/* --------------------------------------------------------------------------------------------- */

Expand Down
12 changes: 6 additions & 6 deletions lib/glibcompat.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#ifndef G_OPTION_ENTRY_NULL
# define G_OPTION_ENTRY_NULL { NULL, '\0', 0, 0, NULL, NULL, NULL }
#endif // G_OPTION_ENTRY_NULL
#endif

/*** enums ***************************************************************************************/

Expand All @@ -18,20 +18,20 @@
#if !GLIB_CHECK_VERSION(2, 54, 0)
gboolean g_ptr_array_find_with_equal_func (GPtrArray *haystack, gconstpointer needle,
GEqualFunc equal_func, guint *index_);
#endif // ! GLIB_CHECK_VERSION (2, 54, 0)
#endif

#if !GLIB_CHECK_VERSION(2, 63, 3)
void g_clear_slist (GSList **slist_ptr, GDestroyNotify destroy);
void g_clear_list (GList **list_ptr, GDestroyNotify destroy);
#endif // ! GLIB_CHECK_VERSION (2, 63, 3)
#endif

#if !GLIB_CHECK_VERSION(2, 60, 0)
void g_queue_clear_full (GQueue *queue, GDestroyNotify free_func);
#endif // ! GLIB_CHECK_VERSION (2, 60, 0)
#endif

#if !GLIB_CHECK_VERSION(2, 77, 0)
GString *g_string_new_take (char *init);
#endif // ! GLIB_CHECK_VERSION (2, 77, 0)
#endif

/* There is no such API in GLib2 */
GString *mc_g_string_copy (GString *dest, const GString *src);
Expand All @@ -44,4 +44,4 @@ GString *mc_g_string_append_c_len (GString *s, gchar c, guint len);

/*** inline functions ****************************************************************************/

#endif // MC_GLIBCOMPAT_H
#endif
14 changes: 7 additions & 7 deletions lib/global.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@
# define SUBSHELL_USE FALSE
# else // SUBSHELL_OPTIONAL
# define SUBSHELL_USE TRUE
# endif // SUBSHELL_OPTIONAL
#else // !ENABLE_SUBSHELL
# endif
#else // !ENABLE_SUBSHELL
# define SUBSHELL_USE FALSE
#endif // !ENABLE_SUBSHELL
#endif

/*** global variables ****************************************************************************/

Expand All @@ -65,15 +65,15 @@ mc_global_t mc_global =
#else
.eight_bit_clean = TRUE,
.full_eight_bits = FALSE,
#endif // !HAVE_CHARSET
#endif
.utf8_display = FALSE,

.message_visible = TRUE,
.keybar_visible = TRUE,

#ifdef ENABLE_BACKGROUND
.we_are_background = FALSE,
#endif // ENABLE_BACKGROUND
#endif

.widget =
{
Expand All @@ -94,13 +94,13 @@ mc_global_t mc_global =
.command_line_colors = NULL,
#ifndef LINUX_CONS_SAVER_C
.console_flag = '\0',
#endif // !LINUX_CONS_SAVER_C
#endif

.use_subshell = SUBSHELL_USE,

#ifdef ENABLE_SUBSHELL
.subshell_pty = 0,
#endif // !ENABLE_SUBSHELL
#endif

.xterm_flag = FALSE,
.disable_x11 = FALSE,
Expand Down
10 changes: 5 additions & 5 deletions lib/global.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
# define bindtextdomain(Domain, Directory) 1
# define _(String) (String)
# define N_(String) (String)
#endif // !ENABLE_NLS
#endif

#ifdef HAVE_FUNC_ATTRIBUTE_FALLTHROUGH
# define MC_FALLTHROUGH __attribute__ ((fallthrough))
Expand Down Expand Up @@ -126,7 +126,7 @@ typedef struct
* This is reported to break on many terminals (xterm, qansi-m).
*/
gboolean full_eight_bits;
#endif // !HAVE_CHARSET
#endif
/*
* If utf-8 terminal utf8_display = TRUE
* Display bits set UTF-8
Expand All @@ -141,7 +141,7 @@ typedef struct
#ifdef ENABLE_BACKGROUND
// If true, this is a background process
gboolean we_are_background;
#endif // ENABLE_BACKGROUND
#endif

struct
{
Expand Down Expand Up @@ -175,14 +175,14 @@ typedef struct
#ifndef LINUX_CONS_SAVER_C
// Used only in mc, not in cons.saver
char console_flag;
#endif // !LINUX_CONS_SAVER_C
#endif
// If using a subshell for evaluating commands this is true
gboolean use_subshell;

#ifdef ENABLE_SUBSHELL
// File descriptors of the pseudoterminal used by the subshell
int subshell_pty;
#endif // !ENABLE_SUBSHELL
#endif

// This flag is set by xterm detection routine in function main()
// It is used by function toggle_subshell()
Expand Down
2 changes: 1 addition & 1 deletion lib/hook.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ gboolean hook_present (hook_t *hook_list, void (*hook_fn) (void *));

/*** inline functions **************************************************/

#endif // MC_HOOK_H
#endif
2 changes: 1 addition & 1 deletion lib/idx.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,4 @@ extern "C"
}
#endif

#endif // _IDX_H
#endif
2 changes: 1 addition & 1 deletion lib/intprops-internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -355,4 +355,4 @@
: (tmin) / (a) < (b)) \
: (tmax) / (b) < (a)))

#endif // _GL_INTPROPS_INTERNAL_H
#endif
2 changes: 1 addition & 1 deletion lib/intprops.h
Original file line number Diff line number Diff line change
Expand Up @@ -305,4 +305,4 @@
#define INT_SUBTRACT_OK(a, b, r) (!INT_SUBTRACT_WRAPV (a, b, r))
#define INT_MULTIPLY_OK(a, b, r) (!INT_MULTIPLY_WRAPV (a, b, r))

#endif // _GL_INTPROPS_H
#endif
6 changes: 3 additions & 3 deletions lib/keybind.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ static name_keymap_t command_names[] = {
ADD_KEYMAP_NAME (SpellCheck),
ADD_KEYMAP_NAME (SpellCheckCurrentWord),
ADD_KEYMAP_NAME (SpellCheckSelectLang),
# endif // HAVE_ASPELL
# endif
ADD_KEYMAP_NAME (BookmarkFlush),
ADD_KEYMAP_NAME (BookmarkNext),
ADD_KEYMAP_NAME (BookmarkPrev),
Expand Down Expand Up @@ -345,7 +345,7 @@ static name_keymap_t command_names[] = {
ADD_KEYMAP_NAME (WindowList),
ADD_KEYMAP_NAME (WindowNext),
ADD_KEYMAP_NAME (WindowPrev),
#endif // USE_INTERNAL_EDIT
#endif

// viewer
ADD_KEYMAP_NAME (WrapMode),
Expand Down Expand Up @@ -374,7 +374,7 @@ static name_keymap_t command_names[] = {
ADD_KEYMAP_NAME (EditOther),
ADD_KEYMAP_NAME (Merge),
ADD_KEYMAP_NAME (MergeOther),
#endif // USE_DIFF_VIEW
#endif

{ NULL, CK_IgnoreKey }
};
Expand Down
2 changes: 1 addition & 1 deletion lib/keybind.h
Original file line number Diff line number Diff line change
Expand Up @@ -364,4 +364,4 @@ long keybind_lookup_keymap_command (const global_keymap_t *keymap, long key);

/*** inline functions ****************************************************************************/

#endif // MC__KEYBIND_H
#endif
2 changes: 1 addition & 1 deletion lib/lock.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ int unlock_file (const vfs_path_t *fname_vpath);

/*** inline functions ****************************************************************************/

#endif // MC_LOCK_H
#endif
2 changes: 1 addition & 1 deletion lib/mcconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,4 @@ void mc_config_history_save (mc_config_t *cfg, const char *name, GList *h);

/*** inline functions ****************************************************************************/

#endif // MC__CONFIG_H
#endif
5 changes: 4 additions & 1 deletion lib/mcconfig/paths.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,10 @@ static const struct
{ &mc_cache_str, EDIT_HOME_TEMP_FILE },
{ &mc_cache_str, EDIT_HOME_BLOCK_FILE },

{ NULL, NULL }
{
NULL,
NULL,
},
};

/* --------------------------------------------------------------------------------------------- */
Expand Down
6 changes: 3 additions & 3 deletions lib/search.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# else
# include <pcre.h>
# endif
#endif // SEARCH_TYPE_PCRE
#endif
/*** typedefs(not structures) and defined constants **********************************************/

typedef enum mc_search_cbret_t mc_search_cbret_t;
Expand Down Expand Up @@ -132,7 +132,7 @@ typedef struct mc_search_struct
# else
int iovector[MC_SEARCH__NUM_REPLACE_ARGS * 2];
# endif
#endif // SEARCH_TYPE_PCRE
#endif

// private data

Expand Down Expand Up @@ -206,4 +206,4 @@ int mc_search_getend_result_by_num (mc_search_t *lc_mc_search, int lc_index);
void mc_search_set_error (mc_search_t *lc_mc_search, mc_search_error_t code, const gchar *format,
...) G_GNUC_PRINTF (3, 4);

#endif // MC__SEARCH_H
#endif
2 changes: 1 addition & 1 deletion lib/search/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,4 @@ GString *mc_search_hex_prepare_replace_str (mc_search_t *lc_mc_search, GString *

/*** inline functions ****************************************************************************/

#endif // MC__SEARCH_INTERNAL_H
#endif
Loading

0 comments on commit 6aa575c

Please sign in to comment.