Mercurial > hg > xmms-sid
diff src/xs_support.c @ 763:61a527ac3baa
Cleanups, remove useless function.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 05 Nov 2012 22:39:12 +0200 |
parents | 55eea3fa8868 |
children | 469b341734b2 |
line wrap: on
line diff
--- a/src/xs_support.c Mon Nov 05 22:38:41 2012 +0200 +++ b/src/xs_support.c Mon Nov 05 22:39:12 2012 +0200 @@ -32,10 +32,11 @@ guint32 xs_fread_be32(XSFile *f) { - return (((guint32) xs_fgetc(f)) << 24) | + return + (((guint32) xs_fgetc(f)) << 24) | (((guint32) xs_fgetc(f)) << 16) | (((guint32) xs_fgetc(f)) << 8) | - ((guint32) xs_fgetc(f)); + ((guint32) xs_fgetc(f)); } @@ -45,17 +46,21 @@ { XSFile *f; glong seekPos; - - /* Open file, get file size */ + + if (filename == NULL) + return -15; + if ((f = xs_fopen(filename, "rb")) == NULL) return -1; xs_fseek(f, 0, SEEK_END); seekPos = xs_ftell(f); - if (seekPos > 0) { + if (seekPos > 0) + { size_t readSize = seekPos; - if (readSize >= *bufSize || *buf == NULL) { + if (readSize >= *bufSize || *buf == NULL) + { /* Only re-allocate if the required size > current */ if (*buf != NULL) { g_free(*buf); @@ -175,20 +180,6 @@ /* Locate character in string */ -gchar *xs_strrchr(gchar *str, const gchar ch) -{ - gchar *lastPos = NULL; - - while (*str) { - if (*str == ch) - lastPos = str; - str++; - } - - return lastPos; -} - - void xs_findnext(const gchar *str, size_t *pos) { while (str[*pos] && isspace(str[*pos]))