File: 02_non-intel.patch

package info (click to toggle)
ppmd 9.1-13
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 228 kB
  • ctags: 329
  • sloc: cpp: 1,332; makefile: 53
file content (101 lines) | stat: -rw-r--r-- 3,470 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#DPATCHLEVEL=0
--- Model.cpp	2002-04-28 17:51:00.000000000 +0300
+++ Model.cpp	2005-07-21 07:47:07.000000000 +0300
@@ -62,13 +62,14 @@
 
 inline void SWAP(PPM_CONTEXT::STATE& s1,PPM_CONTEXT::STATE& s2)
 {
-    WORD t1=(WORD&) s1;                     PPM_CONTEXT* t2=s1.Successor;
-    (WORD&) s1 = (WORD&) s2;                s1.Successor=s2.Successor;
-    (WORD&) s2 = t1;                        s2.Successor=t2;
+    PPM_CONTEXT::STATE t1 = s1;
+    s1 = s2;
+    s2 = t1;
 }
+
 inline void StateCpy(PPM_CONTEXT::STATE& s1,const PPM_CONTEXT::STATE& s2)
 {
-    (WORD&) s1=(WORD&) s2;                  s1.Successor=s2.Successor;
+    s1 = s2;
 }
 struct PPMD_STARTUP { inline PPMD_STARTUP(); } PPMd_StartUp;
 inline PPMD_STARTUP::PPMD_STARTUP()         // constants initialization
@@ -88,7 +89,9 @@
         QTable[i]=m;
         if ( !--k ) { k = ++Step;           m++; }
     }
-    (DWORD&) DummySEE2Cont=PPMdSignature;
+    DummySEE2Cont.Summ = (PPMdSignature & 0xffff0000) >> 16;
+    DummySEE2Cont.Shift = (PPMdSignature & 0xff00) >> 8;
+    DummySEE2Cont.Count = (PPMdSignature & 0xff);
 }
 static void _STDCALL StartModelRare(int MaxOrder,MR_METHOD MRMethod)
 {
--- SubAlloc.hpp	2002-04-28 17:51:00.000000000 +0300
+++ SubAlloc.hpp	2006-03-05 00:50:43.000000000 +0200
@@ -5,8 +5,14 @@
  *  Contents: memory allocation routines                                    *
  ****************************************************************************/
 
-enum { UNIT_SIZE=12, N1=4, N2=4, N3=4, N4=(128+3-1*N1-2*N2-3*N3)/4,
-        N_INDEXES=N1+N2+N3+N4 };
+enum {
+	UNIT_SIZE = sizeof(DWORD)*3,
+	N1 = 4,
+	N2 = 4,
+	N3 = 4,
+	N4 = (128 + 3 - 1*N1 - 2*N2 - 3*N3) / 4,
+	N_INDEXES = N1 + N2 + N3 + N4
+};
 
 #pragma pack(1)
 struct BLK_NODE {
@@ -39,7 +45,7 @@
     p->Stamp=~0UL;                          p->NU=NU;
     Stamp++;
 }
-inline UINT U2B(UINT NU) { return 8*NU+4*NU; }
+inline UINT U2B(UINT NU) { return sizeof(DWORD)*2*NU + sizeof(DWORD)*NU; }
 inline void SplitBlock(void* pv,UINT OldIndx,UINT NewIndx)
 {
     UINT i, k, UDiff=Indx2Units[OldIndx]-Indx2Units[NewIndx];
--- PPMd.cpp	2006-03-05 20:54:01.000000000 +0200
+++ PPMd.cpp	2006-03-05 16:19:13.000000000 +0200
@@ -8,6 +8,7 @@
 #include <string>
 #include <stdio.h>
 #include <stdarg.h>
+#include <stdint.h>
 #include <ctype.h>
 #include <stdlib.h>
 #include <string.h>
@@ -24,8 +25,8 @@
 bool silent=false;
 static clock_t StartClock;
 static struct ARC_INFO { // FileLength & CRC? Hmm, maybe in another times...
-    DWORD signature,attrib;
-    WORD  info,FNLen,time,date;
+    uint32_t signature, attrib;
+    uint16_t info, FNLen, time, date;
 } _PACK_ATTR ai;
 
 extern "C" void printsilent(const char *fmt, ...)
--- PPMdType.h	2006-03-05 20:54:01.000000000 +0200
+++ PPMdType.h	2006-03-05 16:19:13.000000000 +0200
@@ -21,6 +21,7 @@
 #if defined(_WIN32_ENVIRONMENT_)
 #include <windows.h>
 #else /* _DOS32_ENVIRONMENT_ || _POSIX_ENVIRONMENT_ || _UNKNOWN_ENVIRONMENT_ */
+#include <stdint.h>
 typedef int   BOOL;
 #define FALSE 0
 #define TRUE  1
@@ -30,7 +31,7 @@
 typedef unsigned int   UINT;
 #endif /* defined(_WIN32_ENVIRONMENT_)  */
 
-const DWORD PPMdSignature=0x84ACAF8F, Variant='I';
+const uint32_t PPMdSignature=0x84ACAF8F, Variant='I';
 const int MAX_O=16;                         /* maximum allowed model order  */
 
 #define _USE_PREFETCHING                    /* for puzzling mainly          */