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

github.com/kornelski/7z.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '7zip/Archive/7z/7zMethodID.cpp')
-rwxr-xr-x7zip/Archive/7z/7zMethodID.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/7zip/Archive/7z/7zMethodID.cpp b/7zip/Archive/7z/7zMethodID.cpp
index d5b78f05..0d45b732 100755
--- a/7zip/Archive/7z/7zMethodID.cpp
+++ b/7zip/Archive/7z/7zMethodID.cpp
@@ -9,17 +9,17 @@ namespace N7z {
static wchar_t GetHex(Byte value)
{
- return (value < 10) ? ('0' + value) : ('A' + (value - 10));
+ return (wchar_t)((value < 10) ? ('0' + value) : ('A' + (value - 10)));
}
static bool HexCharToInt(wchar_t value, Byte &result)
{
if (value >= '0' && value <= '9')
- result = value - '0';
+ result = (Byte)(value - '0');
else if (value >= 'a' && value <= 'f')
- result = 10 + value - 'a';
+ result = (Byte)(10 + value - 'a');
else if (value >= 'A' && value <= 'F')
- result = 10 + value - 'A';
+ result = (Byte)(10 + value - 'A');
else
return false;
return true;
@@ -32,7 +32,7 @@ static bool TwoHexCharsToInt(wchar_t valueHigh, wchar_t valueLow, Byte &result)
return false;
if (!HexCharToInt(valueLow, resultLow))
return false;
- result = (resultHigh << 4) + resultLow;
+ result = (Byte)((resultHigh << 4) + resultLow);
return true;
}
@@ -42,8 +42,8 @@ UString CMethodID::ConvertToString() const
for (int i = 0; i < IDSize; i++)
{
Byte b = ID[i];
- result += GetHex(b >> 4);
- result += GetHex(b & 0xF);
+ result += GetHex((Byte)(b >> 4));
+ result += GetHex((Byte)(b & 0xF));
}
return result;
}
@@ -53,7 +53,7 @@ bool CMethodID::ConvertFromString(const UString &srcString)
int length = srcString.Length();
if ((length & 1) != 0 || (length >> 1) > kMethodIDSize)
return false;
- IDSize = length / 2;
+ IDSize = (Byte)(length / 2);
UInt32 i;
for(i = 0; i < IDSize; i++)
if (!TwoHexCharsToInt(srcString[i * 2], srcString[i * 2 + 1], ID[i]))