211 |
209 |
212 nextPutBytes:count from:anObject startingAt:start |
210 nextPutBytes:count from:anObject startingAt:start |
213 "add the hash of anObject to the computed hash so far." |
211 "add the hash of anObject to the computed hash so far." |
214 |
212 |
215 %{ |
213 %{ |
|
214 int len, offs; |
|
215 |
|
216 // fetch first - check later |
|
217 len = __intVal(count); |
|
218 offs = __intVal(start) - 1; |
|
219 |
216 if (__bothSmallInteger(count, start)) { |
220 if (__bothSmallInteger(count, start)) { |
217 int len, offs; |
|
218 int objSize; |
221 int objSize; |
219 unsigned char *extPtr; |
222 unsigned char *extPtr; |
220 |
223 |
221 len = __intVal(count); |
224 // the most common first |
222 offs = __intVal(start) - 1; |
225 if (__isStringLike(anObject)) { |
223 |
226 objSize = __stringSize(anObject); |
224 if (__isExternalBytesLike(anObject)) { |
227 extPtr = (unsigned char *)__stringVal(anObject); |
|
228 } else if (__isByteArray(anObject)) { |
|
229 objSize = __byteArraySize(anObject); |
|
230 extPtr = (unsigned char *)__byteArrayVal(anObject); |
|
231 } else if (__isExternalBytesLike(anObject)) { |
225 OBJ sz = __externalBytesSize(anObject); |
232 OBJ sz = __externalBytesSize(anObject); |
226 |
233 |
227 extPtr = (unsigned char *)__externalBytesAddress(anObject); |
234 extPtr = (unsigned char *)__externalBytesAddress(anObject); |
228 if (__isSmallInteger(sz)) { |
235 if (__isSmallInteger(sz)) { |
229 objSize = __intVal(sz); |
236 objSize = __intVal(sz); |
258 unsigned int _crc; |
265 unsigned int _crc; |
259 unsigned int *_crcTable = __integerArrayVal( __INST(crcTable) ); |
266 unsigned int *_crcTable = __integerArrayVal( __INST(crcTable) ); |
260 unsigned char *cp = extPtr+offs; |
267 unsigned char *cp = extPtr+offs; |
261 unsigned int n = len; |
268 unsigned int n = len; |
262 |
269 |
263 if (__isSmallInteger(__INST(crc))) { |
270 _crc = (unsigned int) (__intVal( __INST(crc) )); |
264 _crc = (unsigned int) (__intVal( __INST(crc) )); |
271 if (!__isSmallInteger(__INST(crc))) { |
265 } else { |
|
266 _crc = __unsignedLongIntVal( __INST(crc) ); |
272 _crc = __unsignedLongIntVal( __INST(crc) ); |
267 } |
273 } |
268 |
274 |
269 #ifdef __LSBFIRST__ |
275 #ifdef __LSBFIRST__ |
270 # if __POINTER_SIZE__ == 8 |
276 # if __POINTER_SIZE__ == 8 |