]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Cleanup: Remove HttpHdrCc.cci file
authorAmos Jeffries <squid3@treenet.co.nz>
Sat, 7 Jan 2017 03:10:12 +0000 (16:10 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Sat, 7 Jan 2017 03:10:12 +0000 (16:10 +1300)
Moving the simple methods inline to the HttpHdrCc.h and more complicated
setter to HttpHdrCc.cc.

src/HttpHdrCc.cc
src/HttpHdrCc.cci [deleted file]
src/HttpHdrCc.h
src/Makefile.am

index bb740aa4db430c212681fc7c4e5f5557c2692e55..34ddd4628f27273aefed5f3659df181aafed773b 100644 (file)
@@ -71,6 +71,25 @@ HttpHdrCc::clear()
     *this=HttpHdrCc();
 }
 
+/// set a data member to a new value, and set the corresponding mask-bit.
+/// if setting is false, then the mask-bit is cleared.
+void
+HttpHdrCc::setValue(int32_t &value, int32_t new_value, HttpHdrCcType hdr, bool setting)
+{
+    if (setting) {
+        if (new_value < 0) {
+            debugs(65, 3, "rejecting negative-value Cache-Control directive " << hdr
+                   << " value " << new_value);
+            return;
+        }
+    } else {
+        new_value = -1; //rely on the convention that "unknown" is -1
+    }
+
+    value = new_value;
+    setMask(hdr,setting);
+}
+
 bool
 HttpHdrCc::parse(const String & str)
 {
@@ -331,7 +350,3 @@ operator<< (std::ostream &s, HttpHdrCcType c)
     return s;
 }
 
-#if !_USE_INLINE_
-#include "HttpHdrCc.cci"
-#endif
-
diff --git a/src/HttpHdrCc.cci b/src/HttpHdrCc.cci
deleted file mode 100644 (file)
index cdbc101..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 1996-2017 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.
- */
-
-/* DEBUG: section 65    HTTP Cache Control Header */
-
-#include "Debug.h"
-#include "defines.h"
-
-bool
-HttpHdrCc::isSet(HttpHdrCcType id) const
-{
-    assert(id < HttpHdrCcType::CC_ENUM_END);
-    return EBIT_TEST(mask, static_cast<long>(id));
-}
-
-void
-HttpHdrCc::setMask(HttpHdrCcType id, bool newval)
-{
-    if (newval)
-        EBIT_SET(mask,static_cast<long>(id));
-    else
-        EBIT_CLR(mask, static_cast<long>(id));
-}
-
-/// set a data member to a new value, and set the corresponding mask-bit.
-/// if setting is false, then the mask-bit is cleared.
-void
-HttpHdrCc::setValue(int32_t &value, int32_t new_value, HttpHdrCcType hdr, bool setting)
-{
-    if (setting) {
-        if (new_value < 0) {
-            debugs(65,3,HERE << "rejecting negative-value Cache-Control directive " << hdr
-                   << " value " << new_value );
-            return;
-        }
-    } else {
-        new_value=-1; //rely on the convention that "unknown" is -1
-    }
-
-    value=new_value;
-    setMask(hdr,setting);
-}
-
index cfeb55e270ba6a8a08f5ff4186ee55030d3fc175..6672e590634cfdb2c97130b2b70808891f02235a 100644 (file)
@@ -9,6 +9,7 @@
 #ifndef SQUID_HTTPHDRCC_H
 #define SQUID_HTTPHDRCC_H
 
+#include "defines.h"
 #include "dlink.h"
 #include "mem/forward.h"
 #include "SquidString.h"
@@ -167,7 +168,10 @@ public:
     void clearImmutable() {setMask(HttpHdrCcType::CC_IMMUTABLE,false);}
 
     /// check whether the attribute value supplied by id is set
-    _SQUID_INLINE_ bool isSet(HttpHdrCcType id) const;
+    bool isSet(HttpHdrCcType id) const {
+        assert(id < HttpHdrCcType::CC_ENUM_END);
+        return EBIT_TEST(mask, static_cast<long>(id));
+    }
 
     void packInto(Packable * p) const;
 
@@ -187,8 +191,14 @@ private:
     String no_cache; ///< List of headers sent as value for CC:no-cache="...". May be empty/undefined if the value is missing.
 
     /// low-level part of the public set method, performs no checks
-    _SQUID_INLINE_ void setMask(HttpHdrCcType id, bool newval=true);
-    _SQUID_INLINE_ void setValue(int32_t &value, int32_t new_value, HttpHdrCcType hdr, bool setting=true);
+    void setMask(HttpHdrCcType id, bool newval=true) {
+        if (newval)
+            EBIT_SET(mask,static_cast<long>(id));
+        else
+            EBIT_CLR(mask, static_cast<long>(id));
+    }
+
+    void setValue(int32_t &value, int32_t new_value, HttpHdrCcType hdr, bool setting=true);
 
 public:
     /**comma-separated representation of the header values which were
@@ -204,12 +214,7 @@ void httpHdrCcInitModule(void);
 void httpHdrCcUpdateStats(const HttpHdrCc * cc, StatHist * hist);
 void httpHdrCcStatDumper(StoreEntry * sentry, int idx, double val, double size, int count);
 
-std::ostream&
-operator<< (std::ostream &, HttpHdrCcType);
-
-#if _USE_INLINE_
-#include "HttpHdrCc.cci"
-#endif
+std::ostream & operator<< (std::ostream &, HttpHdrCcType);
 
 #endif /* SQUID_HTTPHDRCC_H */
 
index ace10596c595f973603067c592894d918be4cda4..1239d6dfa3a4e7eef8a35fcc2eaf44f17d30a559 100644 (file)
@@ -317,7 +317,6 @@ squid_SOURCES = \
        HttpHeaderFieldStat.h \
        HttpHdrCc.h \
        HttpHdrCc.cc \
-       HttpHdrCc.cci \
        HttpHdrRange.cc \
        HttpHdrSc.cc \
        HttpHdrSc.h \
@@ -931,7 +930,6 @@ tests_testHttpReply_SOURCES=\
        HttpHeaderFieldStat.h \
        HttpHdrCc.h \
        HttpHdrCc.cc \
-       HttpHdrCc.cci \
        HttpHdrContRange.cc \
        HttpHdrContRange.h \
        HttpHdrRange.cc \
@@ -1046,7 +1044,6 @@ tests_testACLMaxUserIP_SOURCES= \
        HttpHeaderFieldStat.h \
        HttpHdrCc.h \
        HttpHdrCc.cc \
-       HttpHdrCc.cci \
        HttpHdrSc.cc \
        HttpHdrScTarget.cc \
        HttpMsg.cc \
@@ -1273,7 +1270,6 @@ tests_testCacheManager_SOURCES = \
        HttpHeaderFieldStat.h \
        HttpHdrCc.h \
        HttpHdrCc.cc \
-       HttpHdrCc.cci \
        HttpHdrContRange.cc \
        HttpHdrRange.cc \
        HttpHdrSc.cc \
@@ -1457,7 +1453,6 @@ tests_testDiskIO_SOURCES = \
        HttpHeaderFieldStat.h \
        HttpHdrCc.h \
        HttpHdrCc.cc \
-       HttpHdrCc.cci \
        HttpHdrContRange.cc \
        HttpHdrSc.cc \
        HttpHdrScTarget.cc \
@@ -1693,7 +1688,6 @@ tests_testEvent_SOURCES = \
        HttpHeaderFieldStat.h \
        HttpHdrCc.h \
        HttpHdrCc.cc \
-       HttpHdrCc.cci \
        HttpHdrContRange.cc \
        HttpHdrRange.cc \
        HttpHdrSc.cc \
@@ -1930,7 +1924,6 @@ tests_testEventLoop_SOURCES = \
        HttpHeaderFieldStat.h \
        HttpHdrCc.h \
        HttpHdrCc.cc \
-       HttpHdrCc.cci \
        HttpHdrContRange.cc \
        HttpHdrRange.cc \
        HttpHdrSc.cc \
@@ -2157,7 +2150,6 @@ tests_test_http_range_SOURCES = \
        HttpHeaderFieldStat.h \
        HttpHdrCc.h \
        HttpHdrCc.cc \
-       HttpHdrCc.cci \
        HttpHdrContRange.cc \
        HttpHdrRange.cc \
        HttpHdrSc.cc \
@@ -2478,7 +2470,6 @@ tests_testHttpRequest_SOURCES = \
        HttpHeaderFieldStat.h \
        HttpHdrCc.h \
        HttpHdrCc.cc \
-       HttpHdrCc.cci \
        HttpHdrContRange.cc \
        HttpHdrRange.cc \
        HttpHdrSc.cc \
@@ -2708,7 +2699,6 @@ tests_testStore_SOURCES= \
        HttpHeaderFieldStat.h \
        HttpHdrCc.h \
        HttpHdrCc.cc \
-       HttpHdrCc.cci \
        HttpHdrContRange.cc \
        HttpHdrRange.cc \
        HttpHdrSc.cc \
@@ -3003,7 +2993,6 @@ tests_testUfs_SOURCES = \
        HttpHeaderFieldStat.h \
        HttpHdrCc.h \
        HttpHdrCc.cc \
-       HttpHdrCc.cci \
        HttpHdrSc.cc \
        HttpHdrScTarget.cc \
        url.cc \
@@ -3316,7 +3305,6 @@ tests_testURL_SOURCES = \
        HttpHeaderFieldStat.h \
        HttpHdrCc.h \
        HttpHdrCc.cc \
-       HttpHdrCc.cci \
        HttpHdrContRange.cc \
        HttpHdrRange.cc \
        HttpHdrSc.cc \