Assorted fixes and cleanup.

- if we're going to supply the build makefile, it shouldn't require gmake.
 - don't install executable html or gif files
 - add patch comments
 - const correctness for string constants, as demanded by gcc 4.5
 - avoid needing -lcompat
 - fix a y2038 issue

PKGREVISION -> 2
This commit is contained in:
dholland 2011-12-20 16:18:16 +00:00
parent 60291a36e4
commit 8eaa2604c8
52 changed files with 1753 additions and 74 deletions

View file

@ -1,8 +1,8 @@
# $NetBSD: Makefile,v 1.26 2009/07/08 17:20:52 joerg Exp $
# $NetBSD: Makefile,v 1.27 2011/12/20 16:18:16 dholland Exp $
DISTNAME= craftcc35
PKGNAME= craft-3.5
PKGREVISION= 1
PKGREVISION= 2
CATEGORIES= games x11
MASTER_SITES= ftp://set.gmd.de/pub/as/janus/craft/
EXTRACT_SUFX= .tar.Z
@ -15,7 +15,6 @@ PKG_DESTDIR_SUPPORT= user-destdir
WRKSRC= ${WRKDIR}
USE_LANGUAGES= c c++
USE_TOOLS+= gmake
USE_X11BASE= yes
SUBST_CLASSES+= craft
@ -36,14 +35,10 @@ post-extract:
for f in `find ${WRKSRC} -name "*.hc" -type f -print`; do \
${ECHO} "" >>$$f; \
done
post-patch:
${CHMOD} a-x ${WRKSRC}/html/pic/*.gif
${CHMOD} a-x ${WRKSRC}/html/pic/craft.gif.old
${CHMOD} a-x ${WRKSRC}/html/craftcc.html
rm -f ${WRKSRC}/hcc/hcc
.include "../../mk/bsd.prefs.mk"
.if ${OPSYS} == "Linux"
BUILDLINK_TRANSFORM+= rm:-lcompat
.endif
.include "../../x11/libX11/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"

View file

@ -1,15 +1,54 @@
$NetBSD: distinfo,v 1.7 2007/03/06 22:57:46 rillig Exp $
$NetBSD: distinfo,v 1.8 2011/12/20 16:18:16 dholland Exp $
SHA1 (craftcc35.tar.Z) = 8862b9001aa7d752a597033ef45d38ebfcee533f
RMD160 (craftcc35.tar.Z) = 402a2c2ca37df4d86381b434437395424199859e
Size (craftcc35.tar.Z) = 3123677 bytes
SHA1 (patch-aa) = 4be0033e5b4fd72713215ef313e6c7b77f6c5d99
SHA1 (patch-ab) = 32f77d3208af98a26b4a505f51011b33c106b21d
SHA1 (patch-ac) = 93eeef71231abbb5f5210cb7a4d9dac8d476b719
SHA1 (patch-ad) = 096eb8db33986f115efb810f9768661917661fd8
SHA1 (patch-ae) = a891a2a2d80ae37eb0dcc5c218fbc8d8f9e6d2b0
SHA1 (patch-af) = 35c9cae9fc803b9e9d7fa4714bbe4fea6972654b
SHA1 (patch-ag) = 970a96a63c86b16b3b588bc90257c5914e3c35d5
SHA1 (patch-ah) = 56b09c1fb761e88586cc66de6f1b8079c0f7a785
SHA1 (patch-ai) = 437500858d90fb24f8fa494269ac83e501630738
SHA1 (patch-aj) = c9707cfabd88586798a3d77f1ec4ee81d8b67894
SHA1 (patch-aa) = 97a9d7a1d25ff34c6d0b3ac92e10f12ab3d74413
SHA1 (patch-ab) = a1d82644ed0016f174991e69ed3f28799fd310b3
SHA1 (patch-ac) = 9fdc2cd3ba2bbbb6174360143bb3dd7fd8684a14
SHA1 (patch-ad) = c425f26cc26a84339a1e3875045218fda09d511e
SHA1 (patch-ae) = 3251f94a8b99628132d6ab3669b7f93e8e95e998
SHA1 (patch-af) = dab938f633e87be7a33b3dedee17c3f34c480c5a
SHA1 (patch-ag) = 0f44a1a2a6c9e536e8d37b5ae86fc47415a6a93b
SHA1 (patch-ah) = db041fb152b5ad6255b923b609cf8f86d155acd9
SHA1 (patch-ai) = 9eb46992f315dd858afea2df089f127f9b82635d
SHA1 (patch-aj) = bbddb0deef3cfcf1fdf4bb77952c38d1a086f6fa
SHA1 (patch-buttons_h) = 4f64967be33dcafe6d1fe8c0267f65cb00cfe5fd
SHA1 (patch-buttons_hc) = 98bdcd223fe94b1162ca226e2708fb5f183a2fe3
SHA1 (patch-cmap_h) = 15d0a56a4b73451a6d7577a964f83325f2329404
SHA1 (patch-cmap_hc) = 56a55a69a999f08dbb7f340becdde296822a25d4
SHA1 (patch-cmap_selector_h) = 45b492ce3319228540f4ef33ec0fee22e60e0f3c
SHA1 (patch-cmap_selector_hc) = ceb20416bdeaacd7c86ad7f84cb27343275ad3df
SHA1 (patch-compress_h) = d7b5625a3a2aeb48e261d105a38d91e4028a0758
SHA1 (patch-compress_hc) = 470545292968e70c3df75c3952824e30518ae57b
SHA1 (patch-dial_h) = 949a292cd3628eaf3257d6fdbf5a34ab441cd30c
SHA1 (patch-dial_hc) = 6c6c3e432ccfd7ad78e2182b2fca5c2a9cee9907
SHA1 (patch-errorhandling_h) = 764d3389ed5332be53e7419d1082a8aa1263d82b
SHA1 (patch-errorhandling_hc) = 56918650dd888a49a13c3474d976d02d3468eeed
SHA1 (patch-file_selector_h) = bf6d72907ce159a69f2097c89b9096996cc162e7
SHA1 (patch-file_selector_hc) = 9e4b3ef690f93b0a54cb00e724b787f1a54d15be
SHA1 (patch-getline_c) = 3a9c9f9aabc76304054e4821a0571695fd436405
SHA1 (patch-hcc_hcc_hc) = a98cca88e9fa69402f81d094f2fdd16d9b30b681
SHA1 (patch-io_h) = 9653c72cb08d192d51fb72eb19e805e7d54c1a9a
SHA1 (patch-io_hc) = d271dbfeed86fc938a8685e334d3130072967ab8
SHA1 (patch-masks_h) = 36491ebf1a7c5d7ede7ad10f611f41d90a4211ae
SHA1 (patch-masks_hc) = d52bdac44169338c19ae296cb6259069a9c166be
SHA1 (patch-menu_h) = a5265f11322b886c5a2b588f19651b03f6e53d2a
SHA1 (patch-menu_hc) = c705715e69163a4875898463373bfd5914c41eac
SHA1 (patch-object_handler_h) = 5fbce2a8055f881f503725512bc191ea9b96de27
SHA1 (patch-object_handler_hc) = d40a1280ed60aec2c40680a2ace548b3effba6fe
SHA1 (patch-paramreader_h) = 794fb923803f71b504fabbfdf2156e2361b9acfa
SHA1 (patch-player_h) = de836ca73b9fb6e3a3b05a8c66b902880853e7a6
SHA1 (patch-player_hc) = fce03c4fb0b79120be128e4d217af159a8f8e206
SHA1 (patch-scroller_h) = a0a194af6dcd671cd96e87e5cc3b9c96c9e47c7f
SHA1 (patch-scroller_hc) = a2760b62456967c116486f88731d588888b73dfe
SHA1 (patch-selector_h) = 9b140aafb318400b9443b8b1522a8cb8f5a1d534
SHA1 (patch-selector_hc) = aa95c70dd550d4a3413ca058f11a92d4fee80486
SHA1 (patch-table_h) = 6a16731dde40d0fa3bfa785b27257e2d6a02be51
SHA1 (patch-table_hc) = dcd711176dd66435e7fce12584032796e9fcee44
SHA1 (patch-win_h) = 0c473b2284218c4d4f86ad7d5ab0e33da89ab284
SHA1 (patch-xfile_h) = fa2dabab722372022bc77293200fe533ca089ace
SHA1 (patch-xstring_h) = 84e36d498d821fa04624dece37016653ba72da46
SHA1 (patch-xstring_hc) = 43c9302bd21076fccc950d643da56f0488cd33ed
SHA1 (patch-xtimer_h) = 626fba12b2d7d86f6c9b59f5d41b74cbfb4e83f1
SHA1 (patch-xtimer_hc) = 55aaf72e8f15de5a3f523d3b973e55cf5d874d4c

View file

@ -1,46 +1,38 @@
# $NetBSD: Makefile,v 1.3 2009/07/08 17:20:52 joerg Exp $
# $NetBSD: Makefile,v 1.4 2011/12/20 16:18:16 dholland Exp $
#
#---------------------------------------------------------------------
#
# The following assigns must be changed according to your system
#
GCC= ${CC}
GPP= ${CXX}
XLIB=${X11BASE}/lib
CPPFLAGS=-I${X11BASE}/include -DCRAFT_DIR=\\\"${PREFIX}/share/craft/\\\"
CPPFLAGS+=-I${X11BASE}/include -DCRAFT_DIR=\\\"${PREFIX}/share/craft/\\\"
LDFLAGS+=${COMPILER_RPATH_FLAG}${XLIB} -L${XLIB} -lX11 -lm
#
#--------------------------------------------------------------------
OBJ= xtimer.o option_menu.o setupedit.o robot.o land.o ship.o building.o \
dir.o object_handler.o pic.o player.o field.o ilfield.o xbm.o cmap_edit.o \
cmap.o ppm.o compress.o table.o xmath.o io.o cry.o win.o dial.o multi_dial.o \
menu.o xsystem.o xfile.o ppm_handler.o errorhandling.o paramreader.o pattern_match.o \
objects.o xstring.o id_handler.o color_trans.o masks.o buttons.o lru.o scroller.o \
OBJS= xtimer.o option_menu.o setupedit.o robot.o land.o ship.o building.o \
dir.o object_handler.o pic.o player.o field.o ilfield.o xbm.o \
cmap_edit.o cmap.o ppm.o compress.o table.o xmath.o io.o cry.o win.o \
dial.o multi_dial.o menu.o xsystem.o xfile.o ppm_handler.o \
errorhandling.o paramreader.o pattern_match.o objects.o xstring.o \
id_handler.o color_trans.o masks.o buttons.o lru.o scroller.o \
selector.o cmap_selector.o getline.o file_selector.o history.o craft.o
HCC=hcc/hcc
CMP=${HCC} -compiler ${GCC} ${CPPFLAGS} ${CFLAGS} -c
LFLAGS=-Wl,-R${XLIB} -L${XLIB} -lX11 -lm -lcompat
CMP=${HCC} -compiler ${CC} ${CPPFLAGS} ${CFLAGS} -c
all: craft
craft: ${OBJ}
${GPP} ${OBJ} ${CPPFLAGS} -o craft ${LFLAGS}
craft: ${OBJS}
${CXX} ${LDFLAGS} ${OBJS} ${CPPFLAGS} -o craft
%.o: %.cc
${CMP} $*
.SUFFIXES: .cc .hc .o
%.o: %.hc
${CMP} $*
.cc.o:
${CMP} $(.IMPSRC:R)
${OBJ}: hcc/hcc
.hc.o:
${CMP} $(.IMPSRC:R)
${OBJS}: hcc/hcc
hcc/hcc: hcc/hcc.cc
${GPP} ${CFLAGS} $< -o hcc/hcc
${CXX} ${CFLAGS} hcc/hcc.cc -o hcc/hcc
install: craft
${BSD_INSTALL_PROGRAM} craft ${DESTDIR}${PREFIX}/bin

View file

@ -1,4 +1,6 @@
$NetBSD: patch-aa,v 1.3 2003/09/26 14:04:54 tron Exp $
$NetBSD: patch-aa,v 1.4 2011/12/20 16:18:16 dholland Exp $
- use standard headers
--- cry.h.orig 1997-02-24 12:58:31.000000000 +0100
+++ cry.h 2003-09-26 16:00:39.000000000 +0200

View file

@ -1,15 +1,145 @@
$NetBSD: patch-ab,v 1.3 2001/12/19 10:51:19 tron Exp $
$NetBSD: patch-ab,v 1.4 2011/12/20 16:18:16 dholland Exp $
--- win.hc.orig Wed Mar 19 07:21:21 1997
+++ win.hc Thu Sep 24 11:48:49 1998
@@ -118,8 +118,8 @@
- use configured installation directory properly
- const correctness demanded by recent gcc
--- win.hc.orig 2011-12-20 15:13:53.000000000 +0000
+++ win.hc
@@ -42,7 +42,7 @@ bool bitmap_size (char name [], int &dx,
/* ROUTINES text size information (deklarations) */
/*----------------------------------------------------------------------*/
-void text_size (char s [], char font [], int &dx, int &dy, int &num_lines)
+void text_size (const char s [], const char font [], int &dx, int &dy, int &num_lines)
{XFontStruct *font_info;
Display *display;
@@ -119,37 +119,37 @@ void init_default_handler ()
. perform_init
{win_handler_init = true;
- if (! f_exists (".windefaults.params"))
if (! f_exists (".windefaults.params"))
- system ("cp /home/hua/craft/.windefaults.params .");
+ if (! f_exists (".windefaults.params"))
+ system ("cp " CRAFT_DIR ".windefaults.params .windefaults.params");
win_defaults = new paramreader (".windefaults");
}.
}
-int win_default_i (int param, char default_name [])
+int win_default_i (int param, const char default_name [])
{init_default_handler ();
if (param != by_default)
return param;
else return win_default_i (default_name);
}
-int win_default_i (char default_name [])
+int win_default_i (const char default_name [])
{init_default_handler ();
return win_defaults->i_param (default_name);
}
-char *win_default_s (char default_name [])
+char *win_default_s (const char default_name [])
{init_default_handler ();
return win_defaults->s_param (default_name);
}
-int win_default_c (int param, char default_name [])
+int win_default_c (int param, const char default_name [])
{init_default_handler ();
if (param != by_default)
return param;
else return win_default_c (default_name);
}
-int win_default_c (char default_name [])
+int win_default_c (const char default_name [])
{char color_name [128];
init_default_handler ();
@@ -159,7 +159,7 @@ int win_default_c (char default_name [])
else return win_color (color_name);
}
-int win_color (char name [])
+int win_color (const char name [])
{if (strcmp (name, "white") == 0) return 0 ;
if (strcmp (name, "red") == 0) return 1 ;
if (strcmp (name, "red1") == 0) return 2 ;
@@ -263,8 +263,8 @@ bool win::fix_initialized = false;
/* CLASS win (funktions) */
/*----------------------------------------------------------------------*/
-win::win (char title [],
- char host [],
+win::win (const char title [],
+ const char host [],
int x,
int y,
int dx,
@@ -512,8 +512,8 @@ win::win (char title [],
}
win::win (win *parent,
- char title [],
- char host [],
+ const char title [],
+ const char host [],
int x,
int y,
int dx,
@@ -749,7 +749,7 @@ win::win (win *parent,
}
-win::win (char title [])
+win::win (const char title [])
{mydisplay = XOpenDisplay ("");
myscreen = DefaultScreen (mydisplay);
cmap = DefaultColormap (mydisplay, myscreen);
@@ -762,7 +762,7 @@ win::win (char title [])
is_alien = true;
}
-Window win::grab (Display *dsp, Window wnd, char name [])
+Window win::grab (Display *dsp, Window wnd, const char name [])
{Window *children, dummy;
unsigned int nchildren;
int i;
@@ -817,7 +817,7 @@ win::~win ()
#undef green
#undef blue
-void win::alloc_color (char name [], int no)
+void win::alloc_color (const char name [], int no)
{Screen *src = ScreenOfDisplay (mydisplay, myscreen);
XColor c;
XColor d;
@@ -1753,7 +1753,7 @@ void win::shift (int x1, int y1, int x2,
}
-void win::text_size (char string [], int &dx, int &dy)
+void win::text_size (const char string [], int &dx, int &dy)
{if (is_enable)
perform_get_size;
@@ -1767,7 +1767,7 @@ void win::text_size (char string [], int
}
-void win::set_font (char name [])
+void win::set_font (const char name [])
{if (is_enable)
perform_load;
@@ -1795,7 +1795,7 @@ void win::write (int x, int y, int d)
write (x, y, s);
}
-void win::write (int x, int y, char string [])
+void win::write (int x, int y, const char string [])
{if (is_enable)
perform_write;

View file

@ -1,4 +1,6 @@
$NetBSD: patch-ac,v 1.2 2001/12/19 10:26:47 tron Exp $
$NetBSD: patch-ac,v 1.3 2011/12/20 16:18:16 dholland Exp $
- use configured install prefix
--- craft_def.h.orig Fri Feb 21 04:49:57 1997
+++ craft_def.h Thu Sep 24 09:19:35 1998

View file

@ -1,4 +1,6 @@
$NetBSD: patch-ad,v 1.2 2001/12/19 10:26:47 tron Exp $
$NetBSD: patch-ad,v 1.3 2011/12/20 16:18:16 dholland Exp $
- use configured install prefix
--- option_menu.hc.orig Thu Sep 24 10:08:09 1998
+++ option_menu.hc Thu Sep 24 10:09:24 1998

View file

@ -1,4 +1,6 @@
$NetBSD: patch-ae,v 1.2 2001/12/19 10:26:47 tron Exp $
$NetBSD: patch-ae,v 1.3 2011/12/20 16:18:16 dholland Exp $
- use configured install prefix
--- setupedit.hc.orig Thu Sep 24 10:09:51 1998
+++ setupedit.hc Thu Sep 24 10:10:11 1998

View file

@ -1,8 +1,29 @@
$NetBSD: patch-af,v 1.2 1998/10/14 08:19:51 frueauf Exp $
$NetBSD: patch-af,v 1.3 2011/12/20 16:18:16 dholland Exp $
--- paramreader.hc.orig Thu Sep 24 12:00:23 1998
+++ paramreader.hc Thu Sep 24 12:00:59 1998
@@ -101,8 +101,11 @@
- const correctness demanded by newer gcc
- look in $HOME for settings file
--- paramreader.hc.orig 2011-12-20 16:08:24.000000000 +0000
+++ paramreader.hc
@@ -32,7 +32,7 @@ void check_params (int num_params)
/* CLASS paramreader (functions) */
/*----------------------------------------------------------------------*/
-void paramreader::read_sym (char sym [], bool &is_eof)
+void paramreader::read_sym (const char sym [], bool &is_eof)
{is_eof = false;
get_sym;
perhaps_skip_comment;
@@ -88,7 +88,7 @@ void paramreader::read_sym (char sym [],
}
-paramreader::paramreader (char param_file_name [])
+paramreader::paramreader (const char param_file_name [])
{bool is_eof = false;
num_params = 0;
@@ -101,8 +101,11 @@ paramreader::paramreader (char param_fil
. open_param_file
{char file_name [128];
@ -15,3 +36,40 @@ $NetBSD: patch-af,v 1.2 1998/10/14 08:19:51 frueauf Exp $
f [0] = fopen (file_name, "r");
num_includes = 1;
}.
@@ -129,7 +132,7 @@ void paramreader::dump ()
printf (">%s< = >%s<\n", name [i], value [i]);
}
-int paramreader::param_no (char p_name [])
+int paramreader::param_no (const char p_name [])
{for (int no = 0; no < num_params; no++)
if (strcmp (name [no], p_name) == 0)
return no;
@@ -138,15 +141,15 @@ int paramreader::param_no (char p_name [
return (0);
}
-char * paramreader::s_param (char name [])
+char * paramreader::s_param (const char name [])
{return value [param_no (name)];
}
-double paramreader::d_param (char name [])
+double paramreader::d_param (const char name [])
{return atof (value [param_no (name)]);
}
-int paramreader::i_param (char name [])
+int paramreader::i_param (const char name [])
{return atoi (value [param_no (name)]);
}
@@ -158,7 +161,7 @@ int paramreader::max_i_name ()
return max;
}
-void paramreader::set (char p_name [], char p_value [])
+void paramreader::set (const char p_name [], const char p_value [])
{int pno = param_no (p_name);
strcpy (value [pno], p_value);

View file

@ -1,7 +1,13 @@
$NetBSD: patch-ag,v 1.4 1999/08/11 21:54:22 tron Exp $
$NetBSD: patch-ag,v 1.5 2011/12/20 16:18:16 dholland Exp $
--- hcc/hcc.cc.orig Fri Feb 21 12:50:16 1997
+++ hcc/hcc.cc Wed Aug 4 15:37:39 1999
- use standard headers
- don't croak on platforms where char is unsigned
- const correctness demanded by newer gcc
- declare main's return type
- should match patch-hcc_hcc_hc
--- hcc/hcc.cc.orig 1997-02-21 11:50:16.000000000 +0000
+++ hcc/hcc.cc
@@ -1,6 +1,5 @@
-#include "bool.h"
#include "stdio.h"
@ -10,7 +16,72 @@ $NetBSD: patch-ag,v 1.4 1999/08/11 21:54:22 tron Exp $
#include "string.h"
#include "ctype.h"
@@ -203,7 +202,7 @@
@@ -39,7 +38,7 @@ FILE *src;
-void f_open (FILE *&f, char name [], char mode [])
+void f_open (FILE *&f, const char name [], const char mode [])
{f = fopen (name, mode);
/* check_error */ {if (mode [0] == 'r' && f == NULL)
{printf ("1, FILE, file '%s' not found\n", name);
@@ -51,7 +50,7 @@ void f_open (FILE *&f, char name [], cha
}
-char *substring (char s [], int from)
+char *substring (const char s [], int from)
{static bool is_init = false;
static char *result;
@@ -68,7 +67,7 @@ char *substring (char s [], int from)
}
-char *substring (char s [], int from, int to)
+char *substring (const char s [], int from, int to)
{static bool is_init = false;
static char *result;
@@ -91,8 +90,8 @@ char *substring (char s [], int from, in
void changeall (char s [],
int max_length_of_s,
- char tmplate [],
- char replacement [])
+ const char tmplate [],
+ const char replacement [])
{char *pos;
@@ -129,7 +128,7 @@ void changeall (char s [],
}
-char *complete (char name [], char tail [])
+char *complete (const char name [], const char tail [])
{static char r [256];
strcpy (r, name);
@@ -175,7 +174,7 @@ void dump_line_cor ()
};
}
-void pass_1_error (int line_no, char msg [], int l)
+void pass_1_error (int line_no, const char msg [], int l)
{char err_msg [256];
char ii [128];
@@ -187,7 +186,7 @@ void pass_1_error (int line_no, char msg
exit (1);
}
-void pass_1_error (int line_no, char msg [])
+void pass_1_error (int line_no, const char msg [])
{fclose (src);
printf ("error : %d : %s\n", line_no, msg);
exit (1);
@@ -203,7 +202,7 @@ bool pass_1 (char src_name [])
char last_last_sym;
int last_ref_sym_line;
int last_ref_sym_no;
@ -19,3 +90,12 @@ $NetBSD: patch-ag,v 1.4 1999/08/11 21:54:22 tron Exp $
int nested_brackets;
bool inside_refinement;
bool inside_string;
@@ -1307,7 +1306,7 @@ void pass_3 (char src_name [])
}
-main (int num_params, char *shell_params [])
+int main (int num_params, char *shell_params [])
{char gcc_exec [256];
char src_name [256];
char options [256];

View file

@ -1,7 +1,10 @@
$NetBSD: patch-ah,v 1.1 1999/08/11 21:54:22 tron Exp $
$NetBSD: patch-ah,v 1.2 2011/12/20 16:18:16 dholland Exp $
--- xfile.hc.orig Thu Mar 20 09:29:16 1997
+++ xfile.hc Wed Aug 4 14:42:46 1999
- handle platforms where char is unsigned (XXX looks suspicious to me)
- const correctness demanded by recent gcc
--- xfile.hc.orig 2011-12-20 15:13:53.000000000 +0000
+++ xfile.hc
@@ -12,10 +12,10 @@
/*----------------------------------------------------------------------*/
@ -17,3 +20,113 @@ $NetBSD: patch-ah,v 1.1 1999/08/11 21:54:22 tron Exp $
};
union conv_data
@@ -29,7 +29,7 @@ union conv_data
/* General functions */
/*----------------------------------------------------------------------*/
-bool f_exists (char file_name [])
+bool f_exists (const char file_name [])
{FILE *f;
bool is_error;
@@ -60,7 +60,7 @@ double d_get (FILE *f, bool &is_eof)
}
-void f_open (FILE *&f, char name [], char mode [])
+void f_open (FILE *&f, const char name [], const char mode [])
{f = fopen (name, mode);
check_error;
@@ -74,7 +74,7 @@ void f_open (FILE *&f, char name [], cha
}
-void f_open_with_extend (FILE *&f, char name [], char mode [], int max_no)
+void f_open_with_extend (FILE *&f, const char name [], const char mode [], int max_no)
{int version;
char v_name [128];
@@ -113,7 +113,7 @@ char *f_getline (FILE *f, char record []
return r;
}
-time_t f_date (char file_name [])
+time_t f_date (const char file_name [])
{
}
/*
@@ -124,7 +124,7 @@ time_t f_date (char file_name [])
}
*/
-char *f_name (char full_path [])
+char *f_name (const char full_path [])
{static char r [1024];
int i;
@@ -136,7 +136,7 @@ char *f_name (char full_path [])
return r;
}
-char *f_path (char full_path [])
+char *f_path (const char full_path [])
{static char r [1024];
int p = 0;
@@ -150,7 +150,7 @@ char *f_path (char full_path [])
return r;
}
-char *f_tail (char full_path [])
+char *f_tail (const char full_path [])
{static char r [1024];
if (f_is_dir (full_path))
@@ -168,30 +168,30 @@ char *f_tail (char full_path [])
}
-char *f_home_dir (char full_name [])
+char *f_home_dir (const char full_name [])
{static char result [512];
sprintf (result, "/home/%s", &full_name [1]);
return result;
}
-bool f_is_pattern (char f_name [])
+bool f_is_pattern (const char f_name [])
{return (strstr (f_name, "*") != NULL);
}
-bool f_is_dir (char file_name [])
+bool f_is_dir (const char file_name [])
{return (file_name [strlen (file_name)-1] == '/' ||
file_name [strlen (file_name)-1] == '.');
}
-bool f_is_home_dir (char full_name [])
+bool f_is_home_dir (const char full_name [])
{return full_name [0] == '~';
}
-bool sel_get_name (char name [],
+bool sel_get_name (const char name [],
char f_name [],
- char f_pattern [],
- char mode [])
+ const char f_pattern [],
+ const char mode [])
{char pat [256];
file_selector *fsel;
@@ -260,7 +260,7 @@ bool sel_get_name (char name [],
}
-char *complete (char name [], char tail [])
+char *complete (const char name [], const char tail [])
{static char r [256];
strcpy (r, name);

View file

@ -1,4 +1,6 @@
$NetBSD: patch-ai,v 1.1 2003/09/26 14:04:54 tron Exp $
$NetBSD: patch-ai,v 1.2 2011/12/20 16:18:16 dholland Exp $
- use standard headers
--- ppm_handler.h.orig 1997-02-21 12:52:17.000000000 +0100
+++ ppm_handler.h 2003-09-26 16:02:13.000000000 +0200

View file

@ -1,7 +1,12 @@
$NetBSD: patch-aj,v 1.1 2007/03/06 22:57:46 rillig Exp $
$NetBSD: patch-aj,v 1.2 2011/12/20 16:18:16 dholland Exp $
--- getline.h.orig 1997-02-21 12:50:14.000000000 +0100
+++ getline.h 2007-03-06 23:10:00.692282961 +0100
- fix conflict with posix getline
- include stdio.h preemptively to make sure the getline #define doesn't
break it
- const correctness demanded by recent gcc
--- getline.h.orig 1997-02-21 11:50:14.000000000 +0000
+++ getline.h
@@ -6,6 +6,9 @@
#include "buttons.h"
#include "bool.h"
@ -12,3 +17,12 @@ $NetBSD: patch-aj,v 1.1 2007/03/06 22:57:46 rillig Exp $
class getline
{public:
@@ -37,7 +40,7 @@ class getline
bool was_deactive;
bool is_single_char;
- getline (char name [],
+ getline (const char name [],
win *w,
char string [],
int x,

View file

@ -0,0 +1,26 @@
$NetBSD: patch-buttons_h,v 1.1 2011/12/20 16:18:16 dholland Exp $
- const correctness demanded by recent gcc
--- buttons.h.orig 1997-03-19 13:40:07.000000000 +0000
+++ buttons.h
@@ -58,7 +58,7 @@ class button
button (win *b_w,
- char b_label [],
+ const char b_label [],
int b_x,
int b_y,
bool b_with_repeat = false,
@@ -76,8 +76,8 @@ class button
void press (bool mode);
bool eval (int &button);
bool eval ();
- void write (char label_string []);
- void write (char label_string [], bool is_pressed);
+ void write (const char label_string []);
+ void write (const char label_string [], bool is_pressed);
};

View file

@ -0,0 +1,30 @@
$NetBSD: patch-buttons_hc,v 1.1 2011/12/20 16:18:16 dholland Exp $
- const correctness demanded by recent gcc
--- buttons.hc.orig 2011-12-20 15:13:53.000000000 +0000
+++ buttons.hc
@@ -12,7 +12,7 @@
#include "win.h"
button::button (win *b_w,
- char b_label [],
+ const char b_label [],
int b_x,
int b_y,
bool b_with_repeat,
@@ -179,12 +179,12 @@ bool button::eval (int &button)
}
-void button::write (char label_string [])
+void button::write (const char label_string [])
{strcpy (label, label_string);
write (label, is_pressed);
}
-void button::write (char label [], bool is_pressed)
+void button::write (const char label [], bool is_pressed)
{draw_border;
if (is_icon)
write_icon

View file

@ -0,0 +1,15 @@
$NetBSD: patch-cmap_h,v 1.1 2011/12/20 16:18:16 dholland Exp $
- const correctness demanded by recent gcc
--- cmap.h~ 1997-02-21 11:48:24.000000000 +0000
+++ cmap.h
@@ -23,7 +23,7 @@ class cmap
int rot;
cmap (win *w_i,
- char name_i [],
+ const char name_i [],
bool preload = true,
bool smart_load = true);
~cmap ();

View file

@ -0,0 +1,15 @@
$NetBSD: patch-cmap_hc,v 1.1 2011/12/20 16:18:16 dholland Exp $
- const correctness demanded by recent gcc
--- cmap.hc~ 2011-12-20 14:38:01.000000000 +0000
+++ cmap.hc
@@ -2,7 +2,7 @@
#include "cmap.h"
#include "xbm.h"
-cmap::cmap (win *w_i, char name_i [], bool preload, bool smart_load)
+cmap::cmap (win *w_i, const char name_i [], bool preload, bool smart_load)
{w = w_i;
is_mask = false;
is_loaded = false;

View file

@ -0,0 +1,35 @@
$NetBSD: patch-cmap_selector_h,v 1.1 2011/12/20 16:18:16 dholland Exp $
- const correctness demanded by recent gcc
--- cmap_selector.h~ 1997-02-21 11:48:24.000000000 +0000
+++ cmap_selector.h
@@ -40,7 +40,7 @@ class cmap_selector
int case_dy;
int case_dx;
- cmap_selector (char name [],
+ cmap_selector (const char name [],
win *w,
int num_cases,
char case_string [max_cmap_selector_cases][128],
@@ -55,7 +55,7 @@ class cmap_selector
void set_cases (int num_cases,
char case_string [max_cmap_selector_cases][128]);
void set_mark (int case_no, bool mode);
- void set_string (int case_no, char string []);
+ void set_string (int case_no, const char string []);
void refresh (int case_no);
bool is_mark (int case_no);
bool on ();
@@ -65,8 +65,8 @@ class cmap_selector
};
-bool cmap_sel (char name [], char pattern []);
-void get_file_list (char file_pattern [],
+bool cmap_sel (char name [], const char pattern []);
+void get_file_list (const char file_pattern [],
int &num_files,
char file_list [max_cmap_selector_cases][128]);

View file

@ -0,0 +1,42 @@
$NetBSD: patch-cmap_selector_hc,v 1.1 2011/12/20 16:18:16 dholland Exp $
- const correctness demanded by recent gcc
--- cmap_selector.hc.orig 2011-12-20 16:09:53.000000000 +0000
+++ cmap_selector.hc
@@ -11,7 +11,7 @@
#define cmap_selector_marked_case_color yellow
#define cmap_selector_unmarked_case_color black
-cmap_selector::cmap_selector (char v_name [],
+cmap_selector::cmap_selector (const char v_name [],
win *v_w,
int v_num_cases,
char v_case_string[max_cmap_selector_cases][128],
@@ -118,7 +118,7 @@ void cmap_selector::set_mark (int case_n
refresh (case_no);
}
-void cmap_selector::set_string (int case_no, char string [])
+void cmap_selector::set_string (int case_no, const char string [])
{strcpy (case_strings [case_no], string);
get_draw_length;
refresh (case_no);
@@ -290,7 +290,7 @@ bool cmap_selector::eval (int &case_no,
}
-bool cmap_sel (char name [], char pattern [])
+bool cmap_sel (char name [], const char pattern [])
{int num_cases;
char cases [max_cmap_selector_cases][128];
bool quit;
@@ -339,7 +339,7 @@ bool cmap_sel (char name [], char patter
}
-void get_file_list (char pattern [],
+void get_file_list (const char pattern [],
int &num_files,
char file_list [max_cmap_selector_cases][128])

View file

@ -0,0 +1,15 @@
$NetBSD: patch-compress_h,v 1.1 2011/12/20 16:18:16 dholland Exp $
- const correctness demanded by recent gcc
--- compress.h~ 1997-02-21 11:48:58.000000000 +0000
+++ compress.h
@@ -26,7 +26,7 @@ class compress
compress ();
~compress ();
- char *frame_name (char postfix []);
+ char *frame_name (const char postfix []);
void encode (char name []);
void decode (char name []);

View file

@ -0,0 +1,15 @@
$NetBSD: patch-compress_hc,v 1.1 2011/12/20 16:18:16 dholland Exp $
- const correctness demanded by recent gcc
--- compress.hc~ 2011-12-20 15:13:53.000000000 +0000
+++ compress.hc
@@ -25,7 +25,7 @@ compress::~compress ()
{
}
-char *compress::frame_name (char postfix [])
+char *compress::frame_name (const char postfix [])
{static char r [128];
sprintf (r, "%s%04d.%s", name, snr, postfix);

View file

@ -0,0 +1,24 @@
$NetBSD: patch-dial_h,v 1.1 2011/12/20 16:18:16 dholland Exp $
- const correctness demanded by recent gcc
--- dial.h~ 1997-02-21 11:50:13.000000000 +0000
+++ dial.h
@@ -46,7 +46,7 @@ class dial
bool with_edit;
dial (win *w,
- char title [],
+ const char title [],
int title_dx,
int x,
int y,
@@ -60,7 +60,7 @@ class dial
int incr2 = 0,
bool auto_repeat = false);
dial (win *w,
- char title [],
+ const char title [],
int title_dx,
int x,
int y,

View file

@ -0,0 +1,24 @@
$NetBSD: patch-dial_hc,v 1.1 2011/12/20 16:18:16 dholland Exp $
- const correctness demanded by recent gcc
--- dial.hc~ 2011-12-20 14:38:01.000000000 +0000
+++ dial.hc
@@ -16,7 +16,7 @@
#define val_dy 20
dial::dial (win *p_w,
- char p_title [],
+ const char p_title [],
int p_title_dx,
int p_x,
int p_y,
@@ -95,7 +95,7 @@ dial::dial (win *p_w,
dial::dial (win *p_w,
- char p_title [],
+ const char p_title [],
int p_title_dx,
int p_x,
int p_y,

View file

@ -0,0 +1,47 @@
$NetBSD: patch-errorhandling_h,v 1.1 2011/12/20 16:18:16 dholland Exp $
- const correctness demanded by recent gcc
--- errorhandling.h~ 1997-03-19 13:41:06.000000000 +0000
+++ errorhandling.h
@@ -13,26 +13,26 @@
#include "stdio.h"
void errorstop (int error_no,
- char c_class [],
- char msg []);
+ const char c_class [],
+ const char msg []);
void errorstop (int error_no,
- char c_class [],
- char msg [],
- char info []);
+ const char c_class [],
+ const char msg [],
+ const char info []);
void errorstop (int error_no,
- char c_class [],
- char msg [],
- char info [],
- char param1 []);
+ const char c_class [],
+ const char msg [],
+ const char info [],
+ const char param1 []);
void errorstop (int error_no,
- char c_class [],
- char msg [],
- char info [],
- char param1 [],
- char param2 []);
+ const char c_class [],
+ const char msg [],
+ const char info [],
+ const char param1 [],
+ const char param2 []);
#endif

View file

@ -0,0 +1,56 @@
$NetBSD: patch-errorhandling_hc,v 1.1 2011/12/20 16:18:16 dholland Exp $
- const correctness demanded by recent gcc
--- errorhandling.hc~ 2011-12-20 14:59:27.000000000 +0000
+++ errorhandling.hc
@@ -11,35 +11,35 @@
#include "paramreader.h"
void errorstop (int error_no,
- char c_class [],
- char msg [])
+ const char c_class [],
+ const char msg [])
{errorstop (error_no, c_class, msg, "-", "-", "-");
}
void errorstop (int error_no,
- char c_class [],
- char msg [],
- char info [])
+ const char c_class [],
+ const char msg [],
+ const char info [])
{errorstop (error_no, c_class, msg, info, "-", "-");
}
void errorstop (int error_no,
- char c_class [],
- char msg [],
- char info [],
- char param1 [])
+ const char c_class [],
+ const char msg [],
+ const char info [],
+ const char param1 [])
{errorstop (error_no, c_class, msg, info, param1, "-");
}
void errorstop (int error_no,
- char c_class [],
- char msg [],
- char info [],
- char param1 [],
- char param2 [])
+ const char c_class [],
+ const char msg [],
+ const char info [],
+ const char param1 [],
+ const char param2 [])
{printf ("ERROR (%d) : %s : %s : %s : %s : %s\n",
error_no,

View file

@ -0,0 +1,29 @@
$NetBSD: patch-file_selector_h,v 1.1 2011/12/20 16:18:16 dholland Exp $
- const correctness demanded by recent gcc
--- file_selector.h~ 1997-02-21 11:50:14.000000000 +0000
+++ file_selector.h
@@ -32,17 +32,17 @@ class file_selector
button *cancel;
- file_selector (char name [],
+ file_selector (const char name [],
int x,
int y,
- char file_name [],
- char file_pattern [],
+ const char file_name [],
+ const char file_pattern [],
bool must_exists = true);
- file_selector (char name [],
+ file_selector (const char name [],
int x,
int y,
- char full_file_name [],
+ const char full_file_name [],
bool must_exist = true);
~file_selector ();

View file

@ -0,0 +1,34 @@
$NetBSD: patch-file_selector_hc,v 1.1 2011/12/20 16:18:16 dholland Exp $
- const correctness demanded by recent gcc
--- file_selector.hc~ 2011-12-20 15:13:53.000000000 +0000
+++ file_selector.hc
@@ -23,10 +23,10 @@
#define pattern_dx 292
#define pattern_dy 20
-file_selector::file_selector (char p_name [],
+file_selector::file_selector (const char p_name [],
int x,
int y,
- char full_file_name [],
+ const char full_file_name [],
bool must_exist)
{store_params;
@@ -77,11 +77,11 @@ file_selector::file_selector (char p_nam
}
-file_selector::file_selector (char p_name [],
+file_selector::file_selector (const char p_name [],
int x,
int y,
- char p_file_name [],
- char p_file_pattern [],
+ const char p_file_name [],
+ const char p_file_pattern [],
bool must_exist)
{store_params;

View file

@ -0,0 +1,15 @@
$NetBSD: patch-getline_c,v 1.1 2011/12/20 16:18:16 dholland Exp $
- const correctness demanded by recent gcc
--- getline.hc~ 2011-12-20 14:38:01.000000000 +0000
+++ getline.hc
@@ -4,7 +4,7 @@
#define hist_button_name "/hist.open"
-getline::getline (char v_name [],
+getline::getline (const char v_name [],
win *v_w,
char v_string [],
int v_x,

View file

@ -0,0 +1,101 @@
$NetBSD: patch-hcc_hcc_hc,v 1.1 2011/12/20 16:18:16 dholland Exp $
- use standard headers
- don't croak on platforms where char is unsigned
- const correctness demanded by recent gcc
- declare main's return type
- should match patch-ag
--- hcc/hcc.hc.orig 2011-12-20 14:59:27.000000000 +0000
+++ hcc/hcc.hc
@@ -1,6 +1,5 @@
-#include "bool.h"
#include "stdio.h"
-#include "std.h"
+#include "stdlib.h"
#include "string.h"
#include "ctype.h"
@@ -39,7 +38,7 @@ FILE *src;
-void f_open (FILE *&f, char name [], char mode [])
+void f_open (FILE *&f, const char name [], const char mode [])
{f = fopen (name, mode);
check_error;
@@ -53,7 +52,7 @@ void f_open (FILE *&f, char name [], cha
}
-char *substring (char s [], int from)
+char *substring (const char s [], int from)
{static bool is_init = false;
static char *result;
@@ -74,7 +73,7 @@ char *substring (char s [], int from)
}
-char *substring (char s [], int from, int to)
+char *substring (const char s [], int from, int to)
{static bool is_init = false;
static char *result;
@@ -101,8 +100,8 @@ char *substring (char s [], int from, in
void changeall (char s [],
int max_length_of_s,
- char tmplate [],
- char replacement [])
+ const char tmplate [],
+ const char replacement [])
{char *pos;
@@ -147,7 +146,7 @@ void changeall (char s [],
}
-char *complete (char name [], char tail [])
+char *complete (const char name [], const char tail [])
{static char r [256];
strcpy (r, name);
@@ -198,7 +197,7 @@ void dump_line_cor ()
};
}
-void pass_1_error (int line_no, char msg [], int l)
+void pass_1_error (int line_no, const char msg [], int l)
{char err_msg [256];
char ii [128];
@@ -210,7 +209,7 @@ void pass_1_error (int line_no, char msg
exit (1);
}
-void pass_1_error (int line_no, char msg [])
+void pass_1_error (int line_no, const char msg [])
{fclose (src);
printf ("error : %d : %s\n", line_no, msg);
exit (1);
@@ -226,7 +225,7 @@ bool pass_1 (char src_name [])
char last_last_sym;
int last_ref_sym_line;
int last_ref_sym_no;
- char sym;
+ signed char sym;
int nested_brackets;
bool inside_refinement;
bool inside_string;
@@ -883,7 +882,7 @@ void pass_3 (char src_name [])
}
-main (int num_params, char *shell_params [])
+int main (int num_params, char *shell_params [])
{char gcc_exec [256];
char src_name [256];
char options [256];

View file

@ -0,0 +1,19 @@
$NetBSD: patch-io_h,v 1.1 2011/12/20 16:18:16 dholland Exp $
- const correctness demanded by recent gcc
--- io.h~ 1997-03-19 13:41:40.000000000 +0000
+++ io.h
@@ -13,9 +13,9 @@
#define io_h
void ack ();
-void s_ack (char msg []);
+void s_ack (const char msg []);
bool ok ();
-double d_get (char msg []);
-int i_get (char msg []);
+double d_get (const char msg []);
+int i_get (const char msg []);
#endif

View file

@ -0,0 +1,33 @@
$NetBSD: patch-io_hc,v 1.1 2011/12/20 16:18:16 dholland Exp $
- const correctness demanded by recent gcc
--- io.hc~ 2011-12-20 15:13:53.000000000 +0000
+++ io.hc
@@ -4,7 +4,7 @@ void ack ()
{while (getchar () != '\n');
}
-void s_ack (char msg [])
+void s_ack (const char msg [])
{printf ("%s ", msg);
ack ();
}
@@ -13,7 +13,7 @@ bool ok ()
{return (getchar () != 'q');
}
-double d_get (char msg [])
+double d_get (const char msg [])
{float d;
printf ("%s", msg);
@@ -21,7 +21,7 @@ double d_get (char msg [])
return (double) d;
}
-int i_get (char msg [])
+int i_get (const char msg [])
{int i;
printf ("%s", msg);

View file

@ -0,0 +1,45 @@
$NetBSD: patch-masks_h,v 1.1 2011/12/20 16:18:16 dholland Exp $
- const correctness demanded by recent gcc
--- masks.h~ 1997-02-21 11:52:06.000000000 +0000
+++ masks.h
@@ -25,27 +25,27 @@ void frame (win *w,
int dx, int dy,
int color_1, int color_2);
-bool yes (win *w, char host [], char question []);
-bool yes (char host [], char question []);
-bool yes (char question []);
-void ack (char host [], char msg []);
-void ack (char message []);
+bool yes (win *w, const char host [], const char question []);
+bool yes (const char host [], const char question []);
+bool yes (const char question []);
+void ack (const char host [], const char msg []);
+void ack (const char message []);
void tell (win *&w,
- char message []);
-void tell (char host [],
+ const char message []);
+void tell (const char host [],
win *&w,
- char message []);
-void tell (char host [],
+ const char message []);
+void tell (const char host [],
win *parent,
win *&w,
- char message []);
+ const char message []);
bool get_line (char s [],
char name [],
int dx = 300,
bool with_history = true);
-int select (char menu_string [], char *name = NULL);
+int select (const char menu_string [], char *name = NULL);
#endif

View file

@ -0,0 +1,75 @@
$NetBSD: patch-masks_hc,v 1.1 2011/12/20 16:18:16 dholland Exp $
- const correctness demanded by recent gcc
--- masks.hc~ 2011-12-20 15:13:53.000000000 +0000
+++ masks.hc
@@ -67,11 +67,11 @@ void frame (win *w, int x1, int y1, int
w->line (x1, y2, x1, y1);
}
-bool yes (char question [])
+bool yes (const char question [])
{return yes ("", question);
}
-bool yes (char host [], char question [])
+bool yes (const char host [], const char question [])
{win *w;
button *ok;
button *no;
@@ -125,7 +125,7 @@ bool yes (char host [], char question []
}
-bool yes (win *parent, char host [], char question [])
+bool yes (win *parent, const char host [], const char question [])
{win *w;
button *ok;
button *no;
@@ -179,11 +179,11 @@ bool yes (win *parent, char host [], cha
}
-void ack (char message [])
+void ack (const char message [])
{ack ("", message);
}
-void ack (char host [], char message [])
+void ack (const char host [], const char message [])
{win *w;
button *ok;
int dx;
@@ -262,11 +262,11 @@ void ack (char host [], char message [])
}
-void tell (win *&w, char message [])
+void tell (win *&w, const char message [])
{tell ("", w, message);
}
-void tell (char host [], win *&w, char message [])
+void tell (const char host [], win *&w, const char message [])
{open_mask;
tell_message;
@@ -295,7 +295,7 @@ void tell (char host [], win *&w, char m
}
-void tell (char host [], win *parent, win *&w, char message [])
+void tell (const char host [], win *parent, win *&w, const char message [])
{open_mask;
tell_message;
@@ -365,7 +365,7 @@ bool get_line (char s [],
}
-int select (char menu_string [], char *name)
+int select (const char menu_string [], char *name)
{menu *m;
char *m_string;
char m_name [512];

View file

@ -0,0 +1,28 @@
$NetBSD: patch-menu_h,v 1.1 2011/12/20 16:18:16 dholland Exp $
- const correctness demanded by recent gcc
--- menu.h~ 1997-03-19 13:41:59.000000000 +0000
+++ menu.h
@@ -93,10 +93,10 @@ class menu
menu ();
- menu (char name [],
+ menu (const char name [],
int x,
int y,
- char cmds [],
+ const char cmds [],
int wmode = m_pop_up,
int menu_group = std_menu_group);
@@ -112,7 +112,7 @@ class menu
void release ();
void release (int no);
void write (int m_no, char string [], bool pressed = false);
- bool get_cmd (char cmds [], int &p, char cmd []);
+ bool get_cmd (const char cmds [], int &p, char cmd []);
};

View file

@ -0,0 +1,28 @@
$NetBSD: patch-menu_hc,v 1.1 2011/12/20 16:18:16 dholland Exp $
- const correctness demanded by recent gcc
--- menu.hc~ 2011-12-20 15:13:53.000000000 +0000
+++ menu.hc
@@ -27,10 +27,10 @@ menu::menu ()
{
}
-menu::menu (char w_name [],
+menu::menu (const char w_name [],
int w_x,
int w_y,
- char w_cmds [],
+ const char w_cmds [],
int w_mode,
int menu_group)
@@ -363,7 +363,7 @@ void menu::release (int no)
is_pressed [no] = false;
}
-bool menu::get_cmd (char cmds [], int &p, char cmd [])
+bool menu::get_cmd (const char cmds [], int &p, char cmd [])
{if (eof)
return false;
else read_cmd;

View file

@ -0,0 +1,15 @@
$NetBSD: patch-object_handler_h,v 1.1 2011/12/20 16:18:17 dholland Exp $
- const correctness demanded by recent gcc
--- object_handler.h~ 1997-04-17 13:07:38.000000000 +0000
+++ object_handler.h
@@ -297,7 +297,7 @@ class object_handler
bool can_built (int id, int x, int y, int cmd,
bool is_robot = false);
bool attack_possible (int id, int x, int y);
- void write (int color, char msg []);
+ void write (int color, const char msg []);
bool direct_move (int id, int range, int &dx, int &dy);
bool max_diff (int x, int y, int h);
bool min_diff (int x, int y, int h);

View file

@ -0,0 +1,15 @@
$NetBSD: patch-object_handler_hc,v 1.1 2011/12/20 16:18:17 dholland Exp $
- const correctness demanded by recent gcc
--- object_handler.hc~ 2011-12-20 15:13:53.000000000 +0000
+++ object_handler.hc
@@ -9321,7 +9321,7 @@ bool object_handler::readmin (int n_col
}
-void object_handler::write (int color, char msg [])
+void object_handler::write (int color, const char msg [])
{players [color_player [color]]->write (msg);
}

View file

@ -0,0 +1,29 @@
$NetBSD: patch-paramreader_h,v 1.1 2011/12/20 16:18:17 dholland Exp $
- const correctness demanded by recent gcc
--- paramreader.h.orig 1997-03-19 13:42:26.000000000 +0000
+++ paramreader.h
@@ -56,15 +56,15 @@ class paramreader
int num_includes;
- paramreader (char *param_file_name);
+ paramreader (const char *param_file_name);
void dump ();
- char * s_param (char name []);
- double d_param (char name []);
- int i_param (char name []);
- int param_no (char name []);
- void set (char name [], char value []);
- void read_sym (char sym [], bool &is_eof);
+ char * s_param (const char name []);
+ double d_param (const char name []);
+ int i_param (const char name []);
+ int param_no (const char name []);
+ void set (const char name [], const char value []);
+ void read_sym (const char sym [], bool &is_eof);
int max_i_name ();
};

View file

@ -0,0 +1,36 @@
$NetBSD: patch-player_h,v 1.1 2011/12/20 16:18:17 dholland Exp $
- const correctness demanded by recent gcc
--- player.h~ 1997-02-21 11:52:14.000000000 +0000
+++ player.h
@@ -149,7 +149,7 @@ class player
void edit ();
void inform (char msg []);
- void write (char msg []);
+ void write (const char msg []);
void load_pics ();
@@ -184,17 +184,17 @@ class player
int x_center (int lx);
int y_center (int ly);
- void show_percent (int x,int y,int dx,int dy,int p,char title []);
+ void show_percent (int x,int y,int dx,int dy,int p, const char title []);
void clear_percent (int x,int y,int dx,int dy);
void clear_status ();
void show_status (int id, bool is_first_time);
- void push_cmd (char name [],
+ void push_cmd (const char name [],
int code,
char c,
int price,
int wood);
- void adjust_cmd (int cmd, char c, char name []);
+ void adjust_cmd (int cmd, char c, const char name []);
void adjust_cmds ();
void talk (char from [], char msg []);

View file

@ -0,0 +1,48 @@
$NetBSD: patch-player_hc,v 1.1 2011/12/20 16:18:17 dholland Exp $
- const correctness demanded by recent gcc
--- player.hc~ 2011-12-20 15:13:53.000000000 +0000
+++ player.hc
@@ -2113,7 +2113,7 @@ int player::y_center (int ly)
{return (ly * pic_dy);
}
-void player::show_percent (int x, int y, int dx, int dy, int p, char title [])
+void player::show_percent (int x, int y, int dx, int dy, int p, const char title [])
{if (! is_robot)
perform_show;
@@ -2176,7 +2176,7 @@ void player::clear_status ()
}
-void player::push_cmd (char name [], int code, char c, int a_price, int a_wood)
+void player::push_cmd (const char name [], int code, char c, int a_price, int a_wood)
{cmds [num_cmds] = new button (w_status, name, x_cmd, y_cmd);
cmd_code [num_cmds] = code;
cmd_char [num_cmds] = c;
@@ -2394,7 +2394,7 @@ bool supports (int type, int c)
}
-void player::adjust_cmd (int cmd, char c, char name [])
+void player::adjust_cmd (int cmd, char c, const char name [])
{bool is_ok = true;
check_units;
@@ -2869,12 +2869,12 @@ void player::inform (char msg [])
}
-void player::write (char msg [])
+void player::write (const char msg [])
{
}
/*
-void player::write (char msg [])
+void player::write (const char msg [])
{if (! is_robot)
perform_show;

View file

@ -0,0 +1,15 @@
$NetBSD: patch-scroller_h,v 1.1 2011/12/20 16:18:17 dholland Exp $
- const correctness demanded by recent gcc
--- scroller.h~ 1997-02-21 11:52:19.000000000 +0000
+++ scroller.h
@@ -39,7 +39,7 @@ class scroller
button *button_incr;
button *button_decr;
- scroller (char name [],
+ scroller (const char name [],
win *w,
int x,
int y,

View file

@ -0,0 +1,15 @@
$NetBSD: patch-scroller_hc,v 1.1 2011/12/20 16:18:17 dholland Exp $
- const correctness demanded by recent gcc
--- scroller.hc~ 2011-12-20 14:38:01.000000000 +0000
+++ scroller.hc
@@ -4,7 +4,7 @@
#define bar_button_size 14
#define bar_size 16
-scroller::scroller (char v_name [],
+scroller::scroller (const char v_name [],
win *v_w,
int v_x,
int v_y,

View file

@ -0,0 +1,15 @@
$NetBSD: patch-selector_h,v 1.1 2011/12/20 16:18:17 dholland Exp $
- const correctness demanded by recent gcc
--- selector.h~ 1997-02-21 11:52:20.000000000 +0000
+++ selector.h
@@ -38,7 +38,7 @@ class selector
bool mark [max_selector_cases];
int case_dy;
- selector (char name [],
+ selector (const char name [],
win *w,
int num_cases,
char case_string [max_selector_cases][128],

View file

@ -0,0 +1,15 @@
$NetBSD: patch-selector_hc,v 1.1 2011/12/20 16:18:17 dholland Exp $
- const correctness demanded by recent gcc
--- selector.hc~ 2011-12-20 15:13:53.000000000 +0000
+++ selector.hc
@@ -10,7 +10,7 @@
#define selector_marked_case_color yellow
#define selector_unmarked_case_color black
-selector::selector (char v_name [],
+selector::selector (const char v_name [],
win *v_w,
int v_num_cases,
char v_case_string [max_selector_cases][128],

View file

@ -0,0 +1,26 @@
$NetBSD: patch-table_h,v 1.1 2011/12/20 16:18:17 dholland Exp $
- const correctness demanded by recent gcc
--- table.h~ 1997-03-19 13:43:26.000000000 +0000
+++ table.h
@@ -68,7 +68,7 @@ class table
table (char dir [], char name [], bool &is_new, int lru_size = 0);
~table ();
- void check_bound (int adr, int row_no, int column_no, char action []);
+ void check_bound (int adr, int row_no, int column_no, const char action []);
void save ();
void load ();
@@ -76,8 +76,8 @@ class table
void rename (char new_name []);
void copy (table *destination);
- int add_column (char name [], int type);
- int column_no (char name []);
+ int add_column (const char name [], int type);
+ int column_no (const char name []);
int num_columns ();
int candidate (bool &with_remove);

View file

@ -0,0 +1,33 @@
$NetBSD: patch-table_hc,v 1.1 2011/12/20 16:18:17 dholland Exp $
- const correctness demanded by recent gcc
--- table.hc~ 2011-12-20 15:13:53.000000000 +0000
+++ table.hc
@@ -66,7 +66,7 @@ table::~table ()
delete (lru_queue);
}
-void table::check_bound (int adr, int row_no, int column_no, char action [])
+void table::check_bound (int adr, int row_no, int column_no, const char action [])
{if (row_no < 0 || row_no >= number_of_rows) {
fprintf (stderr, "row = %d\n", row_no);
errorstop (4, "table", action, "row out of range", name);
@@ -424,7 +424,7 @@ void table::copy (table *dest)
}
-int table::add_column (char name [], int type)
+int table::add_column (const char name [], int type)
{int col_no;
get_col_no;
@@ -462,7 +462,7 @@ int table::add_column (char name [], int
}
-int table::column_no (char name [])
+int table::column_no (const char name [])
{for (int i = 0; i < number_of_rows; i++)
if (strcmp (column_name [i], name) == 0)
return i;

View file

@ -0,0 +1,88 @@
$NetBSD: patch-win_h,v 1.1 2011/12/20 16:18:17 dholland Exp $
- const correctness demanded by recent gcc
--- win.h.orig 1997-03-19 13:43:52.000000000 +0000
+++ win.h
@@ -129,7 +129,7 @@ bool bitmap_size (char name [], int &dx,
/* ROUTINES text size information (deklarations) */
/*----------------------------------------------------------------------*/
-void text_size (char s [], char font [], int &dx, int &dy, int &num_of_lines);
+void text_size (const char s [], const char font [], int &dx, int &dy, int &num_of_lines);
/*----------------------------------------------------------------------*/
/* Default Handler (deklarations) */
@@ -140,12 +140,12 @@ void text_size (char s [], char font [],
extern bool win_handler_init;
extern paramreader *win_defaults;
-int win_default_i (int param, char default_name []);
-int win_default_i (char default_name []);
-int win_default_c (int param, char default_name []);
-int win_default_c (char default_name []);
-char *win_default_s (char default_name []);
-int win_color (char color_name []);
+int win_default_i (int param, const char default_name []);
+int win_default_i (const char default_name []);
+int win_default_c (int param, const char default_name []);
+int win_default_c (const char default_name []);
+char *win_default_s (const char default_name []);
+int win_color (const char color_name []);
/*----------------------------------------------------------------------*/
/* CLASS polyline (deklarations) */
@@ -241,10 +241,10 @@ class win
int event_mark;
int event_id;
- win (char title []);
+ win (const char title []);
- win (char title [],
- char host [],
+ win (const char title [],
+ const char host [],
int x,
int y,
int dx,
@@ -252,8 +252,8 @@ class win
bool enable = true,
bool resize_enable = false);
win (win *parent,
- char title [],
- char host [],
+ const char title [],
+ const char host [],
int x,
int y,
int dx,
@@ -289,9 +289,9 @@ class win
void mark_mouse ();
void scratch_mouse ();
void clear ();
- void set_font (char name []);
- void text_size (char string [], int &dx, int &dy);
- void write (int x, int y, char string []);
+ void set_font (const char name []);
+ void text_size (const char string [], int &dx, int &dy);
+ void write (int x, int y, const char string []);
void write (int x, int y, double d);
void write (int x, int y, int i);
void set_clip (int x, int y, int dx, int dy);
@@ -332,13 +332,13 @@ class win
int dy ();
void tick (bool just_raised);
void tick ();
- void alloc_color (char name [], int no);
+ void alloc_color (const char name [], int no);
void create_color_map ();
void draw (polyline *p);
void fill (polyline *p);
void xsync ();
- Window grab (Display *dsp, Window wnd, char name []);
+ Window grab (Display *dsp, Window wnd, const char name []);
void get_image (XImage *&i, int x, int y, int dx, int dy);
void put_image (XImage *i, int x, int y, int dx, int dy);

View file

@ -0,0 +1,51 @@
$NetBSD: patch-xfile_h,v 1.1 2011/12/20 16:18:17 dholland Exp $
- const correctness demanded by recent gcc
--- xfile.h.orig 1997-03-19 13:44:01.000000000 +0000
+++ xfile.h
@@ -15,28 +15,28 @@
#include "bool.h"
double d_get (FILE *f, bool &is_eof);
-time_t f_date (char f_name []);
-bool f_exists (char f_name []);
-void f_open (FILE *&f, char name [], char mode []);
-void f_open_with_extend (FILE *&f, char name [], char mode [], int max_no);
+time_t f_date (const char f_name []);
+bool f_exists (const char f_name []);
+void f_open (FILE *&f, const char name [], const char mode []);
+void f_open_with_extend (FILE *&f, const char name [], const char mode [], int max_no);
char *f_getline (FILE *f, char line [], int max_length);
char *f_postfix (char full_path []);
-char *f_name (char full_path []);
-char *f_tail (char full_path []);
-char *f_path (char full_path []);
-char *f_home_dir (char full_path []);
-bool f_is_pattern (char f_name []);
-bool f_is_dir (char f_name []);
-bool f_is_home_dir (char f_name []);
+char *f_name (const char full_path []);
+char *f_tail (const char full_path []);
+char *f_path (const char full_path []);
+char *f_home_dir (const char full_path []);
+bool f_is_pattern (const char f_name []);
+bool f_is_dir (const char f_name []);
+bool f_is_home_dir (const char f_name []);
-bool sel_get_name (char name [],
+bool sel_get_name (const char name [],
char f_name [],
- char f_pat [],
- char mode []);
+ const char f_pat [],
+ const char mode []);
-char *complete (char name [],
- char tail []);
+char *complete (const char name [],
+ const char tail []);
void bprintf (FILE *f, int num_bytes, int i);
bool bscanf (FILE *f, int num_bytes, int &i);

View file

@ -0,0 +1,17 @@
$NetBSD: patch-xstring_h,v 1.1 2011/12/20 16:18:17 dholland Exp $
- const correctness demanded by recent gcc
--- xstring.h~ 1997-02-21 11:52:27.000000000 +0000
+++ xstring.h
@@ -14,8 +14,8 @@ void changeall (char s [],
int max_length_of_s,
char tmpalte [],
char replacement []);
-char *substring (char s [], int from, int to);
-char *substring (char s [], int from);
+char *substring (const char s [], int from, int to);
+char *substring (const char s [], int from);
int submatch (char s [], char p [], int &pos);
void strcat (char s [], int len, char app []);
void delchar (char s [], int pos);

View file

@ -0,0 +1,24 @@
$NetBSD: patch-xstring_hc,v 1.1 2011/12/20 16:18:17 dholland Exp $
- const correctness demanded by recent gcc
--- xstring.hc~ 2011-12-20 15:05:11.000000000 +0000
+++ xstring.hc
@@ -130,7 +130,7 @@ void changeall (char s [],
}
-char *substring (char s [], int from)
+char *substring (const char s [], int from)
{static bool is_init = false;
static char *result;
@@ -151,7 +151,7 @@ char *substring (char s [], int from)
}
-char *substring (char s [], int from, int to)
+char *substring (const char s [], int from, int to)
{static bool is_init = false;
static char *result;

View file

@ -0,0 +1,24 @@
$NetBSD: patch-xtimer_h,v 1.1 2011/12/20 16:18:17 dholland Exp $
- Fix y2038 issue.
--- xtimer.h~ 1997-04-25 12:49:00.000000000 +0000
+++ xtimer.h
@@ -13,7 +13,7 @@
class xtimer
{private :
- long stamp;
+ long long stamp;
double dt;
public :
@@ -26,7 +26,7 @@ class xtimer
};
-long x_sys_time ();
+long long x_sys_time ();
void delay (int dt);
#endif

View file

@ -0,0 +1,31 @@
$NetBSD: patch-xtimer_hc,v 1.1 2011/12/20 16:18:17 dholland Exp $
- Fix y2038 issue.
- Don't use legacy time function ftime().
--- xtimer.hc~ 2011-12-20 14:14:03.000000000 +0000
+++ xtimer.hc
@@ -5,19 +5,15 @@
#include "sys/time.h"
#include "signal.h"
-extern "C"
- {int ftime (struct timeb *);
- }
-
/*----------------------------------------------------------------------*/
/* CLASS xtimer (funktions) */
/*----------------------------------------------------------------------*/
-long x_sys_time ()
- {struct timeb tb;
+long long x_sys_time ()
+ {struct timeval tv;
- ftime (&tb);
- return (tb.time * 1000 + (unsigned long) tb.millitm);
+ gettimeofday (&tv, NULL);
+ return (tv.tv_sec * 1000 + (unsigned long) tv.tv_usec / 1000);
}
void xtimer::start ()