diff options
author | Max Kellermann <max@duempel.org> | 2008-11-01 14:11:19 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-11-01 14:11:19 +0100 |
commit | 35710a81eab5c9dcb5008d127daa55ac3a714071 (patch) | |
tree | dcbdc8b9c94efbb83815b9636951af9b129a80bc /src/tag.c | |
parent | b996108675896e6b4be08f78e32f28bc6d454ad9 (diff) | |
download | mpd-35710a81eab5c9dcb5008d127daa55ac3a714071.tar.gz mpd-35710a81eab5c9dcb5008d127daa55ac3a714071.tar.xz mpd-35710a81eab5c9dcb5008d127daa55ac3a714071.zip |
utils: use GUINT32_FROM_LE() instead of readLEuint32()
Eliminate code already provided by GLib.
Diffstat (limited to 'src/tag.c')
-rw-r--r-- | src/tag.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -125,9 +125,9 @@ struct tag *tag_ape_load(const char *file) struct { unsigned char id[8]; - unsigned char version[4]; - unsigned char length[4]; - unsigned char tagCount[4]; + uint32_t version; + uint32_t length; + uint32_t tagCount; unsigned char flags[4]; unsigned char reserved[8]; } footer; @@ -166,11 +166,11 @@ struct tag *tag_ape_load(const char *file) goto fail; if (memcmp(footer.id, "APETAGEX", sizeof(footer.id)) != 0) goto fail; - if (readLEuint32(footer.version) != 2000) + if (GUINT32_FROM_LE(footer.version) != 2000) goto fail; /* find beginning of ape tag */ - tagLen = readLEuint32(footer.length); + tagLen = GUINT32_FROM_LE(footer.length); if (tagLen < sizeof(footer)) goto fail; if (fseek(fp, size - tagLen, SEEK_SET)) @@ -185,13 +185,13 @@ struct tag *tag_ape_load(const char *file) goto fail; /* read tags */ - tagCount = readLEuint32(footer.tagCount); + tagCount = GUINT32_FROM_LE(footer.tagCount); p = buffer; while (tagCount-- && tagLen > 10) { - size = readLEuint32((unsigned char *)p); + size = GUINT32_FROM_LE(*(const uint32_t *)p); p += 4; tagLen -= 4; - flags = readLEuint32((unsigned char *)p); + flags = GUINT32_FROM_LE(*(const uint32_t *)p); p += 4; tagLen -= 4; |