From 76002280725a7b0e930b54c32b83ed7e9150a93e Mon Sep 17 00:00:00 2001 From: heyongqiang Date: Mon, 2 Jul 2012 17:30:32 -0700 Subject: [PATCH] fix compile warning Summary: as subject Test Plan: compile Reviewers: dhruba Reviewed By: dhruba Differential Revision: https://reviews.facebook.net/D3957 --- port/port_posix.h | 8 ++++---- util/options.cc | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/port/port_posix.h b/port/port_posix.h index d823c5a89..c42745437 100644 --- a/port/port_posix.h +++ b/port/port_posix.h @@ -169,7 +169,7 @@ inline bool Zlib_Compress(const char* input, size_t length, // No output space. Increase the output space by 20%. // (Should we fail the compression since it expands the size?) old_sz = output->size(); - new_sz = output->size() * 1.2; + new_sz = (int)(output->size() * 1.2); output->resize(new_sz); // Set more output. _stream.next_out = (Bytef *)&(*output)[old_sz]; @@ -225,7 +225,7 @@ inline char* Zlib_Uncompress(const char* input_data, size_t input_length, case Z_OK: // No output space. Increase the output space by 20%. old_sz = output_len; - output_len = output_len * 1.2; + output_len = (int)(output_len * 1.2); tmp = new char[output_len]; memcpy(tmp, output, old_sz); delete[] output; @@ -287,7 +287,7 @@ inline bool BZip2_Compress(const char* input, size_t length, // No output space. Increase the output space by 20%. // (Should we fail the compression since it expands the size?) old_sz = output->size(); - new_sz = output->size() * 1.2; + new_sz = (int)(output->size() * 1.2); output->resize(new_sz); // Set more output. _stream.next_out = (char *)&(*output)[old_sz]; @@ -340,7 +340,7 @@ inline char* BZip2_Uncompress(const char* input_data, size_t input_length, case Z_OK: // No output space. Increase the output space by 20%. old_sz = output_len; - output_len = output_len * 1.2; + output_len = (int)(output_len * 1.2); tmp = new char[output_len]; memcpy(tmp, output, old_sz); delete[] output; diff --git a/util/options.cc b/util/options.cc index b12dd115b..c222334a1 100644 --- a/util/options.cc +++ b/util/options.cc @@ -29,7 +29,7 @@ Options::Options() max_mem_compaction_level(2), target_file_size_base(2 * 1048576), target_file_size_multiplier(10), - max_bytes_for_level_base(10 * 1048576.0), + max_bytes_for_level_base(10 * 1048576), max_bytes_for_level_multiplier(10), expanded_compaction_factor(25), max_grandparent_overlap_factor(10),