aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Dos Reis <gdr@integrable-solutions.net>2003-04-30 12:54:29 +0000
committerGabriel Dos Reis <gdr@gcc.gnu.org>2003-04-30 12:54:29 +0000
commit10256cf5f62a636e4ceed09ff624edc3cb4fc52e (patch)
treea2666498880556a83ff9f0c75bb3670739099bdc
parentb2a7fa89ee52438c78715ca70f236a5f348b35f2 (diff)
downloadgcc-10256cf5f62a636e4ceed09ff624edc3cb4fc52e.zip
gcc-10256cf5f62a636e4ceed09ff624edc3cb4fc52e.tar.gz
gcc-10256cf5f62a636e4ceed09ff624edc3cb4fc52e.tar.bz2
diagnostic.h (output_formatted_scalar): Tweak.
* diagnostic.h (output_formatted_scalar): Tweak. * diagnostic.c (output_long_decimal): Likewise. (output_unsigned_decimal): Likewise. (output_long_unsigned_decimal): Likewise. (output_octal): Likewise. (output_long_octal): Likewise. (output_hexadecimal): Likewise. (output_long_hexadecimal): Likewise. (output_pointer): New function. (output_format): Use it. Recognize "%p" format specifier. From-SVN: r66287
-rw-r--r--gcc/ChangeLog13
-rw-r--r--gcc/diagnostic.c55
-rw-r--r--gcc/diagnostic.h4
3 files changed, 41 insertions, 31 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index c453b20..eb02424 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,16 @@
+2003-04-30 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * diagnostic.h (output_formatted_scalar): Tweak.
+ * diagnostic.c (output_long_decimal): Likewise.
+ (output_unsigned_decimal): Likewise.
+ (output_long_unsigned_decimal): Likewise.
+ (output_octal): Likewise.
+ (output_long_octal): Likewise.
+ (output_hexadecimal): Likewise.
+ (output_long_hexadecimal): Likewise.
+ (output_pointer): New function.
+ (output_format): Use it. Recognize "%p" format specifier.
+
2003-04-30 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
* function.c (purge_addressof_1): Postpone insn in fewer cases.
diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c
index 21d78a9..901484a 100644
--- a/gcc/diagnostic.c
+++ b/gcc/diagnostic.c
@@ -307,62 +307,54 @@ output_decimal (buffer, i)
output_formatted_scalar (buffer, "%d", i);
}
-static void
-output_long_decimal (buffer, i)
- output_buffer *buffer;
- long int i;
+static inline void
+output_long_decimal (output_buffer *buffer, long int i)
{
output_formatted_scalar (buffer, "%ld", i);
}
-static void
-output_unsigned_decimal (buffer, i)
- output_buffer *buffer;
- unsigned int i;
+static inline void
+output_unsigned_decimal (output_buffer *buffer, unsigned int i)
{
output_formatted_scalar (buffer, "%u", i);
}
-static void
-output_long_unsigned_decimal (buffer, i)
- output_buffer *buffer;
- long unsigned int i;
+static inline void
+output_long_unsigned_decimal (output_buffer *buffer, long unsigned int i)
{
output_formatted_scalar (buffer, "%lu", i);
}
-static void
-output_octal (buffer, i)
- output_buffer *buffer;
- unsigned int i;
+static inline void
+output_octal (output_buffer *buffer, unsigned int i)
{
output_formatted_scalar (buffer, "%o", i);
}
-static void
-output_long_octal (buffer, i)
- output_buffer *buffer;
- unsigned long int i;
+static inline void
+output_long_octal (output_buffer *buffer, long unsigned int i)
{
output_formatted_scalar (buffer, "%lo", i);
}
-static void
-output_hexadecimal (buffer, i)
- output_buffer *buffer;
- unsigned int i;
+static inline void
+output_hexadecimal (output_buffer *buffer, unsigned int i)
{
output_formatted_scalar (buffer, "%x", i);
}
-static void
-output_long_hexadecimal (buffer, i)
- output_buffer *buffer;
- unsigned long int i;
+static inline void
+output_long_hexadecimal (output_buffer *buffer, long unsigned int i)
{
output_formatted_scalar (buffer, "%lx", i);
}
+static inline void
+output_pointer (output_buffer *buffer, void *p)
+{
+ output_formatted_scalar (buffer, "%p", p);
+}
+
/* Append to BUFFER a string specified by its STARTING character
and LENGTH. */
static void
@@ -497,6 +489,7 @@ output_buffer_to_stream (buffer)
%ld, %li, %lo, %lu, %lx: long versions of the above.
%c: character.
%s: string.
+ %p: pointer.
%%: `%'.
%*.s: a substring the length of which is specified by an integer.
%H: location_t. */
@@ -530,7 +523,7 @@ output_format (buffer, text)
}
/* Handle %c, %d, %i, %ld, %li, %lo, %lu, %lx, %o, %s, %u,
- %x, %.*s; %%. And nothing else. Front-ends should install
+ %x, %p, %.*s; %%. And nothing else. Front-ends should install
printers to grok language specific format specifiers. */
switch (*text->format_spec)
{
@@ -558,6 +551,10 @@ output_format (buffer, text)
output_add_string (buffer, va_arg (*text->args_ptr, const char *));
break;
+ case 'p':
+ output_pointer (buffer, va_arg (*text->args_ptr, void *));
+ break;
+
case 'u':
if (long_integer)
output_long_unsigned_decimal
diff --git a/gcc/diagnostic.h b/gcc/diagnostic.h
index 2c822fc..acbb628 100644
--- a/gcc/diagnostic.h
+++ b/gcc/diagnostic.h
@@ -160,10 +160,10 @@ struct output_buffer
/* True if BUFFER is in line-wrapping mode. */
#define output_is_line_wrapping(BUFFER) (output_line_cutoff (BUFFER) > 0)
-#define output_formatted_scalar(BUFFER, FORMAT, INTEGER) \
+#define output_formatted_scalar(BUFFER, FORMAT, SCALAR) \
do \
{ \
- sprintf ((BUFFER)->digit_buffer, FORMAT, INTEGER); \
+ sprintf ((BUFFER)->digit_buffer, FORMAT, SCALAR); \
output_add_string (BUFFER, (BUFFER)->digit_buffer); \
} \
while (0)