| 18 | } |
| 19 | |
| 20 | void FileWrite( std::FILE* const file, const void* buffer, const unsigned int size ) |
| 21 | { |
| 22 | unsigned int write_total= 0u; |
| 23 | |
| 24 | do |
| 25 | { |
| 26 | const int write= std::fwrite( static_cast<const char*>(buffer) + write_total, 1, size - write_total, file ); |
| 27 | if( write <= 0 ) |
| 28 | break; |
| 29 | |
| 30 | write_total+= write; |
| 31 | } while( write_total < size ); |
| 32 | } |
| 33 | |
| 34 | |
| 35 | } // namespace ChasmReverse |