1 /* This is a modfied version of va-arg-2.c to test passing a va_list as
2 a parameter to another function. */
6 extern __SIZE_TYPE__
strlen (const char *);
9 to_hex (unsigned int a
)
11 static char hex
[] = "0123456789abcdef";
19 fap (int i
, char* format
, va_list ap
)
21 if (strlen (format
) != 16 - i
)
24 if (*format
++ != to_hex (va_arg (ap
, int)))
29 f0 (char* format
, ...)
33 va_start (ap
, format
);
39 f1 (int a1
, char* format
, ...)
49 f2 (int a1
, int a2
, char* format
, ...)
59 f3 (int a1
, int a2
, int a3
, char* format
, ...)
69 f4 (int a1
, int a2
, int a3
, int a4
, char* format
, ...)
79 f5 (int a1
, int a2
, int a3
, int a4
, int a5
,
90 f6 (int a1
, int a2
, int a3
, int a4
, int a5
,
102 f7 (int a1
, int a2
, int a3
, int a4
, int a5
,
108 va_start(ap
, format
);
114 f8 (int a1
, int a2
, int a3
, int a4
, int a5
,
115 int a6
, int a7
, int a8
,
120 va_start(ap
, format
);
126 f9 (int a1
, int a2
, int a3
, int a4
, int a5
,
127 int a6
, int a7
, int a8
, int a9
,
132 va_start(ap
, format
);
138 f10 (int a1
, int a2
, int a3
, int a4
, int a5
,
139 int a6
, int a7
, int a8
, int a9
, int a10
,
144 va_start(ap
, format
);
150 f11 (int a1
, int a2
, int a3
, int a4
, int a5
,
151 int a6
, int a7
, int a8
, int a9
, int a10
,
157 va_start(ap
, format
);
163 f12 (int a1
, int a2
, int a3
, int a4
, int a5
,
164 int a6
, int a7
, int a8
, int a9
, int a10
,
170 va_start(ap
, format
);
176 f13 (int a1
, int a2
, int a3
, int a4
, int a5
,
177 int a6
, int a7
, int a8
, int a9
, int a10
,
178 int a11
, int a12
, int a13
,
183 va_start(ap
, format
);
189 f14 (int a1
, int a2
, int a3
, int a4
, int a5
,
190 int a6
, int a7
, int a8
, int a9
, int a10
,
191 int a11
, int a12
, int a13
, int a14
,
196 va_start(ap
, format
);
202 f15 (int a1
, int a2
, int a3
, int a4
, int a5
,
203 int a6
, int a7
, int a8
, int a9
, int a10
,
204 int a11
, int a12
, int a13
, int a14
, int a15
,
209 va_start(ap
, format
);
216 char *f
= "0123456789abcdef";
218 f0 (f
+0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
219 f1 (0, f
+1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
220 f2 (0, 1, f
+2, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
221 f3 (0, 1, 2, f
+3, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
222 f4 (0, 1, 2, 3, f
+4, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
223 f5 (0, 1, 2, 3, 4, f
+5, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
224 f6 (0, 1, 2, 3, 4, 5, f
+6, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
225 f7 (0, 1, 2, 3, 4, 5, 6, f
+7, 7, 8, 9, 10, 11, 12, 13, 14, 15);
226 f8 (0, 1, 2, 3, 4, 5, 6, 7, f
+8, 8, 9, 10, 11, 12, 13, 14, 15);
227 f9 (0, 1, 2, 3, 4, 5, 6, 7, 8, f
+9, 9, 10, 11, 12, 13, 14, 15);
228 f10 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, f
+10, 10, 11, 12, 13, 14, 15);
229 f11 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, f
+11, 11, 12, 13, 14, 15);
230 f12 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, f
+12, 12, 13, 14, 15);
231 f13 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, f
+13, 13, 14, 15);
232 f14 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, f
+14, 14, 15);
233 f15 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, f
+15, 15);