.
authorclaus
Wed, 15 Feb 1995 11:21:53 +0100
changeset 57 bf0731bbbd01
parent 56 fb0de2a95990
child 58 bd6753bf0401
.
ExtBytes.st
--- a/ExtBytes.st	Sat Feb 11 17:43:21 1995 +0100
+++ b/ExtBytes.st	Wed Feb 15 11:21:53 1995 +0100
@@ -21,7 +21,7 @@
 COPYRIGHT (c) 1993 by Claus Gittinger
               All Rights Reserved
 
-$Header: /cvs/stx/stx/libbasic2/Attic/ExtBytes.st,v 1.8 1994-08-05 00:54:36 claus Exp $
+$Header: /cvs/stx/stx/libbasic2/Attic/ExtBytes.st,v 1.9 1995-02-15 10:21:53 claus Exp $
 '!
 
 !ExternalBytes class methodsFor:'documentation'!
@@ -42,7 +42,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libbasic2/Attic/ExtBytes.st,v 1.8 1994-08-05 00:54:36 claus Exp $
+$Header: /cvs/stx/stx/libbasic2/Attic/ExtBytes.st,v 1.9 1995-02-15 10:21:53 claus Exp $
 "
 !
 
@@ -128,7 +128,7 @@
      * a SepId machine or if data space cannot be executed.
      * all you can do then, is to look for any OS-hooks.
      */
-    if (_isSmallInteger(numberOfBytes)) {
+    if (__isSmallInteger(numberOfBytes)) {
         space = (char *) malloc(_intVal(numberOfBytes) + alignment);
         _addr = (unsigned long) space;
     }
@@ -163,7 +163,7 @@
      * this one is not at all critical - simply return some space
      * to be used for data space of loaded-in binaries.
      */
-    if (_isSmallInteger(numberOfBytes)) {
+    if (__isSmallInteger(numberOfBytes)) {
         space = (char *) malloc(_intVal(numberOfBytes));
         _addr = (unsigned long) space;
     }
@@ -261,13 +261,11 @@
 %{  /* NOCONTEXT */
 
     unsigned char *cp;
-    int idx;
+    OBJ addr = _INST(address);
 
-    if (_isSmallInteger(_INST(address))
-     && _isSmallInteger(index) ) {
-        cp = (unsigned char *)(_intVal(_INST(address)));
-        idx = _intVal(index);
-        cp = cp + _intVal(index) - 1;
+    if (__bothSmallInteger(addr, index)) {
+        cp = (unsigned char *)(__intVal(addr));
+        cp = cp + __intVal(index) - 1;
         RETURN ( _MKSMALLINT(*cp) );
     }
 %}
@@ -282,14 +280,14 @@
 
     unsigned char *cp;
     int val;
+    OBJ addr = _INST(address);
 
-    if (_isSmallInteger(_INST(address))
-     && _isSmallInteger(index)
-     && _isSmallInteger(value)) {
-        val = _intVal(value);
+    if (__isSmallInteger(addr)
+     && __bothSmallInteger(index, value)) {
+        val = __intVal(value);
         if ((val >= 0) && (val <= 255)) {
-            cp = (unsigned char *)(_intVal(_INST(address)));
-            cp = cp + _intVal(index) - 1;
+            cp = (unsigned char *)(__intVal(addr));
+            cp = cp + __intVal(index) - 1;
             *cp = val;
             RETURN ( value );
         }