| 2251 | } |
| 2252 | |
| 2253 | const char* Executor::GetResult() |
| 2254 | { |
| 2255 | if(!codeRunning && genStackSize > (lastResultType == -1 ? 1 : 0)) |
| 2256 | { |
| 2257 | strcpy(execResult, "There is more than one value on the stack"); |
| 2258 | return execResult; |
| 2259 | } |
| 2260 | |
| 2261 | switch(lastResultType) |
| 2262 | { |
| 2263 | case OTYPE_DOUBLE: |
| 2264 | SafeSprintf(execResult, 64, "%f", lastResultDouble); |
| 2265 | break; |
| 2266 | case OTYPE_LONG: |
| 2267 | SafeSprintf(execResult, 64, "%lldL", lastResultLong); |
| 2268 | break; |
| 2269 | case OTYPE_INT: |
| 2270 | SafeSprintf(execResult, 64, "%d", lastResultInt); |
| 2271 | break; |
| 2272 | default: |
| 2273 | SafeSprintf(execResult, 64, "no return value"); |
| 2274 | break; |
| 2275 | } |
| 2276 | return execResult; |
| 2277 | } |
| 2278 | int Executor::GetResultInt() |
| 2279 | { |
| 2280 | assert(lastResultType == OTYPE_INT); |
no test coverage detected