Mercurial > hg > orthanc
comparison OrthancServer/LuaScripting.cpp @ 1545:33d34bc4ac15
fix msvc warnings
author | jodogne |
---|---|
date | Thu, 13 Aug 2015 21:02:31 +0200 |
parents | f967bdf8534e |
children | 3232f1c995a5 |
comparison
equal
deleted
inserted
replaced
1544:4d0e2c38d15b | 1545:33d34bc4ac15 |
---|---|
79 lua_pushnil(state); | 79 lua_pushnil(state); |
80 return 1; | 80 return 1; |
81 } | 81 } |
82 | 82 |
83 const char* uri = lua_tostring(state, 1); | 83 const char* uri = lua_tostring(state, 1); |
84 bool builtin = (nArgs == 2 ? lua_toboolean(state, 2) : false); | 84 bool builtin = (nArgs == 2 ? lua_toboolean(state, 2) != 0 : false); |
85 | 85 |
86 std::string result; | 86 std::string result; |
87 if (HttpToolbox::SimpleGet(result, serverContext->GetHttpHandler().RestrictToOrthancRestApi(builtin), uri)) | 87 if (HttpToolbox::SimpleGet(result, serverContext->GetHttpHandler().RestrictToOrthancRestApi(builtin), uri)) |
88 { | 88 { |
89 lua_pushlstring(state, result.c_str(), result.size()); | 89 lua_pushlstring(state, result.c_str(), result.size()); |
122 } | 122 } |
123 | 123 |
124 const char* uri = lua_tostring(state, 1); | 124 const char* uri = lua_tostring(state, 1); |
125 size_t bodySize = 0; | 125 size_t bodySize = 0; |
126 const char* bodyData = lua_tolstring(state, 2, &bodySize); | 126 const char* bodyData = lua_tolstring(state, 2, &bodySize); |
127 bool builtin = (nArgs == 3 ? lua_toboolean(state, 3) : false); | 127 bool builtin = (nArgs == 3 ? lua_toboolean(state, 3) != 0 : false); |
128 | 128 |
129 std::string result; | 129 std::string result; |
130 if (isPost ? | 130 if (isPost ? |
131 HttpToolbox::SimplePost(result, serverContext->GetHttpHandler().RestrictToOrthancRestApi(builtin), | 131 HttpToolbox::SimplePost(result, serverContext->GetHttpHandler().RestrictToOrthancRestApi(builtin), |
132 uri, bodyData, bodySize) : | 132 uri, bodyData, bodySize) : |
180 lua_pushnil(state); | 180 lua_pushnil(state); |
181 return 1; | 181 return 1; |
182 } | 182 } |
183 | 183 |
184 const char* uri = lua_tostring(state, 1); | 184 const char* uri = lua_tostring(state, 1); |
185 bool builtin = (nArgs == 2 ? lua_toboolean(state, 2) : false); | 185 bool builtin = (nArgs == 2 ? lua_toboolean(state, 2) != 0 : false); |
186 | 186 |
187 if (HttpToolbox::SimpleDelete(serverContext->GetHttpHandler().RestrictToOrthancRestApi(builtin), uri)) | 187 if (HttpToolbox::SimpleDelete(serverContext->GetHttpHandler().RestrictToOrthancRestApi(builtin), uri)) |
188 { | 188 { |
189 lua_pushboolean(state, 1); | 189 lua_pushboolean(state, 1); |
190 } | 190 } |