Skip to content

Add Cstruct.rev to build a reversed cstruct#221

Merged
avsm merged 3 commits intomirage:masterfrom
emillon:cstruct-rev
Feb 26, 2019
Merged

Add Cstruct.rev to build a reversed cstruct#221
avsm merged 3 commits intomirage:masterfrom
emillon:cstruct-rev

Conversation

@emillon
Copy link
Copy Markdown
Contributor

@emillon emillon commented Feb 22, 2019

It's like List.rev, but for cstructs. Let me know what you think.

@avsm
Copy link
Copy Markdown
Member

avsm commented Feb 22, 2019

looks like it does what it says on the tin! :) happy to merge this

lib/cstruct.mli Outdated
* the result is a newly created [t] in the zero- and one-element cases. *)

val rev: t -> t
(** [rev t] is [t] in reverse order. *)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps clarify that this allocates a fresh [t] and does not mutate the input

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea! Done.

@avsm avsm merged commit 721265e into mirage:master Feb 26, 2019
avsm added a commit to avsm/opam-repository that referenced this pull request Feb 26, 2019
…struct-lwt (3.5.0)

CHANGES:

- Remove trailing spaces in hexdump output (mirage/ocaml-cstruct#219 @emillon)
- Add `Cstruct.rev` to allocate a reversed cstruct (mirage/ocaml-cstruct#221 @emillon)
- `Cstruct_unix` now uses the post-OCaml 4.06 `Unix.map_file`
  instead of the deprecated Bigarray `map_file` that was removed
  in OCaml 4.08 (@avsm, see ocaml/ocaml#2263)
- Remove unnecessary `(wrapped false)` in the build system (@avsm)
- Correct ocamldoc to the right `cstruct-ppx` package pointer (@avsm)
@emillon emillon deleted the cstruct-rev branch March 4, 2019 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants