Fossil SCM

Eliminate fossil_utf8_to_console() for non-windows platforms: it isn't used then. Thanks to "bytevolcano" for the suggestion.

jan.nijtmans 2017-11-30 10:15 trunk
Commit 434adc35fc75e5fef19809e944e40f72f1e4a0ddb98f02f53764cd9b4dfa8ed8
1 file changed +2 -4
+2 -4
--- src/utf8.c
+++ src/utf8.c
@@ -305,16 +305,16 @@
305305
** Display UTF-8 on the console. Return the number of
306306
** Characters written. If stdout or stderr is redirected
307307
** to a file, -1 is returned and nothing is written
308308
** to the console.
309309
*/
310
+#ifdef _WIN32
310311
int fossil_utf8_to_console(
311312
const char *zUtf8,
312313
int nByte,
313314
int toStdErr
314315
){
315
-#ifdef _WIN32
316316
int nChar, written = 0;
317317
wchar_t *zUnicode; /* Unicode version of zUtf8 */
318318
DWORD dummy;
319319
Blob blob;
320320
@@ -352,9 +352,7 @@
352352
zUnicode + written, size, &dummy, 0);
353353
written += size;
354354
}
355355
fossil_free(zUnicode);
356356
return nChar;
357
-#else
358
- return -1; /* No-op on unix */
359
-#endif
360357
}
358
+#endif
361359
--- src/utf8.c
+++ src/utf8.c
@@ -305,16 +305,16 @@
305 ** Display UTF-8 on the console. Return the number of
306 ** Characters written. If stdout or stderr is redirected
307 ** to a file, -1 is returned and nothing is written
308 ** to the console.
309 */
 
310 int fossil_utf8_to_console(
311 const char *zUtf8,
312 int nByte,
313 int toStdErr
314 ){
315 #ifdef _WIN32
316 int nChar, written = 0;
317 wchar_t *zUnicode; /* Unicode version of zUtf8 */
318 DWORD dummy;
319 Blob blob;
320
@@ -352,9 +352,7 @@
352 zUnicode + written, size, &dummy, 0);
353 written += size;
354 }
355 fossil_free(zUnicode);
356 return nChar;
357 #else
358 return -1; /* No-op on unix */
359 #endif
360 }
 
361
--- src/utf8.c
+++ src/utf8.c
@@ -305,16 +305,16 @@
305 ** Display UTF-8 on the console. Return the number of
306 ** Characters written. If stdout or stderr is redirected
307 ** to a file, -1 is returned and nothing is written
308 ** to the console.
309 */
310 #ifdef _WIN32
311 int fossil_utf8_to_console(
312 const char *zUtf8,
313 int nByte,
314 int toStdErr
315 ){
 
316 int nChar, written = 0;
317 wchar_t *zUnicode; /* Unicode version of zUtf8 */
318 DWORD dummy;
319 Blob blob;
320
@@ -352,9 +352,7 @@
352 zUnicode + written, size, &dummy, 0);
353 written += size;
354 }
355 fossil_free(zUnicode);
356 return nChar;
 
 
 
357 }
358 #endif
359

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button