* adfWriteDataBlock * */
| 689 | * |
| 690 | */ |
| 691 | RETCODE adfWriteDataBlock(struct Volume *vol, SECTNUM nSect, void *data) |
| 692 | { |
| 693 | uint8_t buf[512]; |
| 694 | uint32_t newSum; |
| 695 | struct bOFSDataBlock *dataB; |
| 696 | RETCODE rc = RC_OK; |
| 697 | |
| 698 | newSum = 0L; |
| 699 | if (isOFS(vol->dosType)) { |
| 700 | dataB = (struct bOFSDataBlock *)data; |
| 701 | dataB->type = T_DATA; |
| 702 | memcpy(buf,dataB,512); |
| 703 | #ifdef LITT_ENDIAN |
| 704 | swapEndian(buf, SWBL_DATA); |
| 705 | #endif |
| 706 | newSum = adfNormalSum(buf,20,512); |
| 707 | swLong(buf+20,newSum); |
| 708 | /* *(int32_t*)(buf+20) = swapLong((uint8_t*)&newSum);*/ |
| 709 | adfWriteBlock(vol,nSect,buf); |
| 710 | } |
| 711 | else { |
| 712 | adfWriteBlock(vol,nSect,data); |
| 713 | } |
| 714 | /*printf("adfWriteDataBlock %ld\n",nSect);*/ |
| 715 | |
| 716 | return rc; |
| 717 | } |
| 718 | |
| 719 | |
| 720 | /* |
no test coverage detected