From: Dmitry Kurochkin Date: Thu, 30 Aug 2012 12:46:47 +0000 (-0600) Subject: Make CpuAffinitySet::applied() method non-const. X-Git-Tag: sourceformat-review-1~14^2~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5ffe109084b362ce8db478ca09d8f23213482153;p=thirdparty%2Fsquid.git Make CpuAffinitySet::applied() method non-const. According to CPU_SET(3) and, apparently, on some systems (e.g., OpenSuSE 10.3) CPU_COUNT macro expects a non-const argument. The patch fixes build error on these systems. --- diff --git a/src/CpuAffinitySet.cc b/src/CpuAffinitySet.cc index 13fbf7d421..f937f03fa2 100644 --- a/src/CpuAffinitySet.cc +++ b/src/CpuAffinitySet.cc @@ -67,8 +67,11 @@ CpuAffinitySet::undo() } bool -CpuAffinitySet::applied() const +CpuAffinitySet::applied() { + // NOTE: cannot be const. + // According to CPU_SET(3) and, apparently, on some systems (e.g., + // OpenSuSE 10.3) CPU_COUNT macro expects a non-const argument. return (CPU_COUNT(&theOrigCpuSet) > 0); } diff --git a/src/CpuAffinitySet.h b/src/CpuAffinitySet.h index c5890f47a1..f2b115772d 100644 --- a/src/CpuAffinitySet.h +++ b/src/CpuAffinitySet.h @@ -21,7 +21,7 @@ public: void undo(); /// whether apply() was called and was not undone - bool applied() const; + bool applied(); /// set CPU affinity mask void set(const cpu_set_t &aCpuSet);