Formatted

This commit is contained in:
Devine Lu Linvega 2023-03-18 11:12:48 -07:00
parent 5ef6a7a98a
commit 5917f409c5
2 changed files with 6 additions and 8 deletions

View File

@ -226,7 +226,7 @@ int
main(int argc, char **argv) main(int argc, char **argv)
{ {
Uxn u; Uxn u;
int i,n; int i, n;
char expirations[8]; char expirations[8];
char coninp[CONINBUFSIZE]; char coninp[CONINBUFSIZE];
struct pollfd fds[3]; struct pollfd fds[3];
@ -263,12 +263,10 @@ main(int argc, char **argv)
read(fds[1].fd, expirations, 8); /* Indicate we handled the timer */ read(fds[1].fd, expirations, 8); /* Indicate we handled the timer */
uxn_eval(&u, GETVEC(&u.dev[0x20])); /* Call the vector once, even if the timer fired multiple times */ uxn_eval(&u, GETVEC(&u.dev[0x20])); /* Call the vector once, even if the timer fired multiple times */
} }
if ((fds[2].revents & POLLIN)!=0) if((fds[2].revents & POLLIN) != 0) {
{ n = read(fds[2].fd, coninp, CONINBUFSIZE - 1);
n = read(fds[2].fd, coninp, CONINBUFSIZE-1);
coninp[n] = 0; coninp[n] = 0;
for (i=0;i<n;i++) for(i = 0; i < n; i++) {
{
console_input(&u, coninp[i]); console_input(&u, coninp[i]);
} }
} }

View File

@ -37,8 +37,8 @@ console_input(Uxn *u, char c)
static void static void
console_deo(Uint8 *d, Uint8 port) console_deo(Uint8 *d, Uint8 port)
{ {
FILE *fd = port == 0x8 ? stdout : port == 0x9 ? stderr FILE *fd = port == 0x8 ? stdout : port == 0x9 ? stderr :
: 0; 0;
if(fd) { if(fd) {
fputc(d[port], fd); fputc(d[port], fd);
fflush(fd); fflush(fd);