Skip to content

Commit 8406bdd

Browse files
committed
formatting: step 6 - manual tweaks
* 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]>
1 parent 8cf79c8 commit 8406bdd

File tree

247 files changed

+3850
-2232
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

247 files changed

+3850
-2232
lines changed

lib/charsets.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,4 @@ str_convert_to_display (const char *str)
110110

111111
/* --------------------------------------------------------------------------------------------- */
112112

113-
#endif // MC__CHARSETS_H
113+
#endif

lib/event-types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,4 @@ typedef struct
8181

8282
/*** inline functions ****************************************************************************/
8383

84-
#endif // MC__EVENT_TYPES_H
84+
#endif

lib/event.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,4 @@ gboolean mc_event_raise (const gchar *, const gchar *, gpointer);
4343

4444
/*** inline functions ****************************************************************************/
4545

46-
#endif // MC__EVENT_H
46+
#endif

lib/event/internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ mc_event_callback_t *mc_event_is_callback_in_array (GPtrArray *callbacks,
2828
gpointer event_init_data);
2929

3030
/*** inline functions ****************************************************************************/
31-
#endif // MC_EVENT_INTERNAL_H
31+
#endif

lib/file-entry.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,4 @@ typedef struct
4646
/*** inline functions ****************************************************************************/
4747
/* --------------------------------------------------------------------------------------------- */
4848

49-
#endif // MC__FILE_ENTRY_H
49+
#endif

lib/filehighlight.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ void mc_fhl_clear (mc_fhl_t *fhl);
3131

3232
/*** inline functions ****************************************************************************/
3333

34-
#endif // MC__FILEHIGHLIGHT_H
34+
#endif

lib/filehighlight/ini-file-read.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,14 @@ mc_fhl_parse_get_file_type_id (mc_fhl_t *fhl, const gchar *group_name)
6666
{
6767
mc_fhl_filter_t *mc_filter;
6868

69-
const gchar *types[] = { "FILE", "FILE_EXE", "DIR", "LINK_DIR",
70-
"LINK", "HARDLINK", "SYMLINK", "STALE_LINK",
71-
"DEVICE", "DEVICE_BLOCK", "DEVICE_CHAR", "SPECIAL",
72-
"SPECIAL_SOCKET", "SPECIAL_FIFO", "SPECIAL_DOOR", NULL };
69+
const gchar *types[] = {
70+
"FILE", "FILE_EXE", //
71+
"DIR", "LINK_DIR", //
72+
"LINK", "HARDLINK", "SYMLINK", "STALE_LINK", //
73+
"DEVICE", "DEVICE_BLOCK", "DEVICE_CHAR", //
74+
"SPECIAL", "SPECIAL_SOCKET", "SPECIAL_FIFO", "SPECIAL_DOOR", //
75+
NULL,
76+
};
7377
int i;
7478
gchar *param_type;
7579

lib/filehighlight/internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,4 @@ gboolean mc_fhl_init_from_standard_files (mc_fhl_t *fhl);
5858

5959
/*** inline functions ****************************************************************************/
6060

61-
#endif // MC__FILEHIGHLIGHT_INTERNAL_H
61+
#endif

lib/glibcompat.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ g_ptr_array_find_with_equal_func (GPtrArray *haystack, gconstpointer needle, GEq
9797

9898
return FALSE;
9999
}
100-
#endif // ! GLIB_CHECK_VERSION (2, 54, 0)
100+
#endif
101101

102102
/* --------------------------------------------------------------------------------------------- */
103103

@@ -162,7 +162,7 @@ g_clear_list (GList **list_ptr, GDestroyNotify destroy)
162162
}
163163
}
164164

165-
#endif // ! GLIB_CHECK_VERSION (2, 63, 3)
165+
#endif
166166

167167
/* --------------------------------------------------------------------------------------------- */
168168

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

188188
g_queue_clear (queue);
189189
}
190-
#endif // ! GLIB_CHECK_VERSION (2, 60, 0)
190+
#endif
191191

192192
/* --------------------------------------------------------------------------------------------- */
193193

@@ -222,7 +222,7 @@ g_string_new_take (char *init)
222222

223223
return string;
224224
}
225-
#endif // ! GLIB_CHECK_VERSION (2, 77, 0)
225+
#endif
226226

227227
/* --------------------------------------------------------------------------------------------- */
228228

lib/glibcompat.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
#ifndef G_OPTION_ENTRY_NULL
77
# define G_OPTION_ENTRY_NULL { NULL, '\0', 0, 0, NULL, NULL, NULL }
8-
#endif // G_OPTION_ENTRY_NULL
8+
#endif
99

1010
/*** enums ***************************************************************************************/
1111

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

2323
#if !GLIB_CHECK_VERSION(2, 63, 3)
2424
void g_clear_slist (GSList **slist_ptr, GDestroyNotify destroy);
2525
void g_clear_list (GList **list_ptr, GDestroyNotify destroy);
26-
#endif // ! GLIB_CHECK_VERSION (2, 63, 3)
26+
#endif
2727

2828
#if !GLIB_CHECK_VERSION(2, 60, 0)
2929
void g_queue_clear_full (GQueue *queue, GDestroyNotify free_func);
30-
#endif // ! GLIB_CHECK_VERSION (2, 60, 0)
30+
#endif
3131

3232
#if !GLIB_CHECK_VERSION(2, 77, 0)
3333
GString *g_string_new_take (char *init);
34-
#endif // ! GLIB_CHECK_VERSION (2, 77, 0)
34+
#endif
3535

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

4545
/*** inline functions ****************************************************************************/
4646

47-
#endif // MC_GLIBCOMPAT_H
47+
#endif

lib/global.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@
3939
# define SUBSHELL_USE FALSE
4040
# else // SUBSHELL_OPTIONAL
4141
# define SUBSHELL_USE TRUE
42-
# endif // SUBSHELL_OPTIONAL
43-
#else // !ENABLE_SUBSHELL
42+
# endif
43+
#else // !ENABLE_SUBSHELL
4444
# define SUBSHELL_USE FALSE
45-
#endif // !ENABLE_SUBSHELL
45+
#endif
4646

4747
/*** global variables ****************************************************************************/
4848

@@ -65,15 +65,15 @@ mc_global_t mc_global =
6565
#else
6666
.eight_bit_clean = TRUE,
6767
.full_eight_bits = FALSE,
68-
#endif // !HAVE_CHARSET
68+
#endif
6969
.utf8_display = FALSE,
7070

7171
.message_visible = TRUE,
7272
.keybar_visible = TRUE,
7373

7474
#ifdef ENABLE_BACKGROUND
7575
.we_are_background = FALSE,
76-
#endif // ENABLE_BACKGROUND
76+
#endif
7777

7878
.widget =
7979
{
@@ -94,13 +94,13 @@ mc_global_t mc_global =
9494
.command_line_colors = NULL,
9595
#ifndef LINUX_CONS_SAVER_C
9696
.console_flag = '\0',
97-
#endif // !LINUX_CONS_SAVER_C
97+
#endif
9898

9999
.use_subshell = SUBSHELL_USE,
100100

101101
#ifdef ENABLE_SUBSHELL
102102
.subshell_pty = 0,
103-
#endif // !ENABLE_SUBSHELL
103+
#endif
104104

105105
.xterm_flag = FALSE,
106106
.disable_x11 = FALSE,

lib/global.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
# define bindtextdomain(Domain, Directory) 1
4343
# define _(String) (String)
4444
# define N_(String) (String)
45-
#endif // !ENABLE_NLS
45+
#endif
4646

4747
#ifdef HAVE_FUNC_ATTRIBUTE_FALLTHROUGH
4848
# define MC_FALLTHROUGH __attribute__ ((fallthrough))
@@ -126,7 +126,7 @@ typedef struct
126126
* This is reported to break on many terminals (xterm, qansi-m).
127127
*/
128128
gboolean full_eight_bits;
129-
#endif // !HAVE_CHARSET
129+
#endif
130130
/*
131131
* If utf-8 terminal utf8_display = TRUE
132132
* Display bits set UTF-8
@@ -141,7 +141,7 @@ typedef struct
141141
#ifdef ENABLE_BACKGROUND
142142
// If true, this is a background process
143143
gboolean we_are_background;
144-
#endif // ENABLE_BACKGROUND
144+
#endif
145145

146146
struct
147147
{
@@ -175,14 +175,14 @@ typedef struct
175175
#ifndef LINUX_CONS_SAVER_C
176176
// Used only in mc, not in cons.saver
177177
char console_flag;
178-
#endif // !LINUX_CONS_SAVER_C
178+
#endif
179179
// If using a subshell for evaluating commands this is true
180180
gboolean use_subshell;
181181

182182
#ifdef ENABLE_SUBSHELL
183183
// File descriptors of the pseudoterminal used by the subshell
184184
int subshell_pty;
185-
#endif // !ENABLE_SUBSHELL
185+
#endif
186186

187187
// This flag is set by xterm detection routine in function main()
188188
// It is used by function toggle_subshell()

lib/hook.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ gboolean hook_present (hook_t *hook_list, void (*hook_fn) (void *));
3131

3232
/*** inline functions **************************************************/
3333

34-
#endif // MC_HOOK_H
34+
#endif

lib/idx.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,4 +140,4 @@ extern "C"
140140
}
141141
#endif
142142

143-
#endif // _IDX_H
143+
#endif

lib/intprops-internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,4 +355,4 @@
355355
: (tmin) / (a) < (b)) \
356356
: (tmax) / (b) < (a)))
357357

358-
#endif // _GL_INTPROPS_INTERNAL_H
358+
#endif

lib/intprops.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,4 +305,4 @@
305305
#define INT_SUBTRACT_OK(a, b, r) (!INT_SUBTRACT_WRAPV (a, b, r))
306306
#define INT_MULTIPLY_OK(a, b, r) (!INT_MULTIPLY_WRAPV (a, b, r))
307307

308-
#endif // _GL_INTPROPS_H
308+
#endif

lib/keybind.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ static name_keymap_t command_names[] = {
304304
ADD_KEYMAP_NAME (SpellCheck),
305305
ADD_KEYMAP_NAME (SpellCheckCurrentWord),
306306
ADD_KEYMAP_NAME (SpellCheckSelectLang),
307-
# endif // HAVE_ASPELL
307+
# endif
308308
ADD_KEYMAP_NAME (BookmarkFlush),
309309
ADD_KEYMAP_NAME (BookmarkNext),
310310
ADD_KEYMAP_NAME (BookmarkPrev),
@@ -345,7 +345,7 @@ static name_keymap_t command_names[] = {
345345
ADD_KEYMAP_NAME (WindowList),
346346
ADD_KEYMAP_NAME (WindowNext),
347347
ADD_KEYMAP_NAME (WindowPrev),
348-
#endif // USE_INTERNAL_EDIT
348+
#endif
349349

350350
// viewer
351351
ADD_KEYMAP_NAME (WrapMode),
@@ -374,7 +374,7 @@ static name_keymap_t command_names[] = {
374374
ADD_KEYMAP_NAME (EditOther),
375375
ADD_KEYMAP_NAME (Merge),
376376
ADD_KEYMAP_NAME (MergeOther),
377-
#endif // USE_DIFF_VIEW
377+
#endif
378378

379379
{ NULL, CK_IgnoreKey }
380380
};

lib/keybind.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,4 +364,4 @@ long keybind_lookup_keymap_command (const global_keymap_t *keymap, long key);
364364

365365
/*** inline functions ****************************************************************************/
366366

367-
#endif // MC__KEYBIND_H
367+
#endif

lib/lock.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ int unlock_file (const vfs_path_t *fname_vpath);
2626

2727
/*** inline functions ****************************************************************************/
2828

29-
#endif // MC_LOCK_H
29+
#endif

lib/mcconfig.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,4 +107,4 @@ void mc_config_history_save (mc_config_t *cfg, const char *name, GList *h);
107107

108108
/*** inline functions ****************************************************************************/
109109

110-
#endif // MC__CONFIG_H
110+
#endif

lib/mcconfig/paths.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,10 @@ static const struct
9292
{ &mc_cache_str, EDIT_HOME_TEMP_FILE },
9393
{ &mc_cache_str, EDIT_HOME_BLOCK_FILE },
9494

95-
{ NULL, NULL }
95+
{
96+
NULL,
97+
NULL,
98+
},
9699
};
97100

98101
/* --------------------------------------------------------------------------------------------- */

lib/search.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# else
1515
# include <pcre.h>
1616
# endif
17-
#endif // SEARCH_TYPE_PCRE
17+
#endif
1818
/*** typedefs(not structures) and defined constants **********************************************/
1919

2020
typedef enum mc_search_cbret_t mc_search_cbret_t;
@@ -132,7 +132,7 @@ typedef struct mc_search_struct
132132
# else
133133
int iovector[MC_SEARCH__NUM_REPLACE_ARGS * 2];
134134
# endif
135-
#endif // SEARCH_TYPE_PCRE
135+
#endif
136136

137137
// private data
138138

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

209-
#endif // MC__SEARCH_H
209+
#endif

lib/search/internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,4 @@ GString *mc_search_hex_prepare_replace_str (mc_search_t *lc_mc_search, GString *
8383

8484
/*** inline functions ****************************************************************************/
8585

86-
#endif // MC__SEARCH_INTERNAL_H
86+
#endif

0 commit comments

Comments
 (0)