* adfWriteBitmapBlock * * OK */
| 468 | * OK |
| 469 | */ |
| 470 | RETCODE |
| 471 | adfWriteBitmapBlock(struct Volume* vol, SECTNUM nSect, struct bBitmapBlock* bitm) |
| 472 | { |
| 473 | uint8_t buf[LOGICAL_BLOCK_SIZE]; |
| 474 | uint32_t newSum; |
| 475 | |
| 476 | memcpy(buf,bitm,LOGICAL_BLOCK_SIZE); |
| 477 | #ifdef LITT_ENDIAN |
| 478 | /* little to big */ |
| 479 | swapEndian(buf, SWBL_BITMAP); |
| 480 | #endif |
| 481 | |
| 482 | newSum = adfNormalSum(buf, 0, LOGICAL_BLOCK_SIZE); |
| 483 | swLong(buf,newSum); |
| 484 | |
| 485 | /* dumpBlock((uint8_t*)buf);*/ |
| 486 | if (adfWriteBlock(vol, nSect, (uint8_t*)buf)!=RC_OK) |
| 487 | return RC_ERROR; |
| 488 | |
| 489 | return RC_OK; |
| 490 | } |
| 491 | |
| 492 | |
| 493 | /* |
no test coverage detected