Mercurial > hg > sidinfo
changeset 95:833bb78eb658
Use th_md5_append_le*() functions instead.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Fri, 12 Feb 2016 18:19:46 +0200 |
parents | 3399e4f12c08 |
children | b6bf182bd37f |
files | sidlib.c |
diffstat | 1 files changed, 3 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/sidlib.c Fri Feb 12 18:11:09 2016 +0200 +++ b/sidlib.c Fri Feb 12 18:19:46 2016 +0200 @@ -8,15 +8,6 @@ #include "th_string.h" -static void si_append_hash16(th_md5state_t *state, uint16_t data) -{ - uint8_t ib8[2]; - ib8[0] = data & 0xff; - ib8[1] = data >> 8; - th_md5_append(state, (uint8_t *) &ib8, sizeof(ib8)); -} - - int si_read_sid_file(th_ioctx *ctx, PSIDHeader *psid) { th_md5state_t state; @@ -131,9 +122,9 @@ } while (read > 0 && !thfeof(ctx)); // Append header data to hash - si_append_hash16(&state, psid->initAddress); - si_append_hash16(&state, psid->playAddress); - si_append_hash16(&state, psid->nSongs); + th_md5_append_le16(&state, psid->initAddress); + th_md5_append_le16(&state, psid->playAddress); + th_md5_append_le16(&state, psid->nSongs); // Append song speed data to hash tmp8 = psid->isRSID ? 60 : 0;