MCPcopy Create free account
hub / github.com/NetHack/NetHack / cmdq_add_int

Function cmdq_add_int

src/cmd.c:334–351  ·  view source on GitHub ↗

add integer to the command queue */

Source from the content-addressed store, hash-verified

332
333/* add integer to the command queue */
334void
335cmdq_add_int(int q, int val)
336{
337 struct _cmd_queue *tmp = (struct _cmd_queue *) alloc(sizeof *tmp);
338 struct _cmd_queue *cq = gc.command_queue[q];
339
340 tmp->typ = CMDQ_INT;
341 tmp->intval = val;
342 tmp->next = NULL;
343
344 while (cq && cq->next)
345 cq = cq->next;
346
347 if (cq)
348 cq->next = tmp;
349 else
350 gc.command_queue[q] = tmp;
351}
352
353/* shift the last entry in command queue to first */
354void

Callers 1

getobjFunction · 0.85

Calls 1

allocFunction · 0.70

Tested by

no test coverage detected