src/SDL12_compat.c
changeset 99 db10b95d4059
parent 98 55027ad695d6
child 100 6384c83ea0e8
     1.1 --- a/src/SDL12_compat.c	Fri Mar 01 23:54:52 2019 -0500
     1.2 +++ b/src/SDL12_compat.c	Sat Mar 02 08:19:49 2019 -0500
     1.3 @@ -1314,8 +1314,9 @@
     1.4  
     1.5      SDL_PumpEvents();  /* this will run our filter and build our 1.2 queue. */
     1.6  
     1.7 -    if (EventQueueHead == NULL)
     1.8 +    if (EventQueueHead == NULL) {
     1.9          return 0;  /* no events at the moment. */
    1.10 +    }
    1.11  
    1.12      SDL_memcpy(event12, &EventQueueHead->event12, sizeof (SDL12_Event));
    1.13      next = EventQueueHead->next;
    1.14 @@ -1333,17 +1334,21 @@
    1.15  SDL_PushEvent(SDL12_Event *event12)
    1.16  {
    1.17      EventQueueType *item = EventQueueAvailable;
    1.18 -    if (item == NULL)
    1.19 +    if (item == NULL) {
    1.20          return -1;  /* no space available at the moment. */
    1.21 +    }
    1.22  
    1.23      EventQueueAvailable = item->next;
    1.24 -    if (EventQueueTail)
    1.25 +    if (EventQueueTail) {
    1.26          EventQueueTail->next = item;
    1.27 -    else
    1.28 +        EventQueueTail = item;
    1.29 +    } else {
    1.30          EventQueueHead = EventQueueTail = item;
    1.31 +    }
    1.32      item->next = NULL;
    1.33  
    1.34      SDL_memcpy(&item->event12, event12, sizeof (SDL12_Event));
    1.35 +
    1.36      return 0;
    1.37  }
    1.38