Commit graph

99 commits

Author SHA1 Message Date
Tim Wojtulewicz
64332ca22c Move all Val classes to the zeek namespaces 2020-06-30 20:48:09 -07:00
Tim Wojtulewicz
ec9eff0bd5 Use type aliases for IntrusivePtr definitions 2020-06-30 20:37:30 -07:00
Tim Wojtulewicz
9364e6a5b7 Move IntrusivePtr and utility methods to the zeek namespace 2020-06-30 20:19:12 -07:00
Tim Wojtulewicz
e1338cc379 GH-1034: Revert TypeList::Types() back to return a type_list* and mark it deprecated 2020-06-29 17:50:09 -07:00
Jon Siwek
d4f3cad7d1 Merge remote-tracking branch 'origin/topic/timw/266-namespaces'
Merge adjustments:

- Preserved original `base_type_no_ref` argument type as ::TypeTag
- Removed superfluous #pragma guard around deprecated TableVal ctor
- Clarify NEWS regarding MetaHook{Pre,Post} deprecations
- Simplify some `::zeek::` qualifications to just `zeek::`
- Prefixed FORWARD_DECLARE_NAMESPACED macro with ZEEK_

* origin/topic/timw/266-namespaces:
  Disable some deprecation diagnostics for GCC
  Rename BroType to Type
  Update NEWS
  Review cleanup
  Move Type types to zeek namespace
  Move Flare/Pipe from the bro namespace to zeek::detail
  Move Attr to the zeek::detail namespace
  Move Trigger into the zeek::detail namespace
  Move ID to the zeek::detail namespace
  Move Anon.h into zeek::detail namespace
  Mark all of the aliased classes in plugin/Plugin.h deprecated, and fix all of the plugins that were using them
  Move all of the base plugin classes into the zeek::plugin namespace
  Expr: move all classes into zeek::detail
  Stmt: move Stmt classes into zeek::detail namespace
  Add utility macro for creating namespaced aliases for classes
2020-06-11 23:20:51 -07:00
Tim Wojtulewicz
137e416a03 Rename BroType to Type 2020-06-10 14:27:36 -07:00
Tim Wojtulewicz
ed13972924 Move Type types to zeek namespace 2020-06-09 17:20:45 -07:00
Jon Siwek
2893eea045 Improve Func.h inclusion
Now forward declares some Broker types since Broker/CAF headers
generally slow things down and also Coverity Scan currently has a
catastrophic error on some CAF headers.

Also a few other changes to EventHandler/BifReturnVal to reduce number
of places that depend on Func.h.
2020-06-05 17:57:42 -07:00
Tim Wojtulewicz
60ed29c3b6 Move Attr to the zeek::detail namespace 2020-06-03 15:16:19 -07:00
Jon Siwek
5b4313b593 Deprecate Val(double, TypeTag) ctor, add TimeVal/DoubleVal subclasses
This also updates all usages of the deprecated Val ctor to use
either IntervalVal, TimeVal, or DoubleVal ctors.  The reason for
doing away with the old constructor is that using it with TYPE_INTERVAL
isn't strictly correct since there exists a more specific subclass,
IntervalVal, with overriden ValDescribe() method that ought to be used
to print such values in a more descriptive way.
2020-06-02 23:33:40 -07:00
Tim Wojtulewicz
c558d771e4 Remove IPAddr.h from Reporter.h 2020-06-01 15:00:39 -07:00
Jon Siwek
bee321711f Deprecate Attributes::FindAttr(), replace with Find() 2020-05-26 15:25:08 -07:00
Jon Siwek
6a1c312451 Add same_type() overloads for IntrusivePtr args 2020-05-21 21:33:02 -07:00
Jon Siwek
4b17929b6b Deprecate IndexType::Indices(), replace with GetIndices() 2020-05-21 19:46:57 -07:00
Jon Siwek
a384bb8b81 Deprecate VectorVal::Lookup(), replace with At() 2020-05-21 17:03:46 -07:00
Jon Siwek
3f92df51b7 Improve TableVal HashKey management
* Deprecated ComputeHash() methods and replaced with MakeHashKey()
  which returns std::unique_ptr<HashKey>

* Deprecated RecoverIndex() and replaced with RecreateIndex()
  which takes HashKey& and returns IntrusivePtr.

* Updated the new TableVal Assign()/Remove() methods to take either
  std::unique_ptr<HashKey> or HashKey& as appropriate for clarity of
  ownership expectations.
2020-05-20 22:16:47 -07:00
Jon Siwek
85a0ddd62d Deprecate TableVal::Lookup(), replace with Find()/FindOrDefault() 2020-05-20 18:00:50 -07:00
Jon Siwek
e01d2c1b37 Deprecate ComputeHash(Val*) methods, replace with ComputeHash(Val&) 2020-05-20 15:47:19 -07:00
Jon Siwek
7e89c8f0df Deprecate TableVal::Assign methods with Val*, add IntrusivePtr overloads 2020-05-20 12:46:51 -07:00
Jon Siwek
f729247778 Deprecate RecordVal::Lookup(int), replace with GetField(int) 2020-05-19 18:19:58 -07:00
Jon Siwek
f3d160d034 Deprecate RecordVal::Assign(int, Val*)
And adapt all usages to the existing overload taking IntrusivePtr.
2020-05-19 15:44:15 -07:00
Jon Siwek
a031f5b727 Deprecate Val(Func*) ctor, replace with one using IntrusivePtr 2020-05-15 16:24:53 -07:00
Jon Siwek
440b0623ac Deprecate RecordVal(RecordType*) ctor
Replaced with one that takes IntrusivePtr
2020-05-14 19:31:43 -07:00
Jon Siwek
1eb723fc9d Deprecate Val::Type(), replace with GetType() 2020-05-14 17:23:20 -07:00
Jon Siwek
d4dba40727 Deprecate VectorVal(VectorType*) ctora
Adds a new one taking an IntrusivePtr.
2020-05-14 17:23:20 -07:00
Jon Siwek
f26904e031 Deprecate BroType::YieldType(), replace with Yield() 2020-05-14 17:18:00 -07:00
Jon Siwek
103fed9f01 Deprecate RecordType::FieldType(), replace with GetFieldType() 2020-05-14 17:18:00 -07:00
Jon Siwek
455fc29b1a Migrate TypeList to store IntrusivePtrs
This changes return types of TypeList::Types() and
IndexType::IndexTypes() to return std::vector instead of type_list*
2020-05-14 17:18:00 -07:00
Jon Siwek
b096e552d3 Deprecate TableVal::ConvertToList() and TableVal::ConvertToPureList()
Replaced with ToListVal() and ToPureListVal() that return IntrusivePtr
2020-05-14 17:18:00 -07:00
Jon Siwek
5f57ceb70a Switch ListVal to store IntrusivePtrs
* Deprecates ListVal::Index() methods and replaces with ListVal::Idx()

* Replaces ListVal::Vals() method with one that returns
  std::vector<IntrusivePtr<Val>> rather than val_list
2020-05-14 17:18:00 -07:00
Jon Siwek
b422f68b88 Deprecant ListVal::Append(Val*) and add IntrusivePtr version 2020-05-14 17:18:00 -07:00
Jon Siwek
d7be84de97 Update deprecated ValManager::GetPort usages 2020-04-16 16:47:19 -07:00
Jon Siwek
93f4c5871b Update deprecated ValManager::GetCount usages 2020-04-16 16:46:36 -07:00
Jon Siwek
0ddac4abcf Update deprecated ValManager::GetInt usages 2020-04-16 16:44:35 -07:00
Jon Siwek
d9edd855da Update deprecated ValManager::GetBool usages 2020-04-16 16:44:33 -07:00
Johanna Amann
876c803d75 Merge remote-tracking branch 'origin/topic/timw/776-using-statements'
* origin/topic/timw/776-using-statements:
  Remove 'using namespace std' from SerialTypes.h
  Remove other using statements from headers
  GH-776: Remove using statements added by PR 770

Includes small fixes in files that changed since the merge request was
made.

Also includes a few small indentation fixes.
2020-04-09 13:31:07 -07:00
Tim Wojtulewicz
0a47588d0b The remaining nulls 2020-04-07 16:08:34 -07:00
Tim Wojtulewicz
d53c1454c0 Remove 'using namespace std' from SerialTypes.h
This unfortunately cuases a ton of flow-down changes because a lot of other
code was depending on that definition existing. This has a fairly large chance
to break builds of external plugins, considering how many internal ones it broke.
2020-04-07 15:59:59 -07:00
Jon Siwek
da56cd44d9 Fix using patterns stored as table/set indices
Pattern values used as table/set indices are stored in serialized form
using just the pattern text, but re-creating the value from that didn't
fully initialize/compile the regex matcher after (re-)creating it from
that pattern text.
2020-04-06 17:12:33 -07:00
Tim Wojtulewicz
fd5e15b116 The Great Embooleanating
A large number of functions had return values and/or arguments changed
to use ``bool`` types instead of ``int``.
2020-03-31 06:41:54 +00:00
Jon Siwek
b045ce4bb3 Change TableVal::RecoverIndex() to return IntrusivePtr 2020-03-23 22:01:03 -07:00
Jon Siwek
b62727a7fa Merge branch 'intrusive_ptr' of https://github.com/MaxKellermann/zeek
* 'intrusive_ptr' of https://github.com/MaxKellermann/zeek: (32 commits)
  Scope: store IntrusivePtr in `local`
  Scope: pass IntrusivePtr to AddInit()
  DNS_Mgr: use class IntrusivePtr
  Scope: use class IntrusivePtr
  Attr: use class IntrusivePtr
  Expr: check_and_promote_expr() returns IntrusivePtr
  Frame: use class IntrusivePtr
  Val: RecordVal::LookupWithDefault() returns IntrusivePtr
  Type: RecordType::FieldDefault() returns IntrusivePtr
  Val: TableVal::Delete() returns IntrusivePtr
  Type: base_type() returns IntrusivePtr
  Type: init_type() returns IntrusivePtr
  Type: merge_types() returns IntrusivePtr
  Type: use class IntrusivePtr in VectorType
  Type: use class IntrusivePtr in EnumType
  Type: use class IntrusivePtr in FileType
  Type: use class IntrusivePtr in TypeDecl
  Type: make TypeDecl `final` and the dtor non-`virtual`
  Type: use class IntrusivePtr in TypeType
  Type: use class IntrusivePtr in FuncType
  ...
2020-03-17 22:51:46 -07:00
Max Kellermann
43af5f8349 Type: use class IntrusivePtr in TypeDecl 2020-03-06 09:06:38 +01:00
Max Kellermann
674e141a15 Val: use class IntrusivePtr in class TableVal 2020-03-06 09:06:38 +01:00
Max Kellermann
7924e948b9 CompHash: return IntrusivePtr 2020-03-06 09:06:38 +01:00
Max Kellermann
ba35ebec4c Type: return IntrusivePtr 2020-03-06 09:06:38 +01:00
Tim Wojtulewicz
822567b3f9 Merge remote-tracking branch 'origin/topic/jsiwek/32bit-compat'
* origin/topic/jsiwek/32bit-compat:
  Improve formatting of doubles that are close to integers
  Improve HTTP version number comparisons
  Add a 32-bit task to Cirrus CI config
  Replace va_list fmt() overload with vfmt()
  Format tables indexed by patterns consistently across 32-bit/64-bit
  Format interval values consistently across 32-bit/64-bit platforms
2020-02-24 18:49:33 -07:00
Jon Siwek
38b25cf38d Merge branch 'smart_ptr' of https://github.com/MaxKellermann/zeek
Minor whitespace fixes during merge.

* 'smart_ptr' of https://github.com/MaxKellermann/zeek:
  OpaqueVal: remove misplaced `virtual` keywords
  CompHash: use class IntrusivePtr for the `type` field
  IntrusivePtr: replace the "add_ref" parameter with tag structs
  IntrusivePtr: remove reset(), nobody uses it
  IntrusivePtr: remove ordering operators
  IntrusivePtr: rename detach() to release()
  IntrusivePtr: move nullptr initializer to field declaration
2020-02-21 10:15:24 -08:00
Max Kellermann
53f49e0057 CompHash: use class IntrusivePtr for the type field 2020-02-20 15:57:39 +01:00
Jon Siwek
8e353aafe5 Format tables indexed by patterns consistently across 32-bit/64-bit
Uses a full 64 bit integer for length values regardless of actual size_t
to get consistent results between either 32-bit and 64-bit platforms.
2020-02-14 21:40:36 -08:00