Fix compile warnings on Solaris (gcc 4.4)

This commit is contained in:
Andrew Bettison 2012-11-28 14:13:25 +10:30
parent 00e1a59ca8
commit c4b90a108b
3 changed files with 12 additions and 7 deletions

View File

@ -327,9 +327,9 @@ overlay_interface_read_any(struct sched_ent *alarm){
/* We have a frame from this interface */
if (debug&DEBUG_PACKETRX)
DEBUG_packet_visualise("Read from real interface", packet,plen);
if (debug&DEBUG_OVERLAYINTERFACES)
if (debug&DEBUG_OVERLAYINTERFACES)
DEBUGF("Received %d bytes from %s on interface %s (ANY)",plen,
inet_ntoa(((struct sockaddr_in *)&src_addr)->sin_addr),
inet_ntoa(src),
interface->name);
if (packetOk(interface,packet,plen,NULL,recvttl,&src_addr,addrlen,1)) {
WHY("Malformed packet");
@ -587,10 +587,12 @@ static void overlay_interface_poll(struct sched_ent *alarm)
/* We have a frame from this interface */
if (debug&DEBUG_PACKETRX)
DEBUG_packet_visualise("Read from real interface", packet,plen);
if (debug&DEBUG_OVERLAYINTERFACES)
DEBUGF("Received %d bytes from %s on interface %s",plen,
inet_ntoa(((struct sockaddr_in *)&src_addr)->sin_addr),
if (debug&DEBUG_OVERLAYINTERFACES) {
struct in_addr src = ((struct sockaddr_in *)&src_addr)->sin_addr; // avoid strict-alias warning on Solaris (gcc 4.4)
DEBUGF("Received %d bytes from %s on interface %s",plen,
inet_ntoa(src),
interface->name);
}
if (packetOk(interface,packet,plen,NULL,recvttl,&src_addr,addrlen,1)) {
WHY("Malformed packet");
// Do we really want to attempt to parse it again?

View File

@ -352,8 +352,10 @@ sqlite3_stmt *_sqlite_prepare(struct __sourceloc __whence, sqlite_retry_state *r
sqlite3_stmt *_sqlite_prepare_loglevel(struct __sourceloc __whence, int log_level, sqlite_retry_state *retry, strbuf stmt)
{
sqlite3_stmt *statement = NULL;
if (strbuf_overrun(stmt))
return WHYFNULL("SQL overrun: %s", strbuf_str(stmt));
if (strbuf_overrun(stmt)) {
WHYF("SQL overrun: %s", strbuf_str(stmt));
return NULL;
}
if (!rhizome_db && rhizome_opendb() == -1)
return NULL;
while (1) {

1
str.h
View File

@ -23,6 +23,7 @@
#include <string.h>
#include <sys/types.h>
#include <ctype.h>
#include <alloca.h>
#ifndef __STR_INLINE
# if __GNUC__ && !__GNUC_STDC_INLINE__