From c5b9acae36b180316fb38b7792f24b5e3dfa66fb Mon Sep 17 00:00:00 2001 From: D-AIRY <admin@ds-servers.com> Date: Mon, 30 Mar 2020 09:54:35 +0300 Subject: [PATCH] Fixed some warnings --- source/gui/Desktop.cpp | 6 +++--- source/gui/ICSS.cpp | 4 ++-- source/gui/IRenderFrame.cpp | 14 +++++++------- source/render/shadow.cpp | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/source/gui/Desktop.cpp b/source/gui/Desktop.cpp index 953b42af7..e779cc5b4 100644 --- a/source/gui/Desktop.cpp +++ b/source/gui/Desktop.cpp @@ -78,9 +78,9 @@ namespace gui point a[] = { {0, 0, 0, 0.0f, 0.0f}, - {m_iWidth, 0, 0, 1.0f, 0.0f}, - {m_iWidth, m_iHeight, 0, 1.0f, 1.0f}, - {0, m_iHeight, 0, 0.0f, 1.0f} + {(float)m_iWidth, 0, 0, 1.0f, 0.0f}, + {(float)m_iWidth, (float)m_iHeight, 0, 1.0f, 1.0f}, + {0, (float)m_iHeight, 0, 0.0f, 1.0f} }; m_pVertices = GetGUI()->getDevice()->createVertexBuffer(sizeof(point) * 4, GXBUFFER_USAGE_STATIC, a); diff --git a/source/gui/ICSS.cpp b/source/gui/ICSS.cpp index 238559f0d..d2a6be682 100644 --- a/source/gui/ICSS.cpp +++ b/source/gui/ICSS.cpp @@ -241,7 +241,7 @@ namespace gui UINT d = 0, o = 0; WCHAR cn; StringW prm = str.substr(pos + 1); - UINT c = swscanf_s(prm.c_str(), L"%d%c-%d", &d, &cn, sizeof(cn), &o); + UINT c = swscanf_s(prm.c_str(), L"%d%c-%d", &d, &cn, 1, &o); if(c >= 1) { nth_num = d; @@ -3599,7 +3599,7 @@ namespace gui } } - int n = swscanf_s(_val.c_str(), L"%f%c%c", &p, &a, sizeof(a), &b, sizeof(b)); + int n = swscanf_s(_val.c_str(), L"%f%c%c", &p, &a, 1, &b, 1); clr->set(p); if(n == 1) { diff --git a/source/gui/IRenderFrame.cpp b/source/gui/IRenderFrame.cpp index 73f0b0956..331550250 100644 --- a/source/gui/IRenderFrame.cpp +++ b/source/gui/IRenderFrame.cpp @@ -1749,16 +1749,16 @@ namespace gui }; point a[6] = { {0, 0, 0, rc}, - {m_iWidth, 0, 0, rc}, - {0, (float)(m_iHeight), 0, rc}, - {0, (float)(m_iHeight), 0, rc}, - {m_iWidth, 0, 0, rc}, - {m_iWidth, (float)(m_iHeight), 0, rc} + {(float)m_iWidth, 0, 0, rc}, + {0, (float)m_iHeight, 0, rc}, + {0, (float)m_iHeight, 0, rc}, + {(float)m_iWidth, 0, 0, rc}, + {(float)m_iWidth, (float)(m_iHeight), 0, rc} }; point2 apdx8[] = { {0, 0, 0}, - {m_iWidth, 0, 0}, - {m_iWidth, (float)(m_iHeight), 0}, + {(float)m_iWidth, 0, 0}, + {(float)m_iWidth, (float)(m_iHeight), 0}, {0, (float)(m_iHeight), 0} }; diff --git a/source/render/shadow.cpp b/source/render/shadow.cpp index a0bde712a..da8630757 100644 --- a/source/render/shadow.cpp +++ b/source/render/shadow.cpp @@ -670,7 +670,7 @@ void CShadowPSSM::updateFrustums() m_pCamera->getUp(&vUp); float fAspectRatio = (float)*r_win_width / (float)*r_win_height; float fFovTan = tanf(*r_effective_fov * 0.5f); - for(UINT i = 0; i < *r_pssm_splits; ++i) + for(int i = 0; i < *r_pssm_splits; ++i) { Split &split = m_splits[i]; -- GitLab