Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
0b29a22c
Commit
0b29a22c
authored
Jan 17, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
conf: replaced getConfigParamValue() with config_get_string()
Don't return a writable pointer.
parent
7acc6236
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
9 deletions
+12
-9
conf.c
src/conf.c
+4
-3
conf.h
src/conf.h
+2
-1
database.c
src/database.c
+3
-2
pcm_resample_libsamplerate.c
src/pcm_resample_libsamplerate.c
+1
-1
tag_id3.c
src/tag_id3.c
+2
-2
No files found.
src/conf.c
View file @
0b29a22c
...
@@ -376,12 +376,13 @@ config_get_next_param(const char *name, struct config_param * last)
...
@@ -376,12 +376,13 @@ config_get_next_param(const char *name, struct config_param * last)
return
param
;
return
param
;
}
}
char
*
getConfigParamValue
(
const
char
*
name
)
const
char
*
config_get_string
(
const
char
*
name
,
const
char
*
default_value
)
{
{
struct
config_param
*
param
=
config_get_param
(
name
);
struct
config_param
*
param
=
config_get_param
(
name
);
if
(
!
param
)
if
(
param
==
NULL
)
return
NULL
;
return
default_value
;
return
param
->
value
;
return
param
->
value
;
}
}
...
...
src/conf.h
View file @
0b29a22c
...
@@ -98,7 +98,8 @@ config_get_param(const char *name)
...
@@ -98,7 +98,8 @@ config_get_param(const char *name)
return
config_get_next_param
(
name
,
NULL
);
return
config_get_next_param
(
name
,
NULL
);
}
}
char
*
getConfigParamValue
(
const
char
*
name
);
const
char
*
config_get_string
(
const
char
*
name
,
const
char
*
default_value
);
struct
block_param
*
struct
block_param
*
getBlockParam
(
struct
config_param
*
param
,
const
char
*
name
);
getBlockParam
(
struct
config_param
*
param
,
const
char
*
name
);
...
...
src/database.c
View file @
0b29a22c
...
@@ -281,7 +281,7 @@ db_load(void)
...
@@ -281,7 +281,7 @@ db_load(void)
foundVersion
=
true
;
foundVersion
=
true
;
}
else
if
(
g_str_has_prefix
(
buffer
,
DIRECTORY_FS_CHARSET
))
{
}
else
if
(
g_str_has_prefix
(
buffer
,
DIRECTORY_FS_CHARSET
))
{
char
*
fsCharset
;
char
*
fsCharset
;
char
*
tempCharset
;
c
onst
c
har
*
tempCharset
;
if
(
foundFsCharset
)
if
(
foundFsCharset
)
g_error
(
"already found fs charset in db"
);
g_error
(
"already found fs charset in db"
);
...
@@ -289,7 +289,8 @@ db_load(void)
...
@@ -289,7 +289,8 @@ db_load(void)
foundFsCharset
=
true
;
foundFsCharset
=
true
;
fsCharset
=
&
(
buffer
[
strlen
(
DIRECTORY_FS_CHARSET
)]);
fsCharset
=
&
(
buffer
[
strlen
(
DIRECTORY_FS_CHARSET
)]);
if
((
tempCharset
=
getConfigParamValue
(
CONF_FS_CHARSET
))
tempCharset
=
config_get_string
(
CONF_FS_CHARSET
,
NULL
);
if
(
tempCharset
!=
NULL
&&
strcmp
(
fsCharset
,
tempCharset
))
{
&&
strcmp
(
fsCharset
,
tempCharset
))
{
g_message
(
"Using
\"
%s
\"
for the "
g_message
(
"Using
\"
%s
\"
for the "
"filesystem charset "
"filesystem charset "
...
...
src/pcm_resample_libsamplerate.c
View file @
0b29a22c
...
@@ -42,7 +42,7 @@ void pcm_resample_deinit(struct pcm_resample_state *state)
...
@@ -42,7 +42,7 @@ void pcm_resample_deinit(struct pcm_resample_state *state)
static
int
pcm_resample_get_converter
(
void
)
static
int
pcm_resample_get_converter
(
void
)
{
{
const
char
*
conf
=
getConfigParamValue
(
CONF_SAMPLERATE_CONVERTER
);
const
char
*
conf
=
config_get_string
(
CONF_SAMPLERATE_CONVERTER
,
NULL
);
long
convalgo
;
long
convalgo
;
char
*
test
;
char
*
test
;
const
char
*
test2
;
const
char
*
test2
;
...
...
src/tag_id3.c
View file @
0b29a22c
...
@@ -55,13 +55,13 @@ static id3_utf8_t * processID3FieldString (int is_id3v1, const id3_ucs4_t *ucs4,
...
@@ -55,13 +55,13 @@ static id3_utf8_t * processID3FieldString (int is_id3v1, const id3_ucs4_t *ucs4,
{
{
id3_utf8_t
*
utf8
,
*
utf8_stripped
;
id3_utf8_t
*
utf8
,
*
utf8_stripped
;
id3_latin1_t
*
isostr
;
id3_latin1_t
*
isostr
;
char
*
encoding
;
c
onst
c
har
*
encoding
;
if
(
type
==
TAG_ITEM_GENRE
)
if
(
type
==
TAG_ITEM_GENRE
)
ucs4
=
id3_genre_name
(
ucs4
);
ucs4
=
id3_genre_name
(
ucs4
);
/* use encoding field here? */
/* use encoding field here? */
if
(
is_id3v1
&&
if
(
is_id3v1
&&
(
encoding
=
getConfigParamValue
(
CONF_ID3V1_ENCODING
))
)
{
(
encoding
=
config_get_string
(
CONF_ID3V1_ENCODING
,
NULL
))
!=
NULL
)
{
isostr
=
id3_ucs4_latin1duplicate
(
ucs4
);
isostr
=
id3_ucs4_latin1duplicate
(
ucs4
);
if
(
G_UNLIKELY
(
!
isostr
))
{
if
(
G_UNLIKELY
(
!
isostr
))
{
return
NULL
;
return
NULL
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment