- Timestamp:
- 07/14/2017 01:45:36 PM (7 years ago)
- Branches:
- master
- Children:
- 7d4cf30
- Parents:
- 33b5477
- Location:
- ram
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
ram/libdsp.c
r33b5477 r298f0b4 235 235 */ 236 236 237 int32_t chksum(int8_t *area, int32_t len) 238 { 239 register int32_t cs, i; 240 237 int32_t chksum(void *area, int32_t len) 238 { 239 uint8_t *area8; 240 int32_t cs, i; 241 242 area8 = area; 241 243 cs = 0L; 242 244 243 245 for (i = 0; i < len; i++) 244 cs += 0x000000FFL & *area ++;246 cs += 0x000000FFL & *area8++; 245 247 246 248 return(cs); … … 306 308 */ 307 309 308 int16_t wr_ec(FILE *fp, int8_t *from, int32_t len) 309 { 310 register int32_t count; 311 register int8_t c; 310 int16_t wr_ec(FILE *fp, void *from, int32_t len) 311 { 312 uint8_t *from8, c; 313 int32_t count; 314 315 from8 = from; 316 312 317 for (count = 0; count < len; count++) { 313 318 314 319 errno = 0; 315 c = *from ++;320 c = *from8++; 316 321 317 322 if (EOF EQ putc(c, fp)) { … … 346 351 */ 347 352 348 int16_t rd_ec(FILE *fp, int8_t *to, int32_t len) 349 { 350 register int32_t count; 351 register int16_t c; 353 int16_t rd_ec(FILE *fp, void *to, int32_t len) 354 { 355 uint8_t *to8; 356 int32_t count; 357 int16_t c; 358 359 to8 = to; 352 360 353 361 for (count = 0; count < len; count++) { … … 368 376 } else { 369 377 370 *to ++ =c;378 *to8++ = (uint8_t)c; 371 379 372 380 #if DEBUGRE -
ram/libdsp.x
r33b5477 r298f0b4 29 29 extern void advlcur(void); 30 30 extern void bsplcur(void); 31 extern int32_t chksum( int8_t*area, int32_t len);31 extern int32_t chksum(void *area, int32_t len); 32 32 extern int16_t ckdups(void); 33 33 extern int16_t ckstor(void); … … 57 57 extern int16_t ocslot(int16_t slot); 58 58 extern int16_t putcat(void); 59 extern int16_t rd_ec(FILE *fp, int8_t*to, int32_t len);59 extern int16_t rd_ec(FILE *fp, void *to, int32_t len); 60 60 extern int16_t showcat(void); 61 61 extern int16_t showsiz(void); … … 65 65 extern int16_t storit(void); 66 66 extern void streset(void); 67 extern int16_t wr_ec(FILE *fp, int8_t*from, int32_t len);67 extern int16_t wr_ec(FILE *fp, void *from, int32_t len); 68 68 extern int16_t writem(void); 69 69 extern int16_t wrtfile(int16_t kind);
Note:
See TracChangeset
for help on using the changeset viewer.