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

Unified Diff: runtime/bin/filter.cc

Issue 139043003: - Address warnings about 64-bit to 32-bit conversions. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 11 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
Index: runtime/bin/filter.cc
===================================================================
--- runtime/bin/filter.cc (revision 31816)
+++ runtime/bin/filter.cc (working copy)
@@ -60,12 +60,13 @@
Dart_ThrowException(DartUtils::NewInternalError(
"Failed to get 'gzip' parameter"));
}
- int64_t level;
- if (Dart_IsError(Dart_IntegerToInt64(level_obj, &level))) {
+ int64_t level = 0;
+ if (Dart_IsError(Dart_IntegerToInt64(level_obj, &level)) ||
+ (level < kMinInt32) || (level > kMaxInt32)) {
siva 2014/01/16 00:15:59 Would be more readable if this code is written as:
Ivan Posva 2014/01/16 05:05:41 Done.
Dart_ThrowException(DartUtils::NewInternalError(
"Failed to get 'level' parameter"));
}
- Filter* filter = new ZLibDeflateFilter(gzip, level);
+ Filter* filter = new ZLibDeflateFilter(gzip, static_cast<int32_t>(level));
if (filter == NULL || !filter->Init()) {
delete filter;
Dart_ThrowException(DartUtils::NewInternalError(

Powered by Google App Engine
This is Rietveld 408576698