summaryrefslogtreecommitdiff
path: root/games
diff options
context:
space:
mode:
authorjoerg <joerg@pkgsrc.org>2013-03-28 21:25:51 +0000
committerjoerg <joerg@pkgsrc.org>2013-03-28 21:25:51 +0000
commit30efbc304bccdae7783bb971bbb1113fd4e13782 (patch)
tree59c4969b08af4252d2acbeedb382179924fae414 /games
parentb04faddb421d8b252497cc86743be5b5ef294f4b (diff)
downloadpkgsrc-30efbc304bccdae7783bb971bbb1113fd4e13782.tar.gz
Fix inline use. Do not use nested functions.
Diffstat (limited to 'games')
-rw-r--r--games/quakeforge/Makefile4
-rw-r--r--games/quakeforge/distinfo15
-rw-r--r--games/quakeforge/patches/patch-al118
-rw-r--r--games/quakeforge/patches/patch-am168
-rw-r--r--games/quakeforge/patches/patch-an34
-rw-r--r--games/quakeforge/patches/patch-as201
-rw-r--r--games/quakeforge/patches/patch-include_QF_llist.h22
-rw-r--r--games/quakeforge/patches/patch-include_QF_mathlib.h35
-rw-r--r--games/quakeforge/patches/patch-include_r__dynamic.h13
-rw-r--r--games/quakeforge/patches/patch-include_r__local.h13
-rw-r--r--games/quakeforge/patches/patch-libs_util_llist.c22
11 files changed, 570 insertions, 75 deletions
diff --git a/games/quakeforge/Makefile b/games/quakeforge/Makefile
index b158532c02a..5b56914de4a 100644
--- a/games/quakeforge/Makefile
+++ b/games/quakeforge/Makefile
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.29 2013/02/16 11:21:26 wiz Exp $
+# $NetBSD: Makefile,v 1.30 2013/03/28 21:25:51 joerg Exp $
DISTNAME= quakeforge-0.5.5
-PKGREVISION= 12
+PKGREVISION= 13
CATEGORIES= games
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=quake/}
diff --git a/games/quakeforge/distinfo b/games/quakeforge/distinfo
index 265c9ecbc0c..9587d40d8ff 100644
--- a/games/quakeforge/distinfo
+++ b/games/quakeforge/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.7 2008/01/23 05:30:59 tnn Exp $
+$NetBSD: distinfo,v 1.8 2013/03/28 21:25:52 joerg Exp $
SHA1 (quakeforge-0.5.5.tar.gz) = 3ceb229b3d777b6c5e0cb1530b4547b20737f402
RMD160 (quakeforge-0.5.5.tar.gz) = d22b29498e950bfdf96169bafee6409fca1a8e11
@@ -14,15 +14,20 @@ SHA1 (patch-ah) = b8da2ec1d52c89535d949445871e85872d9a135f
SHA1 (patch-ai) = 67ef987cfa9dc50485a5a44341a7576e0e99d5c0
SHA1 (patch-aj) = 5b28f79846fd2dff62004ff52bfc0dad33a91a67
SHA1 (patch-ak) = e6983bd274f6945510f2624352bf3ec22610f6cc
-SHA1 (patch-al) = 86749a0e238d817944f89ef01362496cf85e3a86
-SHA1 (patch-am) = a384e268293800d67caa690d260282277cc49ba8
-SHA1 (patch-an) = 7b6c91f62a72f4379456192aa15ce8f3ffe4a8ea
+SHA1 (patch-al) = 7efe85d428efa0dfd0ccf3bf9255deb7970dc5ee
+SHA1 (patch-am) = 3c68f6bac84a0f25a50d5f9062795b75649cbe8a
+SHA1 (patch-an) = 07a0e85e59d44a7f2421b225822e97068ad80062
SHA1 (patch-ao) = ee771a71c83b0b11298baca223af4c5e998da4d2
SHA1 (patch-ap) = 96a767e320124567f53e60b2c39de17d24427085
SHA1 (patch-aq) = 7b9a23a532b84c902a54799aed336247248276f7
SHA1 (patch-ar) = bb4fdab9879930fb73572a831718c75109e10ea4
-SHA1 (patch-as) = 770600734b9e26206fc824d1a3b6cf67b3c0d631
+SHA1 (patch-as) = 4e82270282d1d5a3fb7b0b95768bf53754f569e8
SHA1 (patch-at) = 3e8bb9d7882c5428cec94d78295668e7930624e6
SHA1 (patch-au) = 5fbe311a03bc65e39e501b38f50a9c42b298a03a
SHA1 (patch-av) = 8ba99fa13916ab9efd881a89760307fc5863e9d5
SHA1 (patch-aw) = d02d3a0cfbb47ad2f73e3ee523aed2964a8fcbae
+SHA1 (patch-include_QF_llist.h) = 34b69e99ca69d4564d7100b0e3bcd8d8a024ec94
+SHA1 (patch-include_QF_mathlib.h) = bb25e8798ff1339731e2fbb0f8e7c4ae7ba86e68
+SHA1 (patch-include_r__dynamic.h) = e37cd1d4e242db48793c29c2b78aa78eb14d138d
+SHA1 (patch-include_r__local.h) = 7bb3b46ea3835489a20609739bd7a8dc79b36c96
+SHA1 (patch-libs_util_llist.c) = d41fdac88ac1c9dbccd1bffd512f7e34ae381860
diff --git a/games/quakeforge/patches/patch-al b/games/quakeforge/patches/patch-al
index 242d7869854..d1b29b7746c 100644
--- a/games/quakeforge/patches/patch-al
+++ b/games/quakeforge/patches/patch-al
@@ -1,29 +1,109 @@
-$NetBSD: patch-al,v 1.1 2008/01/23 04:59:36 tnn Exp $
+$NetBSD: patch-al,v 1.2 2013/03/28 21:25:52 joerg Exp $
--- libs/gib/gib_classes.c.orig 2003-11-29 02:01:31.000000000 +0000
+++ libs/gib/gib_classes.c
-@@ -192,7 +192,7 @@ Object_Class_Children_f (gib_object_t *o
+@@ -184,26 +184,32 @@ Object_Class_New_f (gib_object_t *obj, g
+ return 0;
+ }
+
++struct child_data {
++ const char **reply;
++ unsigned i;
++};
++
++static qboolean
++iterator (void *data_, gib_class_t *class, void *unused)
++{
++ struct child_data *data = data_;
++ data->reply[data->i++] = class->name;
++ return false;
++}
++
+ static int
+ Object_Class_Children_f (gib_object_t *obj, gib_method_t *method, void *data,
+ gib_object_t *sender, gib_message_t mesg)
+ {
+- const char **reply;
++ struct child_data cb_data;
unsigned int size;
- unsigned int i = 0;
-
+- unsigned int i = 0;
+-
- static qboolean
-+ qboolean
- iterator (gib_class_t *class, void *unused)
- {
- reply[i++] = class->name;
-@@ -610,13 +610,13 @@ GIB_Classes_Build_Scripted (const char *
+- iterator (gib_class_t *class, void *unused)
+- {
+- reply[i++] = class->name;
+- return false;
+- }
+-
++
+ size = llist_size (obj->class->children);
+ if (size) {
+- reply = malloc (sizeof (char *) * size);
+- llist_iterate (obj->class->children, LLIST_ICAST (iterator));
+- GIB_Reply (obj, mesg, size, reply);
++ cb_data.reply = malloc (sizeof (char *) * size);
++ cb_data.i = 0;
++ llist_iterate (obj->class->children, iterator, &cb_data);
++ GIB_Reply (obj, mesg, size, cb_data.reply);
+ } else
+ GIB_Reply (obj, mesg, 0, NULL);
+ return 0;
+@@ -600,6 +606,12 @@ Scrobj_Method_f (gib_object_t *obj, gib_
+ return 0;
+ }
+
++static void
++mtabfree (void *mtab, void *unused)
++{
++ free (mtab);
++}
++
+ void
+ GIB_Classes_Build_Scripted (const char *name, const char *parentname,
+ gib_tree_t *tree, gib_script_t *script)
+@@ -610,21 +622,6 @@ GIB_Classes_Build_Scripted (const char *
gib_classdesc_t desc;
enum {CLASS, INSTANCE} mode = INSTANCE;
- static void
-+ void
- mtabfree (void *mtab, void *unused)
- {
- free (mtab);
- }
-
+- mtabfree (void *mtab, void *unused)
+- {
+- free (mtab);
+- }
+-
- static const char *
-+ const char *
- fname (const char *str)
- {
- if (mode == INSTANCE)
+- fname (const char *str)
+- {
+- if (mode == INSTANCE)
+- return va ("__%s_%s__", name, str);
+- else
+- return va ("%s::%s", name, str);
+- }
+-
+ methods = llist_new (mtabfree, NULL, NULL);
+ cmethods = llist_new (mtabfree, NULL, NULL);
+
+@@ -640,6 +637,7 @@ GIB_Classes_Build_Scripted (const char *
+ if (!strcmp (line->children->str,
+ "function")) {
+ gib_tree_t *cur, *last;
++ char *fname;
+ gib_methodtab_t *new = malloc (sizeof
+ (gib_methodtab_t));
+ Scrobj_method_t *data = malloc (sizeof
+@@ -648,9 +646,13 @@ GIB_Classes_Build_Scripted (const char *
+ line->children->next->next;
+ last->next; last =
+ last->next);
++
++ if (mode == INSTANCE)
++ fname = va("__%s_%s__", name, line->children->next->str);
++ else
++ fname = va("%s::%s", name, line->children->next->str);
+ data->func = GIB_Function_Define
+- (fname
+- (line->children->next->str),
++ (fname,
+ last->str,
+ last->children,
+ script, NULL);
diff --git a/games/quakeforge/patches/patch-am b/games/quakeforge/patches/patch-am
index f3b49500259..c95ea9367ba 100644
--- a/games/quakeforge/patches/patch-am
+++ b/games/quakeforge/patches/patch-am
@@ -1,22 +1,164 @@
-$NetBSD: patch-am,v 1.1 2008/01/23 04:59:36 tnn Exp $
+$NetBSD: patch-am,v 1.2 2013/03/28 21:25:52 joerg Exp $
--- libs/gib/gib_function.c.orig 2004-04-09 18:18:19.000000000 +0000
+++ libs/gib/gib_function.c
-@@ -169,7 +169,7 @@ GIB_Function_Prepare_Args (cbuf_t * cbuf
- gib_var_t *var;
+@@ -160,79 +160,108 @@ GIB_Function_Find (const char *name)
+ return (gib_function_t *) Hash_Find (gib_functions, name);
+ }
+
++struct prepare_args_data {
++ gib_var_t *var;
++ hashtab_t **zero;
++ unsigned int i, ind;
++ unsigned int argc;
++ const char **args;
++ cbuf_t *cbuf;
++};
++
++static qboolean
++prepare_args_iterate (void *data_, void *arg_, llist_node_t *node)
++{
++ char *arg = arg_;
++ struct prepare_args_data *data = data_;
++ data->var = GIB_Var_Get_Complex (&GIB_DATA(data->cbuf)->locals, data->zero,
++ arg, &data->ind, true);
++ if (!data->var->array[0].value)
++ data->var->array[0].value = dstring_newstr ();
++ dstring_copystr (data->var->array[0].value, data->args[data->i]);
++ data->i++;
++ return data->i < data->argc;
++}
++
+ static void
+ GIB_Function_Prepare_Args (cbuf_t * cbuf, const char **args, unsigned int
+ argc, llist_t *arglist)
+ {
+ static hashtab_t *zero = 0;
+- unsigned int i, ind;
+- gib_var_t *var;
++ struct prepare_args_data data;
static char argss[] = "args";
- static qboolean
-+ qboolean
- iterate (char *arg, llist_node_t *node)
- {
- var = GIB_Var_Get_Complex (&GIB_DATA(cbuf)->locals, &zero,
-@@ -207,7 +207,7 @@ GIB_Function_Prepare_Args_D (cbuf_t * cb
- gib_var_t *var;
+- iterate (char *arg, llist_node_t *node)
+- {
+- var = GIB_Var_Get_Complex (&GIB_DATA(cbuf)->locals, &zero,
+- arg, &ind, true);
+- if (!var->array[0].value)
+- var->array[0].value = dstring_newstr ();
+- dstring_copystr (var->array[0].value, args[i]);
+- i++;
+- return i < argc;
+- }
++ data.cbuf = cbuf;
++ data.argc = argc;
++ data.args = args;
++ data.i = 1;
++ data.zero = &zero;
++ llist_iterate (arglist, prepare_args_iterate, &data);
+
+- i = 1; llist_iterate (arglist, LLIST_ICAST (iterate));
+-
+- var =
++ data.var =
+ GIB_Var_Get_Complex (&GIB_DATA (cbuf)->locals, &zero, argss,
+- &ind, true);
+- var->array = realloc (var->array, sizeof (struct gib_varray_s) * argc);
+- memset (var->array + 1, 0, (argc - 1) * sizeof (struct gib_varray_s));
+- var->size = argc;
+- for (i = 0; i < argc; i++) {
+- if (var->array[i].value)
+- dstring_clearstr (var->array[i].value);
++ &data.ind, true);
++ data.var->array = realloc (data.var->array, sizeof (struct gib_varray_s) * argc);
++ memset (data.var->array + 1, 0, (argc - 1) * sizeof (struct gib_varray_s));
++ data.var->size = argc;
++ for (data.i = 0; data.i < argc; data.i++) {
++ if (data.var->array[data.i].value)
++ dstring_clearstr (data.var->array[data.i].value);
+ else
+- var->array[i].value = dstring_newstr ();
+- dstring_appendstr (var->array[i].value, args[i]);
++ data.var->array[data.i].value = dstring_newstr ();
++ dstring_appendstr (data.var->array[data.i].value, args[data.i]);
+ }
+ }
+
++struct prepare_args_d_data {
++ gib_var_t *var;
++ unsigned i, ind, argc;
++ hashtab_t **zero;
++ dstring_t **args;
++ cbuf_t *cbuf;
++};
++
++static qboolean
++iterate (void *data_, void *arg_, llist_node_t *node)
++{
++ char *arg = arg_;
++ struct prepare_args_d_data *data = data_;
++ data->var = GIB_Var_Get_Complex (&GIB_DATA(data->cbuf)->locals, data->zero,
++ arg, &data->ind, true);
++ if (!data->var->array[0].value)
++ data->var->array[0].value = dstring_newstr ();
++ dstring_copystr (data->var->array[0].value, data->args[data->i]->str);
++ data->i++;
++ return data->i < data->argc;
++}
++
+ static void
+ GIB_Function_Prepare_Args_D (cbuf_t * cbuf, dstring_t **args, unsigned int
+ argc, llist_t *arglist)
+ {
++ struct prepare_args_d_data data;
+ static hashtab_t *zero = 0;
+- unsigned int i, ind;
+- gib_var_t *var;
static char argss[] = "args";
- static qboolean
-+ qboolean
- iterate (char *arg, llist_node_t *node)
- {
- var = GIB_Var_Get_Complex (&GIB_DATA(cbuf)->locals, &zero,
+- iterate (char *arg, llist_node_t *node)
+- {
+- var = GIB_Var_Get_Complex (&GIB_DATA(cbuf)->locals, &zero,
+- arg, &ind, true);
+- if (!var->array[0].value)
+- var->array[0].value = dstring_newstr ();
+- dstring_copystr (var->array[0].value, args[i]->str);
+- i++;
+- return i < argc;
+- }
+-
+- i = 1; llist_iterate (arglist, LLIST_ICAST (iterate));
+-
+- var =
++ data.cbuf = cbuf;
++ data.argc = argc;
++ data.args = args;
++ data.zero = &zero;
++ data.i = 1;
++ llist_iterate (arglist, iterate, &data);
++
++ data.var =
+ GIB_Var_Get_Complex (&GIB_DATA (cbuf)->locals, &zero, argss,
+- &ind, true);
+- var->array = realloc (var->array, sizeof (struct gib_varray_s) * argc);
+- memset (var->array + 1, 0, (argc - 1) * sizeof (struct gib_varray_s));
+- var->size = argc;
+- for (i = 0; i < argc; i++) {
+- if (var->array[i].value)
+- dstring_clearstr (var->array[i].value);
++ &data.ind, true);
++ data.var->array = realloc (data.var->array, sizeof (struct gib_varray_s) * argc);
++ memset (data.var->array + 1, 0, (argc - 1) * sizeof (struct gib_varray_s));
++ data.var->size = argc;
++ for (data.i = 0; data.i < argc; data.i++) {
++ if (data.var->array[data.i].value)
++ dstring_clearstr (data.var->array[data.i].value);
+ else
+- var->array[i].value = dstring_newstr ();
+- dstring_appendstr (var->array[i].value, args[i]->str);
++ data.var->array[data.i].value = dstring_newstr ();
++ dstring_appendstr (data.var->array[data.i].value, args[data.i]->str);
+ }
+ }
+
diff --git a/games/quakeforge/patches/patch-an b/games/quakeforge/patches/patch-an
index 6e2ac61377d..2d7024c183d 100644
--- a/games/quakeforge/patches/patch-an
+++ b/games/quakeforge/patches/patch-an
@@ -1,13 +1,35 @@
-$NetBSD: patch-an,v 1.1 2008/01/23 04:59:36 tnn Exp $
+$NetBSD: patch-an,v 1.2 2013/03/28 21:25:52 joerg Exp $
--- libs/gib/gib_thread.c.orig 2003-09-11 06:03:10.000000000 +0000
+++ libs/gib/gib_thread.c
-@@ -89,7 +89,7 @@ GIB_Thread_Count (void)
+@@ -86,19 +86,21 @@ GIB_Thread_Count (void)
+ return llist_size (gib_threads);
+ }
+
++static qboolean
++thread_exec_iterator (void *dummy, cbuf_t *cbuf, llist_node_t *node)
++{
++ if (GIB_DATA(cbuf)->program)
++ Cbuf_Execute_Stack (cbuf);
++ else
++ Cbuf_DeleteStack ((cbuf_t *) llist_remove (node));
++ return true;
++}
++
void
GIB_Thread_Execute (void)
{
- static qboolean iterator (cbuf_t *cbuf, llist_node_t *node)
-+ qboolean iterator (cbuf_t *cbuf, llist_node_t *node)
- {
- if (GIB_DATA(cbuf)->program)
- Cbuf_Execute_Stack (cbuf);
+- {
+- if (GIB_DATA(cbuf)->program)
+- Cbuf_Execute_Stack (cbuf);
+- else
+- Cbuf_DeleteStack ((cbuf_t *) llist_remove (node));
+- return true;
+- }
+
+- llist_iterate (gib_threads, LLIST_ICAST (iterator));
++ llist_iterate (gib_threads, thread_exec_iterator, NULL);
+ }
+
+ void
diff --git a/games/quakeforge/patches/patch-as b/games/quakeforge/patches/patch-as
index 95c9e942bfb..a0942f1a537 100644
--- a/games/quakeforge/patches/patch-as
+++ b/games/quakeforge/patches/patch-as
@@ -1,46 +1,187 @@
-$NetBSD: patch-as,v 1.1 2008/01/23 04:59:37 tnn Exp $
+$NetBSD: patch-as,v 1.2 2013/03/28 21:25:52 joerg Exp $
--- qw/source/cl_chat.c.orig 2003-07-18 06:27:26.000000000 +0000
+++ qw/source/cl_chat.c
-@@ -66,7 +66,7 @@ CL_Ignore_Compare (const void *ele, cons
+@@ -63,16 +63,35 @@ CL_Ignore_Compare (const void *ele, cons
+ return *(int *)cmp == ((ignore_t *) ele)->uid;
+ }
+
++static qboolean
++ignore_sanity_iterator (void *dummy, void *ig_, llist_node_t *node)
++{
++ ignore_t *ig = ig_;
++ if (cl.players[ig->slot].userid != ig->uid) // We got out of sync somehow
++ llist_remove (node);
++ return true;
++}
++
static void
CL_Ignore_Sanity_Check (void)
{
- static qboolean iterator (ignore_t *ig, llist_node_t *node)
-+ qboolean iterator (ignore_t *ig, llist_node_t *node)
- {
- if (cl.players[ig->slot].userid != ig->uid) // We got out of sync somehow
- llist_remove (node);
-@@ -80,12 +80,12 @@ CL_Ignore_f (void)
+- {
+- if (cl.players[ig->slot].userid != ig->uid) // We got out of sync somehow
+- llist_remove (node);
+- return true;
+- }
+- llist_iterate (ignore_list, LLIST_ICAST (iterator));
++ llist_iterate (ignore_list, ignore_sanity_iterator, NULL);
++}
++
++static qboolean
++live_iterator (void *dummy, void *ig_, llist_node_t *node)
++{
++ ignore_t *ig = ig_;
++ Sys_Printf ("%5i - %s\n", ig->uid, Info_ValueForKey (cl.players[ig->slot].userinfo, "name"));
++ return true;
++}
++
++static qboolean
++dead_iterator (void *dummy, void *ig_, llist_node_t *node)
++{
++ ignore_t *ig = ig_;
++ Sys_Printf ("%s\n", ig->lastname);
++ return true;
+ }
+
+ static void
+@@ -80,27 +99,17 @@ CL_Ignore_f (void)
{
CL_Ignore_Sanity_Check ();
if (Cmd_Argc () == 1) {
- static qboolean live_iterator (ignore_t *ig, llist_node_t *node)
-+ qboolean live_iterator (ignore_t *ig, llist_node_t *node)
- {
- Sys_Printf ("%5i - %s\n", ig->uid, Info_ValueForKey (cl.players[ig->slot].userinfo, "name"));
- return true;
- }
+- {
+- Sys_Printf ("%5i - %s\n", ig->uid, Info_ValueForKey (cl.players[ig->slot].userinfo, "name"));
+- return true;
+- }
- static qboolean dead_iterator (ignore_t *ig, llist_node_t *node)
-+ qboolean dead_iterator (ignore_t *ig, llist_node_t *node)
- {
- Sys_Printf ("%s\n", ig->lastname);
- return true;
-@@ -145,7 +145,7 @@ CL_Chat_Allow_Message (const char *str)
- dstring_t *test = dstring_newstr ();
- qboolean allowed = true;
+- {
+- Sys_Printf ("%s\n", ig->lastname);
+- return true;
+- }
+ Sys_Printf (
+ "Users ignored by user id\n"
+ "------------------------\n"
+ );
+- llist_iterate (ignore_list, LLIST_ICAST (live_iterator));
++ llist_iterate (ignore_list, live_iterator, NULL);
+ Sys_Printf (
+ "\n"
+ "Users ignored by name (not currently connected)\n"
+ "-----------------------------------------------\n"
+ );
+- llist_iterate (dead_ignore_list, LLIST_ICAST (dead_iterator));
++ llist_iterate (dead_ignore_list, dead_iterator, NULL);
+ } else if (Cmd_Argc () == 2) {
+ int i, uid = atoi (Cmd_Argv (1));
-- static qboolean iterator (ignore_t *ig, llist_node_t *node)
-+ qboolean iterator (ignore_t *ig, llist_node_t *node)
- {
- if (cl.players[ig->slot].userid != ig->uid) { // We got out of sync somehow
- llist_remove (node);
-@@ -183,7 +183,7 @@ CL_Chat_Check_Name (const char *name, in
+@@ -139,27 +148,39 @@ CL_Unignore_f (void)
+ }
+ }
+
+-qboolean
+-CL_Chat_Allow_Message (const char *str)
++struct allow_msg_data {
++ const char *str;
++ qboolean allowed;
++ dstring_t *test;
++};
++
++static qboolean
++allow_msg_data_iterator (void *data_, void *ig_, llist_node_t *node)
{
- ignore_t *found = 0;
+- dstring_t *test = dstring_newstr ();
+- qboolean allowed = true;
++ struct allow_msg_data *data = data_;
++ ignore_t *ig = ig_;
- static qboolean iterator (ignore_t *ig, llist_node_t *node)
-+ qboolean iterator (ignore_t *ig, llist_node_t *node)
- {
- if (!strcmp (ig->lastname, name)) {
- found = ig;
+- {
+- if (cl.players[ig->slot].userid != ig->uid) { // We got out of sync somehow
+- llist_remove (node);
+- return true;
+- }
+- dsprintf (test, "%s: ", Info_ValueForKey (cl.players[ig->slot].userinfo, "name"));
+- if (!strncmp (test->str, str, sizeof (test->str))) {
+- return allowed = false;
+- } else
+- return true;
++ if (cl.players[ig->slot].userid != ig->uid) { // We got out of sync somehow
++ llist_remove (node);
++ return true;
+ }
++ dsprintf (data->test, "%s: ", Info_ValueForKey (cl.players[ig->slot].userinfo, "name"));
++ if (!strncmp (data->test->str, data->str, sizeof (*data->test->str))) {
++ return data->allowed = false;
++ } else
++ return true;
++}
+
+- llist_iterate (ignore_list, LLIST_ICAST (iterator));
+- return allowed;
++qboolean
++CL_Chat_Allow_Message (const char *str)
++{
++ struct allow_msg_data data;
++ data.allowed = true;
++ data.str = str;
++ data.test = dstring_newstr ();
++
++ llist_iterate (ignore_list, allow_msg_data_iterator, &data);
++ return data.allowed;
+ }
+
+ void
+@@ -178,25 +199,36 @@ CL_Chat_User_Disconnected (int uid)
+ }
+ }
+
++struct check_name_data {
++ ignore_t *found;
++ const char *name;
++};
++
++static qboolean
++check_name_iterator (void *data_, void *ig_, llist_node_t *node)
++{
++ struct check_name_data *data = data_;
++ ignore_t *ig = ig_;
++ if (!strcmp (ig->lastname, data->name)) {
++ data->found = ig;
++ return false;
++ } else
++ return true;
++}
++
+ void
+ CL_Chat_Check_Name (const char *name, int slot)
+ {
+- ignore_t *found = 0;
+-
+- static qboolean iterator (ignore_t *ig, llist_node_t *node)
+- {
+- if (!strcmp (ig->lastname, name)) {
+- found = ig;
+- return false;
+- } else
+- return true;
+- }
+- llist_iterate (dead_ignore_list, LLIST_ICAST (iterator));
+- if (found) {
+- found->slot = slot;
+- found->uid = cl.players[slot].userid;
+- llist_append (ignore_list, llist_remove (llist_getnode (dead_ignore_list, found)));
+- Sys_Printf ("User %i (%s) is using an ignored name. Now ignoring by user id...\n", found->uid, found->lastname);
++ struct check_name_data data;
++ data.found = 0;
++ data.name = name;
++
++ llist_iterate (dead_ignore_list, check_name_iterator, &data);
++ if (data.found) {
++ data.found->slot = slot;
++ data.found->uid = cl.players[slot].userid;
++ llist_append (ignore_list, llist_remove (llist_getnode (dead_ignore_list, data.found)));
++ Sys_Printf ("User %i (%s) is using an ignored name. Now ignoring by user id...\n", data.found->uid, data.found->lastname);
+ }
+ }
+
diff --git a/games/quakeforge/patches/patch-include_QF_llist.h b/games/quakeforge/patches/patch-include_QF_llist.h
new file mode 100644
index 00000000000..e1cb5acc489
--- /dev/null
+++ b/games/quakeforge/patches/patch-include_QF_llist.h
@@ -0,0 +1,22 @@
+$NetBSD: patch-include_QF_llist.h,v 1.1 2013/03/28 21:25:52 joerg Exp $
+
+--- include/QF/llist.h.orig 2013-03-28 15:10:12.000000000 +0000
++++ include/QF/llist.h
+@@ -44,7 +44,7 @@ typedef struct llist_s {
+ void *userdata;
+ } llist_t;
+
+-typedef qboolean (*llist_iterator_t)(void *element, llist_node_t *node);
++typedef qboolean (*llist_iterator_t)(void *data, void *element, llist_node_t *node);
+
+ #define LLIST_ICAST(x) (llist_iterator_t)(x)
+ #define LLIST_DATA(node, type) ((type *)((node)->data))
+@@ -59,7 +59,7 @@ llist_node_t *llist_insertafter (llist_n
+ llist_node_t *llist_insertbefore (llist_node_t *ref, void *element);
+ void *llist_remove (llist_node_t *ref);
+ unsigned int llist_size (llist_t *llist);
+-void llist_iterate (llist_t *list, llist_iterator_t iterate);
++void llist_iterate (llist_t *list, llist_iterator_t iterate, void *data);
+ void *llist_find (llist_t *list, void *comparison);
+ llist_node_t *llist_findnode (llist_t *list, void *comparison);
+ void *llist_createarray (llist_t *list, size_t esize);
diff --git a/games/quakeforge/patches/patch-include_QF_mathlib.h b/games/quakeforge/patches/patch-include_QF_mathlib.h
new file mode 100644
index 00000000000..dfe718e8f2b
--- /dev/null
+++ b/games/quakeforge/patches/patch-include_QF_mathlib.h
@@ -0,0 +1,35 @@
+$NetBSD: patch-include_QF_mathlib.h,v 1.1 2013/03/28 21:25:52 joerg Exp $
+
+--- include/QF/mathlib.h.orig 2013-03-28 15:01:01.000000000 +0000
++++ include/QF/mathlib.h
+@@ -255,11 +255,8 @@ void QuatMult (const quat_t v1, const qu
+ (PlaneDist (point, plane) - (plane)->dist)
+
+ extern mplane_t * const frustum;
+-extern inline qboolean R_CullBox (const vec3_t mins, const vec3_t maxs);
+-extern inline qboolean R_CullSphere (const vec3_t origin, const float radius);
+-extern inline float VectorNormalize (vec3_t v); // returns vector length
+ #ifndef IMPLEMENT_R_Cull
+-extern inline
++inline
+ #endif
+ qboolean
+ R_CullBox (const vec3_t mins, const vec3_t maxs)
+@@ -273,7 +270,7 @@ R_CullBox (const vec3_t mins, const vec3
+ }
+
+ #ifndef IMPLEMENT_R_Cull
+-extern inline
++inline
+ #endif
+ qboolean
+ R_CullSphere (const vec3_t origin, const float radius)
+@@ -291,7 +288,7 @@ R_CullSphere (const vec3_t origin, const
+ }
+
+ #ifndef IMPLEMENT_VectorNormalize
+-extern inline
++inline
+ #endif
+ float
+ VectorNormalize (vec3_t v)
diff --git a/games/quakeforge/patches/patch-include_r__dynamic.h b/games/quakeforge/patches/patch-include_r__dynamic.h
new file mode 100644
index 00000000000..6f54236a0d1
--- /dev/null
+++ b/games/quakeforge/patches/patch-include_r__dynamic.h
@@ -0,0 +1,13 @@
+$NetBSD: patch-include_r__dynamic.h,v 1.1 2013/03/28 21:25:52 joerg Exp $
+
+--- include/r_dynamic.h.orig 2013-03-28 15:51:46.000000000 +0000
++++ include/r_dynamic.h
+@@ -79,7 +79,7 @@ void R_Particles_Init_Cvars (void);
+ void R_InitBubble (void);
+
+ void R_InitParticles (void);
+-inline void R_ClearParticles (void);
++void R_ClearParticles (void);
+ void R_DrawParticles (void);
+ struct cvar_s;
+ void R_MaxParticlesCheck (struct cvar_s *r_particles,
diff --git a/games/quakeforge/patches/patch-include_r__local.h b/games/quakeforge/patches/patch-include_r__local.h
new file mode 100644
index 00000000000..38e4e4488f0
--- /dev/null
+++ b/games/quakeforge/patches/patch-include_r__local.h
@@ -0,0 +1,13 @@
+$NetBSD: patch-include_r__local.h,v 1.1 2013/03/28 21:25:52 joerg Exp $
+
+--- include/r_local.h.orig 2013-03-28 15:51:51.000000000 +0000
++++ include/r_local.h
+@@ -255,7 +255,7 @@ qboolean R_AliasCheckBBox (void);
+
+ void R_DrawParticles (void);
+ void R_InitParticles (void);
+-inline void R_ClearParticles (void);
++void R_ClearParticles (void);
+ void R_ReadPointFile_f (void);
+ void R_InitSprites (void);
+ void R_SurfacePatch (void);
diff --git a/games/quakeforge/patches/patch-libs_util_llist.c b/games/quakeforge/patches/patch-libs_util_llist.c
new file mode 100644
index 00000000000..242739aba7f
--- /dev/null
+++ b/games/quakeforge/patches/patch-libs_util_llist.c
@@ -0,0 +1,22 @@
+$NetBSD: patch-libs_util_llist.c,v 1.1 2013/03/28 21:25:52 joerg Exp $
+
+--- libs/util/llist.c.orig 2013-03-28 15:10:33.000000000 +0000
++++ libs/util/llist.c
+@@ -215,7 +215,7 @@ llist_size (llist_t *llist)
+ }
+
+ void
+-llist_iterate (llist_t *list, llist_iterator_t iterate)
++llist_iterate (llist_t *list, llist_iterator_t iterate, void *data)
+ {
+ llist_node_t *node;
+
+@@ -223,7 +223,7 @@ llist_iterate (llist_t *list, llist_iter
+ return;
+ for (node = list->start; node; node = list->iter) {
+ list->iter = node->next;
+- if (!iterate (node->data, node))
++ if (!iterate (data, node->data, node))
+ break;
+ }
+ list->iter = 0;