Skip to content
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

Initialize linear buffer from void pointer. #94

Merged
merged 1 commit into from
Feb 21, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Initialize linear buffer from void pointer.
This is more flexible and avoids an unnecessary cast when interoperating with code which expects strings to be char arrays rather than unsigned char arrays.
  • Loading branch information
mikepurvis committed Feb 19, 2015
commit 93c367be3b9420ee122fed41d69b329a7f4b5567
4 changes: 2 additions & 2 deletions lib/include/stream/BufferedInputOutputStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ namespace stm32plus {
* @param[in] size The size of the caller supplied buffer
*/

BufferedInputOutputStream(uint8_t *buffer,uint32_t size) {
_readPtr=_writePtr=_buffer=buffer;
BufferedInputOutputStream(void *buffer,uint32_t size) {
_readPtr=_writePtr=_buffer=static_cast<uint8_t*>(buffer);
_bufferSize=size;
_needToFree=false;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/include/stream/LinearBufferInputOutputStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace stm32plus {

// constructors

LinearBufferInputOutputStream(uint8_t *buffer,uint32_t size);
LinearBufferInputOutputStream(void *buffer,uint32_t size);
LinearBufferInputOutputStream(uint32_t initialSize);

void resetOutput();
Expand Down
2 changes: 1 addition & 1 deletion lib/src/stream/LinearBufferInputOutputStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace stm32plus {
* @param size
*/

LinearBufferInputOutputStream::LinearBufferInputOutputStream(uint8_t *buffer,uint32_t size)
LinearBufferInputOutputStream::LinearBufferInputOutputStream(void *buffer,uint32_t size)
: BufferedInputOutputStream(buffer,size) {
}

Expand Down