584 |
584 |
585 sizeofDouble |
585 sizeofDouble |
586 "return the number of bytes used by the machines native doubles" |
586 "return the number of bytes used by the machines native doubles" |
587 |
587 |
588 %{ /* NOCONTEXT */ |
588 %{ /* NOCONTEXT */ |
589 RETURN (__MKSMALLINT( sizeof(double))); |
589 RETURN (__mkSmallInteger( sizeof(double))); |
590 %} |
590 %} |
591 " |
591 " |
592 ExternalBytes sizeofDouble |
592 ExternalBytes sizeofDouble |
593 " |
593 " |
594 ! |
594 ! |
595 |
595 |
596 sizeofFloat |
596 sizeofFloat |
597 "return the number of bytes used by the machines native floats" |
597 "return the number of bytes used by the machines native floats" |
598 |
598 |
599 %{ /* NOCONTEXT */ |
599 %{ /* NOCONTEXT */ |
600 RETURN (__MKSMALLINT( sizeof(float))); |
600 RETURN (__mkSmallInteger( sizeof(float))); |
601 %} |
601 %} |
602 " |
602 " |
603 ExternalBytes sizeofFloat |
603 ExternalBytes sizeofFloat |
604 " |
604 " |
605 ! |
605 ! |
606 |
606 |
607 sizeofInt |
607 sizeofInt |
608 "return the number of bytes used by the machines native integer" |
608 "return the number of bytes used by the machines native integer" |
609 |
609 |
610 %{ /* NOCONTEXT */ |
610 %{ /* NOCONTEXT */ |
611 RETURN (__MKSMALLINT( sizeof(int))); |
611 RETURN (__mkSmallInteger( sizeof(int))); |
612 %} |
612 %} |
613 " |
613 " |
614 ExternalBytes sizeofInt |
614 ExternalBytes sizeofInt |
615 " |
615 " |
616 ! |
616 ! |
617 |
617 |
618 sizeofLong |
618 sizeofLong |
619 "return the number of bytes used by the machines native longs" |
619 "return the number of bytes used by the machines native longs" |
620 |
620 |
621 %{ /* NOCONTEXT */ |
621 %{ /* NOCONTEXT */ |
622 RETURN (__MKSMALLINT( sizeof(long))); |
622 RETURN (__mkSmallInteger( sizeof(long))); |
623 %} |
623 %} |
624 " |
624 " |
625 ExternalBytes sizeofLong |
625 ExternalBytes sizeofLong |
626 " |
626 " |
627 ! |
627 ! |
628 |
628 |
629 sizeofPointer |
629 sizeofPointer |
630 "return the number of bytes used by the machines native pointer" |
630 "return the number of bytes used by the machines native pointer" |
631 |
631 |
632 %{ /* NOCONTEXT */ |
632 %{ /* NOCONTEXT */ |
633 RETURN (__MKSMALLINT( sizeof(char *))); |
633 RETURN (__mkSmallInteger( sizeof(char *))); |
634 %} |
634 %} |
635 " |
635 " |
636 ExternalBytes sizeofPointer |
636 ExternalBytes sizeofPointer |
637 " |
637 " |
638 ! |
638 ! |
639 |
639 |
640 sizeofShort |
640 sizeofShort |
641 "return the number of bytes used by the machines native short" |
641 "return the number of bytes used by the machines native short" |
642 |
642 |
643 %{ /* NOCONTEXT */ |
643 %{ /* NOCONTEXT */ |
644 RETURN (__MKSMALLINT( sizeof(short))); |
644 RETURN (__mkSmallInteger( sizeof(short))); |
645 %} |
645 %} |
646 " |
646 " |
647 ExternalBytes sizeofShort |
647 ExternalBytes sizeofShort |
648 " |
648 " |
649 ! ! |
649 ! ! |
653 address |
653 address |
654 "return the start address as an integer" |
654 "return the start address as an integer" |
655 |
655 |
656 %{ /* NOCONTEXT */ |
656 %{ /* NOCONTEXT */ |
657 |
657 |
658 int addr; |
658 INT addr; |
659 |
659 |
660 if (__INST(address_) != nil) { |
660 if (__INST(address_) != nil) { |
661 addr = (INT)__INST(address_); |
661 addr = (INT)__INST(address_); |
662 if (addr <= _MAX_INT) { |
662 if (addr <= _MAX_INT) { |
663 RETURN ( __MKSMALLINT(addr) ); |
663 RETURN ( __mkSmallInteger(addr) ); |
664 } |
664 } |
665 RETURN ( __MKUINT(addr)); |
665 RETURN ( __MKUINT(addr)); |
666 } |
666 } |
667 %}. |
667 %}. |
668 ^ nil |
668 ^ nil |
683 idx = __intVal(index); |
683 idx = __intVal(index); |
684 if (idx > 0) { |
684 if (idx > 0) { |
685 if (((sz = __INST(size)) == nil) |
685 if (((sz = __INST(size)) == nil) |
686 || (__intVal(sz) >= idx)) { |
686 || (__intVal(sz) >= idx)) { |
687 cp = cp + idx - 1; |
687 cp = cp + idx - 1; |
688 RETURN ( __MKSMALLINT(*cp) ); |
688 RETURN ( __mkSmallInteger((*cp)) ); |
689 } |
689 } |
690 } |
690 } |
691 } |
691 } |
692 %}. |
692 %}. |
693 (size notNil and:[self address notNil]) ifTrue:[ |
693 (size notNil and:[self address notNil]) ifTrue:[ |