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
940cab86
Commit
940cab86
authored
Dec 26, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'v0.18.x' into v0.19.x
parents
5b84c99d
66503146
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
114 additions
and
51 deletions
+114
-51
NEWS
NEWS
+4
-0
Compiler.h
src/Compiler.h
+23
-11
SongFilter.cxx
src/SongFilter.cxx
+3
-0
ProxyDatabasePlugin.cxx
src/db/plugins/ProxyDatabasePlugin.cxx
+4
-4
SimpleDatabasePlugin.hxx
src/db/plugins/simple/SimpleDatabasePlugin.hxx
+3
-3
DecoderPlugin.cxx
src/decoder/DecoderPlugin.cxx
+6
-0
ChainFilterPlugin.cxx
src/filter/plugins/ChainFilterPlugin.cxx
+5
-4
NormalizeFilterPlugin.cxx
src/filter/plugins/NormalizeFilterPlugin.cxx
+5
-4
ReplayGainFilterPlugin.cxx
src/filter/plugins/ReplayGainFilterPlugin.cxx
+5
-4
RouteFilterPlugin.cxx
src/filter/plugins/RouteFilterPlugin.cxx
+5
-4
VolumeFilterPlugin.cxx
src/filter/plugins/VolumeFilterPlugin.cxx
+5
-4
Charset.cxx
src/fs/Charset.cxx
+6
-0
Traits.cxx
src/fs/Traits.cxx
+6
-0
InputStream.cxx
src/input/InputStream.cxx
+3
-0
ShoutOutputPlugin.cxx
src/output/plugins/ShoutOutputPlugin.cxx
+1
-1
TagBuilder.cxx
src/tag/TagBuilder.cxx
+9
-0
ASCII.hxx
src/util/ASCII.hxx
+16
-10
Manual.hxx
src/util/Manual.hxx
+2
-2
UriUtil.cxx
src/util/UriUtil.cxx
+3
-0
No files found.
NEWS
View file @
940cab86
...
@@ -4,6 +4,7 @@ ver 0.19.8 (not yet released)
...
@@ -4,6 +4,7 @@ ver 0.19.8 (not yet released)
* decoder
* decoder
- dsdiff, dsf: allow ID3 tags larger than 4 kB
- dsdiff, dsf: allow ID3 tags larger than 4 kB
- ffmpeg: support interleaved floating point
- ffmpeg: support interleaved floating point
* fix clang 3.6 warnings
ver 0.19.7 (2014/12/17)
ver 0.19.7 (2014/12/17)
* input
* input
...
@@ -168,6 +169,9 @@ ver 0.19 (2014/10/10)
...
@@ -168,6 +169,9 @@ ver 0.19 (2014/10/10)
* install systemd unit for socket activation
* install systemd unit for socket activation
* Android port
* Android port
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
- embcue: fix filename suffix detection
- embcue: fix filename suffix detection
...
...
src/Compiler.h
View file @
940cab86
...
@@ -20,33 +20,45 @@
...
@@ -20,33 +20,45 @@
#ifndef COMPILER_H
#ifndef COMPILER_H
#define COMPILER_H
#define COMPILER_H
#define GCC_CHECK_VERSION(major, minor) \
#define GCC_MAKE_VERSION(major, minor, patchlevel) ((major) * 10000 + (minor) * 100 + patchlevel)
(defined(__GNUC__) && \
(__GNUC__ > (major) || (__GNUC__ == (major) && __GNUC_MINOR__ >= (minor))))
#ifdef __GNUC__
#ifdef __GNUC__
#define GCC_VERSION (__GNUC__ * 10000 \
#define GCC_VERSION GCC_MAKE_VERSION(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__)
+ __GNUC_MINOR__ * 100 \
+ __GNUC_PATCHLEVEL__)
#else
#else
#define GCC_VERSION 0
#define GCC_VERSION 0
#endif
#endif
#define GCC_CHECK_VERSION(major, minor) \
(defined(__GNUC__) && GCC_VERSION >= GCC_MAKE_VERSION(major, minor, 0))
/**
* Are we building with gcc (not clang or any other compiler) and a
* version older than the specified one?
*/
#define GCC_OLDER_THAN(major, minor) \
(defined(__GNUC__) && !defined(__clang__) && \
GCC_VERSION < GCC_MAKE_VERSION(major, minor, 0))
#ifdef __clang__
#ifdef __clang__
# define CLANG_VERSION (__clang_major__ * 10000 \
# define CLANG_VERSION GCC_MAKE_VERSION(__clang_major__, __clang_minor__, __clang_patchlevel__)
+ __clang_minor__ * 100 \
+ __clang_patchlevel__)
# if __clang_major__ < 3
# if __clang_major__ < 3
# error Sorry, your clang version is too old. You need at least version 3.1.
# error Sorry, your clang version is too old. You need at least version 3.1.
# endif
# endif
#elif defined(__GNUC__)
#elif defined(__GNUC__)
# if
!GCC_CHECK_VERSIO
N(4,6)
# if
GCC_OLDER_THA
N(4,6)
# error Sorry, your gcc version is too old. You need at least version 4.6.
# error Sorry, your gcc version is too old. You need at least version 4.6.
# endif
# endif
#else
#else
# warning Untested compiler. Use at your own risk!
# warning Untested compiler. Use at your own risk!
#endif
#endif
/**
* Are we building with the specified version of clang or newer?
*/
#define CLANG_CHECK_VERSION(major, minor) \
(defined(__clang__) && \
CLANG_VERSION >= GCC_MAKE_VERSION(major, minor, 0))
#if GCC_CHECK_VERSION(4,0)
#if GCC_CHECK_VERSION(4,0)
/* GCC 4.x */
/* GCC 4.x */
...
@@ -141,7 +153,7 @@
...
@@ -141,7 +153,7 @@
#if defined(__cplusplus)
#if defined(__cplusplus)
/* support for C++11 "override" was added in gcc 4.7 */
/* support for C++11 "override" was added in gcc 4.7 */
#if
!defined(__clang__) && !GCC_CHECK_VERSIO
N(4,7)
#if
GCC_OLDER_THA
N(4,7)
#define override
#define override
#define final
#define final
#endif
#endif
...
...
src/SongFilter.cxx
View file @
940cab86
...
@@ -77,7 +77,10 @@ SongFilter::Item::Item(unsigned _tag, time_t _time)
...
@@ -77,7 +77,10 @@ SongFilter::Item::Item(unsigned _tag, time_t _time)
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
)
{
const
std
::
string
folded
=
IcuCaseFold
(
s
);
const
std
::
string
folded
=
IcuCaseFold
(
s
);
...
...
src/db/plugins/ProxyDatabasePlugin.cxx
View file @
940cab86
...
@@ -103,7 +103,7 @@ public:
...
@@ -103,7 +103,7 @@ public:
virtual
void
Close
()
override
;
virtual
void
Close
()
override
;
virtual
const
LightSong
*
GetSong
(
const
char
*
uri_utf8
,
virtual
const
LightSong
*
GetSong
(
const
char
*
uri_utf8
,
Error
&
error
)
const
override
;
Error
&
error
)
const
override
;
v
irtual
void
ReturnSong
(
const
LightSong
*
song
)
const
;
v
oid
ReturnSong
(
const
LightSong
*
song
)
const
override
;
virtual
bool
Visit
(
const
DatabaseSelection
&
selection
,
virtual
bool
Visit
(
const
DatabaseSelection
&
selection
,
VisitDirectory
visit_directory
,
VisitDirectory
visit_directory
,
...
@@ -731,7 +731,7 @@ ProxyDatabase::Visit(const DatabaseSelection &selection,
...
@@ -731,7 +731,7 @@ ProxyDatabase::Visit(const DatabaseSelection &selection,
{
{
// TODO: eliminate the const_cast
// TODO: eliminate the const_cast
if
(
!
const_cast
<
ProxyDatabase
*>
(
this
)
->
EnsureConnected
(
error
))
if
(
!
const_cast
<
ProxyDatabase
*>
(
this
)
->
EnsureConnected
(
error
))
return
nullptr
;
return
false
;
if
(
!
visit_directory
&&
!
visit_playlist
&&
selection
.
recursive
&&
if
(
!
visit_directory
&&
!
visit_playlist
&&
selection
.
recursive
&&
(
ServerSupportsSearchBase
(
connection
)
(
ServerSupportsSearchBase
(
connection
)
...
@@ -757,7 +757,7 @@ ProxyDatabase::VisitUniqueTags(const DatabaseSelection &selection,
...
@@ -757,7 +757,7 @@ ProxyDatabase::VisitUniqueTags(const DatabaseSelection &selection,
{
{
// TODO: eliminate the const_cast
// TODO: eliminate the const_cast
if
(
!
const_cast
<
ProxyDatabase
*>
(
this
)
->
EnsureConnected
(
error
))
if
(
!
const_cast
<
ProxyDatabase
*>
(
this
)
->
EnsureConnected
(
error
))
return
nullptr
;
return
false
;
enum
mpd_tag_type
tag_type2
=
Convert
(
tag_type
);
enum
mpd_tag_type
tag_type2
=
Convert
(
tag_type
);
if
(
tag_type2
==
MPD_TAG_COUNT
)
{
if
(
tag_type2
==
MPD_TAG_COUNT
)
{
...
@@ -810,7 +810,7 @@ ProxyDatabase::GetStats(const DatabaseSelection &selection,
...
@@ -810,7 +810,7 @@ ProxyDatabase::GetStats(const DatabaseSelection &selection,
// TODO: eliminate the const_cast
// TODO: eliminate the const_cast
if
(
!
const_cast
<
ProxyDatabase
*>
(
this
)
->
EnsureConnected
(
error
))
if
(
!
const_cast
<
ProxyDatabase
*>
(
this
)
->
EnsureConnected
(
error
))
return
nullptr
;
return
false
;
struct
mpd_stats
*
stats2
=
struct
mpd_stats
*
stats2
=
mpd_run_stats
(
connection
);
mpd_run_stats
(
connection
);
...
...
src/db/plugins/simple/SimpleDatabasePlugin.hxx
View file @
940cab86
...
@@ -110,9 +110,9 @@ public:
...
@@ -110,9 +110,9 @@ public:
virtual
bool
Open
(
Error
&
error
)
override
;
virtual
bool
Open
(
Error
&
error
)
override
;
virtual
void
Close
()
override
;
virtual
void
Close
()
override
;
virtual
const
LightSong
*
GetSong
(
const
char
*
uri_utf8
,
const
LightSong
*
GetSong
(
const
char
*
uri_utf8
,
Error
&
error
)
const
override
;
Error
&
error
)
const
override
;
v
irtual
void
ReturnSong
(
const
LightSong
*
song
)
const
;
v
oid
ReturnSong
(
const
LightSong
*
song
)
const
override
;
virtual
bool
Visit
(
const
DatabaseSelection
&
selection
,
virtual
bool
Visit
(
const
DatabaseSelection
&
selection
,
VisitDirectory
visit_directory
,
VisitDirectory
visit_directory
,
...
...
src/decoder/DecoderPlugin.cxx
View file @
940cab86
...
@@ -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/filter/plugins/ChainFilterPlugin.cxx
View file @
940cab86
...
@@ -53,10 +53,11 @@ public:
...
@@ -53,10 +53,11 @@ public:
children
.
emplace_back
(
name
,
filter
);
children
.
emplace_back
(
name
,
filter
);
}
}
virtual
AudioFormat
Open
(
AudioFormat
&
af
,
Error
&
error
)
override
;
/* virtual methods from class Filter */
virtual
void
Close
();
AudioFormat
Open
(
AudioFormat
&
af
,
Error
&
error
)
override
;
virtual
ConstBuffer
<
void
>
FilterPCM
(
ConstBuffer
<
void
>
src
,
void
Close
()
override
;
Error
&
error
);
ConstBuffer
<
void
>
FilterPCM
(
ConstBuffer
<
void
>
src
,
Error
&
error
)
override
;
private
:
private
:
/**
/**
...
...
src/filter/plugins/NormalizeFilterPlugin.cxx
View file @
940cab86
...
@@ -34,10 +34,11 @@ class NormalizeFilter final : public Filter {
...
@@ -34,10 +34,11 @@ class NormalizeFilter final : public Filter {
PcmBuffer
buffer
;
PcmBuffer
buffer
;
public
:
public
:
virtual
AudioFormat
Open
(
AudioFormat
&
af
,
Error
&
error
)
override
;
/* virtual methods from class Filter */
virtual
void
Close
();
AudioFormat
Open
(
AudioFormat
&
af
,
Error
&
error
)
override
;
virtual
ConstBuffer
<
void
>
FilterPCM
(
ConstBuffer
<
void
>
src
,
void
Close
()
override
;
Error
&
error
)
override
;
ConstBuffer
<
void
>
FilterPCM
(
ConstBuffer
<
void
>
src
,
Error
&
error
)
override
;
};
};
static
Filter
*
static
Filter
*
...
...
src/filter/plugins/ReplayGainFilterPlugin.cxx
View file @
940cab86
...
@@ -112,10 +112,11 @@ public:
...
@@ -112,10 +112,11 @@ public:
*/
*/
void
Update
();
void
Update
();
virtual
AudioFormat
Open
(
AudioFormat
&
af
,
Error
&
error
)
override
;
/* virtual methods from class Filter */
virtual
void
Close
();
AudioFormat
Open
(
AudioFormat
&
af
,
Error
&
error
)
override
;
virtual
ConstBuffer
<
void
>
FilterPCM
(
ConstBuffer
<
void
>
src
,
void
Close
()
override
;
Error
&
error
)
override
;
ConstBuffer
<
void
>
FilterPCM
(
ConstBuffer
<
void
>
src
,
Error
&
error
)
override
;
};
};
void
void
...
...
src/filter/plugins/RouteFilterPlugin.cxx
View file @
940cab86
...
@@ -120,10 +120,11 @@ public:
...
@@ -120,10 +120,11 @@ public:
*/
*/
bool
Configure
(
const
config_param
&
param
,
Error
&
error
);
bool
Configure
(
const
config_param
&
param
,
Error
&
error
);
virtual
AudioFormat
Open
(
AudioFormat
&
af
,
Error
&
error
)
override
;
/* virtual methods from class Filter */
virtual
void
Close
();
AudioFormat
Open
(
AudioFormat
&
af
,
Error
&
error
)
override
;
virtual
ConstBuffer
<
void
>
FilterPCM
(
ConstBuffer
<
void
>
src
,
void
Close
()
override
;
Error
&
error
)
override
;
ConstBuffer
<
void
>
FilterPCM
(
ConstBuffer
<
void
>
src
,
Error
&
error
)
override
;
};
};
bool
bool
...
...
src/filter/plugins/VolumeFilterPlugin.cxx
View file @
940cab86
...
@@ -43,10 +43,11 @@ public:
...
@@ -43,10 +43,11 @@ public:
pv
.
SetVolume
(
_volume
);
pv
.
SetVolume
(
_volume
);
}
}
virtual
AudioFormat
Open
(
AudioFormat
&
af
,
Error
&
error
)
override
;
/* virtual methods from class Filter */
virtual
void
Close
();
AudioFormat
Open
(
AudioFormat
&
af
,
Error
&
error
)
override
;
virtual
ConstBuffer
<
void
>
FilterPCM
(
ConstBuffer
<
void
>
src
,
void
Close
()
override
;
Error
&
error
)
override
;
ConstBuffer
<
void
>
FilterPCM
(
ConstBuffer
<
void
>
src
,
Error
&
error
)
override
;
};
};
static
constexpr
Domain
volume_domain
(
"pcm_volume"
);
static
constexpr
Domain
volume_domain
(
"pcm_volume"
);
...
...
src/fs/Charset.cxx
View file @
940cab86
...
@@ -103,7 +103,10 @@ static inline void FixSeparators(std::string &s)
...
@@ -103,7 +103,10 @@ static inline void FixSeparators(std::string &s)
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
#ifdef HAVE_GLIB
#ifdef HAVE_GLIB
if
(
fs_charset
.
empty
())
{
if
(
fs_charset
.
empty
())
{
...
@@ -144,7 +147,10 @@ PathToUTF8(const char *path_fs)
...
@@ -144,7 +147,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 @
940cab86
...
@@ -52,7 +52,10 @@ template<typename Traits>
...
@@ -52,7 +52,10 @@ template<typename Traits>
typename
Traits
::
const_pointer
typename
Traits
::
const_pointer
GetBasePathImpl
(
typename
Traits
::
const_pointer
p
)
GetBasePathImpl
(
typename
Traits
::
const_pointer
p
)
{
{
#if !CLANG_CHECK_VERSION(3,6)
/* disabled on clang due to -Wtautological-pointer-compare */
assert
(
p
!=
nullptr
);
assert
(
p
!=
nullptr
);
#endif
typename
Traits
::
const_pointer
sep
=
Traits
::
FindLastSeparator
(
p
);
typename
Traits
::
const_pointer
sep
=
Traits
::
FindLastSeparator
(
p
);
return
sep
!=
nullptr
return
sep
!=
nullptr
...
@@ -64,7 +67,10 @@ template<typename Traits>
...
@@ -64,7 +67,10 @@ template<typename Traits>
typename
Traits
::
string
typename
Traits
::
string
GetParentPathImpl
(
typename
Traits
::
const_pointer
p
)
GetParentPathImpl
(
typename
Traits
::
const_pointer
p
)
{
{
#if !CLANG_CHECK_VERSION(3,6)
/* disabled on clang due to -Wtautological-pointer-compare */
assert
(
p
!=
nullptr
);
assert
(
p
!=
nullptr
);
#endif
typename
Traits
::
const_pointer
sep
=
Traits
::
FindLastSeparator
(
p
);
typename
Traits
::
const_pointer
sep
=
Traits
::
FindLastSeparator
(
p
);
if
(
sep
==
nullptr
)
if
(
sep
==
nullptr
)
...
...
src/input/InputStream.cxx
View file @
940cab86
...
@@ -122,7 +122,10 @@ InputStream::IsAvailable()
...
@@ -122,7 +122,10 @@ InputStream::IsAvailable()
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/output/plugins/ShoutOutputPlugin.cxx
View file @
940cab86
...
@@ -109,7 +109,7 @@ ShoutOutput::Configure(const config_param ¶m, Error &error)
...
@@ -109,7 +109,7 @@ ShoutOutput::Configure(const config_param ¶m, Error &error)
if
(
!
audio_format
.
IsFullyDefined
())
{
if
(
!
audio_format
.
IsFullyDefined
())
{
error
.
Set
(
config_domain
,
error
.
Set
(
config_domain
,
"Need full audio format specification"
);
"Need full audio format specification"
);
return
nullptr
;
return
false
;
}
}
const
char
*
host
=
require_block_string
(
param
,
"host"
);
const
char
*
host
=
require_block_string
(
param
,
"host"
);
...
...
src/tag/TagBuilder.cxx
View file @
940cab86
...
@@ -182,7 +182,10 @@ TagBuilder::Complement(const Tag &other)
...
@@ -182,7 +182,10 @@ TagBuilder::Complement(const Tag &other)
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
);
auto
f
=
FixTagString
(
value
,
length
);
auto
f
=
FixTagString
(
value
,
length
);
...
@@ -203,7 +206,10 @@ TagBuilder::AddItemInternal(TagType type, const char *value, size_t length)
...
@@ -203,7 +206,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
;
...
@@ -214,7 +220,10 @@ TagBuilder::AddItem(TagType type, const char *value, size_t length)
...
@@ -214,7 +220,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 @
940cab86
...
@@ -43,24 +43,30 @@ gcc_pure gcc_nonnull_all
...
@@ -43,24 +43,30 @@ 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
)
{
{
assert
(
a
!=
nullptr
);
#if !CLANG_CHECK_VERSION(3,6)
assert
(
b
!=
nullptr
);
/* disabled on clang due to -Wtautological-pointer-compare */
assert
(
a
!=
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 */
return
strcasecmp
(
a
,
b
)
==
0
;
return
strcasecmp
(
a
,
b
)
==
0
;
}
}
gcc_pure
gcc_nonnull_all
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
)
{
{
assert
(
a
!=
nullptr
);
#if !CLANG_CHECK_VERSION(3,6)
assert
(
b
!=
nullptr
);
/* disabled on clang due to -Wtautological-pointer-compare */
assert
(
a
!=
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 */
return
strncasecmp
(
a
,
b
,
n
)
==
0
;
return
strncasecmp
(
a
,
b
,
n
)
==
0
;
}
}
#endif
#endif
src/util/Manual.hxx
View file @
940cab86
...
@@ -35,7 +35,7 @@
...
@@ -35,7 +35,7 @@
#include <new>
#include <new>
#include <utility>
#include <utility>
#if
!defined(__clang__) && __GNUC__ && !GCC_CHECK_VERSIO
N(4,8)
#if
GCC_OLDER_THA
N(4,8)
#include <type_traits>
#include <type_traits>
#endif
#endif
...
@@ -54,7 +54,7 @@
...
@@ -54,7 +54,7 @@
*/
*/
template
<
class
T
>
template
<
class
T
>
class
Manual
{
class
Manual
{
#if
!defined(__clang__) && __GNUC__ && !GCC_CHECK_VERSIO
N(4,8)
#if
GCC_OLDER_THA
N(4,8)
/* no alignas() on gcc < 4.8: apply worst-case fallback */
/* no alignas() on gcc < 4.8: apply worst-case fallback */
__attribute__
((
aligned
(
8
)))
__attribute__
((
aligned
(
8
)))
#else
#else
...
...
src/util/UriUtil.cxx
View file @
940cab86
...
@@ -140,8 +140,11 @@ uri_remove_auth(const char *uri)
...
@@ -140,8 +140,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