mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Merge branch 'refactor_obj' of https://github.com/MaxKellermann/zeek
Minor formatting/style changes in merge. * 'refactor_obj' of https://github.com/MaxKellermann/zeek: Val: use C++ initializers Val: add BroValUnion constructors Val: reduce duplicate code by using delegating constructors Val: remove unused default constructors and `friend` declarations Val: remove the unnecessary BroValUnion typedef Type: remove unnecessary enum typedefs Type: use C++ initializers Type: move code from BroType::BroType() to constexpr functions Type: remove useless BroType destructor Obj: disallow copying BroObj Obj: use C++ initializers Obj: make `no_location` constexpr
This commit is contained in:
commit
f0c713046c
8 changed files with 194 additions and 195 deletions
13
src/Obj.h
13
src/Obj.h
|
@ -31,7 +31,7 @@ typedef Location yyltype;
|
|||
YYLTYPE GetCurrentLocation();
|
||||
|
||||
// Used to mean "no location associated with this object".
|
||||
extern Location no_location;
|
||||
inline constexpr Location no_location("<no location>", 0, 0, 0, 0);
|
||||
|
||||
// Current start/end location.
|
||||
extern Location start_location;
|
||||
|
@ -53,9 +53,6 @@ class BroObj {
|
|||
public:
|
||||
BroObj()
|
||||
{
|
||||
ref_cnt = 1;
|
||||
notify_plugins = false;
|
||||
|
||||
// A bit of a hack. We'd like to associate location
|
||||
// information with every object created when parsing,
|
||||
// since for them, the location is generally well-defined.
|
||||
|
@ -76,6 +73,10 @@ public:
|
|||
|
||||
virtual ~BroObj();
|
||||
|
||||
/* disallow copying */
|
||||
BroObj(const BroObj &) = delete;
|
||||
BroObj &operator=(const BroObj &) = delete;
|
||||
|
||||
// Report user warnings/errors. If obj2 is given, then it's
|
||||
// included in the message, though if pinpoint_only is non-zero,
|
||||
// then obj2 is only used to pinpoint the location.
|
||||
|
@ -141,8 +142,8 @@ private:
|
|||
friend inline void Ref(BroObj* o);
|
||||
friend inline void Unref(BroObj* o);
|
||||
|
||||
bool notify_plugins;
|
||||
int ref_cnt;
|
||||
bool notify_plugins = false;
|
||||
int ref_cnt = 1;
|
||||
|
||||
// If non-zero, do not print runtime errors. Useful for
|
||||
// speculative evaluation.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue