Title: [139982] trunk/Source/WTF
- Revision
- 139982
- Author
- ddkil...@apple.com
- Date
- 2013-01-17 08:37:17 -0800 (Thu, 17 Jan 2013)
Log Message
Fix vprintf_stderr_common() to compile with -Wshorten-64-to-32
<http://webkit.org/b/107126>
Reviewed by Darin Adler.
Fixes the following build error:
Assertions.cpp:92:22: error: implicit conversion loses integer precision: 'CFIndex' (aka 'long') to 'int' [-Werror,-Wshorten-64-to-32]
int length = CFStringGetMaximumSizeForEncoding(CFStringGetLength(str), kCFStringEncodingUTF8);
~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
* wtf/Assertions.cpp:
(vprintf_stderr_common): Use CFIndex type instead of int for the
return value of CFStringGetMaximumSizeForEncoding().
Modified Paths
Diff
Modified: trunk/Source/WTF/ChangeLog (139981 => 139982)
--- trunk/Source/WTF/ChangeLog 2013-01-17 16:34:47 UTC (rev 139981)
+++ trunk/Source/WTF/ChangeLog 2013-01-17 16:37:17 UTC (rev 139982)
@@ -1,3 +1,21 @@
+2013-01-17 David Kilzer <ddkil...@apple.com>
+
+ Fix vprintf_stderr_common() to compile with -Wshorten-64-to-32
+ <http://webkit.org/b/107126>
+
+ Reviewed by Darin Adler.
+
+ Fixes the following build error:
+
+ Assertions.cpp:92:22: error: implicit conversion loses integer precision: 'CFIndex' (aka 'long') to 'int' [-Werror,-Wshorten-64-to-32]
+ int length = CFStringGetMaximumSizeForEncoding(CFStringGetLength(str), kCFStringEncodingUTF8);
+ ~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ 1 error generated.
+
+ * wtf/Assertions.cpp:
+ (vprintf_stderr_common): Use CFIndex type instead of int for the
+ return value of CFStringGetMaximumSizeForEncoding().
+
2013-01-17 Zan Dobersek <zdober...@igalia.com>
[Autotools] Unify WTF sources list regardless of the target OS, Unicode backend
Modified: trunk/Source/WTF/wtf/Assertions.cpp (139981 => 139982)
--- trunk/Source/WTF/wtf/Assertions.cpp 2013-01-17 16:34:47 UTC (rev 139981)
+++ trunk/Source/WTF/wtf/Assertions.cpp 2013-01-17 16:37:17 UTC (rev 139982)
@@ -89,7 +89,7 @@
#if COMPILER(CLANG)
#pragma clang diagnostic pop
#endif
- int length = CFStringGetMaximumSizeForEncoding(CFStringGetLength(str), kCFStringEncodingUTF8);
+ CFIndex length = CFStringGetMaximumSizeForEncoding(CFStringGetLength(str), kCFStringEncodingUTF8);
char* buffer = (char*)malloc(length + 1);
CFStringGetCString(str, buffer, length, kCFStringEncodingUTF8);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes