Fixing a bunch of compiler warnings.

This commit is contained in:
Robin Sommer 2011-10-06 17:46:47 -07:00
parent f1ae48ea53
commit b790856a40
7 changed files with 10 additions and 9 deletions

View file

@ -663,7 +663,7 @@ void BroFile::InitEncrypt(const char* keyfile)
unsigned char secret[EVP_PKEY_size(pub_key)]; unsigned char secret[EVP_PKEY_size(pub_key)];
unsigned char* psecret = secret; unsigned char* psecret = secret;
unsigned long secret_len; unsigned int secret_len;
int iv_len = EVP_CIPHER_iv_length(cipher_type); int iv_len = EVP_CIPHER_iv_length(cipher_type);
unsigned char iv[iv_len]; unsigned char iv[iv_len];

View file

@ -324,6 +324,7 @@ private:
PeerID current_id; PeerID current_id;
char current_msgtype; char current_msgtype;
ChunkedIO::Chunk* current_args; ChunkedIO::Chunk* current_args;
double last_flush;
id_list sync_ids; id_list sync_ids;

View file

@ -1145,7 +1145,7 @@ Packet* Packet::Unserialize(UnserialInfo* info)
if ( ! info->s->Read((char**) &tag, 0, "tag") ) if ( ! info->s->Read((char**) &tag, 0, "tag") )
return 0; return 0;
u_char* pkt; char* pkt;
int caplen; int caplen;
if ( ! info->s->Read((char**) &pkt, &caplen, "data") ) if ( ! info->s->Read((char**) &pkt, &caplen, "data") )
{ {
@ -1155,7 +1155,7 @@ Packet* Packet::Unserialize(UnserialInfo* info)
hdr->caplen = uint32(caplen); hdr->caplen = uint32(caplen);
p->hdr = hdr; p->hdr = hdr;
p->pkt = pkt; p->pkt = (u_char*) pkt;
p->tag = tag; p->tag = tag;
p->hdr_size = get_link_header_size(p->link_type); p->hdr_size = get_link_header_size(p->link_type);

View file

@ -1052,7 +1052,7 @@ Connection* NetSessions::NewConn(HashKey* k, double t, const ConnID* id,
int flags = 0; int flags = 0;
// Hmm... This is not great. // Hmm... This is not great.
TransportProto tproto; TransportProto tproto = TRANSPORT_UNKNOWN;
switch ( proto ) { switch ( proto ) {
case IPPROTO_ICMP: case IPPROTO_ICMP:
tproto = TRANSPORT_ICMP; tproto = TRANSPORT_ICMP;

View file

@ -2497,7 +2497,7 @@ bool TableVal::DoSerialize(SerialInfo* info) const
IterCookie* c; IterCookie* c;
TableEntryVal* v; // current value TableEntryVal* v; // current value
bool did_index; // already wrote the val's index bool did_index; // already wrote the val's index
}* state; }* state = 0;
PDict(TableEntryVal)* tbl = PDict(TableEntryVal)* tbl =
const_cast<TableVal*>(this)->AsNonConstTable(); const_cast<TableVal*>(this)->AsNonConstTable();

View file

@ -434,7 +434,7 @@ nb_dns_activity(struct nb_dns_info *nd, struct nb_dns_result *nr, char *errstr)
register char **ap, **hap; register char **ap, **hap;
register u_int16_t id; register u_int16_t id;
register const u_char *rdata; register const u_char *rdata;
register u_int32_t rttl; register u_int32_t rttl = 0; // make compiler happy.
register struct hostent *he; register struct hostent *he;
register size_t rdlen; register size_t rdlen;
ns_msg handle; ns_msg handle;

View file

@ -268,21 +268,21 @@ refine connection SSL_Conn += {
int num_ext = X509_get_ext_count(pTemp); int num_ext = X509_get_ext_count(pTemp);
for ( int k = 0; k < num_ext; ++k ) for ( int k = 0; k < num_ext; ++k )
{ {
char *pBuffer = 0; unsigned char *pBuffer = 0;
int length = 0; int length = 0;
X509_EXTENSION* ex = X509_get_ext(pTemp, k); X509_EXTENSION* ex = X509_get_ext(pTemp, k);
if (ex) if (ex)
{ {
ASN1_STRING *pString = X509_EXTENSION_get_data(ex); ASN1_STRING *pString = X509_EXTENSION_get_data(ex);
length = ASN1_STRING_to_UTF8((unsigned char**)&pBuffer, pString); length = ASN1_STRING_to_UTF8(&pBuffer, pString);
//i2t_ASN1_OBJECT(&pBuffer, length, obj) //i2t_ASN1_OBJECT(&pBuffer, length, obj)
// -1 indicates an error. // -1 indicates an error.
if ( length < 0 ) if ( length < 0 )
continue; continue;
StringVal* value = new StringVal(length, pBuffer); StringVal* value = new StringVal(length, (char*)pBuffer);
BifEvent::generate_x509_extension(bro_analyzer(), BifEvent::generate_x509_extension(bro_analyzer(),
bro_analyzer()->Conn(), value); bro_analyzer()->Conn(), value);
OPENSSL_free(pBuffer); OPENSSL_free(pBuffer);