From afe677ecda00648889cca9980583400268db5518 Mon Sep 17 00:00:00 2001 From: Pascal Obry Date: Fri, 14 Mar 2008 13:53:32 +0100 Subject: [PATCH] Activate style checks, fix style violations. Fix at the same time some files permissions. --- gnadelite.gpr | 4 +++- src/db-sqlite.adb | 27 +++++++++++++++------------ 2 files changed, 18 insertions(+), 13 deletions(-) mode change 100755 => 100644 gnadelite.gpr mode change 100755 => 100644 src/db-sqlite.adb diff --git a/gnadelite.gpr b/gnadelite.gpr old mode 100755 new mode 100644 index f8dd8d5..aaa1c68 --- a/gnadelite.gpr +++ b/gnadelite.gpr @@ -43,7 +43,7 @@ project GnadeLite is -- Common options used for the Debug and Release modes Debug_Options := - ("-g", "-gnata", "-gnatVa", "-gnatQ", "-gnato"); + ("-g", "-gnata", "-gnatVa", "-gnatQ", "-gnato", "-gnaty"); Release_Options := ("-O2"); @@ -58,6 +58,8 @@ project GnadeLite is for Default_Switches ("Ada") use Common_Options & Release_Options; end case; + for Switches ("gnu-db-sqlite3.adb") use ("-gnatyN"); + end Compiler; end GnadeLite; diff --git a/src/db-sqlite.adb b/src/db-sqlite.adb old mode 100755 new mode 100644 index 158443f..213da86 --- a/src/db-sqlite.adb +++ b/src/db-sqlite.adb @@ -50,15 +50,15 @@ package body DB.SQLite is protected SQLite_Safe is procedure Close - (DB : in Handle; Result : out Sqlite3.Return_Value); + (DB : in Handle; Result : out SQLite3.Return_Value); -- Close the database procedure Exec - (DB : in Handle; SQL : in String; Result : out Sqlite3.Return_Value); + (DB : in Handle; SQL : in String; Result : out SQLite3.Return_Value); -- Execute an SQL statement procedure Open - (DB : in Handle; Name : in String; Result : out Sqlite3.Return_Value); + (DB : in Handle; Name : in String; Result : out SQLite3.Return_Value); -- Open the database function Prepare_Select @@ -107,7 +107,7 @@ package body DB.SQLite is ----------- overriding procedure Close (DB : in out Handle) is - Result : Sqlite3.Return_Value; + Result : SQLite3.Return_Value; begin Logs.Write (Module, "close"); SQLite_Safe.Close (DB, Result); @@ -138,7 +138,7 @@ package body DB.SQLite is pragma Unreferenced (User, Password); use type GNU.DB.SQLite3.Handle; - Result : Sqlite3.Return_Value; + Result : SQLite3.Return_Value; begin Logs.Write (Module, "connect " & Logs.NV ("Name", Name)); @@ -181,7 +181,7 @@ package body DB.SQLite is ------------- overriding procedure Execute (DB : in Handle; SQL : in String) is - Result : SQLite3.Return_Value; + Result : SQLite3.Return_Value; begin Logs.Write (Module, "execute : " & Logs.NV ("SQL", SQL)); SQLite_Safe.Exec (DB, SQL, Result); @@ -214,8 +214,8 @@ package body DB.SQLite is ----------------------- overriding function Last_Insert_Rowid (DB : in Handle) return String is - Rowid : constant String := - SQLite3.uint64'Image (SQLite3.Last_Insert_Rowid (DB.H)); + Rowid : constant String := + SQLite3.uint64'Image (SQLite3.Last_Insert_Rowid (DB.H)); begin -- Skip first whitespace returned by 'Image return Rowid (Rowid'First + 1 .. Rowid'Last); @@ -265,7 +265,7 @@ package body DB.SQLite is ----------- procedure Close - (DB : in Handle; Result : out Sqlite3.Return_Value) is + (DB : in Handle; Result : out SQLite3.Return_Value) is begin Result := SQLite3.Close (DB.H); end Close; @@ -275,7 +275,7 @@ package body DB.SQLite is ---------- procedure Exec - (DB : in Handle; SQL : in String; Result : out Sqlite3.Return_Value) is + (DB : in Handle; SQL : in String; Result : out SQLite3.Return_Value) is begin Result := SQLite3.Exec (DB.H, SQL); end Exec; @@ -285,7 +285,9 @@ package body DB.SQLite is ---------- procedure Open - (DB : in Handle; Name : in String; Result : out Sqlite3.Return_Value) is + (DB : in Handle; + Name : in String; + Result : out SQLite3.Return_Value) is begin Result := SQLite3.Open (DB.H, Name); end Open; @@ -311,7 +313,8 @@ package body DB.SQLite is Check_Result ("prepare_select", - SQLite3.prepare (DB.H, SQL, Iterator (Select_Iter).S'Unchecked_Access)); + SQLite3.prepare + (DB.H, SQL, Iterator (Select_Iter).S'Unchecked_Access)); Iterator (Select_Iter).Col := SQLite3.column_count (Iterator (Select_Iter).S'Unchecked_Access); -- 2.11.4.GIT