From acdf21e1a7f8c229cbc58bda11ae91eea6714f47 Mon Sep 17 00:00:00 2001 From: dholland Date: Mon, 3 Oct 2011 01:45:21 +0000 Subject: Fix conflict with POSIX getline; fix LP64 issues found by gcc. --- graphics/xgraph/distinfo | 4 +++- graphics/xgraph/patches/patch-dialog_c | 33 +++++++++++++++++++++++++++++++++ graphics/xgraph/patches/patch-st_c | 27 +++++++++++++++++++++++++++ 3 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 graphics/xgraph/patches/patch-dialog_c create mode 100644 graphics/xgraph/patches/patch-st_c (limited to 'graphics/xgraph') diff --git a/graphics/xgraph/distinfo b/graphics/xgraph/distinfo index e0c3c0a2e82..09dcb7641d7 100644 --- a/graphics/xgraph/distinfo +++ b/graphics/xgraph/distinfo @@ -1,7 +1,9 @@ -$NetBSD: distinfo,v 1.4 2005/12/19 16:22:56 joerg Exp $ +$NetBSD: distinfo,v 1.5 2011/10/03 01:45:21 dholland Exp $ SHA1 (xgraph-11.3.2-hack.9.tar.gz) = 6e695d2008094e8aca54795c7c73ed239d0d5404 RMD160 (xgraph-11.3.2-hack.9.tar.gz) = 3d1344b9e97b72886faaedce92b697dbc9503a1b Size (xgraph-11.3.2-hack.9.tar.gz) = 101979 bytes SHA1 (patch-aa) = cc5f9a2c5d2ca604459f581b41fd3e6cc82633d5 SHA1 (patch-ab) = c04e437b082e3f06ba3c88f3bb605882ce5ad297 +SHA1 (patch-dialog_c) = 9127063712889ebf8e7f197d9b8e6ee6ea64c494 +SHA1 (patch-st_c) = bb47aa944b4cd0827a05fb211cee1f0920c69b68 diff --git a/graphics/xgraph/patches/patch-dialog_c b/graphics/xgraph/patches/patch-dialog_c new file mode 100644 index 00000000000..c8830daa2b9 --- /dev/null +++ b/graphics/xgraph/patches/patch-dialog_c @@ -0,0 +1,33 @@ +$NetBSD: patch-dialog_c,v 1.1 2011/10/03 01:45:22 dholland Exp $ + +- fix conflict with POSIX getline + +--- dialog.c~ 1998-05-22 12:19:06.000000000 +0000 ++++ dialog.c +@@ -32,7 +32,7 @@ static short gray_bits[] = { + + static void make_msg_box(); + static void del_msg_box(); +-static int getline(); ++static int get_line(char **, char *); + + + #define D_VPAD 2 +@@ -702,7 +702,7 @@ xtb_frame *frame; /* Returned frame */ + new_info->lines = (Window *) malloc((unsigned) (sizeof(Window) * E_LINES)); + + lineptr = text; +- while (getline(&lineptr, line)) { ++ while (get_line(&lineptr, line)) { + if (new_info->num_lines >= new_info->alloc_lines) { + new_info->alloc_lines *= 2; + new_info->lines = (Window *) realloc((char *) new_info->lines, +@@ -800,7 +800,7 @@ char *err_text; + + + +-static int getline(tptr, lptr) ++static int get_line(tptr, lptr) + char **tptr; + char *lptr; + /* diff --git a/graphics/xgraph/patches/patch-st_c b/graphics/xgraph/patches/patch-st_c new file mode 100644 index 00000000000..552cbee43f1 --- /dev/null +++ b/graphics/xgraph/patches/patch-st_c @@ -0,0 +1,27 @@ +$NetBSD: patch-st_c,v 1.1 2011/10/03 01:45:22 dholland Exp $ + +- Fix LP64 issues. + +--- st.c.orig 1998-05-22 12:27:04.000000000 +0000 ++++ st.c +@@ -11,6 +11,7 @@ + + #include + #include ++#include + #include "copyright.h" + + #include "st.h" +@@ -21,9 +22,9 @@ + #define alloc(type) (type *) malloc(sizeof(type)) + + #define ABS(x) ((x) < 0 ? -(x) : (x)) +-#define ST_NUMCMP(x,y) ((int) (x) - (int) (y)) +-#define ST_NUMHASH(x,size) (ABS((int)x)%(size)) +-#define ST_PTRHASH(x,size) ((int)((unsigned)(x)>>2)%size) ++#define ST_NUMCMP(x,y) ((intptr_t) (x) - (intptr_t) (y)) ++#define ST_NUMHASH(x,size) (ABS((intptr_t)x)%(size)) ++#define ST_PTRHASH(x,size) ((intptr_t)((uintptr_t)(x)>>2)%size) + #define EQUAL(func, x, y) \ + ((((func) == st_numcmp) || ((func) == st_ptrcmp)) ?\ + (ST_NUMCMP((x),(y)) == 0) : ((*func)((x), (y)) == 0)) -- cgit v1.2.3