Bug 1485593 - Avoid using isdigit. r=hsivonen
authorNicolas Silva <nsilva@mozilla.com>
Thu, 23 Aug 2018 11:50:55 +0000
changeset 490745 613debd35609e10cd1d1404b2137514f8f9176d0
parent 490744 5412e9ef6314e378952186b398966a77b24edb7e
child 490746 a6b25f2541af4c45fbbaba43bd2811f3e118be82
push id1815
push userffxbld-merge
push dateMon, 15 Oct 2018 10:40:45 +0000
treeherdermozilla-release@18d4c09e9378 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershsivonen
bugs1485593
milestone63.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 1485593 - Avoid using isdigit. r=hsivonen Differential Revision: https://phabricator.services.mozilla.com/D4066
gfx/src/FontPropertyTypes.h
--- a/gfx/src/FontPropertyTypes.h
+++ b/gfx/src/FontPropertyTypes.h
@@ -13,16 +13,17 @@
 #include <cmath>
 #include <utility>
 
 #include <ctype.h>
 #include <stdlib.h>
 #include <string.h>
 
 #include "mozilla/Assertions.h"
+#include "mozilla/TextUtils.h"
 #include "nsString.h"
 
 /*
  * This file is separate from gfxFont.h so that layout can include it
  * without bringing in gfxFont.h and everything it includes.
  */
 
 namespace mozilla {
@@ -337,17 +338,17 @@ public:
   // intended to parse arbitrary (untrusted) strings.
   static FontSlantStyle FromString(const char* aString)
   {
     if (strcmp(aString, "normal") == 0) {
       return Normal();
     } else if (strcmp(aString, "italic") == 0) {
       return Italic();
     } else {
-      if (isdigit(aString[0]) && strstr(aString, "deg")) {
+      if (mozilla::IsAsciiDigit(aString[0]) && strstr(aString, "deg")) {
         float angle = strtof(aString, nullptr);
         return Oblique(angle);
       }
       // Not recognized as an oblique angle; maybe it's from a startup-cache
       // created by an older version. The style field there used a simple 0/1
       // for normal/italic respectively.
       return aString[0] == '0' ? Normal() : Italic();
     }