~ubuntu-branches/ubuntu/maverick/xchat/maverick

« back to all changes in this revision

Viewing changes to intl/printf-args.c

  • Committer: Bazaar Package Importer
  • Author(s): Lorenzo De Liso
  • Date: 2010-06-21 22:47:10 UTC
  • mfrom: (2.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20100621224710-9t1iyiglri330pss
Tags: 2.8.8-1ubuntu1
* Merge from debian unstable (LP: #597042), remaining changes:
  - debian/patches:
    + series: Refreshed.
    + 01_serverlist.patch: Numerous changes to default serverlist.
    + 02_ubuntu_default_server.patch: select "Ubuntu servers" by default.
    + 37_lpi.patch: Add launchpad integration.
    + 38_autoconf.patch: Autoconf modifications for launchpad integration.
    + 45_brand_ctcp_version.patch: Add Ubuntu brand to CTCP version response.
    + 70_notification_strings_shorten.patch: Shorten notification strings.
  - debian/control:
    + Build-depend on libgtk2.0-dev (>= 2.10.0).
    + Build-depend on liblaunchpad-integration-dev.
    + Remove conflict/replaces on xchat-gnome.
    + Updated Maintainer field to match Ubuntu Developers.
  - debian/rules:
    + Make build independent of the python version.
  - debian/patches/45_ctcp_version_less_information.dpatch: 
    + Renamed to debian/patches/45_brand_ctcp_version.patch
    + Added short description.
* Converted all patches to quilt, as in debian quilt has been
  adopted, all old dpatch patches have been renamed with the 
  *.patch extension.
* Dropped changes:
  - 71_notification_icon_change.patch: can't be applied

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* Decomposed printf argument list.
2
 
   Copyright (C) 1999, 2002-2003, 2005-2006 Free Software Foundation, Inc.
 
2
   Copyright (C) 1999, 2002-2003, 2005-2007 Free Software Foundation, Inc.
3
3
 
4
4
   This program is free software; you can redistribute it and/or modify it
5
5
   under the terms of the GNU Library General Public License as published
16
16
   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
17
17
   USA.  */
18
18
 
19
 
#include <config.h>
 
19
/* This file can be parametrized with the following macros:
 
20
     ENABLE_UNISTDIO    Set to 1 to enable the unistdio extensions.
 
21
     PRINTF_FETCHARGS   Name of the function to be defined.
 
22
     STATIC             Set to 'static' to declare the function static.  */
 
23
 
 
24
#ifndef PRINTF_FETCHARGS
 
25
# include <config.h>
 
26
#endif
20
27
 
21
28
/* Specification.  */
22
 
#include "printf-args.h"
 
29
#ifndef PRINTF_FETCHARGS
 
30
# include "printf-args.h"
 
31
#endif
23
32
 
24
33
#ifdef STATIC
25
34
STATIC
26
35
#endif
27
36
int
28
 
printf_fetchargs (va_list args, arguments *a)
 
37
PRINTF_FETCHARGS (va_list args, arguments *a)
29
38
{
30
39
  size_t i;
31
40
  argument *ap;
57
66
      case TYPE_ULONGINT:
58
67
        ap->a.a_ulongint = va_arg (args, unsigned long int);
59
68
        break;
60
 
#ifdef HAVE_LONG_LONG_INT
 
69
#if HAVE_LONG_LONG_INT
61
70
      case TYPE_LONGLONGINT:
62
71
        ap->a.a_longlongint = va_arg (args, long long int);
63
72
        break;
68
77
      case TYPE_DOUBLE:
69
78
        ap->a.a_double = va_arg (args, double);
70
79
        break;
71
 
#ifdef HAVE_LONG_DOUBLE
72
80
      case TYPE_LONGDOUBLE:
73
81
        ap->a.a_longdouble = va_arg (args, long double);
74
82
        break;
75
 
#endif
76
83
      case TYPE_CHAR:
77
84
        ap->a.a_char = va_arg (args, int);
78
85
        break;
79
 
#ifdef HAVE_WINT_T
 
86
#if HAVE_WINT_T
80
87
      case TYPE_WIDE_CHAR:
81
88
        /* Although ISO C 99 7.24.1.(2) says that wint_t is "unchanged by
82
89
           default argument promotions", this is not the case in mingw32,
95
102
        if (ap->a.a_string == NULL)
96
103
          ap->a.a_string = "(NULL)";
97
104
        break;
98
 
#ifdef HAVE_WCHAR_T
 
105
#if HAVE_WCHAR_T
99
106
      case TYPE_WIDE_STRING:
100
107
        ap->a.a_wide_string = va_arg (args, const wchar_t *);
101
108
        /* A null pointer is an invalid argument for "%ls", but in practice
129
136
      case TYPE_COUNT_LONGINT_POINTER:
130
137
        ap->a.a_count_longint_pointer = va_arg (args, long int *);
131
138
        break;
132
 
#ifdef HAVE_LONG_LONG_INT
 
139
#if HAVE_LONG_LONG_INT
133
140
      case TYPE_COUNT_LONGLONGINT_POINTER:
134
141
        ap->a.a_count_longlongint_pointer = va_arg (args, long long int *);
135
142
        break;
136
143
#endif
 
144
#if ENABLE_UNISTDIO
 
145
      /* The unistdio extensions.  */
 
146
      case TYPE_U8_STRING:
 
147
        ap->a.a_u8_string = va_arg (args, const uint8_t *);
 
148
        /* A null pointer is an invalid argument for "%U", but in practice
 
149
           it occurs quite frequently in printf statements that produce
 
150
           debug output.  Use a fallback in this case.  */
 
151
        if (ap->a.a_u8_string == NULL)
 
152
          {
 
153
            static const uint8_t u8_null_string[] =
 
154
              { '(', 'N', 'U', 'L', 'L', ')', 0 };
 
155
            ap->a.a_u8_string = u8_null_string;
 
156
          }
 
157
        break;
 
158
      case TYPE_U16_STRING:
 
159
        ap->a.a_u16_string = va_arg (args, const uint16_t *);
 
160
        /* A null pointer is an invalid argument for "%lU", but in practice
 
161
           it occurs quite frequently in printf statements that produce
 
162
           debug output.  Use a fallback in this case.  */
 
163
        if (ap->a.a_u16_string == NULL)
 
164
          {
 
165
            static const uint16_t u16_null_string[] =
 
166
              { '(', 'N', 'U', 'L', 'L', ')', 0 };
 
167
            ap->a.a_u16_string = u16_null_string;
 
168
          }
 
169
        break;
 
170
      case TYPE_U32_STRING:
 
171
        ap->a.a_u32_string = va_arg (args, const uint32_t *);
 
172
        /* A null pointer is an invalid argument for "%llU", but in practice
 
173
           it occurs quite frequently in printf statements that produce
 
174
           debug output.  Use a fallback in this case.  */
 
175
        if (ap->a.a_u32_string == NULL)
 
176
          {
 
177
            static const uint32_t u32_null_string[] =
 
178
              { '(', 'N', 'U', 'L', 'L', ')', 0 };
 
179
            ap->a.a_u32_string = u32_null_string;
 
180
          }
 
181
        break;
 
182
#endif
137
183
      default:
138
184
        /* Unknown type.  */
139
185
        return -1;