Browse Source

Use c99 standard in build.sh and don't use TR_hashEmpty any more ... I probably will deprecate all the empty functions soon

1.0.0
Georg Hopp 11 years ago
parent
commit
87d711ff14
  1. 13
      src/i_comm_manager.c
  2. 10
      testers/build.sh

13
src/i_comm_manager.c

@ -90,10 +90,13 @@ TR_commManagerSelect(void * _this, TR_Event event)
TR_Timer timer = (TR_Timer)event->data; TR_Timer timer = (TR_Timer)event->data;
TR_EventDispatcher dispatcher = (TR_EventDispatcher)event->subject; TR_EventDispatcher dispatcher = (TR_EventDispatcher)event->subject;
unsigned long timeout; // milliseconds unsigned long timeout; // milliseconds
unsigned long io_triggerd;
if (! (TR_hashEmpty(this->read)
&& TR_hashEmpty(this->write)
&& TR_hashEmpty(this->accept))) {
io_triggerd = TR_hashEach(this->write, this, commManagerIssueWriteEvents);
io_triggerd += TR_hashEach(this->accept, this, commManagerIssueAcceptEvents);
io_triggerd += TR_hashEach(this->read, this, commManagerIssueReadEvents);
if (io_triggerd) {
timeout = 0; timeout = 0;
} else if (NULL == timer) { } else if (NULL == timer) {
timeout = TR_eventDispatcherGetDataWaitTime(dispatcher); timeout = TR_eventDispatcherGetDataWaitTime(dispatcher);
@ -103,10 +106,6 @@ TR_commManagerSelect(void * _this, TR_Event event)
TR_CALL(_this, TR_CommManager, select, event, timeout); TR_CALL(_this, TR_CommManager, select, event, timeout);
TR_hashEach(this->write, this, commManagerIssueWriteEvents);
TR_hashEach(this->accept, this, commManagerIssueAcceptEvents);
TR_hashEach(this->read, this, commManagerIssueReadEvents);
return TR_EVENT_DONE; return TR_EVENT_DONE;
} }

10
testers/build.sh

@ -2,8 +2,8 @@
#TRLIBS="-ltrbase -ltrhashing -ltrio -ltrdata -ltrevent -ltrcomm" #TRLIBS="-ltrbase -ltrhashing -ltrio -ltrdata -ltrevent -ltrcomm"
TRLIBS="/usr/local/lib/libtrcomm.a /usr/local/lib/libtrevent.a /usr/local/lib/libtrdata.a /usr/local/lib/libtrio.a /usr/local/lib/libtrhashing.a /usr/local/lib/libtrbase.a" TRLIBS="/usr/local/lib/libtrcomm.a /usr/local/lib/libtrevent.a /usr/local/lib/libtrdata.a /usr/local/lib/libtrio.a /usr/local/lib/libtrhashing.a /usr/local/lib/libtrbase.a"
LIBS="-lcrypto -lssl -lrt -luuid" LIBS="-lcrypto -lssl -lrt -luuid"
gcc ${CFLAGS} -c -o test_handler.o test_handler.c
gcc ${CFLAGS} -I/usr/local/include -L/usr/local/lib ${LIBS} -o testserver testserver.c test_handler.o ${TRLIBS}
gcc ${CFLAGS} -I/usr/local/include -L/usr/local/lib ${LIBS} -o testserver2 testserver2.c test_handler.o ${TRLIBS}
gcc ${CFLAGS} -I/usr/local/include -L/usr/local/lib ${LIBS} -o testtcp testclient.c ${TRLIBS}
gcc ${CFLAGS} -I/usr/local/include -L/usr/local/lib ${LIBS} -DUDP=1 -o testudp testclient.c ${TRLIBS}
gcc ${CFLAGS} -std=c99 -c -o test_handler.o test_handler.c
gcc ${CFLAGS} -std=c99 -I/usr/local/include -L/usr/local/lib ${LIBS} -o testserver testserver.c test_handler.o ${TRLIBS}
gcc ${CFLAGS} -std=c99 -I/usr/local/include -L/usr/local/lib ${LIBS} -o testserver2 testserver2.c test_handler.o ${TRLIBS}
gcc ${CFLAGS} -std=c99 -I/usr/local/include -L/usr/local/lib ${LIBS} -o testtcp testclient.c ${TRLIBS}
gcc ${CFLAGS} -std=c99 -I/usr/local/include -L/usr/local/lib ${LIBS} -DUDP=1 -o testudp testclient.c ${TRLIBS}
Loading…
Cancel
Save