public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Ada] Use function and not procedure UI_Image in pretty-printing
@ 2021-05-04  9:52 Pierre-Marie de Rodat
  0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2021-05-04  9:52 UTC (permalink / raw)
  To: gcc-patches; +Cc: Piotr Trojanek

[-- Attachment #1: Type: text/plain, Size: 257 bytes --]

Code cleanup; semantics is unaffected. The code for pretty-printing
integer, real and string literals now looks the same.

Tested on x86_64-pc-linux-gnu, committed on trunk

gcc/ada/

	* pprint.adb (Expr_Name): Simplify with functional variant of
	UI_Image.

[-- Attachment #2: patch.diff --]
[-- Type: text/x-diff, Size: 454 bytes --]

diff --git a/gcc/ada/pprint.adb b/gcc/ada/pprint.adb
--- a/gcc/ada/pprint.adb
+++ b/gcc/ada/pprint.adb
@@ -226,8 +226,7 @@ package body Pprint is
                end;
 
             when N_Integer_Literal =>
-               UI_Image (Intval (Expr));
-               return UI_Image_Buffer (1 .. UI_Image_Length);
+               return UI_Image (Intval (Expr));
 
             when N_Real_Literal =>
                return Real_Image (Realval (Expr));



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-05-04  9:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-04  9:52 [Ada] Use function and not procedure UI_Image in pretty-printing Pierre-Marie de Rodat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).