aboutsummaryrefslogtreecommitdiff
path: root/gcc/f/sts.c
diff options
context:
space:
mode:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>1999-11-29 02:26:49 +0000
committerKaveh Ghazi <ghazi@gcc.gnu.org>1999-11-29 02:26:49 +0000
commit14657de8f1fd8fff5cb3bed37d91267beea5e1f3 (patch)
tree0cd978ce53551cb7dfa9d8927ebebee6a99623a6 /gcc/f/sts.c
parent146e60a0704290a2dcac78ffb1a2efbd7b852f7e (diff)
downloadgcc-14657de8f1fd8fff5cb3bed37d91267beea5e1f3.zip
gcc-14657de8f1fd8fff5cb3bed37d91267beea5e1f3.tar.gz
gcc-14657de8f1fd8fff5cb3bed37d91267beea5e1f3.tar.bz2
com.c (ffecom_get_invented_identifier): Rewrite to take an ellipses.
* com.c (ffecom_get_invented_identifier): Rewrite to take an ellipses. (ffecom_char_enhance_arg_, ffecom_do_entry_, ffecom_f2c_make_type_, ffecom_gen_sfuncdef_, ffecom_start_progunit_, ffecom_start_progunit_, ffecom_start_progunit_, ffecom_sym_transform_assign_, ffecom_transform_equiv_, ffecom_transform_namelist_, ffecom_vardesc_, ffecom_vardesc_array_, ffecom_vardesc_dims_, ffecom_end_transition, ffecom_lookup_label, ffecom_temp_label): Adjust accordingly. * com.h (ffecom_get_invented_identifier): Likewise. * sts.c (ffests_printf): New function taking ellipses. (ffests_printf_1D, ffests_printf_1U, ffests_printf_1s, ffests_printf_2Us): Delete. * sts.h: Likewise. * std.c (ffestd_R1001dump_, ffestd_R1001dump_1005_1_, ffestd_R1001dump_1005_2_, ffestd_R1001dump_1005_3_, ffestd_R1001dump_1005_4_, ffestd_R1001dump_1005_5_, ffestd_R1001dump_1010_2_, ffestd_R1001dump_1010_3_, ffestd_R1001dump_1010_4_, ffestd_R1001dump_1010_5_, ffestd_R1001rtexpr_): Call `ffests_printf', not `ffests_printf_*'. * ste.c (ffeste_io_ialist_, ffeste_io_cilist_, ffeste_io_cllist_, ffeste_io_icilist_, ffeste_io_inlist_, ffeste_io_olist_): Likewise. From-SVN: r30692
Diffstat (limited to 'gcc/f/sts.c')
-rw-r--r--gcc/f/sts.c118
1 files changed, 12 insertions, 106 deletions
diff --git a/gcc/f/sts.c b/gcc/f/sts.c
index 143f550..63bf77a 100644
--- a/gcc/f/sts.c
+++ b/gcc/f/sts.c
@@ -96,119 +96,25 @@ ffests_new (ffests s, mallocPool pool, ffestsLength size)
s->text_ = malloc_new_ksr (pool, "ffests", size);
}
-/* ffests_printf_1D -- printf("...%ld...",(long)) to a string
+/* ffests_printf -- printf ("...%ld...",(long)) to a string
ffests s;
- ffests_printf_1D(s,"...%ld...",1);
+ ffests_printf (s,"...%ld...",1);
Like printf, but into a string. */
void
-ffests_printf_1D (ffests s, const char *ctl, long arg1)
+ffests_printf (ffests s, const char *ctl, ...)
{
- char quickbuf[40];
- char *buff;
- ffestsLength len;
-
- if ((len = strlen (ctl) + 21) < ARRAY_SIZE (quickbuf))
- /* No # bigger than 20 digits. */
- {
- sprintf (&quickbuf[0], ctl, arg1);
- ffests_puttext (s, &quickbuf[0], strlen (quickbuf));
- }
- else
- {
- buff = malloc_new_ks (malloc_pool_image (), "ffests_printf_1D", len);
- sprintf (buff, ctl, arg1);
- ffests_puttext (s, buff, strlen (buff));
- malloc_kill_ks (malloc_pool_image (), buff, len);
- }
-}
-
-/* ffests_printf_1U -- printf("...%lu...",(unsigned long)) to a string
-
- ffests s;
- ffests_printf_1U(s,"...%lu...",1);
-
- Like printf, but into a string. */
-
-void
-ffests_printf_1U (ffests s, const char *ctl, unsigned long arg1)
-{
- char quickbuf[40];
- char *buff;
- ffestsLength len;
-
- if ((len = strlen (ctl) + 21) < ARRAY_SIZE (quickbuf))
- /* No # bigger than 20 digits. */
- {
- sprintf (&quickbuf[0], ctl, arg1);
- ffests_puttext (s, &quickbuf[0], strlen (quickbuf));
- }
- else
- {
- buff = malloc_new_ks (malloc_pool_image (), "ffests_printf_1U", len);
- sprintf (buff, ctl, arg1);
- ffests_puttext (s, buff, strlen (buff));
- malloc_kill_ks (malloc_pool_image (), buff, len);
- }
-}
-
-/* ffests_printf_1s -- printf("...%s...",(char *)) to a string
-
- ffests s;
- ffests_printf_1s(s,"...%s...","hi there!");
-
- Like printf, but into a string. */
-
-void
-ffests_printf_1s (ffests s, const char *ctl, const char *arg1)
-{
- char quickbuf[40];
- char *buff;
- ffestsLength len;
-
- if ((len = strlen (ctl) + strlen (arg1) - 1) < ARRAY_SIZE (quickbuf))
- {
- sprintf (&quickbuf[0], ctl, arg1);
- ffests_puttext (s, &quickbuf[0], strlen (quickbuf));
- }
- else
- {
- buff = malloc_new_ks (malloc_pool_image (), "ffests_printf_1s", len);
- sprintf (buff, ctl, arg1);
- ffests_puttext (s, buff, strlen (buff));
- malloc_kill_ks (malloc_pool_image (), buff, len);
- }
-}
-
-/* ffests_printf_2Us -- printf("...%lu...%s...",...) to a string
-
- ffests s;
- ffests_printf_2Us(s,"...%lu...%s...",1,"hi there!");
-
- Like printf, but into a string. */
-
-void
-ffests_printf_2Us (ffests s, const char *ctl, unsigned long arg1, const char *arg2)
-{
- char quickbuf[60];
- char *buff;
- ffestsLength len;
-
- if ((len = strlen (ctl) + 21 + strlen (arg2) - 1) < ARRAY_SIZE (quickbuf))
- /* No # bigger than 20 digits. */
- {
- sprintf (&quickbuf[0], ctl, arg1, arg2);
- ffests_puttext (s, &quickbuf[0], strlen (quickbuf));
- }
- else
- {
- buff = malloc_new_ks (malloc_pool_image (), "ffests_printf_2Us", len);
- sprintf (buff, ctl, arg1, arg2);
- ffests_puttext (s, buff, strlen (buff));
- malloc_kill_ks (malloc_pool_image (), buff, len);
- }
+ char *string;
+ va_list ap;
+
+ va_start (ap, ctl);
+ if (vasprintf (&string, ctl, ap) == 0)
+ abort ();
+ va_end (ap);
+ ffests_puts (s, string);
+ free (string);
}
/* ffests_putc -- Put a single character into string