Reputation: 3090
I'm trying to use a circular buffer like the one mentioned in this post: https://stackoverflow.com/a/827749
When I need to push and pop things to the buffer I find myself doing something like this all the time:
int data;
int *data_ptr = &data;
cb_pop(spi_buffer, data_ptr);
Is this the best (probably not) way to do this? How would you do it?
Thanks
Upvotes: 0
Views: 184
Reputation: 137312
Why won't you just do:
int data;
cb_pop(spi_buffer, &data);
the creation of another pointer variable is redundant.
Upvotes: 3