Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Apr 2015 07:26:10 +0000 (UTC)
From:      Alexey Dokuchaev <danfe@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r384550 - in head/games/gtkradiant: . files
Message-ID:  <201504230726.t3N7QADH024103@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: danfe
Date: Thu Apr 23 07:26:09 2015
New Revision: 384550
URL: https://svnweb.freebsd.org/changeset/ports/384550

Log:
  - Fix broken communication with external tools (e.g. q2map): GtkRadiant's
    network library (libs/l_net) defines its own struct sockaddr_s, which
    has single ``short sa_family'' field instead of ``unsigned char sa_len''
    and ``sa_family_t sa_family'' of struct sockaddr; this, in turn, causes
    problems when sockaddr_s objects bogusly used as sockaddr ones, e.g.:
  
      connect(4, { sa_len = 2, sa_family = 0, ...) ERR#47 'Address family
      not supported by protocol family'
  
  - Fix missing main window icon by calling pixbuf_new_from_file_with_mask()
    with correct filepath
  - Since these changes are likely to improve GtkRadiant user's experience,
    tentatively bump port revision
  - Fix comment indentation in `radiant/treemodel.cpp' (broken in r384527)

Added:
  head/games/gtkradiant/files/patch-libs_l__net_l__net__berkley.c   (contents, props changed)
Modified:
  head/games/gtkradiant/Makefile
  head/games/gtkradiant/files/patch-radiant__mainframe.cpp
  head/games/gtkradiant/files/patch-radiant_treemodel.cpp

Modified: head/games/gtkradiant/Makefile
==============================================================================
--- head/games/gtkradiant/Makefile	Thu Apr 23 06:48:53 2015	(r384549)
+++ head/games/gtkradiant/Makefile	Thu Apr 23 07:26:09 2015	(r384550)
@@ -3,7 +3,7 @@
 
 PORTNAME=	gtkradiant
 PORTVERSION=	1.5.0
-PORTREVISION=	13
+PORTREVISION=	14
 CATEGORIES=	games cad
 MASTER_SITES=	IDSOFTWARE/source/:id \
 		http://www.bsd-geek.de/FreeBSD/distfiles/:fb

Added: head/games/gtkradiant/files/patch-libs_l__net_l__net__berkley.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/games/gtkradiant/files/patch-libs_l__net_l__net__berkley.c	Thu Apr 23 07:26:09 2015	(r384550)
@@ -0,0 +1,29 @@
+--- libs/l_net/l_net_berkley.c.orig	2006-02-10 22:01:20 UTC
++++ libs/l_net/l_net_berkley.c
+@@ -438,7 +438,7 @@ static int PartialIPAddress (char *in, s
+ 		addr = (addr<<8) + num;
+ 	}
+ 	
+-	hostaddr->sa_family = AF_INET;
++	((struct sockaddr_in *)hostaddr)->sin_family = AF_INET;
+ 	((struct sockaddr_in *)hostaddr)->sin_port = htons((u_short)net_hostport);
+ 	((struct sockaddr_in *)hostaddr)->sin_addr.s_addr = (myAddr & htonl(mask)) | htonl(addr);
+ 	
+@@ -657,7 +657,7 @@ int WINS_StringToAddr(char *string, stru
+ 	sscanf(string, "%d.%d.%d.%d:%d", &ha1, &ha2, &ha3, &ha4, &hp);
+ 	ipaddr = (ha1 << 24) | (ha2 << 16) | (ha3 << 8) | ha4;
+ 
+-	addr->sa_family = AF_INET;
++	((struct sockaddr_in *)addr)->sin_family = AF_INET;
+ 	((struct sockaddr_in *)addr)->sin_addr.s_addr = htonl(ipaddr);
+ 	((struct sockaddr_in *)addr)->sin_port = htons((u_short)hp);
+ 	return 0;
+@@ -718,7 +718,7 @@ int WINS_GetAddrFromName(char *name, str
+ 	if (!hostentry)
+ 		return -1;
+ 
+-	addr->sa_family = AF_INET;
++	((struct sockaddr_in *)addr)->sin_family = AF_INET;
+ 	((struct sockaddr_in *)addr)->sin_port = htons((u_short)net_hostport);
+ 	((struct sockaddr_in *)addr)->sin_addr.s_addr = *(int *)hostentry->h_addr_list[0];
+ 

Modified: head/games/gtkradiant/files/patch-radiant__mainframe.cpp
==============================================================================
--- head/games/gtkradiant/files/patch-radiant__mainframe.cpp	Thu Apr 23 06:48:53 2015	(r384549)
+++ head/games/gtkradiant/files/patch-radiant__mainframe.cpp	Thu Apr 23 07:26:09 2015	(r384550)
@@ -9,6 +9,15 @@
  "so"
  #elif defined (__APPLE__)
  "dylib"
+@@ -2849,7 +2849,7 @@
+ 
+ #if !defined(WIN32)
+   {
+-    GdkPixbuf* pixbuf = pixbuf_new_from_file_with_mask("icon.bmp");
++    GdkPixbuf* pixbuf = pixbuf_new_from_file_with_mask("bitmaps/icon.bmp");
+     if(pixbuf != 0)
+     {
+       gtk_window_set_icon(window, pixbuf);
 @@ -3479,7 +3479,7 @@
      const char* ENGINEPATH_ATTRIBUTE =
  #if defined(WIN32)

Modified: head/games/gtkradiant/files/patch-radiant_treemodel.cpp
==============================================================================
--- head/games/gtkradiant/files/patch-radiant_treemodel.cpp	Thu Apr 23 06:48:53 2015	(r384549)
+++ head/games/gtkradiant/files/patch-radiant_treemodel.cpp	Thu Apr 23 07:26:09 2015	(r384550)
@@ -20,7 +20,7 @@
  void node_detach_name_changed_callback(scene::Node& node, const NameCallback& callback)
  {
 -  if(&node != 0)
-+  volatile intptr_t n = (intptr_t)&node;		// see the comment on line 713
++  volatile intptr_t n = (intptr_t)&node;	// see the comment on line 713
 +
 +  if(n != 0)
    {
@@ -31,7 +31,7 @@
  const char* node_get_name_safe(scene::Node& node)
  {
 -  if(&node == 0)
-+  volatile intptr_t n = (intptr_t)&node;		// see the comment on line 713
++  volatile intptr_t n = (intptr_t)&node;	// see the comment on line 713
 +
 +  if(n == 0)
    {
@@ -42,7 +42,7 @@
  void node_attach_name_changed_callback(scene::Node& node, const NameCallback& callback)
  {
 -  if(&node != 0)
-+  volatile intptr_t n = (intptr_t)&node;		// see the comment on line 713
++  volatile intptr_t n = (intptr_t)&node;	// see the comment on line 713
 +
 +  if(n != 0)
    {
@@ -53,7 +53,7 @@
  void node_detach_name_changed_callback(scene::Node& node, const NameCallback& callback)
  {
 -  if(&node != 0)
-+  volatile intptr_t n = (intptr_t)&node;		// see the comment on line 713
++  volatile intptr_t n = (intptr_t)&node;	// see the comment on line 713
 +
 +  if(n != 0)
    {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201504230726.t3N7QADH024103>