]> granicus.if.org Git - imagemagick/blobdiff - magick/string-private.h
(no commit message)
[imagemagick] / magick / string-private.h
index 14491761105613affb6a8b63856c9ca77d8f47d6..95b5187fdfb822d8ba66bfba1f30d8349d60360a 100644 (file)
@@ -1,12 +1,12 @@
 /*
   Copyright 1999-2010 ImageMagick Studio LLC, a non-profit organization
   dedicated to making software imaging solutions freely available.
-  
+
   You may not use this file except in compliance with the License.
   obtain a copy of the License at
-  
+
     http://www.imagemagick.org/script/license.php
-  
+
   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -31,7 +31,6 @@ static inline double SiPrefixToDouble(const char *string,const double interval)
     scale,
     value;
 
-  assert(string != (char *) NULL);
   value=strtod(string,&q);
   scale=1000.0;
   if ((*q != '\0') && (tolower((int) ((unsigned char) *(q+1))) == 'i'))
@@ -57,11 +56,21 @@ static inline double StringToDouble(const char *value)
   return(strtod(value,(char **) NULL));
 }
 
+static inline int StringToInteger(const char *value)
+{
+  return((int) strtol(value,(char **) NULL,10));
+}
+
 static inline long StringToLong(const char *value)
 {
   return(strtol(value,(char **) NULL,10));
 }
 
+static inline unsigned long StringToUnsignedLong(const char *value)
+{
+  return(strtoul(value,(char **) NULL,10));
+}
+
 #if defined(__cplusplus) || defined(c_plusplus)
 }
 #endif