CCSDS File Delivery Protocol (CCSDS 727.0-B-5) for space file transfer
0
fork

Configure Feed

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

fix(lint): replace Printf/Format with Fmt across multiple packages

Replace Printf.sprintf with Fmt.str and Format.fprintf with Fmt.pf in
cbort, cfdp, btree, block, bpsec, irmin, cookeio, and cpio. Also fix
E215 (failwith+Fmt.str -> Fmt.failwith) and E340 (extract err_* helpers).

+15 -16
+15 -16
lib/cfdp.ml
··· 120 120 let to_int64 eid = eid 121 121 let equal = Int64.equal 122 122 let compare = Int64.compare 123 - let pp fmt eid = Format.fprintf fmt "0x%Lx" eid 123 + let pp fmt eid = Fmt.pf fmt "0x%Lx" eid 124 124 end 125 125 126 126 type entity_id = Entity_id.t ··· 130 130 type transaction_id = { source : entity_id; seq_nr : int64 } 131 131 132 132 let pp_transaction_id fmt tid = 133 - Format.fprintf fmt "{source=%a; seq=%Ld}" Entity_id.pp tid.source tid.seq_nr 133 + Fmt.pf fmt "{source=%a; seq=%Ld}" Entity_id.pp tid.source tid.seq_nr 134 134 135 135 (* {1 PDU Configuration} *) 136 136 ··· 201 201 | _ -> None 202 202 203 203 let pp_condition fmt c = 204 - Format.fprintf fmt "%s" 204 + Fmt.pf fmt "%s" 205 205 (match c with 206 206 | No_error -> "No_error" 207 207 | Positive_ack_limit -> "Positive_ack_limit" ··· 260 260 | _ -> None 261 261 262 262 let pp_checksum_type fmt t = 263 - Format.fprintf fmt "%s" 263 + Fmt.pf fmt "%s" 264 264 (match t with 265 265 | Checksum_modular -> "Modular" 266 266 | Checksum_crc32 -> "CRC-32" ··· 346 346 | _ -> None 347 347 348 348 let pp_directive_code fmt c = 349 - Format.fprintf fmt "%s" 349 + Fmt.pf fmt "%s" 350 350 (match c with 351 351 | Dir_eof -> "EOF" 352 352 | Dir_finished -> "Finished" ··· 374 374 } 375 375 376 376 let pp_header fmt h = 377 - Format.fprintf fmt 377 + Fmt.pf fmt 378 378 "{ver=%d; type=%s; dir=%s; mode=%s; crc=%b; large=%b; src=%a; seq=%Ld; \ 379 379 dst=%a; len=%d}" 380 380 h.version ··· 401 401 { condition; checksum; file_size; fault_location } 402 402 403 403 let pp_eof fmt e = 404 - Format.fprintf fmt "{cond=%a; checksum=0x%lx; size=%Ld}" pp_condition 405 - e.condition e.checksum e.file_size 404 + Fmt.pf fmt "{cond=%a; checksum=0x%lx; size=%Ld}" pp_condition e.condition 405 + e.checksum e.file_size 406 406 407 407 type filestore_response = { 408 408 action_code : int; ··· 425 425 { condition; delivery_code; file_status; filestore_responses; fault_location } 426 426 427 427 let pp_finished fmt f = 428 - Format.fprintf fmt "{cond=%a; delivery=%s; status=%s}" pp_condition 429 - f.condition 428 + Fmt.pf fmt "{cond=%a; delivery=%s; status=%s}" pp_condition f.condition 430 429 (match f.delivery_code with 431 430 | Data_complete -> "Complete" 432 431 | Data_incomplete -> "Incomplete") ··· 447 446 { directive; subtype; condition; transaction_status } 448 447 449 448 let pp_ack fmt a = 450 - Format.fprintf fmt "{dir=%a; subtype=%d; cond=%a}" pp_directive_code 451 - a.directive a.subtype pp_condition a.condition 449 + Fmt.pf fmt "{dir=%a; subtype=%d; cond=%a}" pp_directive_code a.directive 450 + a.subtype pp_condition a.condition 452 451 453 452 type filestore_request = { 454 453 action_code : int; ··· 480 479 } 481 480 482 481 let pp_metadata fmt m = 483 - Format.fprintf fmt "{closure=%b; checksum=%a; size=%Ld; src=%S; dst=%S}" 482 + Fmt.pf fmt "{closure=%b; checksum=%a; size=%Ld; src=%S; dst=%S}" 484 483 m.closure_requested pp_checksum_type m.checksum_type m.file_size 485 484 m.source_filename m.dest_filename 486 485 ··· 497 496 let nak ~start_scope ~end_scope segments = { start_scope; end_scope; segments } 498 497 499 498 let pp_nak fmt n = 500 - Format.fprintf fmt "{scope=[%Ld,%Ld]; reqs=%d}" n.start_scope n.end_scope 499 + Fmt.pf fmt "{scope=[%Ld,%Ld]; reqs=%d}" n.start_scope n.end_scope 501 500 (List.length n.segments) 502 501 503 502 type prompt_response = Prompt_nak | Prompt_keep_alive ··· 506 505 let prompt response = { response } 507 506 508 507 let pp_prompt fmt p = 509 - Format.fprintf fmt "{resp=%s}" 508 + Fmt.pf fmt "{resp=%s}" 510 509 (match p.response with 511 510 | Prompt_nak -> "NAK" 512 511 | Prompt_keep_alive -> "Keep_alive") ··· 514 513 type keep_alive = { progress : int64 } 515 514 516 515 let keep_alive progress = { progress } 517 - let pp_keep_alive fmt k = Format.fprintf fmt "{progress=%Ld}" k.progress 516 + let pp_keep_alive fmt k = Fmt.pf fmt "{progress=%Ld}" k.progress 518 517 519 518 (* {1 File Data PDU} *) 520 519