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
229229free_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 :
0 commit comments