binpac: Replace u_char usages with unsigned char

Improve Alpine (musl) support by not relying on the (technically)
non-standard u_char typedef.
This commit is contained in:
Jon Siwek 2018-11-30 19:22:15 -06:00 committed by Tim Wojtulewicz
parent 46e2490cb0
commit 1d750aa164
5 changed files with 15 additions and 15 deletions

View file

@ -12,8 +12,8 @@ namespace binpac {
extern double network_time();
namespace {
const u_char CR = '\r';
const u_char LF = '\n';
const unsigned char CR = '\r';
const unsigned char LF = '\n';
}
FlowBuffer::FlowBuffer(LineBreakStyle linebreak_style)
@ -108,10 +108,10 @@ void FlowBuffer::ExpandBuffer(int length)
// Allocate a new buffer and copy the existing contents
buffer_length_ = length;
u_char *new_buf = (u_char *) realloc(buffer_, buffer_length_);
unsigned char* new_buf = (unsigned char *) realloc(buffer_, buffer_length_);
BINPAC_ASSERT(new_buf);
#if 0
u_char* new_buf = new u_char[buffer_length_];
unsigned char* new_buf = new unsigned char[buffer_length_];
if ( buffer_ && buffer_n_ > 0 )
memcpy(new_buf, buffer_, buffer_n_);
delete [] buffer_;
@ -119,7 +119,7 @@ void FlowBuffer::ExpandBuffer(int length)
buffer_ = new_buf;
}
void FlowBuffer::SetLineBreaker(u_char *lbreaker)
void FlowBuffer::SetLineBreaker(unsigned char* lbreaker)
{
linebreaker_ = *lbreaker;
linebreak_style_default = linebreak_style_;