Skip to content

Commit bf3a603

Browse files
committed
style: activate sc_trailing_blanks and remove trailing whitespaces
2019-10-04 Jose E. Marchesi <[email protected]> * cfg.mk (local-checks-to-skip): Remove sc_trailing_blank. * .x-sc_trailing_blanks: New file. * pickles/elf.pk: Remove trailing blanks. * etc/poke-gdb.scm: Likewise. * doc/poke.texi: Likewise. * testsuite/poke.std/std.exp: Likewise. * testsuite/poke.pkl/try-catch-2.pk: Likewise. * testsuite/poke.pkl/structs.pk: Likewise. * testsuite/poke.pkl/promo-array-arg-diag-7.pk: Likewise. * testsuite/poke.pkl/promo-array-arg-8.pk: Likewise. * testsuite/poke.pkl/pkl.exp: Likewise. * testsuite/poke.pkl/loop-4.pk: Likewise. * testsuite/poke.pkl/loop-3.pk: Likewise. * testsuite/poke.pkl/funcall-def-diag-7.pk: Likewise. * testsuite/poke.pkl/funcall-def-diag-5.pk: Likewise. * testsuite/poke.pkl/funcall-def-2.pk: Likewise. * testsuite/poke.pkl/fun-types-4.pk: Likewise. * testsuite/poke.pkl/fun-types-3.pk: Likewise. * testsuite/poke.pkl/for-in-2.pk: Likewise. * testsuite/poke.pkl/defun-12.pk: Likewise. * testsuite/poke.pkl/defun-10.pk: Likewise. * testsuite/poke.pkl/break-while-2.pk: Likewise. * testsuite/poke.pkl/break-while-1.pk: Likewise. * testsuite/poke.pkl/break-for-1.pk: Likewise. * testsuite/poke.pkl/array-siz-1.pk: Likewise. * testsuite/poke.map/maps-structs-constraints-1.pk: Likewise. * testsuite/poke.map/maps-arrays-4.pk: Likewise. * testsuite/poke.map/map.exp: Likewise. * testsuite/poke.cmd/cmd.exp: Likewise. * testsuite/lib/poke.exp: Likewise. * testsuite/lib/poke-dg.exp: Likewise. * src/std.pk: Likewise. * src/ras: Likewise. * src/pvm.jitter: Likewise. * src/pkl-insn.def: Likewise. * src/pkl-gen.pks: Likewise. * src/pkl-asm.pks: Likewise. * src/pk-dump.pk: Likewise.
1 parent 4f951c7 commit bf3a603

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+137
-105
lines changed

.x-sc_trailing_blanks

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
pickles/future/*
2+
etc/parse-vlgrind-suppressions.sh
3+
HACKING

ChangeLog

+41
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,44 @@
1+
2019-10-04 Jose E. Marchesi <[email protected]>
2+
3+
* cfg.mk (local-checks-to-skip): Remove sc_trailing_blank.
4+
* .x-sc_trailing_blanks: New file.
5+
* pickles/elf.pk: Remove trailing blanks.
6+
* etc/poke-gdb.scm: Likewise.
7+
* doc/poke.texi: Likewise.
8+
* testsuite/poke.std/std.exp: Likewise.
9+
* testsuite/poke.pkl/try-catch-2.pk: Likewise.
10+
* testsuite/poke.pkl/structs.pk: Likewise.
11+
* testsuite/poke.pkl/promo-array-arg-diag-7.pk: Likewise.
12+
* testsuite/poke.pkl/promo-array-arg-8.pk: Likewise.
13+
* testsuite/poke.pkl/pkl.exp: Likewise.
14+
* testsuite/poke.pkl/loop-4.pk: Likewise.
15+
* testsuite/poke.pkl/loop-3.pk: Likewise.
16+
* testsuite/poke.pkl/funcall-def-diag-7.pk: Likewise.
17+
* testsuite/poke.pkl/funcall-def-diag-5.pk: Likewise.
18+
* testsuite/poke.pkl/funcall-def-2.pk: Likewise.
19+
* testsuite/poke.pkl/fun-types-4.pk: Likewise.
20+
* testsuite/poke.pkl/fun-types-3.pk: Likewise.
21+
* testsuite/poke.pkl/for-in-2.pk: Likewise.
22+
* testsuite/poke.pkl/defun-12.pk: Likewise.
23+
* testsuite/poke.pkl/defun-10.pk: Likewise.
24+
* testsuite/poke.pkl/break-while-2.pk: Likewise.
25+
* testsuite/poke.pkl/break-while-1.pk: Likewise.
26+
* testsuite/poke.pkl/break-for-1.pk: Likewise.
27+
* testsuite/poke.pkl/array-siz-1.pk: Likewise.
28+
* testsuite/poke.map/maps-structs-constraints-1.pk: Likewise.
29+
* testsuite/poke.map/maps-arrays-4.pk: Likewise.
30+
* testsuite/poke.map/map.exp: Likewise.
31+
* testsuite/poke.cmd/cmd.exp: Likewise.
32+
* testsuite/lib/poke.exp: Likewise.
33+
* testsuite/lib/poke-dg.exp: Likewise.
34+
* src/std.pk: Likewise.
35+
* src/ras: Likewise.
36+
* src/pvm.jitter: Likewise.
37+
* src/pkl-insn.def: Likewise.
38+
* src/pkl-gen.pks: Likewise.
39+
* src/pkl-asm.pks: Likewise.
40+
* src/pk-dump.pk: Likewise.
41+
142
2019-10-04 Henner Zeller <[email protected]>
243

344
* src/ios-dev.h: Remove trailing spaces.

cfg.mk

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@ po_file=does-not-exist
44
export _gl_TS_headers = *.h
55

66
local-checks-to-skip = \
7-
sc_tight_scope \
8-
sc_trailing_blank
7+
sc_tight_scope

doc/poke.texi

+12-12
Original file line numberDiff line numberDiff line change
@@ -988,7 +988,7 @@ types.
988988

989989
@c the type of @code{a} is @code{array (integer (32, 1))}, and it's size
990990
@c is @code{3}.
991-
991+
992992
@c In function definitions, it is not allowed to specify a size for an
993993
@c array argument, thus, this is @emph{not} allowed:
994994

@@ -1019,7 +1019,7 @@ types.
10191019

10201020
@c is a type expression denoting a struct type having name @var{n} and @var{m}
10211021
@c fields, each featuring a field name @var{li} and a type @var{ti}.
1022-
1022+
10231023
@c The strings @var{n} and @var{li} can be @code{NULL}, meaning the
10241024
@c structure type is anonymous and that the corresponding struct fields
10251025
@c are anonymous, respectively.
@@ -1617,7 +1617,7 @@ deftype Tag =
16171617
int flags;
16181618
int reserved;
16191619
@};
1620-
1620+
16211621
struct
16221622
@{
16231623
int tag_type = TAG_VIDEO;
@@ -1640,7 +1640,7 @@ deftype Tag =
16401640
@} null;
16411641
@};
16421642
@end example
1643-
1643+
16441644
Compare the above with the following version where flattening is not
16451645
used at all. The type `tag' is changed to a struct and an additional
16461646
union is nested, very C-like.
@@ -1669,7 +1669,7 @@ deftype Tag =
16691669
struct
16701670
@{
16711671
@} null : tag_type = TAG_NULL;
1672-
1672+
16731673
@} data;
16741674
@};
16751675
@end example
@@ -1791,7 +1791,7 @@ Allow constant expressions in integral type constructors, like
17911791
@c of EXPR do not sum exactly LEN bytes. */
17921792
@c @};
17931793
@c @end example
1794-
@c
1794+
@c
17951795
@c Note that if LEN is not achieved because of an union constraint
17961796
@c failure, this will catch the error (the union constraint failure
17971797
@c won't.) Put an example.
@@ -2012,7 +2012,7 @@ pinned struct
20122012
int f2;
20132013
@};
20142014
@end example
2015-
2015+
20162016
The location counter is not advanced when a pinned struct is
20172017
processed. Labels can be used with pinned fields with the usual
20182018
semantics.
@@ -2066,7 +2066,7 @@ XXX: assignment to structs.
20662066
20672067
for (elf_section section in elf.sections)
20682068
switch (tagof (section))
2069-
@{
2069+
@{
20702070
case progbits: bleh;
20712071
case symtab: bleh;
20722072
@}
@@ -2258,7 +2258,7 @@ XXX: optional fields.
22582258
int f;
22592259
struct @{@};
22602260
@};
2261-
@end example
2261+
@end example
22622262

22632263
Note that if f does not have constraints associated with it, then
22642264
it will be always present.
@@ -2429,7 +2429,7 @@ deftype astruct =
24292429
struct
24302430
@{
24312431
int f1;
2432-
2432+
24332433
union
24342434
@{
24352435
int f2 : f1 == 0;
@@ -2453,7 +2453,7 @@ deftype astruct =
24532453
struct
24542454
@{
24552455
int f1;
2456-
2456+
24572457
union
24582458
@{
24592459
int f2 : f1 == 0;
@@ -3380,7 +3380,7 @@ let packet = Packet @@ 0x00; /* This evals to a mapped Packet in an rhs. */
33803380
33813381
packet.field = 10; /* This accesses IO. */
33823382
packet = @{0xa, 0xb@}; /* But this replaces the value of the variable. */
3383-
3383+
33843384
let packets = Packet[] @@ 0x00; /* This evals to a mapped array value in an rhs. */
33853385
33863386
packets[0] = @{0xa, 0xb@}; /* This accesses IO. */

etc/poke-gdb.scm

+3-3
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
(value-lognot
4747
(value-cast (make-value 0)
4848
(lookup-type "uint64_t")))
49-
(value-sub uint-size 1))
49+
(value-sub uint-size 1))
5050
(make-value 1)))
5151
(lookup-type "uint32_t")))))
5252
(format #f "(pvm:uint<~a>) ~a" uint-size uint-val)))
@@ -93,7 +93,7 @@
9393
(value-lognot
9494
(value-cast (make-value 0)
9595
(lookup-type "unsigned long long")))
96-
(value-sub ulong-size 1))
96+
(value-sub ulong-size 1))
9797
(make-value 1)))
9898
(lookup-type "uint64_t")))))
9999
(format #f "(pvm:ulong<~a>) ~a" ulong-size ulong-val)))
@@ -133,7 +133,7 @@
133133
((#x7) ;; PVM_NULL
134134
"PVM_NULL")
135135
(else
136-
"Unknown PVM_VAL tag"))))
136+
"Unknown PVM_VAL tag"))))
137137

138138
(define (make-poke-pvm-val-printer value)
139139
"Print a pvm_val object"

pickles/elf.pk

-1
Original file line numberDiff line numberDiff line change
@@ -139,4 +139,3 @@ defun elf_section_by_type = (Elf64_Ehdr ehdr, Elf_Word type) Elf64_Shdr:
139139

140140
raise E_generic;
141141
}
142-

src/pk-dump.pk

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ defun dump = (off64 from = pk_dump_offset,
4545
{
4646
defun print_ruler = void:
4747
{
48-
defvar o = 0#B;
48+
defvar o = 0#B;
4949

5050
print "76543210 ";
5151
for (s in ["00", "11", "22", "33", "44", "55", "66",
@@ -91,7 +91,7 @@ defun dump = (off64 from = pk_dump_offset,
9191
}
9292
}
9393
print "\n";
94-
94+
9595
offset = offset + step;
9696
}
9797
}

src/pkl-asm.pks

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
mullu
3232
nip2 ; OFF (OGETU*OGETM
3333
.end
34-
34+
3535
;;; RAS_MACRO_REMAP
3636
;;; ( VAL -- VAL )
3737
;;;
@@ -225,7 +225,7 @@
225225
;;;
226226
;;; Multiply an offset with a magnitude. The result of the operation
227227
;;; is an offset with base type BASE_TYPE.
228-
;;;
228+
;;;
229229
;;; Macro arguments:
230230
;;; @base_type
231231
;;; a pkl_ast_node with the base type of the offset.

src/pkl-gen.pks

+22-22
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@
3131
push null
3232
msetw
3333
.end
34-
34+
3535
;;; RAS_FUNCTION_ARRAY_MAPPER
3636
;;; ( OFF EBOUND SBOUND -- ARR )
37-
;;;
37+
;;;
3838
;;; Assemble a function that maps an array value at the given offset
3939
;;; OFF, with mapping attributes EBOUND and SBOUND.
40-
;;;
40+
;;;
4141
;;; If both EBOUND and SBOUND are null, then perform an unbounded map,
4242
;;; i.e. read array elements from IO until EOF. XXX: what about empty
4343
;;; arrays?
@@ -53,7 +53,7 @@
5353
;;;
5454
;;; Only one of EBOUND or SBOUND simultanously are supported.
5555
;;; Note that OFF should be of type offset<uint<64>,*>.
56-
;;;
56+
;;;
5757
;;; The C environment required is:
5858
;;;
5959
;;; `array_type' is a pkl_ast_node with the array type being mapped.
@@ -132,7 +132,7 @@
132132
nip2 ; OFF ATYPE (SBOUNDM+AOMAG)
133133
pushvar $eomag ; OFF ATYPE (SBOUNDM+AOMAG) EOMAG
134134
gtlu ; OFF ATYPE (SBOUNDM+AOMAG) EOMAG ((SBOUNDM+AOMAG)>EOMAG)
135-
nip2 ; OFF ATYPE ((SBOUNDM+AOMAG)>EOMAG)
135+
nip2 ; OFF ATYPE ((SBOUNDM+AOMAG)>EOMAG)
136136
ba .end_loop_on
137137
.loop_unbounded:
138138
drop ; OFF ATYPE
@@ -263,13 +263,13 @@
263263

264264
;;; RAS_FUNCTION_ARRAY_VALMAPPER
265265
;;; ( VAL NVAL OFF -- ARR )
266-
;;;
266+
;;;
267267
;;; Assemble a function that "valmaps" a given NVAL at the given offset
268268
;;; OFF, using the data of NVAL, and the mapping attributes of VAL.
269-
;;;
269+
;;;
270270
;;; This function can raise PVM_E_MAP_BOUNDS if the characteristics of
271271
;;; NVAL violate the bounds of the map.
272-
;;;
272+
;;;
273273
;;; Note that OFF should be of type offset<uint<64>,*>.
274274

275275
.function array_valmapper
@@ -333,7 +333,7 @@
333333
bnn .check_ebound
334334
drop ; OFF
335335
ba .ebound_ok
336-
336+
337337
.check_ebound:
338338
pushvar $nelem ; OFF EBOUND NELEM
339339
sublu ; OFF EBOUND NELEM (EBOUND-NELEM)
@@ -495,7 +495,7 @@
495495
addlu ; EDIX 1UL (EIDX+1UL)
496496
nip2 ; (EIDX+1UL)
497497
popvar $idx ; _
498-
.endloop
498+
.endloop
499499
popf 1
500500
push null
501501
return
@@ -569,7 +569,7 @@
569569
;;;
570570
;;; `field' is a pkl_ast_node with the struct field being
571571
;;; mapped.
572-
572+
573573
.macro handle_struct_field_label
574574
.c if (PKL_AST_STRUCT_FIELD_TYPE_LABEL (field) == NULL)
575575
drop ; OFF
@@ -625,7 +625,7 @@
625625
drop
626626
.c }
627627
.end
628-
628+
629629
;;; RAS_MACRO_STRUCT_FIELD_MAPPER
630630
;;; ( OFF SOFF -- OFF STR VAL NOFF )
631631
;;;
@@ -663,7 +663,7 @@
663663
nrot ; OFF STR VAL
664664
fromr ; OFF STR VAL NOFF
665665
.end
666-
666+
667667
;;; RAS_FUNCTION_STRUCT_MAPPER
668668
;;; ( OFF EBOUND SBOUND -- SCT )
669669
;;;
@@ -679,10 +679,10 @@
679679
;;;
680680
;;; `type_struct' is a pkl_ast_node with the struct type being
681681
;;; processed.
682-
;;;
682+
;;;
683683
;;; `type_struct_fields' is a pkl_ast_node with the chained list fields
684684
;;; of the struct type being processed.
685-
;;;
685+
;;;
686686
;;; `field' is a scratch pkl_ast_node.
687687

688688
;; NOTE: please be careful when altering the lexical structure of
@@ -744,10 +744,10 @@
744744
;;;
745745
;;; `type_struct' is a pkl_ast_node with the struct type being
746746
;;; processed.
747-
;;;
747+
;;;
748748
;;; `type_struct_fields' is a pkl_ast_node with the chained list fields
749749
;;; of the struct type being processed.
750-
;;;
750+
;;;
751751
;;; `field' is a scratch pkl_ast_node.
752752

753753
.function struct_constructor
@@ -794,15 +794,15 @@
794794
popf 1
795795
return
796796
.end
797-
797+
798798
;;; RAS_MACRO_STRUCT_FIELD_WRITER
799799
;;; ( SCT I -- )
800800
;;;
801801
;;; Macro that writes the Ith field of struct SCT to IO space.
802802
;;;
803803
;;; C environment required:
804804
;;; `field' is a pkl_ast_node with the type of the field to write.
805-
805+
806806
.macro struct_field_writer
807807
;; The field is written out only if it hasn't
808808
;; been modified since the last mapping.
@@ -824,7 +824,7 @@
824824
drop ; _
825825
.next:
826826
.end
827-
827+
828828
;;; RAS_FUNCTION_STRUCT_WRITER
829829
;;; ( OFF VAL -- )
830830
;;;
@@ -834,10 +834,10 @@
834834
;;;
835835
;;; `type_struct' is a pkl_ast_node with the struct type being
836836
;;; processed.
837-
;;;
837+
;;;
838838
;;; `type_struct_fields' is a pkl_ast_node with the chained list fields
839839
;;; of the struct type being processed.
840-
;;;
840+
;;;
841841
;;; `field' is a scratch pkl_ast_node.
842842

843843
.function struct_writer

0 commit comments

Comments
 (0)