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
53f40448
Commit
53f40448
authored
Dec 26, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
util/{ASCII,UriUtil}, ...: work around -Wtautological-pointer-compare
New in clang 3.6.
parent
a5049136
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
52 additions
and
0 deletions
+52
-0
NEWS
NEWS
+1
-0
DatabaseGlue.cxx
src/DatabaseGlue.cxx
+3
-0
DecoderPlugin.cxx
src/DecoderPlugin.cxx
+6
-0
Directory.cxx
src/Directory.cxx
+3
-0
InputStream.cxx
src/InputStream.cxx
+6
-0
SongFilter.cxx
src/SongFilter.cxx
+3
-0
Charset.cxx
src/fs/Charset.cxx
+6
-0
Traits.cxx
src/fs/Traits.cxx
+6
-0
TagBuilder.cxx
src/tag/TagBuilder.cxx
+9
-0
ASCII.hxx
src/util/ASCII.hxx
+6
-0
UriUtil.cxx
src/util/UriUtil.cxx
+3
-0
No files found.
NEWS
View file @
53f40448
ver 0.18.22 (not yet released)
ver 0.18.22 (not yet released)
* fix clang 3.6 warnings
ver 0.18.21 (2014/12/17)
ver 0.18.21 (2014/12/17)
* playlist
* playlist
...
...
src/DatabaseGlue.cxx
View file @
53f40448
...
@@ -112,7 +112,10 @@ db_get_root(void)
...
@@ -112,7 +112,10 @@ db_get_root(void)
Directory
*
Directory
*
db_get_directory
(
const
char
*
name
)
db_get_directory
(
const
char
*
name
)
{
{
#if !CLANG_CHECK_VERSION(3,6)
/* disabled on clang due to -Wtautological-pointer-compare */
assert
(
name
!=
nullptr
);
assert
(
name
!=
nullptr
);
#endif
if
(
db
==
nullptr
)
if
(
db
==
nullptr
)
return
nullptr
;
return
nullptr
;
...
...
src/DecoderPlugin.cxx
View file @
53f40448
...
@@ -26,7 +26,10 @@
...
@@ -26,7 +26,10 @@
bool
bool
DecoderPlugin
::
SupportsSuffix
(
const
char
*
suffix
)
const
DecoderPlugin
::
SupportsSuffix
(
const
char
*
suffix
)
const
{
{
#if !CLANG_CHECK_VERSION(3,6)
/* disabled on clang due to -Wtautological-pointer-compare */
assert
(
suffix
!=
nullptr
);
assert
(
suffix
!=
nullptr
);
#endif
return
suffixes
!=
nullptr
&&
string_array_contains
(
suffixes
,
suffix
);
return
suffixes
!=
nullptr
&&
string_array_contains
(
suffixes
,
suffix
);
...
@@ -35,7 +38,10 @@ DecoderPlugin::SupportsSuffix(const char *suffix) const
...
@@ -35,7 +38,10 @@ DecoderPlugin::SupportsSuffix(const char *suffix) const
bool
bool
DecoderPlugin
::
SupportsMimeType
(
const
char
*
mime_type
)
const
DecoderPlugin
::
SupportsMimeType
(
const
char
*
mime_type
)
const
{
{
#if !CLANG_CHECK_VERSION(3,6)
/* disabled on clang due to -Wtautological-pointer-compare */
assert
(
mime_type
!=
nullptr
);
assert
(
mime_type
!=
nullptr
);
#endif
return
mime_types
!=
nullptr
&&
return
mime_types
!=
nullptr
&&
string_array_contains
(
mime_types
,
mime_type
);
string_array_contains
(
mime_types
,
mime_type
);
...
...
src/Directory.cxx
View file @
53f40448
...
@@ -40,7 +40,10 @@ extern "C" {
...
@@ -40,7 +40,10 @@ extern "C" {
inline
Directory
*
inline
Directory
*
Directory
::
Allocate
(
const
char
*
path
)
Directory
::
Allocate
(
const
char
*
path
)
{
{
#if !CLANG_CHECK_VERSION(3,6)
/* disabled on clang due to -Wtautological-pointer-compare */
assert
(
path
!=
nullptr
);
assert
(
path
!=
nullptr
);
#endif
const
size_t
path_size
=
strlen
(
path
)
+
1
;
const
size_t
path_size
=
strlen
(
path
)
+
1
;
Directory
*
directory
=
Directory
*
directory
=
...
...
src/InputStream.cxx
View file @
53f40448
...
@@ -155,7 +155,10 @@ InputStream::IsAvailable()
...
@@ -155,7 +155,10 @@ InputStream::IsAvailable()
size_t
size_t
InputStream
::
Read
(
void
*
ptr
,
size_t
_size
,
Error
&
error
)
InputStream
::
Read
(
void
*
ptr
,
size_t
_size
,
Error
&
error
)
{
{
#if !CLANG_CHECK_VERSION(3,6)
/* disabled on clang due to -Wtautological-pointer-compare */
assert
(
ptr
!=
nullptr
);
assert
(
ptr
!=
nullptr
);
#endif
assert
(
_size
>
0
);
assert
(
_size
>
0
);
return
plugin
.
read
(
this
,
ptr
,
_size
,
error
);
return
plugin
.
read
(
this
,
ptr
,
_size
,
error
);
...
@@ -164,7 +167,10 @@ InputStream::Read(void *ptr, size_t _size, Error &error)
...
@@ -164,7 +167,10 @@ InputStream::Read(void *ptr, size_t _size, Error &error)
size_t
size_t
InputStream
::
LockRead
(
void
*
ptr
,
size_t
_size
,
Error
&
error
)
InputStream
::
LockRead
(
void
*
ptr
,
size_t
_size
,
Error
&
error
)
{
{
#if !CLANG_CHECK_VERSION(3,6)
/* disabled on clang due to -Wtautological-pointer-compare */
assert
(
ptr
!=
nullptr
);
assert
(
ptr
!=
nullptr
);
#endif
assert
(
_size
>
0
);
assert
(
_size
>
0
);
const
ScopeLock
protect
(
mutex
);
const
ScopeLock
protect
(
mutex
);
...
...
src/SongFilter.cxx
View file @
53f40448
...
@@ -78,7 +78,10 @@ SongFilter::Item::Item(unsigned _tag, const char *_value, bool _fold_case)
...
@@ -78,7 +78,10 @@ SongFilter::Item::Item(unsigned _tag, const char *_value, bool _fold_case)
bool
bool
SongFilter
::
Item
::
StringMatch
(
const
char
*
s
)
const
SongFilter
::
Item
::
StringMatch
(
const
char
*
s
)
const
{
{
#if !CLANG_CHECK_VERSION(3,6)
/* disabled on clang due to -Wtautological-pointer-compare */
assert
(
s
!=
nullptr
);
assert
(
s
!=
nullptr
);
#endif
if
(
fold_case
)
{
if
(
fold_case
)
{
char
*
p
=
g_utf8_casefold
(
s
,
-
1
);
char
*
p
=
g_utf8_casefold
(
s
,
-
1
);
...
...
src/fs/Charset.cxx
View file @
53f40448
...
@@ -79,7 +79,10 @@ GetFSCharset()
...
@@ -79,7 +79,10 @@ GetFSCharset()
std
::
string
std
::
string
PathToUTF8
(
const
char
*
path_fs
)
PathToUTF8
(
const
char
*
path_fs
)
{
{
#if !CLANG_CHECK_VERSION(3,6)
/* disabled on clang due to -Wtautological-pointer-compare */
assert
(
path_fs
!=
nullptr
);
assert
(
path_fs
!=
nullptr
);
#endif
if
(
fs_charset
.
empty
())
if
(
fs_charset
.
empty
())
return
std
::
string
(
path_fs
);
return
std
::
string
(
path_fs
);
...
@@ -109,7 +112,10 @@ PathToUTF8(const char *path_fs)
...
@@ -109,7 +112,10 @@ PathToUTF8(const char *path_fs)
char
*
char
*
PathFromUTF8
(
const
char
*
path_utf8
)
PathFromUTF8
(
const
char
*
path_utf8
)
{
{
#if !CLANG_CHECK_VERSION(3,6)
/* disabled on clang due to -Wtautological-pointer-compare */
assert
(
path_utf8
!=
nullptr
);
assert
(
path_utf8
!=
nullptr
);
#endif
if
(
fs_charset
.
empty
())
if
(
fs_charset
.
empty
())
return
g_strdup
(
path_utf8
);
return
g_strdup
(
path_utf8
);
...
...
src/fs/Traits.cxx
View file @
53f40448
...
@@ -25,7 +25,10 @@
...
@@ -25,7 +25,10 @@
const
char
*
const
char
*
PathTraits
::
GetBaseUTF8
(
const
char
*
p
)
PathTraits
::
GetBaseUTF8
(
const
char
*
p
)
{
{
#if !CLANG_CHECK_VERSION(3,6)
/* disabled on clang due to -Wtautological-pointer-compare */
assert
(
p
!=
nullptr
);
assert
(
p
!=
nullptr
);
#endif
const
char
*
slash
=
strrchr
(
p
,
SEPARATOR_UTF8
);
const
char
*
slash
=
strrchr
(
p
,
SEPARATOR_UTF8
);
return
slash
!=
nullptr
return
slash
!=
nullptr
...
@@ -36,7 +39,10 @@ PathTraits::GetBaseUTF8(const char *p)
...
@@ -36,7 +39,10 @@ PathTraits::GetBaseUTF8(const char *p)
std
::
string
std
::
string
PathTraits
::
GetParentUTF8
(
const
char
*
p
)
PathTraits
::
GetParentUTF8
(
const
char
*
p
)
{
{
#if !CLANG_CHECK_VERSION(3,6)
/* disabled on clang due to -Wtautological-pointer-compare */
assert
(
p
!=
nullptr
);
assert
(
p
!=
nullptr
);
#endif
const
char
*
slash
=
strrchr
(
p
,
SEPARATOR_UTF8
);
const
char
*
slash
=
strrchr
(
p
,
SEPARATOR_UTF8
);
return
slash
!=
nullptr
return
slash
!=
nullptr
...
...
src/tag/TagBuilder.cxx
View file @
53f40448
...
@@ -77,7 +77,10 @@ TagBuilder::Commit()
...
@@ -77,7 +77,10 @@ TagBuilder::Commit()
inline
void
inline
void
TagBuilder
::
AddItemInternal
(
TagType
type
,
const
char
*
value
,
size_t
length
)
TagBuilder
::
AddItemInternal
(
TagType
type
,
const
char
*
value
,
size_t
length
)
{
{
#if !CLANG_CHECK_VERSION(3,6)
/* disabled on clang due to -Wtautological-pointer-compare */
assert
(
value
!=
nullptr
);
assert
(
value
!=
nullptr
);
#endif
assert
(
length
>
0
);
assert
(
length
>
0
);
char
*
p
=
FixTagString
(
value
,
length
);
char
*
p
=
FixTagString
(
value
,
length
);
...
@@ -98,7 +101,10 @@ TagBuilder::AddItemInternal(TagType type, const char *value, size_t length)
...
@@ -98,7 +101,10 @@ TagBuilder::AddItemInternal(TagType type, const char *value, size_t length)
void
void
TagBuilder
::
AddItem
(
TagType
type
,
const
char
*
value
,
size_t
length
)
TagBuilder
::
AddItem
(
TagType
type
,
const
char
*
value
,
size_t
length
)
{
{
#if !CLANG_CHECK_VERSION(3,6)
/* disabled on clang due to -Wtautological-pointer-compare */
assert
(
value
!=
nullptr
);
assert
(
value
!=
nullptr
);
#endif
if
(
length
==
0
||
ignore_tag_items
[
type
])
if
(
length
==
0
||
ignore_tag_items
[
type
])
return
;
return
;
...
@@ -109,7 +115,10 @@ TagBuilder::AddItem(TagType type, const char *value, size_t length)
...
@@ -109,7 +115,10 @@ TagBuilder::AddItem(TagType type, const char *value, size_t length)
void
void
TagBuilder
::
AddItem
(
TagType
type
,
const
char
*
value
)
TagBuilder
::
AddItem
(
TagType
type
,
const
char
*
value
)
{
{
#if !CLANG_CHECK_VERSION(3,6)
/* disabled on clang due to -Wtautological-pointer-compare */
assert
(
value
!=
nullptr
);
assert
(
value
!=
nullptr
);
#endif
AddItem
(
type
,
value
,
strlen
(
value
));
AddItem
(
type
,
value
,
strlen
(
value
));
}
}
src/util/ASCII.hxx
View file @
53f40448
...
@@ -43,8 +43,11 @@ gcc_pure gcc_nonnull_all
...
@@ -43,8 +43,11 @@ gcc_pure gcc_nonnull_all
static
inline
bool
static
inline
bool
StringEqualsCaseASCII
(
const
char
*
a
,
const
char
*
b
)
StringEqualsCaseASCII
(
const
char
*
a
,
const
char
*
b
)
{
{
#if !CLANG_CHECK_VERSION(3,6)
/* disabled on clang due to -Wtautological-pointer-compare */
assert
(
a
!=
nullptr
);
assert
(
a
!=
nullptr
);
assert
(
b
!=
nullptr
);
assert
(
b
!=
nullptr
);
#endif
/* note: strcasecmp() depends on the locale, but for ASCII-only
/* note: strcasecmp() depends on the locale, but for ASCII-only
strings, it's safe to use */
strings, it's safe to use */
...
@@ -55,8 +58,11 @@ gcc_pure gcc_nonnull_all
...
@@ -55,8 +58,11 @@ gcc_pure gcc_nonnull_all
static
inline
bool
static
inline
bool
StringEqualsCaseASCII
(
const
char
*
a
,
const
char
*
b
,
size_t
n
)
StringEqualsCaseASCII
(
const
char
*
a
,
const
char
*
b
,
size_t
n
)
{
{
#if !CLANG_CHECK_VERSION(3,6)
/* disabled on clang due to -Wtautological-pointer-compare */
assert
(
a
!=
nullptr
);
assert
(
a
!=
nullptr
);
assert
(
b
!=
nullptr
);
assert
(
b
!=
nullptr
);
#endif
/* note: strcasecmp() depends on the locale, but for ASCII-only
/* note: strcasecmp() depends on the locale, but for ASCII-only
strings, it's safe to use */
strings, it's safe to use */
...
...
src/util/UriUtil.cxx
View file @
53f40448
...
@@ -128,8 +128,11 @@ uri_remove_auth(const char *uri)
...
@@ -128,8 +128,11 @@ uri_remove_auth(const char *uri)
bool
bool
uri_is_child
(
const
char
*
parent
,
const
char
*
child
)
uri_is_child
(
const
char
*
parent
,
const
char
*
child
)
{
{
#if !CLANG_CHECK_VERSION(3,6)
/* disabled on clang due to -Wtautological-pointer-compare */
assert
(
parent
!=
nullptr
);
assert
(
parent
!=
nullptr
);
assert
(
child
!=
nullptr
);
assert
(
child
!=
nullptr
);
#endif
const
size_t
parent_length
=
strlen
(
parent
);
const
size_t
parent_length
=
strlen
(
parent
);
return
memcmp
(
parent
,
child
,
parent_length
)
==
0
&&
return
memcmp
(
parent
,
child
,
parent_length
)
==
0
&&
...
...
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