Update to 7-Zip 17.00 Beta

This commit is contained in:
Tino Reichardt
2017-04-30 14:14:14 +02:00
parent 54389d6e2f
commit aa5ba75da0
451 changed files with 15746 additions and 8574 deletions

View File

@@ -123,33 +123,11 @@ static int FindPartType(const Byte *guid)
return -1;
}
static inline char GetHex(unsigned t) { return (char)(((t < 10) ? ('0' + t) : ('A' + (t - 10)))); }
static void PrintHex(unsigned v, char *s)
static void RawLeGuidToString_Upper(const Byte *g, char *s)
{
s[0] = GetHex((v >> 4) & 0xF);
s[1] = GetHex(v & 0xF);
}
static void ConvertUInt16ToHex4Digits(UInt32 val, char *s) throw()
{
PrintHex(val >> 8, s);
PrintHex(val & 0xFF, s + 2);
}
static void GuidToString(const Byte *g, char *s)
{
ConvertUInt32ToHex8Digits(Get32(g ), s); s += 8; *s++ = '-';
ConvertUInt16ToHex4Digits(Get16(g + 4), s); s += 4; *s++ = '-';
ConvertUInt16ToHex4Digits(Get16(g + 6), s); s += 4; *s++ = '-';
for (unsigned i = 0; i < 8; i++)
{
if (i == 2)
*s++ = '-';
PrintHex(g[8 + i], s);
s += 2;
}
*s = 0;
RawLeGuidToString(g, s);
// MyStringUpper_Ascii(s);
}
@@ -328,7 +306,7 @@ STDMETHODIMP CHandler::GetArchiveProperty(PROPID propID, PROPVARIANT *value)
case kpidId:
{
char s[48];
GuidToString(Guid, s);
RawLeGuidToString_Upper(Guid, s);
prop = s;
break;
}
@@ -364,18 +342,16 @@ STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *val
s += c;
}
if (s.IsEmpty())
s.Add_UInt32(index);
{
char temp[16];
ConvertUInt32ToString(index, temp);
s.AddAscii(temp);
}
{
s += '.';
const char *ext = NULL;
int typeIndex = FindPartType(item.Type);
s += L'.';
const char *ext = "img";
if (typeIndex >= 0 && kPartTypes[(unsigned)typeIndex].Ext)
if (typeIndex >= 0)
ext = kPartTypes[(unsigned)typeIndex].Ext;
s.AddAscii(ext);
if (!ext)
ext = "img";
s += ext;
}
prop = s;
break;
@@ -394,7 +370,7 @@ STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *val
res = kPartTypes[(unsigned)typeIndex].Type;
else
{
GuidToString(item.Type, s);
RawLeGuidToString_Upper(item.Type, s);
res = s;
}
prop = res;
@@ -404,7 +380,7 @@ STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *val
case kpidId:
{
char s[48];
GuidToString(item.Id, s);
RawLeGuidToString_Upper(item.Id, s);
prop = s;
break;
}