MCPcopy Create free account
hub / github.com/ZDoom/Raze / CCMD

Function CCMD

source/common/console/c_expr.cpp:723–752  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

721//==========================================================================
722
723CCMD (test)
724{
725 int parsept = 1;
726 FProduction *prod = ParseExpression (argv, parsept);
727
728 if (prod == NULL || parsept >= argv.argc())
729 {
730 Printf ("Usage: test <expr> <true cmd> [false cmd]\n");
731 }
732 else
733 {
734 if (prod->Type == PROD_String)
735 {
736 prod = StringToDouble (prod);
737 }
738
739 if (static_cast<FDoubleProd *>(prod)->Value != 0.0)
740 {
741 AddCommandString (argv[parsept]);
742 }
743 else if (++parsept < argv.argc())
744 {
745 AddCommandString (argv[parsept]);
746 }
747 }
748 if (prod != NULL)
749 {
750 M_Free (prod);
751 }
752}
753
754//==========================================================================
755//

Callers

nothing calls this directly

Calls 8

ParseExpressionFunction · 0.85
PrintfFunction · 0.85
StringToDoubleFunction · 0.85
AddCommandStringFunction · 0.85
M_FreeFunction · 0.85
FindCVarFunction · 0.85
argcMethod · 0.80
SetGenericRepMethod · 0.80

Tested by

no test coverage detected