ExternalLong.st
changeset 3773 511f3e8b9b34
parent 3753 23d5633e7499
child 4303 dc9dd4174b6e
child 4769 89914ccfcf7d
--- a/ExternalLong.st	Wed Mar 23 14:33:58 2016 +0100
+++ b/ExternalLong.st	Wed Mar 23 14:35:45 2016 +0100
@@ -41,9 +41,11 @@
 documentation
 "
     mostly added for odbc, which uses instances of me as container in which values
-    (pointers) are returned. The name is misleading: it should be ExternalPointer,
+    (pointers) are returned. 
+    The name is very misleading: it should be ExternalPointer,
     because on machines where sizeof(long) !!= sizeof(void *), that makes a difference.
-    However, over time, others started to use this class, and renaming it would break some code.
+    However, over time, others started to use this class, 
+    and renaming it would break some code.
 "
 ! !
 
@@ -116,13 +118,13 @@
 !
 
 asInteger
-    "warning: retrieves an integer with the size of the native machine's
+    "warning: retrieves a signed integer with the size of the native machine's
      pointer (i.e. either 32 or 64bit)"
 
     ExternalAddress pointerSize == 8 ifTrue:[
-        ^ self longLongAt:1 bigEndian:IsBigEndian
+        ^ self signedInt64At:1 MSB:IsBigEndian
     ] ifFalse:[
-        ^ self signedDoubleWordAt:1 MSB:IsBigEndian
+        ^ self signedInt32At:1 MSB:IsBigEndian
     ]
 
     "
@@ -157,15 +159,13 @@
 !
 
 asUnsignedInteger
-    "warning: only returns a 32bit integer"
-
     "warning: retrieves an integer with the size of the native machine's
      pointer (i.e. either 32 or 64bit)"
 
     ExternalAddress pointerSize == 8 ifTrue:[
-        ^ self unsignedLongLongAt:1 bigEndian:IsBigEndian
+        ^ self unsignedInt64At:1 MSB:IsBigEndian
     ] ifFalse:[
-        ^ self doubleWordAt:1 MSB:IsBigEndian
+        ^ self unsignedInt32At:1 MSB:IsBigEndian
     ]
 
     "