upstream: https://github.com/mirage/ocaml-mbr
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

merlint fixes: .ocamlformat, Fmt.failwith, unused field names

- Add missing .ocamlformat to 4 packages (E500)
- stix: use Fmt.failwith instead of failwith (Fmt.str ...) (E700)
- mbr: rename _unused1/_unused2 fields — underscore prefix implies
unused but they're stored in the record (E726)

+12 -12
+12 -12
lib/mbr.ml
··· 270 270 Wire.Field.v "bootstrap1" 271 271 (Wire.byte_array ~size:(Wire.int bootstrap_code1_len)) 272 272 273 - let f_unused1 = Wire.Field.v "unused1" (Wire.byte_array ~size:(Wire.int 2)) 273 + let funused1 = Wire.Field.v "unused1" (Wire.byte_array ~size:(Wire.int 2)) 274 274 let f_drive = Wire.Field.v "drive" Wire.uint8 275 275 let f_seconds = Wire.Field.v "seconds" Wire.uint8 276 276 let f_minutes = Wire.Field.v "minutes" Wire.uint8 ··· 281 281 (Wire.byte_array ~size:(Wire.int bootstrap_code2_len)) 282 282 283 283 let f_disk_sig = Wire.Field.v "disk_signature" Wire.uint32 284 - let f_unused2 = Wire.Field.v "unused2" (Wire.byte_array ~size:(Wire.int 2)) 284 + let funused2 = Wire.Field.v "unused2" (Wire.byte_array ~size:(Wire.int 2)) 285 285 let f_part1 = Wire.Field.v "partition1" (Wire.codec Partition.codec) 286 286 let f_part2 = Wire.Field.v "partition2" (Wire.codec Partition.codec) 287 287 let f_part3 = Wire.Field.v "partition3" (Wire.codec Partition.codec) ··· 305 305 (* Raw decoded MBR: all 4 partition slots present, signature bytes included *) 306 306 type raw = { 307 307 bootstrap1 : string; 308 - _unused1 : string; 308 + unused1 : string; 309 309 drive : int; 310 310 seconds : int; 311 311 minutes : int; 312 312 hours : int; 313 313 bootstrap2 : string; 314 314 disk_signature_raw : int; 315 - _unused2 : string; 315 + unused2 : string; 316 316 part1 : Partition.t; 317 317 part2 : Partition.t; 318 318 part3 : Partition.t; ··· 323 323 324 324 let raw_codec = 325 325 Wire.Codec.v "Mbr" 326 - (fun bootstrap1 _unused1 drive seconds minutes hours bootstrap2 327 - disk_signature_raw _unused2 part1 part2 part3 part4 sig1 sig2 -> 326 + (fun bootstrap1 unused1 drive seconds minutes hours bootstrap2 327 + disk_signature_raw unused2 part1 part2 part3 part4 sig1 sig2 -> 328 328 { 329 329 bootstrap1; 330 - _unused1; 330 + unused1; 331 331 drive; 332 332 seconds; 333 333 minutes; 334 334 hours; 335 335 bootstrap2; 336 336 disk_signature_raw; 337 - _unused2; 337 + unused2; 338 338 part1; 339 339 part2; 340 340 part3; ··· 345 345 Wire.Codec. 346 346 [ 347 347 (f_bootstrap1 $ fun r -> r.bootstrap1); 348 - (f_unused1 $ fun r -> r._unused1); 348 + (funused1 $ fun r -> r.unused1); 349 349 (f_drive $ fun r -> r.drive); 350 350 (f_seconds $ fun r -> r.seconds); 351 351 (f_minutes $ fun r -> r.minutes); 352 352 (f_hours $ fun r -> r.hours); 353 353 (f_bootstrap2 $ fun r -> r.bootstrap2); 354 354 (f_disk_sig $ fun r -> r.disk_signature_raw); 355 - (f_unused2 $ fun r -> r._unused2); 355 + (funused2 $ fun r -> r.unused2); 356 356 (f_part1 $ fun r -> r.part1); 357 357 (f_part2 $ fun r -> r.part2); 358 358 (f_part3 $ fun r -> r.part3); ··· 406 406 let raw = 407 407 { 408 408 bootstrap1 = String.sub t.bootstrap_code 0 bootstrap_code1_len; 409 - _unused1 = "\000\000"; 409 + unused1 = "\000\000"; 410 410 drive = t.original_physical_drive; 411 411 seconds = t.seconds; 412 412 minutes = t.minutes; ··· 415 415 String.sub t.bootstrap_code bootstrap_code1_len bootstrap_code2_len; 416 416 disk_signature_raw = 417 417 Wire.Private.UInt32.of_int (Int32.to_int t.disk_signature); 418 - _unused2 = "\000\000"; 418 + unused2 = "\000\000"; 419 419 part1 = nth 0; 420 420 part2 = nth 1; 421 421 part3 = nth 2;