From 340e08232e8939fef7d4b0738175a9adc896ed5f Mon Sep 17 00:00:00 2001 From: Amy Gale Ruth Bowersox Date: Sun, 1 Dec 2019 01:07:37 -0700 Subject: [PATCH] fixed compilation errors --- src/Makefile | 2 +- src/msg.h | 2 +- src/msg_queue.c | 5 +++-- src/sysinput.c | 4 ++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/Makefile b/src/Makefile index d77522a..de01b8a 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,5 +1,5 @@ OBJS=main.o sysinput.o log.o gpio.o msg_queue.o time_func.o -LIBS= +LIBS=-lpthread upiwin: $(OBJS) gcc -o upiwin $(OBJS) $(LIBS) diff --git a/src/msg.h b/src/msg.h index c880d76..a09d269 100644 --- a/src/msg.h +++ b/src/msg.h @@ -5,7 +5,7 @@ #define MSG_ATTRCOUNT 2 -typedef tagMSG { +typedef struct tagMSG { uintptr_t target; unsigned message; uintptr_t attrs[MSG_ATTRCOUNT]; diff --git a/src/msg_queue.c b/src/msg_queue.c index 9d89ae3..ff94048 100644 --- a/src/msg_queue.c +++ b/src/msg_queue.c @@ -1,4 +1,5 @@ #include +#include #include #include "wintype.h" #include "time_func.h" @@ -12,8 +13,8 @@ PMSG_QUEUE MqAlloc(int nentries) rc = (PMSG_QUEUE)malloc(sz); if (!rc) return NULL; - memset(rc, 0 sz); - rc->startbound = &(rc->messagestore); + memset(rc, 0, sz); + rc->startbound = &(rc->messagestore[0]); rc->endbound = rc->startbound + nentries; rc->head = rc->tail = rc->startbound; rc->nentries = nentries; diff --git a/src/sysinput.c b/src/sysinput.c index 27fda6c..2834660 100644 --- a/src/sysinput.c +++ b/src/sysinput.c @@ -22,13 +22,13 @@ static void *input_thread(void *arg) st = Gpio_read_buttons(); if (st != last_bstate) { - tmp = last_state & ~st; + tmp = last_bstate & ~st; for (attr = 1, mask = 1; attr <= 4; attr++, mask <<= 1) { if (tmp & mask) MqPost1(Sys_Queue, 0, WM_HWBUTTONUP, attr); } - tmp = st & ~last_state; + tmp = st & ~last_bstate; for (attr = 1, mask = 1; attr <= 4; attr++, mask <<= 1) { if (tmp & mask)