mirror of
https://github.com/zeek/zeek.git
synced 2025-10-05 16:18:19 +00:00
Fix compiler warnings
These changes eliminate 405 of 571 warnings seen on OS X 10.7.4 with clang.
This commit is contained in:
parent
c0bbd78ee1
commit
7f4b0b52f8
11 changed files with 15 additions and 15 deletions
|
@ -96,7 +96,7 @@ EventHandler* EventHandler::Unserialize(UnserialInfo* info)
|
|||
{
|
||||
char* name;
|
||||
if ( ! UNSERIALIZE_STR(&name, 0) )
|
||||
return false;
|
||||
return 0;
|
||||
|
||||
EventHandler* h = event_registry->Lookup(name);
|
||||
if ( ! h )
|
||||
|
|
|
@ -100,7 +100,7 @@ Func* Func::Unserialize(UnserialInfo* info)
|
|||
if ( ! (id->HasVal() && id->ID_Val()->Type()->Tag() == TYPE_FUNC) )
|
||||
{
|
||||
info->s->Error(fmt("ID %s is not a built-in", name));
|
||||
return false;
|
||||
return 0;
|
||||
}
|
||||
|
||||
Unref(f);
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
class IncrementalSendTimer;
|
||||
|
||||
namespace threading {
|
||||
class Field;
|
||||
class Value;
|
||||
struct Field;
|
||||
struct Value;
|
||||
}
|
||||
|
||||
// This class handles the communication done in Bro's main loop.
|
||||
|
|
|
@ -368,7 +368,7 @@ int SMB_Session::ParseSetupAndx(int is_orig, binpac::SMB::SMB_header const& hdr,
|
|||
// The binpac type depends on the negotiated server settings -
|
||||
// possibly we can just pick the "right" format here, and use that?
|
||||
|
||||
if ( hdr.flags2() && 0x0800 )
|
||||
if ( hdr.flags2() & 0x0800 )
|
||||
{
|
||||
binpac::SMB::SMB_setup_andx_ext msg(hdr.unicode());
|
||||
msg.Parse(body.data(), body.data() + body.length());
|
||||
|
|
|
@ -163,7 +163,7 @@ SerialObj* SerialObj::Unserialize(UnserialInfo* info, SerialType type)
|
|||
if ( ! result )
|
||||
{
|
||||
DBG_POP(DBG_SERIAL);
|
||||
return false;
|
||||
return 0;
|
||||
}
|
||||
|
||||
DBG_POP(DBG_SERIAL);
|
||||
|
|
|
@ -18,7 +18,7 @@ struct pcap_pkthdr;
|
|||
|
||||
class EncapsulationStack;
|
||||
class Connection;
|
||||
class ConnID;
|
||||
struct ConnID;
|
||||
class OSFingerprint;
|
||||
class ConnCompressor;
|
||||
|
||||
|
|
|
@ -910,7 +910,7 @@ Val* RecordType::FieldDefault(int field) const
|
|||
const TypeDecl* td = FieldDecl(field);
|
||||
|
||||
if ( ! td->attrs )
|
||||
return false;
|
||||
return 0;
|
||||
|
||||
const Attr* def_attr = td->attrs->FindAttr(ATTR_DEFAULT);
|
||||
|
||||
|
|
|
@ -232,7 +232,7 @@ Value* Ascii::EntryToVal(string s, FieldMapping field)
|
|||
{
|
||||
Error(Fmt("Field: %s Invalid value for boolean: %s",
|
||||
field.name.c_str(), s.c_str()));
|
||||
return false;
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -262,7 +262,7 @@ Value* Ascii::EntryToVal(string s, FieldMapping field)
|
|||
if ( pos == s.npos )
|
||||
{
|
||||
Error(Fmt("Invalid value for subnet: %s", s.c_str()));
|
||||
return false;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int width = atoi(s.substr(pos+1).c_str());
|
||||
|
|
|
@ -983,7 +983,7 @@ WriterFrontend* Manager::CreateWriter(EnumVal* id, EnumVal* writer, const Writer
|
|||
|
||||
if ( ! stream )
|
||||
// Don't know this stream.
|
||||
return false;
|
||||
return 0;
|
||||
|
||||
Stream::WriterMap::iterator w =
|
||||
stream->writers.find(Stream::WriterPathPair(writer->AsEnum(), info.path));
|
||||
|
|
|
@ -295,7 +295,7 @@ refine connection SSL_Conn += {
|
|||
for ( int k = 0; k < num_ext; ++k )
|
||||
{
|
||||
unsigned char *pBuffer = 0;
|
||||
uint length = 0;
|
||||
int length = 0;
|
||||
|
||||
X509_EXTENSION* ex = X509_get_ext(pTemp, k);
|
||||
if (ex)
|
||||
|
@ -303,7 +303,7 @@ refine connection SSL_Conn += {
|
|||
ASN1_STRING *pString = X509_EXTENSION_get_data(ex);
|
||||
length = ASN1_STRING_to_UTF8(&pBuffer, pString);
|
||||
//i2t_ASN1_OBJECT(&pBuffer, length, obj)
|
||||
// printf("extension length: %u\n", length);
|
||||
// printf("extension length: %d\n", length);
|
||||
// -1 indicates an error.
|
||||
if ( length < 0 )
|
||||
continue;
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
#ifndef THREADING_SERIALIZATIONTYPES_H
|
||||
#define THREADING_SERIALIZATIONTYPES_H
|
||||
|
||||
using namespace std;
|
||||
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
|
@ -11,6 +9,8 @@ using namespace std;
|
|||
#include "Type.h"
|
||||
#include "net_util.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
class SerializationFormat;
|
||||
|
||||
namespace threading {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue