Skip to content

Commit 0d98283

Browse files
committed
fbc: code formatting and white space clean up
1 parent 01b6109 commit 0d98283

File tree

13 files changed

+71
-69
lines changed

13 files changed

+71
-69
lines changed

src/compiler/ast-node-misc.bas

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ end function
152152
function astNewDBG _
153153
( _
154154
byval op as integer, _
155-
byval ex As Integer, _
156-
byval filename As ZString Ptr _
155+
byval ex as integer, _
156+
byval filename As ZString Ptr _
157157
) as ASTNODE ptr
158158

159159
dim as ASTNODE ptr n = any
@@ -166,14 +166,14 @@ function astNewDBG _
166166

167167
n->dbg.op = op
168168
n->dbg.ex = ex
169-
n->dbg.filename = filename
169+
n->dbg.filename = filename
170170

171171
function = n
172172
end function
173173

174174
function astLoadDBG( byval n as ASTNODE ptr ) as IRVREG ptr
175175
if( ast.doemit ) then
176-
irEmitDBG( n->dbg.op, astGetProc( )->sym, n->dbg.ex, n->dbg.filename )
176+
irEmitDBG( n->dbg.op, astGetProc( )->sym, n->dbg.ex, n->dbg.filename )
177177
end if
178178

179179
function = NULL

src/compiler/ast.bi

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,9 @@ type AST_NODE_JMPTB
172172
end type
173173

174174
type AST_NODE_DBG
175-
ex as integer
176-
filename as ZString Ptr
177-
op as integer
175+
ex as integer
176+
filename as zstring ptr
177+
op as integer
178178
end type
179179

180180
type AST_NODE_MEM
@@ -794,9 +794,9 @@ declare function astNewASM( byval asmtokhead as ASTASMTOK ptr ) as ASTNODE ptr
794794

795795
declare function astNewDBG _
796796
( _
797-
byval op As integer, _
798-
byval ex as integer = 0, _
799-
byval filename As ZString Ptr = 0 _
797+
byval op as integer, _
798+
byval ex as integer = 0, _
799+
byval filename as zstring ptr = 0 _
800800
) as ASTNODE ptr
801801

802802
declare function astNewMEM _

src/compiler/edbg_stab.bas

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -266,13 +266,13 @@ sub edbgLineBegin _
266266
( _
267267
byval proc as FBSYMBOL ptr, _
268268
byval lnum as integer, _
269-
byval pos_ as Integer, _
270-
ByVal filename As ZString Ptr _
269+
byval pos_ as integer, _
270+
ByVal filename As zstring ptr _
271271
)
272272

273273
if( env.clopt.debuginfo = FALSE ) then
274274
exit sub
275-
end If
275+
end if
276276

277277
if( ctx.lnum > 0 ) then
278278
ctx.pos = pos_ - ctx.pos
@@ -282,7 +282,7 @@ sub edbgLineBegin _
282282
end if
283283
end if
284284

285-
edbgInclude(filename)
285+
edbgInclude( filename )
286286

287287
ctx.pos = pos_
288288
ctx.lnum = lnum
@@ -533,7 +533,7 @@ sub edbgEmitProcHeader _
533533

534534
''
535535
ctx.isnewline = TRUE
536-
ctx.lnum = 0
536+
ctx.lnum = 0
537537
ctx.pos = 0
538538
ctx.label = NULL
539539

@@ -648,7 +648,7 @@ sub edbgEmitProcFooter _
648648

649649
''
650650
ctx.isnewline = TRUE
651-
ctx.lnum = 0
651+
ctx.lnum = 0
652652
ctx.pos = 0
653653
ctx.label = NULL
654654

src/compiler/emit.bas

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,8 @@ sub emitFlush( )
204204
case EMIT_NODECLASS_DBG
205205
cast( EMIT_DBGCB, emit.opFnTb[n->dbg.op] )( n->dbg.sym, _
206206
n->dbg.lnum, _
207-
n->dbg.pos, _
208-
n->dbg.filename )
207+
n->dbg.pos, _
208+
n->dbg.filename )
209209

210210
end select
211211

@@ -457,8 +457,8 @@ private function hNewDBG _
457457
byval op as integer, _
458458
byval sym as FBSYMBOL ptr, _
459459
byval lnum as integer = 0, _
460-
byval pos_ as integer = 0, _
461-
ByVal filename As ZString Ptr =0 _
460+
byval pos_ as integer = 0, _
461+
byval filename As zstring ptr = 0 _
462462
) as EMIT_NODE ptr static
463463

464464
dim as EMIT_NODE ptr n
@@ -468,7 +468,7 @@ private function hNewDBG _
468468
n->dbg.op = op
469469
n->dbg.sym = sym
470470
n->dbg.lnum = lnum
471-
n->dbg.filename = filename
471+
n->dbg.filename = filename
472472
n->dbg.pos = pos_
473473

474474
function = n
@@ -1635,11 +1635,11 @@ end function
16351635
function emitDBGLineBegin _
16361636
( _
16371637
byval proc as FBSYMBOL ptr, _
1638-
byval lnum as Integer, _
1639-
ByVal filename As ZString Ptr _
1638+
byval lnum as integer, _
1639+
byval filename As zstring ptr _
16401640
) as EMIT_NODE ptr
16411641

1642-
function = hNewDBG( EMIT_OP_LINEINI, proc, lnum, emit.pos, filename )
1642+
function = hNewDBG( EMIT_OP_LINEINI, proc, lnum, emit.pos, filename )
16431643

16441644
end function
16451645

src/compiler/emit.bi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ type EMIT_DBGNODE
199199
op as integer
200200
sym as FBSYMBOL ptr
201201
lnum as integer
202-
filename As ZString Ptr
202+
filename as zstring ptr
203203
pos as integer
204204
end type
205205

src/compiler/emit_x86.bas

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6049,11 +6049,11 @@ private sub _emitLINEINI _
60496049
( _
60506050
byval proc as FBSYMBOL ptr, _
60516051
byval lnum as integer, _
6052-
byval pos_ as Integer, _
6053-
ByVal filename As ZString Ptr _
6052+
byval pos_ as integer, _
6053+
byval filename As zstring ptr _
60546054
)
60556055

6056-
edbgLineBegin( proc, lnum, pos_, filename )
6056+
edbgLineBegin( proc, lnum, pos_, filename )
60576057

60586058
end sub
60596059

src/compiler/emitdbg.bi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ declare sub edbgLineBegin _
99
( _
1010
byval proc as FBSYMBOL ptr, _
1111
byval lnum as integer, _
12-
byval pos as Integer, _
13-
ByVal filename as ZString Ptr _
12+
byval pos as integer, _
13+
byval filename as zstring ptr _
1414
)
1515

1616
declare sub edbgLineEnd _

src/compiler/ir-hlc.bas

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ type IRHLCCTX
192192
section as integer '' Current section to write to
193193
sectiongosublevel as integer
194194

195-
lnum as integer
195+
linenum as integer
196196
escapedinputfilename as string
197197
usedbuiltins as uinteger '' BUILTIN_*
198198

@@ -223,8 +223,8 @@ declare sub _emitDBG _
223223
( _
224224
byval op as integer, _
225225
byval proc as FBSYMBOL ptr, _
226-
byval lnum as Integer, _
227-
ByVal filename As ZString Ptr = 0 _
226+
byval lnum as integer, _
227+
ByVal filename As zstring ptr = 0 _
228228
)
229229

230230
declare sub exprFreeNode( byval n as EXPRNODE ptr )
@@ -386,7 +386,7 @@ private sub hWriteLine( byref s as string, byval noline as integer = FALSE )
386386
static as string ln
387387

388388
if( env.clopt.debuginfo and (noline = FALSE) ) then
389-
ln = "#line " + str( ctx.lnum )
389+
ln = "#line " + str( ctx.linenum )
390390
ln += " """ + ctx.escapedinputfilename + """"
391391
sectionWriteLine( ln )
392392
end if
@@ -1250,7 +1250,7 @@ private function _emitBegin( ) as integer
12501250

12511251
ctx.section = -1
12521252
ctx.sectiongosublevel = 0
1253-
ctx.lnum = 0
1253+
ctx.linenum = 0
12541254
ctx.usedbuiltins = 0
12551255
ctx.globalvarpass = 0
12561256
hUpdateCurrentFileName( env.inf.name )
@@ -3159,13 +3159,15 @@ private sub _emitDBG _
31593159
( _
31603160
byval op as integer, _
31613161
byval proc as FBSYMBOL ptr, _
3162-
byval lnum as Integer, _
3163-
ByVal filename As ZString Ptr _
3162+
byval lnum as integer, _
3163+
ByVal filename As zstring ptr _
31643164
)
31653165

31663166
if( op = AST_OP_DBG_LINEINI ) then
3167-
ctx.lnum = lnum
3168-
If filename<>0 Then hUpdateCurrentFileName(filename)
3167+
ctx.linenum = lnum
3168+
if( filename <> NULL ) then
3169+
hUpdateCurrentFileName( filename )
3170+
end if
31693171
end if
31703172

31713173
end sub

src/compiler/ir-llvm.bas

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ const MAXVARINISCOPES = 128
155155

156156
type IRLLVMCONTEXT
157157
indent as integer '' current indentation used by hWriteLine()
158-
lnum as integer
158+
linenum as integer
159159

160160
varini as string
161161
variniscopelevel as integer
@@ -185,8 +185,8 @@ declare sub _emitDBG _
185185
( _
186186
byval op as integer, _
187187
byval proc as FBSYMBOL ptr, _
188-
byval lnum as Integer, _
189-
ByVal filename As ZString Ptr = 0 _
188+
byval lnum as integer, _
189+
ByVal filename As zstring ptr = 0 _
190190
)
191191
declare function hVregToStr( byval vreg as IRVREG ptr ) as string
192192
declare sub hEmitConvert( byval v1 as IRVREG ptr, byval v2 as IRVREG ptr )
@@ -886,7 +886,7 @@ private function _emitBegin( ) as integer
886886
ctx.head_txt = ""
887887
ctx.body_txt = ""
888888
ctx.foot_txt = ""
889-
ctx.lnum = 0
889+
ctx.linenum = 0
890890
ctx.section = SECTION_HEAD
891891

892892
for i as integer = 0 to BUILTIN__COUNT-1
@@ -2081,18 +2081,18 @@ private sub _emitDBG _
20812081
( _
20822082
byval op as integer, _
20832083
byval proc as FBSYMBOL ptr, _
2084-
byval lnum as Integer, _
2085-
ByVal filename As ZString Ptr _
2084+
byval lnum as integer, _
2085+
ByVal filename As zstring ptr _
20862086
)
20872087

2088-
if( op = AST_OP_DBG_LINEINI ) Then
2089-
If filename<>0 Then
2090-
hWriteLine( "#line " & lnum & " """ & hReplace( filename, "\", $"\\" ) & """" )
2091-
Else
2092-
hWriteLine( "#line " & lnum & " """ & hReplace( env.inf.name, "\", $"\\" ) & """" )
2093-
End If
2094-
ctx.lnum = lnum
2095-
end If
2088+
if( op = AST_OP_DBG_LINEINI ) Then
2089+
if( filename <> NULL ) then
2090+
hWriteLine( "#line " & lnum & " """ & hReplace( filename, "\", $"\\" ) & """" )
2091+
else
2092+
hWriteLine( "#line " & lnum & " """ & hReplace( env.inf.name, "\", $"\\" ) & """" )
2093+
end if
2094+
ctx.linenum = lnum
2095+
end If
20962096

20972097
end sub
20982098

src/compiler/ir-tac.bas

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ declare sub hFlushDBG _
106106
( _
107107
byval op as integer, _
108108
byval proc as FBSYMBOL ptr, _
109-
byval ex as Integer, _
110-
ByVal filename As ZString Ptr _
109+
byval ex as integer, _
110+
ByVal filename As zstring ptr _
111111
)
112112

113113
declare sub hFlushLIT( byval op as integer, byval text as zstring ptr )
@@ -295,8 +295,8 @@ private sub _emit _
295295
byval v2 as IRVREG ptr, _
296296
byval vr as IRVREG ptr, _
297297
byval ex1 as FBSYMBOL ptr = NULL, _
298-
byval ex2 as integer = 0, _
299-
byval ex3 as ZString Ptr = 0 _
298+
byval ex2 as integer = 0, _
299+
byval ex3 as zstring ptr = 0 _
300300
) static
301301

302302
dim as IRTAC ptr t
@@ -682,11 +682,11 @@ private sub _emitDBG _
682682
( _
683683
byval op as integer, _
684684
byval proc as FBSYMBOL ptr, _
685-
byval ex As Integer, _
686-
ByVal filename As ZString Ptr _
685+
byval ex as integer, _
686+
byval filename as zstring ptr _
687687
)
688688

689-
_emit( op, NULL, NULL, NULL, proc, ex, filename )
689+
_emit( op, NULL, NULL, NULL, proc, ex, filename )
690690

691691
end sub
692692

@@ -1365,7 +1365,7 @@ private sub _flush static
13651365
hFlushMEM( op, v1, v2, t->ex2, t->ex1 )
13661366

13671367
case AST_NODECLASS_DBG
1368-
hFlushDBG( op, t->ex1, t->ex2, t->ex3 )
1368+
hFlushDBG( op, t->ex1, t->ex2, t->ex3 )
13691369

13701370
case AST_NODECLASS_LIT
13711371
hFlushLIT( op, cast( any ptr, t->ex1 ) )
@@ -2401,13 +2401,13 @@ private sub hFlushDBG _
24012401
( _
24022402
byval op as integer, _
24032403
byval proc as FBSYMBOL ptr, _
2404-
byval ex as Integer, _
2405-
ByVal filename As ZString Ptr _
2404+
byval ex as integer, _
2405+
ByVal filename As zstring ptr _
24062406
)
24072407

24082408
select case as const op
24092409
case AST_OP_DBG_LINEINI
2410-
emitDBGLineBegin( proc, ex, filename )
2410+
emitDBGLineBegin( proc, ex, filename )
24112411

24122412
case AST_OP_DBG_LINEEND
24132413
emitDBGLineEnd( proc, ex )

0 commit comments

Comments
 (0)