X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=folly%2FFormatArg.h;h=48311e3d4e7cd18a77aeacb553dd0d4c98fc7ee9;hb=dc1c3dcc04baa70029d16351d4424af4a7ef4385;hp=701654b3397453a8a59e7c924c0a6ff08ff858dc;hpb=b62a976d20c5c5b186a9888a34e8557ee59f046d;p=folly.git diff --git a/folly/FormatArg.h b/folly/FormatArg.h index 701654b3..48311e3d 100644 --- a/folly/FormatArg.h +++ b/folly/FormatArg.h @@ -1,5 +1,5 @@ /* - * Copyright 2016 Facebook, Inc. + * Copyright 2017 Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -243,10 +243,10 @@ inline StringPiece FormatArg::doSplitKey() { const char* p; if (e[-1] == ']') { --e; - p = static_cast(memchr(b, '[', e - b)); - enforce(p, "unmatched ']'"); + p = static_cast(memchr(b, '[', size_t(e - b))); + enforce(p != nullptr, "unmatched ']'"); } else { - p = static_cast(memchr(b, '.', e - b)); + p = static_cast(memchr(b, '.', size_t(e - b))); } if (p) { key_.assign(p + 1, e); @@ -267,7 +267,7 @@ inline int FormatArg::splitIntKey() { } try { return to(doSplitKey()); - } catch (const std::out_of_range& e) { + } catch (const std::out_of_range&) { error("integer key required"); return 0; // unreached }