From c7832c32253cdc2123313731c7cbbace4fc8332c Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Tue, 26 Jul 2016 15:06:11 +0200 Subject: Use asprintf instead of printing to a buffer. --- debug/DebugInformation.ml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'debug') diff --git a/debug/DebugInformation.ml b/debug/DebugInformation.ml index 471318af..dfde9136 100644 --- a/debug/DebugInformation.ml +++ b/debug/DebugInformation.ml @@ -53,13 +53,10 @@ let lookup_types: (string, int) Hashtbl.t = Hashtbl.create 7 (* Translate a C.typ to a string needed for hashing *) let typ_to_string ty = - let buf = Buffer.create 7 in - let chan = Format.formatter_of_buffer buf in Cprint.print_debug_idents := true; - Cprint.typ chan ty; + let s = Format.asprintf "%a" Cprint.typ ty in Cprint.print_debug_idents := false; - Format.pp_print_flush chan (); - Buffer.contents buf + s (* Helper functions for the attributes *) let strip_attributes typ = strip_attributes_type typ [AConst; AVolatile] -- cgit