Subject: pkg/5943: xpipeman doesnt build on alpha
To: None <gnats-bugs@gnats.netbsd.org>
From: Tim Rightnour <root@polaris.garbled.net>
List: netbsd-bugs
Date: 08/09/1998 04:30:07
>Number:         5943
>Category:       pkg
>Synopsis:       xpipeman doesn't build on alpha
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    gnats-admin (GNATS administrator)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Aug  9 04:35:02 1998
>Last-Modified:
>Originator:     Tim Rightnour
>Organization:
Tim Rightnour    -  root@garbled.net
http://www.zynetwc.com/~garbled/garbled.html
>Release:        6/10/98<NetBSD-current source date>
>Environment:
	
System: NetBSD polaris 1.3 NetBSD 1.3 (POLARIS) #0: Thu Mar 26 13:17:18 MST 1998 root@polaris:/usr/src/sys/arch/i386/compile/POLARIS i386


>Description:
The author used a 32 bit hack to make the resource strings, and it goes
kaboom on an LP64 machine.
	
>How-To-Repeat:
Compile..  see an annoying compiler message..  note that this is very 
similar to PR# 5815.  Be annoyed.
	
>Fix:
lotsa new patches below:
--- xpipeman.h.orig	Sun Aug  9 03:40:53 1998
+++ xpipeman.h	Sun Aug  9 03:48:12 1998
@@ -36,2 +36,10 @@
  */
+
+typedef struct {
+	Pixel fg;
+	Pixel bg;
+	XtTranslations translations;
+	char *score_filename;
+} AppData;
+
 extern Display 	*display;
@@ -41,4 +49,2 @@
 		cleargc;
-extern Pixel 	fg, 
-		bg;
 
@@ -119,4 +125,2 @@
 extern void	show_scores_callback();
-
-extern char *score_filename;
 
--- main.c.orig	Sun Aug  9 03:29:21 1998
+++ main.c	Sun Aug  9 03:53:49 1998
@@ -140,5 +140,3 @@
 
-Pixel fg, bg;
-
-XtTranslations translations;
+AppData app_data;
 
@@ -150,9 +148,9 @@
   {"foreground", "Foreground", XtRPixel, sizeof(Pixel),
-                (Cardinal)&fg, XtRString, (caddr_t) "Black"},
+                XtOffsetOf(AppData,fg), XtRString, (caddr_t) "Black"},
   {"background", "Background", XtRPixel, sizeof(Pixel),
-                (Cardinal)&bg, XtRString, (caddr_t) "White"},
+                XtOffsetOf(AppData,bg), XtRString, (caddr_t) "White"},
   {"translations","Translations", XtRTranslationTable, sizeof(XtTranslations),
-                (Cardinal)&translations, XtRString, (caddr_t)translations_str},
+                XtOffsetOf(AppData,translations), XtRString,(caddr_t)translations_str},
   {"scorefile","Scorefile", XtRString, sizeof(String),
-                (Cardinal)&score_filename, XtRString, (caddr_t)SCORE_FILE},
+                XtOffsetOf(AppData,score_filename), XtRString,(caddr_t)SCORE_FILE},
 };
@@ -195,3 +193,3 @@
 
-  XtAugmentTranslations(playfield_widget,translations);
+  XtAugmentTranslations(playfield_widget,app_data.translations);
 
@@ -265,4 +263,4 @@
   playfield = XtWindow(playfield_widget);
-  gcv.foreground = fg;
-  gcv.background = bg;
+  gcv.foreground = app_data.fg;
+  gcv.background = app_data.bg;
   gcv.function = GXcopy;
@@ -270,3 +268,3 @@
  		GCForeground | GCBackground | GCFunction, &gcv);
-  gcv.foreground = bg;
+  gcv.foreground = app_data.bg;
   cleargc = XCreateGC(display, playfield,
--- graphics.c.orig	Sun Aug  9 03:51:32 1998
+++ graphics.c	Sun Aug  9 03:52:35 1998
@@ -46,2 +46,3 @@
 
+extern AppData app_data;
 
@@ -65,4 +66,4 @@
 
-  fgcolor.pixel = fg;
-  bgcolor.pixel = bg;
+  fgcolor.pixel = app_data.fg;
+  bgcolor.pixel = app_data.bg;
   fgcolor.flags =  DoRed | DoGreen | DoBlue;
--- score.c.orig	Sun Aug  9 03:56:41 1998
+++ score.c	Sun Aug  9 03:57:23 1998
@@ -72,3 +72,3 @@
 static FILE *scorefile = 0;
-char *score_filename;
+extern AppData app_data;
 
@@ -102,4 +102,4 @@
 
-  if( !(scorefile = fopen(score_filename,"r+")) ) {
-    scorefile = fopen(score_filename, "w");
+  if( !(scorefile = fopen(app_data.score_filename,"r+")) ) {
+    scorefile = fopen(app_data.score_filename, "w");
     return;

	
>Audit-Trail:
>Unformatted: