-/* $NetBSD: misc.c,v 1.12 2001/02/05 01:10:10 christos Exp $ */
+/* $NetBSD: misc.c,v 1.16 2008/01/28 01:58:01 dholland Exp $ */
/*
* Copyright (c) 1983, 1993
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
#if 0
static char sccsid[] = "@(#)misc.c 8.2 (Berkeley) 4/28/95";
#else
-__RCSID("$NetBSD: misc.c,v 1.12 2001/02/05 01:10:10 christos Exp $");
+__RCSID("$NetBSD: misc.c,v 1.16 2008/01/28 01:58:01 dholland Exp $");
#endif
#endif /* not lint */
#include <ctype.h>
#include <stdio.h>
#include <unistd.h>
+#include <stdlib.h>
#include <string.h>
#include "extern.h"
#include "pathnames.h"
}
static int
-angle(int dr, int dc)
+angle(int Dr, int Dc)
{
int i;
- if (dc >= 0 && dr > 0)
+ if (Dc >= 0 && Dr > 0)
i = 0;
- else if (dr <= 0 && dc > 0)
+ else if (Dr <= 0 && Dc > 0)
i = 2;
- else if (dc <= 0 && dr < 0)
+ else if (Dc <= 0 && Dr < 0)
i = 4;
else
i = 6;
- dr = abs(dr);
- dc = abs(dc);
- if ((i == 0 || i == 4) && dc * 2.4 > dr) {
+ Dr = abs(Dr);
+ Dc = abs(Dc);
+ if ((i == 0 || i == 4) && Dc * 2.4 > Dr) {
i++;
- if (dc > dr * 2.4)
+ if (Dc > Dr * 2.4)
i++;
- } else if ((i == 2 || i == 6) && dr * 2.4 > dc) {
+ } else if ((i == 2 || i == 6) && Dr * 2.4 > Dc) {
i++;
- if (dr > dc * 2.4)
+ if (Dr > Dc * 2.4)
i++;
}
return i % 8 + 1;
if (sp->file->struck)
return flag;
flag = *countryname[capship(sp)->nationality];
- return sp->file->FS ? flag : tolower(flag);
+ return sp->file->FS ? flag : tolower((unsigned char)flag);
}
void