Commit 0e9e3a8b by Gabriel Dos Reis Committed by Gabriel Dos Reis

diagnostic.h (output_host_wide_integer): Declare.

	* diagnostic.h (output_host_wide_integer): Declare.
	* diagnostic.c (output_long_long_decicaml): New function.
	(output_host_wide_integer): Likewise.
	(output_format): Use them.  Handle "%ll" and "%w".

From-SVN: r68323
parent ad667abe
2003-06-22 Gabriel Dos Reis <gdr@integrable-solutions.net>
* diagnostic.h (output_host_wide_integer): Declare.
* diagnostic.c (output_long_long_decicaml): New function.
(output_host_wide_integer): Likewise.
(output_format): Use them. Handle "%ll" and "%w".
2003-06-21 Jason Thorpe <thorpej@wasabisystems.com> 2003-06-21 Jason Thorpe <thorpej@wasabisystems.com>
* config.gcc (*-*-netbsd*): Add t-libgcc-pic to tmake_file. * config.gcc (*-*-netbsd*): Add t-libgcc-pic to tmake_file.
......
...@@ -335,6 +335,18 @@ output_long_hexadecimal (output_buffer *buffer, long unsigned int i) ...@@ -335,6 +335,18 @@ output_long_hexadecimal (output_buffer *buffer, long unsigned int i)
} }
static inline void static inline void
output_long_long_decimal (output_buffer *buffer, long long int i)
{
output_formatted_scalar (buffer, "%lld", i);
}
void
output_host_wide_integer (output_buffer *buffer, HOST_WIDE_INT i)
{
output_formatted_scalar (buffer, HOST_WIDE_INT_PRINT_DEC, i);
}
static inline void
output_pointer (output_buffer *buffer, void *p) output_pointer (output_buffer *buffer, void *p)
{ {
output_formatted_scalar (buffer, HOST_PTR_PRINTF, p); output_formatted_scalar (buffer, HOST_PTR_PRINTF, p);
...@@ -457,6 +469,8 @@ output_buffer_to_stream (output_buffer *buffer) ...@@ -457,6 +469,8 @@ output_buffer_to_stream (output_buffer *buffer)
%o: unsigned integer in base eight. %o: unsigned integer in base eight.
%x: unsigned integer in base sixteen. %x: unsigned integer in base sixteen.
%ld, %li, %lo, %lu, %lx: long versions of the above. %ld, %li, %lo, %lu, %lx: long versions of the above.
%ll: long long int.
%w: and integer of type HOST_WIDE_INT.
%c: character. %c: character.
%s: string. %s: string.
%p: pointer. %p: pointer.
...@@ -542,6 +556,15 @@ output_format (output_buffer *buffer, text_info *text) ...@@ -542,6 +556,15 @@ output_format (output_buffer *buffer, text_info *text)
(buffer, va_arg (*text->args_ptr, unsigned int)); (buffer, va_arg (*text->args_ptr, unsigned int));
break; break;
case 'l':
if (long_integer)
output_long_long_decimal
(buffer, va_arg (*text->args_ptr, long long));
else
/* Sould not happen. */
abort();
break;
case 'm': case 'm':
output_add_string (buffer, xstrerror (text->err_no)); output_add_string (buffer, xstrerror (text->err_no));
break; break;
...@@ -575,6 +598,11 @@ output_format (output_buffer *buffer, text_info *text) ...@@ -575,6 +598,11 @@ output_format (output_buffer *buffer, text_info *text)
} }
break; break;
case 'w':
output_host_wide_integer
(buffer, va_arg (*text->args_ptr, HOST_WIDE_INT));
break;
default: default:
if (!buffer->format_decoder if (!buffer->format_decoder
|| !(*buffer->format_decoder) (buffer, text)) || !(*buffer->format_decoder) (buffer, text))
......
...@@ -315,6 +315,7 @@ extern int output_space_left (const output_buffer *); ...@@ -315,6 +315,7 @@ extern int output_space_left (const output_buffer *);
extern void output_append (output_buffer *, const char *, const char *); extern void output_append (output_buffer *, const char *, const char *);
extern void output_add_character (output_buffer *, int); extern void output_add_character (output_buffer *, int);
extern void output_decimal (output_buffer *, int); extern void output_decimal (output_buffer *, int);
extern void output_host_wide_integer (output_buffer *, HOST_WIDE_INT);
extern void output_add_string (output_buffer *, const char *); extern void output_add_string (output_buffer *, const char *);
extern void output_add_identifier (output_buffer *, tree); extern void output_add_identifier (output_buffer *, tree);
extern const char *output_finalize_message (output_buffer *); extern const char *output_finalize_message (output_buffer *);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment