Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
B
brpc
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
brpc
Commits
9ad67cdb
Commit
9ad67cdb
authored
Aug 21, 2017
by
James Ge
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support clang 4.0 (except UT)
Change-Id: I603bdaca231398e1c45141f36538823354d490cf
parent
42c2712b
Hide whitespace changes
Inline
Side-by-side
Showing
34 changed files
with
86 additions
and
78 deletions
+86
-78
atomicops.h
src/base/atomicops.h
+11
-7
flat_map.h
src/base/containers/flat_map.h
+2
-1
find_cstr.h
src/base/find_cstr.h
+1
-1
md5.cc
src/base/md5.cc
+1
-1
ref_counted.h
src/base/memory/ref_counted.h
+8
-1
singleton_on_pthread_once.h
src/base/memory/singleton_on_pthread_once.h
+2
-1
g_fmt.cc
src/base/third_party/dmg_fp/g_fmt.cc
+3
-3
rapidjson.h
src/base/third_party/rapidjson/rapidjson.h
+5
-1
dir_service.h
src/brpc/builtin/dir_service.h
+0
-6
hotspots_service.cpp
src/brpc/builtin/hotspots_service.cpp
+1
-1
sorttable_js.cpp
src/brpc/builtin/sorttable_js.cpp
+1
-1
http_parser.h
src/brpc/details/http_parser.h
+2
-5
http_method.cpp
src/brpc/http_method.cpp
+7
-7
parallel_channel.cpp
src/brpc/parallel_channel.cpp
+4
-0
parse_result.h
src/brpc/parse_result.h
+1
-1
hasher.h
src/brpc/policy/hasher.h
+1
-1
nshead_protocol.cpp
src/brpc/policy/nshead_protocol.cpp
+2
-1
rtmp_protocol.cpp
src/brpc/policy/rtmp_protocol.cpp
+0
-1
rtmp_protocol.h
src/brpc/policy/rtmp_protocol.h
+1
-1
server.cpp
src/brpc/server.cpp
+1
-3
socket.h
src/brpc/socket.h
+1
-1
ts.cpp
src/brpc/ts.cpp
+7
-7
execution_queue.h
src/bthread/execution_queue.h
+1
-1
task_meta.h
src/bthread/task_meta.h
+1
-1
default_variables.cpp
src/bvar/default_variables.cpp
+6
-4
percentile.cpp
src/bvar/detail/percentile.cpp
+1
-1
variable.cpp
src/bvar/variable.cpp
+0
-2
brpc_builtin_service_unittest.cpp
test/brpc_builtin_service_unittest.cpp
+1
-1
cancellation_flag_unittest.cc
test/cancellation_flag_unittest.cc
+0
-10
condition_variable_unittest.cc
test/condition_variable_unittest.cc
+1
-1
path_service_unittest.cc
test/path_service_unittest.cc
+1
-1
temp_file_unittest.cpp
test/temp_file_unittest.cpp
+2
-2
type_traits_unittest.cc
test/type_traits_unittest.cc
+1
-1
print_gcc_version.cc
tools/print_gcc_version.cc
+9
-1
No files found.
src/base/atomicops.h
View file @
9ad67cdb
...
...
@@ -171,17 +171,21 @@ Atomic64 Release_Load(volatile const Atomic64* ptr);
// gcc supports atomic thread fence since 4.8 checkout
// https://gcc.gnu.org/gcc-4.7/cxx0x_status.html and
// https://gcc.gnu.org/gcc-4.8/cxx0x_status.html for more details
#if !defined(__GNUC__) || (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 >= 40800)
#include <atomic>
#if defined(__clang__) || \
!defined(__GNUC__) || \
(__GNUC__ * 10000 + __GNUC_MINOR__ * 100 >= 40800)
# include <atomic>
#else
#if __GNUC__ * 10000 + __GNUC_MINOR__ * 100 >= 40500
#
if __GNUC__ * 10000 + __GNUC_MINOR__ * 100 >= 40500
// gcc 4.5 renames cstdatomic to atomic
// (https://gcc.gnu.org/gcc-4.5/changes.html)
#include <atomic>
#else
#include <cstdatomic>
#endif
#
include <atomic>
#
else
#
include <cstdatomic>
#
endif
namespace
std
{
...
...
src/base/containers/flat_map.h
View file @
9ad67cdb
...
...
@@ -94,7 +94,7 @@ namespace base {
template
<
typename
_Map
,
typename
_Element
>
class
FlatMapIterator
;
template
<
typename
_Map
,
typename
_Element
>
class
SparseFlatMapIterator
;
template
<
typename
K
,
typename
T
>
struct
FlatMapElement
;
template
<
typename
K
,
typename
T
>
class
FlatMapElement
;
struct
FlatMapVoid
{};
// Replace void which is not constructible.
template
<
typename
K
>
struct
DefaultHasher
;
template
<
typename
K
>
struct
DefaultEqualTo
;
...
...
@@ -246,6 +246,7 @@ public:
};
private
:
friend
class
FlatMapTest
;
template
<
typename
_Map
,
typename
_Element
>
friend
class
FlatMapIterator
;
template
<
typename
_Map
,
typename
_Element
>
friend
class
FlatMapSparseIterator
;
// True if buckets need to be resized before holding `size' elements.
...
...
src/base/find_cstr.h
View file @
9ad67cdb
...
...
@@ -38,7 +38,7 @@ struct StringMapThreadLocalTemp {
if
(
temp
->
initialized
)
{
temp
->
initialized
=
false
;
std
::
string
*
temp_string
=
(
std
::
string
*
)
temp
->
buf
;
temp_string
->
std
::
string
::~
string
();
temp_string
->
~
basic_
string
();
}
}
...
...
src/base/md5.cc
View file @
9ad67cdb
...
...
@@ -64,7 +64,7 @@ void byteReverse(unsigned char *buf, unsigned longs) {
* the data and converts bytes into longwords for this routine.
*/
void
MD5Transform
(
uint32_t
buf
[
4
],
const
uint32_t
in
[
16
])
{
register
uint32_t
a
,
b
,
c
,
d
;
uint32_t
a
,
b
,
c
,
d
;
a
=
buf
[
0
];
b
=
buf
[
1
];
...
...
src/base/memory/ref_counted.h
View file @
9ad67cdb
...
...
@@ -68,8 +68,11 @@ class BASE_EXPORT RefCountedBase {
private
:
mutable
int
ref_count_
;
#if defined(__clang__)
mutable
bool
ALLOW_UNUSED
in_dtor_
;
#else
mutable
bool
in_dtor_
;
#endif
DFAKE_MUTEX
(
add_release_
);
DISALLOW_COPY_AND_ASSIGN
(
RefCountedBase
);
...
...
@@ -90,7 +93,11 @@ class BASE_EXPORT RefCountedThreadSafeBase {
private
:
mutable
AtomicRefCount
ref_count_
;
#if defined(__clang__)
mutable
bool
ALLOW_UNUSED
in_dtor_
;
#else
mutable
bool
in_dtor_
;
#endif
DISALLOW_COPY_AND_ASSIGN
(
RefCountedThreadSafeBase
);
};
...
...
src/base/memory/singleton_on_pthread_once.h
View file @
9ad67cdb
...
...
@@ -12,7 +12,8 @@
namespace
base
{
template
<
typename
T
>
struct
GetLeakySingleton
{
template
<
typename
T
>
class
GetLeakySingleton
{
public
:
static
base
::
subtle
::
AtomicWord
g_leaky_singleton_untyped
;
static
pthread_once_t
g_create_leaky_singleton_once
;
static
void
create_leaky_singleton
();
...
...
src/base/third_party/dmg_fp/g_fmt.cc
View file @
9ad67cdb
...
...
@@ -27,10 +27,10 @@
namespace
dmg_fp
{
char
*
g_fmt
(
register
char
*
b
,
double
x
)
g_fmt
(
char
*
b
,
double
x
)
{
register
int
i
,
k
;
register
char
*
s
;
int
i
,
k
;
char
*
s
;
int
decpt
,
j
,
sign
;
char
*
b0
,
*
s0
,
*
se
;
...
...
src/base/third_party/rapidjson/rapidjson.h
View file @
9ad67cdb
...
...
@@ -438,8 +438,12 @@ RAPIDJSON_NAMESPACE_END
#ifndef RAPIDJSON_HAS_CXX11_RVALUE_REFS
#if defined(__clang__)
#
define RAPIDJSON_HAS_CXX11_RVALUE_REFS
__has_feature(cxx_rvalue_references) && \
#
if
__has_feature(cxx_rvalue_references) && \
(
defined
(
_LIBCPP_VERSION
)
||
defined
(
__GLIBCXX__
)
&&
__GLIBCXX__
>=
20080306
)
# define RAPIDJSON_HAS_CXX11_RVALUE_REFS 1
# else
# define RAPIDJSON_HAS_CXX11_RVALUE_REFS 0
# endif
#elif (defined(RAPIDJSON_GNUC) && (RAPIDJSON_GNUC >= RAPIDJSON_VERSION_CODE(4,3,0)) && defined(__GXX_EXPERIMENTAL_CXX0X__)) || \
(
defined
(
_MSC_VER
)
&&
_MSC_VER
>=
1600
)
...
...
src/brpc/builtin/dir_service.h
View file @
9ad67cdb
...
...
@@ -12,18 +12,12 @@
namespace
brpc
{
class
Server
;
class
DirService
:
public
dir
{
public
:
explicit
DirService
(
Server
*
server
)
:
_server
(
server
)
{}
void
default_method
(
::
google
::
protobuf
::
RpcController
*
cntl_base
,
const
::
brpc
::
DirRequest
*
request
,
::
brpc
::
DirResponse
*
response
,
::
google
::
protobuf
::
Closure
*
done
);
private
:
Server
*
_server
;
};
}
// namespace brpc
...
...
src/brpc/builtin/hotspots_service.cpp
View file @
9ad67cdb
...
...
@@ -254,7 +254,7 @@ static int MakeProfName(ProfilingType type, char* buf, size_t buf_len) {
static
void
ConsumeWaiters
(
ProfilingType
type
,
const
Controller
*
cur_cntl
,
std
::
vector
<
ProfilingWaiter
>*
waiters
)
{
waiters
->
clear
();
if
(
type
>=
(
int
)
arraysize
(
g_env
))
{
if
(
(
int
)
type
>=
(
int
)
arraysize
(
g_env
))
{
LOG
(
ERROR
)
<<
"Invalid type="
<<
type
;
return
;
}
...
...
src/brpc/builtin/sorttable_js.cpp
View file @
9ad67cdb
...
...
@@ -191,7 +191,7 @@ const char* sorttable_js() {
" for (var i=0; i<table.tBodies[0].rows.length; i++) {
\n
"
" text = sorttable.getInnerText(table.tBodies[0].rows[i].cells[column]);
\n
"
" if (text != '') {
\n
"
" if (text.match(/^-?[$]?[
\\
d,.]+%?$/)) {
\n
"
" if (text.match(/^-?[$]?[
\\
d,.]+%?$/)) {
\n
"
" return sorttable.sort_numeric;
\n
"
" }
\n
"
" // check for a date: dd/mm/yyyy or dd/mm/yy
\n
"
...
...
src/brpc/details/http_parser.h
View file @
9ad67cdb
...
...
@@ -64,9 +64,7 @@ typedef unsigned __int64 uint64_t;
namespace
brpc
{
typedef
struct
http_parser
http_parser
;
typedef
struct
http_parser_settings
http_parser_settings
;
struct
http_parser
;
/* Callbacks should return non-zero to indicate an error. The parser will
* then halt execution.
...
...
@@ -201,8 +199,7 @@ enum http_errno {
#define HTTP_PARSER_ERRNO(p) ((enum http_errno) (p)->http_errno)
class
http_parser
{
public
:
struct
http_parser
{
/** PRIVATE **/
unsigned
int
type
:
2
;
/* enum http_parser_type */
unsigned
int
flags
:
6
;
/* F_* values from 'flags' enum; semi-public */
...
...
src/brpc/http_method.cpp
View file @
9ad67cdb
...
...
@@ -60,11 +60,11 @@ struct LessThanByName {
static
void
BuildHttpMethodMaps
()
{
for
(
size_t
i
=
0
;
i
<
ARRAY_SIZE
(
g_method_pairs
);
++
i
)
{
i
f
(
g_method_pairs
[
i
].
method
<
0
||
g_method_pairs
[
i
].
method
>
(
int
)
ARRAY_SIZE
(
g_method2str_map
))
{
i
nt
method
=
(
int
)
g_method_pairs
[
i
].
method
;
if
(
method
<
0
||
method
>
(
int
)
ARRAY_SIZE
(
g_method2str_map
))
{
abort
();
}
g_method2str_map
[
g_method_pairs
[
i
].
method
]
=
g_method_pairs
[
i
].
str
;
g_method2str_map
[
method
]
=
g_method_pairs
[
i
].
str
;
}
std
::
sort
(
g_method_pairs
,
g_method_pairs
+
ARRAY_SIZE
(
g_method_pairs
),
LessThanByName
());
...
...
@@ -82,13 +82,13 @@ static void BuildHttpMethodMaps() {
}
}
const
char
*
HttpMethod2Str
(
HttpMethod
http_
method
)
{
const
char
*
HttpMethod2Str
(
HttpMethod
method
)
{
pthread_once
(
&
g_init_maps_once
,
BuildHttpMethodMaps
);
if
(
http_
method
<
0
||
http_
method
>=
(
int
)
ARRAY_SIZE
(
g_method2str_map
))
{
if
(
(
int
)
method
<
0
||
(
int
)
method
>=
(
int
)
ARRAY_SIZE
(
g_method2str_map
))
{
return
"UNKNOWN"
;
}
const
char
*
s
=
g_method2str_map
[
http_
method
];
const
char
*
s
=
g_method2str_map
[
method
];
return
s
?
s
:
"UNKNOWN"
;
}
...
...
src/brpc/parallel_channel.cpp
View file @
9ad67cdb
...
...
@@ -395,7 +395,11 @@ private:
int
_fail_limit
;
int
_ndone
;
int
_nchan
;
#if defined(__clang__)
int
ALLOW_UNUSED
_memsize
;
#else
int
_memsize
;
#endif
base
::
atomic
<
int
>
_current_fail
;
base
::
atomic
<
uint32_t
>
_current_done
;
Controller
*
_cntl
;
...
...
src/brpc/parse_result.h
View file @
9ad67cdb
...
...
@@ -31,7 +31,7 @@ inline const char* ParseErrorToString(ParseError e) {
return
"unknown ParseError"
;
}
struct
InputMessageBase
;
class
InputMessageBase
;
// A specialized Maybe<> type to represent a parsing result.
class
ParseResult
{
...
...
src/brpc/policy/hasher.h
View file @
9ad67cdb
...
...
@@ -5,7 +5,7 @@
// Date: 2015/06/11 17:46:26
#ifndef BRPC_HASHER_H
#define B
AIDU_P
PC_HASHER_H
#define B
R
PC_HASHER_H
#include <stddef.h>
#include <stdint.h>
...
...
src/brpc/policy/nshead_protocol.cpp
View file @
9ad67cdb
...
...
@@ -45,7 +45,8 @@ void NsheadClosure::DoNotRespond() {
_do_respond
=
false
;
}
struct
DeleteNsheadClosure
{
class
DeleteNsheadClosure
{
public
:
void
operator
()(
NsheadClosure
*
done
)
const
{
done
->~
NsheadClosure
();
free
(
done
);
...
...
src/brpc/policy/rtmp_protocol.cpp
View file @
9ad67cdb
...
...
@@ -85,7 +85,6 @@ const char* messagetype2str(uint8_t t) {
// Unchangable constants required by RTMP
static
const
uint32_t
RTMP_INITIAL_CHUNK_SIZE
=
128
;
static
const
uint8_t
RTMP_DEFAULT_VERSION
=
3
;
static
const
uint8_t
RTMP_MAX_VERSION
=
31
;
static
const
size_t
RTMP_HANDSHAKE_SIZE0
=
1
;
static
const
size_t
RTMP_HANDSHAKE_SIZE1
=
1536
;
static
const
size_t
RTMP_HANDSHAKE_SIZE2
=
RTMP_HANDSHAKE_SIZE1
;
...
...
src/brpc/policy/rtmp_protocol.h
View file @
9ad67cdb
...
...
@@ -229,7 +229,7 @@ class RtmpChunkStream;
// Associated with a RTMP connection.
class
RtmpContext
:
public
Destroyable
{
friend
class
RtmpChunkStream
;
friend
struct
RtmpUnsentMessage
;
friend
class
RtmpUnsentMessage
;
public
:
// States during handshake.
enum
State
{
...
...
src/brpc/server.cpp
View file @
9ad67cdb
...
...
@@ -147,8 +147,6 @@ Server::MethodProperty::MethodProperty()
,
status
(
NULL
)
{
}
static
const
char
*
const
UNKNOWN_STR
=
"unknown"
;
static
timeval
GetUptime
(
void
*
arg
/*start_time*/
)
{
return
base
::
microseconds_to_timeval
(
base
::
cpuwide_time_us
()
-
(
intptr_t
)
arg
);
}
...
...
@@ -494,7 +492,7 @@ int Server::AddBuiltinServices() {
return
-
1
;
}
if
(
FLAGS_enable_dir_service
&&
AddBuiltinService
(
new
(
std
::
nothrow
)
DirService
(
this
)
))
{
AddBuiltinService
(
new
(
std
::
nothrow
)
DirService
))
{
LOG
(
ERROR
)
<<
"Fail to add DirService"
;
return
-
1
;
}
...
...
src/brpc/socket.h
View file @
9ad67cdb
...
...
@@ -509,7 +509,7 @@ friend void DereferenceSocket(Socket*);
// Generic callback for Socket to handle epollout event
static
int
HandleEpollOut
(
SocketId
socket_id
);
struct
EpollOutRequest
;
class
EpollOutRequest
;
// Callback to handle epollout event whose request data
// is `EpollOutRequest'
int
HandleEpollOutRequest
(
int
error_code
,
EpollOutRequest
*
req
);
...
...
src/brpc/ts.cpp
View file @
9ad67cdb
...
...
@@ -90,19 +90,19 @@ static const int TS_PMT_NUMBER = 1;
// Program Association Table(see Table 2-25)
static
const
TsPid
TS_PID_PAT
=
(
TsPid
)
0x00
;
// Conditional Access Table (see Table 2-27)
static
const
TsPid
TS_PID_CAT
=
(
TsPid
)
0x01
;
//
static const TsPid TS_PID_CAT = (TsPid)0x01;
// Transport Stream Description Table
static
const
TsPid
TS_PID_TSDT
=
(
TsPid
)
0x02
;
static
const
TsPid
TS_PID_RESERVED_START
=
(
TsPid
)
0x03
;
static
const
TsPid
TS_PID_RESERVED_END
=
(
TsPid
)
0x0f
;
//
static const TsPid TS_PID_TSDT = (TsPid)0x02;
//
static const TsPid TS_PID_RESERVED_START = (TsPid)0x03;
//
static const TsPid TS_PID_RESERVED_END = (TsPid)0x0f;
// May be assigned as network_PID; Program_map_PID; elementary_PID; or for
// other purposes
static
const
TsPid
TS_PID_APP_START
=
(
TsPid
)
0x10
;
//
static const TsPid TS_PID_APP_START = (TsPid)0x10;
static
const
TsPid
TS_PID_VIDEO_AVC
=
(
TsPid
)
0x100
;
static
const
TsPid
TS_PID_AUDIO_AAC
=
(
TsPid
)
0x101
;
static
const
TsPid
TS_PID_AUDIO_MP3
=
(
TsPid
)
0x102
;
static
const
TsPid
TS_PID_PMT
=
(
TsPid
)
0x1001
;
static
const
TsPid
TS_PID_APP_END
=
(
TsPid
)
0x1ffe
;
//
static const TsPid TS_PID_APP_END = (TsPid)0x1ffe;
static
const
TsPid
TS_PID_NULL
=
(
TsPid
)
0x01FFF
;
// null packets (see Table 2-3)
// The sync_byte is a fixed 8-bit field whose value is '0100 0111' (0x47).
...
...
@@ -1185,7 +1185,7 @@ static const uint8_t cont_nalu_header[] = { 0x00, 0x00, 0x01 };
// 8, SP (SP slice)
// 9, SI (SI slice)
// H.264-AVC-ISO_IEC_14496-10-2012.pdf, page 105.
static
const
uint8_t
aud_nalu_7
[]
=
{
0x09
,
0xf0
};
//
static const uint8_t aud_nalu_7[] = { 0x09, 0xf0};
static
const
uint8_t
fresh_nalu_header_and_aud_nalu_7
[]
=
{
0x00
,
0x00
,
0x00
,
0x01
,
0x09
,
0xf0
};
...
...
src/bthread/execution_queue.h
View file @
9ad67cdb
...
...
@@ -19,7 +19,7 @@ namespace bthread {
template
<
typename
T
>
struct
ExecutionQueueId
;
template
<
typename
T
>
class
ExecutionQueue
;
struct
TaskNode
;
struct
ExecutionQueueBase
;
class
ExecutionQueueBase
;
class
TaskIteratorBase
{
DISALLOW_COPY_AND_ASSIGN
(
TaskIteratorBase
);
...
...
src/bthread/task_meta.h
View file @
9ad67cdb
...
...
@@ -20,7 +20,7 @@ struct TaskStatistics {
int64_t
nswitch
;
};
struct
KeyTable
;
class
KeyTable
;
struct
ButexWaiter
;
struct
LocalStorage
{
...
...
src/bvar/default_variables.cpp
View file @
9ad67cdb
...
...
@@ -527,10 +527,6 @@ public:
RUsageReader::get_field<BVAR_MEMBER_TYPE(&rusage::field), \
offsetof(rusage, field)>, NULL); \
inline
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
timeval
&
tm
)
{
return
os
<<
tm
.
tv_sec
<<
'.'
<<
std
::
setw
(
6
)
<<
std
::
setfill
(
'0'
)
<<
tm
.
tv_usec
;
}
// ======================================
BVAR_DEFINE_PROC_STAT_FIELD2
(
pid
,
"pid"
);
...
...
@@ -746,3 +742,9 @@ PassiveStatus<std::string> g_work_dir("process_work_dir", get_work_dir, NULL);
#undef BVAR_DEFINE_RUSAGE_FIELD2
}
// namespace bvar
// In the same scope where timeval is defined. Required by clang.
inline
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
timeval
&
tm
)
{
return
os
<<
tm
.
tv_sec
<<
'.'
<<
std
::
setw
(
6
)
<<
std
::
setfill
(
'0'
)
<<
tm
.
tv_usec
;
}
src/bvar/detail/percentile.cpp
View file @
9ad67cdb
...
...
@@ -23,7 +23,7 @@ inline uint32_t ones32(uint32_t x) {
}
inline
uint32_t
log2
(
uint32_t
x
)
{
register
int
y
=
(
x
&
(
x
-
1
));
int
y
=
(
x
&
(
x
-
1
));
y
|=
-
y
;
y
>>=
31
;
x
|=
(
x
>>
1
);
...
...
src/bvar/variable.cpp
View file @
9ad67cdb
...
...
@@ -51,8 +51,6 @@ DEFINE_bool(bvar_log_dumpped, false,
const
size_t
SUB_MAP_COUNT
=
32
;
// must be power of 2
BAIDU_CASSERT
(
!
(
SUB_MAP_COUNT
&
(
SUB_MAP_COUNT
-
1
)),
must_be_power_of_2
);
const
size_t
MAX_CONFLICT_NAME
=
128
;
class
VarEntry
{
public
:
VarEntry
()
:
var
(
NULL
),
display_filter
(
DISPLAY_ON_ALL
)
{}
...
...
test/brpc_builtin_service_unittest.cpp
View file @
9ad67cdb
...
...
@@ -674,7 +674,7 @@ TEST_F(BuiltinServiceTest, pprof) {
}
TEST_F
(
BuiltinServiceTest
,
dir
)
{
brpc
::
DirService
service
(
&
_server
)
;
brpc
::
DirService
service
;
brpc
::
DirRequest
req
;
brpc
::
DirResponse
res
;
{
...
...
test/cancellation_flag_unittest.cc
View file @
9ad67cdb
...
...
@@ -16,16 +16,6 @@ namespace base {
namespace
{
//------------------------------------------------------------------------------
// Define our test class.
//------------------------------------------------------------------------------
void
CancelHelper
(
CancellationFlag
*
flag
)
{
#if GTEST_HAS_DEATH_TEST
ASSERT_DEBUG_DEATH
(
flag
->
Set
(),
""
);
#endif
}
TEST
(
CancellationFlagTest
,
SimpleSingleThreadedTest
)
{
CancellationFlag
flag
;
ASSERT_FALSE
(
flag
.
IsSet
());
...
...
test/condition_variable_unittest.cc
View file @
9ad67cdb
...
...
@@ -191,7 +191,7 @@ TEST_F(ConditionVariableTest, TimeoutTest) {
#if defined(OS_POSIX)
const
int
kDiscontinuitySeconds
=
2
;
void
BackInTime
(
Lock
*
lock
)
{
void
ALLOW_UNUSED
BackInTime
(
Lock
*
lock
)
{
AutoLock
auto_lock
(
*
lock
);
timeval
tv
;
...
...
test/path_service_unittest.cc
View file @
9ad67cdb
...
...
@@ -25,7 +25,7 @@ namespace {
// Returns true if PathService::Get returns true and sets the path parameter
// to non-empty for the given PathService::DirType enumeration value.
bool
ReturnsValidPath
(
int
dir_type
)
{
bool
ALLOW_UNUSED
ReturnsValidPath
(
int
dir_type
)
{
base
::
FilePath
path
;
bool
result
=
PathService
::
Get
(
dir_type
,
&
path
);
...
...
test/temp_file_unittest.cpp
View file @
9ad67cdb
...
...
@@ -119,7 +119,7 @@ struct test_t {
TEST_F
(
TempFileTest
,
save_binary_twice
)
{
test_t
data
=
{
12
,
-
34
,
'B'
,
'E'
,
'E'
,
'F'
};
test_t
data
=
{
12
,
-
34
,
{
'B'
,
'E'
,
'E'
,
'F'
}
};
base
::
TempFile
tmp
;
ASSERT_EQ
(
0
,
tmp
.
save_bin
(
&
data
,
sizeof
(
data
)));
...
...
@@ -133,7 +133,7 @@ TEST_F(TempFileTest, save_binary_twice)
ASSERT_EQ
(
0
,
memcmp
(
&
data
,
&
act_data
,
sizeof
(
data
)));
// save twice
test_t
data2
=
{
89
,
1000
,
'E'
,
'C'
,
'A'
,
'Z'
};
test_t
data2
=
{
89
,
1000
,
{
'E'
,
'C'
,
'A'
,
'Z'
}
};
ASSERT_EQ
(
0
,
tmp
.
save_bin
(
&
data2
,
sizeof
(
data2
)));
fp
=
fopen
(
tmp
.
fname
(),
"r"
);
...
...
test/type_traits_unittest.cc
View file @
9ad67cdb
...
...
@@ -18,7 +18,7 @@ struct BStruct {
int
x
;
};
class
BClass
{
int
_x
;
int
ALLOW_UNUSED
_x
;
};
class
Parent
{};
...
...
tools/print_gcc_version.cc
View file @
9ad67cdb
#include <stdio.h>
int
main
()
{
#if defined(__GNUC__)
#if defined(__clang__)
const
int
major_v
=
__GNUC__
;
int
minor_v
=
__GNUC_MINOR__
;
if
(
major_v
==
4
&&
minor_v
<=
8
)
{
// Make version of clang >= 4.8 so that it's not rejected by config_brpc.sh
minor_v
=
8
;
}
printf
(
"%d
\n
"
,
(
major_v
*
10000
+
minor_v
*
100
));
#elif defined(__GNUC__)
printf
(
"%d
\n
"
,
(
__GNUC__
*
10000
+
__GNUC_MINOR__
*
100
+
__GNUC_PATCHLEVEL__
));
#else
printf
(
"0
\n
"
);
...
...
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