Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
L
libzmq
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
libzmq
Commits
be81dcd4
Commit
be81dcd4
authored
Aug 09, 2018
by
Simon Giesecke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use std::min/max where possible
parent
3cb77e42
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
6 deletions
+4
-6
pipe.cpp
src/pipe.cpp
+2
-2
stream_engine.cpp
src/stream_engine.cpp
+1
-3
timers.cpp
src/timers.cpp
+1
-1
No files found.
src/pipe.cpp
View file @
be81dcd4
...
...
@@ -520,8 +520,8 @@ void zmq::pipe_t::hiccup ()
void
zmq
::
pipe_t
::
set_hwms
(
int
inhwm_
,
int
outhwm_
)
{
int
in
=
inhwm_
+
(
_in_hwm_boost
>
0
?
_in_hwm_boost
:
0
);
int
out
=
outhwm_
+
(
_out_hwm_boost
>
0
?
_out_hwm_boost
:
0
);
int
in
=
inhwm_
+
std
::
max
(
_in_hwm_boost
,
0
);
int
out
=
outhwm_
+
std
::
max
(
_out_hwm_boost
,
0
);
// if either send or recv side has hwm <= 0 it means infinite so we should set hwms infinite
if
(
inhwm_
<=
0
||
_in_hwm_boost
==
0
)
...
...
src/stream_engine.cpp
View file @
be81dcd4
...
...
@@ -1158,9 +1158,7 @@ int zmq::stream_engine_t::process_heartbeat_message (msg_t *msg_)
// Given the engine goes straight to out_event, sequential PINGs will
// not be a problem.
const
size_t
context_len
=
msg_
->
size
()
-
ping_ttl_len
>
ping_max_ctx_len
?
ping_max_ctx_len
:
msg_
->
size
()
-
ping_ttl_len
;
std
::
min
(
msg_
->
size
()
-
ping_ttl_len
,
ping_max_ctx_len
);
const
int
rc
=
_pong_msg
.
init_size
(
msg_t
::
ping_cmd_name_size
+
context_len
);
errno_assert
(
rc
==
0
);
...
...
src/timers.cpp
View file @
be81dcd4
...
...
@@ -144,7 +144,7 @@ long zmq::timers_t::timeout ()
for
(;
it
!=
end
;
++
it
)
{
if
(
0
==
_cancelled_timers
.
erase
(
it
->
second
.
timer_id
))
{
// Live timer, lets return the timeout
res
=
it
->
first
>
now
?
static_cast
<
long
>
(
it
->
first
-
now
)
:
0
;
res
=
std
::
max
(
static_cast
<
long
>
(
it
->
first
-
now
),
0l
)
;
break
;
}
}
...
...
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