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.
@@ -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 | + | |
1 | 12 | 2017-01-30 Keith Marshall <keithmarshall@users.sourceforge.net> |
2 | 13 | |
3 | 14 | Implement strerror_r()/strerror_s() API. |
@@ -8,7 +8,7 @@ | ||
8 | 8 | * $Id$ |
9 | 9 | * |
10 | 10 | * 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 | |
12 | 12 | * |
13 | 13 | * |
14 | 14 | * Permission is hereby granted, free of charge, to any person obtaining a |
@@ -84,25 +84,23 @@ | ||
84 | 84 | * declared; users should NEVER access this, other than via our two |
85 | 85 | * accessor functions. |
86 | 86 | */ |
87 | -extern unsigned int __mingw_output_format_flag; | |
87 | +extern unsigned int __mingw_output_format_flags; | |
88 | 88 | |
89 | 89 | 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; } | |
92 | 92 | |
93 | 93 | #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 | |
96 | 95 | * formatting style; although POSIX might lead us to prefer an initial |
97 | 96 | * default of _TWO_DIGIT_EXPONENT, we choose to assign a default which |
98 | 97 | * is consistent with Microsoft's preference. |
99 | 98 | */ |
100 | -unsigned int __mingw_output_format_flag = _THREE_DIGIT_EXPONENT; | |
99 | +unsigned int __mingw_output_format_flags = _THREE_DIGIT_EXPONENT; | |
101 | 100 | |
102 | 101 | #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 | |
106 | 104 | * sufficient for both _get_output_format() and _set_output_format(), |
107 | 105 | * with the set action being completed in the calling wrapper. |
108 | 106 | */ |
@@ -112,7 +110,7 @@ unsigned int __mingw_get_output_format_fallback( void ) | ||
112 | 110 | /* Our replacement function simply returns the current setting of |
113 | 111 | * the assigned formatting style... |
114 | 112 | */ |
115 | - return __mingw_output_format_flag & _EXPONENT_DIGIT_MASK; | |
113 | + return __mingw_output_format_flags & _EXPONENT_DIGIT_MASK; | |
116 | 114 | } |
117 | 115 | /* ...and, in the case of _set_output_format(), we simply map the |
118 | 116 | * requisite name to the common function implementation. |
@@ -121,8 +119,7 @@ extern unsigned int __mingw_set_output_format_fallback( unsigned int ) | ||
121 | 119 | __attribute__((__alias__("__mingw_get_output_format_fallback"))); |
122 | 120 | |
123 | 121 | #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 | |
126 | 123 | * fallback for _get_printf_count_output()/_set_printf_count_output(). |
127 | 124 | */ |
128 | 125 | int __mingw_get_printf_count_output_fallback( void ) |
@@ -139,8 +136,7 @@ int __mingw_set_printf_count_output_fallback( int mode ) | ||
139 | 136 | * _set_output_format() compilation options first. |
140 | 137 | */ |
141 | 138 | #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... | |
144 | 140 | */ |
145 | 141 | # define RTNTYPE int |
146 | 142 | # define FUNCTION _set_printf_count_output |
@@ -150,8 +146,7 @@ int __mingw_set_printf_count_output_fallback( int mode ) | ||
150 | 146 | extern int __mingw_set_printf_count_output_fallback( int ); |
151 | 147 | |
152 | 148 | #elif defined __getnfmt__ |
153 | -/* | |
154 | - * ...while here, it is _get_printf_count_output(). | |
149 | +/* ...while here, it is _get_printf_count_output(). | |
155 | 150 | */ |
156 | 151 | # define RTNTYPE int |
157 | 152 | # define FUNCTION _get_printf_count_output |
@@ -161,8 +156,7 @@ extern int __mingw_set_printf_count_output_fallback( int ); | ||
161 | 156 | extern int __mingw_get_printf_count_output_fallback( void ); |
162 | 157 | |
163 | 158 | #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, | |
166 | 160 | * which will be called when there is no MSVCRT implementation. |
167 | 161 | */ |
168 | 162 | # define RTNTYPE unsigned int |
@@ -183,7 +177,7 @@ api_invoke( unsigned int (*api_helper)(unsigned int), unsigned int style ) | ||
183 | 177 | * to use a handler in common with _get_output_format()... |
184 | 178 | */ |
185 | 179 | 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 ); | |
187 | 181 | return retval; |
188 | 182 | } |
189 | 183 | /* ...while declaring its formal prototype as external. |
@@ -204,7 +198,7 @@ static __inline__ __attribute__((__always_inline__)) | ||
204 | 198 | unsigned int api_invoke( unsigned int (*api_helper)( void ) ) |
205 | 199 | { |
206 | 200 | 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 ); | |
208 | 202 | return retval; |
209 | 203 | } |
210 | 204 |
@@ -8,7 +8,7 @@ | ||
8 | 8 | * to support Microsoft's non-standard format specifications. |
9 | 9 | * |
10 | 10 | * 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 | |
12 | 12 | * |
13 | 13 | * |
14 | 14 | * Permission is hereby granted, free of charge, to any person obtaining a |
@@ -187,10 +187,10 @@ | ||
187 | 187 | * 2) Emulation of _set_output_format(), through the use of inline |
188 | 188 | * functions defined in stdio.h, and supported regardless of the |
189 | 189 | * 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' | |
191 | 191 | * variable, (which users should consider to be private). |
192 | 192 | */ |
193 | -extern unsigned int __mingw_output_format_flag; | |
193 | +extern unsigned int __mingw_output_format_flags; | |
194 | 194 | |
195 | 195 | static __pformat_inline__ |
196 | 196 | int __pformat_exponent_digits( void ) |
@@ -200,7 +200,7 @@ int __pformat_exponent_digits( void ) | ||
200 | 200 | */ |
201 | 201 | char *exponent_digits = getenv( "PRINTF_EXPONENT_DIGITS" ); |
202 | 202 | 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) | |
204 | 204 | ? 2 : 3 ; |
205 | 205 | } |
206 | 206 | #else |
@@ -2199,7 +2199,7 @@ int __pformat_is_alt_ldouble_modifier( int length ) | ||
2199 | 2199 | * to be treated as equivalent to 'L', as it is in MSVCRT.DLL's |
2200 | 2200 | * implementation of the printf() functions. |
2201 | 2201 | */ |
2202 | - return (__mingw_output_format_flag & _MSVC_PRINTF_QUIRKS) | |
2202 | + return (__mingw_output_format_flags & _MSVC_PRINTF_QUIRKS) | |
2203 | 2203 | ? (length == PFORMAT_LENGTH_LONG) : 0; |
2204 | 2204 | } |
2205 | 2205 | #else |