From: Christos Tsantilas Date: Thu, 20 Jan 2011 15:31:20 +0000 (+0200) Subject: use unsigned int instead of time_t for snmp variables X-Git-Tag: take03^2~37^2~12 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=579928b6165a996d08d50050a13186db0409c877;p=thirdparty%2Fsquid.git use unsigned int instead of time_t for snmp variables --- diff --git a/src/snmpx/Var.cc b/src/snmpx/Var.cc index 889344026a..32f972a1f7 100644 --- a/src/snmpx/Var.cc +++ b/src/snmpx/Var.cc @@ -228,12 +228,12 @@ Snmp::Var::asCounter64() const return *reinterpret_cast(val.integer); } -time_t +unsigned int Snmp::Var::asTimeTicks() const { Must(type == SMI_TIMETICKS); - Must(val.integer != NULL && val_len == sizeof(time_t)); - return *reinterpret_cast(val.integer); + Must(val.integer != NULL && val_len == sizeof(unsigned int)); + return *reinterpret_cast(val.integer); } Range @@ -299,7 +299,7 @@ Snmp::Var::setCounter64(long long int counter) } void -Snmp::Var::setTimeTicks(time_t ticks) +Snmp::Var::setTimeTicks(unsigned int ticks) { setValue(&ticks, sizeof(ticks), SMI_TIMETICKS); } diff --git a/src/snmpx/Var.h b/src/snmpx/Var.h index 86d05326bc..c38cec4594 100644 --- a/src/snmpx/Var.h +++ b/src/snmpx/Var.h @@ -45,7 +45,7 @@ public: unsigned int asGauge() const; ///< returns variable value as unsigned int int asCounter() const; ///< returns variable value as Counter32 long long int asCounter64() const; ///< returns variable value as Counter64 - time_t asTimeTicks() const; ///< returns variable value as time ticks + unsigned int asTimeTicks() const; ///< returns variable value as time ticks Range asObject() const; ///< returns variable value as object oid Range asString() const; ///< returns variable value as chars string ipaddr asIpAddress() const; ///< returns variable value as ip address @@ -55,7 +55,7 @@ public: void setGauge(unsigned int value); ///< assign unsigned int value to variable void setString(const Range& string); ///< assign string to variable void setObject(const Range& object); ///< assign object oid to variable - void setTimeTicks(time_t ticks); ///