Several fixes uncovered with -pedantic

playerData.c:
proper error checking

directory.c:
properly check myFgets() for errors
(it returns NULL on error)

inputPlugins/mp3_plugin.c
get rid of commas at the end of enums

interface.c:
we weren't using long long, so strtoll isn't needed
get rid of void-pointer arithmetic

sllist.c:
get rid of void-pointer arithmetic

compress.c:
get rid of C++ comments, some compilers don't accept them

Note that I personally like void pointer arithmetic, but some
ancient compilers don't support them :(

git-svn-id: https://svn.musicpd.org/mpd/trunk@4510 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
Eric Wong
2006-08-01 04:18:41 +00:00
parent 9ccf40b242
commit 5aca21a502
6 changed files with 20 additions and 20 deletions

View File

@@ -940,14 +940,14 @@ static void readDirectoryInfo(FILE * fp, Directory * directory)
&& 0 != strncmp(DIRECTORY_END, buffer, strlen(DIRECTORY_END))) {
if (0 == strncmp(DIRECTORY_DIR, buffer, strlen(DIRECTORY_DIR))) {
key = strdup(&(buffer[strlen(DIRECTORY_DIR)]));
if (myFgets(buffer, bufferSize, fp) < 0) {
if (!myFgets(buffer, bufferSize, fp)) {
ERROR("Error reading db, fgets\n");
exit(EXIT_FAILURE);
}
/* for compatibility with db's prior to 0.11 */
if (0 == strncmp(DIRECTORY_MTIME, buffer,
strlen(DIRECTORY_MTIME))) {
if (myFgets(buffer, bufferSize, fp) < 0) {
if (!myFgets(buffer, bufferSize, fp)) {
ERROR("Error reading db, fgets\n");
exit(EXIT_FAILURE);
}
@@ -1140,7 +1140,7 @@ int readDirectoryDB()
int foundFsCharset = 0;
int foundVersion = 0;
if (myFgets(buffer, bufferSize, fp) < 0) {
if (!myFgets(buffer, bufferSize, fp)) {
ERROR("Error reading db, fgets\n");
exit(EXIT_FAILURE);
}