Mercurial > hg > xmms-sid
changeset 763:61a527ac3baa
Cleanups, remove useless function.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 05 Nov 2012 22:39:12 +0200 |
parents | 03c5cde1dfbb |
children | 5eee092d1b13 |
files | src/xmms-sid.c src/xs_slsup.c src/xs_support.c src/xs_support.h src/xs_title.c |
diffstat | 5 files changed, 18 insertions(+), 28 deletions(-) [+] |
line wrap: on
line diff
--- a/src/xmms-sid.c Mon Nov 05 22:38:41 2012 +0200 +++ b/src/xmms-sid.c Mon Nov 05 22:39:12 2012 +0200 @@ -200,7 +200,7 @@ } /* Detect just by checking filename extension */ - ext = xs_strrchr(filename, '.'); + ext = strrchr(filename, '.'); if (ext) { ext++; switch (xs_cfg.playerEngine) {
--- a/src/xs_slsup.c Mon Nov 05 22:38:41 2012 +0200 +++ b/src/xs_slsup.c Mon Nov 05 22:39:12 2012 +0200 @@ -100,8 +100,8 @@ if (xs_cfg.stilDBEnable && xs_stildb_db) { if (xs_cfg.hvscPath) { /* Remove postfixed directory separator from HVSC-path */ - tmpFilename = xs_strrchr(xs_cfg.hvscPath, '/'); - if (tmpFilename && (tmpFilename[1] == 0)) + tmpFilename = strrchr(xs_cfg.hvscPath, '/'); + if (tmpFilename && tmpFilename[1] == 0) tmpFilename[0] = 0; /* Remove HVSC location-prefix from filename */
--- 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]))
--- a/src/xs_support.h Mon Nov 05 22:38:41 2012 +0200 +++ b/src/xs_support.h Mon Nov 05 22:39:12 2012 +0200 @@ -96,7 +96,6 @@ gint xs_pstrcpy(gchar **, const gchar *); gint xs_pstrcat(gchar **, const gchar *); void xs_pnstrcat(gchar *, size_t, const gchar *); -gchar *xs_strrchr(gchar *, const gchar); void xs_findnext(const gchar *, size_t *); void xs_findeol(const gchar *, size_t *); void xs_findnum(const gchar *, size_t *);
--- a/src/xs_title.c Mon Nov 05 22:38:41 2012 +0200 +++ b/src/xs_title.c Mon Nov 05 22:39:12 2012 +0200 @@ -31,21 +31,21 @@ /* Split the filename into path */ *tmpFilePath = g_strdup(path); - tmpStr = xs_strrchr(*tmpFilePath, '/'); + tmpStr = strrchr(*tmpFilePath, '/'); if (tmpStr) tmpStr[1] = 0; /* Filename */ - *tmpFilename = xs_strrchr(path, '/'); + *tmpFilename = strrchr(path, '/'); if (*tmpFilename) *tmpFilename = g_strdup(*tmpFilename + 1); else *tmpFilename = g_strdup(path); - tmpStr = xs_strrchr(*tmpFilename, '.'); + tmpStr = strrchr(*tmpFilename, '.'); tmpStr[0] = 0; /* Extension */ - *tmpFileExt = xs_strrchr(path, '.'); + *tmpFileExt = strrchr(path, '.'); }