Merge "Cherry-pick: Specify const for operator()"
diff --git a/Android.bp b/Android.bp
index ebd9400..f26585d 100644
--- a/Android.bp
+++ b/Android.bp
@@ -122,9 +122,6 @@
         "-Wno-error=c++0x-compat",
         "-Wno-non-virtual-dtor",
         "-Wno-sign-promo",
-
-        // Temporarily suppress the warning http://b/37911198
-        "-Wno-error=user-defined-warnings",
     ],
 
     debug: {
diff --git a/cpp/src/sfntly/table/header.cc b/cpp/src/sfntly/table/header.cc
index 672ace5..eb8fd75 100644
--- a/cpp/src/sfntly/table/header.cc
+++ b/cpp/src/sfntly/table/header.cc
@@ -54,12 +54,12 @@
 Header::~Header() {}
 
 bool HeaderComparatorByOffset::operator() (const HeaderPtr lhs,
-                                           const HeaderPtr rhs) {
+                                           const HeaderPtr rhs) const {
   return lhs->offset_ > rhs->offset_;
 }
 
 bool HeaderComparatorByTag::operator() (const HeaderPtr lhs,
-                                        const HeaderPtr rhs) {
+                                        const HeaderPtr rhs) const {
   return lhs->tag_ > rhs->tag_;
 }
 
diff --git a/cpp/src/sfntly/table/header.h b/cpp/src/sfntly/table/header.h
index 280e556..7744a21 100644
--- a/cpp/src/sfntly/table/header.h
+++ b/cpp/src/sfntly/table/header.h
@@ -89,21 +89,21 @@
  public:
   virtual ~HeaderComparator() {}
   virtual bool operator()(const HeaderPtr h1,
-                          const HeaderPtr h2) = 0;
+                          const HeaderPtr h2) const = 0;
 };
 
 class HeaderComparatorByOffset : public HeaderComparator {
  public:
   virtual ~HeaderComparatorByOffset() {}
   virtual bool operator()(const HeaderPtr h1,
-                          const HeaderPtr h2);
+                          const HeaderPtr h2) const;
 };
 
 class HeaderComparatorByTag : public HeaderComparator {
  public:
   virtual ~HeaderComparatorByTag() {}
   virtual bool operator()(const HeaderPtr h1,
-                          const HeaderPtr h2);
+                          const HeaderPtr h2) const;
 };
 
 typedef std::set<HeaderPtr, HeaderComparatorByOffset> HeaderOffsetSortedSet;