-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
removal of out_fct_wrap_type #32
Comments
I don't exactly follow what you're suggesting:
Please clarify... |
Not the function pointer. Only variables specific to the mode of output. It's difficult for me to explain, but I've already done this on an open PR, you can see the changes there. |
Oh, now I see your PR. But - it's a 44-commit PR; that doesn't make sense. I can't use it without spending hours, or days, on merging. To submit a PR, you start from the branch you're PR'ing against, and only apply one or a few changesets to get the effect you wanted. Anyway, I don't mind using the struct you suggested, which basically a kind of a richer iterator than a raw pointer. I'll try to manually merge that change soon. |
Hmm. This is interesting. This actually gives me the idea of doing something a little differentr:
|
Well, I was going to work on this, but then other issues came up. Now that there are no open bugs, I believe it might be a good idea to pause, make a release (v5.0 I suppose), then get back to this. What do you think, @mickjc750 ? |
I agree, I have some other issues myself at the moment. It's working well enough for now. |
@mickjc750 : So, this is happening... expect a PR soon. It will do away with 4 parameters + the return value in lots of functions :-) |
…entation for all library functions. * Added: An `output_gadget_t` struct * Added: Named constructor idioms for `output_gadget_t`, instead of the function wrappers we have before: For `putchar_()` output, buffer output, discarding/no output, and arbitrary function output. * Implementation functions no longer need to maintain and pass around the parameters `buffer`, `maxlen`, `idx` - these are part of the uniform output gadget * Implementation functions no longer need to increase the position within the output (`idx)`, nor return the increased value to their caller. * No longer need a dummy buffer of size 1, anywhere.
…entation for all library functions. * Added: An `output_gadget_t` struct * Added: Named constructor idioms for `output_gadget_t`, instead of the function wrappers we have before: For `putchar_()` output, buffer output, discarding/no output, and arbitrary function output. * Implementation functions no longer need to maintain and pass around the parameters `buffer`, `maxlen`, `idx` - these are part of the uniform output gadget * Implementation functions no longer need to increase the position within the output (`idx)`, nor return the increased value to their caller. * No longer need a dummy buffer of size 1, anywhere.
…entation for all library functions. * Added: An `output_gadget_t` struct * Added: Named constructor idioms for `output_gadget_t`, instead of the function wrappers we have before: For `putchar_()` output, buffer output, discarding/no output, and arbitrary function output. * Implementation functions no longer need to maintain and pass around the parameters `buffer`, `maxlen`, `idx` - these are part of the uniform output gadget * Implementation functions no longer need to increase the position within the output (`idx)`, nor return the increased value to their caller. * No longer need a dummy buffer of size 1, anywhere.
…entation for all library functions. * Added: An `output_gadget_t` struct * Added: Named constructor idioms for `output_gadget_t`, instead of the function wrappers we have before: For `putchar_()` output, buffer output, discarding/no output, and arbitrary function output. * Implementation functions no longer need to maintain and pass around the parameters `buffer`, `maxlen`, `idx` - these are part of the uniform output gadget * Implementation functions no longer need to increase the position within the output (`idx)`, nor return the increased value to their caller. * No longer need a dummy buffer of size 1, anywhere.
…entation for all library functions. * Added: An `output_gadget_t` struct * Added: Named constructor idioms for `output_gadget_t`, instead of the function wrappers we have before: For `putchar_()` output, buffer output, discarding/no output, and arbitrary function output. * Implementation functions no longer need to maintain and pass around the parameters `buffer`, `maxlen`, `idx` - these are part of the uniform output gadget * Implementation functions no longer need to increase the position within the output (`idx)`, nor return the increased value to their caller. * No longer need a dummy buffer of size 1, anywhere.
…entation for all library functions. Also, this merits a version bump. * Added: An `output_gadget_t` struct * Added: Named constructor idioms for `output_gadget_t`, instead of the function wrappers we have before: For `putchar_()` output, buffer output, discarding/no output, and arbitrary function output. * Implementation functions no longer need to maintain and pass around the parameters `buffer`, `maxlen`, `idx` - these are part of the uniform output gadget * Implementation functions no longer need to increase the position within the output (`idx)`, nor return the increased value to their caller. * No longer need a dummy buffer of size 1, anywhere.
…entation for all library functions. Also, this merits a version bump. * Added: An `output_gadget_t` struct * Added: Named constructor idioms for `output_gadget_t`, instead of the function wrappers we have before: For `putchar_()` output, buffer output, discarding/no output, and arbitrary function output. * Implementation functions no longer need to maintain and pass around the parameters `buffer`, `maxlen`, `idx` - these are part of the uniform output gadget * Implementation functions no longer need to increase the position within the output (`idx)`, nor return the increased value to their caller. * No longer need a dummy buffer of size 1, anywhere.
…entation for all library functions. Also, this merits a version bump. * Added: An `output_gadget_t` struct * Added: Named constructor idioms for `output_gadget_t`, instead of the function wrappers we have before: For `putchar_()` output, buffer output, discarding/no output, and arbitrary function output. * Implementation functions no longer need to maintain and pass around the parameters `buffer`, `maxlen`, `idx` - these are part of the uniform output gadget * Implementation functions no longer need to increase the position within the output (`idx)`, nor return the increased value to their caller. * No longer need a dummy buffer of size 1, anywhere.
…entation for all library functions. Also, this merits a version bump. * Added: An `output_gadget_t` struct * Added: Named constructor idioms for `output_gadget_t`, instead of the function wrappers we have before: For `putchar_()` output, buffer output, discarding/no output, and arbitrary function output. * Implementation functions no longer need to maintain and pass around the parameters `buffer`, `maxlen`, `idx` - these are part of the uniform output gadget * Implementation functions no longer need to increase the position within the output (`idx)`, nor return the increased value to their caller. * No longer need a dummy buffer of size 1, anywhere.
…entation for all library functions. Also, this merits a version bump. * Added: An `output_gadget_t` struct * Added: Named constructor idioms for `output_gadget_t`, instead of the function wrappers we have before: For `putchar_()` output, buffer output, discarding/no output, and arbitrary function output. * Implementation functions no longer need to maintain and pass around the parameters `buffer`, `maxlen`, `idx` - these are part of the uniform output gadget * Implementation functions no longer need to increase the position within the output (`idx)`, nor return the increased value to their caller. * No longer need a dummy buffer of size 1, anywhere.
…entation for all library functions. Also, this merits a version bump. * Added: An `output_gadget_t` struct * Added: Named constructor idioms for `output_gadget_t`, instead of the function wrappers we have before: For `putchar_()` output, buffer output, discarding/no output, and arbitrary function output. * Implementation functions no longer need to maintain and pass around the parameters `buffer`, `maxlen`, `idx` - these are part of the uniform output gadget * Implementation functions no longer need to increase the position within the output (`idx)`, nor return the increased value to their caller. * No longer need a dummy buffer of size 1, anywhere.
…entation for all library functions. Also, this merits a version bump. * Added: An `output_gadget_t` struct * Added: Named constructor idioms for `output_gadget_t`, instead of the function wrappers we have before: For `putchar_()` output, buffer output, discarding/no output, and arbitrary function output. * Implementation functions no longer need to maintain and pass around the parameters `buffer`, `maxlen`, `idx` - these are part of the uniform output gadget * Implementation functions no longer need to increase the position within the output (`idx)`, nor return the increased value to their caller. * No longer need a dummy buffer of size 1, anywhere.
…entation for all library functions. Also, this merits a version bump. * Added: An `output_gadget_t` struct * Added: Named constructor idioms for `output_gadget_t`, instead of the function wrappers we have before: For `putchar_()` output, buffer output, discarding/no output, and arbitrary function output. * Implementation functions no longer need to maintain and pass around the parameters `buffer`, `maxlen`, `idx` - these are part of the uniform output gadget * Implementation functions no longer need to increase the position within the output (`idx)`, nor return the increased value to their caller. * No longer need a dummy buffer of size 1, anywhere.
…entation for all library functions. Also, this merits a version bump. * Added: An `output_gadget_t` struct * Added: Named constructor idioms for `output_gadget_t`, instead of the function wrappers we have before: For `putchar_()` output, buffer output, discarding/no output, and arbitrary function output. * Implementation functions no longer need to maintain and pass around the parameters `buffer`, `maxlen`, `idx` - these are part of the uniform output gadget * Implementation functions no longer need to increase the position within the output (`idx)`, nor return the increased value to their caller. * No longer need a dummy buffer of size 1, anywhere.
This wrapper exists, as a means of passing a function pointer and a null pointer, from the interface function all the way down to the character output function, which itself is a function pointer based on the output mode. This is needed to provide fctprintf().
A better approach, is to instantiate a variable set (struct) particular to the output mode in the interface function. Then pass this by reference through to the character output function.
This makes the character output function the same format (void (out)(char, void)) as that used by fctprintf().
This removes the need for a double function pointer de-reference per character which is a performance boost.
It also removes the need to pass the 'maxlen' parameter to most of the functions, where for most output modes it is unused.
The text was updated successfully, but these errors were encountered: