• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

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

The MinGW.org Windows System Libraries


コミットメタ情報

リビジョン425e1c3b3cd7fd2dda8ec36d6bfd0063db3160d2 (tree)
日時2017-02-05 06:33:50
作者Keith Marshall <keithmarshall@user...>
コミッターKeith Marshall

ログメッセージ

Resolve a global variable naming inconsistency.

変更サマリ

差分

--- a/mingwrt/ChangeLog
+++ b/mingwrt/ChangeLog
@@ -1,3 +1,14 @@
1+2017-02-04 Keith Marshall <keithmarshall@users.sourceforge.net>
2+
3+ Resolve a global variable naming inconsistency.
4+
5+ * mingwex/ofmt.c (__mingw_output_format_flag): Rename it as...
6+ (__mingw_output_format_flags): ...this, at point of definition, and
7+ update all references, to maintain consistency with usage...
8+ * mingwex/ofmtctl.c (__mingw_output_format_flags): ...here.
9+
10+ * mingwex/stdio/pformat.c: Update references.
11+
112 2017-01-30 Keith Marshall <keithmarshall@users.sourceforge.net>
213
314 Implement strerror_r()/strerror_s() API.
--- a/mingwrt/mingwex/ofmt.c
+++ b/mingwrt/mingwex/ofmt.c
@@ -8,7 +8,7 @@
88 * $Id$
99 *
1010 * Written by Keith Marshall <keithmarshall@users.sourceforge.net>
11- * Copyright (C) 2014, 2015, MinGW.org Project
11+ * Copyright (C) 2014, 2015, 2017, MinGW.org Project
1212 *
1313 *
1414 * Permission is hereby granted, free of charge, to any person obtaining a
@@ -84,25 +84,23 @@
8484 * declared; users should NEVER access this, other than via our two
8585 * accessor functions.
8686 */
87-extern unsigned int __mingw_output_format_flag;
87+extern unsigned int __mingw_output_format_flags;
8888
8989 static __inline__ __attribute__((__always_inline__))
90-unsigned int update_output_format_flag( unsigned int style )
91-{ return (__mingw_output_format_flag & ~_EXPONENT_DIGIT_MASK) | style; }
90+unsigned int update_output_format_flags( unsigned int style )
91+{ return (__mingw_output_format_flags & ~_EXPONENT_DIGIT_MASK) | style; }
9292
9393 #if defined __varofmt__
94-/*
95- * Here, we actually allocate the storage for recording the preferred
94+/* Here, we actually allocate the storage for recording the preferred
9695 * formatting style; although POSIX might lead us to prefer an initial
9796 * default of _TWO_DIGIT_EXPONENT, we choose to assign a default which
9897 * is consistent with Microsoft's preference.
9998 */
100-unsigned int __mingw_output_format_flag = _THREE_DIGIT_EXPONENT;
99+unsigned int __mingw_output_format_flags = _THREE_DIGIT_EXPONENT;
101100
102101 #elif defined __crtofmt__
103-/*
104- * Here we implement the common part of the fallback API, retrieving
105- * the value stored in __mingw_output_format_flag. Note that this is
102+/* Here we implement the common part of the fallback API, retrieving
103+ * the value stored in __mingw_output_format_flags. Note that this is
106104 * sufficient for both _get_output_format() and _set_output_format(),
107105 * with the set action being completed in the calling wrapper.
108106 */
@@ -112,7 +110,7 @@ unsigned int __mingw_get_output_format_fallback( void )
112110 /* Our replacement function simply returns the current setting of
113111 * the assigned formatting style...
114112 */
115- return __mingw_output_format_flag & _EXPONENT_DIGIT_MASK;
113+ return __mingw_output_format_flags & _EXPONENT_DIGIT_MASK;
116114 }
117115 /* ...and, in the case of _set_output_format(), we simply map the
118116 * requisite name to the common function implementation.
@@ -121,8 +119,7 @@ extern unsigned int __mingw_set_output_format_fallback( unsigned int )
121119 __attribute__((__alias__("__mingw_get_output_format_fallback")));
122120
123121 #elif defined __crtnfmt__
124-/*
125- * Here, we implement a generic fallback hook, suitable for use as the
122+/* Here, we implement a generic fallback hook, suitable for use as the
126123 * fallback for _get_printf_count_output()/_set_printf_count_output().
127124 */
128125 int __mingw_get_printf_count_output_fallback( void )
@@ -139,8 +136,7 @@ int __mingw_set_printf_count_output_fallback( int mode )
139136 * _set_output_format() compilation options first.
140137 */
141138 #if defined __setnfmt__
142-/*
143- * Here, we are wrapping the _set_printf_count_output() function...
139+/* Here, we are wrapping the _set_printf_count_output() function...
144140 */
145141 # define RTNTYPE int
146142 # define FUNCTION _set_printf_count_output
@@ -150,8 +146,7 @@ int __mingw_set_printf_count_output_fallback( int mode )
150146 extern int __mingw_set_printf_count_output_fallback( int );
151147
152148 #elif defined __getnfmt__
153-/*
154- * ...while here, it is _get_printf_count_output().
149+/* ...while here, it is _get_printf_count_output().
155150 */
156151 # define RTNTYPE int
157152 # define FUNCTION _get_printf_count_output
@@ -161,8 +156,7 @@ extern int __mingw_set_printf_count_output_fallback( int );
161156 extern int __mingw_get_printf_count_output_fallback( void );
162157
163158 #elif defined __setofmt__
164-/*
165- * This is our implementation for the _set_output_format() function,
159+/* This is our implementation for the _set_output_format() function,
166160 * which will be called when there is no MSVCRT implementation.
167161 */
168162 # define RTNTYPE unsigned int
@@ -183,7 +177,7 @@ api_invoke( unsigned int (*api_helper)(unsigned int), unsigned int style )
183177 * to use a handler in common with _get_output_format()...
184178 */
185179 unsigned int retval = api_helper( style &= _EXPONENT_DIGIT_MASK );
186- __mingw_output_format_flag = update_output_format_flag( style );
180+ __mingw_output_format_flags = update_output_format_flags( style );
187181 return retval;
188182 }
189183 /* ...while declaring its formal prototype as external.
@@ -204,7 +198,7 @@ static __inline__ __attribute__((__always_inline__))
204198 unsigned int api_invoke( unsigned int (*api_helper)( void ) )
205199 {
206200 unsigned int retval = api_helper();
207- __mingw_output_format_flag = update_output_format_flag( retval );
201+ __mingw_output_format_flags = update_output_format_flags( retval );
208202 return retval;
209203 }
210204
--- a/mingwrt/mingwex/stdio/pformat.c
+++ b/mingwrt/mingwex/stdio/pformat.c
@@ -8,7 +8,7 @@
88 * to support Microsoft's non-standard format specifications.
99 *
1010 * Written by Keith Marshall <keithmarshall@users.sourceforge.net>
11- * Copyright (C) 2008, 2009, 2011, 2014-2016, MinGW.org Project
11+ * Copyright (C) 2008, 2009, 2011, 2014-2017, MinGW.org Project
1212 *
1313 *
1414 * Permission is hereby granted, free of charge, to any person obtaining a
@@ -187,10 +187,10 @@
187187 * 2) Emulation of _set_output_format(), through the use of inline
188188 * functions defined in stdio.h, and supported regardless of the
189189 * availability of the API within MSVCRT.DLL; this emulated API
190- * maintains state in the global `__mingw_output_format_flag'
190+ * maintains state in the global `__mingw_output_format_flags'
191191 * variable, (which users should consider to be private).
192192 */
193-extern unsigned int __mingw_output_format_flag;
193+extern unsigned int __mingw_output_format_flags;
194194
195195 static __pformat_inline__
196196 int __pformat_exponent_digits( void )
@@ -200,7 +200,7 @@ int __pformat_exponent_digits( void )
200200 */
201201 char *exponent_digits = getenv( "PRINTF_EXPONENT_DIGITS" );
202202 return ((exponent_digits != NULL) && ((unsigned)(*exponent_digits - '0') < 3))
203- || (__mingw_output_format_flag & _TWO_DIGIT_EXPONENT)
203+ || (__mingw_output_format_flags & _TWO_DIGIT_EXPONENT)
204204 ? 2 : 3 ;
205205 }
206206 #else
@@ -2199,7 +2199,7 @@ int __pformat_is_alt_ldouble_modifier( int length )
21992199 * to be treated as equivalent to 'L', as it is in MSVCRT.DLL's
22002200 * implementation of the printf() functions.
22012201 */
2202- return (__mingw_output_format_flag & _MSVC_PRINTF_QUIRKS)
2202+ return (__mingw_output_format_flags & _MSVC_PRINTF_QUIRKS)
22032203 ? (length == PFORMAT_LENGTH_LONG) : 0;
22042204 }
22052205 #else