--- mstools/mfc/samples/chart/chartwnd.cpp 2018/08/09 18:21:00 1.1 +++ mstools/mfc/samples/chart/chartwnd.cpp 2018/08/09 18:22:42 1.1.1.2 @@ -395,7 +395,7 @@ void CChartWnd::SetNewColors() // void CChartWnd::RenderChart(CDC* pDC) { - short i, nSize, nTextHeight; + int i, nSize, nTextHeight; float yTickMag, yTickGuess; char szBuffer[80]; @@ -427,8 +427,8 @@ void CChartWnd::RenderChart(CDC* pDC) yTickGuess = m_fTallest / 10; yTickMag = (float)(((log10(yTickGuess) / log10(2.7182818))) / (log10(10.0) / log10(2.7182818))); - yTickGuess = (float)(((yTickGuess / pow(10, (yTickMag - 1)) + 0.5) / 10) * - pow(10, yTickMag)); + yTickGuess = (float)(((yTickGuess / pow(10.0, (yTickMag - 1.0)) + 0.5) + / 10.0) * pow(10.0, yTickMag)); // Draw grid. // @@ -498,7 +498,7 @@ void CChartWnd::RenderChart(CDC* pDC) void CChartWnd::DrawBarChart(CDC* pDC) { float flFraction; - short nWidth, i, nTextHeight, nCurrentHeight, nSize; + int nWidth, i, nTextHeight, nCurrentHeight, nSize; CRect rectBar; POSITION pos; CChartData* ptr; @@ -509,7 +509,7 @@ void CChartWnd::DrawBarChart(CDC* pDC) CObList* pChartData = m_pChartObject->m_pChartData; - flFraction = (rectData.Width() / (pChartData->GetCount())); + flFraction = (float)(rectData.Width() / (pChartData->GetCount())); nWidth = (short) flFraction; pos = pChartData->GetHeadPosition(); @@ -558,8 +558,8 @@ void CChartWnd::DrawBarChart(CDC* pDC) // void CChartWnd::DrawLineChart(CDC* pDC) { - short nWidth, nSize, nTextHeight, i; - short nCurrentHeight, nBottom; + int nWidth, nSize, nTextHeight, i; + int nCurrentHeight, nBottom; CPoint ptStart; CPoint ptEnd; @@ -575,7 +575,7 @@ void CChartWnd::DrawLineChart(CDC* pDC) CObList* pChartData = m_pChartObject->m_pChartData; ASSERT(pChartData != NULL); - flFraction = (rectData.Width() / (pChartData->GetCount())); + flFraction = (float)(rectData.Width() / (pChartData->GetCount())); nWidth = (short) flFraction; ptr = (CChartData*)pChartData->GetHead();