Add warning to buffer.h
This commit is contained in:
parent
b9b910439a
commit
028638ee84
5
buffer.c
5
buffer.c
|
@ -239,7 +239,7 @@ short b_setmark(Buffer* const pBD, short mark) {
|
||||||
- pBuffer const pBD
|
- pBuffer const pBD
|
||||||
* Return value: 1, 0
|
* Return value: 1, 0
|
||||||
*/
|
*/
|
||||||
int b_eob(Buffer* const pBD) {
|
int b_eob(Buffer* const pBD) {
|
||||||
if (!pBD) { return R_FAIL1; }
|
if (!pBD) { return R_FAIL1; }
|
||||||
return pBD->eob;
|
return pBD->eob;
|
||||||
}
|
}
|
||||||
|
@ -356,12 +356,13 @@ char b_getc(Buffer* const pBD) {
|
||||||
int b_print(Buffer* const pBD) {
|
int b_print(Buffer* const pBD) {
|
||||||
int char_count = 0; /* Counter to track how many characters were sent to output */
|
int char_count = 0; /* Counter to track how many characters were sent to output */
|
||||||
char char_buf; /* "Buffer" character to load before output */
|
char char_buf; /* "Buffer" character to load before output */
|
||||||
short tmp_offset = pBD->getc_offset;
|
short tmp_offset = OFFSET_RESET;
|
||||||
|
|
||||||
if (!pBD || !pBD->cb_head) { return R_FAIL1; }
|
if (!pBD || !pBD->cb_head) { return R_FAIL1; }
|
||||||
|
|
||||||
if (b_isempty(pBD) == TRUE) { printf("The Buffer is empty.\n"); }
|
if (b_isempty(pBD) == TRUE) { printf("The Buffer is empty.\n"); }
|
||||||
else {
|
else {
|
||||||
|
tmp_offset = pBD->getc_offset;
|
||||||
pBD->getc_offset = OFFSET_RESET;
|
pBD->getc_offset = OFFSET_RESET;
|
||||||
do {
|
do {
|
||||||
char_buf = b_getc(pBD);
|
char_buf = b_getc(pBD);
|
||||||
|
|
2
buffer.h
2
buffer.h
|
@ -14,7 +14,7 @@
|
||||||
|
|
||||||
/* standard header files */
|
/* standard header files */
|
||||||
#include <stdio.h> /* standard input/output */
|
#include <stdio.h> /* standard input/output */
|
||||||
#include <mm_malloc.h> /* for dynamic memory allocation*/
|
#include <mm_malloc.h> /* for dynamic memory allocation. NOTE: USE MALLOC.H FOR LINUX/WINDOWS.THIS IS FOR MACOS ONLY*/
|
||||||
#include <limits.h> /* implementation-defined data type ranges and limits */
|
#include <limits.h> /* implementation-defined data type ranges and limits */
|
||||||
|
|
||||||
/* constant definitions */
|
/* constant definitions */
|
||||||
|
|
Loading…
Reference in New Issue