SHA1Stream.st
changeset 16004 3d3da3b792a1
parent 15998 4307e39fc342
child 16009 94ef574411dc
equal deleted inserted replaced
16003:251463ee7d9c 16004:3d3da3b792a1
   547             }
   547             }
   548         } else {
   548         } else {
   549             OBJ oClass = __Class(anObject);
   549             OBJ oClass = __Class(anObject);
   550             int nInstVars = __intVal(__ClassInstPtr(oClass)->c_ninstvars);
   550             int nInstVars = __intVal(__ClassInstPtr(oClass)->c_ninstvars);
   551 
   551 
   552             nInstBytes = __OBJS2BYTES__(nInstVars);
   552             nInstBytes = OHDR_SIZE + __OBJS2BYTES__(nInstVars);
   553             switch (__intVal(__ClassInstPtr(oClass)->c_flags) & ARRAYMASK) {
   553             switch (__intVal(__ClassInstPtr(oClass)->c_flags) & ARRAYMASK) {
   554                 case BYTEARRAY:
   554                 case BYTEARRAY:
   555                 case WORDARRAY:
   555                 case WORDARRAY:
   556                 case LONGARRAY:
   556                 case LONGARRAY:
   557                 case SWORDARRAY:
   557                 case SWORDARRAY:
   572                 default:
   572                 default:
   573                     goto bad;
   573                     goto bad;
   574             }
   574             }
   575             // nInstBytes is the number of bytes occupied by pointer instance variables
   575             // nInstBytes is the number of bytes occupied by pointer instance variables
   576             // subtract from size and add to byte-pointer
   576             // subtract from size and add to byte-pointer
   577             objSize = __Size(anObject) - OHDR_SIZE - nInstBytes;
   577             objSize = __Size(anObject) - nInstBytes;
   578             extPtr = (char *)__byteArrayVal(anObject)+nInstBytes;
   578             extPtr = (char *)__byteArrayVal(anObject)+nInstBytes;
   579         }
   579         }
   580         if ((offs >= 0) && (len >= 0) && (objSize >= (len + offs))) {
   580         if ((offs >= 0) && (len >= 0) && (objSize >= (len + offs))) {
   581             SHA1Update(ctx, extPtr+offs, (unsigned int)len);
   581             SHA1Update(ctx, extPtr+offs, (unsigned int)len);
   582             RETURN (count);
   582             RETURN (count);
   589 ! !
   589 ! !
   590 
   590 
   591 !SHA1Stream class methodsFor:'documentation'!
   591 !SHA1Stream class methodsFor:'documentation'!
   592 
   592 
   593 version
   593 version
   594     ^ '$Header: /cvs/stx/stx/libbasic/SHA1Stream.st,v 1.43 2014-02-12 14:31:21 stefan Exp $'
   594     ^ '$Header: /cvs/stx/stx/libbasic/SHA1Stream.st,v 1.44 2014-02-12 14:38:02 stefan Exp $'
   595 !
   595 !
   596 
   596 
   597 version_CVS
   597 version_CVS
   598     ^ '$Header: /cvs/stx/stx/libbasic/SHA1Stream.st,v 1.43 2014-02-12 14:31:21 stefan Exp $'
   598     ^ '$Header: /cvs/stx/stx/libbasic/SHA1Stream.st,v 1.44 2014-02-12 14:38:02 stefan Exp $'
   599 ! !
   599 ! !
   600 
   600 
   601 
   601 
   602 SHA1Stream initialize!
   602 SHA1Stream initialize!