Skip to content
This repository was archived by the owner on Feb 28, 2025. It is now read-only.

Commit 851a1a2

Browse files
committed
Ticket #4592: migrate to clang-format - step 1: convert comments /* */ -> //
"Safe" automatic replacement and then manual tweaks: ``` find . -type file -name '*.[ch]' | xargs sed -i '' -E '/^\/\*/! s|/\*([^/]+)\*/$|//\1|g' find . -type file -name '*.[ch]' | xargs sed -i '' -E s/ +$// ``` Signed-off-by: Yury V. Zaytsev <[email protected]>
1 parent 0a97ffd commit 851a1a2

File tree

355 files changed

+6143
-6106
lines changed

Some content is hidden

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

355 files changed

+6143
-6106
lines changed

lib/charsets.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@
3434
#include <string.h>
3535

3636
#include "lib/global.h"
37-
#include "lib/strutil.h" /* utf-8 functions */
37+
#include "lib/strutil.h" // utf-8 functions
3838
#include "lib/fileloc.h"
39-
#include "lib/util.h" /* whitespace() */
39+
#include "lib/util.h" // whitespace()
4040

4141
#include "lib/charsets.h"
4242

@@ -106,7 +106,7 @@ load_codepages_list_from_file (GPtrArray **list, const char *fname)
106106

107107
while (fgets (buf, sizeof buf, f) != NULL)
108108
{
109-
/* split string into id and cpname */
109+
// split string into id and cpname
110110
char *p = buf;
111111
size_t buflen;
112112

@@ -142,8 +142,8 @@ load_codepages_list_from_file (GPtrArray **list, const char *fname)
142142
{
143143
unsigned int i;
144144

145-
/* whether id is already present in list */
146-
/* if yes, overwrite description */
145+
// whether id is already present in list
146+
// if yes, overwrite description
147147
for (i = 0; i < (*list)->len; i++)
148148
{
149149
codepage_desc *desc;
@@ -152,14 +152,14 @@ load_codepages_list_from_file (GPtrArray **list, const char *fname)
152152

153153
if (strcmp (id, desc->id) == 0)
154154
{
155-
/* found */
155+
// found
156156
g_free (desc->name);
157157
desc->name = g_strdup (p);
158158
break;
159159
}
160160
}
161161

162-
/* not found */
162+
// not found
163163
if (i == (*list)->len)
164164
g_ptr_array_add (*list, new_codepage_desc (id, p));
165165
}
@@ -203,19 +203,19 @@ load_codepages_list (void)
203203
{
204204
char *fname;
205205

206-
/* 1: try load /usr/share/mc/mc.charsets */
206+
// 1: try load /usr/share/mc/mc.charsets
207207
fname = g_build_filename (mc_global.share_data_dir, CHARSETS_LIST, (char *) NULL);
208208
load_codepages_list_from_file (&codepages, fname);
209209
g_free (fname);
210210

211-
/* 2: try load /etc/mc/mc.charsets */
211+
// 2: try load /etc/mc/mc.charsets
212212
fname = g_build_filename (mc_global.sysconfig_dir, CHARSETS_LIST, (char *) NULL);
213213
load_codepages_list_from_file (&codepages, fname);
214214
g_free (fname);
215215

216216
if (codepages == NULL)
217217
{
218-
/* files are not found, add default codepage */
218+
// files are not found, add default codepage
219219
fprintf (stderr, "%s\n", _("Warning: cannot load codepages list"));
220220

221221
codepages = g_ptr_array_new_with_free_func (free_codepage_desc);
@@ -229,7 +229,7 @@ void
229229
free_codepages_list (void)
230230
{
231231
g_ptr_array_free (codepages, TRUE);
232-
/* NULL-ize pointer to make unit tests happy */
232+
// NULL-ize pointer to make unit tests happy
233233
codepages = NULL;
234234
}
235235

@@ -288,7 +288,7 @@ init_translation_table (int cpsource, int cpdisplay)
288288
int i;
289289
GIConv cd;
290290

291-
/* Fill input <-> display tables */
291+
// Fill input <-> display tables
292292

293293
if (cpsource < 0 || cpdisplay < 0 || cpsource == cpdisplay)
294294
{
@@ -309,7 +309,7 @@ init_translation_table (int cpsource, int cpdisplay)
309309
cp_source = ((codepage_desc *) g_ptr_array_index (codepages, cpsource))->id;
310310
cp_display = ((codepage_desc *) g_ptr_array_index (codepages, cpdisplay))->id;
311311

312-
/* display <- inpit table */
312+
// display <- inpit table
313313

314314
cd = g_iconv_open (cp_display, cp_source);
315315
if (cd == INVALID_CONV)
@@ -320,7 +320,7 @@ init_translation_table (int cpsource, int cpdisplay)
320320

321321
g_iconv_close (cd);
322322

323-
/* inpit <- display table */
323+
// inpit <- display table
324324

325325
cd = g_iconv_open (cp_source, cp_display);
326326
if (cd == INVALID_CONV)

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 // MC__CHARSETS_H

lib/event-types.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ struct Widget;
7272
typedef struct
7373
{
7474
struct mc_config_t *cfg;
75-
struct Widget *receiver; /* NULL means broadcast message */
75+
struct Widget *receiver; // NULL means broadcast message
7676
} ev_history_load_save_t;
7777

7878
/*** global variables defined in .c file *********************************************************/
@@ -81,4 +81,4 @@ typedef struct
8181

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

84-
#endif /* MC__EVENT_TYPES_H */
84+
#endif // MC__EVENT_TYPES_H

lib/event.h

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

4646
/*** inline functions ****************************************************************************/
4747

48-
#endif /* MC__EVENT_H */
48+
#endif // MC__EVENT_H

lib/event/internal.h

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

3131
/*** inline functions ****************************************************************************/
32-
#endif /* MC_EVENT_INTERNAL_H */
32+
#endif // MC_EVENT_INTERNAL_H

lib/file-entry.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#include <sys/types.h>
99
#include <sys/stat.h>
1010

11-
#include "lib/global.h" /* include <glib.h> */
11+
#include "lib/global.h" // include <glib.h>
1212

1313
/*** typedefs(not structures) and defined constants **********************************************/
1414

@@ -19,22 +19,22 @@
1919
/* keys are set only during sorting */
2020
typedef struct
2121
{
22-
/* File name */
22+
// File name
2323
GString *fname;
24-
/* File attributes */
24+
// File attributes
2525
struct stat st;
26-
/* Key used for comparing names */
26+
// Key used for comparing names
2727
char *name_sort_key;
28-
/* Key used for comparing extensions */
28+
// Key used for comparing extensions
2929
char *extension_sort_key;
3030

31-
/* Flags */
31+
// Flags
3232
struct
3333
{
34-
unsigned int marked:1; /* File marked in pane window */
35-
unsigned int link_to_dir:1; /* If this is a link, does it point to directory? */
36-
unsigned int stale_link:1; /* If this is a symlink and points to Charon's land */
37-
unsigned int dir_size_computed:1; /* Size of directory was computed with dirsizes_cmd */
34+
unsigned int marked:1; // File marked in pane window
35+
unsigned int link_to_dir:1; // If this is a link, does it point to directory?
36+
unsigned int stale_link:1; // If this is a symlink and points to Charon's land
37+
unsigned int dir_size_computed:1; // Size of directory was computed with dirsizes_cmd
3838
} f;
3939
} file_entry_t;
4040

@@ -46,4 +46,4 @@ typedef struct
4646
/*** inline functions ****************************************************************************/
4747
/* --------------------------------------------------------------------------------------------- */
4848

49-
#endif /* MC__FILE_ENTRY_H */
49+
#endif // MC__FILE_ENTRY_H

lib/filehighlight.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef MC__FILEHIGHLIGHT_H
22
#define MC__FILEHIGHLIGHT_H
33

4-
#include "lib/mcconfig.h" /* mc_config_t */
4+
#include "lib/mcconfig.h" // mc_config_t
55
#include "lib/file-entry.h"
66

77
/*** typedefs(not structures) and defined constants **********************************************/
@@ -31,4 +31,4 @@ void mc_fhl_clear (mc_fhl_t * fhl);
3131

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

34-
#endif /* MC__FILEHIGHLIGHT_H */
34+
#endif // MC__FILEHIGHLIGHT_H

lib/filehighlight/common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#include <config.h>
2828

2929
#include "lib/global.h"
30-
#include "lib/util.h" /* MC_PTR_FREE */
30+
#include "lib/util.h" // MC_PTR_FREE
3131

3232
#include "lib/filehighlight.h"
3333

lib/filehighlight/get-color.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
#include "lib/global.h"
3131
#include "lib/skin.h"
32-
#include "lib/util.h" /* is_exe() */
32+
#include "lib/util.h" // is_exe()
3333
#include "lib/filehighlight.h"
3434
#include "internal.h"
3535

lib/filehighlight/ini-file-read.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#include "lib/fileloc.h"
3232
#include "lib/strutil.h"
3333
#include "lib/skin.h"
34-
#include "lib/util.h" /* exist_file() */
34+
#include "lib/util.h" // exist_file()
3535

3636
#include "lib/filehighlight.h"
3737

@@ -206,21 +206,21 @@ mc_fhl_init_from_standard_files (mc_fhl_t *fhl)
206206
gchar *name;
207207
gboolean ok;
208208

209-
/* ${XDG_CONFIG_HOME}/mc/filehighlight.ini */
209+
// ${XDG_CONFIG_HOME}/mc/filehighlight.ini
210210
name = mc_config_get_full_path (MC_FHL_INI_FILE);
211211
ok = mc_fhl_read_ini_file (fhl, name);
212212
g_free (name);
213213
if (ok)
214214
return TRUE;
215215

216-
/* ${sysconfdir}/mc/filehighlight.ini */
216+
// ${sysconfdir}/mc/filehighlight.ini
217217
name = g_build_filename (mc_global.sysconfig_dir, MC_FHL_INI_FILE, (char *) NULL);
218218
ok = mc_fhl_read_ini_file (fhl, name);
219219
g_free (name);
220220
if (ok)
221221
return TRUE;
222222

223-
/* ${datadir}/mc/filehighlight.ini */
223+
// ${datadir}/mc/filehighlight.ini
224224
name = g_build_filename (mc_global.share_data_dir, MC_FHL_INI_FILE, (char *) NULL);
225225
ok = mc_fhl_read_ini_file (fhl, name);
226226
g_free (name);
@@ -245,17 +245,17 @@ mc_fhl_parse_ini_file (mc_fhl_t *fhl)
245245
{
246246
if (mc_config_has_param (fhl->config, *group_names, "type"))
247247
{
248-
/* parse filetype filter */
248+
// parse filetype filter
249249
mc_fhl_parse_get_file_type_id (fhl, *group_names);
250250
}
251251
if (mc_config_has_param (fhl->config, *group_names, "regexp"))
252252
{
253-
/* parse regexp filter */
253+
// parse regexp filter
254254
mc_fhl_parse_get_regexp (fhl, *group_names);
255255
}
256256
if (mc_config_has_param (fhl->config, *group_names, "extensions"))
257257
{
258-
/* parse extensions filter */
258+
// parse extensions filter
259259
mc_fhl_parse_get_extensions (fhl, *group_names);
260260
}
261261
}

0 commit comments

Comments
 (0)