Skip to content

Commit

Permalink
source code style cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
kburtch committed Feb 3, 2012
1 parent 4972f0e commit 1465d27
Show file tree
Hide file tree
Showing 28 changed files with 556 additions and 458 deletions.
2 changes: 1 addition & 1 deletion src/GNUmakefile.orig
Expand Up @@ -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
Expand Down
25 changes: 15 additions & 10 deletions src/builtins.adb.orig
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -496,7 +496,7 @@ begin
elsif isExecutingCommand then
put_line( old_pwd );
end if;
end pwd;
end pwd;

-----------------------------------------------------------------------------
-- SELECT (SQL COMMAND)
Expand Down Expand Up @@ -1222,6 +1222,8 @@ begin
"inspection_peek - like a inspection_point but no breakout" );
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" ) & " " &
Expand All @@ -1247,6 +1249,8 @@ begin
Put_Line( " " & bold( "pragma" ) & " " &
"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" ) & " " &
Expand Down Expand Up @@ -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" );
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -1829,7 +1834,7 @@ begin
if C_errno = EINTR then
goto retryclose;
end if;
end if;
end if;
restoreScript( scriptState );
end;
discardUnusedIdentifier( token );
Expand Down
21 changes: 10 additions & 11 deletions src/bush_os-tty.adb
Expand Up @@ -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" );
Expand Down Expand Up @@ -145,7 +145,7 @@ begin
end if;

-- Create the argument list for tput command

ap := new ArgumentList( 1..1 );

if tput_style = "terminfo" then
Expand Down Expand Up @@ -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 );
Expand All @@ -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 );
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -287,7 +287,7 @@ begin
return ttyCode;
end tput;


-- Attribute Procedures

procedure updateTtyAttributes( thisTerm : unbounded_string ) is
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 1465d27

Please sign in to comment.