char *p = field + Len(id);
*--p = 0;
while (p > field) {
- *--p = '0' + (n & 7);
+ *--p = char('0' + (n & 7));
n >>= 3;
}
return n == 0;
}
wxTarEntry::wxTarEntry(const wxTarEntry& e)
- : m_Name(e.m_Name),
+ : wxArchiveEntry(),
+ m_Name(e.m_Name),
m_Mode(e.m_Mode),
m_IsModeSet(e.m_IsModeSet),
m_UserId(e.m_UserId),
bool wxTarEntry::IsDir() const
{
- return m_TypeFlag - wxTAR_DIRTYPE == 0;
+ return m_TypeFlag == wxTAR_DIRTYPE;
}
void wxTarEntry::SetIsDir(bool isDir)
{
if (isDir)
m_TypeFlag = wxTAR_DIRTYPE;
- else if (m_TypeFlag - wxTAR_DIRTYPE == 0)
+ else if (m_TypeFlag == wxTAR_DIRTYPE)
m_TypeFlag = wxTAR_REGTYPE;
}
wxTAR_LNKTYPE, wxTAR_SYMTYPE, wxTAR_CHRTYPE, wxTAR_BLKTYPE,
wxTAR_DIRTYPE, wxTAR_FIFOTYPE, 0
};
- char typeflag = e->GetTypeFlag();
+ int typeflag = e->GetTypeFlag();
// pax does now allow data for wxTAR_LNKTYPE
- if (!m_pax || typeflag - wxTAR_LNKTYPE != 0)
+ if (!m_pax || typeflag != wxTAR_LNKTYPE)
if (strchr(nodata, typeflag) != NULL)
CloseEntry();
}
if (entry.GetSize() == wxInvalidOffset)
entry.SetSize(0);
- m_large = SetHeaderNumber(TAR_SIZE, entry.GetSize());
+ m_large = !SetHeaderNumber(TAR_SIZE, entry.GetSize());
SetHeaderDate(_T("mtime"), entry.GetDateTime());
if (entry.GetAccessTime().IsValid())
if (entry.GetCreateTime().IsValid())
SetHeaderDate(_T("ctime"), entry.GetCreateTime());
- *m_hdr->Get(TAR_TYPEFLAG) = entry.GetTypeFlag();
+ *m_hdr->Get(TAR_TYPEFLAG) = char(entry.GetTypeFlag());
strcpy(m_hdr->Get(TAR_MAGIC), USTAR_MAGIC);
strcpy(m_hdr->Get(TAR_VERSION), USTAR_VERSION);
wxLongLong ll = datetime.IsValid() ? datetime.GetValue() : wxLongLong(0);
wxLongLong secs = ll / 1000L;
- if (key != _T("mtime") || !m_hdr->SetOctal(TAR_MTIME, secs.GetValue())
+ if (key != _T("mtime")
+ || !m_hdr->SetOctal(TAR_MTIME, wxTarNumber(secs.GetValue()))
|| secs <= 0 || secs >= 0x7fffffff)
{
wxString str;