POSIX.1 National Language Support API for MinGW
Revisão | 2b7377d3dfecb79882b3d67ea4d50aaf897a557a (tree) |
---|---|
Hora | 2007-11-10 23:34:45 |
Autor | Keith Marshall <keithmarshall@user...> |
Commiter | Keith Marshall |
Relocate misplaced declaration statements to precede assignments or function calls, within their containing scopes.
@@ -1,3 +1,15 @@ | ||
1 | +2007-09-22 Charles Wilson <cwilso11@users.sourceforge.net> | |
2 | + | |
3 | + Relocate misplaced declaration statements to precede assignments or | |
4 | + function calls, within their containing scopes. | |
5 | + | |
6 | + * catopen.c (mc_open): Relocate `retval' declaration, at top level. | |
7 | + (mc_nlspath_open): Relocate `break_code' declaration within enclosing | |
8 | + `if' block. | |
9 | + | |
10 | + * mcsource.c (mc_source): Declare `len' before `dfprintf', within | |
11 | + enclosing `if' block. | |
12 | + | |
1 | 13 | 2007-08-17 Keith Marshall <keithmarshall@users.sourceforge.net> |
2 | 14 | |
3 | 15 | Avoid a potential segmentation fault. |
@@ -9,7 +9,7 @@ | ||
9 | 9 | * POSIX compatible national language message catalogues in MinGW. |
10 | 10 | * |
11 | 11 | * Written by Keith Marshall <keithmarshall@users.sourceforge.net> |
12 | - * Last modification: 08-Aug-2007 | |
12 | + * Last modification: 22-Sept-2007 | |
13 | 13 | * |
14 | 14 | * |
15 | 15 | * This is free software. It is provided AS IS, in the hope that it may |
@@ -330,8 +330,8 @@ int mc_nlspath_open( __const char *msgcat, unsigned flags ) | ||
330 | 330 | || ((nls_locale = mc_nl_cat_locale_getenv( flags )) != NULL) |
331 | 331 | || ((nls_locale = setlocale( LC_MESSAGES, NULL )) != NULL) ) |
332 | 332 | { |
333 | - subst = nls_locale; | |
334 | 333 | wchar_t *break_code = L"_.@"; |
334 | + subst = nls_locale; | |
335 | 335 | |
336 | 336 | if( chk == L'L' ) |
337 | 337 | { |
@@ -401,6 +401,7 @@ void *mc_open( struct mc_tab *cdt, va_list argv ) | ||
401 | 401 | */ |
402 | 402 | char *catname = va_arg( argv, char * ); |
403 | 403 | unsigned tab_increment, flags = va_arg( argv, unsigned ); |
404 | + int retval = 0; | |
404 | 405 | |
405 | 406 | /* First, check the `catopen' flags, to determine how many new descriptor |
406 | 407 | * table slots to create, if we need to expand the table. |
@@ -410,7 +411,6 @@ void *mc_open( struct mc_tab *cdt, va_list argv ) | ||
410 | 411 | |
411 | 412 | /* Find the first free slot, if any, in the descriptor table. |
412 | 413 | */ |
413 | - int retval = 0; | |
414 | 414 | while( (retval < cdt->curr_size) && (cdt->tab[ retval ].fd >= 0) ) |
415 | 415 | ++retval; |
416 | 416 |
@@ -496,4 +496,4 @@ nl_catd catopen( __const char *name, int flags ) | ||
496 | 496 | return (nl_catd)_mctab_( mc_open, name, flags ); |
497 | 497 | } |
498 | 498 | |
499 | -/* $RCSfile$Revision: 1.3 $: end of file */ | |
499 | +/* $RCSfile$Revision: 1.4 $: end of file */ |
@@ -9,7 +9,7 @@ | ||
9 | 9 | * used internally by `gencat', to compile message dictionaries. |
10 | 10 | * |
11 | 11 | * Written by Keith Marshall <keithmarshall@users.sourceforge.net> |
12 | - * Last modification: 21-May-2007 | |
12 | + * Last modification: 22-Sept-2007 | |
13 | 13 | * |
14 | 14 | * |
15 | 15 | * This is free software. It is provided AS IS, in the hope that it may |
@@ -915,12 +915,14 @@ struct msgdict *mc_source( const char *input ) | ||
915 | 915 | */ |
916 | 916 | if( last_char == L'\r' ) |
917 | 917 | { |
918 | + size_t len; | |
919 | + | |
918 | 920 | /* The previous character was a deferred carriage return, |
919 | 921 | * but it was *not* the lead byte in a CRLF line terminator, |
920 | 922 | * so we need to emit it into the message definition. |
921 | 923 | */ |
922 | 924 | dfprintf(( stderr, "\n%s:%u:", input, linenum )); |
923 | - size_t len = mc_add_escape( iconv_map, messages + msgloc, L'\r' ); | |
925 | + len = mc_add_escape( iconv_map, messages + msgloc, L'\r' ); | |
924 | 926 | if( len > (size_t)(0) ) |
925 | 927 | { |
926 | 928 | headroom -= len; |
@@ -1263,4 +1265,4 @@ struct msgdict *mc_source( const char *input ) | ||
1263 | 1265 | return head; |
1264 | 1266 | } |
1265 | 1267 | |
1266 | -/* $RCSfile$Revision: 1.10 $: end of file */ | |
1268 | +/* $RCSfile$Revision: 1.11 $: end of file */ |