From miwi@miwi.homeunix.com  Tue Oct  2 15:46:05 2007
Return-Path: <miwi@miwi.homeunix.com>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2F62816A421
	for <FreeBSD-gnats-submit@freebsd.org>; Tue,  2 Oct 2007 15:46:05 +0000 (UTC)
	(envelope-from miwi@miwi.homeunix.com)
Received: from miwi.homeunix.com (dslb-082-083-155-037.pools.arcor-ip.net [82.83.155.37])
	by mx1.freebsd.org (Postfix) with ESMTP id 2CD9913C48A
	for <FreeBSD-gnats-submit@freebsd.org>; Tue,  2 Oct 2007 15:46:03 +0000 (UTC)
	(envelope-from miwi@miwi.homeunix.com)
Received: by miwi.homeunix.com (Postfix, from userid 1010)
	id E5D4F2E114; Tue,  2 Oct 2007 17:46:02 +0200 (CEST)
Message-Id: <20071002154602.E5D4F2E114@miwi.homeunix.com>
Date: Tue,  2 Oct 2007 17:46:02 +0200 (CEST)
From: Martin Wilke <miwi@FreeBSD.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc: jre@vineyard.net
Subject: [PATCH] games/heroes: Fix build with gcc 4.2
X-Send-Pr-Version: 3.113
X-GNATS-Notify: jre@vineyard.net

>Number:         116831
>Category:       ports
>Synopsis:       [PATCH] games/heroes: Fix build with gcc 4.2
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    miwi
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Oct 02 15:50:08 GMT 2007
>Closed-Date:    Thu Oct 04 21:45:33 GMT 2007
>Last-Modified:  Thu Oct  4 21:50:01 GMT 2007
>Originator:     Martin Wilke
>Release:        FreeBSD 7.0-CURRENT i386
>Organization:
>Environment:
System: FreeBSD miwi.homeunix.com 7.0-CURRENT FreeBSD 7.0-CURRENT #305: Fri Sep 28 12:07:59 CEST 2007
>Description:
- Unbreak
- Fix Build with gcc4.2

Tindy tested:
i386
http://head.miwibox.org/tb/index.php?action=describe_port&id=2163
amd64
http://amd64.miwibox.org/tb/index.php?action=describe_port&id=1604


Added file(s):
- files/patch-src_hedlite.c

Port maintainer (jre@vineyard.net) is cc'd.

Generated with FreeBSD Port Tools 0.77
>How-To-Repeat:
>Fix:

--- heroes-0.21_8.patch begins here ---
Index: Makefile
===================================================================
RCS file: /home/pcvs/ports/games/heroes/Makefile,v
retrieving revision 1.30
diff -u -u -r1.30 Makefile
--- Makefile	2 Oct 2007 10:22:10 -0000	1.30
+++ Makefile	2 Oct 2007 14:31:36 -0000
@@ -80,10 +80,4 @@
 	${MKDIR} ${DATADIR}/mod
 	${INSTALL_DATA} ${MUSICSRC}/*.xm ${MUSICSRC}/sound.conf ${DATADIR}/mod
 
-.include <bsd.port.pre.mk>
-
-.if ${OSVERSION} >= 700042
-BROKEN=		Does not compile with GCC 4.2
-.endif
-
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>
Index: files/patch-src_hedlite.c
===================================================================
RCS file: files/patch-src_hedlite.c
diff -N files/patch-src_hedlite.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/patch-src_hedlite.c	2 Oct 2007 14:34:34 -0000
@@ -0,0 +1,184 @@
+--- src/hedlite.c.orig	2002-02-06 22:49:44.000000000 +0100
++++ src/hedlite.c	2007-10-02 16:33:06.000000000 +0200
+@@ -45,7 +45,7 @@
+ #include "dirname.h"
+ 
+ static a_pcx_image heditrsc;
+-static a_pcx_image tile_set_img;
++static a_pcx_image tile_set_img_local;
+ 
+ unsigned short int xdalles = 0;
+ unsigned short int ydalles = 0;
+@@ -144,9 +144,9 @@
+ static void
+ copy_tile (int src_, a_pixel *dest)
+ {
+-  int i = tile_set_img.width;
++  int i = tile_set_img_local.width;
+   int j;
+-  a_pixel *src = tile_set_img.buffer + src_;
++  a_pixel *src = tile_set_img_local.buffer + src_;
+   for (j = 20; j > 0; j--) {
+     fastmem4 (src, dest, 24 >> 2);
+     src += i;
+@@ -157,9 +157,9 @@
+ static void
+ copy_tile_pcx (int src_, a_pixel *dest)
+ {
+-  int i = tile_set_img.width;
++  int i = tile_set_img_local.width;
+   int j;
+-  a_pixel *src = tile_set_img.buffer + src_;
++  a_pixel *src = tile_set_img_local.buffer + src_;
+   for (j = 20; j > 0; j--) {
+     fastmem4 (src, dest, 24 >> 2);
+     src += i;
+@@ -170,9 +170,9 @@
+ static void
+ copy_tile_transp (int src_, a_pixel *dest)
+ {
+-  int i = tile_set_img.width;
++  int i = tile_set_img_local.width;
+   int j, k;
+-  a_pixel *src = tile_set_img.buffer + src_;
++  a_pixel *src = tile_set_img_local.buffer + src_;
+   for (j = 20; j > 0; j--) {
+     for (k = 24; k > 0; k--) {
+       if (*src != 0)
+@@ -188,9 +188,9 @@
+ static void
+ copy_tile_transp_pcx (int src_, a_pixel *dest)
+ {
+-  int i = tile_set_img.width;
++  int i = tile_set_img_local.width;
+   int j, k;
+-  a_pixel *src = tile_set_img.buffer + src_;
++  a_pixel *src = tile_set_img_local.buffer + src_;
+   for (j = 20; j > 0; j--) {
+     for (k = 24; k > 0; k--) {
+       if (*src != 0)
+@@ -555,7 +555,7 @@
+ static void
+ update_middle_panel (void)
+ {
+-  rectangle_copy (xdalles, 0, 144, 200, 145, 0, &tile_set_img);
++  rectangle_copy (xdalles, 0, 144, 200, 145, 0, &tile_set_img_local);
+   frame (145 + xdallesdec, ydalles, 23, 19, 15);
+   rectangle_copy (0, 64, 30, 6, 290, 64, &heditrsc);
+   sprintf (nombre, "%u", (xdalles + xdallesdec) / 24);
+@@ -670,7 +670,7 @@
+ curdalled (void)
+ {
+   int i =
+-    (xdalles + xdallesdec) / 24 + (ydalles / 20) * (tile_set_img.width / 24);
++    (xdalles + xdallesdec) / 24 + (ydalles / 20) * (tile_set_img_local.width / 24);
+   return i;
+ }
+ 
+@@ -894,7 +894,7 @@
+   free (tempc);
+   putc (0xC, fpcx);
+   for (i1 = 0; i1 < 768; i1++)
+-    putc (tile_set_img.palette.global[i1] << 2, fpcx);
++    putc (tile_set_img_local.palette.global[i1] << 2, fpcx);
+   fclose (fpcx);
+ }
+ 
+@@ -1225,7 +1225,7 @@
+     }
+   } else if (i == HK_End) {
+     if (mod & HK_MOD_Ctrl) {
+-      xdalles = (tile_set_img.width / 24) * 24 - 144;
++      xdalles = (tile_set_img_local.width / 24) * 24 - 144;
+       update_middle_panel ();
+     }
+   } else if (i == HK_PageDown) {
+@@ -1250,7 +1250,7 @@
+     }
+   } else if (i == HK_Right) {
+     if (mod & HK_MOD_Ctrl) {
+-      if (xdalles + 168U < tile_set_img.width) {
++      if (xdalles + 168U < tile_set_img_local.width) {
+ 	xdalles += 24;
+ 	update_middle_panel ();
+       } else if (xdallesdec < 120) {
+@@ -1337,7 +1337,7 @@
+   } else if (i == HK_Space) {
+     j = curdallep ();
+     level_map[j].number =
+-      xdalles + xdallesdec + ydalles * (tile_set_img.width);
++      xdalles + xdallesdec + ydalles * (tile_set_img_local.width);
+     level_map[j].type = ddef[curdalled ()].type;
+     level_map[j].info = ddef[curdalled ()].info;
+     gestclav (HK_i, HK_MOD_None);
+@@ -1351,9 +1351,9 @@
+       level_map[j].collision[3] = 0;
+     }
+     for (j = hplaninfo.xt * hplaninfo.yt - 1; j >= 0; j--) {
+-      k = (((level_map[j].number % tile_set_img.width) / 24) +
+-	   (level_map[j].number / (tile_set_img.width * 20)) *
+-	   (tile_set_img.width / 24));
++      k = (((level_map[j].number % tile_set_img_local.width) / 24) +
++	   (level_map[j].number / (tile_set_img_local.width * 20)) *
++	   (tile_set_img_local.width / 24));
+       level_map[j].type = ddef[k].type;
+       if (level_map[j].type != t_tunnel) {
+ 	if (level_map[j].type == t_anim || i == 0x1749)
+@@ -1404,7 +1404,7 @@
+     if (mod & HK_MOD_Ctrl) {
+       for (j = hplaninfo.xt * hplaninfo.yt - 1; j >= 0; j--) {
+ 	level_map[j].number = xdalles + xdallesdec +
+-	  ydalles * (tile_set_img.width);
++	  ydalles * (tile_set_img_local.width);
+ 	level_map[j].type = ddef[curdalled ()].type;
+ 	level_map[j].info = ddef[curdalled ()].info;
+       }
+@@ -1414,7 +1414,7 @@
+ 
+ 	level_map[j].number =
+ 	  (((j % hplaninfo.xt) + (j / hplaninfo.xt)) & 1) * 20 *
+-	  tile_set_img.width;
++	  tile_set_img_local.width;
+       update_left_panel ();
+     }
+   } else if (i == HK_F3) {
+@@ -1427,7 +1427,7 @@
+     if (level_map[curdallep ()].sprite == 0)
+ 
+       level_map[curdallep ()].sprite =
+-	(short int) (xdalles + xdallesdec + ydalles * (tile_set_img.width));
++	(short int) (xdalles + xdallesdec + ydalles * (tile_set_img_local.width));
+     else
+       level_map[curdallep ()].sprite = 0;
+     update_left_panel ();
+@@ -1707,17 +1707,17 @@
+ 				   hplaninfo.tile_set_name), ".pie");
+ 
+   pcx_load_from_rsc ("editor-img", &heditrsc);
+-  pcx_load (tile_set_name, &tile_set_img);
++  pcx_load (tile_set_name, &tile_set_img_local);
+ 
+   /* read the tileset definition */
+-  XCALLOC_ARRAY (ddef, (tile_set_img.width / 24) * 10);
++  XCALLOC_ARRAY (ddef, (tile_set_img_local.width / 24) * 10);
+   if (!((ftmp = fopen (dallepie, "rb")) == NULL))
+-    fread (ddef, sizeof (a_tile_info), (tile_set_img.width / 24) * 10, ftmp);
++    fread (ddef, sizeof (a_tile_info), (tile_set_img_local.width / 24) * 10, ftmp);
+   fclose (ftmp);
+ 
+   outwayinit ();
+   XCALLOC_ARRAY (hedit_buffer, xbuf * 200);
+-  set_pal (tile_set_img.palette.global, 0, 256 * 3);
++  set_pal (tile_set_img_local.palette.global, 0, 256 * 3);
+   rectangle_copy (0, 0, 30, 200, 290, 0, &heditrsc);
+   strupr (levelnomshort);
+   draw_text (levelnomshort, 305, 29, 8, 1);
+@@ -1767,7 +1767,7 @@
+     free (ddef);
+     free (level_map);
+     img_free (&heditrsc);
+-    img_free (&tile_set_img);
++    img_free (&tile_set_img_local);
+   }
+ 
+   free (dallepie);
--- heroes-0.21_8.patch ends here ---

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->miwi 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Tue Oct 2 15:50:25 UTC 2007 
Responsible-Changed-Why:  
Submitter has GNATS access 

http://www.freebsd.org/cgi/query-pr.cgi?pr=116831 
State-Changed-From-To: open->feedback 
State-Changed-By: edwin 
State-Changed-When: Tue Oct 2 15:50:36 UTC 2007 
State-Changed-Why:  
Awaiting maintainers feedback 

http://www.freebsd.org/cgi/query-pr.cgi?pr=116831 

From: Josh Elsasser <josh@elsasser.org>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/116831: [PATCH] games/heroes: Fix build with gcc 4.2
Date: Thu, 4 Oct 2007 12:47:10 -0700

 I no longer have access to a machine to test this, please remove me as
 port maintainer.
State-Changed-From-To: feedback->closed 
State-Changed-By: miwi 
State-Changed-When: Thu Oct 4 21:45:32 UTC 2007 
State-Changed-Why:  
Committed. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=116831 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/116831: commit references a PR
Date: Thu,  4 Oct 2007 21:44:13 +0000 (UTC)

 miwi        2007-10-04 21:43:58 UTC
 
   FreeBSD ports repository
 
   Modified files:
     games/heroes         Makefile 
   Added files:
     games/heroes/files   patch-src_hedlite.c 
   Log:
   - Unbreak
   - Fix build with gcc 4.2
   - Use SF macro
   - Reset maintainer
   
   PR:             116831
   Submitted by:   miwi
   Approved by:    maintainer
   
   Revision  Changes    Path
   1.31      +3 -10     ports/games/heroes/Makefile
   1.1       +184 -0    ports/games/heroes/files/patch-src_hedlite.c (new)
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
