aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2015-05-21 15:48:46 +0100
committerFlorian Weimer <fweimer@redhat.com>2015-05-21 16:48:46 +0200
commit0f87de79e935b2f8bcc2b90ab750a358c26f6715 (patch)
tree1d41b029961e440b0aa128e81fb14e499118783e
parentf8194fa6f991456bd2cf79f2cdfbec7b497eb342 (diff)
downloadglibc-0f87de79e935b2f8bcc2b90ab750a358c26f6715.zip
glibc-0f87de79e935b2f8bcc2b90ab750a358c26f6715.tar.gz
glibc-0f87de79e935b2f8bcc2b90ab750a358c26f6715.tar.bz2
vfprintf: Remove label name switching for the jump table
Different labels are no longer needed because the tables are now in separate functions.
-rw-r--r--ChangeLog5
-rw-r--r--stdio-common/vfprintf.c21
2 files changed, 9 insertions, 17 deletions
diff --git a/ChangeLog b/ChangeLog
index 48311f5..30a7432 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2015-05-21 Florian Weimer <fweimer@redhat.com>
+ * stdio-common/vfprintf.c (LABEL, JUMP_TABLE_BASE_LABEL, REF):
+ Adjust jump table label generation macros.
+
+2015-05-21 Florian Weimer <fweimer@redhat.com>
+
* stdio-common/vfprintf.c (vfprintf): Move local variables
args_malloced, specs, specs_malloced, and the code after
do_positional to the printf_positional function.
diff --git a/stdio-common/vfprintf.c b/stdio-common/vfprintf.c
index 4753cbf..0592e70 100644
--- a/stdio-common/vfprintf.c
+++ b/stdio-common/vfprintf.c
@@ -233,9 +233,12 @@ static const uint8_t jump_table[] =
#define NOT_IN_JUMP_RANGE(Ch) ((Ch) < L_(' ') || (Ch) > L_('z'))
#define CHAR_CLASS(Ch) (jump_table[(INT_T) (Ch) - L_(' ')])
+#define LABEL(Name) do_##Name
#ifdef SHARED
/* 'int' is enough and it saves some space on 64 bit systems. */
# define JUMP_TABLE_TYPE const int
+# define JUMP_TABLE_BASE_LABEL do_form_unknown
+# define REF(Name) &&do_##Name - &&JUMP_TABLE_BASE_LABEL
# define JUMP(ChExpr, table) \
do \
{ \
@@ -250,6 +253,7 @@ static const uint8_t jump_table[] =
while (0)
#else
# define JUMP_TABLE_TYPE const void *const
+# define REF(Name) &&do_##Name
# define JUMP(ChExpr, table) \
do \
{ \
@@ -1328,13 +1332,6 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap)
/* Process whole format string. */
do
{
-#ifdef SHARED
-# define JUMP_TABLE_BASE_LABEL do_form_unknown
-# define REF(Name) (&&do_##Name - &&JUMP_TABLE_BASE_LABEL)
-#else
-# define REF(Name) &&do_##Name
-#endif
-#define LABEL(Name) do_##Name
STEP0_3_TABLE;
STEP4_TABLE;
@@ -1928,16 +1925,6 @@ printf_positional (_IO_FILE *s, const CHAR_T *format, int readonly_format,
/* Now walk through all format specifiers and process them. */
for (; (size_t) nspecs_done < nspecs; ++nspecs_done)
{
-#undef REF
-#ifdef SHARED
-# undef JUMP_TABLE_BASE_LABEL
-# define JUMP_TABLE_BASE_LABEL do2_form_unknown
-# define REF(Name) (&&do2_##Name - &&JUMP_TABLE_BASE_LABEL)
-#else
-# define REF(Name) &&do2_##Name
-#endif
-#undef LABEL
-#define LABEL(Name) do2_##Name
STEP4_TABLE;
int is_negative;