]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/snmp/Var.cc
Docs: Copyright updates for 2018 (#114)
[thirdparty/squid.git] / src / snmp / Var.cc
index 70155e04788b50149f6201748eec6e08de52bb74..509bbfcbc00614ec937c2012f486a81761fb718b 100644 (file)
@@ -1,16 +1,21 @@
 /*
- * $Id$
- *
- * DEBUG: section 49    SNMP Interface
+ * Copyright (C) 1996-2018 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.
  */
 
-#include "config.h"
+/* DEBUG: section 49    SNMP Interface */
+
+#include "squid.h"
 #include "base/TextException.h"
+#include "Debug.h"
 #include "ipc/TypedMsgHdr.h"
-#include "protos.h"
 #include "snmp/Var.h"
+#include "tools.h"
 
+#include <algorithm>
 
 Snmp::Var::Var()
 {
@@ -39,14 +44,13 @@ Snmp::Var::operator = (const Var& var)
 void
 Snmp::Var::init()
 {
-    xmemset(this, 0, sizeof(*this));
+    memset(this, 0, sizeof(*this));
 }
 
 Snmp::Var&
 Snmp::Var::operator += (const Var& var)
 {
-    switch(type)
-    {
+    switch (type) {
     case SMI_INTEGER:
         setInt(asInt() + var.asInt());
         break;
@@ -74,8 +78,7 @@ Snmp::Var&
 Snmp::Var::operator /= (int num)
 {
     Must(num != 0);
-    switch(type)
-    {
+    switch (type) {
     case SMI_INTEGER:
         setInt(asInt() / num);
         break;
@@ -102,8 +105,7 @@ Snmp::Var::operator /= (int num)
 bool
 Snmp::Var::operator < (const Var& var) const
 {
-    switch(type)
-    {
+    switch (type) {
     case SMI_INTEGER:
         return asInt() < var.asInt();
     case SMI_GAUGE32:
@@ -125,8 +127,7 @@ Snmp::Var::operator < (const Var& var) const
 bool
 Snmp::Var::operator > (const Var& var) const
 {
-    switch(type)
-    {
+    switch (type) {
     case SMI_INTEGER:
         return asInt() > var.asInt();
     case SMI_GAUGE32:
@@ -358,3 +359,4 @@ Snmp::Var::unpack(const Ipc::TypedMsgHdr& msg)
         msg.getFixed(val.string, val_len);
     }
 }
+