Removal of the --enable-int64 config option.

This will now be always on.  As such, uses of the USE_INT64 preprocessor
definition have been cleaned out.
This commit is contained in:
Jon Siwek 2010-10-19 12:39:20 -05:00
parent 5cad4c8789
commit 13569aaab7
11 changed files with 2 additions and 66 deletions

View file

@ -27,9 +27,6 @@ set(DATADIR share/bro
set(BROv6 false
CACHE STRING "enable IPv6 processing" FORCE)
set(USE_INT64 true
CACHE STRING "enable use of int64 (long long) for integers" FORCE)
# TODO: add to configure wrapper as '--enable-debug'
# TODO: make this option do stuff
set(ENABLE_DEBUG false

View file

@ -183,9 +183,6 @@
/* GeoIP geographic lookup functionality */
#undef USE_GEOIP
/* enable use of 64-bit integers */
#cmakedefine USE_INT64
/* Use libclamav */
#undef USE_LIBCLAMAV

View file

@ -8,13 +8,8 @@
#include <sys/types.h>
#include <regex.h>
#ifdef USE_INT64
# define FMT_INT "%lld"
# define FMT_UINT "%llu"
#else
# define FMT_INT "%d"
# define FMT_UINT "%u"
#endif
static TableType* bt_tracker_headers = 0;
static RecordType* bittorrent_peer;

View file

@ -105,7 +105,6 @@ void ODesc::Add(uint32 u)
}
}
#ifdef USE_INT64
void ODesc::Add(int64 i)
{
if ( IsBinary() )
@ -129,7 +128,6 @@ void ODesc::Add(uint64 u)
Add(tmp);
}
}
#endif
void ODesc::Add(double d)
{

View file

@ -57,10 +57,8 @@ public:
void AddN(const char* s, int len) { AddBytes(s, len); }
void Add(int i);
void Add(uint32 u);
#ifdef USE_INT64
void Add(int64 i);
void Add(uint64 u);
#endif
void Add(double d);
// Add s as a counted string.

View file

@ -237,8 +237,6 @@ HashKey::HashKey(bro_uint_t u)
is_our_dynamic = 0;
}
#ifdef USE_INT64
HashKey::HashKey(uint32 u)
{
key_u.u32 = u;
@ -248,8 +246,6 @@ HashKey::HashKey(uint32 u)
is_our_dynamic = 0;
}
#endif // USE_INT64
HashKey::HashKey(const uint32 u[], int n)
{
size = n * sizeof(u[0]);

View file

@ -24,9 +24,7 @@ class HashKey {
public:
HashKey(bro_int_t i);
HashKey(bro_uint_t u);
#ifdef USE_INT64
HashKey(uint32 u);
#endif
HashKey(const uint32 u[], int n);
HashKey(double d);
HashKey(const void* p);
@ -78,9 +76,7 @@ protected:
union {
bro_int_t i;
#ifdef USE_INT64
uint32 u32;
#endif
double d;
const void* p;
} key_u;

View file

@ -161,8 +161,6 @@ bro_int_t TCP_Endpoint::Size() const
{
bro_int_t size;
#ifdef USE_INT64
uint64 last_seq_64 = (uint64(last_seq_high) << 32) | last_seq;
uint64 ack_seq_64 = (uint64(ack_seq_high) << 32) | ack_seq;
if ( last_seq_64 > ack_seq_64 )
@ -170,26 +168,6 @@ bro_int_t TCP_Endpoint::Size() const
else
size = ack_seq_64 - start_seq;
#else
if ( seq_delta(last_seq, ack_seq) > 0 || ack_seq == start_seq + 1 )
// Either last_seq corresponds to more data sent than we've
// seen ack'd, or we haven't seen any data ack'd (in which
// case we should trust last_seq anyway). This last test
// matters for the case in which the connection has
// transferred > 2 GB of data, in which case we will find
// seq_delta(last_seq, ack_seq) < 0 even if ack_seq
// corresponds to no data transferred.
size = last_seq - start_seq;
else
// It could be that ack_seq > last_seq, if we've seen an
// ack for the connection (say in a FIN) without seeing
// the corresponding data.
size = ack_seq - start_seq;
#endif
// Don't include SYN octet in sequence space. For partial connections
// (no SYN seen), we're still careful to adjust start_seq as though
// there was an initial SYN octet, because if we don't then the

View file

@ -127,7 +127,6 @@ public:
#endif
}
#ifdef USE_INT64
Val(int64 i, TypeTag t)
{
val.int_val = i;
@ -147,7 +146,6 @@ public:
bound_id = 0;
#endif
}
#endif // USE_INT64
Val(double d, TypeTag t)
{

View file

@ -222,25 +222,15 @@ static void do_fmt(const char*& fmt, Val* v, ODesc* d)
u = ntohl(uint32(u));
}
#ifdef USE_INT64
snprintf(fmt_buf, sizeof(fmt_buf), "%%%s%s", num_fmt,
*fmt == 'd' ? "llu" : "llx");
#else
snprintf(fmt_buf, sizeof(fmt_buf), "%%%s%c", num_fmt,
*fmt == 'd' ? 'u' : 'x');
#endif
snprintf(out_buf, sizeof(out_buf), fmt_buf, u);
}
else
{
#ifdef USE_INT64
snprintf(fmt_buf, sizeof(fmt_buf), "%%%s%s", num_fmt,
*fmt == 'd' ? "lld" : "llx");
#else
snprintf(fmt_buf, sizeof(fmt_buf), "%%%s%c", num_fmt,
*fmt == 'd' ? 'd' : 'x');
#endif
snprintf(out_buf, sizeof(out_buf), fmt_buf,
v->CoerceToInt());
}

View file

@ -44,15 +44,8 @@ typedef unsigned int uint32;
typedef unsigned short uint16;
typedef unsigned char uint8;
typedef long long int int64;
#ifdef USE_INT64
typedef int64 bro_int_t;
typedef uint64 bro_uint_t;
#else
typedef int bro_int_t;
typedef uint32 bro_uint_t;
// # error "USE_INT64 not defined!"
#endif
typedef int64 bro_int_t;
typedef uint64 bro_uint_t;
#if SIZEOF_LONG_LONG == 8
typedef unsigned long long uint64;