Previous 199869 Revisions Next

r34338 Sunday 11th January, 2015 at 07:30:12 UTC by Miodrag Milanović
Applied changes same as on previous source (nw)
[3rdparty/lzma/C]7zCrc.c Alloc.c Alloc.h CpuArch.c CpuArch.h LzmaDec.c LzmaDec.h LzmaEnc.c Ppmd7.c Threads.c Types.h

trunk/3rdparty/lzma/C/7zCrc.c
r242849r242850
66
77#define kCrcPoly 0xEDB88320
88
9#ifdef MY_CPU_X86_OR_AMD64
10  #define CRC_NUM_TABLES 8
11  UInt32 MY_FAST_CALL CrcUpdateT8(UInt32 v, const void *data, size_t size, const UInt32 *table);
12#elif defined(MY_CPU_LE)
9#if defined(MY_CPU_LE)
1310  #define CRC_NUM_TABLES 4
1411#else
1512  #define CRC_NUM_TABLES 5
trunk/3rdparty/lzma/C/Alloc.c
r242849r242850
33Igor Pavlov
44Public domain */
55
6#ifdef _WIN32
6#ifdef _WIN32_7Z
77#include <windows.h>
88#endif
99#include <stdlib.h>
r242849r242850
4444  free(address);
4545}
4646
47#ifdef _WIN32
47#ifdef _WIN32_7Z
4848
4949void *MidAlloc(size_t size)
5050{
trunk/3rdparty/lzma/C/Alloc.h
r242849r242850
1313void *MyAlloc(size_t size);
1414void MyFree(void *address);
1515
16#ifdef _WIN32
16#ifdef _WIN32_7Z
1717
1818void SetLargePageSize();
1919
trunk/3rdparty/lzma/C/CpuArch.c
r242849r242850
7272
7373  #else
7474
75  __asm__ __volatile__ (
76    "cpuid"
77    : "=a" (*a) ,
78      "=b" (*b) ,
79      "=c" (*c) ,
80      "=d" (*d)
81    : "0" (function)) ;
75   #ifdef __PIC__
76   __asm__ __volatile__ (
77   "mov %%ebx, %%edi;"
78   "cpuid;"
79   "xchgl %%ebx, %%edi;"
80   : "=a" (*a) ,
81      "=D" (*b) , /* edi */
82      "=c" (*c) ,
83      "=d" (*d)
84   : "0" (function)) ;
85   #else   // __PIC__
86   __asm__ __volatile__ (
87   "cpuid"
88   : "=a" (*a) ,
89      "=b" (*b) ,
90      "=c" (*c) ,
91      "=d" (*d)
92   : "0" (function)) ;
93   #endif  // __PIC__
94 
95   #endif
8296
83  #endif
84 
8597  #else
8698
8799  int CPUInfo[4];
r242849r242850
123135  return -1;
124136}
125137
126Bool CPU_Is_InOrder()
138Bool CPU_Is_InOrder(void)
127139{
128140  Cx86cpuid p;
129141  int firm;
r242849r242850
142154  return True;
143155}
144156
145#if !defined(MY_CPU_AMD64) && defined(_WIN32)
146static Bool CPU_Sys_Is_SSE_Supported()
157#if !defined(MY_CPU_AMD64) && defined(_WIN32_7Z)
158static Bool CPU_Sys_Is_SSE_Supported(void)
147159{
148160  OSVERSIONINFO vi;
149161  vi.dwOSVersionInfoSize = sizeof(vi);
r242849r242850
156168#define CHECK_SYS_SSE_SUPPORT
157169#endif
158170
159Bool CPU_Is_Aes_Supported()
171Bool CPU_Is_Aes_Supported(void)
160172{
161173  Cx86cpuid p;
162174  CHECK_SYS_SSE_SUPPORT
trunk/3rdparty/lzma/C/CpuArch.h
r242849r242850
2020#define MY_CPU_AMD64
2121#endif
2222
23#if defined(MY_CPU_AMD64) || defined(_M_IA64)
23#ifdef PTR64
2424#define MY_CPU_64BIT
2525#endif
2626
r242849r242850
3636#define MY_CPU_32BIT
3737#endif
3838
39#if defined(_WIN32) && defined(_M_ARM)
39#if defined(_WIN32_7Z) && defined(_M_ARM)
4040#define MY_CPU_ARM_LE
4141#endif
4242
43#if defined(_WIN32) && defined(_M_IA64)
43#if defined(_WIN32_7Z) && defined(_M_IA64)
4444#define MY_CPU_IA64_LE
4545#endif
4646
r242849r242850
5252#define MY_CPU_LE
5353#endif
5454
55#if defined(__BIG_ENDIAN__) || defined(__m68k__) ||  defined(__ARMEB__) || defined(__MIPSEB__)
55#ifdef BIGENDIAN
5656#define MY_CPU_BE
5757#endif
5858
r242849r242850
9797
9898#endif
9999
100#if defined(MY_CPU_LE_UNALIGN) && defined(_WIN64) && (_MSC_VER >= 1300)
100#if defined(MY_CPU_LE_UNALIGN) && defined(_WIN64) && (defined(_MSC_VER) && (_MSC_VER >= 1300))
101#include <stdlib.h>
101102
102103#pragma intrinsic(_byteswap_ulong)
103104#pragma intrinsic(_byteswap_uint64)
r242849r242850
145146#define x86cpuid_GetModel(p) (((p)->ver >> 4) & 0xF00F)
146147#define x86cpuid_GetStepping(p) ((p)->ver & 0xF)
147148
148Bool CPU_Is_InOrder();
149Bool CPU_Is_Aes_Supported();
149Bool CPU_Is_InOrder(void);
150Bool CPU_Is_Aes_Supported(void);
150151
151152#endif
152153
trunk/3rdparty/lzma/C/LzmaDec.c
r242849r242850
967967  return SZ_OK;
968968}
969969
970// why isn't there an interface to pass in the properties directly????
971SRes LzmaDec_Allocate_MAME(CLzmaDec *p, const CLzmaProps *propNew, ISzAlloc *alloc)
972{
973   SizeT dicBufSize;
974   RINOK(LzmaDec_AllocateProbs2(p, propNew, alloc));
975   dicBufSize = propNew->dicSize;
976   if (p->dic == 0 || dicBufSize != p->dicBufSize)
977   {
978   LzmaDec_FreeDict(p, alloc);
979   p->dic = (Byte *)alloc->Alloc(alloc, dicBufSize);
980   if (p->dic == 0)
981   {
982      LzmaDec_FreeProbs(p, alloc);
983      return SZ_ERROR_MEM;
984   }
985   }
986   p->dicBufSize = dicBufSize;
987   p->prop = *propNew;
988   return SZ_OK;
989}
990
970991SRes LzmaDecode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen,
971992    const Byte *propData, unsigned propSize, ELzmaFinishMode finishMode,
972993    ELzmaStatus *status, ISzAlloc *alloc)
trunk/3rdparty/lzma/C/LzmaDec.h
r242849r242850
224224    const Byte *propData, unsigned propSize, ELzmaFinishMode finishMode,
225225    ELzmaStatus *status, ISzAlloc *alloc);
226226
227/*
228 * Why isn't there an interface to pass in the properties directly????
229 */
230SRes LzmaDec_Allocate_MAME(CLzmaDec *p, const CLzmaProps *propNew, ISzAlloc *alloc);
231
227232#ifdef __cplusplus
228233}
229234#endif
trunk/3rdparty/lzma/C/LzmaEnc.c
r242849r242850
19051905static SRes LzmaEnc_Alloc(CLzmaEnc *p, UInt32 keepWindowSize, ISzAlloc *alloc, ISzAlloc *allocBig)
19061906{
19071907  UInt32 beforeSize = kNumOpts;
1908  #ifndef _7ZIP_ST
19081909  Bool btMode;
1910  #endif
19091911  if (!RangeEnc_Alloc(&p->rc, alloc))
1910    return SZ_ERROR_MEM;
1912  return SZ_ERROR_MEM;
1913  #ifndef _7ZIP_ST
19111914  btMode = (p->matchFinderBase.btMode != 0);
1912  #ifndef _7ZIP_ST
19131915  p->mtMode = (p->multiThread && !p->fastMode && btMode);
19141916  #endif
19151917
r242849r242850
20852087  CLzmaEnc *p = (CLzmaEnc *)pp;
20862088  if (p->mtMode)
20872089    MatchFinderMt_ReleaseStream(&p->matchFinderMt);
2088  #else
2089  pp = pp;
20902090  #endif
20912091}
20922092
trunk/3rdparty/lzma/C/Ppmd7.c
r242849r242850
222010-03-12 : Igor Pavlov : Public domain
33This code is based on PPMd var.H (2001): Dmitry Shkarin : Public domain */
44
5#include <memory.h>
5#include <string.h>
66
77#include "Ppmd7.h"
88
trunk/3rdparty/lzma/C/Threads.c
r242849r242850
11/* Threads.c -- multithreading library
222009-09-20 : Igor Pavlov : Public domain */
33
4#ifndef _WIN32_WCE
4#ifndef _WIN32_7Z_WCE
55#include <process.h>
66#endif
77
trunk/3rdparty/lzma/C/Types.h
r242849r242850
66
77#include <stddef.h>
88
9#ifdef _WIN32
9#ifdef _WIN32_7Z
1010#include <windows.h>
1111#endif
1212
r242849r242850
4242
4343typedef int SRes;
4444
45#ifdef _WIN32
45#ifdef _WIN32_7Z
4646typedef DWORD WRes;
4747#else
4848typedef int WRes;
r242849r242850
9797#define False 0
9898
9999
100#ifdef _WIN32
100#ifdef _WIN32_7Z
101101#define MY_STD_CALL __stdcall
102102#else
103103#define MY_STD_CALL
r242849r242850
233233#define IAlloc_Alloc(p, size) (p)->Alloc((p), size)
234234#define IAlloc_Free(p, a) (p)->Free((p), a)
235235
236#ifdef _WIN32
236#ifdef _WIN32_7Z
237237
238238#define CHAR_PATH_SEPARATOR '\\'
239239#define WCHAR_PATH_SEPARATOR L'\\'


Previous 199869 Revisions Next


© 1997-2024 The MAME Team