Bug 1528881 - Part 5: gfx/gl: Make some global functions static. r=jgilbert
authorChris Peterson <cpeterson@mozilla.com>
Fri, 14 Jun 2019 23:42:59 +0000
changeset 541816 39a016c2ea309e5aeb21e8ec3545ec80f41de6c1
parent 541815 b8628b1c358c6997f5d1685770b192b0fa7c36c3
child 541817 7312aba8ec3b2149f5251bd91d8f1cfee7cd3322
push id2131
push userffxbld-merge
push dateMon, 26 Aug 2019 18:30:20 +0000
treeherdermozilla-release@b19ffb3ca153 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgilbert
bugs1528881
milestone69.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1528881 - Part 5: gfx/gl: Make some global functions static. r=jgilbert clang's -Wmissing-prototypes option identifies global functions that can be made static (because they're only called from one compilation unit) or removed (if they're never called). gfx/gl/GfxTexturesReporter.cpp:22:13 [-Wmissing-prototypes] no previous prototype for function 'FormatBytes' gfx/gl/GLContextFeatures.cpp:534:6 [-Wmissing-prototypes] no previous prototype for function 'IsFeaturePartOfProfileVersion' Depends on D20263 Differential Revision: https://phabricator.services.mozilla.com/D20264
gfx/gl/GLContextFeatures.cpp
gfx/gl/GfxTexturesReporter.cpp
--- a/gfx/gl/GLContextFeatures.cpp
+++ b/gfx/gl/GLContextFeatures.cpp
@@ -528,18 +528,19 @@ static inline uint32_t ProfileVersionFor
   const FeatureInfo& featureInfo = GetFeatureInfo(feature);
 
   if (profile == ContextProfile::OpenGLES)
     return (uint32_t)featureInfo.mOpenGLESVersion;
 
   return (uint32_t)featureInfo.mOpenGLVersion;
 }
 
-bool IsFeaturePartOfProfileVersion(GLFeature feature, ContextProfile profile,
-                                   unsigned int version) {
+static bool IsFeaturePartOfProfileVersion(GLFeature feature,
+                                          ContextProfile profile,
+                                          unsigned int version) {
   unsigned int profileVersion = ProfileVersionForFeature(feature, profile);
 
   /**
    * if `profileVersion` is zero, it means that no version of the profile
    * added support for the feature.
    */
   return profileVersion && version >= profileVersion;
 }
--- a/gfx/gl/GfxTexturesReporter.cpp
+++ b/gfx/gl/GfxTexturesReporter.cpp
@@ -14,17 +14,17 @@ using namespace mozilla;
 using namespace mozilla::gl;
 
 NS_IMPL_ISUPPORTS(GfxTexturesReporter, nsIMemoryReporter)
 
 Atomic<size_t> GfxTexturesReporter::sAmount(0);
 Atomic<size_t> GfxTexturesReporter::sPeakAmount(0);
 Atomic<size_t> GfxTexturesReporter::sTileWasteAmount(0);
 
-std::string FormatBytes(size_t amount) {
+static std::string FormatBytes(size_t amount) {
   std::stringstream stream;
   int depth = 0;
   double val = amount;
   while (val > 1024) {
     val /= 1024;
     depth++;
   }