Skip to content
This repository has been archived by the owner on Mar 18, 2021. It is now read-only.

Added function pointer-based support for GAPS channels. Removed case … #80

Merged
merged 3 commits into from
Jun 10, 2020

Conversation

vitalytka
Copy link
Contributor

Replaced case statements in libpirate primitives with function pointers

@vitalytka vitalytka requested a review from mspiegel June 9, 2020 20:32
@mspiegel
Copy link
Contributor

I made a branch with a few changes:

  • moves pirate_channel_funcs_t declaration out of libpirate.h. libpirate.h is the public-facing header file with the declaration that libpirate users will need.
  • keep INVALID type as the 0 value. I don't want uses accidentally specifying a DEVICE type because they used the 0 value by accident.
  • Remove gaps_channel_funcs constructor and replace with static initialization. I'd prefer not to use the C constructor functionality.

Take a look at #81 and see if it's ok to merge.

mspiegel and others added 2 commits June 10, 2020 15:20
* Replace channel_funcs constructor with level of indirection

* Simplify channel functions

* Invert tests for pirate_channel_type_valid

Co-authored-by: Michael Spiegel <michael.spiegel@twosixlabs.com>
@mspiegel mspiegel merged commit 4e8fb84 into master Jun 10, 2020
@mspiegel mspiegel deleted the vitaly/optimization branch October 15, 2020 12:40
@mspiegel mspiegel restored the vitaly/optimization branch October 15, 2020 12:40
@joehendrix joehendrix deleted the vitaly/optimization branch February 26, 2021 01:32
mspiegel referenced this pull request in mspiegel/pirate Mar 3, 2021
* Added function pointer-based support for GAPS channels. Removed case statements in libpirate primitives.

* Remove constructor from PR 80 (#81)

* Replace channel_funcs constructor with level of indirection

* Simplify channel functions

* Invert tests for pirate_channel_type_valid

Co-authored-by: Michael Spiegel <michael.spiegel@twosixlabs.com>

* Add 'static' modifier deleted by accident

Co-authored-by: Vitaly Tkachuk <vitaly.tkachuk@invincea.com>
Co-authored-by: Michael Spiegel <michael.m.spiegel@gmail.com>
Co-authored-by: Michael Spiegel <michael.spiegel@twosixlabs.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants