fixed compilation errors

This commit is contained in:
Amy G. Bowersox 2019-12-01 01:07:37 -07:00
parent 87db1f4d02
commit 340e08232e
4 changed files with 7 additions and 6 deletions

View File

@ -1,5 +1,5 @@
OBJS=main.o sysinput.o log.o gpio.o msg_queue.o time_func.o OBJS=main.o sysinput.o log.o gpio.o msg_queue.o time_func.o
LIBS= LIBS=-lpthread
upiwin: $(OBJS) upiwin: $(OBJS)
gcc -o upiwin $(OBJS) $(LIBS) gcc -o upiwin $(OBJS) $(LIBS)

View File

@ -5,7 +5,7 @@
#define MSG_ATTRCOUNT 2 #define MSG_ATTRCOUNT 2
typedef tagMSG { typedef struct tagMSG {
uintptr_t target; uintptr_t target;
unsigned message; unsigned message;
uintptr_t attrs[MSG_ATTRCOUNT]; uintptr_t attrs[MSG_ATTRCOUNT];

View File

@ -1,4 +1,5 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h>
#include <pthread.h> #include <pthread.h>
#include "wintype.h" #include "wintype.h"
#include "time_func.h" #include "time_func.h"
@ -12,8 +13,8 @@ PMSG_QUEUE MqAlloc(int nentries)
rc = (PMSG_QUEUE)malloc(sz); rc = (PMSG_QUEUE)malloc(sz);
if (!rc) if (!rc)
return NULL; return NULL;
memset(rc, 0 sz); memset(rc, 0, sz);
rc->startbound = &(rc->messagestore); rc->startbound = &(rc->messagestore[0]);
rc->endbound = rc->startbound + nentries; rc->endbound = rc->startbound + nentries;
rc->head = rc->tail = rc->startbound; rc->head = rc->tail = rc->startbound;
rc->nentries = nentries; rc->nentries = nentries;

View File

@ -22,13 +22,13 @@ static void *input_thread(void *arg)
st = Gpio_read_buttons(); st = Gpio_read_buttons();
if (st != last_bstate) if (st != last_bstate)
{ {
tmp = last_state & ~st; tmp = last_bstate & ~st;
for (attr = 1, mask = 1; attr <= 4; attr++, mask <<= 1) for (attr = 1, mask = 1; attr <= 4; attr++, mask <<= 1)
{ {
if (tmp & mask) if (tmp & mask)
MqPost1(Sys_Queue, 0, WM_HWBUTTONUP, attr); 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) for (attr = 1, mask = 1; attr <= 4; attr++, mask <<= 1)
{ {
if (tmp & mask) if (tmp & mask)