aboutsummaryrefslogtreecommitdiffstats
path: root/src/grt
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2022-05-15 05:23:58 +0200
committerTristan Gingold <tgingold@free.fr>2022-05-15 05:23:58 +0200
commit511075ef4fee902e256551cb31b913de569016f3 (patch)
treec6dade191fb4bbbd3371090854cb784334ae2fc7 /src/grt
parent54503976a4e2241fea70c4d37d12fd85f06eaf59 (diff)
downloadghdl-511075ef4fee902e256551cb31b913de569016f3.tar.gz
ghdl-511075ef4fee902e256551cb31b913de569016f3.tar.bz2
ghdl-511075ef4fee902e256551cb31b913de569016f3.zip
grt: simplifies grt-readline, adjust casing
Diffstat (limited to 'src/grt')
-rw-r--r--src/grt/grt-files_operations.adb4
-rw-r--r--src/grt/grt-readline.ads5
-rw-r--r--src/grt/grt-types.ads7
-rw-r--r--src/grt/grt-waves.adb4
4 files changed, 9 insertions, 11 deletions
diff --git a/src/grt/grt-files_operations.adb b/src/grt/grt-files_operations.adb
index 86a1af1a6..f2b408398 100644
--- a/src/grt/grt-files_operations.adb
+++ b/src/grt/grt-files_operations.adb
@@ -293,13 +293,13 @@ package body Grt.Files_Operations is
return;
end case;
- if Strcmp (Name, To_Ghdl_C_String (Std_Input_Name'Address)) = 0 then
+ if strcmp (Name, To_Ghdl_C_String (Std_Input_Name'Address)) = 0 then
if Mode /= Read_Mode then
Status := Op_Mode_Error;
return;
end if;
F := stdin;
- elsif Strcmp (Name, To_Ghdl_C_String (Std_Output_Name'Address)) = 0 then
+ elsif strcmp (Name, To_Ghdl_C_String (Std_Output_Name'Address)) = 0 then
if Mode /= Write_Mode then
Status := Op_Mode_Error;
return;
diff --git a/src/grt/grt-readline.ads b/src/grt/grt-readline.ads
index 6d4903e02..5eb1b5c7f 100644
--- a/src/grt/grt-readline.ads
+++ b/src/grt/grt-readline.ads
@@ -1,17 +1,12 @@
-- Although being part of GRT, the readline binding should be independent of
-- it (for easier reuse).
-with System; use System;
with Grt.Types; use Grt.Types;
package Grt.Readline is
function Readline (Prompt : Ghdl_C_String) return Ghdl_C_String;
- function Readline (Prompt : Address) return Ghdl_C_String;
pragma Import (C, Readline);
- procedure Free (Buf : Ghdl_C_String);
- pragma Import (C, Free);
-
procedure Add_History (Line : Ghdl_C_String);
pragma Import (C, Add_History);
diff --git a/src/grt/grt-types.ads b/src/grt/grt-types.ads
index 788840b21..d6c709da9 100644
--- a/src/grt/grt-types.ads
+++ b/src/grt/grt-types.ads
@@ -77,8 +77,11 @@ package Grt.Types is
function strlen (Str : Ghdl_C_String) return Natural;
pragma Import (C, strlen);
- function Strcmp (L , R : Ghdl_C_String) return Integer;
- pragma Import (C, Strcmp);
+ function strcmp (L , R : Ghdl_C_String) return Integer;
+ pragma Import (C, strcmp);
+
+ procedure free (Buf : Ghdl_C_String);
+ pragma Import (C, free);
function To_Ghdl_C_String is new Ada.Unchecked_Conversion
(Source => Address, Target => Ghdl_C_String);
diff --git a/src/grt/grt-waves.adb b/src/grt/grt-waves.adb
index a513ef010..eb0f0a898 100644
--- a/src/grt/grt-waves.adb
+++ b/src/grt/grt-waves.adb
@@ -365,7 +365,7 @@ package body Grt.Waves is
if L = R then
return 0;
end if;
- return Strcmp (Ls, Rs);
+ return strcmp (Ls, Rs);
end Str_Compare;
procedure Disp_Str_Avl (N : AVL_Nid) is
@@ -442,7 +442,7 @@ package body Grt.Waves is
H := Str_Table.Last;
loop
M := (L + H) / 2;
- Diff := Strcmp (Str, Str_Table.Table (M));
+ Diff := strcmp (Str, Str_Table.Table (M));
if Diff = 0 then
return M;
elsif Diff < 0 then