]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/format/Token.h
SourceFormat Enforcement
[thirdparty/squid.git] / src / format / Token.h
index f8b3c6226490c8acefac0b08491e3ccc2b4f04e4..ed8ab97cc418e30ef030d62fe696fdcc5cdc84f9 100644 (file)
@@ -1,3 +1,11 @@
+/*
+ * Copyright (C) 1996-2015 The Squid Software Foundation and contributors
+ *
+ * Squid software is distributed under GPLv2+ license and includes
+ * contributions from numerous individuals and organizations.
+ * Please see the COPYING and CONTRIBUTORS files for details.
+ */
+
 #ifndef _SQUID_FORMAT_TOKEN_H
 #define _SQUID_FORMAT_TOKEN_H
 
@@ -27,18 +35,7 @@ class TokenTableEntry;
 class Token
 {
 public:
-    Token() : type(LFT_NONE),
-            label(NULL),
-            widthMin(-1),
-            widthMax(-1),
-            quote(LOG_QUOTE_NONE),
-            left(false),
-            space(false),
-            zero(false),
-            divisor(1),
-            next(NULL)
-    { data.string = NULL; }
-
+    Token();
     ~Token();
 
     /// Initialize the format token registrations
@@ -52,7 +49,7 @@ public:
 
     ByteCode_t type;
     const char *label;
-    union {
+    struct {
         char *string;
 
         struct {
@@ -60,7 +57,6 @@ public:
             char *element;
             char separator;
         } header;
-        char *timespec;
     } data;
     int widthMin; ///< minimum field width
     int widthMax; ///< maximum field width
@@ -69,7 +65,7 @@ public:
     bool space;
     bool zero;
     int divisor;    // class invariant: MUST NOT be zero.
-    Token *next;       /* todo: move from linked list to array */
+    Token *next;    /* todo: move from linked list to array */
 
 private:
     const char *scanForToken(TokenTableEntry const table[], const char *cur);
@@ -78,3 +74,4 @@ private:
 } // namespace Format
 
 #endif /* _SQUID_FORMAT_TOKEN_H */
+