Skip to content
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
6 changes: 5 additions & 1 deletion src/c_buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
#define LOG(f_, ...) printf((f_), ##__VA_ARGS__)
#endif

#ifndef LOG_DEBUG
#define LOG_DEBUG(f_, ...)// printf((f_), ##__VA_ARGS__)
#endif

static inline size_t MODULO_DEC(size_t value, size_t decrement, size_t modulus)
{
return (value + modulus - (decrement % modulus)) % modulus;
Expand Down Expand Up @@ -381,7 +385,7 @@ uint8_t cBufferReadByte(cBuffer_t *inst) {

// Protect from empty buffers
if (cBufferEmpty(inst)) {
LOG("Reading from empty buffer!\n");
LOG_DEBUG("Reading from empty buffer!\n");
return 0;
}

Expand Down
8 changes: 8 additions & 0 deletions src/c_buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,13 @@
* SOFTWARE.
*/


#ifndef C_BUFFER_H
#define C_BUFFER_H
#ifdef __cplusplus
extern "C" {
#endif


#include <stdint.h>
#include <stddef.h>
Expand Down Expand Up @@ -222,4 +227,7 @@ int32_t cBufferEmptyWrite(cBuffer_t* inst, size_t num_bytes);
*/
int32_t cBufferEmptyRead(cBuffer_t* inst, size_t num_bytes);

#ifdef __cplusplus
}
#endif
#endif /* C_BUFFER_H */