MCPcopy Create free account
hub / github.com/WheretIB/nullc / GetResult

Method GetResult

NULLC/Executor.cpp:2253–2277  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2251}
2252
2253const 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}
2278int Executor::GetResultInt()
2279{
2280 assert(lastResultType == OTYPE_INT);

Callers 1

nullcGetResultFunction · 0.45

Calls 1

SafeSprintfFunction · 0.70

Tested by

no test coverage detected