Skip to content

Commit d06c096

Browse files
committed
fbc: whitespace clean-ups
1 parent df424ed commit d06c096

File tree

4 files changed

+163
-163
lines changed

4 files changed

+163
-163
lines changed

src/compiler/ast-node-proc.bas

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ private sub hProcFlush _
111111
byval doemit as integer _
112112
)
113113

114-
dim as ASTNODE ptr n = any, nxt = any
115-
dim as FBSYMBOL ptr sym = any
114+
dim as ASTNODE ptr n = any, nxt = any
115+
dim as FBSYMBOL ptr sym = any
116116

117117
sym = p->sym
118118

@@ -153,19 +153,19 @@ private sub hProcFlush _
153153
n = nxt
154154
loop
155155

156-
'' emit footer
157-
if( ast.doemit ) then
158-
irEmitPROCEND( sym, p->block.initlabel, p->block.exitlabel )
156+
'' emit footer
157+
if( ast.doemit ) then
158+
irEmitPROCEND( sym, p->block.initlabel, p->block.exitlabel )
159159

160160
'' Emit static local variables
161161
irProcAllocStaticVars( symbGetProcSymbTbHead( sym ) )
162-
end if
162+
end if
163163

164-
'' del symbols from hash and symbol tb's
165-
symbDelSymbolTb( @sym->proc.symtb, FALSE )
164+
'' del symbols from hash and symbol tb's
165+
symbDelSymbolTb( @sym->proc.symtb, FALSE )
166166

167-
''
168-
symbNestEnd( FALSE )
167+
''
168+
symbNestEnd( FALSE )
169169

170170
hDelProcNode( p )
171171

@@ -179,9 +179,9 @@ private sub hProcFlushAll _
179179
_
180180
)
181181

182-
dim as ASTNODE ptr n = any
183-
dim as integer doemit = any
184-
dim as FBSYMBOL ptr sym = any
182+
dim as ASTNODE ptr n = any
183+
dim as integer doemit = any
184+
dim as FBSYMBOL ptr sym = any
185185

186186
'' procs should be sorted by include file
187187

@@ -634,9 +634,9 @@ private function hCallProfiler _
634634
end function
635635

636636
function astProcEnd( byval callrtexit as integer ) as integer
637-
static as integer rec_cnt = 0
637+
static as integer rec_cnt = 0
638638
dim as integer res = any, do_flush = any, enable_implicit_code = any
639-
dim as FBSYMBOL ptr sym = any
639+
dim as FBSYMBOL ptr sym = any
640640
dim as ASTNODE ptr n = any
641641

642642
n = ast.proc.curr
@@ -770,7 +770,7 @@ function astProcEnd( byval callrtexit as integer ) as integer
770770

771771
''
772772
if( do_flush ) then
773-
if( n->block.proc.ismain = FALSE ) then
773+
if( n->block.proc.ismain = FALSE ) then
774774
hProcFlush( n, TRUE )
775775
else
776776
hProcFlushAll( )
@@ -781,20 +781,20 @@ function astProcEnd( byval callrtexit as integer ) as integer
781781
ast.proc.curr = ast.proc.head
782782
ast.currblock = ast.proc.head
783783

784-
parser.scope = FB_MAINSCOPE
785-
parser.currproc = env.main.proc
786-
parser.currblock = env.main.proc
784+
parser.scope = FB_MAINSCOPE
785+
parser.currproc = env.main.proc
786+
parser.currblock = env.main.proc
787787

788-
''
789-
rec_cnt -= 1
788+
''
789+
rec_cnt -= 1
790790

791791
function = res
792792

793793
end function
794794

795795
private function hDeclVarsForProcParams( byval proc as FBSYMBOL ptr ) as integer
796-
dim as integer i = any
797-
dim as FBSYMBOL ptr p = any
796+
dim as integer i = any
797+
dim as FBSYMBOL ptr p = any
798798

799799
function = FALSE
800800

@@ -825,8 +825,8 @@ private function hDeclVarsForProcParams( byval proc as FBSYMBOL ptr ) as integer
825825
end function
826826

827827
private sub hLoadProcResult( byval proc as FBSYMBOL ptr )
828-
dim as FBSYMBOL ptr s = any
829-
dim as ASTNODE ptr n = any
828+
dim as FBSYMBOL ptr s = any
829+
dim as ASTNODE ptr n = any
830830

831831
s = symbGetProcResult( proc )
832832

@@ -851,7 +851,7 @@ private sub hLoadProcResult( byval proc as FBSYMBOL ptr )
851851
end sub
852852

853853
private function hModLevelIsEmpty( byval p as ASTNODE ptr ) as integer
854-
dim as ASTNODE ptr n = any, nxt = any
854+
dim as ASTNODE ptr n = any, nxt = any
855855

856856
'' an empty module-level proc will have just the
857857
'' initial and final labels as nodes and nothing else
@@ -1351,7 +1351,7 @@ private sub hCallDtors( byval proc as FBSYMBOL ptr )
13511351
parent = symbGetNamespace( proc )
13521352

13531353
'' 1st) fields dtors
1354-
hCallFieldDtors( parent, proc )
1354+
hCallFieldDtors( parent, proc )
13551355

13561356
'' 2nd) base dtor
13571357
hCallBaseDtor( parent, proc )
@@ -1396,9 +1396,9 @@ private sub hGenStaticInstancesDtors( byval proc as FBSYMBOL ptr )
13961396
exit sub
13971397
end if
13981398

1399-
'' for each node..
1400-
wrap = listGetHead( dtorlist )
1401-
do while( wrap <> NULL )
1399+
'' for each node..
1400+
wrap = listGetHead( dtorlist )
1401+
do while( wrap <> NULL )
14021402
astProcBegin( wrap->proc, FALSE )
14031403
n = ast.proc.curr
14041404

@@ -1412,13 +1412,13 @@ private sub hGenStaticInstancesDtors( byval proc as FBSYMBOL ptr )
14121412
'' proc is flushed
14131413
hProcFlush( n, TRUE )
14141414

1415-
wrap = listGetNext( wrap )
1416-
loop
1415+
wrap = listGetNext( wrap )
1416+
loop
14171417

1418-
'' destroy list
1419-
listEnd( dtorlist )
1420-
deallocate( proc->proc.ext->statdtor )
1421-
proc->proc.ext->statdtor = NULL
1418+
'' destroy list
1419+
listEnd( dtorlist )
1420+
deallocate( proc->proc.ext->statdtor )
1421+
proc->proc.ext->statdtor = NULL
14221422
end sub
14231423

14241424
'':::::
@@ -1443,16 +1443,16 @@ function astProcAddStaticInstance _
14431443
listInit( dtorlist, 16, len( FB_DTORWRAPPER ), LIST_FLAGS_NOCLEAR )
14441444
end if
14451445

1446-
''
1447-
wrap = listNewNode( dtorlist )
1446+
''
1447+
wrap = listNewNode( dtorlist )
14481448

14491449
proc = symbAddProc( symbPreAddProc( NULL ), symbUniqueLabel( ), NULL, FB_DATATYPE_VOID, NULL, _
14501450
FB_SYMBATTRIB_PRIVATE, FB_PROCATTRIB_NONE, FB_FUNCMODE_CDECL, FB_SYMBOPT_DECLARING )
14511451

1452-
wrap->proc = proc
1453-
wrap->sym = sym
1452+
wrap->proc = proc
1453+
wrap->sym = sym
14541454

1455-
'' can't be undefined
1455+
'' can't be undefined
14561456
symbSetCantUndef( sym )
14571457

14581458
function = proc
@@ -1467,16 +1467,16 @@ sub astProcAddGlobalInstance _
14671467
byval call_dtor as integer _
14681468
)
14691469

1470-
dim as FB_GLOBINSTANCE ptr wrap = any
1470+
dim as FB_GLOBINSTANCE ptr wrap = any
14711471

1472-
''
1473-
wrap = listNewNode( @ast.globinst.list )
1472+
''
1473+
wrap = listNewNode( @ast.globinst.list )
14741474

1475-
wrap->sym = sym
1476-
wrap->initree = initree
1475+
wrap->sym = sym
1476+
wrap->initree = initree
14771477
wrap->call_dtor = call_dtor
14781478

1479-
'' can't be undefined
1479+
'' can't be undefined
14801480
symbSetCantUndef( sym )
14811481

14821482
if( initree <> NULL ) then
@@ -1554,5 +1554,5 @@ private sub hGenGlobalInstancesCtor( )
15541554
astProcEnd( FALSE )
15551555
end if
15561556

1557-
'' list will be deleted by astProcListEnd( )
1557+
'' list will be deleted by astProcListEnd( )
15581558
end sub

src/compiler/parser-proc.bas

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ private sub hCheckPrototype _
128128
byval mode as integer _
129129
)
130130

131-
dim as FBSYMBOL ptr param = any, proto_param = any
132-
dim as integer params = any, proto_params = any, i = any
131+
dim as FBSYMBOL ptr param = any, proto_param = any
132+
dim as integer params = any, proto_params = any, i = any
133133

134134
'' Check ALIAS id
135135
if( (palias <> NULL) and ((proto->stats and FB_SYMBSTATS_HASALIAS) <> 0) ) then
@@ -179,21 +179,21 @@ private sub hCheckPrototype _
179179
'' the common parameters, for better error recovery.
180180
i = 1
181181
while( (i <= proto_params) and (i <= params) )
182-
dim as integer dtype = symbGetFullType( proto_param )
183-
184-
'' convert any AS ANY arg to the final one
185-
if( typeGet( dtype ) = FB_DATATYPE_VOID ) then
186-
proto_param->typ = param->typ
187-
proto_param->subtype = param->subtype
188-
189-
'' check if types don't conflit
190-
else
191-
if( param->typ <> dtype ) then
192-
hParamError( proc, i )
193-
elseif( param->subtype <> symbGetSubtype( proto_param ) ) then
194-
hParamError( proc, i )
195-
end if
196-
end if
182+
dim as integer dtype = symbGetFullType( proto_param )
183+
184+
'' convert any AS ANY arg to the final one
185+
if( typeGet( dtype ) = FB_DATATYPE_VOID ) then
186+
proto_param->typ = param->typ
187+
proto_param->subtype = param->subtype
188+
189+
'' check if types don't conflit
190+
else
191+
if( param->typ <> dtype ) then
192+
hParamError( proc, i )
193+
elseif( param->subtype <> symbGetSubtype( proto_param ) ) then
194+
hParamError( proc, i )
195+
end if
196+
end if
197197

198198
'' and mode
199199
if( param->param.mode <> proto_param->param.mode ) then
@@ -208,19 +208,19 @@ private sub hCheckPrototype _
208208
end if
209209
end if
210210

211-
'' check names and change to the new one if needed
212-
if( param->param.mode <> FB_PARAMMODE_VARARG ) then
213-
symbSetName( proto_param, symbGetName( param ) )
211+
'' check names and change to the new one if needed
212+
if( param->param.mode <> FB_PARAMMODE_VARARG ) then
213+
symbSetName( proto_param, symbGetName( param ) )
214214

215-
'' as both have the same type, re-set the suffix, because for example
216-
'' "a as integer" on the prototype and "a%" or just "a" on the proc
217-
'' declaration when in a defint context is allowed in QB
218-
if( symbIsSuffixed( param ) ) then
219-
symbGetAttrib( proto_param ) or= FB_SYMBATTRIB_SUFFIXED
220-
else
221-
symbGetAttrib( proto_param ) and = not FB_SYMBATTRIB_SUFFIXED
222-
end if
223-
end if
215+
'' as both have the same type, re-set the suffix, because for example
216+
'' "a as integer" on the prototype and "a%" or just "a" on the proc
217+
'' declaration when in a defint context is allowed in QB
218+
if( symbIsSuffixed( param ) ) then
219+
symbGetAttrib( proto_param ) or= FB_SYMBATTRIB_SUFFIXED
220+
else
221+
symbGetAttrib( proto_param ) and = not FB_SYMBATTRIB_SUFFIXED
222+
end if
223+
end if
224224

225225
'' Warn about mismatching param initializers?
226226
'' If both params are optional, compare the two initializers
@@ -230,8 +230,8 @@ private sub hCheckPrototype _
230230
end if
231231
end if
232232

233-
proto_param = proto_param->next
234-
param = param->next
233+
proto_param = proto_param->next
234+
param = param->next
235235
i += 1
236236
wend
237237

@@ -504,10 +504,10 @@ function cProcReturnMethod( byval dtype as FB_DATATYPE ) as FB_PROC_RETURN_METHO
504504
end function
505505

506506
function cProcCallingConv( byval default as FB_FUNCMODE ) as FB_FUNCMODE
507-
'' Use the default FBCALL?
508-
if( default = FB_FUNCMODE_FBCALL ) then
509-
default = env.target.fbcall
510-
end if
507+
'' Use the default FBCALL?
508+
if( default = FB_FUNCMODE_FBCALL ) then
509+
default = env.target.fbcall
510+
end if
511511

512512
'' (CDECL|STDCALL|PASCAL|THISCALL)?
513513
select case as const lexGetToken( )
@@ -610,7 +610,7 @@ private function hCheckOpOvlParams _
610610
) as integer
611611

612612
dim as integer found_mismatch = any
613-
dim as integer is_method = symbIsMethod( proc )
613+
dim as integer is_method = symbIsMethod( proc )
614614

615615
#macro hCheckParam( proc, param, num )
616616
'' vararg?
@@ -1751,8 +1751,8 @@ end sub
17511751
'' (SUB|FUNCTION|CONSTRUCTOR|DESTRUCTOR|OPERATOR) ProcHeader .
17521752
sub cProcStmtBegin( byval attrib as FB_SYMBATTRIB, byval pattrib as FB_PROCATTRIB )
17531753
dim as integer tkn = any, is_nested = any
1754-
dim as FBSYMBOL ptr proc = any
1755-
dim as FB_CMPSTMTSTK ptr stk = any
1754+
dim as FBSYMBOL ptr proc = any
1755+
dim as FB_CMPSTMTSTK ptr stk = any
17561756

17571757
if( (attrib and (FB_SYMBATTRIB_PUBLIC or FB_SYMBATTRIB_PRIVATE)) = 0 ) then
17581758
if( env.opt.procpublic ) then

0 commit comments

Comments
 (0)