pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/devel/glib2 For the 'trio' varargs functions, don't pa...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/bde503b36f46
branches:  trunk
changeset: 463450:bde503b36f46
user:      fvdl <fvdl%pkgsrc.org@localhost>
date:      Tue Nov 11 13:39:09 2003 +0000

description:
For the 'trio' varargs functions, don't pass a reference to a va_list
argument to the level below; it's not portable. Use va_copy to
create a new copy, and pass a reference to that instead.

diffstat:

 devel/glib2/distinfo         |   11 +-
 devel/glib2/patches/patch-aa |   24 +-
 devel/glib2/patches/patch-ab |  269 +++++++++++++++++++++++++++++++++++++++++-
 devel/glib2/patches/patch-ac |   33 ++--
 devel/glib2/patches/patch-ad |   30 +--
 5 files changed, 305 insertions(+), 62 deletions(-)

diffs (truncated from 394 to 300 lines):

diff -r b26ced747f96 -r bde503b36f46 devel/glib2/distinfo
--- a/devel/glib2/distinfo      Tue Nov 11 13:00:24 2003 +0000
+++ b/devel/glib2/distinfo      Tue Nov 11 13:39:09 2003 +0000
@@ -1,8 +1,9 @@
-$NetBSD: distinfo,v 1.19 2003/09/27 20:18:37 danw Exp $
+$NetBSD: distinfo,v 1.20 2003/11/11 13:39:09 fvdl Exp $
 
 SHA1 (glib-2.2.3.tar.bz2) = 05580cbe110b94dd5020a07cf6d380190a2a13af
 Size (glib-2.2.3.tar.bz2) = 1636987 bytes
-SHA1 (patch-aa) = 6f1a12477763df0edcffd58819e2319f2bfbef4a
-SHA1 (patch-ab) = cf7fd8b57974a01a718ccacb622f874993034de2
-SHA1 (patch-ac) = 6e97c0b3360609f0a4f0f74cd5060f4068364933
-SHA1 (patch-ad) = 13c4bdafc931b8db5d9f83a0035db2244c5be1d1
+SHA1 (patch-aa) = 29ff7360a007d3d02cc3c28dce20e42ccf24bd5a
+SHA1 (patch-ab) = 6713466fc35ee8aed6cb9e7ab52519c632891e56
+SHA1 (patch-ac) = 1b94c567ac0086abfc927f5af1e657f14b091218
+SHA1 (patch-ad) = 58739c123a640a66206c9afa8c28d81e3eb02986
+SHA1 (patch-ae) = fcbd0e4e3bab6805c829c10ae5f3be405b1e9bb5
diff -r b26ced747f96 -r bde503b36f46 devel/glib2/patches/patch-aa
--- a/devel/glib2/patches/patch-aa      Tue Nov 11 13:00:24 2003 +0000
+++ b/devel/glib2/patches/patch-aa      Tue Nov 11 13:39:09 2003 +0000
@@ -1,13 +1,13 @@
-$NetBSD: patch-aa,v 1.8 2003/01/29 10:18:35 tron Exp $
+$NetBSD: patch-aa,v 1.9 2003/11/11 13:39:09 fvdl Exp $
 
---- gthread/gthread-posix.c.orig       2002-11-04 21:04:55.000000000 +0100
-+++ gthread/gthread-posix.c    2003-01-28 11:05:52.000000000 +0100
-@@ -97,7 +97,7 @@
- # error This should not happen. Contact the GLib team.
- #endif
- 
--#if defined (POSIX_MIN_PRIORITY) && defined (POSIX_MAX_PRIORITY)
-+#if defined (POSIX_MIN_PRIORITY) && defined (POSIX_MAX_PRIORITY) && defined(_POSIX_THREAD_PRIORITY_SCHEDULING)
- # define HAVE_PRIORITIES 1
- static gint priority_normal_value;
- # ifdef __FreeBSD__
+--- configure.orig     2003-08-26 18:42:14.000000000 +0200
++++ configure
+@@ -31199,7 +31199,7 @@ fi
+ #  b) libtool doesn't recognize -pthread as a library dependency.
+ #
+ case $host in
+-  *-*-linux*)
++  *-*-linux* | *-*-netbsd*)
+     G_THREAD_LIBS_FOR_GTHREAD="`echo $G_THREAD_LIBS | sed s/-pthread/-lpthread/`"
+     ;;
+   *)
diff -r b26ced747f96 -r bde503b36f46 devel/glib2/patches/patch-ab
--- a/devel/glib2/patches/patch-ab      Tue Nov 11 13:00:24 2003 +0000
+++ b/devel/glib2/patches/patch-ab      Tue Nov 11 13:39:09 2003 +0000
@@ -1,13 +1,258 @@
-$NetBSD: patch-ab,v 1.6 2003/02/09 00:57:14 chris Exp $
+$NetBSD: patch-ab,v 1.7 2003/11/11 13:39:09 fvdl Exp $
 
---- configure.orig     2003-02-09 00:44:10.000000000 +0000
-+++ configure  2003-02-09 00:46:14.000000000 +0000
-@@ -19025,7 +19025,7 @@
- #  b) libtool doesn't recognize -pthread as a library dependency.
- #
- case $host in
--  *-*-linux*)
-+  *-*-linux* | *-*-netbsd*)
-     G_THREAD_LIBS_FOR_GTHREAD="`echo $G_THREAD_LIBS | sed s/-pthread/-lpthread/`"
-     ;;
-   *)
+--- glib/trio/trio.c.orig      2003-08-26 02:17:43.000000000 +0200
++++ glib/trio/trio.c
+@@ -3575,9 +3575,12 @@ TRIO_ARGS2((format, args),
+          TRIO_CONST char *format,
+          va_list args)
+ {
++  va_list args2;
++
+   assert(VALID(format));
+ 
+-  return TrioFormat(stdout, 0, TrioOutStreamFile, format, &args, NULL);
++  va_copy(args2, args);
++  return TrioFormat(stdout, 0, TrioOutStreamFile, format, &args2, NULL);
+ }
+ 
+ /**
+@@ -3644,10 +3647,13 @@ TRIO_ARGS3((file, format, args),
+          TRIO_CONST char *format,
+          va_list args)
+ {
++  va_list args2;
++
+   assert(VALID(file));
+   assert(VALID(format));
+-  
+-  return TrioFormat(file, 0, TrioOutStreamFile, format, &args, NULL);
++
++  va_copy(args2, args);  
++  return TrioFormat(file, 0, TrioOutStreamFile, format, &args2, NULL);
+ }
+ 
+ /**
+@@ -3716,9 +3722,12 @@ TRIO_ARGS3((fd, format, args),
+          TRIO_CONST char *format,
+          va_list args)
+ {
++  va_list args2;
++
+   assert(VALID(format));
+-  
+-  return TrioFormat(&fd, 0, TrioOutStreamFileDescriptor, format, &args, NULL);
++
++  va_copy(args2, args);  
++  return TrioFormat(&fd, 0, TrioOutStreamFileDescriptor, format, &args2, NULL);
+ }
+ 
+ /**
+@@ -3775,6 +3784,7 @@ TRIO_ARGS4((stream, closure, format, arg
+          TRIO_CONST char *format,
+          va_list args)
+ {
++  va_list args2;
+   trio_custom_t data;
+ 
+   assert(VALID(stream));
+@@ -3782,7 +3792,8 @@ TRIO_ARGS4((stream, closure, format, arg
+ 
+   data.stream.out = stream;
+   data.closure = closure;
+-  return TrioFormat(&data, 0, TrioOutStreamCustom, format, &args, NULL);
++  va_copy(args2, args);
++  return TrioFormat(&data, 0, TrioOutStreamCustom, format, &args2, NULL);
+ }
+ 
+ TRIO_PUBLIC int
+@@ -3850,12 +3861,14 @@ TRIO_ARGS3((buffer, format, args),
+          TRIO_CONST char *format,
+          va_list args)
+ {
++  va_list args2;
+   int status;
+ 
+   assert(VALID(buffer));
+   assert(VALID(format));
+ 
+-  status = TrioFormat(&buffer, 0, TrioOutStreamString, format, &args, NULL);
++  va_copy(args2, args);
++  status = TrioFormat(&buffer, 0, TrioOutStreamString, format, &args2, NULL);
+   *buffer = NIL;
+   return status;
+ }
+@@ -3938,13 +3951,15 @@ TRIO_ARGS4((buffer, max, format, args),
+          TRIO_CONST char *format,
+          va_list args)
+ {
++  va_list args2;
+   int status;
+ 
+   assert(max == 0 || VALID(buffer));
+   assert(VALID(format));
+ 
++  va_copy(args2, args);
+   status = TrioFormat(&buffer, max > 0 ? max - 1 : 0,
+-                    TrioOutStreamStringMax, format, &args, NULL);
++                    TrioOutStreamStringMax, format, &args2, NULL);
+   if (max > 0)
+     *buffer = NIL;
+   return status;
+@@ -4019,6 +4034,7 @@ TRIO_ARGS4((buffer, max, format, args),
+          TRIO_CONST char *format,
+          va_list args)
+ {
++  va_list args2;
+   int status;
+   size_t buf_len;
+   
+@@ -4027,8 +4043,9 @@ TRIO_ARGS4((buffer, max, format, args),
+ 
+   buf_len = trio_length(buffer);
+   buffer = &buffer[buf_len];
++  va_copy(args2, args);
+   status = TrioFormat(&buffer, max - 1 - buf_len,
+-                    TrioOutStreamStringMax, format, &args, NULL);
++                    TrioOutStreamStringMax, format, &args2, NULL);
+   *buffer = NIL;
+   return status;
+ }
+@@ -4072,6 +4089,7 @@ TRIO_ARGS2((format, args),
+          TRIO_CONST char *format,
+          va_list args)
+ {
++  va_list args2;
+   trio_string_t *info;
+   char *result = NULL;
+   
+@@ -4080,8 +4098,9 @@ TRIO_ARGS2((format, args),
+   info = trio_xstring_duplicate("");
+   if (info)
+     {
++      va_copy(args2, args);
+       (void)TrioFormat(info, 0, TrioOutStreamStringDynamic,
+-                     format, &args, NULL);
++                     format, &args2, NULL);
+       trio_string_terminate(info);
+       result = trio_string_extract(info);
+       trio_string_destroy(info);
+@@ -4132,6 +4151,7 @@ TRIO_ARGS3((result, format, args),
+          TRIO_CONST char *format,
+          va_list args)
+ {
++  va_list args2;
+   int status;
+   trio_string_t *info;
+   
+@@ -4146,8 +4166,9 @@ TRIO_ARGS3((result, format, args),
+     }
+   else
+     {
++      va_copy(args2, args);
+       status = TrioFormat(info, 0, TrioOutStreamStringDynamic,
+-                        format, &args, NULL);
++                        format, &args2, NULL);
+       if (status >= 0)
+       {
+         trio_string_terminate(info);
+@@ -4834,9 +4855,11 @@ TRIO_ARGS3((ref, format, arglist),
+          TRIO_CONST char *format,
+          va_list arglist)
+ {
++  va_list args2;
+   assert(VALID(format));
+-  
+-  return TrioFormatRef((trio_reference_t *)ref, format, &arglist, NULL);
++
++  va_copy(args2, arglist); 
++  return TrioFormatRef((trio_reference_t *)ref, format, &args2, NULL);
+ }
+ 
+ /*************************************************************************
+@@ -6487,11 +6510,13 @@ TRIO_ARGS2((format, args),
+          TRIO_CONST char *format,
+          va_list args)
+ {
++  va_list args2;
+   assert(VALID(format));
+-  
++
++  va_copy(args2, args);
+   return TrioScan((trio_pointer_t)stdin, 0,
+                 TrioInStreamFile,
+-                format, &args, NULL);
++                format, &args2, NULL);
+ }
+ 
+ TRIO_PUBLIC int
+@@ -6538,12 +6563,15 @@ TRIO_ARGS3((file, format, args),
+          TRIO_CONST char *format,
+          va_list args)
+ {
++  va_list args2;
++
+   assert(VALID(file));
+   assert(VALID(format));
+-  
++
++  va_copy(args2, args);  
+   return TrioScan((trio_pointer_t)file, 0,
+                 TrioInStreamFile,
+-                format, &args, NULL);
++                format, &args2, NULL);
+ }
+ 
+ TRIO_PUBLIC int
+@@ -6591,11 +6619,13 @@ TRIO_ARGS3((fd, format, args),
+          TRIO_CONST char *format,
+          va_list args)
+ {
++  va_list args2;
+   assert(VALID(format));
+-  
++
++  va_copy(args2, args); 
+   return TrioScan((trio_pointer_t)&fd, 0,
+                 TrioInStreamFileDescriptor,
+-                format, &args, NULL);
++                format, &args2, NULL);
+ }
+ 
+ TRIO_PUBLIC int
+@@ -6646,6 +6676,7 @@ TRIO_ARGS4((stream, closure, format, arg
+          TRIO_CONST char *format,
+          va_list args)
+ {
++  va_list args2;
+   trio_custom_t data;
+   
+   assert(VALID(stream));
+@@ -6653,7 +6684,9 @@ TRIO_ARGS4((stream, closure, format, arg
+ 
+   data.stream.in = stream;
+   data.closure = closure;
+-  return TrioScan(&data, 0, TrioInStreamCustom, format, &args, NULL);
++
++  va_copy(args2, args);
++  return TrioScan(&data, 0, TrioInStreamCustom, format, &args2, NULL);



Home | Main Index | Thread Index | Old Index