--- ray/src/hd/rhdisp.c 2008/03/11 02:21:47 3.52 +++ ray/src/hd/rhdisp.c 2023/02/06 22:40:21 3.56 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: rhdisp.c,v 3.52 2008/03/11 02:21:47 greg Exp $"; +static const char RCSid[] = "$Id: rhdisp.c,v 3.56 2023/02/06 22:40:21 greg Exp $"; #endif /* * Holodeck display process. @@ -61,7 +61,7 @@ static long nimmrays, naddrays; static int disp_wait(void); static void add_holo(HDGRID *hdg, char *gfn, char *pfn); static void disp_bundle(PACKHEAD *p); -static void new_view(register VIEW *v); +static void new_view(VIEW *v); static void set_focus(char *args); static int usr_input(void); static void printview(void); @@ -215,7 +215,7 @@ disp_wait(void) /* wait for more input */ static void -add_holo( /* register a new holodeck section */ +add_holo( /* a new holodeck section */ HDGRID *hdg, char *gfn, char *pfn @@ -223,7 +223,7 @@ add_holo( /* register a new holodeck section */ { VIEW nv; double d; - register int hd; + int hd; for (hd = 0; hd < HDMAX && hdlist[hd] != NULL; hd++) ; @@ -257,13 +257,13 @@ add_holo( /* register a new holodeck section */ static void disp_bundle( /* display a ray bundle */ - register PACKHEAD *p + PACKHEAD *p ) { GCOORD gc[2]; FVECT ro, rd, wp; double d; - register int i; + int i; /* get beam coordinates */ if ((p->hd < 0) | (p->hd >= HDMAX) || hdlist[p->hd] == NULL) error(INTERNAL, "bad holodeck number in disp_bundle"); @@ -288,7 +288,7 @@ disp_bundle( /* display a ray bundle */ static void new_view( /* change view parameters */ - register VIEW *v + VIEW *v ) { static VIEW viewhist[VIEWHISTLEN]; @@ -422,8 +422,8 @@ usr_input(void) /* get user input and process it */ { VIEW vparams; char cmd[256]; - register char *args; - register int i; + char *args; + int i; if (fgets(cmd, sizeof(cmd), sstdin) == NULL) { fclose(sstdin); @@ -499,14 +499,14 @@ printview(void) /* print our current view to server } -extern int +int serv_result(void) /* get next server result and process it */ { static char *buf = NULL; static int bufsiz = 0; MSGHEAD msg; /* read message header */ - if (fread((char *)&msg, sizeof(MSGHEAD), 1, stdin) != 1) + if (getbinary(&msg, sizeof(MSGHEAD), 1, stdin) != 1) goto readerr; if (msg.nbytes > 0) { /* get the message body */ if (msg.nbytes > bufsiz) { @@ -518,7 +518,7 @@ serv_result(void) /* get next server result and proc if (buf == NULL) error(SYSTEM, "out of memory in serv_result"); } - if (fread(buf, 1, msg.nbytes, stdin) != msg.nbytes) + if (getbinary(buf, 1, msg.nbytes, stdin) != msg.nbytes) goto readerr; } switch (msg.type) { /* process results */ @@ -543,7 +543,7 @@ serv_result(void) /* get next server result and proc break; case DS_STARTIMM: case DS_ENDIMM: - if (!(imm_mode = msg.type==DS_STARTIMM)) + if (!(imm_mode = (msg.type==DS_STARTIMM))) dev_flush(); #ifdef DEBUG { @@ -576,7 +576,7 @@ readerr: } -extern void +void serv_request( /* send a request to the server process */ int type, int nbytes, @@ -597,9 +597,9 @@ serv_request( /* send a request to the server process } msg.type = type; /* write and flush the message */ msg.nbytes = nbytes; - fwrite((char *)&msg, sizeof(MSGHEAD), 1, stdout); + putbinary(&msg, sizeof(MSGHEAD), 1, stdout); if (nbytes > 0) - fwrite(p, 1, nbytes, stdout); + putbinary(p, 1, nbytes, stdout); if (fflush(stdout) < 0) error(SYSTEM, "write error in serv_request"); } @@ -607,7 +607,7 @@ serv_request( /* send a request to the server process void eputs( /* put error message to stderr */ - register char *s + const char *s ) { static int midline = 0;