diff --git a/BuildOptions.cmake b/BuildOptions.cmake index 168bd5527d..b4f33736ab 100644 --- a/BuildOptions.cmake +++ b/BuildOptions.cmake @@ -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 diff --git a/config.h.in b/config.h.in index e633e7f091..7d55d001b4 100644 --- a/config.h.in +++ b/config.h.in @@ -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 diff --git a/src/BitTorrentTracker.cc b/src/BitTorrentTracker.cc index be72a17d26..50f6d0449c 100644 --- a/src/BitTorrentTracker.cc +++ b/src/BitTorrentTracker.cc @@ -8,13 +8,8 @@ #include #include -#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; diff --git a/src/Desc.cc b/src/Desc.cc index 0a494bcd9c..baf3ad1160 100644 --- a/src/Desc.cc +++ b/src/Desc.cc @@ -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) { diff --git a/src/Desc.h b/src/Desc.h index de09f12be4..49b331d51b 100644 --- a/src/Desc.h +++ b/src/Desc.h @@ -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. diff --git a/src/Hash.cc b/src/Hash.cc index 47216a8d9d..ef8b2a61cf 100644 --- a/src/Hash.cc +++ b/src/Hash.cc @@ -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]); diff --git a/src/Hash.h b/src/Hash.h index 5ed41b05e9..fa1f00f91f 100644 --- a/src/Hash.h +++ b/src/Hash.h @@ -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; diff --git a/src/TCP_Endpoint.cc b/src/TCP_Endpoint.cc index 826c7f5636..6cb52f1f03 100644 --- a/src/TCP_Endpoint.cc +++ b/src/TCP_Endpoint.cc @@ -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 diff --git a/src/Val.h b/src/Val.h index 925015c9c1..5a2faee9d7 100644 --- a/src/Val.h +++ b/src/Val.h @@ -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) { diff --git a/src/bro.bif b/src/bro.bif index a4111bb041..8dace1247d 100644 --- a/src/bro.bif +++ b/src/bro.bif @@ -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()); } diff --git a/src/util.h b/src/util.h index 96aeb761e1..f4f007a27d 100644 --- a/src/util.h +++ b/src/util.h @@ -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;