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