void BodyPipe::setBodySize(uint64_t aBodySize)
{
assert(!bodySizeKnown());
- assert(aBodySize >= 0);
assert(thePutSize <= aBodySize);
// If this assert fails, we need to add code to check for eof and inform
}
};
inline const char* GetHost(void) const { return host; };
- inline const int GetHostIsNumeric(void) const { return host_is_numeric; };
+ inline int GetHostIsNumeric(void) const { return host_is_numeric; };
#if USE_ADAPTATION
/// Returns possibly nil history, creating it if adapt. logging is enabled
\retval METHOD_OTHER the method is not recognized and has no unique ID
\retval * the method is on of the recognized HTTP methods.
*/
- _method_t const id() const { return theMethod; }
+ _method_t id() const { return theMethod; }
/** Get a char string representation of the method. */
- char const* image() const;
+ char const * image() const;
bool isCacheble() const;
bool purgesOthers() const;
static int
aclHostDomainCompare( char *const &a, char * const &b)
{
- const char *h = (const char *)a;
- const char *d = (const char *)b;
+ const char *h = static_cast<const char *>(a);
+ const char *d = static_cast<const char *>(b);
return matchDomainName(h, d);
}
int
aclDomainCompare(T const &a, T const &b)
{
- char * const d1 = (char *const)b;
- char * const d2 = (char *const )a;
+ char * const d1 = static_cast<char *>(b);
+ char * const d2 = static_cast<char *>(a);
int ret;
ret = aclHostDomainCompare(d1, d2);
* \retval 0 the digest is not stale yet
* \retval -1 the digest will be stale on the next request
*/
-const int
+int
authDigestNonceLastRequest(digest_nonce_h * nonce)
{
if (!nonce)
extern void authDigestNonceUnlink(digest_nonce_h * nonce);
extern int authDigestNonceIsValid(digest_nonce_h * nonce, char nc[9]);
extern const char *authenticateDigestNonceNonceb64(const digest_nonce_h * nonce);
-extern const int authDigestNonceLastRequest(digest_nonce_h * nonce);
+extern int authDigestNonceLastRequest(digest_nonce_h * nonce);
/* configuration runtime data */
}
- /*
- * paranoid check
- */
- assert((available.size() >= 0 && i->debt() >= 0) || i->debt() == -1);
-
if (!canPackMoreRanges()) {
debugs(33, 3, "clientPackRange: Returning because !canPackMoreRanges.");
return conn_;
}
-ConnStateData * const
+ConnStateData const *
ClientHttpRequest::getConn() const
{
if (!cbdataReferenceValid(conn_))
", id = 0x" << std::hex << q->msg_id);
q->callback = callback;
-
q->callback_data = cbdataReference(data);
idnsCacheQuery(q);
-
idnsSendQuery(q);
}
", id = 0x" << std::hex << q->msg_id);
q->callback = callback;
-
q->callback_data = cbdataReference(data);
idnsCacheQuery(q);
-
idnsSendQuery(q);
}
extern const char *hier_code_str[];
-inline const hier_code operator++(hier_code &i) { return (hier_code)(i+1); }
+inline hier_code operator++(hier_code &i) { return (hier_code)(i+1); }
#endif /* SQUID__HIER_CODE_H */
/* some external code may have blindly memset a parent. */
/* thats okay, our default is known */
if ( IsAnyAddr() ) {
- memcpy(buf,"::\0", min((const unsigned int)3,blen));
+ memcpy(buf,"::\0", min(static_cast<unsigned int>(3),blen));
return buf;
}
/* However IPv4 CAN. */
if ( force == AF_INET && !IsIPv4() ) {
if ( IsIPv6() ) {
- memcpy(buf, "{!IPv4}\0", min((const unsigned int)8,blen));
+ memcpy(buf, "{!IPv4}\0", min(static_cast<unsigned int>(8),blen));
}
return buf;
}
force << "). accepted={" << AF_UNSPEC << "," << AF_INET << "," << AF_INET6 << "}");
fprintf(stderr,"WARNING: Corrupt IP Address details OR required to display in unknown format (%d). accepted={%d,%d,%d} ",
force, AF_UNSPEC, AF_INET, AF_INET6);
- memcpy(buf,"dead:beef::\0", min((const unsigned int)13,blen));
+ memcpy(buf,"dead:beef::\0", min(static_cast<unsigned int>(13),blen));
assert(false);
}
/// returns the kid by index, useful for kids iteration
Kid& Kids::get(size_t i)
{
- assert(i >= 0 && i < count());
+ assert(i < count());
return storage[i];
}
void
Ipc::TypedMsgHdr::getRaw(void *raw, size_t size) const
{
- Must(size >= 0);
if (size > 0) {
Must(size <= data.size - offset);
memcpy(raw, data.raw + offset, size);
void
Ipc::TypedMsgHdr::putRaw(const void *raw, size_t size)
{
- Must(size >= 0);
if (size > 0) {
Must(size <= sizeof(data.raw) - data.size);
memcpy(data.raw + data.size, raw, size);