]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Document and enforce invariant on Format::Token.divisor
authorFrancesco Chemolli <kinkie@squid-cache.org>
Fri, 10 Jan 2014 15:50:03 +0000 (16:50 +0100)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Fri, 10 Jan 2014 15:50:03 +0000 (16:50 +0100)
src/format/Token.h

index 052cf80b41070c8e075b83330656f4a7f64eb456..f8b3c6226490c8acefac0b08491e3ccc2b4f04e4 100644 (file)
@@ -35,7 +35,7 @@ public:
             left(false),
             space(false),
             zero(false),
-            divisor(0),
+            divisor(1),
             next(NULL)
     { data.string = NULL; }
 
@@ -68,7 +68,7 @@ public:
     bool left;
     bool space;
     bool zero;
-    int divisor;
+    int divisor;    // class invariant: MUST NOT be zero.
     Token *next;       /* todo: move from linked list to array */
 
 private: