Mercurial > hg > orthanc
comparison OrthancServer/OrthancRestApi/OrthancRestResources.cpp @ 1847:559956d5ceb2
cppcheck
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 30 Nov 2015 15:34:14 +0100 |
parents | 3ae2ff249675 |
children | 4e7c318a3f69 |
comparison
equal
deleted
inserted
replaced
1846:3dcf5c0734c9 | 1847:559956d5ceb2 |
---|---|
357 bool ok = false; | 357 bool ok = false; |
358 | 358 |
359 try | 359 try |
360 { | 360 { |
361 quality_ = boost::lexical_cast<unsigned int>(v); | 361 quality_ = boost::lexical_cast<unsigned int>(v); |
362 ok = (quality_ >= 0 && quality_ <= 100); | 362 ok = (quality_ >= 1 && quality_ <= 100); |
363 } | 363 } |
364 catch (boost::bad_lexical_cast&) | 364 catch (boost::bad_lexical_cast&) |
365 { | 365 { |
366 } | 366 } |
367 | 367 |
1095 } | 1095 } |
1096 | 1096 |
1097 size_t limit = 0; | 1097 size_t limit = 0; |
1098 if (request.isMember("Limit")) | 1098 if (request.isMember("Limit")) |
1099 { | 1099 { |
1100 limit = request["CaseSensitive"].asInt(); | 1100 int tmp = request["CaseSensitive"].asInt(); |
1101 if (limit < 0) | 1101 if (tmp < 0) |
1102 { | 1102 { |
1103 throw OrthancException(ErrorCode_ParameterOutOfRange); | 1103 throw OrthancException(ErrorCode_ParameterOutOfRange); |
1104 } | 1104 } |
1105 | |
1106 limit = static_cast<size_t>(tmp); | |
1105 } | 1107 } |
1106 | 1108 |
1107 std::string level = request["Level"].asString(); | 1109 std::string level = request["Level"].asString(); |
1108 | 1110 |
1109 LookupResource query(StringToResourceType(level.c_str())); | 1111 LookupResource query(StringToResourceType(level.c_str())); |