* adfReadBitmapBlock * * ENDIAN DEPENDENT */
| 441 | * ENDIAN DEPENDENT |
| 442 | */ |
| 443 | RETCODE |
| 444 | adfReadBitmapBlock(struct Volume* vol, SECTNUM nSect, struct bBitmapBlock* bitm) |
| 445 | { |
| 446 | uint8_t buf[LOGICAL_BLOCK_SIZE]; |
| 447 | |
| 448 | /*printf("bitmap %ld\n",nSect);*/ |
| 449 | if (adfReadBlock(vol, nSect, buf)!=RC_OK) |
| 450 | return RC_ERROR; |
| 451 | |
| 452 | memcpy(bitm, buf, LOGICAL_BLOCK_SIZE); |
| 453 | #ifdef LITT_ENDIAN |
| 454 | /* big to little = 68000 to x86 */ |
| 455 | swapEndian((uint8_t*)bitm, SWBL_BITMAP); |
| 456 | #endif |
| 457 | |
| 458 | if (bitm->checkSum!=adfNormalSum(buf,0,LOGICAL_BLOCK_SIZE)) |
| 459 | (*adfEnv.wFct)("adfReadBitmapBlock : invalid checksum"); |
| 460 | |
| 461 | return RC_OK; |
| 462 | } |
| 463 | |
| 464 | |
| 465 | /* |
no test coverage detected