Mercurial > hg > xmms-sid
diff src/xs_length.c @ 57:85811bcd049e
Improved, re-written configuration code and lots of minor fixes
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sun, 22 Jun 2003 11:01:03 +0000 |
parents | 6a3ce7260ae1 |
children | 0d1df20745dd |
line wrap: on
line diff
--- a/src/xs_length.c Sun Jun 22 00:17:04 2003 +0000 +++ b/src/xs_length.c Sun Jun 22 11:01:03 2003 +0000 @@ -199,11 +199,12 @@ /* * Read database to memory */ -gint xs_db_read(gchar *dbFilename, t_xs_dbentry **dataBase) +gint xs_db_read(gchar *dbFilename) { FILE *inFile; gchar inLine[XS_BUFSIZE]; - gint lineNum, linePos, iOK; + guint lineNum, linePos; + gboolean iOK; t_xs_dbentry *tmpNode; /* Try to open the file */ @@ -264,9 +265,9 @@ } else { /* First playtime is after '=' */ linePos++; - iOK = 1; + iOK = TRUE; - while ((linePos < strlen(inLine)) && (iOK)) + while ((linePos < strlen(inLine)) && iOK) { xs_findnext(inLine, &linePos); @@ -276,7 +277,7 @@ xs_gettime(inLine, &linePos); tmpNode->nLengths++; } else - iOK = 0; + iOK = FALSE; } /* Add an entry to db in memory */ @@ -325,7 +326,7 @@ if (xs_cfg.songlenDBPath == NULL) return -10; - if (xs_db_read(xs_cfg.songlenDBPath, &xs_database) < 0) + if (xs_db_read(xs_cfg.songlenDBPath) < 0) return -9; /* Get size of db */ @@ -562,11 +563,8 @@ { dbEntry = xs_db_get(dbHash); - if (dbEntry) - { - if ((subTune >= 0) && (subTune < dbEntry->nLengths)) - iResult = dbEntry->sLengths[subTune - 1]; - } + if (dbEntry && (subTune >= 0) && (subTune < dbEntry->nLengths)) + iResult = dbEntry->sLengths[subTune - 1]; } } #if 0