Bug 817913 - Don't have static functions in GfxDriverInfo.h. r=bas
authorCameron McCormack <cam@mcc.id.au>
Wed, 05 Dec 2012 15:51:52 +1100
changeset 115012 1d3c65ce01addd4c3a5a8a575467f04b300d43dc
parent 115011 c0715c079f1e09961ea45dd3b0bb559b238ee96c
child 115013 f5477b99877f6bc73846e69d1a461d15f0387243
push id19108
push usercmccormack@mozilla.com
push dateWed, 05 Dec 2012 04:53:42 +0000
treeherdermozilla-inbound@1d3c65ce01ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbas
bugs817913
milestone20.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 817913 - Don't have static functions in GfxDriverInfo.h. r=bas
widget/xpwidgets/GfxDriverInfo.h
--- a/widget/xpwidgets/GfxDriverInfo.h
+++ b/widget/xpwidgets/GfxDriverInfo.h
@@ -120,17 +120,17 @@ struct GfxDriverInfo
   static nsAString* mDeviceVendors[DeviceVendorMax];
 
   nsString mModel, mHardware, mProduct, mManufacturer;
 };
 
 #define GFX_DRIVER_VERSION(a,b,c,d) \
   ((uint64_t(a)<<48) | (uint64_t(b)<<32) | (uint64_t(c)<<16) | uint64_t(d))
 
-static uint64_t
+inline uint64_t
 V(uint32_t a, uint32_t b, uint32_t c, uint32_t d)
 {
   // We make sure every driver number is padded by 0s, this will allow us the
   // easiest 'compare as if decimals' approach. See ParseDriverVersion for a
   // more extensive explanation of this approach.
   while (b > 0 && b < 1000) {
     b *= 10;
   }
@@ -139,17 +139,17 @@ V(uint32_t a, uint32_t b, uint32_t c, ui
   }
   while (d > 0 && d < 1000) {
     d *= 10;
   }
   return GFX_DRIVER_VERSION(a, b, c, d);
 }
 
 // All destination string storage needs to have at least 5 bytes available.
-static bool SplitDriverVersion(const char *aSource, char *aAStr, char *aBStr, char *aCStr, char *aDStr)
+inline bool SplitDriverVersion(const char *aSource, char *aAStr, char *aBStr, char *aCStr, char *aDStr)
 {
   // sscanf doesn't do what we want here to we parse this manually.
   int len = strlen(aSource);
   char *dest[4] = { aAStr, aBStr, aCStr, aDStr };
   int destIdx = 0;
   int destPos = 0;
 
   for (int i = 0; i < len; i++) {
@@ -177,22 +177,22 @@ static bool SplitDriverVersion(const cha
   dest[destIdx][destPos] = 0;
 
   if (destIdx != ArrayLength(dest) - 1) {
     return false;
   }
   return true;
 }
 
-// This allows us to pad driver versiopn 'substrings' with 0s, this
+// This allows us to pad driver version 'substrings' with 0s, this
 // effectively allows us to treat the version numbers as 'decimals'. This is
 // a little strange but this method seems to do the right thing for all
 // different vendor's driver strings. i.e. .98 will become 9800, which is
 // larger than .978 which would become 9780.
-static void PadDriverDecimal(char *aString)
+inline void PadDriverDecimal(char *aString)
 {
   for (int i = 0; i < 4; i++) {
     if (!aString[i]) {
       for (int c = i; c < 4; c++) {
         aString[c] = '0';
       }
       break;
     }