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
50aaa985
Commit
50aaa985
authored
May 21, 2019
by
gejun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix typos
parent
760c9473
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
14 additions
and
19 deletions
+14
-19
baidu_rpc_protocol.cpp
src/brpc/policy/baidu_rpc_protocol.cpp
+1
-2
hulu_pbrpc_protocol.cpp
src/brpc/policy/hulu_pbrpc_protocol.cpp
+1
-2
sofa_pbrpc_protocol.cpp
src/brpc/policy/sofa_pbrpc_protocol.cpp
+1
-2
streaming_rpc_protocol.cpp
src/brpc/policy/streaming_rpc_protocol.cpp
+1
-2
rpc_dump.cpp
src/brpc/rpc_dump.cpp
+1
-2
bthread_execution_queue_unittest.cpp
test/bthread_execution_queue_unittest.cpp
+9
-9
No files found.
src/brpc/policy/baidu_rpc_protocol.cpp
View file @
50aaa985
...
...
@@ -59,8 +59,7 @@ DEFINE_bool(baidu_protocol_use_fullname, true,
// Pack header into `buf'
inline
void
PackRpcHeader
(
char
*
rpc_header
,
int
meta_size
,
int
payload_size
)
{
// supress strict-aliasing warning.
uint32_t
*
dummy
=
(
uint32_t
*
)
rpc_header
;
uint32_t
*
dummy
=
(
uint32_t
*
)
rpc_header
;
// suppress strict-alias warning
*
dummy
=
*
(
uint32_t
*
)
"PRPC"
;
butil
::
RawPacker
(
rpc_header
+
4
)
.
pack32
(
meta_size
+
payload_size
)
...
...
src/brpc/policy/hulu_pbrpc_protocol.cpp
View file @
50aaa985
...
...
@@ -142,8 +142,7 @@ private:
};
inline
void
PackHuluHeader
(
char
*
hulu_header
,
int
meta_size
,
int
body_size
)
{
// dummy supresses strict-aliasing warning.
uint32_t
*
dummy
=
reinterpret_cast
<
uint32_t
*>
(
hulu_header
);
uint32_t
*
dummy
=
reinterpret_cast
<
uint32_t
*>
(
hulu_header
);
// suppress strict-alias warning
*
dummy
=
*
reinterpret_cast
<
const
uint32_t
*>
(
"HULU"
);
HuluRawPacker
rp
(
hulu_header
+
4
);
rp
.
pack32
(
meta_size
+
body_size
).
pack32
(
meta_size
);
...
...
src/brpc/policy/sofa_pbrpc_protocol.cpp
View file @
50aaa985
...
...
@@ -128,8 +128,7 @@ private:
};
inline
void
PackSofaHeader
(
char
*
sofa_header
,
int
meta_size
,
int
body_size
)
{
// dummy supresses strict-aliasing warning.
uint32_t
*
dummy
=
reinterpret_cast
<
uint32_t
*>
(
sofa_header
);
uint32_t
*
dummy
=
reinterpret_cast
<
uint32_t
*>
(
sofa_header
);
// suppress strict-alias warning
*
dummy
=
*
reinterpret_cast
<
const
uint32_t
*>
(
"SOFA"
);
SofaRawPacker
rp
(
sofa_header
+
4
);
...
...
src/brpc/policy/streaming_rpc_protocol.cpp
View file @
50aaa985
...
...
@@ -43,8 +43,7 @@ void PackStreamMessage(butil::IOBuf* out,
const
uint32_t
data_length
=
data
?
data
->
length
()
:
0
;
const
uint32_t
meta_length
=
fm
.
ByteSize
();
char
head
[
12
];
// dummy supresses strict-aliasing warning.
uint32_t
*
dummy
=
(
uint32_t
*
)
head
;
uint32_t
*
dummy
=
(
uint32_t
*
)
head
;
// suppresses strict-alias warning
*
(
uint32_t
*
)
dummy
=
*
(
const
uint32_t
*
)
"STRM"
;
butil
::
RawPacker
(
head
+
4
)
.
pack32
(
data_length
+
meta_length
)
...
...
src/brpc/rpc_dump.cpp
View file @
50aaa985
...
...
@@ -247,8 +247,7 @@ bool RpcDumpContext::Serialize(butil::IOBuf& buf, SampledRequest* sample) {
const
size_t
meta_size
=
buf
.
size
()
-
starting_size
;
buf
.
append
(
sample
->
request
);
// dummy supresses strict-aliasing warning.
uint32_t
*
dummy
=
(
uint32_t
*
)
rpc_header
;
uint32_t
*
dummy
=
(
uint32_t
*
)
rpc_header
;
// suppress strict-alias warning
*
dummy
=
*
(
uint32_t
*
)
"PRPC"
;
butil
::
RawPacker
(
rpc_header
+
4
)
.
pack32
(
meta_size
+
sample
->
request
.
size
())
...
...
test/bthread_execution_queue_unittest.cpp
View file @
50aaa985
...
...
@@ -124,7 +124,7 @@ void* push_thread_which_addresses_execq(void *arg) {
TEST_F
(
ExecutionQueueTest
,
performance
)
{
pthread_t
threads
[
8
];
bthread
::
ExecutionQueueId
<
LongIntTask
>
queue_id
=
{
0
};
// to sup
ress warn
s
bthread
::
ExecutionQueueId
<
LongIntTask
>
queue_id
=
{
0
};
// to sup
press warning
s
bthread
::
ExecutionQueueOptions
options
;
int64_t
result
=
0
;
ASSERT_EQ
(
0
,
bthread
::
execution_queue_start
(
&
queue_id
,
&
options
,
...
...
@@ -220,7 +220,7 @@ int add_with_suspend(void* meta, bthread::TaskIterator<LongIntTask>& iter) {
TEST_F
(
ExecutionQueueTest
,
execute_urgent
)
{
g_should_be_urgent
=
false
;
pthread_t
threads
[
10
];
bthread
::
ExecutionQueueId
<
LongIntTask
>
queue_id
=
{
0
};
// to sup
ress warn
s
bthread
::
ExecutionQueueId
<
LongIntTask
>
queue_id
=
{
0
};
// to sup
press warning
s
bthread
::
ExecutionQueueOptions
options
;
int64_t
result
=
0
;
ASSERT_EQ
(
0
,
bthread
::
execution_queue_start
(
&
queue_id
,
&
options
,
...
...
@@ -262,7 +262,7 @@ TEST_F(ExecutionQueueTest, execute_urgent) {
TEST_F
(
ExecutionQueueTest
,
urgent_task_is_the_last_task
)
{
g_should_be_urgent
=
false
;
g_suspending
=
false
;
bthread
::
ExecutionQueueId
<
LongIntTask
>
queue_id
=
{
0
};
// to sup
ress warn
s
bthread
::
ExecutionQueueId
<
LongIntTask
>
queue_id
=
{
0
};
// to sup
press warning
s
bthread
::
ExecutionQueueOptions
options
;
int64_t
result
=
0
;
ASSERT_EQ
(
0
,
bthread
::
execution_queue_start
(
&
queue_id
,
&
options
,
...
...
@@ -319,7 +319,7 @@ int check_order(void* meta, bthread::TaskIterator<LongIntTask>& iter) {
TEST_F
(
ExecutionQueueTest
,
multi_threaded_order
)
{
memset
(
next_task
,
0
,
sizeof
(
next_task
));
long
disorder_times
=
0
;
bthread
::
ExecutionQueueId
<
LongIntTask
>
queue_id
=
{
0
};
// to sup
ress warn
s
bthread
::
ExecutionQueueId
<
LongIntTask
>
queue_id
=
{
0
};
// to sup
press warning
s
bthread
::
ExecutionQueueOptions
options
;
ASSERT_EQ
(
0
,
bthread
::
execution_queue_start
(
&
queue_id
,
&
options
,
check_order
,
&
disorder_times
));
...
...
@@ -346,7 +346,7 @@ int check_running_thread(void* arg, bthread::TaskIterator<LongIntTask>& iter) {
TEST_F
(
ExecutionQueueTest
,
in_place_task
)
{
pthread_t
thread_id
=
pthread_self
();
bthread
::
ExecutionQueueId
<
LongIntTask
>
queue_id
=
{
0
};
// to sup
ress warn
s
bthread
::
ExecutionQueueId
<
LongIntTask
>
queue_id
=
{
0
};
// to sup
press warning
s
bthread
::
ExecutionQueueOptions
options
;
ASSERT_EQ
(
0
,
bthread
::
execution_queue_start
(
&
queue_id
,
&
options
,
check_running_thread
,
...
...
@@ -434,7 +434,7 @@ void* inplace_push_thread(void* arg) {
TEST_F
(
ExecutionQueueTest
,
inplace_and_order
)
{
memset
(
next_task
,
0
,
sizeof
(
next_task
));
long
disorder_times
=
0
;
bthread
::
ExecutionQueueId
<
LongIntTask
>
queue_id
=
{
0
};
// to sup
ress warn
s
bthread
::
ExecutionQueueId
<
LongIntTask
>
queue_id
=
{
0
};
// to sup
press warning
s
bthread
::
ExecutionQueueOptions
options
;
ASSERT_EQ
(
0
,
bthread
::
execution_queue_start
(
&
queue_id
,
&
options
,
check_order
,
&
disorder_times
));
...
...
@@ -476,7 +476,7 @@ int add_with_suspend2(void* meta, bthread::TaskIterator<LongIntTask>& iter) {
}
TEST_F
(
ExecutionQueueTest
,
cancel
)
{
bthread
::
ExecutionQueueId
<
LongIntTask
>
queue_id
=
{
0
};
// to sup
ress warn
s
bthread
::
ExecutionQueueId
<
LongIntTask
>
queue_id
=
{
0
};
// to sup
press warning
s
bthread
::
ExecutionQueueOptions
options
;
int64_t
result
=
0
;
ASSERT_EQ
(
0
,
bthread
::
execution_queue_start
(
&
queue_id
,
&
options
,
...
...
@@ -517,7 +517,7 @@ int cancel_self(void* /*meta*/, bthread::TaskIterator<CancelSelf*>& iter) {
}
TEST_F
(
ExecutionQueueTest
,
cancel_self
)
{
bthread
::
ExecutionQueueId
<
CancelSelf
*>
queue_id
=
{
0
};
// to sup
ress warn
s
bthread
::
ExecutionQueueId
<
CancelSelf
*>
queue_id
=
{
0
};
// to sup
press warning
s
bthread
::
ExecutionQueueOptions
options
;
ASSERT_EQ
(
0
,
bthread
::
execution_queue_start
(
&
queue_id
,
&
options
,
cancel_self
,
NULL
));
...
...
@@ -665,7 +665,7 @@ int add_with_suspend3(void* meta, bthread::TaskIterator<LongIntTask>& iter) {
TEST_F
(
ExecutionQueueTest
,
cancel_unexecuted_high_priority_task
)
{
g_should_be_urgent
=
false
;
bthread
::
ExecutionQueueId
<
LongIntTask
>
queue_id
=
{
0
};
// to sup
ress warn
s
bthread
::
ExecutionQueueId
<
LongIntTask
>
queue_id
=
{
0
};
// to sup
press warning
s
bthread
::
ExecutionQueueOptions
options
;
int64_t
result
=
0
;
ASSERT_EQ
(
0
,
bthread
::
execution_queue_start
(
&
queue_id
,
&
options
,
...
...
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