mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 15:48:19 +00:00
Fix compile errors possible on some platforms.
Include <algorithm> in some sources that require it; addresses #430 Places where STL's min() template function could get used with arguments of differing types can fail to deduce the right template type. These are fixed with some type tweaking of local variables and also giving an explicit template argument for good measure.
This commit is contained in:
parent
cde6076857
commit
35b7caf44f
3 changed files with 10 additions and 4 deletions
|
@ -9,6 +9,8 @@
|
|||
#include <assert.h>
|
||||
#include <openssl/ssl.h>
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include "config.h"
|
||||
#include "ChunkedIO.h"
|
||||
#include "NetVar.h"
|
||||
|
@ -166,13 +168,13 @@ bool ChunkedIOFd::Write(Chunk* chunk)
|
|||
|
||||
// We have to split it up.
|
||||
char* p = chunk->data;
|
||||
unsigned long left = chunk->len;
|
||||
uint32 left = chunk->len;
|
||||
|
||||
while ( left )
|
||||
{
|
||||
Chunk* part = new Chunk;
|
||||
|
||||
part->len = min(BUFFER_SIZE - sizeof(uint32), left);
|
||||
part->len = min<uint32>(BUFFER_SIZE - sizeof(uint32), left);
|
||||
part->data = new char[part->len];
|
||||
memcpy(part->data, p, part->len);
|
||||
left -= part->len;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue