Ignore:
Timestamp:
Sep 26, 2013, 9:08:13 PM (6 years ago)
Author:
dluke@…
Message:

clamav: use upstream patches for simplicity

Location:
trunk/dports/sysutils/clamav
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/dports/sysutils/clamav/Portfile

    r111557 r111596  
    66name                    clamav
    77version                 0.98
     8revision                1
    89categories              sysutils
    910maintainers             geeklair.net:dluke
     
    2627                        --with-zlib=${prefix}
    2728
     29                        # https://bugzilla.clamav.net/show_bug.cgi?id=9018
     30                        # https://bugzilla.clamav.net/show_bug.cgi?id=8959
     31patchfiles              patch-libclamav-7z-typedef.diff \
     32                        patch-configure.diff
     33
    2834use_parallel_build      yes
    2935
     
    3642
    3743platform darwin 8 {
    38                         #- zlib has a 'Byte' typedef, so we can't define it again
    39                         patchfiles-append       patch-libclamav-7z-typdef.diff
    4044                        configure.cflags {-O0}
    4145                }
    4246
    43 platform darwin 9 {
    44                         #- zlib has a 'Byte' typedef, so we can't define it again
    45                         patchfiles-append       patch-libclamav-7z-typedef.diff
    46                 }
    47 
    48 platform darwin 10 {
    49                         #- zlib has a 'Byte' typedef, so we can't define it again
    50                         patchfiles-append       patch-libclamav-7z-typedef.diff
    51                 }
    52 
    53 platform darwin {
    54                         #- zlib test tries to set rpath in a way that doesn't work
    55                         pre-configure {
    56                                 reinplace "s|-Wl,-rpath=|-Wl,-rpath |g" ${worksrcpath}/configure
    57                         }
    58                 }
    5947post-destroot {
    6048                        #muniversal should allow this to be hooked in some way that's less gross
  • trunk/dports/sysutils/clamav/files/patch-libclamav-7z-typedef.diff

    r111554 r111596  
    1 diff -u -d -b -w -r libclamav/7z/7z.h libclamav/7z/7z.h
    2 --- libclamav/7z/7z.h   2013-09-25 11:30:13.000000000 -0400
    3 +++ libclamav/7z/7z.h   2013-09-25 11:40:44.000000000 -0400
    4 @@ -10,7 +10,7 @@
    5  
    6  #define k7zStartHeaderSize 0x20
    7  #define k7zSignatureSize 6
    8 -extern Byte k7zSignature[k7zSignatureSize];
    9 +extern SZByte k7zSignature[k7zSignatureSize];
    10  #define k7zMajorVersion 0
    11  
    12  enum EIdEnum
    13 @@ -83,7 +83,7 @@
    14  
    15  SRes SzFolder_Decode(const CSzFolder *folder, const UInt64 *packSizes,
    16      ILookInStream *stream, UInt64 startPos,
    17 -    Byte *outBuffer, size_t outSize, ISzAlloc *allocMain);
    18 +    SZByte *outBuffer, size_t outSize, ISzAlloc *allocMain);
    19  
    20  typedef struct
    21  {
    22 @@ -97,12 +97,12 @@
    23    UInt64 Size;
    24    UInt32 Crc;
    25    UInt32 Attrib;
    26 -  Byte HasStream;
    27 -  Byte IsDir;
    28 -  Byte IsAnti;
    29 -  Byte CrcDefined;
    30 -  Byte MTimeDefined;
    31 -  Byte AttribDefined;
    32 +  SZByte HasStream;
    33 +  SZByte IsDir;
    34 +  SZByte IsAnti;
    35 +  SZByte CrcDefined;
    36 +  SZByte MTimeDefined;
    37 +  SZByte AttribDefined;
    38  } CSzFileItem;
    39  
    40  void SzFile_Init(CSzFileItem *p);
    41 @@ -110,7 +110,7 @@
    42  typedef struct
    43  {
    44    UInt64 *PackSizes;
    45 -  Byte *PackCRCsDefined;
    46 +  SZByte *PackCRCsDefined;
    47    UInt32 *PackCRCs;
    48    CSzFolder *Folders;
    49    CSzFileItem *Files;
    50 @@ -177,7 +177,7 @@
    51      ILookInStream *inStream,
    52      UInt32 fileIndex,         /* index of file */
    53      UInt32 *blockIndex,       /* index of solid block */
    54 -    Byte **outBuffer,         /* pointer to pointer to output buffer (allocated with allocMain) */
    55 +    SZByte **outBuffer,         /* pointer to pointer to output buffer (allocated with allocMain) */
    56      size_t *outBufferSize,    /* buffer size for output buffer */
    57      size_t *offset,           /* offset of stream for required file in *outBuffer */
    58      size_t *outSizeProcessed, /* size of file in *outBuffer */
    59 diff -u -d -b -w -r libclamav/7z/7zBuf.c libclamav/7z/7zBuf.c
    60 --- libclamav/7z/7zBuf.c        2013-09-25 11:30:13.000000000 -0400
    61 +++ libclamav/7z/7zBuf.c        2013-09-25 11:31:31.000000000 -0400
    62 @@ -1,4 +1,4 @@
    63 -/* 7zBuf.c -- Byte Buffer
    64 +/* 7zBuf.c -- SZByte Buffer
    65  2008-03-28
    66  Igor Pavlov
    67  Public domain */
    68 @@ -19,7 +19,7 @@
    69      p->data = 0;
    70      return 1;
    71    }
    72 -  p->data = (Byte *)alloc->Alloc(alloc, size);
    73 +  p->data = (SZByte *)alloc->Alloc(alloc, size);
    74    if (p->data != 0)
    75    {
    76      p->size = size;
    77 diff -u -d -b -w -r libclamav/7z/7zBuf.h libclamav/7z/7zBuf.h
    78 --- libclamav/7z/7zBuf.h        2013-09-25 11:30:13.000000000 -0400
    79 +++ libclamav/7z/7zBuf.h        2013-09-25 11:40:55.000000000 -0400
    80 @@ -1,4 +1,4 @@
    81 -/* 7zBuf.h -- Byte Buffer
    82 +/* 7zBuf.h -- SZByte Buffer
    83  2009-02-07 : Igor Pavlov : Public domain */
    84  
    85  #ifndef __7Z_BUF_H
    86 @@ -12,7 +12,7 @@
    87  
    88  typedef struct
    89  {
    90 -  Byte *data;
    91 +  SZByte *data;
    92    size_t size;
    93  } CBuf;
    94  
    95 @@ -22,14 +22,14 @@
    96  
    97  typedef struct
    98  {
    99 -  Byte *data;
    100 +  SZByte *data;
    101    size_t size;
    102    size_t pos;
    103  } CDynBuf;
    104  
    105  void DynBuf_Construct(CDynBuf *p);
    106  void DynBuf_SeekToBeg(CDynBuf *p);
    107 -int DynBuf_Write(CDynBuf *p, const Byte *buf, size_t size, ISzAlloc *alloc);
    108 +int DynBuf_Write(CDynBuf *p, const SZByte *buf, size_t size, ISzAlloc *alloc);
    109  void DynBuf_Free(CDynBuf *p, ISzAlloc *alloc);
    110  
     1--- libclamav/7z/Types.h
     2+++ libclamav/7z/Types.h
     3@@ -10,6 +10,8 @@
     4 #include <windows.h>
     5 #endif
     6
     7+#include <zconf.h>
     8+
     9 #ifndef EXTERN_C_BEGIN
    11110 #ifdef __cplusplus
    112 diff -u -d -b -w -r libclamav/7z/7zBuf2.c libclamav/7z/7zBuf2.c
    113 --- libclamav/7z/7zBuf2.c       2013-09-25 11:30:13.000000000 -0400
    114 +++ libclamav/7z/7zBuf2.c       2013-09-25 11:31:45.000000000 -0400
    115 @@ -1,4 +1,4 @@
    116 -/* 7zBuf2.c -- Byte Buffer
    117 +/* 7zBuf2.c -- SZByte Buffer
    118  2008-10-04 : Igor Pavlov : Public domain */
    119  
    120  #include <string.h>
    121 @@ -16,14 +16,14 @@
    122    p->pos = 0;
    123  }
    124  
    125 -int DynBuf_Write(CDynBuf *p, const Byte *buf, size_t size, ISzAlloc *alloc)
    126 +int DynBuf_Write(CDynBuf *p, const SZByte *buf, size_t size, ISzAlloc *alloc)
    127  {
    128    if (size > p->size - p->pos)
    129    {
    130      size_t newSize = p->pos + size;
    131 -    Byte *data;
    132 +    SZByte *data;
    133      newSize += newSize / 4;
    134 -    data = (Byte *)alloc->Alloc(alloc, newSize);
    135 +    data = (SZByte *)alloc->Alloc(alloc, newSize);
    136      if (data == 0)
    137        return 0;
    138      p->size = newSize;
    139 diff -u -d -b -w -r libclamav/7z/7zCrc.c libclamav/7z/7zCrc.c
    140 --- libclamav/7z/7zCrc.c        2013-09-25 11:30:13.000000000 -0400
    141 +++ libclamav/7z/7zCrc.c        2013-09-25 11:31:54.000000000 -0400
    142 @@ -11,7 +11,7 @@
    143  
    144  UInt32 MY_FAST_CALL CrcUpdate(UInt32 v, const void *data, size_t size)
    145  {
    146 -  const Byte *p = (const Byte *)data;
    147 +  const SZByte *p = (const SZByte *)data;
    148    for (; size > 0; size--, p++)
    149      v = CRC_UPDATE_BYTE_2(v, *p);
    150    return v;
    151 diff -u -d -b -w -r libclamav/7z/7zDec.c libclamav/7z/7zDec.c
    152 --- libclamav/7z/7zDec.c        2013-09-25 11:30:13.000000000 -0400
    153 +++ libclamav/7z/7zDec.c        2013-09-25 11:32:51.000000000 -0400
    154 @@ -33,16 +33,16 @@
    155  typedef struct
    156  {
    157    IByteIn p;
    158 -  const Byte *cur;
    159 -  const Byte *end;
    160 -  const Byte *begin;
    161 +  const SZByte *cur;
    162 +  const SZByte *end;
    163 +  const SZByte *begin;
    164    UInt64 processed;
    165    Bool extra;
    166    SRes res;
    167    ILookInStream *inStream;
    168  } CByteInToLook;
    169  
    170 -static Byte ReadByte(void *pp)
    171 +static SZByte ReadByte(void *pp)
    172  {
    173    CByteInToLook *p = (CByteInToLook *)pp;
    174    if (p->cur != p->end)
    175 @@ -64,7 +64,7 @@
    176  }
    177  
    178  static SRes SzDecodePpmd(CSzCoderInfo *coder, UInt64 inSize, ILookInStream *inStream,
    179 -    Byte *outBuffer, SizeT outSize, ISzAlloc *allocMain)
    180 +    SZByte *outBuffer, SizeT outSize, ISzAlloc *allocMain)
    181  {
    182    CPpmd7 ppmd;
    183    CByteInToLook s;
    184 @@ -109,7 +109,7 @@
    185          int sym = Ppmd7_DecodeSymbol(&ppmd, &rc.p);
    186          if (s.extra || sym < 0)
    187            break;
    188 -        outBuffer[i] = (Byte)sym;
    189 +        outBuffer[i] = (SZByte)sym;
    190        }
    191        if (i != outSize)
    192          res = (s.res != SZ_OK ? s.res : SZ_ERROR_DATA);
    193 @@ -125,7 +125,7 @@
    194  
    195  
    196  static SRes SzDecodeLzma(CSzCoderInfo *coder, UInt64 inSize, ILookInStream *inStream,
    197 -    Byte *outBuffer, SizeT outSize, ISzAlloc *allocMain)
    198 +    SZByte *outBuffer, SizeT outSize, ISzAlloc *allocMain)
    199  {
    200    CLzmaDec state;
    201    SRes res = SZ_OK;
    202 @@ -138,7 +138,7 @@
    203  
    204    for (;;)
    205    {
    206 -    Byte *inBuf = NULL;
    207 +    SZByte *inBuf = NULL;
    208      size_t lookahead = (1 << 18);
    209      if (lookahead > inSize)
    210        lookahead = (size_t)inSize;
    211 @@ -173,7 +173,7 @@
    212  }
    213  
    214  static SRes SzDecodeLzma2(CSzCoderInfo *coder, UInt64 inSize, ILookInStream *inStream,
    215 -    Byte *outBuffer, SizeT outSize, ISzAlloc *allocMain)
    216 +    SZByte *outBuffer, SizeT outSize, ISzAlloc *allocMain)
    217  {
    218    CLzma2Dec state;
    219    SRes res = SZ_OK;
    220 @@ -188,7 +188,7 @@
    221  
    222    for (;;)
    223    {
    224 -    Byte *inBuf = NULL;
    225 +    SZByte *inBuf = NULL;
    226      size_t lookahead = (1 << 18);
    227      if (lookahead > inSize)
    228        lookahead = (size_t)inSize;
    229 @@ -221,7 +221,7 @@
    230    return res;
    231  }
    232  
    233 -static SRes SzDecodeCopy(UInt64 inSize, ILookInStream *inStream, Byte *outBuffer)
    234 +static SRes SzDecodeCopy(UInt64 inSize, ILookInStream *inStream, SZByte *outBuffer)
    235  {
    236    while (inSize > 0)
    237    {
    238 @@ -338,13 +338,13 @@
    239  
    240  static SRes SzFolder_Decode2(const CSzFolder *folder, const UInt64 *packSizes,
    241      ILookInStream *inStream, UInt64 startPos,
    242 -    Byte *outBuffer, SizeT outSize, ISzAlloc *allocMain,
    243 -    Byte *tempBuf[])
    244 +    SZByte *outBuffer, SizeT outSize, ISzAlloc *allocMain,
    245 +    SZByte *tempBuf[])
    246  {
    247    UInt32 ci;
    248    SizeT tempSizes[3] = { 0, 0, 0};
    249    SizeT tempSize3 = 0;
    250 -  Byte *tempBuf3 = 0;
    251 +  SZByte *tempBuf3 = 0;
    252  
    253    RINOK(CheckSupportedFolder(folder));
    254  
    255 @@ -357,7 +357,7 @@
    256        UInt32 si = 0;
    257        UInt64 offset;
    258        UInt64 inSize;
    259 -      Byte *outBufCur = outBuffer;
    260 +      SZByte *outBufCur = outBuffer;
    261        SizeT outSizeCur = outSize;
    262        if (folder->NumCoders == 4)
    263        {
    264 @@ -366,11 +366,11 @@
    265          si = indices[ci];
    266          if (ci < 2)
    267          {
    268 -          Byte *temp;
    269 +          SZByte *temp;
    270            outSizeCur = (SizeT)unpackSize;
    271            if (outSizeCur != unpackSize)
    272              return SZ_ERROR_MEM;
    273 -          temp = (Byte *)IAlloc_Alloc(allocMain, outSizeCur);
    274 +          temp = (SZByte *)IAlloc_Alloc(allocMain, outSizeCur);
    275            if (temp == 0 && outSizeCur != 0)
    276              return SZ_ERROR_MEM;
    277            outBufCur = tempBuf[1 - ci] = temp;
    278 @@ -424,7 +424,7 @@
    279        tempSizes[2] = (SizeT)s3Size;
    280        if (tempSizes[2] != s3Size)
    281          return SZ_ERROR_MEM;
    282 -      tempBuf[2] = (Byte *)IAlloc_Alloc(allocMain, tempSizes[2]);
    283 +      tempBuf[2] = (SZByte *)IAlloc_Alloc(allocMain, tempSizes[2]);
    284        if (tempBuf[2] == 0 && tempSizes[2] != 0)
    285          return SZ_ERROR_MEM;
    286        res = SzDecodeCopy(s3Size, inStream, tempBuf[2]);
    287 @@ -462,9 +462,9 @@
    288  
    289  SRes SzFolder_Decode(const CSzFolder *folder, const UInt64 *packSizes,
    290      ILookInStream *inStream, UInt64 startPos,
    291 -    Byte *outBuffer, size_t outSize, ISzAlloc *allocMain)
    292 +    SZByte *outBuffer, size_t outSize, ISzAlloc *allocMain)
    293  {
    294 -  Byte *tempBuf[3] = { 0, 0, 0};
    295 +  SZByte *tempBuf[3] = { 0, 0, 0};
    296    int i;
    297    SRes res = SzFolder_Decode2(folder, packSizes, inStream, startPos,
    298        outBuffer, (SizeT)outSize, allocMain, tempBuf);
    299 diff -u -d -b -w -r libclamav/7z/7zFile.c libclamav/7z/7zFile.c
    300 --- libclamav/7z/7zFile.c       2013-09-25 11:30:13.000000000 -0400
    301 +++ libclamav/7z/7zFile.c       2013-09-25 11:33:00.000000000 -0400
    302 @@ -108,7 +108,7 @@
    303      DWORD curSize = (originalSize > kChunkSizeMax) ? kChunkSizeMax : (DWORD)originalSize;
    304      DWORD processed = 0;
    305      BOOL res = ReadFile(p->handle, data, curSize, &processed, NULL);
    306 -    data = (void *)((Byte *)data + processed);
    307 +    data = (void *)((SZByte *)data + processed);
    308      originalSize -= processed;
    309      *size += processed;
    310      if (!res)
    311 @@ -143,7 +143,7 @@
    312      DWORD curSize = (originalSize > kChunkSizeMax) ? kChunkSizeMax : (DWORD)originalSize;
    313      DWORD processed = 0;
    314      BOOL res = WriteFile(p->handle, data, curSize, &processed, NULL);
    315 -    data = (void *)((Byte *)data + processed);
    316 +    data = (void *)((SZByte *)data + processed);
    317      originalSize -= processed;
    318      *size += processed;
    319      if (!res)
    320 diff -u -d -b -w -r libclamav/7z/7zIn.c libclamav/7z/7zIn.c
    321 --- libclamav/7z/7zIn.c 2013-09-25 11:30:13.000000000 -0400
    322 +++ libclamav/7z/7zIn.c 2013-09-25 11:35:29.000000000 -0400
    323 @@ -7,7 +7,7 @@
    324  #include "7zCrc.h"
    325  #include "CpuArch.h"
    326  
    327 -Byte k7zSignature[k7zSignatureSize] = {'7', 'z', 0xBC, 0xAF, 0x27, 0x1C};
    328 +SZByte k7zSignature[k7zSignatureSize] = {'7', 'z', 0xBC, 0xAF, 0x27, 0x1C};
    329  
    330  #define RINOM(x) { if ((x) == 0) return SZ_ERROR_MEM; }
    331  
    332 @@ -298,7 +298,7 @@
    333  }
    334  */
    335  
    336 -static int TestSignatureCandidate(Byte *testBytes)
    337 +static int TestSignatureCandidate(SZByte *testBytes)
    338  {
    339    size_t i;
    340    for (i = 0; i < k7zSignatureSize; i++)
    341 @@ -309,11 +309,11 @@
    342  
    343  typedef struct _CSzState
    344  {
    345 -  Byte *Data;
    346 +  SZByte *Data;
    347    size_t Size;
    348  }CSzData;
    349  
    350 -static SRes SzReadByte(CSzData *sd, Byte *b)
    351 +static SRes SzReadByte(CSzData *sd, SZByte *b)
    352  {
    353    if (sd->Size == 0)
    354      return SZ_ERROR_ARCHIVE;
    355 @@ -322,7 +322,7 @@
    356    return SZ_OK;
    357  }
    358  
    359 -static SRes SzReadBytes(CSzData *sd, Byte *data, size_t size)
    360 +static SRes SzReadBytes(CSzData *sd, SZByte *data, size_t size)
    361  {
    362    size_t i;
    363    for (i = 0; i < size; i++)
    364 @@ -338,7 +338,7 @@
    365    *value = 0;
    366    for (i = 0; i < 4; i++)
    367    {
    368 -    Byte b;
    369 +    SZByte b;
    370      RINOK(SzReadByte(sd, &b));
    371      *value |= ((UInt32)(b) << (8 * i));
    372    }
    373 @@ -347,14 +347,14 @@
    374  
    375  static SRes SzReadNumber(CSzData *sd, UInt64 *value)
    376  {
    377 -  Byte firstByte;
    378 -  Byte mask = 0x80;
    379 +  SZByte firstByte;
    380 +  SZByte mask = 0x80;
    381    int i;
    382    RINOK(SzReadByte(sd, &firstByte));
    383    *value = 0;
    384    for (i = 0; i < 8; i++)
    385    {
    386 -    Byte b;
    387 +    SZByte b;
    388      if ((firstByte & mask) == 0)
    389      {
    390        UInt64 highPart = firstByte & (mask - 1);
    391 @@ -428,12 +428,12 @@
    392    }
    393  }
    394  
    395 -static SRes SzReadBoolVector(CSzData *sd, size_t numItems, Byte **v, ISzAlloc *alloc)
    396 +static SRes SzReadBoolVector(CSzData *sd, size_t numItems, SZByte **v, ISzAlloc *alloc)
    397  {
    398 -  Byte b = 0;
    399 -  Byte mask = 0;
    400 +  SZByte b = 0;
    401 +  SZByte mask = 0;
    402    size_t i;
    403 -  MY_ALLOC(Byte, *v, numItems, alloc);
    404 +  MY_ALLOC(SZByte, *v, numItems, alloc);
    405    for (i = 0; i < numItems; i++)
    406    {
    407      if (mask == 0)
    408 @@ -441,20 +441,20 @@
    409        RINOK(SzReadByte(sd, &b));
    410        mask = 0x80;
    411      }
    412 -    (*v)[i] = (Byte)(((b & mask) != 0) ? 1 : 0);
    413 +    (*v)[i] = (SZByte)(((b & mask) != 0) ? 1 : 0);
    414      mask >>= 1;
    415    }
    416    return SZ_OK;
    417  }
    418  
    419 -static SRes SzReadBoolVector2(CSzData *sd, size_t numItems, Byte **v, ISzAlloc *alloc)
    420 +static SRes SzReadBoolVector2(CSzData *sd, size_t numItems, SZByte **v, ISzAlloc *alloc)
    421  {
    422 -  Byte allAreDefined;
    423 +  SZByte allAreDefined;
    424    size_t i;
    425    RINOK(SzReadByte(sd, &allAreDefined));
    426    if (allAreDefined == 0)
    427      return SzReadBoolVector(sd, numItems, v, alloc);
    428 -  MY_ALLOC(Byte, *v, numItems, alloc);
    429 +  MY_ALLOC(SZByte, *v, numItems, alloc);
    430    for (i = 0; i < numItems; i++)
    431      (*v)[i] = 1;
    432    return SZ_OK;
    433 @@ -463,7 +463,7 @@
    434  static SRes SzReadHashDigests(
    435      CSzData *sd,
    436      size_t numItems,
    437 -    Byte **digestsDefined,
    438 +    SZByte **digestsDefined,
    439      UInt32 **digests,
    440      ISzAlloc *alloc)
    441  {
    442 @@ -483,7 +483,7 @@
    443      UInt64 *dataOffset,
    444      UInt32 *numPackStreams,
    445      UInt64 **packSizes,
    446 -    Byte **packCRCsDefined,
    447 +    SZByte **packCRCsDefined,
    448      UInt32 **packCRCs,
    449      ISzAlloc *alloc)
    450  {
    451 @@ -515,7 +515,7 @@
    452    }
    453    if (*packCRCsDefined == 0)
    454    {
    455 -    MY_ALLOC(Byte, *packCRCsDefined, (size_t)*numPackStreams, alloc);
    456 +    MY_ALLOC(SZByte, *packCRCsDefined, (size_t)*numPackStreams, alloc);
    457      MY_ALLOC(UInt32, *packCRCs, (size_t)*numPackStreams, alloc);
    458      for (i = 0; i < *numPackStreams; i++)
    459      {
    460 @@ -528,7 +528,7 @@
    461  
    462  static SRes SzReadSwitch(CSzData *sd)
    463  {
    464 -  Byte external;
    465 +  SZByte external;
    466    RINOK(SzReadByte(sd, &external));
    467    return (external == 0) ? SZ_OK: SZ_ERROR_UNSUPPORTED;
    468  }
    469 @@ -550,11 +550,11 @@
    470  
    471    for (i = 0; i < numCoders; i++)
    472    {
    473 -    Byte mainByte;
    474 +    SZByte mainByte;
    475      CSzCoderInfo *coder = folder->Coders + i;
    476      {
    477        unsigned idSize, j;
    478 -      Byte longID[15];
    479 +      SZByte longID[15];
    480        RINOK(SzReadByte(sd, &mainByte));
    481        idSize = (unsigned)(mainByte & 0xF);
    482        RINOK(SzReadBytes(sd, longID, idSize));
    483 @@ -692,7 +692,7 @@
    484      if (type == k7zIdCRC)
    485      {
    486        SRes res;
    487 -      Byte *crcsDefined = 0;
    488 +      SZByte *crcsDefined = 0;
    489        UInt32 *crcs = 0;
    490        res = SzReadHashDigests(sd, *numFolders, &crcsDefined, &crcs, allocTemp);
    491        if (res == SZ_OK)
    492 @@ -719,7 +719,7 @@
    493      CSzFolder *folders,
    494      UInt32 *numUnpackStreams,
    495      UInt64 **unpackSizes,
    496 -    Byte **digestsDefined,
    497 +    SZByte **digestsDefined,
    498      UInt32 **digests,
    499      ISzAlloc *allocTemp)
    500  {
    501 @@ -764,7 +764,7 @@
    502    {
    503      *unpackSizes = (UInt64 *)IAlloc_Alloc(allocTemp, (size_t)*numUnpackStreams * sizeof(UInt64));
    504      RINOM(*unpackSizes);
    505 -    *digestsDefined = (Byte *)IAlloc_Alloc(allocTemp, (size_t)*numUnpackStreams * sizeof(Byte));
    506 +    *digestsDefined = (SZByte *)IAlloc_Alloc(allocTemp, (size_t)*numUnpackStreams * sizeof(SZByte));
    507      RINOM(*digestsDefined);
    508      *digests = (UInt32 *)IAlloc_Alloc(allocTemp, (size_t)*numUnpackStreams * sizeof(UInt32));
    509      RINOM(*digests);
    510 @@ -817,7 +817,7 @@
    511      if (type == k7zIdCRC)
    512      {
    513        int digestIndex = 0;
    514 -      Byte *digestsDefined2 = 0;
    515 +      SZByte *digestsDefined2 = 0;
    516        UInt32 *digests2 = 0;
    517        SRes res = SzReadHashDigests(sd, numDigests, &digestsDefined2, &digests2, allocTemp);
    518        if (res == SZ_OK)
    519 @@ -865,7 +865,7 @@
    520      CSzAr *p,
    521      UInt32 *numUnpackStreams,
    522      UInt64 **unpackSizes, /* allocTemp */
    523 -    Byte **digestsDefined,   /* allocTemp */
    524 +    SZByte **digestsDefined,   /* allocTemp */
    525      UInt32 **digests,        /* allocTemp */
    526      ISzAlloc *alloc,
    527      ISzAlloc *allocTemp)
    528 @@ -909,14 +909,14 @@
    529    if (dest != 0)
    530    {
    531      size_t i;
    532 -    const Byte *src = p->FileNames.data + (p->FileNameOffsets[fileIndex] * 2);
    533 +    const SZByte *src = p->FileNames.data + (p->FileNameOffsets[fileIndex] * 2);
    534      for (i = 0; i < len; i++)
    535        dest[i] = GetUi16(src + i * 2);
    536    }
    537    return len;
    538  }
    539  
    540 -static SRes SzReadFileNames(const Byte *p, size_t size, UInt32 numFiles, size_t *sizes)
    541 +static SRes SzReadFileNames(const SZByte *p, size_t size, UInt32 numFiles, size_t *sizes)
    542  {
    543    UInt32 i;
    544    size_t pos = 0;
    545 @@ -941,11 +941,11 @@
    546      CSzArEx *p,   /* allocMain */
    547      CSzData *sd,
    548      UInt64 **unpackSizes,  /* allocTemp */
    549 -    Byte **digestsDefined,    /* allocTemp */
    550 +    SZByte **digestsDefined,    /* allocTemp */
    551      UInt32 **digests,         /* allocTemp */
    552 -    Byte **emptyStreamVector, /* allocTemp */
    553 -    Byte **emptyFileVector,   /* allocTemp */
    554 -    Byte **lwtVector,         /* allocTemp */
    555 +    SZByte **emptyStreamVector, /* allocTemp */
    556 +    SZByte **emptyFileVector,   /* allocTemp */
    557 +    SZByte **lwtVector,         /* allocTemp */
    558      ISzAlloc *allocMain,
    559      ISzAlloc *allocTemp)
    560  {
    561 @@ -1045,7 +1045,7 @@
    562          for (i = 0; i < numFiles; i++)
    563          {
    564            CSzFileItem *f = &files[i];
    565 -          Byte defined = (*lwtVector)[i];
    566 +          SZByte defined = (*lwtVector)[i];
    567            f->AttribDefined = defined;
    568            f->Attrib = 0;
    569            if (defined)
    570 @@ -1064,7 +1064,7 @@
    571          for (i = 0; i < numFiles; i++)
    572          {
    573            CSzFileItem *f = &files[i];
    574 -          Byte defined = (*lwtVector)[i];
    575 +          SZByte defined = (*lwtVector)[i];
    576            f->MTimeDefined = defined;
    577            f->MTime.Low = f->MTime.High = 0;
    578            if (defined)
    579 @@ -1094,13 +1094,13 @@
    580        if (*emptyStreamVector == 0)
    581          file->HasStream = 1;
    582        else
    583 -        file->HasStream = (Byte)((*emptyStreamVector)[i] ? 0 : 1);
    584 +        file->HasStream = (SZByte)((*emptyStreamVector)[i] ? 0 : 1);
    585        if (file->HasStream)
    586        {
    587          file->IsDir = 0;
    588          file->Size = (*unpackSizes)[sizeIndex];
    589          file->Crc = (*digests)[sizeIndex];
    590 -        file->CrcDefined = (Byte)(*digestsDefined)[sizeIndex];
    591 +        file->CrcDefined = (SZByte)(*digestsDefined)[sizeIndex];
    592          sizeIndex++;
    593        }
    594        else
    595 @@ -1108,7 +1108,7 @@
    596          if (*emptyFileVector == 0)
    597            file->IsDir = 1;
    598          else
    599 -          file->IsDir = (Byte)((*emptyFileVector)[emptyFileIndex] ? 0 : 1);
    600 +          file->IsDir = (SZByte)((*emptyFileVector)[emptyFileIndex] ? 0 : 1);
    601          emptyFileIndex++;
    602          file->Size = 0;
    603          file->Crc = 0;
    604 @@ -1126,11 +1126,11 @@
    605      ISzAlloc *allocTemp)
    606  {
    607    UInt64 *unpackSizes = 0;
    608 -  Byte *digestsDefined = 0;
    609 +  SZByte *digestsDefined = 0;
    610    UInt32 *digests = 0;
    611 -  Byte *emptyStreamVector = 0;
    612 -  Byte *emptyFileVector = 0;
    613 -  Byte *lwtVector = 0;
    614 +  SZByte *emptyStreamVector = 0;
    615 +  SZByte *emptyFileVector = 0;
    616 +  SZByte *lwtVector = 0;
    617    SRes res = SzReadHeader2(p, sd,
    618        &unpackSizes, &digestsDefined, &digests,
    619        &emptyStreamVector, &emptyFileVector, &lwtVector,
    620 @@ -1151,7 +1151,7 @@
    621      UInt64 baseOffset,
    622      CSzAr *p,
    623      UInt64 **unpackSizes,
    624 -    Byte **digestsDefined,
    625 +    SZByte **digestsDefined,
    626      UInt32 **digests,
    627      ISzAlloc *allocTemp)
    628  {
    629 @@ -1197,7 +1197,7 @@
    630  {
    631    CSzAr p;
    632    UInt64 *unpackSizes = 0;
    633 -  Byte *digestsDefined = 0;
    634 +  SZByte *digestsDefined = 0;
    635    UInt32 *digests = 0;
    636    SRes res;
    637    SzAr_Init(&p);
    638 @@ -1217,7 +1217,7 @@
    639      ISzAlloc *allocMain,
    640      ISzAlloc *allocTemp)
    641  {
    642 -  Byte header[k7zStartHeaderSize];
    643 +  SZByte header[k7zStartHeaderSize];
    644    Int64 startArcPos;
    645    UInt64 nextHeaderOffset, nextHeaderSize;
    646    size_t nextHeaderSizeT;
    647 @@ -1246,7 +1246,7 @@
    648      return SZ_ERROR_CRC; */
    649    if(!GetUi32(header + 8) && !nextHeaderOffset && !nextHeaderSize && !nextHeaderCRC) {
    650      int i, checkSize = 500;
    651 -    Byte buf[500];
    652 +    SZByte buf[500];
    653      Int64 curpos=0, endpos=0, readpos;
    654      RINOK(inStream->Seek(inStream, &curpos, SZ_SEEK_CUR));
    655      RINOK(inStream->Seek(inStream, &endpos, SZ_SEEK_END));
    656 @@ -1349,7 +1349,7 @@
    657      ILookInStream *inStream,
    658      UInt32 fileIndex,
    659      UInt32 *blockIndex,
    660 -    Byte **outBuffer,
    661 +    SZByte **outBuffer,
    662      size_t *outBufferSize,
    663      size_t *offset,
    664      size_t *outSizeProcessed,
    665 @@ -1389,7 +1389,7 @@
    666        *outBufferSize = unpackSize;
    667        if (unpackSize != 0)
    668        {
    669 -        *outBuffer = (Byte *)IAlloc_Alloc(allocMain, unpackSize);
    670 +        *outBuffer = (SZByte *)IAlloc_Alloc(allocMain, unpackSize);
    671          if (*outBuffer == 0)
    672            res = SZ_ERROR_MEM;
    673        }
    674 diff -u -d -b -w -r libclamav/7z/7zStream.c libclamav/7z/7zStream.c
    675 --- libclamav/7z/7zStream.c     2013-09-25 11:30:13.000000000 -0400
    676 +++ libclamav/7z/7zStream.c     2013-09-25 11:35:41.000000000 -0400
    677 @@ -13,7 +13,7 @@
    678      RINOK(stream->Read(stream, buf, &processed));
    679      if (processed == 0)
    680        return errorType;
    681 -    buf = (void *)((Byte *)buf + processed);
    682 +    buf = (void *)((SZByte *)buf + processed);
    683      size -= processed;
    684    }
    685    return SZ_OK;
    686 @@ -24,7 +24,7 @@
    687    return SeqInStream_Read2(stream, buf, size, SZ_ERROR_INPUT_EOF);
    688  }
    689  
    690 -SRes SeqInStream_ReadByte(ISeqInStream *stream, Byte *buf)
    691 +SRes SeqInStream_ReadByte(ISeqInStream *stream, SZByte *buf)
    692  {
    693    size_t processed = 1;
    694    RINOK(stream->Read(stream, buf, &processed));
    695 @@ -55,7 +55,7 @@
    696      RINOK(stream->Read(stream, buf, &processed));
    697      if (processed == 0)
    698        return errorType;
    699 -    buf = (void *)((Byte *)buf + processed);
    700 +    buf = (void *)((SZByte *)buf + processed);
    701      size -= processed;
    702    }
    703    return SZ_OK;
    704 diff -u -d -b -w -r libclamav/7z/Bcj2.c libclamav/7z/Bcj2.c
    705 --- libclamav/7z/Bcj2.c 2013-09-25 11:30:13.000000000 -0400
    706 +++ libclamav/7z/Bcj2.c 2013-09-25 11:36:14.000000000 -0400
    707 @@ -31,18 +31,18 @@
    708  #define UPDATE_1(p) range -= bound; code -= bound; *(p) = (CProb)(ttt - (ttt >> kNumMoveBits)); NORMALIZE;
    709  
    710  int Bcj2_Decode(
    711 -    const Byte *buf0, SizeT size0,
    712 -    const Byte *buf1, SizeT size1,
    713 -    const Byte *buf2, SizeT size2,
    714 -    const Byte *buf3, SizeT size3,
    715 -    Byte *outBuf, SizeT outSize)
    716 +    const SZByte *buf0, SizeT size0,
    717 +    const SZByte *buf1, SizeT size1,
    718 +    const SZByte *buf2, SizeT size2,
    719 +    const SZByte *buf3, SizeT size3,
    720 +    SZByte *outBuf, SizeT outSize)
    721  {
    722    CProb p[256 + 2];
    723    SizeT inPos = 0, outPos = 0;
    724  
    725 -  const Byte *buffer, *bufferLim;
    726 +  const SZByte *buffer, *bufferLim;
    727    UInt32 range, code;
    728 -  Byte prevByte = 0;
    729 +  SZByte prevByte = 0;
    730  
    731    unsigned int i;
    732    for (i = 0; i < sizeof(p) / sizeof(p[0]); i++)
    733 @@ -57,7 +57,7 @@
    734  
    735    for (;;)
    736    {
    737 -    Byte b;
    738 +    SZByte b;
    739      CProb *prob;
    740      UInt32 bound;
    741      UInt32 ttt;
    742 @@ -67,7 +67,7 @@
    743        limit = outSize - outPos;
    744      while (limit != 0)
    745      {
    746 -      Byte b = buf0[inPos];
    747 +      SZByte b = buf0[inPos];
    748        outBuf[outPos++] = b;
    749        if (IsJ(prevByte, b))
    750          break;
    751 @@ -96,7 +96,7 @@
    752      else
    753      {
    754        UInt32 dest;
    755 -      const Byte *v;
    756 +      const SZByte *v;
    757        UPDATE_1(prob)
    758        if (b == 0xE8)
    759        {
    760 @@ -116,16 +116,16 @@
    761        }
    762        dest = (((UInt32)v[0] << 24) | ((UInt32)v[1] << 16) |
    763            ((UInt32)v[2] << 8) | ((UInt32)v[3])) - ((UInt32)outPos + 4);
    764 -      outBuf[outPos++] = (Byte)dest;
    765 +      outBuf[outPos++] = (SZByte)dest;
    766        if (outPos == outSize)
    767          break;
    768 -      outBuf[outPos++] = (Byte)(dest >> 8);
    769 +      outBuf[outPos++] = (SZByte)(dest >> 8);
    770        if (outPos == outSize)
    771          break;
    772 -      outBuf[outPos++] = (Byte)(dest >> 16);
    773 +      outBuf[outPos++] = (SZByte)(dest >> 16);
    774        if (outPos == outSize)
    775          break;
    776 -      outBuf[outPos++] = prevByte = (Byte)(dest >> 24);
    777 +      outBuf[outPos++] = prevByte = (SZByte)(dest >> 24);
    778      }
    779    }
    780    return (outPos == outSize) ? SZ_OK : SZ_ERROR_DATA;
    781 diff -u -d -b -w -r libclamav/7z/Bcj2.h libclamav/7z/Bcj2.h
    782 --- libclamav/7z/Bcj2.h 2013-09-25 11:30:13.000000000 -0400
    783 +++ libclamav/7z/Bcj2.h 2013-09-25 11:41:10.000000000 -0400
    784 @@ -25,11 +25,11 @@
    785  */
    786  
    787  int Bcj2_Decode(
    788 -    const Byte *buf0, SizeT size0,
    789 -    const Byte *buf1, SizeT size1,
    790 -    const Byte *buf2, SizeT size2,
    791 -    const Byte *buf3, SizeT size3,
    792 -    Byte *outBuf, SizeT outSize);
    793 +    const SZByte *buf0, SizeT size0,
    794 +    const SZByte *buf1, SizeT size1,
    795 +    const SZByte *buf2, SizeT size2,
    796 +    const SZByte *buf3, SizeT size3,
    797 +    SZByte *outBuf, SizeT outSize);
    798  
    799  #ifdef __cplusplus
    800  }
    801 diff -u -d -b -w -r libclamav/7z/Bra.c libclamav/7z/Bra.c
    802 --- libclamav/7z/Bra.c  2013-09-25 11:30:13.000000000 -0400
    803 +++ libclamav/7z/Bra.c  2013-09-25 11:36:49.000000000 -0400
    804 @@ -3,7 +3,7 @@
    805  
    806  #include "Bra.h"
    807  
    808 -SizeT ARM_Convert(Byte *data, SizeT size, UInt32 ip, int encoding)
    809 +SizeT ARM_Convert(SZByte *data, SizeT size, UInt32 ip, int encoding)
    810  {
    811    SizeT i;
    812    if (size < 4)
    813 @@ -22,15 +22,15 @@
    814        else
    815          dest = src - (ip + (UInt32)i);
    816        dest >>= 2;
    817 -      data[i + 2] = (Byte)(dest >> 16);
    818 -      data[i + 1] = (Byte)(dest >> 8);
    819 -      data[i + 0] = (Byte)dest;
    820 +      data[i + 2] = (SZByte)(dest >> 16);
    821 +      data[i + 1] = (SZByte)(dest >> 8);
    822 +      data[i + 0] = (SZByte)dest;
    823      }
    824    }
    825    return i;
    826  }
    827  
    828 -SizeT ARMT_Convert(Byte *data, SizeT size, UInt32 ip, int encoding)
    829 +SizeT ARMT_Convert(SZByte *data, SizeT size, UInt32 ip, int encoding)
    830  {
    831    SizeT i;
    832    if (size < 4)
    833 @@ -56,17 +56,17 @@
    834          dest = src - (ip + (UInt32)i);
    835        dest >>= 1;
    836        
    837 -      data[i + 1] = (Byte)(0xF0 | ((dest >> 19) & 0x7));
    838 -      data[i + 0] = (Byte)(dest >> 11);
    839 -      data[i + 3] = (Byte)(0xF8 | ((dest >> 8) & 0x7));
    840 -      data[i + 2] = (Byte)dest;
    841 +      data[i + 1] = (SZByte)(0xF0 | ((dest >> 19) & 0x7));
    842 +      data[i + 0] = (SZByte)(dest >> 11);
    843 +      data[i + 3] = (SZByte)(0xF8 | ((dest >> 8) & 0x7));
    844 +      data[i + 2] = (SZByte)dest;
    845        i += 2;
    846      }
    847    }
    848    return i;
    849  }
    850  
    851 -SizeT PPC_Convert(Byte *data, SizeT size, UInt32 ip, int encoding)
    852 +SizeT PPC_Convert(SZByte *data, SizeT size, UInt32 ip, int encoding)
    853  {
    854    SizeT i;
    855    if (size < 4)
    856 @@ -86,9 +86,9 @@
    857          dest = ip + (UInt32)i + src;
    858        else
    859          dest = src - (ip + (UInt32)i);
    860 -      data[i + 0] = (Byte)(0x48 | ((dest >> 24) &  0x3));
    861 -      data[i + 1] = (Byte)(dest >> 16);
    862 -      data[i + 2] = (Byte)(dest >> 8);
    863 +      data[i + 0] = (SZByte)(0x48 | ((dest >> 24) &  0x3));
    864 +      data[i + 1] = (SZByte)(dest >> 16);
    865 +      data[i + 2] = (SZByte)(dest >> 8);
    866        data[i + 3] &= 0x3;
    867        data[i + 3] |= dest;
    868      }
    869 @@ -96,7 +96,7 @@
    870    return i;
    871  }
    872  
    873 -SizeT SPARC_Convert(Byte *data, SizeT size, UInt32 ip, int encoding)
    874 +SizeT SPARC_Convert(SZByte *data, SizeT size, UInt32 ip, int encoding)
    875  {
    876    UInt32 i;
    877    if (size < 4)
    878 @@ -123,10 +123,10 @@
    879        
    880        dest = (((0 - ((dest >> 22) & 1)) << 22) & 0x3FFFFFFF) | (dest & 0x3FFFFF) | 0x40000000;
    881  
    882 -      data[i + 0] = (Byte)(dest >> 24);
    883 -      data[i + 1] = (Byte)(dest >> 16);
    884 -      data[i + 2] = (Byte)(dest >> 8);
    885 -      data[i + 3] = (Byte)dest;
    886 +      data[i + 0] = (SZByte)(dest >> 24);
    887 +      data[i + 1] = (SZByte)(dest >> 16);
    888 +      data[i + 2] = (SZByte)(dest >> 8);
    889 +      data[i + 3] = (SZByte)dest;
    890      }
    891    }
    892    return i;
    893 diff -u -d -b -w -r libclamav/7z/Bra.h libclamav/7z/Bra.h
    894 --- libclamav/7z/Bra.h  2013-09-25 11:30:13.000000000 -0400
    895 +++ libclamav/7z/Bra.h  2013-09-25 11:41:21.000000000 -0400
    896 @@ -54,12 +54,12 @@
    897  */
    898  
    899  #define x86_Convert_Init(state) { state = 0; }
    900 -SizeT x86_Convert(Byte *data, SizeT size, UInt32 ip, UInt32 *state, int encoding);
    901 -SizeT ARM_Convert(Byte *data, SizeT size, UInt32 ip, int encoding);
    902 -SizeT ARMT_Convert(Byte *data, SizeT size, UInt32 ip, int encoding);
    903 -SizeT PPC_Convert(Byte *data, SizeT size, UInt32 ip, int encoding);
    904 -SizeT SPARC_Convert(Byte *data, SizeT size, UInt32 ip, int encoding);
    905 -SizeT IA64_Convert(Byte *data, SizeT size, UInt32 ip, int encoding);
    906 +SizeT x86_Convert(SZByte *data, SizeT size, UInt32 ip, UInt32 *state, int encoding);
    907 +SizeT ARM_Convert(SZByte *data, SizeT size, UInt32 ip, int encoding);
    908 +SizeT ARMT_Convert(SZByte *data, SizeT size, UInt32 ip, int encoding);
    909 +SizeT PPC_Convert(SZByte *data, SizeT size, UInt32 ip, int encoding);
    910 +SizeT SPARC_Convert(SZByte *data, SizeT size, UInt32 ip, int encoding);
    911 +SizeT IA64_Convert(SZByte *data, SizeT size, UInt32 ip, int encoding);
    912  
    913  #ifdef __cplusplus
    914  }
    915 diff -u -d -b -w -r libclamav/7z/Bra86.c libclamav/7z/Bra86.c
    916 --- libclamav/7z/Bra86.c        2013-09-25 11:30:13.000000000 -0400
    917 +++ libclamav/7z/Bra86.c        2013-09-25 11:37:14.000000000 -0400
    918 @@ -5,10 +5,10 @@
    919  
    920  #define Test86MSByte(b) ((b) == 0 || (b) == 0xFF)
    921  
    922 -const Byte kMaskToAllowedStatus[8] = {1, 1, 1, 0, 1, 0, 0, 0};
    923 -const Byte kMaskToBitNumber[8] = {0, 1, 2, 2, 3, 3, 3, 3};
    924 +const SZByte kMaskToAllowedStatus[8] = {1, 1, 1, 0, 1, 0, 0, 0};
    925 +const SZByte kMaskToBitNumber[8] = {0, 1, 2, 2, 3, 3, 3, 3};
    926  
    927 -SizeT x86_Convert(Byte *data, SizeT size, UInt32 ip, UInt32 *state, int encoding)
    928 +SizeT x86_Convert(SZByte *data, SizeT size, UInt32 ip, UInt32 *state, int encoding)
    929  {
    930    SizeT bufferPos = 0, prevPosT;
    931    UInt32 prevMask = *state & 0x7;
    932 @@ -19,8 +19,8 @@
    933  
    934    for (;;)
    935    {
    936 -    Byte *p = data + bufferPos;
    937 -    Byte *limit = data + size - 4;
    938 +    SZByte *p = data + bufferPos;
    939 +    SZByte *limit = data + size - 4;
    940      for (; p < limit; p++)
    941        if ((*p & 0xFE) == 0xE8)
    942          break;
    943 @@ -35,7 +35,7 @@
    944        prevMask = (prevMask << ((int)prevPosT - 1)) & 0x7;
    945        if (prevMask != 0)
    946        {
    947 -        Byte b = p[4 - kMaskToBitNumber[prevMask]];
    948 +        SZByte b = p[4 - kMaskToBitNumber[prevMask]];
    949          if (!kMaskToAllowedStatus[prevMask] || Test86MSByte(b))
    950          {
    951            prevPosT = bufferPos;
    952 @@ -53,7 +53,7 @@
    953        UInt32 dest;
    954        for (;;)
    955        {
    956 -        Byte b;
    957 +        SZByte b;
    958          int index;
    959          if (encoding)
    960            dest = (ip + (UInt32)bufferPos) + src;
    961 @@ -62,15 +62,15 @@
    962          if (prevMask == 0)
    963            break;
    964          index = kMaskToBitNumber[prevMask] * 8;
    965 -        b = (Byte)(dest >> (24 - index));
    966 +        b = (SZByte)(dest >> (24 - index));
    967          if (!Test86MSByte(b))
    968            break;
    969          src = dest ^ ((1 << (32 - index)) - 1);
    970        }
    971 -      p[4] = (Byte)(~(((dest >> 24) & 1) - 1));
    972 -      p[3] = (Byte)(dest >> 16);
    973 -      p[2] = (Byte)(dest >> 8);
    974 -      p[1] = (Byte)dest;
    975 +      p[4] = (SZByte)(~(((dest >> 24) & 1) - 1));
    976 +      p[3] = (SZByte)(dest >> 16);
    977 +      p[2] = (SZByte)(dest >> 8);
    978 +      p[1] = (SZByte)dest;
    979        bufferPos += 5;
    980      }
    981      else
    982 diff -u -d -b -w -r libclamav/7z/CpuArch.h libclamav/7z/CpuArch.h
    983 --- libclamav/7z/CpuArch.h      2013-09-25 11:30:13.000000000 -0400
    984 +++ libclamav/7z/CpuArch.h      2013-09-25 11:41:32.000000000 -0400
    985 @@ -20,17 +20,17 @@
    986  #define GetUi16(p) (cli_readint16(p))
    987  #define GetUi32(p) (cli_readint32(p))
    988  
    989 -#define GetUi64(p) (GetUi32(p) | ((UInt64)GetUi32(((const Byte *)(p)) + 4) << 32))
    990 +#define GetUi64(p) (GetUi32(p) | ((UInt64)GetUi32(((const SZByte *)(p)) + 4) << 32))
    991  
    992  #define SetUi16(p, d) { UInt32 _x_ = (d); \
    993 -    ((Byte *)(p))[0] = (Byte)_x_; \
    994 -    ((Byte *)(p))[1] = (Byte)(_x_ >> 8); }
    995 +    ((SZByte *)(p))[0] = (SZByte)_x_; \
    996 +    ((SZByte *)(p))[1] = (SZByte)(_x_ >> 8); }
    997  
    998  #define SetUi32(p, d) (cli_writeint32(p, d))
    999  
    1000  #define SetUi64(p, d) { UInt64 _x64_ = (d); \
    1001      SetUi32(p, (UInt32)_x64_); \
    1002 -    SetUi32(((Byte *)(p)) + 4, (UInt32)(_x64_ >> 32)); }
    1003 +    SetUi32(((SZByte *)(p)) + 4, (UInt32)(_x64_ >> 32)); }
    1004  
    1005  EXTERN_C_END
    1006  
    1007 diff -u -d -b -w -r libclamav/7z/Lzma2Dec.c libclamav/7z/Lzma2Dec.c
    1008 --- libclamav/7z/Lzma2Dec.c     2013-09-25 11:30:13.000000000 -0400
    1009 +++ libclamav/7z/Lzma2Dec.c     2013-09-25 11:38:00.000000000 -0400
    1010 @@ -58,30 +58,30 @@
    1011    LZMA2_STATE_ERROR
    1012  } ELzma2State;
    1013  
    1014 -static SRes Lzma2Dec_GetOldProps(Byte prop, Byte *props)
    1015 +static SRes Lzma2Dec_GetOldProps(SZByte prop, SZByte *props)
    1016  {
    1017    UInt32 dicSize;
    1018    if (prop > 40)
    1019      return SZ_ERROR_UNSUPPORTED;
    1020    dicSize = (prop == 40) ? 0xFFFFFFFF : LZMA2_DIC_SIZE_FROM_PROP(prop);
    1021 -  props[0] = (Byte)LZMA2_LCLP_MAX;
    1022 -  props[1] = (Byte)(dicSize);
    1023 -  props[2] = (Byte)(dicSize >> 8);
    1024 -  props[3] = (Byte)(dicSize >> 16);
    1025 -  props[4] = (Byte)(dicSize >> 24);
    1026 +  props[0] = (SZByte)LZMA2_LCLP_MAX;
    1027 +  props[1] = (SZByte)(dicSize);
    1028 +  props[2] = (SZByte)(dicSize >> 8);
    1029 +  props[3] = (SZByte)(dicSize >> 16);
    1030 +  props[4] = (SZByte)(dicSize >> 24);
    1031    return SZ_OK;
    1032  }
    1033  
    1034 -SRes Lzma2Dec_AllocateProbs(CLzma2Dec *p, Byte prop, ISzAlloc *alloc)
    1035 +SRes Lzma2Dec_AllocateProbs(CLzma2Dec *p, SZByte prop, ISzAlloc *alloc)
    1036  {
    1037 -  Byte props[LZMA_PROPS_SIZE];
    1038 +  SZByte props[LZMA_PROPS_SIZE];
    1039    RINOK(Lzma2Dec_GetOldProps(prop, props));
    1040    return LzmaDec_AllocateProbs(&p->decoder, props, LZMA_PROPS_SIZE, alloc);
    1041  }
    1042  
    1043 -SRes Lzma2Dec_Allocate(CLzma2Dec *p, Byte prop, ISzAlloc *alloc)
    1044 +SRes Lzma2Dec_Allocate(CLzma2Dec *p, SZByte prop, ISzAlloc *alloc)
    1045  {
    1046 -  Byte props[LZMA_PROPS_SIZE];
    1047 +  SZByte props[LZMA_PROPS_SIZE];
    1048    RINOK(Lzma2Dec_GetOldProps(prop, props));
    1049    return LzmaDec_Allocate(&p->decoder, props, LZMA_PROPS_SIZE, alloc);
    1050  }
    1051 @@ -95,7 +95,7 @@
    1052    LzmaDec_Init(&p->decoder);
    1053  }
    1054  
    1055 -static ELzma2State Lzma2Dec_UpdateState(CLzma2Dec *p, Byte b)
    1056 +static ELzma2State Lzma2Dec_UpdateState(CLzma2Dec *p, SZByte b)
    1057  {
    1058    switch(p->state)
    1059    {
    1060 @@ -156,7 +156,7 @@
    1061    return LZMA2_STATE_ERROR;
    1062  }
    1063  
    1064 -static void LzmaDec_UpdateWithUncompressed(CLzmaDec *p, const Byte *src, SizeT size)
    1065 +static void LzmaDec_UpdateWithUncompressed(CLzmaDec *p, const SZByte *src, SizeT size)
    1066  {
    1067    memcpy(p->dic + p->dicPos, src, size);
    1068    p->dicPos += size;
    1069 @@ -168,7 +168,7 @@
    1070  void LzmaDec_InitDicAndState(CLzmaDec *p, Bool initDic, Bool initState);
    1071  
    1072  SRes Lzma2Dec_DecodeToDic(CLzma2Dec *p, SizeT dicLimit,
    1073 -    const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status)
    1074 +    const SZByte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status)
    1075  {
    1076    SizeT inSize = *srcLen;
    1077    *srcLen = 0;
    1078 @@ -288,7 +288,7 @@
    1079    return SZ_OK;
    1080  }
    1081  
    1082 -SRes Lzma2Dec_DecodeToBuf(CLzma2Dec *p, Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status)
    1083 +SRes Lzma2Dec_DecodeToBuf(CLzma2Dec *p, SZByte *dest, SizeT *destLen, const SZByte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status)
    1084  {
    1085    SizeT outSize = *destLen, inSize = *srcLen;
    1086    *srcLen = *destLen = 0;
    1087 @@ -327,13 +327,13 @@
    1088    }
    1089  }
    1090  
    1091 -SRes Lzma2Decode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen,
    1092 -    Byte prop, ELzmaFinishMode finishMode, ELzmaStatus *status, ISzAlloc *alloc)
    1093 +SRes Lzma2Decode(SZByte *dest, SizeT *destLen, const SZByte *src, SizeT *srcLen,
    1094 +    SZByte prop, ELzmaFinishMode finishMode, ELzmaStatus *status, ISzAlloc *alloc)
    1095  {
    1096    CLzma2Dec decoder;
    1097    SRes res;
    1098    SizeT outSize = *destLen, inSize = *srcLen;
    1099 -  Byte props[LZMA_PROPS_SIZE];
    1100 +  SZByte props[LZMA_PROPS_SIZE];
    1101  
    1102    Lzma2Dec_Construct(&decoder);
    1103  
    1104 diff -u -d -b -w -r libclamav/7z/Lzma2Dec.h libclamav/7z/Lzma2Dec.h
    1105 --- libclamav/7z/Lzma2Dec.h     2013-09-25 11:30:13.000000000 -0400
    1106 +++ libclamav/7z/Lzma2Dec.h     2013-09-25 11:41:52.000000000 -0400
    1107 @@ -18,7 +18,7 @@
    1108    UInt32 packSize;
    1109    UInt32 unpackSize;
    1110    int state;
    1111 -  Byte control;
    1112 +  SZByte control;
    1113    Bool needInitDic;
    1114    Bool needInitState;
    1115    Bool needInitProp;
    1116 @@ -28,8 +28,8 @@
    1117  #define Lzma2Dec_FreeProbs(p, alloc) LzmaDec_FreeProbs(&(p)->decoder, alloc);
    1118  #define Lzma2Dec_Free(p, alloc) LzmaDec_Free(&(p)->decoder, alloc);
    1119  
    1120 -SRes Lzma2Dec_AllocateProbs(CLzma2Dec *p, Byte prop, ISzAlloc *alloc);
    1121 -SRes Lzma2Dec_Allocate(CLzma2Dec *p, Byte prop, ISzAlloc *alloc);
    1122 +SRes Lzma2Dec_AllocateProbs(CLzma2Dec *p, SZByte prop, ISzAlloc *alloc);
    1123 +SRes Lzma2Dec_Allocate(CLzma2Dec *p, SZByte prop, ISzAlloc *alloc);
    1124  void Lzma2Dec_Init(CLzma2Dec *p);
    1125  
    1126  
    1127 @@ -49,10 +49,10 @@
    1128  */
    1129  
    1130  SRes Lzma2Dec_DecodeToDic(CLzma2Dec *p, SizeT dicLimit,
    1131 -    const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status);
    1132 +    const SZByte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status);
    1133  
    1134 -SRes Lzma2Dec_DecodeToBuf(CLzma2Dec *p, Byte *dest, SizeT *destLen,
    1135 -    const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status);
    1136 +SRes Lzma2Dec_DecodeToBuf(CLzma2Dec *p, SZByte *dest, SizeT *destLen,
    1137 +    const SZByte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status);
    1138  
    1139  
    1140  /* ---------- One Call Interface ---------- */
    1141 @@ -74,8 +74,8 @@
    1142    SZ_ERROR_INPUT_EOF - It needs more bytes in input buffer (src).
    1143  */
    1144  
    1145 -SRes Lzma2Decode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen,
    1146 -    Byte prop, ELzmaFinishMode finishMode, ELzmaStatus *status, ISzAlloc *alloc);
    1147 +SRes Lzma2Decode(SZByte *dest, SizeT *destLen, const SZByte *src, SizeT *srcLen,
    1148 +    SZByte prop, ELzmaFinishMode finishMode, ELzmaStatus *status, ISzAlloc *alloc);
    1149  
    1150  #ifdef __cplusplus
    1151  }
    1152 diff -u -d -b -w -r libclamav/7z/LzmaDec.c libclamav/7z/LzmaDec.c
    1153 --- libclamav/7z/LzmaDec.c      2013-09-25 11:30:13.000000000 -0400
    1154 +++ libclamav/7z/LzmaDec.c      2013-09-25 11:39:07.000000000 -0400
    1155 @@ -128,7 +128,7 @@
    1156      = kMatchSpecLenStart + 2 : State Init Marker
    1157  */
    1158  
    1159 -static int MY_FAST_CALL LzmaDec_DecodeReal(CLzmaDec *p, SizeT limit, const Byte *bufLimit)
    1160 +static int MY_FAST_CALL LzmaDec_DecodeReal(CLzmaDec *p, SizeT limit, const SZByte *bufLimit)
    1161  {
    1162    CLzmaProb *probs = p->probs;
    1163  
    1164 @@ -138,7 +138,7 @@
    1165    unsigned lpMask = ((unsigned)1 << (p->prop.lp)) - 1;
    1166    unsigned lc = p->prop.lc;
    1167  
    1168 -  Byte *dic = p->dic;
    1169 +  SZByte *dic = p->dic;
    1170    SizeT dicBufSize = p->dicBufSize;
    1171    SizeT dicPos = p->dicPos;
    1172    
    1173 @@ -146,7 +146,7 @@
    1174    UInt32 checkDicSize = p->checkDicSize;
    1175    unsigned len = 0;
    1176  
    1177 -  const Byte *buf = p->buf;
    1178 +  const SZByte *buf = p->buf;
    1179    UInt32 range = p->range;
    1180    UInt32 code = p->code;
    1181  
    1182 @@ -190,7 +190,7 @@
    1183          }
    1184          while (symbol < 0x100);
    1185        }
    1186 -      dic[dicPos++] = (Byte)symbol;
    1187 +      dic[dicPos++] = (SZByte)symbol;
    1188        processedPos++;
    1189        continue;
    1190      }
    1191 @@ -387,12 +387,12 @@
    1192          len -= curLen;
    1193          if (pos + curLen <= dicBufSize)
    1194          {
    1195 -          Byte *dest = dic + dicPos;
    1196 +          SZByte *dest = dic + dicPos;
    1197            ptrdiff_t src = (ptrdiff_t)pos - (ptrdiff_t)dicPos;
    1198 -          const Byte *lim = dest + curLen;
    1199 +          const SZByte *lim = dest + curLen;
    1200            dicPos += curLen;
    1201            do
    1202 -            *(dest) = (Byte)*(dest + src);
    1203 +            *(dest) = (SZByte)*(dest + src);
    1204            while (++dest != lim);
    1205          }
    1206          else
    1207 @@ -429,7 +429,7 @@
    1208  {
    1209    if (p->remainLen != 0 && p->remainLen < kMatchSpecLenStart)
    1210    {
    1211 -    Byte *dic = p->dic;
    1212 +    SZByte *dic = p->dic;
    1213      SizeT dicPos = p->dicPos;
    1214      SizeT dicBufSize = p->dicBufSize;
    1215      unsigned len = p->remainLen;
    1216 @@ -451,7 +451,7 @@
    1217    }
    1218  }
    1219  
    1220 -static int MY_FAST_CALL LzmaDec_DecodeReal2(CLzmaDec *p, SizeT limit, const Byte *bufLimit)
    1221 +static int MY_FAST_CALL LzmaDec_DecodeReal2(CLzmaDec *p, SizeT limit, const SZByte *bufLimit)
    1222  {
    1223    do
    1224    {
    1225 @@ -484,11 +484,11 @@
    1226    DUMMY_REP
    1227  } ELzmaDummy;
    1228  
    1229 -static ELzmaDummy LzmaDec_TryDummy(const CLzmaDec *p, const Byte *buf, SizeT inSize)
    1230 +static ELzmaDummy LzmaDec_TryDummy(const CLzmaDec *p, const SZByte *buf, SizeT inSize)
    1231  {
    1232    UInt32 range = p->range;
    1233    UInt32 code = p->code;
    1234 -  const Byte *bufLimit = buf + inSize;
    1235 +  const SZByte *bufLimit = buf + inSize;
    1236    CLzmaProb *probs = p->probs;
    1237    unsigned state = p->state;
    1238    ELzmaDummy res;
    1239 @@ -675,7 +675,7 @@
    1240  }
    1241  
    1242  
    1243 -static void LzmaDec_InitRc(CLzmaDec *p, const Byte *data)
    1244 +static void LzmaDec_InitRc(CLzmaDec *p, const SZByte *data)
    1245  {
    1246    p->code = ((UInt32)data[1] << 24) | ((UInt32)data[2] << 16) | ((UInt32)data[3] << 8) | ((UInt32)data[4]);
    1247    p->range = 0xFFFFFFFF;
    1248 @@ -716,7 +716,7 @@
    1249    p->needInitState = 0;
    1250  }
    1251  
    1252 -SRes LzmaDec_DecodeToDic(CLzmaDec *p, SizeT dicLimit, const Byte *src, SizeT *srcLen,
    1253 +SRes LzmaDec_DecodeToDic(CLzmaDec *p, SizeT dicLimit, const SZByte *src, SizeT *srcLen,
    1254      ELzmaFinishMode finishMode, ELzmaStatus *status)
    1255  {
    1256    SizeT inSize = *srcLen;
    1257 @@ -772,7 +772,7 @@
    1258        if (p->tempBufSize == 0)
    1259        {
    1260          SizeT processed;
    1261 -        const Byte *bufLimit;
    1262 +        const SZByte *bufLimit;
    1263          if (inSize < LZMA_REQUIRED_INPUT_MAX || checkEndMarkNow)
    1264          {
    1265            int dummyRes = LzmaDec_TryDummy(p, src, inSize);
    1266 @@ -837,7 +837,7 @@
    1267    return (p->code == 0) ? SZ_OK : SZ_ERROR_DATA;
    1268  }
    1269  
    1270 -SRes LzmaDec_DecodeToBuf(CLzmaDec *p, Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status)
    1271 +SRes LzmaDec_DecodeToBuf(CLzmaDec *p, SZByte *dest, SizeT *destLen, const SZByte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status)
    1272  {
    1273    SizeT outSize = *destLen;
    1274    SizeT inSize = *srcLen;
    1275 @@ -895,10 +895,10 @@
    1276    LzmaDec_FreeDict(p, alloc);
    1277  }
    1278  
    1279 -SRes LzmaProps_Decode(CLzmaProps *p, const Byte *data, unsigned size)
    1280 +SRes LzmaProps_Decode(CLzmaProps *p, const SZByte *data, unsigned size)
    1281  {
    1282    UInt32 dicSize;
    1283 -  Byte d;
    1284 +  SZByte d;
    1285    
    1286    if (size < LZMA_PROPS_SIZE)
    1287      return SZ_ERROR_UNSUPPORTED;
    1288 @@ -935,7 +935,7 @@
    1289    return SZ_OK;
    1290  }
    1291  
    1292 -SRes LzmaDec_AllocateProbs(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAlloc *alloc)
    1293 +SRes LzmaDec_AllocateProbs(CLzmaDec *p, const SZByte *props, unsigned propsSize, ISzAlloc *alloc)
    1294  {
    1295    CLzmaProps propNew;
    1296    RINOK(LzmaProps_Decode(&propNew, props, propsSize));
    1297 @@ -944,7 +944,7 @@
    1298    return SZ_OK;
    1299  }
    1300  
    1301 -SRes LzmaDec_Allocate(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAlloc *alloc)
    1302 +SRes LzmaDec_Allocate(CLzmaDec *p, const SZByte *props, unsigned propsSize, ISzAlloc *alloc)
    1303  {
    1304    CLzmaProps propNew;
    1305    SizeT dicBufSize;
    1306 @@ -954,7 +954,7 @@
    1307    if (p->dic == 0 || dicBufSize != p->dicBufSize)
    1308    {
    1309      LzmaDec_FreeDict(p, alloc);
    1310 -    p->dic = (Byte *)alloc->Alloc(alloc, dicBufSize);
    1311 +    p->dic = (SZByte *)alloc->Alloc(alloc, dicBufSize);
    1312      if (p->dic == 0)
    1313      {
    1314        LzmaDec_FreeProbs(p, alloc);
    1315 @@ -966,8 +966,8 @@
    1316    return SZ_OK;
    1317  }
    1318  
    1319 -SRes LzmaDecode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen,
    1320 -    const Byte *propData, unsigned propSize, ELzmaFinishMode finishMode,
    1321 +SRes LzmaDecode(SZByte *dest, SizeT *destLen, const SZByte *src, SizeT *srcLen,
    1322 +    const SZByte *propData, unsigned propSize, ELzmaFinishMode finishMode,
    1323      ELzmaStatus *status, ISzAlloc *alloc)
    1324  {
    1325    CLzmaDec p;
    1326 diff -u -d -b -w -r libclamav/7z/LzmaDec.h libclamav/7z/LzmaDec.h
    1327 --- libclamav/7z/LzmaDec.h      2013-09-25 11:30:13.000000000 -0400
    1328 +++ libclamav/7z/LzmaDec.h      2013-09-25 11:42:18.000000000 -0400
    1329 @@ -37,7 +37,7 @@
    1330    SZ_ERROR_UNSUPPORTED - Unsupported properties
    1331  */
    1332  
    1333 -SRes LzmaProps_Decode(CLzmaProps *p, const Byte *data, unsigned size);
    1334 +SRes LzmaProps_Decode(CLzmaProps *p, const SZByte *data, unsigned size);
    1335  
    1336  
    1337  /* ---------- LZMA Decoder state ---------- */
    1338 @@ -51,8 +51,8 @@
    1339  {
    1340    CLzmaProps prop;
    1341    CLzmaProb *probs;
    1342 -  Byte *dic;
    1343 -  const Byte *buf;
    1344 +  SZByte *dic;
    1345 +  const SZByte *buf;
    1346    UInt32 range, code;
    1347    SizeT dicPos;
    1348    SizeT dicBufSize;
    1349 @@ -65,7 +65,7 @@
    1350    int needInitState;
    1351    UInt32 numProbs;
    1352    unsigned tempBufSize;
    1353 -  Byte tempBuf[LZMA_REQUIRED_INPUT_MAX];
    1354 +  SZByte tempBuf[LZMA_REQUIRED_INPUT_MAX];
    1355  } CLzmaDec;
    1356  
    1357  #define LzmaDec_Construct(p) { (p)->dic = 0; (p)->probs = 0; }
    1358 @@ -131,10 +131,10 @@
    1359    SZ_ERROR_UNSUPPORTED - Unsupported properties
    1360  */
    1361    
    1362 -SRes LzmaDec_AllocateProbs(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAlloc *alloc);
    1363 +SRes LzmaDec_AllocateProbs(CLzmaDec *p, const SZByte *props, unsigned propsSize, ISzAlloc *alloc);
    1364  void LzmaDec_FreeProbs(CLzmaDec *p, ISzAlloc *alloc);
    1365  
    1366 -SRes LzmaDec_Allocate(CLzmaDec *state, const Byte *prop, unsigned propsSize, ISzAlloc *alloc);
    1367 +SRes LzmaDec_Allocate(CLzmaDec *state, const SZByte *prop, unsigned propsSize, ISzAlloc *alloc);
    1368  void LzmaDec_Free(CLzmaDec *state, ISzAlloc *alloc);
    1369  
    1370  /* ---------- Dictionary Interface ---------- */
    1371 @@ -179,7 +179,7 @@
    1372  */
    1373  
    1374  SRes LzmaDec_DecodeToDic(CLzmaDec *p, SizeT dicLimit,
    1375 -    const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status);
    1376 +    const SZByte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status);
    1377  
    1378  
    1379  /* ---------- Buffer Interface ---------- */
    1380 @@ -195,8 +195,8 @@
    1381    LZMA_FINISH_END - Stream must be finished after (*destLen).
    1382  */
    1383  
    1384 -SRes LzmaDec_DecodeToBuf(CLzmaDec *p, Byte *dest, SizeT *destLen,
    1385 -    const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status);
    1386 +SRes LzmaDec_DecodeToBuf(CLzmaDec *p, SZByte *dest, SizeT *destLen,
    1387 +    const SZByte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status);
    1388  
    1389  
    1390  /* ---------- One Call Interface ---------- */
    1391 @@ -220,8 +220,8 @@
    1392    SZ_ERROR_INPUT_EOF - It needs more bytes in input buffer (src).
    1393  */
    1394  
    1395 -SRes LzmaDecode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen,
    1396 -    const Byte *propData, unsigned propSize, ELzmaFinishMode finishMode,
    1397 +SRes LzmaDecode(SZByte *dest, SizeT *destLen, const SZByte *src, SizeT *srcLen,
    1398 +    const SZByte *propData, unsigned propSize, ELzmaFinishMode finishMode,
    1399      ELzmaStatus *status, ISzAlloc *alloc);
    1400  
    1401  #ifdef __cplusplus
    1402 diff -u -d -b -w -r libclamav/7z/Ppmd.h libclamav/7z/Ppmd.h
    1403 --- libclamav/7z/Ppmd.h 2013-09-25 11:30:13.000000000 -0400
    1404 +++ libclamav/7z/Ppmd.h 2013-09-25 11:42:34.000000000 -0400
    1405 @@ -33,17 +33,17 @@
    1406  typedef struct
    1407  {
    1408    UInt16 Summ; /* Freq */
    1409 -  Byte Shift;  /* Speed of Freq change; low Shift is for fast change */
    1410 -  Byte Count;  /* Count to next change of Shift */
    1411 +  SZByte Shift;  /* Speed of Freq change; low Shift is for fast change */
    1412 +  SZByte Count;  /* Count to next change of Shift */
    1413  } CPpmd_See;
    1414  
    1415  #define Ppmd_See_Update(p)  if ((p)->Shift < PPMD_PERIOD_BITS && --(p)->Count == 0) \
    1416 -    { (p)->Summ <<= 1; (p)->Count = (Byte)(3 << (p)->Shift++); }
    1417 +    { (p)->Summ <<= 1; (p)->Count = (SZByte)(3 << (p)->Shift++); }
    1418  
    1419  typedef struct
    1420  {
    1421 -  Byte Symbol;
    1422 -  Byte Freq;
    1423 +  SZByte Symbol;
    1424 +  SZByte Freq;
    1425    UInt16 SuccessorLow;
    1426    UInt16 SuccessorHigh;
    1427  } CPpmd_State;
    1428 @@ -66,7 +66,7 @@
    1429  
    1430  typedef
    1431    #ifdef PPMD_32BIT
    1432 -    Byte *
    1433 +    SZByte *
    1434    #else
    1435      UInt32
    1436    #endif
    1437 diff -u -d -b -w -r libclamav/7z/Ppmd7.c libclamav/7z/Ppmd7.c
    1438 --- libclamav/7z/Ppmd7.c        2013-09-25 11:30:13.000000000 -0400
    1439 +++ libclamav/7z/Ppmd7.c        2013-09-25 11:40:06.000000000 -0400
    1440 @@ -6,7 +6,7 @@
    1441  
    1442  #include "Ppmd7.h"
    1443  
    1444 -const Byte PPMD7_kExpEscape[16] = { 25, 14, 9, 7, 5, 5, 4, 4, 4, 3, 3, 3, 2, 2, 2, 2 };
    1445 +const SZByte PPMD7_kExpEscape[16] = { 25, 14, 9, 7, 5, 5, 4, 4, 4, 3, 3, 3, 2, 2, 2, 2 };
    1446  static const UInt16 kInitBinEsc[] = { 0x3CDD, 0x1F3F, 0x59BF, 0x48F3, 0x64A1, 0x5ABC, 0x6632, 0x6051};
    1447  
    1448  #define MAX_FREQ 124
    1449 @@ -19,7 +19,7 @@
    1450  #ifdef PPMD_32BIT
    1451    #define REF(ptr) (ptr)
    1452  #else
    1453 -  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
    1454 +  #define REF(ptr) ((UInt32)((SZByte *)(ptr) - (p)->Base))
    1455  #endif
    1456  
    1457  #define STATS_REF(ptr) ((CPpmd_State_Ref)REF(ptr))
    1458 @@ -69,8 +69,8 @@
    1459    for (i = 0, k = 0; i < PPMD_NUM_INDEXES; i++)
    1460    {
    1461      unsigned step = (i >= 12 ? 4 : (i >> 2) + 1);
    1462 -    do { p->Units2Indx[k++] = (Byte)i; } while(--step);
    1463 -    p->Indx2Units[i] = (Byte)k;
    1464 +    do { p->Units2Indx[k++] = (SZByte)i; } while(--step);
    1465 +    p->Indx2Units[i] = (SZByte)k;
    1466    }
    1467  
    1468    p->NS2BSIndx[0] = (0 << 1);
    1469 @@ -79,10 +79,10 @@
    1470    memset(p->NS2BSIndx + 11, (3 << 1), 256 - 11);
    1471  
    1472    for (i = 0; i < 3; i++)
    1473 -    p->NS2Indx[i] = (Byte)i;
    1474 +    p->NS2Indx[i] = (SZByte)i;
    1475    for (m = i, k = 1; i < 256; i++)
    1476    {
    1477 -    p->NS2Indx[i] = (Byte)m;
    1478 +    p->NS2Indx[i] = (SZByte)m;
    1479      if (--k == 0)
    1480        k = (++m) - 2;
    1481    }
    1482 @@ -109,7 +109,7 @@
    1483        #else
    1484          4 - (size & 3);
    1485        #endif
    1486 -    if ((p->Base = (Byte *)alloc->Alloc(alloc, p->AlignOffset + size
    1487 +    if ((p->Base = (SZByte *)alloc->Alloc(alloc, p->AlignOffset + size
    1488          #ifndef PPMD_32BIT
    1489          + UNIT_SIZE
    1490          #endif
    1491 @@ -136,11 +136,11 @@
    1492  static void SplitBlock(CPpmd7 *p, void *ptr, unsigned oldIndx, unsigned newIndx)
    1493  {
    1494    unsigned i, nu = I2U(oldIndx) - I2U(newIndx);
    1495 -  ptr = (Byte *)ptr + U2B(I2U(newIndx));
    1496 +  ptr = (SZByte *)ptr + U2B(I2U(newIndx));
    1497    if (I2U(i = U2I(nu)) != nu)
    1498    {
    1499      unsigned k = I2U(--i);
    1500 -    InsertNode(p, ((Byte *)ptr) + U2B(k), nu - k - 1);
    1501 +    InsertNode(p, ((SZByte *)ptr) + U2B(k), nu - k - 1);
    1502    }
    1503    InsertNode(p, ptr, i);
    1504  }
    1505 @@ -311,7 +311,7 @@
    1506    for (i = 0; i < 256; i++)
    1507    {
    1508      CPpmd_State *s = &p->FoundState[i];
    1509 -    s->Symbol = (Byte)i;
    1510 +    s->Symbol = (SZByte)i;
    1511      s->Freq = 1;
    1512      SetSuccessor(s, 0);
    1513    }
    1514 @@ -376,7 +376,7 @@
    1515      ps[numPs++] = s;
    1516    }
    1517    
    1518 -  upState.Symbol = *(const Byte *)Ppmd7_GetPtr(p, upBranch);
    1519 +  upState.Symbol = *(const SZByte *)Ppmd7_GetPtr(p, upBranch);
    1520    SetSuccessor(&upState, upBranch + 1);
    1521    
    1522    if (c->NumStats == 1)
    1523 @@ -388,7 +388,7 @@
    1524      for (s = STATS(c); s->Symbol != upState.Symbol; s++);
    1525      cf = s->Freq - 1;
    1526      s0 = c->SummFreq - c->NumStats - cf;
    1527 -    upState.Freq = (Byte)(1 + ((2 * cf <= s0) ? (5 * cf > s0) : ((2 * cf + 3 * s0 - 1) / (2 * s0))));
    1528 +    upState.Freq = (SZByte)(1 + ((2 * cf <= s0) ? (5 * cf > s0) : ((2 * cf + 3 * s0 - 1) / (2 * s0))));
    1529    }
    1530  
    1531    do
    1532 @@ -565,7 +565,7 @@
    1533        CPpmd_State *s = STATS(c) + ns1;
    1534        SetSuccessor(s, successor);
    1535        s->Symbol = p->FoundState->Symbol;
    1536 -      s->Freq = (Byte)cf;
    1537 +      s->Freq = (SZByte)cf;
    1538        c->NumStats = (UInt16)(ns1 + 1);
    1539      }
    1540    }
    1541 @@ -586,14 +586,14 @@
    1542    escFreq = p->MinContext->SummFreq - s->Freq;
    1543    s->Freq += 4;
    1544    adder = (p->OrderFall != 0);
    1545 -  s->Freq = (Byte)((s->Freq + adder) >> 1);
    1546 +  s->Freq = (SZByte)((s->Freq + adder) >> 1);
    1547    sumFreq = s->Freq;
    1548    
    1549    i = p->MinContext->NumStats - 1;
    1550    do
    1551    {
    1552      escFreq -= (++s)->Freq;
    1553 -    s->Freq = (Byte)((s->Freq + adder) >> 1);
    1554 +    s->Freq = (SZByte)((s->Freq + adder) >> 1);
    1555      sumFreq += s->Freq;
    1556      if (s[0].Freq > s[-1].Freq)
    1557      {
    1558 @@ -619,7 +619,7 @@
    1559        CPpmd_State tmp = *stats;
    1560        do
    1561        {
    1562 -        tmp.Freq = (Byte)(tmp.Freq - (tmp.Freq >> 1));
    1563 +        tmp.Freq = (SZByte)(tmp.Freq - (tmp.Freq >> 1));
    1564          escFreq >>= 1;
    1565        }
    1566        while (escFreq > 1);
    1567 @@ -664,7 +664,7 @@
    1568  static void NextContext(CPpmd7 *p)
    1569  {
    1570    CTX_PTR c = CTX(SUCCESSOR(p->FoundState));
    1571 -  if (p->OrderFall == 0 && (Byte *)c > p->Text)
    1572 +  if (p->OrderFall == 0 && (SZByte *)c > p->Text)
    1573      p->MinContext = p->MaxContext = c;
    1574    else
    1575      UpdateModel(p);
    1576 @@ -697,7 +697,7 @@
    1577  
    1578  void Ppmd7_UpdateBin(CPpmd7 *p)
    1579  {
    1580 -  p->FoundState->Freq = (Byte)(p->FoundState->Freq + (p->FoundState->Freq < 128 ? 1: 0));
    1581 +  p->FoundState->Freq = (SZByte)(p->FoundState->Freq + (p->FoundState->Freq < 128 ? 1: 0));
    1582    p->PrevSuccess = 1;
    1583    p->RunLength++;
    1584    NextContext(p);
    1585 diff -u -d -b -w -r libclamav/7z/Ppmd7.h libclamav/7z/Ppmd7.h
    1586 --- libclamav/7z/Ppmd7.h        2013-09-25 11:30:13.000000000 -0400
    1587 +++ libclamav/7z/Ppmd7.h        2013-09-25 11:43:00.000000000 -0400
    1588 @@ -48,13 +48,13 @@
    1589  
    1590    UInt32 Size;
    1591    UInt32 GlueCount;
    1592 -  Byte *Base, *LoUnit, *HiUnit, *Text, *UnitsStart;
    1593 +  SZByte *Base, *LoUnit, *HiUnit, *Text, *UnitsStart;
    1594    UInt32 AlignOffset;
    1595  
    1596 -  Byte Indx2Units[PPMD_NUM_INDEXES];
    1597 -  Byte Units2Indx[128];
    1598 +  SZByte Indx2Units[PPMD_NUM_INDEXES];
    1599 +  SZByte Units2Indx[128];
    1600    CPpmd_Void_Ref FreeList[PPMD_NUM_INDEXES];
    1601 -  Byte NS2Indx[256], NS2BSIndx[256], HB2Flag[256];
    1602 +  SZByte NS2Indx[256], NS2BSIndx[256], HB2Flag[256];
    1603    CPpmd_See DummySee, See[25][16];
    1604    UInt16 BinSumm[128][64];
    1605  } CPpmd7;
    1606 @@ -68,7 +68,7 @@
    1607  
    1608  /* ---------- Internal Functions ---------- */
    1609  
    1610 -extern const Byte PPMD7_kExpEscape[16];
    1611 +extern const SZByte PPMD7_kExpEscape[16];
    1612  
    1613  #ifdef PPMD_32BIT
    1614    #define Ppmd7_GetPtr(p, ptr) (ptr)
    1615 @@ -125,7 +125,7 @@
    1616  {
    1617    UInt64 Low;
    1618    UInt32 Range;
    1619 -  Byte Cache;
    1620 +  SZByte Cache;
    1621    UInt64 CacheSize;
    1622    IByteOut *Stream;
    1623  } CPpmd7z_RangeEnc;
    1624 diff -u -d -b -w -r libclamav/7z/Ppmd7Dec.c libclamav/7z/Ppmd7Dec.c
    1625 --- libclamav/7z/Ppmd7Dec.c     2013-09-25 11:30:13.000000000 -0400
    1626 +++ libclamav/7z/Ppmd7Dec.c     2013-09-25 11:40:20.000000000 -0400
    1627 @@ -86,7 +86,7 @@
    1628      UInt32 count, hiCnt;
    1629      if ((count = rc->GetThreshold(rc, p->MinContext->SummFreq)) < (hiCnt = s->Freq))
    1630      {
    1631 -      Byte symbol;
    1632 +      SZByte symbol;
    1633        rc->Decode(rc, 0, s->Freq);
    1634        p->FoundState = s;
    1635        symbol = s->Symbol;
    1636 @@ -99,7 +99,7 @@
    1637      {
    1638        if ((hiCnt += (++s)->Freq) > count)
    1639        {
    1640 -        Byte symbol;
    1641 +        SZByte symbol;
    1642          rc->Decode(rc, hiCnt - s->Freq, s->Freq);
    1643          p->FoundState = s;
    1644          symbol = s->Symbol;
    1645 @@ -122,7 +122,7 @@
    1646      UInt16 *prob = Ppmd7_GetBinSumm(p);
    1647      if (rc->DecodeBit(rc, *prob) == 0)
    1648      {
    1649 -      Byte symbol;
    1650 +      SZByte symbol;
    1651        *prob = (UInt16)PPMD_UPDATE_PROB_0(*prob);
    1652        symbol = (p->FoundState = Ppmd7Context_OneState(p->MinContext))->Symbol;
    1653        Ppmd7_UpdateBin(p);
    1654 @@ -167,7 +167,7 @@
    1655      
    1656      if (count < hiCnt)
    1657      {
    1658 -      Byte symbol;
    1659 +      SZByte symbol;
    1660        CPpmd_State **pps = ps;
    1661        for (hiCnt = 0; (hiCnt += (*pps)->Freq) <= count; pps++);
    1662        s = *pps;
    1663 diff -u -d -b -w -r libclamav/7z/Types.h libclamav/7z/Types.h
    1664 --- libclamav/7z/Types.h        2013-09-25 11:30:13.000000000 -0400
    1665 +++ libclamav/7z/Types.h        2013-09-25 11:43:09.000000000 -0400
    1666 @@ -55,7 +55,7 @@
     11 #define EXTERN_C_BEGIN extern "C" {
     12@@ -55,7 +57,9 @@ typedef int WRes;
    166713 #define RINOK(x) { int __result__ = (x); if (__result__ != 0) return __result__; }
    166814 #endif
    1669  
    1670 -typedef unsigned char Byte;
    1671 +typedef unsigned char SZByte;
     15
     16+/* aCaB -- use Byte defined in zconf.h
     17 typedef unsigned char Byte;
     18+*/
    167219 typedef short Int16;
    167320 typedef unsigned short UInt16;
    1674  
    1675 @@ -129,12 +129,12 @@
    1676  
    1677  typedef struct
    1678  {
    1679 -  Byte (*Read)(void *p); /* reads one byte, returns 0 in case of EOF or error */
    1680 +  SZByte (*Read)(void *p); /* reads one byte, returns 0 in case of EOF or error */
    1681  } IByteIn;
    1682  
    1683  typedef struct
    1684  {
    1685 -  void (*Write)(void *p, Byte b);
    1686 +  void (*Write)(void *p, SZByte b);
    1687  } IByteOut;
    1688  
    1689  typedef struct
    1690 @@ -147,7 +147,7 @@
    1691  /* it can return SZ_ERROR_INPUT_EOF */
    1692  SRes SeqInStream_Read(ISeqInStream *stream, void *buf, size_t size);
    1693  SRes SeqInStream_Read2(ISeqInStream *stream, void *buf, size_t size, SRes errorType);
    1694 -SRes SeqInStream_ReadByte(ISeqInStream *stream, Byte *buf);
    1695 +SRes SeqInStream_ReadByte(ISeqInStream *stream, SZByte *buf);
    1696  
    1697  typedef struct
    1698  {
    1699 @@ -199,7 +199,7 @@
    1700    ISeekInStream *realStream;
    1701    size_t pos;
    1702    size_t size;
    1703 -  Byte buf[LookToRead_BUF_SIZE];
    1704 +  SZByte buf[LookToRead_BUF_SIZE];
    1705  } CLookToRead;
    1706  
    1707  void LookToRead_CreateVTable(CLookToRead *p, int lookahead);
Note: See TracChangeset for help on using the changeset viewer.