Skip to content

Commit 017a640

Browse files
committed
Whitespace and line lengths
1 parent 797c9a7 commit 017a640

40 files changed

+149
-92
lines changed

Diff for: api_docgen/Makefile.docfiles

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ str_MLIS := str.mli
3535
unix_MLIS := unix.mli unixLabels.mli
3636
dynlink_MLIS := dynlink.mli
3737
thread_MLIS := \
38-
thread.mli event.mli \
39-
threadUnix.mli
38+
thread.mli event.mli \
39+
threadUnix.mli
4040

4141
STDLIB=$(filter-out stdlib__Pervasives, $(STDLIB_MODULES))
4242

Diff for: asmcomp/afl_instrument.ml

+9-3
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,19 @@ let rec with_afl_logging b dbg =
4242
let afl_area = V.create_local "shared_mem" in
4343
let op oper args = Cop (oper, args, dbg) in
4444
Clet(VP.create afl_area,
45-
op (Cload ({memory_chunk=Word_int; mutability=Asttypes.Mutable; is_atomic=false})) [afl_area_ptr dbg],
46-
Clet(VP.create cur_pos, op Cxor [op (Cload {memory_chunk=Word_int; mutability=Asttypes.Mutable; is_atomic=false})
45+
op (Cload ({memory_chunk=Word_int;
46+
mutability=Asttypes.Mutable;
47+
is_atomic=false})) [afl_area_ptr dbg],
48+
Clet(VP.create cur_pos, op Cxor [op (Cload {memory_chunk=Word_int;
49+
mutability=Asttypes.Mutable;
50+
is_atomic=false})
4751
[afl_prev_loc dbg]; Cconst_int (cur_location, dbg)],
4852
Csequence(
4953
op (Cstore(Byte_unsigned, Assignment))
5054
[op Cadda [Cvar afl_area; Cvar cur_pos];
51-
op Cadda [op (Cload {memory_chunk=Byte_unsigned; mutability=Asttypes.Mutable; is_atomic=false})
55+
op Cadda [op (Cload {memory_chunk=Byte_unsigned;
56+
mutability=Asttypes.Mutable;
57+
is_atomic=false})
5258
[op Cadda [Cvar afl_area; Cvar cur_pos]];
5359
Cconst_int (1, dbg)]],
5460
op (Cstore(Word_int, Assignment))

Diff for: asmcomp/arm/selection.ml

+3-1
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,9 @@ method private select_operation_softfp op args dbg =
270270
(* Add coercions around loads and stores of 32-bit floats *)
271271
| (Cload {memory_chunk=Single; mutability; is_atomic=false}, args) ->
272272
(self#iextcall "__aeabi_f2d" typ_float [XInt],
273-
[Cop(Cload {memory_chunk=Word_int; mutability; is_atomic=false}, args, dbg)])
273+
[Cop(Cload {memory_chunk=Word_int;
274+
mutability;
275+
is_atomic=false}, args, dbg)])
274276
| (Cstore (Single, init), [arg1; arg2]) ->
275277
let arg2' =
276278
Cop(Cextcall("__aeabi_d2f", typ_int, [XFloat], false),

Diff for: asmcomp/strmatch.ml

+3-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ module Make(I:I) = struct
7676
let mk_let_cell id str ind body =
7777
let dbg = Debuginfo.none in
7878
let cell =
79-
Cop(Cload {memory_chunk=Word_int; mutability=Asttypes.Mutable; is_atomic=false},
79+
Cop(Cload {memory_chunk=Word_int;
80+
mutability=Asttypes.Mutable;
81+
is_atomic=false},
8082
[Cop(Cadda,[str;Cconst_int(Arch.size_int*ind, dbg)], dbg)],
8183
dbg) in
8284
Clet(id, cell, body)

Diff for: lambda/translmod.ml

+10-5
Original file line numberDiff line numberDiff line change
@@ -966,7 +966,8 @@ let transl_store_subst = ref Ident.Map.empty
966966

967967
let nat_toplevel_name id =
968968
try match Ident.Map.find id !transl_store_subst with
969-
| Lprim(Pfield (pos, _, _), [Lprim(Pgetglobal glob, [], _)], _) -> (glob,pos)
969+
| Lprim(Pfield (pos, _, _),
970+
[Lprim(Pgetglobal glob, [], _)], _) -> (glob,pos)
970971
| _ -> raise Not_found
971972
with Not_found ->
972973
fatal_error("Translmod.nat_toplevel_name: " ^ Ident.unique_name id)
@@ -1250,7 +1251,8 @@ let transl_store_structure ~scopes glob map prims aliases str =
12501251
(add_idents true ids subst) cont rem
12511252
| id :: idl ->
12521253
Llet(Alias, Pgenval, id,
1253-
Lprim(Pfield (pos, Pointer, Mutable), [Lvar mid], loc),
1254+
Lprim(Pfield (pos, Pointer, Mutable),
1255+
[Lvar mid], loc),
12541256
Lsequence(store_ident loc id,
12551257
store_idents (pos + 1) idl))
12561258
in
@@ -1521,7 +1523,8 @@ let transl_toplevel_item ~scopes item =
15211523
lambda_unit
15221524
| id :: ids ->
15231525
Lsequence(toploop_setvalue id
1524-
(Lprim(Pfield (pos, Pointer, Mutable), [Lvar mid], Loc_unknown)),
1526+
(Lprim(Pfield (pos, Pointer, Mutable),
1527+
[Lvar mid], Loc_unknown)),
15251528
set_idents (pos + 1) ids) in
15261529
Llet(Strict, Pgenval, mid,
15271530
transl_module ~scopes Tcoerce_none None modl, set_idents 0 ids)
@@ -1544,7 +1547,8 @@ let transl_toplevel_item ~scopes item =
15441547
lambda_unit
15451548
| id :: ids ->
15461549
Lsequence(toploop_setvalue id
1547-
(Lprim(Pfield (pos, Pointer, Mutable), [Lvar mid], Loc_unknown)),
1550+
(Lprim(Pfield (pos, Pointer, Mutable),
1551+
[Lvar mid], Loc_unknown)),
15481552
set_idents (pos + 1) ids)
15491553
in
15501554
Llet(pure, Pgenval, mid,
@@ -1647,7 +1651,8 @@ let transl_store_package component_names target_name coercion =
16471651
(fun pos _id ->
16481652
Lprim(Psetfield(pos, Pointer, Root_initialization),
16491653
[Lprim(Pgetglobal target_name, [], Loc_unknown);
1650-
Lprim(Pfield (pos, Pointer, Mutable), [Lvar blk], Loc_unknown)],
1654+
Lprim(Pfield (pos, Pointer, Mutable),
1655+
[Lvar blk], Loc_unknown)],
16511656
Loc_unknown))
16521657
0 pos_cc_list))
16531658
(*

Diff for: middle_end/closure/closure.ml

+4-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ let rec build_closure_env env_param pos = function
5454
[] -> V.Map.empty
5555
| id :: rem ->
5656
V.Map.add id
57-
(Uprim(P.Pfield(pos, Pointer, Immutable), [Uvar env_param], Debuginfo.none))
57+
(Uprim(P.Pfield(pos, Pointer, Immutable),
58+
[Uvar env_param], Debuginfo.none))
5859
(build_closure_env env_param (pos+1) rem)
5960

6061
(* Auxiliary for accessing globals. We change the name of the global
@@ -483,7 +484,8 @@ let simplif_prim_pure ~backend fpc p (args, approxs) dbg =
483484
(Uprim(p, args, dbg), Value_tuple (Array.of_list approxs))
484485
end
485486
(* Field access *)
486-
| Pfield (n, _, _), _, [ Value_const(Uconst_ref(_, Some (Uconst_block(_, l)))) ]
487+
| Pfield (n, _, _), _,
488+
[ Value_const(Uconst_ref(_, Some (Uconst_block(_, l)))) ]
487489
when n < List.length l ->
488490
make_const (List.nth l n)
489491
| Pfield(n, _, _), [ Uprim(P.Pmakeblock _, ul, _) ], [approx]

Diff for: middle_end/flambda/closure_conversion.ml

+4-2
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ let tupled_function_call_stub original_params unboxed_version ~closure_bound_var
9191
let _, body =
9292
List.fold_left (fun (pos, body) param ->
9393
let lam : Flambda.named =
94-
Prim (Pfield (pos, Pointer, Mutable), [tuple_param_var], Debuginfo.none)
94+
Prim (Pfield (pos, Pointer, Mutable),
95+
[tuple_param_var], Debuginfo.none)
9596
in
9697
pos + 1, Flambda.create_let param lam body)
9798
(0, call) params
@@ -698,7 +699,8 @@ let lambda_to_flambda ~backend ~module_ident ~size lam
698699
(Flambda.create_let result_v
699700
(Prim (Pfield (0, Pointer, Mutable), [sym_v], Debuginfo.none))
700701
(Flambda.create_let value_v
701-
(Prim (Pfield (pos, Pointer, Mutable), [result_v], Debuginfo.none))
702+
(Prim (Pfield (pos, Pointer, Mutable),
703+
[result_v], Debuginfo.none))
702704
(Var value_v))))
703705
in
704706
let module_initializer : Flambda.program_body =

Diff for: runtime/arm64.S

+26-13
Original file line numberDiff line numberDiff line change
@@ -175,18 +175,21 @@ name:
175175
* from the bottom of the OCaml stack. Clobbers REG. */
176176
#define SWITCH_C_TO_OCAML(REG) \
177177
SWITCH_C_TO_OCAML_NO_CTXT(REG); \
178-
/* Pop the caml_context from the bottom of stack updating TRAP_OFF and return address. */ \
178+
/* Pop the caml_context from the bottom of stack updating TRAP_OFF and
179+
return address. */ \
179180
ldr x30, [sp, 24]; \
180181
ldr TRAP_OFF, [sp], 32
181182

182-
/* Restore exception handler for OCaml code. Cuts stack, and loads target address in TMP. */
183+
/* Restore exception handler for OCaml code. Cuts stack, and loads target
184+
address in TMP. */
183185
#define RESTORE_EXN_HANDLER_OCAML \
184186
LOAD_TL_VAR(caml_stack_high, TMP); \
185187
sub sp, TMP, TRAP_OFF; \
186188
ldr TMP, [sp, 8]; \
187189
ldr TRAP_OFF, [sp], 16
188190

189-
/* Load [caml_system_stack_high - TRAP_OFF] into sp. Cuts the stack, and loads the target address in TMP. */
191+
/* Load [caml_system_stack_high - TRAP_OFF] into sp. Cuts the stack, and loads
192+
the target address in TMP. */
190193
#define RESTORE_EXN_HANDLER_SYS \
191194
LOAD_TL_VAR(caml_system_stack_high, TMP); \
192195
sub sp, TMP, TRAP_OFF; \
@@ -220,11 +223,13 @@ caml_system__code_begin:
220223

221224
#define SAVE_ALL_REGS_AND_CALL(TARGET_FUN) \
222225
/* Set up stack space, saving return address and frame pointer */ \
223-
/* (2 regs RA/GP, 24 allocatable int regs, 24 caller-save float regs) * 8 */ \
226+
/* (2 regs RA/GP, 24 allocatable int regs, 24 caller-save float regs) * 8 \
227+
*/ \
224228
stp x29, x30, [sp, -400]!; \
225229
CFI_ADJUST(400); \
226230
add x29, sp, 0 ; \
227-
/* Save allocatable integer registers on the stack, in the order given in proc.ml */ \
231+
/* Save allocatable integer registers on the stack, in the order given in \
232+
proc.ml */ \
228233
stp x0, x1, [sp, 16]; \
229234
stp x2, x3, [sp, 32]; \
230235
stp x4, x5, [sp, 48]; \
@@ -312,7 +317,8 @@ CFI_ENDPROC
312317
.size caml_call_realloc_stack, .-caml_call_realloc_stack
313318

314319

315-
/* TODO KC: define MK_CAML_ALLOC(SZ) macro for generating caml_allocX functions. */
320+
/* TODO KC: define MK_CAML_ALLOC(SZ) macro for generating caml_allocX
321+
functions. */
316322

317323
FUNCTION(caml_alloc1)
318324
CFI_STARTPROC
@@ -690,7 +696,8 @@ CFI_STARTPROC
690696
LOAD_TL_VAR(caml_current_stack, x1)
691697
str xzr, Stack_sp(x1) /* zero SP */
692698
ldr x20, Stack_handle_exception(x1) /* exception handler */
693-
ldr x0, Stack_parent(x1) /* parent stack. Never NULL here. */
699+
ldr x0, Stack_parent(x1) /* parent stack. Never NULL
700+
here. */
694701
/* Reset stack */
695702
mov TMP, 1
696703
str TMP, Stack_handle_value(x1)
@@ -715,7 +722,8 @@ CFI_STARTPROC
715722
LOAD_TL_VAR(caml_current_stack, x1)
716723
str xzr, Stack_sp(x1) /* zero SP */
717724
ldr x20, Stack_handle_value(x1) /* value handler */
718-
ldr x0, Stack_parent(x1) /* parent stack. Never NULL here. */
725+
ldr x0, Stack_parent(x1) /* parent stack. Never NULL
726+
here. */
719727
/* Reset stack. First pop off fiber exn handler. */
720728
add sp, sp, 16
721729
CFI_ADJUST(-16)
@@ -744,7 +752,8 @@ CFI_STARTPROC
744752
b.eq 1f
745753
ldr x21, Stack_handle_effect(x20) /* effect handler */
746754
mov TMP, 1
747-
str TMP, Stack_parent(x20) /* Set parent stack of performer to NULL */
755+
str TMP, Stack_parent(x20) /* Set parent stack of performer
756+
to NULL */
748757
/* Switch stacks */
749758
SWITCH_OCAML_STACKS
750759
/* Invoke effect handler */
@@ -769,8 +778,10 @@ CFI_STARTPROC
769778
cmp x0, 1 /* Parent is NULL? */
770779
b.eq 1f
771780
str x1, Stack_parent(x2) /* Set performer as parent */
772-
mov x20, x2 /* Save current stack in callee-saved x20 */
773-
ldr x21, Stack_handle_effect(x2) /* Save effect handler in callee-saved x21 */
781+
mov x20, x2 /* Save current stack in
782+
callee-saved x20 */
783+
ldr x21, Stack_handle_effect(x2) /* Save effect handler in
784+
callee-saved x21 */
774785
/* Switch stacks */
775786
SWITCH_OCAML_STACKS
776787
/* Invoke effect handler */
@@ -837,11 +848,13 @@ caml_system__code_end:
837848
caml_system__frametable:
838849
.quad 2 /* two descriptors */
839850
.quad .Lcaml_retaddr /* return address into callback */
840-
.short -1 /* negative frame size => use callback link */
851+
.short -1 /* negative frame size => use callback
852+
link */
841853
.short 0 /* no roots */
842854
.align 3
843855
.quad .Lfiber_val_handler /* return address into fiber_val_handler */
844-
.short -1 /* negative frame size => use callback link */
856+
.short -1 /* negative frame size => use callback
857+
link */
845858
.short 0 /* no roots */
846859
.align 3
847860
.type caml_system__frametable, %object

Diff for: runtime/backtrace.c

+6-3
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ CAMLexport void caml_record_backtraces(int flag)
3535
if (flag != Caml_state->backtrace_active) {
3636
Caml_state->backtrace_active = flag;
3737
Caml_state->backtrace_pos = 0;
38-
caml_modify_generational_global_root(&Caml_state->backtrace_last_exn, Val_unit);
38+
caml_modify_generational_global_root(&Caml_state->backtrace_last_exn,
39+
Val_unit);
3940
}
4041
return;
4142
}
@@ -182,7 +183,8 @@ CAMLprim value caml_get_exception_raw_backtrace(value unit)
182183

183184
res = caml_alloc(saved_caml_backtrace_pos, 0);
184185
for (i = 0; i < saved_caml_backtrace_pos; i++) {
185-
caml_initialize(&Field(res, i), Val_backtrace_slot(saved_caml_backtrace_buffer[i]));
186+
caml_initialize(&Field(res, i),
187+
Val_backtrace_slot(saved_caml_backtrace_buffer[i]));
186188
}
187189
}
188190

@@ -214,7 +216,8 @@ CAMLprim value caml_restore_raw_backtrace(value exn, value backtrace)
214216
}
215217

216218
/* Allocate if needed and copy the backtrace buffer */
217-
if (domain_state->backtrace_buffer == NULL && caml_alloc_backtrace_buffer() == -1){
219+
if (domain_state->backtrace_buffer == NULL
220+
&& caml_alloc_backtrace_buffer() == -1){
218221
return Val_unit;
219222
}
220223

Diff for: runtime/caml/custom.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ CAMLextern value caml_alloc_custom_mem(const struct custom_operations * ops,
6464
uintnat size, /*size in bytes*/
6565
mlsize_t mem /*memory consumed*/);
6666

67-
CAMLextern void caml_register_custom_operations(const struct custom_operations * ops);
67+
CAMLextern void
68+
caml_register_custom_operations(const struct custom_operations * ops);
6869

6970
/* Global variable moved to Caml_state in 4.10 */
7071
#define caml_compare_unordered (Caml_state_field(compare_unordered))

Diff for: runtime/caml/finalise.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ struct caml_final_info {
6363
struct final_todo *todo_head;
6464
struct final_todo *todo_tail;
6565
uintnat running_finalisation_function;
66-
struct caml_final_info* next; /* used for orphaned finalisers. See major_gc.c */
66+
struct caml_final_info* next; /* used for orphaned finalisers.
67+
See major_gc.c */
6768
};
6869

6970
void caml_final_merge_finalisable (struct finalisable *source,

Diff for: runtime/caml/globroots.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ void caml_register_dyn_global(void *v);
3232

3333
#endif /* CAML_INTERNALS */
3434

35-
#endif /* CAML_GLOBROOTS_H */
35+
#endif /* CAML_GLOBROOTS_H */

Diff for: runtime/caml/memory.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ CAMLextern void caml_adjust_gc_speed (mlsize_t, mlsize_t);
5353
CAMLextern void caml_alloc_dependent_memory (mlsize_t);
5454
CAMLextern void caml_free_dependent_memory (mlsize_t);
5555
CAMLextern int caml_atomic_cas_field (value, intnat, value, value);
56-
CAMLextern void caml_blit_fields (value src, int srcoff, value dst, int dstoff, int n);
56+
CAMLextern void caml_blit_fields (value src, int srcoff, value dst, int dstoff,
57+
int n);
5758
CAMLextern value caml_check_urgent_gc (value);
5859
#ifdef CAML_INTERNALS
5960
CAMLextern char *caml_alloc_for_heap (asize_t request); /* Size in bytes. */

Diff for: runtime/caml/roots.h

+5-4
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,15 @@
2222
#include "memory.h"
2323

2424
typedef void (*scanning_action) (void*, value, value *);
25-
CAMLextern void (*caml_scan_roots_hook)(scanning_action, void*, caml_domain_state*);
25+
CAMLextern void (*caml_scan_roots_hook)(scanning_action, void*,
26+
caml_domain_state*);
2627

2728
void caml_do_roots (scanning_action f, void* data, caml_domain_state* d,
2829
int do_final_val);
2930
void caml_do_local_roots(scanning_action f, void* data,
30-
struct caml__roots_block* local_roots,
31-
struct stack_info *current_stack,
32-
value * v_gc_regs);
31+
struct caml__roots_block* local_roots,
32+
struct stack_info *current_stack,
33+
value * v_gc_regs);
3334

3435
#endif /* CAML_INTERNALS */
3536

Diff for: runtime/caml/stack.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@
6161
#endif
6262

6363
#ifdef TARGET_amd64
64-
/* Size of the gc_regs structure, in words. See amd64.S and amd64/proc.ml for the indices */
64+
/* Size of the gc_regs structure, in words.
65+
See amd64.S and amd64/proc.ml for the indices */
6566
#define Wosize_gc_regs (13 /* int regs */ + 16 /* float regs */)
6667
#define Saved_return_address(sp) *((intnat *)((sp) - 8))
6768
#endif

Diff for: runtime/custom.c

+6-3
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ static value alloc_custom_gen (const struct custom_operations * ops,
5656
}
5757
/* The remaining [mem_minor] will be counted if the block survives a
5858
minor GC */
59-
add_to_custom_table (&Caml_state->minor_tables->custom, result, mem, max_major);
59+
add_to_custom_table (&Caml_state->minor_tables->custom, result,
60+
mem, max_major);
6061
/* Keep track of extra resources held by custom block in
6162
minor heap. */
6263
if (mem_minor != 0) {
@@ -116,7 +117,8 @@ struct custom_operations_list {
116117

117118
static struct custom_operations_list * custom_ops_table = NULL;
118119

119-
CAMLexport void caml_register_custom_operations(const struct custom_operations * ops)
120+
CAMLexport void
121+
caml_register_custom_operations(const struct custom_operations * ops)
120122
{
121123
struct custom_operations_list * l =
122124
caml_stat_alloc(sizeof(struct custom_operations_list));
@@ -131,7 +133,8 @@ struct custom_operations * caml_find_custom_operations(char * ident)
131133
{
132134
struct custom_operations_list * l;
133135
for (l = custom_ops_table; l != NULL; l = l->next)
134-
if (strcmp(l->ops->identifier, ident) == 0) return (struct custom_operations*)l->ops;
136+
if (strcmp(l->ops->identifier, ident) == 0)
137+
return (struct custom_operations*)l->ops;
135138
return NULL;
136139
}
137140

0 commit comments

Comments
 (0)