From ee61dfe08742b76b1c637a038dd5b3a6b244ece7 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 11 Aug 2015 22:57:47 +0200 Subject: [PATCH] protocol/ArgParser: use std::numeric_limits Using unsigned(-1) renders undefined behavior. --- src/protocol/ArgParser.cxx | 2 -- src/protocol/ArgParser.hxx | 4 +++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/protocol/ArgParser.cxx b/src/protocol/ArgParser.cxx index 2c3e21f79..1dbbd0cf3 100644 --- a/src/protocol/ArgParser.cxx +++ b/src/protocol/ArgParser.cxx @@ -22,8 +22,6 @@ #include "Result.hxx" #include "Chrono.hxx" -#include - #include bool diff --git a/src/protocol/ArgParser.hxx b/src/protocol/ArgParser.hxx index d71894771..221ffebe3 100644 --- a/src/protocol/ArgParser.hxx +++ b/src/protocol/ArgParser.hxx @@ -22,6 +22,8 @@ #include "check.h" +#include + #include class Client; @@ -39,7 +41,7 @@ struct RangeArg { void SetAll() { start = 0; - end = unsigned(-1); + end = std::numeric_limits::max(); } };