X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=Ada95%2Fsrc%2Fterminal_interface-curses-trace.adb_p;h=0dead37675ffb63210ddccfb63d9b0b033d186d9;hp=d2117a4cef17dd375eee836e14c5d19e35c608a1;hb=4298026c68384077462178f8018c8c1add0c3cdf;hpb=9776951416d7fb862b9dca1f4c9f8031a5c9059b diff --git a/Ada95/src/terminal_interface-curses-trace.adb_p b/Ada95/src/terminal_interface-curses-trace.adb_p index d2117a4c..0dead376 100644 --- a/Ada95/src/terminal_interface-curses-trace.adb_p +++ b/Ada95/src/terminal_interface-curses-trace.adb_p @@ -7,7 +7,7 @@ -- B O D Y -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 2000-2004,2009 Free Software Foundation, Inc. -- +-- Copyright (c) 2000-2009,2014 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -35,60 +35,39 @@ ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control: --- $Revision: 1.7 $ +-- $Revision: 1.11 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ #if ADA_TRACE then with Interfaces.C; use Interfaces.C; -with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; -with Ada.Unchecked_Conversion; #end if; package body Terminal_Interface.Curses.Trace is #if ADA_TRACE then - type C_TraceType is new C_UInt; - - function TraceAda_To_TraceC is new - Ada.Unchecked_Conversion (Source => Trace_Attribute_Set, - Target => C_TraceType); - procedure Trace_On (x : Trace_Attribute_Set) is - procedure traceC (y : C_TraceType); + procedure traceC (y : Trace_Attribute_Set); pragma Import (C, traceC, "trace"); begin - traceC (TraceAda_To_TraceC (x)); + traceC (x); end Trace_On; - -- 75. (12) A C function that takes a variable number of arguments can - -- correspond to several Ada subprograms, taking various specific - -- numbers and types of parameters. - procedure Trace_Put (str : String) is procedure tracef (format : char_array; s : char_array); pragma Import (C, tracef, "_traces"); - Txt : char_array (0 .. str'Length); - Length : size_t; - formatstr : constant String := "%s" & ASCII.NUL; - formattxt : char_array (0 .. formatstr'Length); + -- _traces() is defined in c_varargs_to_ada.h begin - To_C (formatstr, formattxt, Length); - To_C (str, Txt, Length); - tracef (formattxt, Txt); + tracef (To_C ("%s"), To_C (str)); end Trace_Put; #else procedure Trace_On (x : Trace_Attribute_Set) is -#if PRAGMA_UNREF - pragma Unreferenced (x); -#end if; + pragma Warnings (Off, x); -- unreferenced begin null; end Trace_On; procedure Trace_Put (str : String) is -#if PRAGMA_UNREF - pragma Unreferenced (str); -#end if; + pragma Warnings (Off, str); -- unreferenced begin null; end Trace_Put;