Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/mpc-hc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXhmikosR <xhmikosr@users.sourceforge.net>2013-03-30 21:51:25 +0400
committerXhmikosR <xhmikosr@users.sourceforge.net>2013-03-31 20:49:20 +0400
commit928af40d894b14d690df237ec55b7319ab05b690 (patch)
tree8640424b4e68d43a97f8a25eb55c6e50ae1df504 /src/DSUtil/DSUtil.cpp
parent45fddd57e29462e263db7972d35662ac0cd71275 (diff)
Cppcheck fixes:
* reduce variable scope * remove unneeded variable assignments
Diffstat (limited to 'src/DSUtil/DSUtil.cpp')
-rw-r--r--src/DSUtil/DSUtil.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/DSUtil/DSUtil.cpp b/src/DSUtil/DSUtil.cpp
index 423fa2062..2704c7eb0 100644
--- a/src/DSUtil/DSUtil.cpp
+++ b/src/DSUtil/DSUtil.cpp
@@ -795,9 +795,10 @@ void CStringToBin(CString str, CAtlArray<BYTE>& data)
CString BinToCString(const BYTE* ptr, size_t len)
{
CString ret;
- TCHAR high, low;
while (len-- > 0) {
+ TCHAR high, low;
+
high = (*ptr >> 4) >= 10 ? (*ptr >> 4) - 10 + _T('A') : (*ptr >> 4) + _T('0');
low = (*ptr & 0xf) >= 10 ? (*ptr & 0xf) - 10 + _T('A') : (*ptr & 0xf) + _T('0');
@@ -2756,10 +2757,10 @@ void HexDump(CString fileName, BYTE* buf, int size)
CString dump_str;
dump_str.Format(_T("Dump size = %d\n"), size);
- int len, i, j, c;
+ int i, j, c;
for (i = 0; i < size; i += 16) {
- len = size - i;
+ int len = size - i;
if (len > 16) {
len = 16;
}