# HG changeset patch # User Matti Hamalainen # Date 1455293986 -7200 # Node ID 833bb78eb658d6bf8ac169c129407faee5ac8831 # Parent 3399e4f12c085d1c44ea33571935d17f4e57f634 Use th_md5_append_le*() functions instead. diff -r 3399e4f12c08 -r 833bb78eb658 sidlib.c --- 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;