From: amosjeffries <> Date: Fri, 24 Aug 2007 07:02:09 +0000 (+0000) Subject: Fix debug not showing some values. X-Git-Tag: SQUID_3_0_PRE7~35 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=066c954000aa7944c0ed4777ded1cda4a1b2185f;p=thirdparty%2Fsquid.git Fix debug not showing some values. debugs() does not handle uint8_t properly if the value is 0-31, 127+. This patch adds a proper stream operator to display them like any other int --- diff --git a/src/Debug.h b/src/Debug.h index 1753c41206..64a64bca4d 100644 --- a/src/Debug.h +++ b/src/Debug.h @@ -1,6 +1,6 @@ /* - * $Id: Debug.h,v 1.9 2007/04/28 22:26:37 hno Exp $ + * $Id: Debug.h,v 1.10 2007/08/24 01:02:09 amosjeffries Exp $ * * DEBUG: section 0 Debug Routines * AUTHOR: Harvest Derived @@ -83,4 +83,9 @@ private: */ #define HERE __FILE__<<"("<<__LINE__<<") " +/* AYJ: some uint8_t do not like streaming control-chars (values 0-31, 127+) */ +inline std::ostream& operator <<(std::ostream &os, const uint8_t d) { + return (os << (int)d); +} + #endif /* SQUID_DEBUG */