• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

POSIX.1 National Language Support API for MinGW


Commit MetaInfo

Revisión2b7377d3dfecb79882b3d67ea4d50aaf897a557a (tree)
Tiempo2007-11-10 23:34:45
AutorKeith Marshall <keithmarshall@user...>
CommiterKeith Marshall

Log Message

Relocate misplaced declaration statements to precede assignments or function calls, within their containing scopes.

Cambiar Resumen

Diferencia incremental

--- a/ChangeLog
+++ b/ChangeLog
@@ -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+
113 2007-08-17 Keith Marshall <keithmarshall@users.sourceforge.net>
214
315 Avoid a potential segmentation fault.
--- a/catopen.c
+++ b/catopen.c
@@ -9,7 +9,7 @@
99 * POSIX compatible national language message catalogues in MinGW.
1010 *
1111 * Written by Keith Marshall <keithmarshall@users.sourceforge.net>
12- * Last modification: 08-Aug-2007
12+ * Last modification: 22-Sept-2007
1313 *
1414 *
1515 * 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 )
330330 || ((nls_locale = mc_nl_cat_locale_getenv( flags )) != NULL)
331331 || ((nls_locale = setlocale( LC_MESSAGES, NULL )) != NULL) )
332332 {
333- subst = nls_locale;
334333 wchar_t *break_code = L"_.@";
334+ subst = nls_locale;
335335
336336 if( chk == L'L' )
337337 {
@@ -401,6 +401,7 @@ void *mc_open( struct mc_tab *cdt, va_list argv )
401401 */
402402 char *catname = va_arg( argv, char * );
403403 unsigned tab_increment, flags = va_arg( argv, unsigned );
404+ int retval = 0;
404405
405406 /* First, check the `catopen' flags, to determine how many new descriptor
406407 * 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 )
410411
411412 /* Find the first free slot, if any, in the descriptor table.
412413 */
413- int retval = 0;
414414 while( (retval < cdt->curr_size) && (cdt->tab[ retval ].fd >= 0) )
415415 ++retval;
416416
@@ -496,4 +496,4 @@ nl_catd catopen( __const char *name, int flags )
496496 return (nl_catd)_mctab_( mc_open, name, flags );
497497 }
498498
499-/* $RCSfile$Revision: 1.3 $: end of file */
499+/* $RCSfile$Revision: 1.4 $: end of file */
--- a/mcsource.c
+++ b/mcsource.c
@@ -9,7 +9,7 @@
99 * used internally by `gencat', to compile message dictionaries.
1010 *
1111 * Written by Keith Marshall <keithmarshall@users.sourceforge.net>
12- * Last modification: 21-May-2007
12+ * Last modification: 22-Sept-2007
1313 *
1414 *
1515 * 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 )
915915 */
916916 if( last_char == L'\r' )
917917 {
918+ size_t len;
919+
918920 /* The previous character was a deferred carriage return,
919921 * but it was *not* the lead byte in a CRLF line terminator,
920922 * so we need to emit it into the message definition.
921923 */
922924 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' );
924926 if( len > (size_t)(0) )
925927 {
926928 headroom -= len;
@@ -1263,4 +1265,4 @@ struct msgdict *mc_source( const char *input )
12631265 return head;
12641266 }
12651267
1266-/* $RCSfile$Revision: 1.10 $: end of file */
1268+/* $RCSfile$Revision: 1.11 $: end of file */