From f6876b78dc61a95fc2080c31571fda77a8f7d18b Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Sat, 16 May 2015 17:04:38 +0200 Subject: [PATCH] Fix C4244 warnings: 'conversion' conversion from 'type1' to 'type2', possible loss of data Signed-off-by: Sven Strickroth --- ext/gitdll/gitdll.c | 12 ++++++------ src/Utils/MiscUI/MyGraph.cpp | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/ext/gitdll/gitdll.c b/ext/gitdll/gitdll.c index 6ab0405d0..031d564d1 100644 --- a/ext/gitdll/gitdll.c +++ b/ext/gitdll/gitdll.c @@ -120,7 +120,7 @@ static int git_parse_commit_author(struct GIT_COMMIT_AUTHOR *author, char *pbuff { return -1; } - author->NameSize = end - pbuff - 1; + author->NameSize = (int)(end - pbuff - 1); pbuff = end +1; end = strchr(pbuff, '>'); @@ -128,7 +128,7 @@ static int git_parse_commit_author(struct GIT_COMMIT_AUTHOR *author, char *pbuff return -1; author->Email = pbuff ; - author->EmailSize = end - pbuff; + author->EmailSize = (int)(end - pbuff); pbuff = end + 2; @@ -184,7 +184,7 @@ int git_parse_commit(GIT_COMMIT *commit) pbuf += 9; commit->m_Encode=pbuf; end = strchr(pbuf,'\n'); - commit->m_EncodeSize=end -pbuf; + commit->m_EncodeSize= (int)(end -pbuf); } // the headers end after the first empty line @@ -198,7 +198,7 @@ int git_parse_commit(GIT_COMMIT *commit) commit->m_SubjectSize = strlen(pbuf); else { - commit->m_SubjectSize = end - pbuf; + commit->m_SubjectSize = (int)(end - pbuf); pbuf = end +1; commit->m_Body = pbuf; commit->m_BodySize = strlen(pbuf); @@ -614,9 +614,9 @@ int git_get_diff_file(GIT_DIFF diff,GIT_FILE file,int i, char **newname, char ** if(IsBin) *IsBin = p_Rev->diffstat.files[j]->is_binary; if(inc) - *inc = p_Rev->diffstat.files[j]->added; + *inc = (int)p_Rev->diffstat.files[j]->added; if(dec) - *dec = p_Rev->diffstat.files[j]->deleted; + *dec = (int)p_Rev->diffstat.files[j]->deleted; }else { *IsBin=1; diff --git a/src/Utils/MiscUI/MyGraph.cpp b/src/Utils/MiscUI/MyGraph.cpp index c39761d05..4af2592b5 100644 --- a/src/Utils/MiscUI/MyGraph.cpp +++ b/src/Utils/MiscUI/MyGraph.cpp @@ -177,7 +177,7 @@ int MyGraphSeries::GetAverageDataValue() const if (m_dwaValues.GetSize() == 0) return 0; - return nTotal / m_dwaValues.GetSize(); + return nTotal / (int)m_dwaValues.GetSize(); } // Returns the number of data points that are not zero. @@ -1214,8 +1214,8 @@ void MyGraph::DrawSeriesBar(CDC& dc) const int nMaxDataValue = max(GetMaxDataValue(), 1); double barTop = m_ptOrigin.y - (double)m_nYAxisHeight * (GetAverageDataValue() / (double)nMaxDataValue); - dc.MoveTo(m_ptOrigin.x, barTop); - VERIFY(dc.LineTo(m_ptOrigin.x + (m_nXAxisWidth - m_rcLegend.Width() - (GAP_PIXELS * 2)), barTop)); + dc.MoveTo(m_ptOrigin.x, (int)barTop); + VERIFY(dc.LineTo(m_ptOrigin.x + (m_nXAxisWidth - m_rcLegend.Width() - (GAP_PIXELS * 2)), (int)barTop)); } } @@ -1317,8 +1317,8 @@ void MyGraph::DrawSeriesLine(CDC& dc) const int nMaxDataValue = max(GetMaxDataValue(), 1); double barTop = m_ptOrigin.y - (double)m_nYAxisHeight * (GetAverageDataValue() / (double)nMaxDataValue); - dc.MoveTo(m_ptOrigin.x, barTop); - VERIFY(dc.LineTo(m_ptOrigin.x + (m_nXAxisWidth - m_rcLegend.Width() - (GAP_PIXELS * 2)), barTop)); + dc.MoveTo(m_ptOrigin.x, (int)barTop); + VERIFY(dc.LineTo(m_ptOrigin.x + (m_nXAxisWidth - m_rcLegend.Width() - (GAP_PIXELS * 2)), (int)barTop)); } // -- 2.11.4.GIT