Dash:
[t2-trunk.git] / package / develop / squeak / 64bit-vm.diff
blob8f686a92ca427d9f8bbbccdb2b7439c9577a7fbf
1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
3 #
4 # T2 SDE: package/.../squeak/64bit-vm.diff
5 # Copyright (C) 2007 The T2 SDE Project
6 #
7 # More information can be found in the files COPYING and README.
8 #
9 # This patch file is dual-licensed. It is available under the license the
10 # patched project is licensed under, as long as it is an OpenSource license
11 # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
12 # of the GNU General Public License as published by the Free Software
13 # Foundation; either version 2 of the License, or (at your option) any later
14 # version.
15 # --- T2-COPYRIGHT-NOTE-END ---
17 --- ../../Cross/vm/sqMemoryAccess.h_orig 2007-05-27 10:45:08.000000000 +0200
18 +++ ../../Cross/vm/sqMemoryAccess.h 2007-05-27 10:46:10.000000000 +0200
19 @@ -82,7 +82,7 @@
20 static inline sqInt longAtPointerput(char *ptr, sqInt val) { return (sqInt)(*((sqInt *)ptr)= (sqInt)val); }
21 static inline sqInt oopAtPointer(char *ptr) { return (sqInt)(*((sqInt *)ptr)); }
22 static inline sqInt oopAtPointerput(char *ptr, sqInt val) { return (sqInt)(*((sqInt *)ptr)= (sqInt)val); }
23 - static inline char *pointerForOop(sqInt oop) { return sqMemoryBase + oop; }
24 + static inline char *pointerForOop(usqInt oop) { return sqMemoryBase + oop; }
25 static inline sqInt oopForPointer(char *ptr) { return (sqInt)(ptr - sqMemoryBase); }
26 static inline sqInt byteAt(sqInt oop) { return byteAtPointer(pointerForOop(oop)); }
27 static inline sqInt byteAtput(sqInt oop, int val) { return byteAtPointerput(pointerForOop(oop), val); }
28 @@ -106,8 +106,8 @@
29 # define longAtPointerput(ptr, val) ((sqInt)(*((sqInt *)(ptr))= (sqInt)(val)))
30 # define oopAtPointer(ptr) (sqInt)(*((sqInt *)ptr))
31 # define oopAtPointerput(ptr, val) (sqInt)(*((sqInt *)ptr)= (sqInt)val)
32 -# define pointerForOop(oop) ((char *)(sqMemoryBase + (oop)))
33 -# define oopForPointer(ptr) ((sqInt)(ptr))
34 +# define pointerForOop(oop) ((char *)(sqMemoryBase + ((usqInt)(oop))))
35 +# define oopForPointer(ptr) ((sqInt)(((char *)(ptr)) - (sqMemoryBase)))
36 # define byteAt(oop) byteAtPointer(pointerForOop(oop))
37 # define byteAtput(oop, val) byteAtPointerput(pointerForOop(oop), (val))
38 # define shortAt(oop) shortAtPointer(pointerForOop(oop))
39 --- ../../unix/src/vm/intplugins/SocketPlugin/SocketPlugin.c_orig 2007-05-29 13:35:16.000000000 +0200
40 +++ ../../unix/src/vm/intplugins/SocketPlugin/SocketPlugin.c 2007-05-29 13:36:45.000000000 +0200
41 @@ -178,7 +178,7 @@
42 static sqInt netAddressToInt(unsigned char * ptrToByteArray) {
43 sqInt sz;
45 - sz = interpreterProxy->byteSizeOf(((sqInt)(long)(ptrToByteArray) - 4));
46 + sz = interpreterProxy->byteSizeOf(((usqInt)(long)((char *)ptrToByteArray - sqMemoryBase ) - 4));
47 if (!(sz == 4)) {
48 return interpreterProxy->primitiveFail();
50 @@ -315,7 +315,7 @@
51 return null;
53 if (!(interpreterProxy->failed())) {
54 - sz = interpreterProxy->byteSizeOf(((sqInt)(long)(name) - 4));
55 + sz = interpreterProxy->byteSizeOf(((usqInt)(long)((char *)name - sqMemoryBase ) - 4));
56 sqResolverStartNameLookup(name, sz);
58 if (interpreterProxy->failed()) {