Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Unified Diff: source/io/uprntf_p.c

Issue 2440913002: Update ICU to 58.1
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « source/io/uprintf.cpp ('k') | source/io/uscanf.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/io/uprntf_p.c
diff --git a/source/io/uprntf_p.c b/source/io/uprntf_p.c
index 09ae6bad85793a0e35b4145eb4866b6e76a1b397..9890b29b964b2110640ffee4501409723b2b098d 100644
--- a/source/io/uprntf_p.c
+++ b/source/io/uprntf_p.c
@@ -1,7 +1,9 @@
+// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
/*
******************************************************************************
*
-* Copyright (C) 1998-2014, International Business Machines
+* Copyright (C) 1998-2016, International Business Machines
* Corporation and others. All Rights Reserved.
*
******************************************************************************
@@ -143,7 +145,7 @@ u_printf_set_sign(UNumberFormat *format,
symbolLen = unum_getSymbol(format,
UNUM_PLUS_SIGN_SYMBOL,
plusSymbol,
- sizeof(plusSymbol)/sizeof(*plusSymbol),
+ UPRV_LENGTHOF(plusSymbol),
status);
unum_setTextAttribute(format,
UNUM_POSITIVE_PREFIX,
@@ -215,7 +217,7 @@ u_printf_string_handler(const u_printf_stream_handler *handler,
}
else {
s = ufmt_defaultCPToUnicode(arg, argSize, buffer,
- sizeof(buffer)/sizeof(UChar));
+ UPRV_LENGTHOF(buffer));
}
}
else {
@@ -251,7 +253,7 @@ u_printf_char_handler(const u_printf_stream_handler *handler,
unsigned char arg = (unsigned char)(args[0].int64Value);
/* convert from default codepage to Unicode */
- ufmt_defaultCPToUnicode((const char *)&arg, 2, s, sizeof(s)/sizeof(UChar));
+ ufmt_defaultCPToUnicode((const char *)&arg, 2, s, UPRV_LENGTHOF(s));
/* Remember that this may be an MBCS character */
if (arg != 0) {
@@ -1508,6 +1510,7 @@ u_printf_parse(const u_printf_stream_handler *streamHandler,
/* set the spec's width to the # of chars written */
info->fWidth = *written;
/* fall through to set the pointer */
+ U_FALLTHROUGH;
case ufmt_string:
case ufmt_ustring:
case ufmt_pointer:
@@ -1535,6 +1538,7 @@ u_printf_parse(const u_printf_stream_handler *streamHandler,
/* set the spec's width to the # of chars written */
info->fWidth = *written;
/* fall through to set the pointer */
+ U_FALLTHROUGH;
case ufmt_string:
case ufmt_ustring:
case ufmt_pointer:
« no previous file with comments | « source/io/uprintf.cpp ('k') | source/io/uscanf.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698