MCPcopy Create free account
hub / github.com/JACoders/OpenJK / Com_PushEvent

Function Com_PushEvent

code/qcommon/common.cpp:763–787  ·  view source on GitHub ↗

================= Com_PushEvent ================= */

Source from the content-addressed store, hash-verified

761=================
762*/
763void Com_PushEvent( sysEvent_t *event ) {
764 sysEvent_t *ev;
765 static int printedWarning;
766
767 ev = &com_pushedEvents[ com_pushedEventsHead & (MAX_PUSHED_EVENTS-1) ];
768
769 if ( com_pushedEventsHead - com_pushedEventsTail >= MAX_PUSHED_EVENTS ) {
770
771 // don't print the warning constantly, or it can give time for more...
772 if ( !printedWarning ) {
773 printedWarning = qtrue;
774 Com_Printf( "WARNING: Com_PushEvent overflow\n" );
775 }
776
777 if ( ev->evPtr ) {
778 Z_Free( ev->evPtr );
779 }
780 com_pushedEventsTail++;
781 } else {
782 printedWarning = qfalse;
783 }
784
785 *ev = *event;
786 com_pushedEventsHead++;
787}
788
789/*
790=================

Callers 1

Com_MillisecondsFunction · 0.70

Calls 2

Com_PrintfFunction · 0.70
Z_FreeFunction · 0.70

Tested by

no test coverage detected