Fixed building events.c.

This commit is contained in:
Pietro Gagliardi 2019-05-18 10:00:07 -04:00
parent 25afc9b13f
commit 66247ce73d
1 changed files with 2 additions and 2 deletions

View File

@ -4,6 +4,8 @@
#include "ui.h"
#include "uipriv.h"
#define nGrow 32
struct handler {
int id;
uiEventHandler f;
@ -136,7 +138,6 @@ notFound:
void uiEventDeleteHandler(uiEvent *e, int id)
{
struct handler *h;
int id;
checkEventNonnull(e, /* nothing */);
checkEventNotFiring(e, /* nothing */);
@ -144,7 +145,6 @@ void uiEventDeleteHandler(uiEvent *e, int id)
if (h == NULL)
return;
id = h->id;
e->len--;
// TODO write this in a way that doesn't mix ptrdiff_t and size_t
memmove(h, h + 1, (e->len - (h - e->handlers)) * sizeof (struct handler));