aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2026-03-09 23:22:14 -0400
committerB. Watson <urchlay@slackware.uk>2026-03-09 23:22:14 -0400
commit705bc7fa9068ef576b23c813abb193a44cff5bcd (patch)
tree08a2a85ebbcfff0bec715e701f4ed36e9490699d /src
parent15488c9cb3c7200efc3c863b505959a07e96e89a (diff)
downloadfujinet-chat-705bc7fa9068ef576b23c813abb193a44cff5bcd.tar.gz
Cleanup, get rid of stdbool.h
Diffstat (limited to 'src')
-rw-r--r--src/irc.c3
-rw-r--r--src/main.c20
2 files changed, 10 insertions, 13 deletions
diff --git a/src/irc.c b/src/irc.c
index 8740e15..444f863 100644
--- a/src/irc.c
+++ b/src/irc.c
@@ -620,7 +620,7 @@ int irc_read(void) {
}
// Get # of bytes waiting, no more than size of rx_buf
- rxbuflen = OS.dvstat[1] * 256 + OS.dvstat[0];
+ rxbuflen = (OS.dvstat[1] << 8) | OS.dvstat[0];
if(rxbuflen > MAX_MSG)
rxbuflen = MAX_MSG;
@@ -628,7 +628,6 @@ int irc_read(void) {
if(rxbuflen > 0) {
err = nread(url, rx_buf, rxbuflen);
if(err != 1) {
- scr_print_current("READ ERROR: ");
print_errnum();
return 0;
}
diff --git a/src/main.c b/src/main.c
index 3f12e00..56fab25 100644
--- a/src/main.c
+++ b/src/main.c
@@ -9,26 +9,24 @@
#define DEF_CHANNEL "##atari"
#include <atari.h>
-#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
-#include <conio.h> // for kbhit() and cgetc()
-// #include "conio.h" // our local one.
+#include <conio.h> // for cgetc() only
#include "nio.h"
#include "irc.h"
#include "screen.h"
#include "edbox.h"
-char url[256] = DEF_URL; // URL
-char usernick[32] = DEF_NICK;
+char url[256] = DEF_URL; // URL.
+char usernick[32] = DEF_NICK; // our current nick (can be changed by the server)
unsigned char err; // error code of last operation.
-unsigned char trip=0; // if trip=1, fujinet is asking us for attention.
-bool old_enabled=false; // were interrupts enabled for old vector
-void* old_vprced; // old PROCEED vector, restored on exit.
-unsigned short rxbuflen;
-unsigned int txbuflen; // TX buffer length
+unsigned char trip = 0; // if trip == 1, fujinet is asking us for attention.
+char old_enabled = 0; // were interrupts enabled for old vector
+void *old_vprced; // old PROCEED vector, restored on exit.
+unsigned short rxbuflen; // RX buffer length
+unsigned int txbuflen; // TX buffer length
char hz; /* 50 for PAL, 60 for NSTC */
/* TODO: user modes (default +iw), fg/bg color... */
@@ -89,7 +87,7 @@ void txbuf_set_str3(const char *s1, const char *s2, const char *s3) {
}
void txbuf_send(void) {
- /* don't sent empty buffer */
+ /* don't send empty buffer */
if(!txbuflen) return;
/* always terminate with EOL */