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

Commit e51e34f

Browse files
committed
formatting: step 4 - reformat all files
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
1 parent adc49f0 commit e51e34f

File tree

372 files changed

+15972
-18118
lines changed

Some content is hidden

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

372 files changed

+15972
-18118
lines changed

lib/charsets.c

Lines changed: 24 additions & 24 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

@@ -52,7 +52,7 @@ const char *cp_source = NULL;
5252

5353
/*** file scope macro definitions ****************************************************************/
5454

55-
#define UNKNCHAR '\001'
55+
#define UNKNCHAR '\001'
5656

5757
#define OTHER_8BIT "Other_8_bit"
5858

@@ -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
}
@@ -172,7 +172,7 @@ load_codepages_list_from_file (GPtrArray **list, const char *fname)
172172
g_free (default_codepage);
173173
}
174174

175-
fail:
175+
fail:
176176
fclose (f);
177177
}
178178

@@ -215,11 +215,11 @@ load_codepages_list (void)
215215

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

221221
codepages = g_ptr_array_new_with_free_func (free_codepage_desc);
222-
g_ptr_array_add (codepages, new_codepage_desc (DEFAULT_CHARSET, _("7-bit ASCII")));
222+
g_ptr_array_add (codepages, new_codepage_desc (DEFAULT_CHARSET, _ ("7-bit ASCII")));
223223
}
224224
}
225225

@@ -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,22 +309,22 @@ 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)
316-
return g_strdup_printf (_("Cannot translate from %s to %s"), cp_source, cp_display);
316+
return g_strdup_printf (_ ("Cannot translate from %s to %s"), cp_source, cp_display);
317317

318318
for (i = 128; i <= 255; ++i)
319319
conv_displ[i] = translate_character (cd, i);
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)
327-
return g_strdup_printf (_("Cannot translate from %s to %s"), cp_display, cp_source);
327+
return g_strdup_printf (_ ("Cannot translate from %s to %s"), cp_display, cp_source);
328328

329329
for (i = 128; i <= 255; ++i)
330330
{
@@ -489,13 +489,13 @@ convert_from_8bit_to_utf_c (char input_char, GIConv conv)
489489
switch (str_translate_char (conv, (char *) str, -1, (char *) buf_ch, sizeof (buf_ch)))
490490
{
491491
case ESTR_SUCCESS:
492-
{
493-
int res;
492+
{
493+
int res;
494494

495-
res = g_utf8_get_char_validated ((char *) buf_ch, -1);
496-
ch = res >= 0 ? res : buf_ch[0];
497-
break;
498-
}
495+
res = g_utf8_get_char_validated ((char *) buf_ch, -1);
496+
ch = res >= 0 ? res : buf_ch[0];
497+
break;
498+
}
499499
case ESTR_PROBLEM:
500500
case ESTR_FAILURE:
501501
default:

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: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
/*** typedefs(not structures) and defined constants **********************************************/
77

88
/* Event groups for main modules */
9-
#define MCEVENT_GROUP_CORE "Core"
10-
#define MCEVENT_GROUP_DIALOG "Dialog"
11-
#define MCEVENT_GROUP_DIFFVIEWER "DiffViewer"
12-
#define MCEVENT_GROUP_EDITOR "Editor"
9+
#define MCEVENT_GROUP_CORE "Core"
10+
#define MCEVENT_GROUP_DIALOG "Dialog"
11+
#define MCEVENT_GROUP_DIFFVIEWER "DiffViewer"
12+
#define MCEVENT_GROUP_EDITOR "Editor"
1313
#define MCEVENT_GROUP_FILEMANAGER "FileManager"
14-
#define MCEVENT_GROUP_VIEWER "Viewer"
14+
#define MCEVENT_GROUP_VIEWER "Viewer"
1515

1616
/* Events */
1717
#define MCEVENT_HISTORY_LOAD "history_load"
@@ -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: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,25 +24,23 @@ typedef struct
2424
/*** declarations of public functions ************************************************************/
2525

2626
/* event.c: */
27-
gboolean mc_event_init (GError ** mcerror);
28-
gboolean mc_event_deinit (GError ** mcerror);
29-
27+
gboolean mc_event_init (GError **mcerror);
28+
gboolean mc_event_deinit (GError **mcerror);
3029

3130
/* manage.c: */
32-
gboolean mc_event_add (const gchar * event_group_name, const gchar * event_name,
31+
gboolean mc_event_add (const gchar *event_group_name, const gchar *event_name,
3332
mc_event_callback_func_t event_callback, gpointer event_init_data,
34-
GError ** mcerror);
35-
void mc_event_del (const gchar * event_group_name, const gchar * event_name,
33+
GError **mcerror);
34+
void mc_event_del (const gchar *event_group_name, const gchar *event_name,
3635
mc_event_callback_func_t event_callback, gpointer event_init_data);
37-
void mc_event_destroy (const gchar * event_group_name, const gchar * event_name);
38-
void mc_event_group_del (const gchar * event_group_name);
39-
gboolean mc_event_present (const gchar * event_group_name, const gchar * event_name);
40-
gboolean mc_event_mass_add (const event_init_t * events, GError ** mcerror);
36+
void mc_event_destroy (const gchar *event_group_name, const gchar *event_name);
37+
void mc_event_group_del (const gchar *event_group_name);
38+
gboolean mc_event_present (const gchar *event_group_name, const gchar *event_name);
39+
gboolean mc_event_mass_add (const event_init_t *events, GError **mcerror);
4140

4241
/* raise.c: */
4342
gboolean mc_event_raise (const gchar *, const gchar *, gpointer);
4443

45-
4644
/*** inline functions ****************************************************************************/
4745

48-
#endif // MC__EVENT_H
46+
#endif // MC__EVENT_H

lib/event/event.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,16 @@ mc_event_init (GError **mcerror)
5454

5555
if (mc_event_grouplist != NULL)
5656
{
57-
mc_propagate_error (mcerror, 0, "%s", _("Event system already initialized"));
57+
mc_propagate_error (mcerror, 0, "%s", _ ("Event system already initialized"));
5858
return FALSE;
5959
}
6060

61-
mc_event_grouplist =
62-
g_tree_new_full ((GCompareDataFunc) g_ascii_strcasecmp,
63-
NULL, (GDestroyNotify) g_free, (GDestroyNotify) g_tree_destroy);
61+
mc_event_grouplist = g_tree_new_full ((GCompareDataFunc) g_ascii_strcasecmp, NULL,
62+
(GDestroyNotify) g_free, (GDestroyNotify) g_tree_destroy);
6463

6564
if (mc_event_grouplist == NULL)
6665
{
67-
mc_propagate_error (mcerror, 0, "%s", _("Failed to initialize event system"));
66+
mc_propagate_error (mcerror, 0, "%s", _ ("Failed to initialize event system"));
6867
return FALSE;
6968
}
7069

@@ -80,7 +79,7 @@ mc_event_deinit (GError **mcerror)
8079

8180
if (mc_event_grouplist == NULL)
8281
{
83-
mc_propagate_error (mcerror, 0, "%s", _("Event system not initialized"));
82+
mc_propagate_error (mcerror, 0, "%s", _ ("Event system not initialized"));
8483
return FALSE;
8584
}
8685

@@ -100,8 +99,7 @@ mc_event_mass_add (const event_init_t *events, GError **mcerror)
10099

101100
for (array_index = 0; events[array_index].event_group_name != NULL; array_index++)
102101
{
103-
if (!mc_event_add (events[array_index].event_group_name,
104-
events[array_index].event_name,
102+
if (!mc_event_add (events[array_index].event_group_name, events[array_index].event_name,
105103
events[array_index].cb, events[array_index].init_data, mcerror))
106104
{
107105
return FALSE;

lib/event/internal.h

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,19 @@ typedef struct mc_event_callback_struct
1313
mc_event_callback_func_t callback;
1414
} mc_event_callback_t;
1515

16-
1716
/*** global variables defined in .c file *******************************/
1817

1918
extern GTree *mc_event_grouplist;
2019

2120
/*** declarations of public functions **********************************/
2221

23-
GTree *mc_event_get_event_group_by_name (const gchar * event_group_name, gboolean create_new,
24-
GError ** mcerror);
25-
GPtrArray *mc_event_get_event_by_name (GTree * event_group, const gchar * event_name,
26-
gboolean create_new, GError ** mcerror);
27-
mc_event_callback_t *mc_event_is_callback_in_array (GPtrArray * callbacks,
22+
GTree *mc_event_get_event_group_by_name (const gchar *event_group_name, gboolean create_new,
23+
GError **mcerror);
24+
GPtrArray *mc_event_get_event_by_name (GTree *event_group, const gchar *event_name,
25+
gboolean create_new, GError **mcerror);
26+
mc_event_callback_t *mc_event_is_callback_in_array (GPtrArray *callbacks,
2827
mc_event_callback_func_t event_callback,
2928
gpointer event_init_data);
3029

3130
/*** inline functions ****************************************************************************/
32-
#endif // MC_EVENT_INTERNAL_H
31+
#endif // MC_EVENT_INTERNAL_H

lib/event/manage.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ mc_event_add (const gchar *event_group_name, const gchar *event_name,
6969
if (mc_event_grouplist == NULL || event_group_name == NULL || event_name == NULL
7070
|| event_callback == NULL)
7171
{
72-
mc_propagate_error (mcerror, 0, "%s", _("Check input data! Some of parameters are NULL!"));
72+
mc_propagate_error (mcerror, 0, "%s", _ ("Check input data! Some of parameters are NULL!"));
7373
return FALSE;
7474
}
7575

@@ -157,13 +157,11 @@ mc_event_get_event_group_by_name (const gchar *event_group_name, gboolean create
157157
if (event_group == NULL && create_new)
158158
{
159159
event_group =
160-
g_tree_new_full ((GCompareDataFunc) g_ascii_strcasecmp,
161-
NULL,
162-
(GDestroyNotify) g_free,
160+
g_tree_new_full ((GCompareDataFunc) g_ascii_strcasecmp, NULL, (GDestroyNotify) g_free,
163161
(GDestroyNotify) mc_event_group_destroy_value);
164162
if (event_group == NULL)
165163
{
166-
mc_propagate_error (mcerror, 0, _("Unable to create group '%s' for events!"),
164+
mc_propagate_error (mcerror, 0, _ ("Unable to create group '%s' for events!"),
167165
event_group_name);
168166
return NULL;
169167
}
@@ -188,7 +186,7 @@ mc_event_get_event_by_name (GTree *event_group, const gchar *event_name, gboolea
188186
callbacks = g_ptr_array_new_with_free_func (g_free);
189187
if (callbacks == NULL)
190188
{
191-
mc_propagate_error (mcerror, 0, _("Unable to create event '%s'!"), event_name);
189+
mc_propagate_error (mcerror, 0, _ ("Unable to create event '%s'!"), event_name);
192190
return NULL;
193191
}
194192
g_tree_insert (event_group, g_strdup (event_name), (gpointer) callbacks);

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

0 commit comments

Comments
 (0)