MCPcopy Create free account
hub / github.com/DFHack/dfhack / queue_globals

Method queue_globals

plugins/devel/check-structures-sanity/dispatch.cpp:107–138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

105}
106
107void Checker::queue_globals()
108{
109 auto fields = df::global::_identity.getFields();
110 for (auto field = fields; field->mode != struct_field_info::END; field++)
111 {
112 if (!field->offset)
113 {
114 UNEXPECTED;
115 continue;
116 }
117
118 // offset is the position of the DFHack pointer to this global.
119 auto ptr = *reinterpret_cast<const void **>(field->offset);
120
121 QueueItem item(fmt::format("df.global.{}", field->name), ptr);
122 CheckedStructure cs(field);
123
124 if (!ptr)
125 {
126 FAIL("unknown global address");
127 continue;
128 }
129
130 if (!strcmp(field->name, "enabler"))
131 {
132 // don't care about libgraphics as we have the source code
133 continue;
134 }
135
136 queue_item(item, cs);
137 }
138}
139
140bool Checker::process_queue()
141{

Callers 1

commandFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected