MCPcopy Create free account
hub / github.com/BernardoGiordano/Checkpoint / intAt

Method intAt

common/script/scriptargs.cpp:81–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

79}
80
81int ScriptArgs::intAt(int i) const
82{
83 struct Value* value = at(i);
84 // The Value carries the type from the prototype, so a mismatch here means
85 // the binding and its declaration disagree — a Checkpoint bug that used to
86 // read a pointer as an int and abort somewhere else entirely.
87 if (value->Typ == nullptr || value->Typ->Base != TypeInt) {
88 fail("argument %d is declared %s, read as int", i + 1, value->Typ != nullptr ? baseName(value->Typ->Base) : "untyped");
89 }
90 return value->Val->Integer;
91}
92
93void* ScriptArgs::ptrAt(int i, bool allowNull) const
94{

Callers

nothing calls this directly

Calls 2

atFunction · 0.85
baseNameFunction · 0.85

Tested by

no test coverage detected