| 578 | } |
| 579 | |
| 580 | int CScriptFile::WriteInt(asINT64 val, asUINT bytes) |
| 581 | { |
| 582 | if( file == 0 ) |
| 583 | return 0; |
| 584 | |
| 585 | unsigned char buf[8]; |
| 586 | if( mostSignificantByteFirst ) |
| 587 | { |
| 588 | for( unsigned int n = 0; n < bytes; n++ ) |
| 589 | buf[n] = (val >> ((bytes-n-1)*8)) & 0xFF; |
| 590 | } |
| 591 | else |
| 592 | { |
| 593 | for( unsigned int n = 0; n < bytes; n++ ) |
| 594 | buf[n] = (val >> (n*8)) & 0xFF; |
| 595 | } |
| 596 | |
| 597 | size_t r = fwrite(&buf, bytes, 1, file); |
| 598 | return int(r); |
| 599 | } |
| 600 | |
| 601 | int CScriptFile::WriteUInt(asQWORD val, asUINT bytes) |
| 602 | { |
no outgoing calls
no test coverage detected