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:
Jon Siwek 2020-02-21 20:04:30 -08:00
commit f0c713046c
8 changed files with 194 additions and 195 deletions

View file

@ -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.