switch source tree from k&r to c99

This commit is contained in:
nhmall
2021-01-26 21:06:16 -05:00
parent a2a9cb7b4f
commit f963c5aca7
232 changed files with 12099 additions and 17782 deletions

View File

@@ -4,9 +4,9 @@
#include "hack.h"
int FDECL(get_rect_ind, (NhRect *));
int get_rect_ind(NhRect *);
static boolean FDECL(intersect, (NhRect *, NhRect *, NhRect *));
static boolean intersect(NhRect *, NhRect *, NhRect *);
/*
* In this file, we will handle the various rectangle functions we
@@ -26,7 +26,7 @@ static int rect_cnt;
*/
void
init_rect()
init_rect(void)
{
rect_cnt = 1;
rect[0].lx = rect[0].ly = 0;
@@ -40,8 +40,7 @@ init_rect()
*/
int
get_rect_ind(r)
NhRect *r;
get_rect_ind(NhRect* r)
{
register NhRect *rectp;
register int lx, ly, hx, hy;
@@ -63,8 +62,7 @@ NhRect *r;
*/
NhRect *
get_rect(r)
NhRect *r;
get_rect(NhRect* r)
{
register NhRect *rectp;
register int lx, ly, hx, hy;
@@ -86,7 +84,7 @@ NhRect *r;
*/
NhRect *
rnd_rect()
rnd_rect(void)
{
return rect_cnt > 0 ? &rect[rn2(rect_cnt)] : 0;
}
@@ -98,8 +96,7 @@ rnd_rect()
*/
static boolean
intersect(r1, r2, r3)
NhRect *r1, *r2, *r3;
intersect(NhRect* r1, NhRect* r2, NhRect* r3)
{
if (r2->lx > r1->hx || r2->ly > r1->hy || r2->hx < r1->lx
|| r2->hy < r1->ly)
@@ -120,8 +117,7 @@ NhRect *r1, *r2, *r3;
*/
void
remove_rect(r)
NhRect *r;
remove_rect(NhRect* r)
{
int ind;
@@ -135,8 +131,7 @@ NhRect *r;
*/
void
add_rect(r)
NhRect *r;
add_rect(NhRect* r)
{
if (rect_cnt >= MAXRECT) {
if (wizard)
@@ -158,8 +153,7 @@ NhRect *r;
*/
void
split_rects(r1, r2)
NhRect *r1, *r2;
split_rects(NhRect* r1, NhRect* r2)
{
NhRect r, old_r;
int i;