Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/miloyip/rapidjson.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Trushin <konstantin.trushin@gmail.com>2016-03-13 14:07:39 +0300
committerKonstantin Trushin <konstantin.trushin@gmail.com>2016-03-13 14:07:39 +0300
commit305882489c1d59de91b4abf311a3324abbcad972 (patch)
treef49b821006d5d5b33963b671d2bc0710c1533184 /include/rapidjson/pointer.h
parentd454d21409a72b8736f3a5927d0f6f2fde8f4a45 (diff)
do potentially precision-losing conversions explicitly
Diffstat (limited to 'include/rapidjson/pointer.h')
-rw-r--r--include/rapidjson/pointer.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/rapidjson/pointer.h b/include/rapidjson/pointer.h
index eddeab42..94449381 100644
--- a/include/rapidjson/pointer.h
+++ b/include/rapidjson/pointer.h
@@ -987,11 +987,11 @@ private:
src_++;
Ch c = 0;
for (int j = 0; j < 2; j++) {
- c <<= 4;
+ c = static_cast<Ch>(c << 4);
Ch h = *src_;
- if (h >= '0' && h <= '9') c += h - '0';
- else if (h >= 'A' && h <= 'F') c += h - 'A' + 10;
- else if (h >= 'a' && h <= 'f') c += h - 'a' + 10;
+ if (h >= '0' && h <= '9') c = static_cast<Ch>(c + h - '0');
+ else if (h >= 'A' && h <= 'F') c = static_cast<Ch>(c + h - 'A' + 10);
+ else if (h >= 'a' && h <= 'f') c = static_cast<Ch>(c + h - 'a' + 10);
else {
valid_ = false;
return 0;