Mon Dec 24 01:50:58 2012 UTC ()
Fix LP64 problems and patch up some other stuff that appeared while
doing so.
(dholland)
diff -r1.11 -r1.12 pkgsrc/print/bibtool/Makefile
diff -r1.1.1.1 -r1.2 pkgsrc/print/bibtool/distinfo
diff -r0 -r1.1 pkgsrc/print/bibtool/patches/patch-configure
diff -r0 -r1.1 pkgsrc/print/bibtool/patches/patch-main.c
diff -r0 -r1.1 pkgsrc/print/bibtool/patches/patch-parse.c
diff -r0 -r1.1 pkgsrc/print/bibtool/patches/patch-regex-0.12_regex.c
--- pkgsrc/print/bibtool/Makefile 2012/12/24 00:56:19 1.11
+++ pkgsrc/print/bibtool/Makefile 2012/12/24 01:50:57 1.12
--- pkgsrc/print/bibtool/distinfo 2006/03/31 03:11:56 1.1.1.1
+++ pkgsrc/print/bibtool/distinfo 2012/12/24 01:50:57 1.2
$NetBSD: patch-configure,v 1.1 2012/12/24 01:50:57 dholland Exp $
Disable a highly obsolete configure test that exercises undefined
behavior.
--- configure~ 2012-12-24 01:44:27.000000000 +0000
+++ configure
@@ -2789,7 +2789,8 @@ fi
if test $ac_cv_header_stdc = yes; then
# /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
- if test "$cross_compiling" = yes; then
+ # disabled 20121222, IRIX 4 is long dead and this test exercises UB.
+ if true; then
:
else
cat >conftest.$ac_ext <<_ACEOF
$NetBSD: patch-main.c,v 1.1 2012/12/24 01:50:57 dholland Exp $
Remove wrong casts.
--- main.c~ 2004-02-08 09:41:38.000000000 +0000
+++ main.c
@@ -789,10 +789,10 @@ static int update_crossref(db,rec) /
/* */
t = *++hp; t++; /* */
(void)sp_open(t); /* Try to extract */
- if ( (s = SParseSymbol(&t)) == (Uchar)NULL ) /* the crossref as symbol*/
+ if ( (s = SParseSymbol(&t)) == NULL ) /* the crossref as symbol*/
{ return 0; } /* */
/* */
- if ( (s = db_new_key(db,s)) == (Uchar)NULL ) /* */
+ if ( (s = db_new_key(db,s)) == NULL ) /* */
{ ERROR2("Crossref not found: ",(char*)s); /* */
return 0; /* */
} /* */
$NetBSD: patch-parse.c,v 1.1 2012/12/24 01:50:58 dholland Exp $
Fix bug handling EOF, detected by gcc.
--- parse.c~ 2004-02-08 09:41:45.000000000 +0000
+++ parse.c
@@ -533,13 +533,15 @@ static void parse_number() /*
static int parse_string(quotep) /* */
int quotep; /* */
{ Uchar c; /* */
+ int c1; /* */
int left; /* */
int start_flno = flno; /* */
/* */
left = 0; /* */
if ( quotep ) (void)sbputchar('"',parse_sb); /*" */
do /* */
- { switch ( c=skip_nl() ) /* */
+ { c=c1=skip_nl(); /* */
+ switch ( c1 ) /* */
{ case EOF: /* */
UnterminatedError("Unterminated double quote",
start_flno);
$NetBSD: patch-regex-0.12_regex.c,v 1.1 2012/12/24 01:50:58 dholland Exp $
Use the right config.h. This package misuses autoconf fairly
extensively, and has its own config.h with its own config in it where
where autoconf packages would normally put autoconf's output config.h.
Also patch up some integer/pointer casts.
--- regex-0.12/regex.c.orig 2000-12-16 09:49:55.000000000 +0000
+++ regex-0.12/regex.c
@@ -30,7 +30,7 @@
#include <sys/types.h>
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include "bibtool/config.h"
#endif
/* The `emacs' switch turns on certain matching commands
@@ -65,9 +65,12 @@
#ifdef STDC_HEADERS
#include <stdlib.h>
+#include <stdint.h>
#else
char *malloc ();
char *realloc ();
+typedef long intptr_t;
+typedef unsigned long uintptr_t;
#endif
@@ -2404,10 +2407,10 @@ typedef struct
} \
\
DEBUG_PRINT2 (" Pushing low active reg: %d\n", lowest_active_reg);\
- PUSH_FAILURE_ITEM (lowest_active_reg); \
+ PUSH_FAILURE_ITEM ((uintptr_t)lowest_active_reg); \
\
DEBUG_PRINT2 (" Pushing high active reg: %d\n", highest_active_reg);\
- PUSH_FAILURE_ITEM (highest_active_reg); \
+ PUSH_FAILURE_ITEM ((uintptr_t)highest_active_reg); \
\
DEBUG_PRINT2 (" Pushing pattern 0x%x: ", pattern_place); \
DEBUG_PRINT_COMPILED_PATTERN (bufp, pattern_place, pend); \
@@ -2492,10 +2495,10 @@ typedef struct
DEBUG_PRINT_COMPILED_PATTERN (bufp, pat, pend); \
\
/* Restore register info. */ \
- high_reg = (unsigned) POP_FAILURE_ITEM (); \
+ high_reg = (unsigned)(uintptr_t) POP_FAILURE_ITEM (); \
DEBUG_PRINT2 (" Popping high active reg: %d\n", high_reg); \
\
- low_reg = (unsigned) POP_FAILURE_ITEM (); \
+ low_reg = (unsigned)(uintptr_t) POP_FAILURE_ITEM (); \
DEBUG_PRINT2 (" Popping low active reg: %d\n", low_reg); \
\
for (this_reg = high_reg; this_reg >= low_reg; this_reg--) \
@@ -3762,7 +3765,7 @@ re_match_2 (bufp, string1, size1, string
regstart[r] = old_regstart[r];
/* xx why this test? */
- if ((int) old_regend[r] >= (int) regstart[r])
+ if ((intptr_t) old_regend[r] >= (intptr_t) regstart[r])
regend[r] = old_regend[r];
}
}