diff options
author | Max Kellermann <max@duempel.org> | 2008-02-05 10:17:33 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2008-02-05 10:17:33 +0000 |
commit | 6fbdc721d972d8c1f823acd5473a3dce8836d5fa (patch) | |
tree | e72131541f4e887d5dedd6c75ffce455cbf6b97c /src/path.c | |
parent | 22efbd5eca4705426af5cee17a65a3e76c33bec6 (diff) | |
download | mpd-6fbdc721d972d8c1f823acd5473a3dce8836d5fa.tar.gz mpd-6fbdc721d972d8c1f823acd5473a3dce8836d5fa.tar.xz mpd-6fbdc721d972d8c1f823acd5473a3dce8836d5fa.zip |
fix -Wconst warnings
[ew: cleaned up the dirty union hack a bit]
Signed-off-by: Eric Wong <normalperson@yhbt.net>
git-svn-id: https://svn.musicpd.org/mpd/trunk@7180 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r-- | src/path.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/path.c b/src/path.c index 258363036..6aaff84cf 100644 --- a/src/path.c +++ b/src/path.c @@ -38,24 +38,25 @@ static size_t music_dir_len; static size_t playlist_dir_len; static char *fsCharset; -static char *path_conv_charset(char *dest, char *to, char *from, char *str) +static char *path_conv_charset(char *dest, const char *to, + const char *from, const char *str) { return setCharSetConversion(to, from) ? NULL : char_conv_str(dest, str); } -char *fs_charset_to_utf8(char *dst, char *str) +char *fs_charset_to_utf8(char *dst, const char *str) { char *ret = path_conv_charset(dst, "UTF-8", fsCharset, str); return (ret && !validUtf8String(ret)) ? NULL : ret; } -char *utf8_to_fs_charset(char *dst, char *str) +char *utf8_to_fs_charset(char *dst, const char *str) { char *ret = path_conv_charset(dst, fsCharset, "UTF-8", str); return ret ? ret : strcpy(dst, str); } -void setFsCharset(char *charset) +void setFsCharset(const char *charset) { int error = 0; @@ -86,7 +87,7 @@ void setFsCharset(char *charset) } } -char *getFsCharset(void) +const char *getFsCharset(void) { return fsCharset; } @@ -243,7 +244,7 @@ char *parent_path(char *path_max_tmp, const char *path) return path_max_tmp; } -char *sanitizePathDup(char *path) +char *sanitizePathDup(const char *path) { int len = strlen(path) + 1; char *ret = xmalloc(len); @@ -285,7 +286,7 @@ char *sanitizePathDup(char *path) void utf8_to_fs_playlist_path(char *path_max_tmp, const char *utf8path) { - utf8_to_fs_charset(path_max_tmp, (char *)utf8path); + utf8_to_fs_charset(path_max_tmp, utf8path); rpp2app_r(path_max_tmp, path_max_tmp); strncat(path_max_tmp, "." PLAYLIST_FILE_SUFFIX, MPD_PATH_MAX - 1); } |