Permalink
Browse files

source code style cleanup

  • Loading branch information...
1 parent 4972f0e commit 1465d27c2a97cc8bb735dfdcb83f527bda513fe9 @kburtch committed Feb 3, 2012
View
@@ -74,7 +74,7 @@ all: c_os.o c_scanner.o
@echo " http://www.pegasoft.ca/sparforte.html"
@echo "---------------------------------------------------------------"
@echo
- $(GNATMAKE) -j2 -c -i -O1 $(CPU_FLAG)=$(CPU) -gnatfaon -fstack-check -c $(INCLUDE) spar
+ $(GNATMAKE) -j2 -c -i -O1 $(CPU_FLAG)=$(CPU) -gnat05 -gnatfaon -gnatybdh -fstack-check -c $(INCLUDE) spar
gnatbind -x $(INCLUDE_BIND) spar.ali
gnatlink spar.ali ${ADAVOXLIBS} c_os.o c_scanner.o $(LIBS)
@echo
View
@@ -89,9 +89,9 @@ begin
getcwd( buffer, buffer'length );
if C_errno /= 0 then
put_line( standard_error, "findPwd: error getting current working directory, errno "
- & C_errno'img );
+ & C_errno'img );
current_working_directory := null_unbounded_string;
- end if;
+ end if;
current_working_directory := to_unbounded_string(
buffer( 1..index( buffer, ASCII.NUL & "" ) - 1 ) ) ;
end findPwd;
@@ -359,7 +359,7 @@ begin
-- If the user has requested a maximum number of lines (historyMax),
-- then calculate the first line (historyFirst) to be shown. If all
-- should be shown, turn on showHistory flag immediately.
-
+
if historyMax /= 0 then
if historyNext - historyMax < 1 then
historyFirst := historyArray'last - historyMax + historyNext;
@@ -368,19 +368,19 @@ begin
end if;
end if;
showHistory := historyFirst = 0 or historyFirst = historyNext;
-
+
-- Determine the starting point in the history array. The history
-- array wraps around to the first element when it has been filled.
-
+
if historyNext = historyArray'last then
i := 1;
else
i := historyNext + 1;
end if;
-
+
-- Walk the history array and show the contents. Wrap around when the
-- end of array is reached.
-
+
loop
if i = historyArray'last then
i := 1;
@@ -496,7 +496,7 @@ begin
elsif isExecutingCommand then
put_line( old_pwd );
end if;
-end pwd;
+end pwd;
-----------------------------------------------------------------------------
-- SELECT (SQL COMMAND)
@@ -1223,6 +1223,8 @@ begin
Put_Line( " " & bold( "pragma" ) & " " &
"inspection_point - break to command prompt if --break is used" );
Put_Line( " " & bold( "pragma" ) & " " &
+ "license( license_name [, extra] )" );
+ Put_Line( " " & bold( "pragma" ) & " " &
"no_command_hash - do not store command pathnames in the hash table" );
Put_Line( " " & bold( "pragma" ) & " " &
"prompt_script( `commands` ) - commands to draw command prompt" );
@@ -1248,6 +1250,8 @@ begin
"restriction( no_postgresql_database ) - " &
"disable connections to postgresql" );
Put_Line( " " & bold( "pragma" ) & " " &
+ "software_model( model_name )" );
+ Put_Line( " " & bold( "pragma" ) & " " &
"template( css|html|js|json|text|wml|xml [, path] ) - script is acting as a template processor" );
Put_Line( " " & bold( "pragma" ) & " " &
"test( condition ) - with --test, execute test commands" );
@@ -1334,6 +1338,7 @@ begin
Put_Line( " System.Max_Base_Digits System.Default_Bit_Order" );
Put_Line( " System.Max_Mantissa System.Login_Shell" );
Put_Line( " System.Restricted_Shell System.Script_License" );
+ Put_Line( " System.Script_Software_Model" );
discardUnusedIdentifier( token );
elsif helpTopic = "trace" then
Put_Line( "trace - show verbose debugging information" );
@@ -1737,7 +1742,7 @@ begin
discardUnusedIdentifier( token );
getNextToken;
expect( symbol_t, "," );
- elsif identifiers( token ).name = to_unbounded_string( "see also" ) then
+ elsif identifiers( token ).name = to_unbounded_string( "see_also" ) then
if last_tag = "see also" then
info := null_unbounded_string;
elsif HTMLOutput then
@@ -1829,7 +1834,7 @@ begin
if C_errno = EINTR then
goto retryclose;
end if;
- end if;
+ end if;
restoreScript( scriptState );
end;
discardUnusedIdentifier( token );
View
@@ -98,7 +98,7 @@ function tput( attr : termAttributes ) return unbounded_string is
begin
-- Redirect standard output to a temp file
-
+
mkstemp( tputResultsFD, tputResults );
if tputResultsFD < 0 then
put_line( standard_error, Gnat.Source_Info.Source_Location & ": Unable to make temp file" );
@@ -145,7 +145,7 @@ begin
end if;
-- Create the argument list for tput command
-
+
ap := new ArgumentList( 1..1 );
if tput_style = "terminfo" then
@@ -187,7 +187,7 @@ begin
put_line( standard_output, "Internal error: unknown tput_style" );
ap( 1 ) := tcap_normal'access; -- prevent exception
end if;
-
+
-- Export TERM variable
findIdent( to_unbounded_string( "TERM" ), term_id );
@@ -199,10 +199,10 @@ begin
if term_id /= eof_t then
intResult := putenv( termString );
end if;
-
+
-- Run tput and restore stdout when done
- C_reset_errno;
+ C_reset_errno;
spawn( tput_path1, ap, status, noReturn => false );
if C_errno > 0 then
spawn( tput_path2, ap, status, noReturn => false );
@@ -247,9 +247,9 @@ begin
-- if term_id /= eof_t then
-- intResult := putenv( "TERM" & ASCII.NUL );
-- end if;
-
+
-- Read results
-
+
<<retry11>> tputResultsFD := open( tputResults & ASCII.NUL, 0, 660 );
if tputResultsFD < 0 then
if C_errno = EINTR then
@@ -287,7 +287,7 @@ begin
return ttyCode;
end tput;
-
+
-- Attribute Procedures
procedure updateTtyAttributes( thisTerm : unbounded_string ) is
@@ -371,7 +371,7 @@ begin
if amountRead = 0 then -- nothing read?
ch := ASCII.EOT; -- return a control-d
end if;
- else
+ else
-- read character here (non-canonical, set by termios
-- MIN = 1 & TIME = 0). Disable special chars separately
-- strip high bit. Normally, canonical + 0 min + 0 time
@@ -387,8 +387,7 @@ begin
else
ioctl_getattr( res, ttyFile, TCGETATTR, tio );
if res /= 0 then
- put( standard_error, Gnat.Source_Info.Source_Location & ": unable to load keyboard settings - "
-);
+ put( standard_error, Gnat.Source_Info.Source_Location & ": unable to load keyboard settings - " );
put_line( standard_error, "ioctl /dev/tty TCGETATTR failed" );
raise CONSTRAINT_ERROR; -- for lack of a better error
else
Oops, something went wrong.

0 comments on commit 1465d27

Please sign in to comment.