summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-09-07 08:37:05 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-09-07 08:37:05 +0000
commitb3b896c472bd802ace10eca85b8d6a7e55a36908 (patch)
tree591599fc1fcede341b53debacee329cdbf1e228c
parent1e6778f300138c934d22c19729f4e405cd7ad4b2 (diff)
warning fix
git-svn-id: http://svn.miranda-ng.org/main/trunk@15290 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--plugins/HistoryStats/src/column_chatduration.cpp2
-rw-r--r--plugins/HistoryStats/src/column_inoutgraph.cpp4
-rw-r--r--plugins/HistoryStats/src/column_split.cpp2
-rw-r--r--plugins/HistoryStats/src/column_timeline.cpp14
-rw-r--r--plugins/HistoryStats/src/utils.h12
5 files changed, 22 insertions, 12 deletions
diff --git a/plugins/HistoryStats/src/column_chatduration.cpp b/plugins/HistoryStats/src/column_chatduration.cpp
index 719ba2efd0..0d4b7e67fc 100644
--- a/plugins/HistoryStats/src/column_chatduration.cpp
+++ b/plugins/HistoryStats/src/column_chatduration.cpp
@@ -219,7 +219,7 @@ void ColChatDuration::impl_outputRenderRow(ext::ostream& tos, const Contact& con
HDC hDC = canvas.beginDraw();
SetBkColor(hDC, con::ColorBar);
- ExtTextOut(hDC, 0, 0, ETO_OPAQUE, &utils::rect(0, 0, barW, 15), NULL, 0, NULL);
+ ExtTextOut(hDC, 0, 0, ETO_OPAQUE, utils::rect(0, 0, barW, 15), NULL, 0, NULL);
canvas.endDraw();
diff --git a/plugins/HistoryStats/src/column_inoutgraph.cpp b/plugins/HistoryStats/src/column_inoutgraph.cpp
index 6b869598f1..7a7427de0b 100644
--- a/plugins/HistoryStats/src/column_inoutgraph.cpp
+++ b/plugins/HistoryStats/src/column_inoutgraph.cpp
@@ -272,10 +272,10 @@ void ColInOutGraph::impl_outputRenderRow(ext::ostream& tos, const Contact& conta
HDC hDC = canvas.beginDraw();
SetBkColor(hDC, con::ColorOut);
- ExtTextOut(hDC, 0, 0, ETO_OPAQUE, &utils::rect(0, 0, outW, 15), NULL, 0, NULL);
+ ExtTextOut(hDC, 0, 0, ETO_OPAQUE, utils::rect(0, 0, outW, 15), NULL, 0, NULL);
SetBkColor(hDC, con::ColorIn);
- ExtTextOut(hDC, 0, 0, ETO_OPAQUE, &utils::rect(100 - inW, 0, 100, 15), NULL, 0, NULL);
+ ExtTextOut(hDC, 0, 0, ETO_OPAQUE, utils::rect(100 - inW, 0, 100, 15), NULL, 0, NULL);
if (m_bGraphPercent)
{
diff --git a/plugins/HistoryStats/src/column_split.cpp b/plugins/HistoryStats/src/column_split.cpp
index e7c834861e..e3da38ed01 100644
--- a/plugins/HistoryStats/src/column_split.cpp
+++ b/plugins/HistoryStats/src/column_split.cpp
@@ -389,7 +389,7 @@ void ColSplit::impl_outputRenderRow(ext::ostream& tos, const Contact& contact, D
{
int bar_len = (50 * part_top + top - 1) / top;
- ExtTextOut(hDC, 0, 0, ETO_OPAQUE, &utils::rect(j * 5, 50 - bar_len, j * 5 + 4, 50), NULL, 0, NULL);
+ ExtTextOut(hDC, 0, 0, ETO_OPAQUE, utils::rect(j * 5, 50 - bar_len, j * 5 + 4, 50), NULL, 0, NULL);
}
}
diff --git a/plugins/HistoryStats/src/column_timeline.cpp b/plugins/HistoryStats/src/column_timeline.cpp
index 111104be4e..f0e8a166d6 100644
--- a/plugins/HistoryStats/src/column_timeline.cpp
+++ b/plugins/HistoryStats/src/column_timeline.cpp
@@ -298,11 +298,11 @@ void ColTimeline::outputRenderRowInOut(ext::ostream& tos, const Contact& contact
int from_left = 3 * ((curDay - m_nFirstDay) / m_nDays);
if (bar_len != 0)
- ExtTextOut(hDC, 0, 0, ETO_OPAQUE, &utils::rect(from_left, 24 - bar_len, from_left + 3, 25 + bar_len), NULL, 0, NULL);
+ ExtTextOut(hDC, 0, 0, ETO_OPAQUE, utils::rect(from_left, 24 - bar_len, from_left + 3, 25 + bar_len), NULL, 0, NULL);
}
SetBkColor(hDC, con::ColorBarLine);
- ExtTextOut(hDC, 0, 0, ETO_OPAQUE, &utils::rect(0, 24, m_nTimelineWidth, 25), NULL, 0, NULL);
+ ExtTextOut(hDC, 0, 0, ETO_OPAQUE, utils::rect(0, 24, m_nTimelineWidth, 25), NULL, 0, NULL);
canvas.endDraw();
@@ -340,7 +340,7 @@ void ColTimeline::outputRenderRowInOut(ext::ostream& tos, const Contact& contact
if (m_bDetail)
{
- DWORD rightDay = min(curDay + m_nDays - 1, m_nLastDay);
+ int rightDay = min(curDay + m_nDays - 1, m_nLastDay);
tos << _T("<div title=\"");
@@ -399,7 +399,7 @@ void ColTimeline::outputRenderRowRatio(ext::ostream& tos, const Contact& contact
HDC hDC = canvas.beginDraw();
SetBkColor(hDC, con::ColorIOLine);
- ExtTextOut(hDC, 0, 0, ETO_OPAQUE, &utils::rect(0, 24, m_nTimelineWidth, 25), NULL, 0, NULL);
+ ExtTextOut(hDC, 0, 0, ETO_OPAQUE, utils::rect(0, 24, m_nTimelineWidth, 25), NULL, 0, NULL);
for (curDay = m_nFirstDay; curDay <= m_nLastDay; curDay += m_nDays)
{
@@ -430,12 +430,12 @@ void ColTimeline::outputRenderRowRatio(ext::ostream& tos, const Contact& contact
if (bar_len < 0)
{
SetBkColor(hDC, con::ColorIn);
- ExtTextOut(hDC, 0, 0, ETO_OPAQUE, &utils::rect(from_left, 24, from_left + 3, 24 - bar_len), NULL, 0, NULL);
+ ExtTextOut(hDC, 0, 0, ETO_OPAQUE, utils::rect(from_left, 24, from_left + 3, 24 - bar_len), NULL, 0, NULL);
}
else if (bar_len > 0)
{
SetBkColor(hDC, con::ColorOut);
- ExtTextOut(hDC, 0, 0, ETO_OPAQUE, &utils::rect(from_left, 25 - bar_len, from_left + 3, 25), NULL, 0, NULL);
+ ExtTextOut(hDC, 0, 0, ETO_OPAQUE, utils::rect(from_left, 25 - bar_len, from_left + 3, 25), NULL, 0, NULL);
}
}
@@ -484,7 +484,7 @@ void ColTimeline::outputRenderRowRatio(ext::ostream& tos, const Contact& contact
if (m_bDetail)
{
- DWORD rightDay = min(curDay + m_nDays - 1, m_nLastDay);
+ int rightDay = min(curDay + m_nDays - 1, m_nLastDay);
tos << _T("<div title=\"");
diff --git a/plugins/HistoryStats/src/utils.h b/plugins/HistoryStats/src/utils.h
index cbd42f240b..db42e4c106 100644
--- a/plugins/HistoryStats/src/utils.h
+++ b/plugins/HistoryStats/src/utils.h
@@ -80,7 +80,17 @@ namespace utils
// drawing helpers
inline POINT point(int x, int y) { POINT p = { x, y }; return p; }
- inline RECT rect(int left, int top, int right, int bottom) { RECT r = { left, top, right, bottom }; return r; }
+
+ struct rect
+ {
+ RECT r;
+ inline rect(int left, int top, int right, int bottom)
+ {
+ r = { left, top, right, bottom };
+ }
+
+ inline operator const RECT*() const { return &r; }
+ };
// misc functionality
void ensureRange(int& value, int min, int max, int fallback);