freebsd-ports/games/gtkradiant/files/patch-radiant_treemodel.cpp
Alexey Dokuchaev 3fb6cf8e52 - 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)
2015-04-23 07:26:09 +00:00

61 lines
1.9 KiB
C++

--- radiant/treemodel.cpp.orig 2006-02-10 22:01:20 UTC
+++ radiant/treemodel.cpp
@@ -710,7 +710,13 @@ public:
void node_attach_name_changed_callback(scene::Node& node, const NameCallback& callback)
{
- if(&node != 0)
+ // Reference cannot be bound to dereferenced null pointer in well-defined
+ // C++ code, and Clang will assume that comparison below always evaluates
+ // to true, resulting in a segmentation fault. Use a dirty hack to force
+ // Clang to check those "bad" references for null nonetheless.
+ volatile intptr_t n = (intptr_t)&node;
+
+ if(n != 0)
{
Nameable* nameable = Node_getNameable(node);
if(nameable != 0)
@@ -721,7 +727,9 @@ void node_attach_name_changed_callback(s
}
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
+
+ if(n != 0)
{
Nameable* nameable = Node_getNameable(node);
if(nameable != 0)
@@ -1243,7 +1251,9 @@ const char* node_get_name(scene::Node& n
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
+
+ if(n == 0)
{
return "";
}
@@ -1264,7 +1274,9 @@ GraphTreeNode* graph_tree_model_find_par
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
+
+ if(n != 0)
{
Nameable* nameable = Node_getNameable(node);
if(nameable != 0)
@@ -1275,7 +1287,9 @@ void node_attach_name_changed_callback(s
}
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
+
+ if(n != 0)
{
Nameable* nameable = Node_getNameable(node);
if(nameable != 0)