Code: Select all
arclite: build under vs2013
diff --git a/plugins/arclite/attr.cpp b/plugins/arclite/attr.cpp
index 3324334..425c30d 100644
--- a/plugins/arclite/attr.cpp
+++ b/plugins/arclite/attr.cpp
@@ -324,7 +324,7 @@ void Archive::load_arc_attr() {
if (File::get_find_data_nt(volume_path, find_data))
arc_size += find_data.size();
});
- unsigned ratio = total_size ? round(static_cast<double>(arc_size) / total_size * 100) : 100;
+ unsigned ratio = total_size ? round_(static_cast<double>(arc_size) / total_size * 100) : 100;
if (ratio > 100)
ratio = 100;
attr.value = int_to_str(ratio) + L'%';
diff --git a/plugins/arclite/common.cpp b/plugins/arclite/common.cpp
index 0550bcf..d9e5682 100644
--- a/plugins/arclite/common.cpp
+++ b/plugins/arclite/common.cpp
@@ -8,7 +8,7 @@
Error g_com_error;
-int round(double d) {
+int round_(double d) {
double a = fabs(d);
int res = static_cast<int>(a);
double frac = a - res;
@@ -25,7 +25,7 @@ unsigned calc_percent(unsigned __int64 completed, unsigned __int64 total) {
if (total == 0)
percent = 0;
else
- percent = round(static_cast<double>(completed) / total * 100);
+ percent = round_(static_cast<double>(completed) / total * 100);
if (percent > 100)
percent = 100;
return percent;
diff --git a/plugins/arclite/common.hpp b/plugins/arclite/common.hpp
index 8fb0500..2761af2 100644
--- a/plugins/arclite/common.hpp
+++ b/plugins/arclite/common.hpp
@@ -190,7 +190,7 @@ struct Attr {
};
typedef list<Attr> AttrList;
-int round(double d);
+int round_(double d);
unsigned calc_percent(unsigned __int64 completed, unsigned __int64 total);
unsigned __int64 get_module_version(const wstring& file_path);
unsigned __int64 parse_size_string(const wstring& str);
diff --git a/plugins/arclite/delete.cpp b/plugins/arclite/delete.cpp
index 04a8e8e..adb48b0 100644
--- a/plugins/arclite/delete.cpp
+++ b/plugins/arclite/delete.cpp
@@ -17,7 +17,7 @@ private:
if (total == 0)
percent_done = 0;
else
- percent_done = round(static_cast<double>(completed) * 100 / total);
+ percent_done = round_(static_cast<double>(completed) * 100 / total);
if (percent_done > 100)
percent_done = 100;
@@ -25,7 +25,7 @@ private:
if (time_elapsed() == 0)
speed = 0;
else
- speed = round(static_cast<double>(completed) / time_elapsed() * ticks_per_sec());
+ speed = round_(static_cast<double>(completed) / time_elapsed() * ticks_per_sec());
wostringstream st;
st << setw(7) << format_data_size(completed, get_size_suffixes()) << L" / " << format_data_size(total, get_size_suffixes()) << L" @ " << setw(9) << format_data_size(speed, get_speed_suffixes()) << L'\n';
diff --git a/plugins/arclite/extract.cpp b/plugins/arclite/extract.cpp
index 5492069..96a7174 100644
--- a/plugins/arclite/extract.cpp
+++ b/plugins/arclite/extract.cpp
@@ -19,10 +19,10 @@ wstring get_progress_bar_str(unsigned width, unsigned percent1, unsigned percent
const wchar_t c_pb_black = 9608;
const wchar_t c_pb_gray = 9619;
const wchar_t c_pb_white = 9617;
- unsigned len1 = round(static_cast<double>(percent1) / 100 * width);
+ unsigned len1 = round_(static_cast<double>(percent1) / 100 * width);
if (len1 > width)
len1 = width;
- unsigned len2 = round(static_cast<double>(percent2) / 100 * width);
+ unsigned len2 = round_(static_cast<double>(percent2) / 100 * width);
if (len2 > width)
len2 = width;
if (len2 > len1)
@@ -57,7 +57,7 @@ private:
if (time_elapsed() == 0)
extract_speed = 0;
else
- extract_speed = round(static_cast<double>(extract_completed) / time_elapsed() * ticks_per_sec());
+ extract_speed = round_(static_cast<double>(extract_completed) / time_elapsed() * ticks_per_sec());
if (extract_total && cache_total > extract_total)
cache_total = extract_total;
diff --git a/plugins/arclite/test.cpp b/plugins/arclite/test.cpp
index 800d40f..a72576c 100644
--- a/plugins/arclite/test.cpp
+++ b/plugins/arclite/test.cpp
@@ -23,7 +23,7 @@ private:
if (time_elapsed() == 0)
speed = 0;
else
- speed = round(static_cast<double>(completed) / time_elapsed() * ticks_per_sec());
+ speed = round_(static_cast<double>(completed) / time_elapsed() * ticks_per_sec());
wostringstream st;
st << fit_str(file_path, c_width) << L'\n';
diff --git a/plugins/arclite/ui.cpp b/plugins/arclite/ui.cpp
index 1418357..61ed245 100644
--- a/plugins/arclite/ui.cpp
+++ b/plugins/arclite/ui.cpp
@@ -1355,7 +1355,7 @@ public:
new_line();
open_shared_ctrl_id = check_box(Far::get_msg(MSG_UPDATE_DLG_OPEN_SHARED), options.open_shared);
spacer(2);
- enable_filter_ctrl_id = check_box(Far::get_msg(MSG_UPDATE_DLG_ENABLE_FILTER), options.filter);
+ enable_filter_ctrl_id = check_box(Far::get_msg(MSG_UPDATE_DLG_ENABLE_FILTER), (bool)options.filter);
new_line();
separator();
diff --git a/plugins/arclite/update.cpp b/plugins/arclite/update.cpp
index 72dff95..3b7ea5b 100644
--- a/plugins/arclite/update.cpp
+++ b/plugins/arclite/update.cpp
@@ -38,7 +38,7 @@ private:
if (time == 0)
speed = 0;
else
- speed = round(static_cast<double>(completed) / time * ticks_per_sec());
+ speed = round_(static_cast<double>(completed) / time * ticks_per_sec());
unsigned __int64 total_time;
if (completed)
diff --git a/plugins/arclite/utils.hpp b/plugins/arclite/utils.hpp
index b97d863..37f88ba 100644
--- a/plugins/arclite/utils.hpp
+++ b/plugins/arclite/utils.hpp
@@ -43,7 +43,7 @@ bool is_unc_path(const wstring& path);
bool is_absolute_path(const wstring& path);
wstring remove_path_root(const wstring& path);
-int round(double d);
+int round_(double d);
class NonCopyable {
protected: