aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-03-02 15:41:44 +0100
committerMax Kellermann <max@duempel.org>2009-03-02 15:41:44 +0100
commiteb5b3ce553cc7de68235c65863651a52283c2fe1 (patch)
treeb3256a89bd29aa71b0bc60cc3109923ec1164521
parentb7bfa24f22a3a5a7709ce425ffc84bd4bb64be08 (diff)
downloadmpd-eb5b3ce553cc7de68235c65863651a52283c2fe1.tar.gz
mpd-eb5b3ce553cc7de68235c65863651a52283c2fe1.tar.xz
mpd-eb5b3ce553cc7de68235c65863651a52283c2fe1.zip
database: no CamelCase
Renamed a bunch of variables.
-rw-r--r--src/database.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/src/database.c b/src/database.c
index b1c47d4d4..d19ce834b 100644
--- a/src/database.c
+++ b/src/database.c
@@ -47,7 +47,7 @@ static char *database_path;
static struct directory *music_root;
-static time_t directory_dbModTime;
+static time_t database_mtime;
void
db_init(const char *path)
@@ -261,7 +261,7 @@ db_save(void)
while (fclose(fp) && errno == EINTR);
if (stat(database_path, &st) == 0)
- directory_dbModTime = st.st_mtime;
+ database_mtime = st.st_mtime;
return true;
}
@@ -272,7 +272,7 @@ db_load(void)
FILE *fp = NULL;
struct stat st;
char buffer[100];
- bool foundFsCharset = false, foundVersion = false;
+ bool found_charset = false, found_version = false;
assert(database_path != NULL);
assert(music_root != NULL);
@@ -304,26 +304,25 @@ db_load(void)
g_strchomp(buffer);
if (g_str_has_prefix(buffer, DIRECTORY_MPD_VERSION)) {
- if (foundVersion)
+ if (found_version)
g_error("already found version in db");
- foundVersion = true;
+ found_version = true;
} else if (g_str_has_prefix(buffer, DIRECTORY_FS_CHARSET)) {
- char *fsCharset;
- const char *tempCharset;
+ const char *new_charset, *old_charset;
- if (foundFsCharset)
+ if (found_charset)
g_error("already found fs charset in db");
- foundFsCharset = true;
+ found_charset = true;
- fsCharset = &(buffer[strlen(DIRECTORY_FS_CHARSET)]);
- tempCharset = path_get_fs_charset();
- if (tempCharset != NULL
- && strcmp(fsCharset, tempCharset)) {
+ new_charset = &(buffer[strlen(DIRECTORY_FS_CHARSET)]);
+ old_charset = path_get_fs_charset();
+ if (old_charset != NULL
+ && strcmp(new_charset, old_charset)) {
g_message("Existing database has charset \"%s\" "
"instead of \"%s\"; "
"discarding database file",
- fsCharset, tempCharset);
+ new_charset, old_charset);
return false;
}
} else
@@ -339,7 +338,7 @@ db_load(void)
stats_update();
if (stat(database_path, &st) == 0)
- directory_dbModTime = st.st_mtime;
+ database_mtime = st.st_mtime;
return true;
}
@@ -347,5 +346,5 @@ db_load(void)
time_t
db_get_mtime(void)
{
- return directory_dbModTime;
+ return database_mtime;
}