]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Thu, 19 May 2011 13:22:18 +0000 (13:22 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Thu, 19 May 2011 13:22:18 +0000 (13:22 +0000)
ChangeLog
config/config.h.in
config/configure.xml
configure
configure.ac
magick/locale-private.h
magick/locale.c
magick/magick-config.h
magick/string.c
magick/version.h

index 90c0e3e5c89b58bb151ab8f77f785166fee9d231..f79d34e0280efdf70691f2b5785a1d8470a279af 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 2011-05-16  6.6.9-10 Cristy  <quetzlzacatenango@image...>
   * Don't use comma as a separator for stroked text (reference
     http://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=18742).
+  * Use C locale when generating or interpretting SVG.
 
 2011-05-15  6.6.9-9 Cristy  <quetzlzacatenango@image...>
   * New version 6.6.9-9.
index 73a093a924d0d8c24071b0c13ff4a7a12c8c382d..13cb812812c34ec5d4daffefe5634c2ef01e0488 100644 (file)
 /* Define to 1 if you have the <unistd.h> header file. */
 #undef HAVE_UNISTD_H
 
+/* Define to 1 if you have the `uselocale' function. */
+#undef HAVE_USELOCALE
+
 /* Define to 1 if you have the `usleep' function. */
 #undef HAVE_USLEEP
 
index 75f1630e965ff659dfb374a45bc91b2c6e53ad3a..a21a4d4b4cc93eb6c8dec7d96048db23034f814f 100644 (file)
@@ -10,8 +10,8 @@
   <configure name="VERSION" value="6.6.9"/>
   <configure name="LIB_VERSION" value="0x669"/>
   <configure name="LIB_VERSION_NUMBER" value="6,6,9,10"/>
-  <configure name="SVN_REVISION" value="4448" />
-  <configure name="RELEASE_DATE" value="2011-05-18"/>
+  <configure name="SVN_REVISION" value="4455" />
+  <configure name="RELEASE_DATE" value="2011-05-19"/>
   <configure name="CONFIGURE" value="./configure "/>
   <configure name="PREFIX" value="/usr/local"/>
   <configure name="EXEC-PREFIX" value="/usr/local"/>
index 933914e14f0485062e772ce18a0412b2188f9583..035a623b5382d42854f3164eabaca91fbb6ad4e8 100755 (executable)
--- a/configure
+++ b/configure
@@ -3455,7 +3455,7 @@ MAGICK_LIBRARY_CURRENT_MIN=`expr $MAGICK_LIBRARY_CURRENT - $MAGICK_LIBRARY_AGE`
 
 MAGICK_LIBRARY_VERSION_INFO=$MAGICK_LIBRARY_CURRENT:$MAGICK_LIBRARY_REVISION:$MAGICK_LIBRARY_AGE
 
-MAGICK_SVN_REVISION=4448
+MAGICK_SVN_REVISION=4455
 
 
 
@@ -24005,7 +24005,7 @@ fi
 LIBS="$MATH_LIBS $LIBS"
 
 
-for ac_func in atoll atexit cabs carg cimag creal clock ctime_r directio _exit execvp fchmod floor fork ftime ftruncate getc_unlocked getcwd getpid getexecname getdtablesize getpagesize getrlimit getrusage gettimeofday gmtime_r j0 j1 lltostr localtime_r lstat memmove memset mkstemp munmap nanosleep newlocale _NSGetExecutablePath pclose _pclose poll popen _popen posix_fadvise posix_fallocate posix_madvise posix_memalign posix_spawnp pow pread pwrite qsort_r raise rand_r readlink readdir_r realpath select seekdir setlocale sqrt setvbuf stat strchr strerror_r strrchr strcspn strdup strpbrk strspn strstr strtod strtod_l strtol strtoul symlink sysconf sigemptyset sigaction spawnvp strerror strlcat strlcpy strcasecmp strncasecmp telldir tempnam times ulltostr usleep utime vsprintf vsnprintf waitpid _wfopen _wstat
+for ac_func in atoll atexit cabs carg cimag creal clock ctime_r directio _exit execvp fchmod floor fork ftime ftruncate getc_unlocked getcwd getpid getexecname getdtablesize getpagesize getrlimit getrusage gettimeofday gmtime_r j0 j1 lltostr localtime_r lstat memmove memset mkstemp munmap nanosleep newlocale _NSGetExecutablePath pclose _pclose poll popen _popen posix_fadvise posix_fallocate posix_madvise posix_memalign posix_spawnp pow pread pwrite qsort_r raise rand_r readlink readdir_r realpath select seekdir setlocale sqrt setvbuf stat strchr strerror_r strrchr strcspn strdup strpbrk strspn strstr strtod strtod_l strtol strtoul symlink sysconf sigemptyset sigaction spawnvp strerror strlcat strlcpy strcasecmp strncasecmp telldir tempnam times ulltostr uselocale usleep utime vsprintf vsnprintf waitpid _wfopen _wstat
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
index 3ae9394df585839544a4eb1b457c5cb31517a660..be6e6616385bed39c1affa4264848b6e6b198950 100755 (executable)
@@ -1051,7 +1051,7 @@ AC_CHECK_LIB(m,sqrt,MATH_LIBS="-lm",,)
 LIBS="$MATH_LIBS $LIBS"
 AC_SUBST(MATH_LIBS)
 
-AC_CHECK_FUNCS([atoll atexit cabs carg cimag creal clock ctime_r directio _exit execvp fchmod floor fork ftime ftruncate getc_unlocked getcwd getpid getexecname getdtablesize getpagesize getrlimit getrusage gettimeofday gmtime_r j0 j1 lltostr localtime_r lstat memmove memset mkstemp munmap nanosleep newlocale _NSGetExecutablePath pclose _pclose poll popen _popen posix_fadvise posix_fallocate posix_madvise posix_memalign posix_spawnp pow pread pwrite qsort_r raise rand_r readlink readdir_r realpath select seekdir setlocale sqrt setvbuf stat strchr strerror_r strrchr strcspn strdup strpbrk strspn strstr strtod strtod_l strtol strtoul symlink sysconf sigemptyset sigaction spawnvp strerror strlcat strlcpy strcasecmp strncasecmp telldir tempnam times ulltostr usleep utime vsprintf vsnprintf waitpid _wfopen _wstat])
+AC_CHECK_FUNCS([atoll atexit cabs carg cimag creal clock ctime_r directio _exit execvp fchmod floor fork ftime ftruncate getc_unlocked getcwd getpid getexecname getdtablesize getpagesize getrlimit getrusage gettimeofday gmtime_r j0 j1 lltostr localtime_r lstat memmove memset mkstemp munmap nanosleep newlocale _NSGetExecutablePath pclose _pclose poll popen _popen posix_fadvise posix_fallocate posix_madvise posix_memalign posix_spawnp pow pread pwrite qsort_r raise rand_r readlink readdir_r realpath select seekdir setlocale sqrt setvbuf stat strchr strerror_r strrchr strcspn strdup strpbrk strspn strstr strtod strtod_l strtol strtoul symlink sysconf sigemptyset sigaction spawnvp strerror strlcat strlcpy strcasecmp strncasecmp telldir tempnam times ulltostr uselocale usleep utime vsprintf vsnprintf vsnprintf_l waitpid _wfopen _wstat])
 
 #
 # Check for clock_gettime().
index 790014af464b26778e2e53be7c8edc21635cee50..edd97211655f54124f80ac4a7b062759435a3ec1 100644 (file)
@@ -13,7 +13,7 @@
   See the License for the specific language governing permissions and
   limitations under the License.
 
-  MagickCore localre private methods.
+  MagickCore locale private methods.
 */
 #ifndef _MAGICKCORE_LOCALE_PRIVATE_H
 #define _MAGICKCORE_LOCALE_PRIVATE_H
 extern "C" {
 #endif
 
+extern MagickExport locale_t
+  AcquireMagickLocale(void);
+
+extern MagickExport void
+  DestroyMagickLocale(void);
+
 #if defined(__cplusplus) || defined(c_plusplus)
 }
 #endif
index 4cbe278eb3f017ae991991234f74b91f250be0cb..d86f3e437e751ab3cc335eb2ef5116de4581a54c 100644 (file)
@@ -85,6 +85,9 @@ static SplayTreeInfo
 
 static volatile MagickBooleanType
   instantiate_locale = MagickFalse;
+
+static volatile locale_t
+  locale_cache = (locale_t) NULL;
 \f
 /*
   Forward declarations.
@@ -98,6 +101,37 @@ static MagickBooleanType
 %                                                                             %
 %                                                                             %
 %                                                                             %
++   A c q u i r e M a g i c k L o c a l e                                     %
+%                                                                             %
+%                                                                             %
+%                                                                             %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+%  AcquireMagickLocale() allocates the C locale object, or (locale_t) 0 with
+%  errno set if it cannot be acquired.
+%
+%  The format of the AcquireMagickLocale method is:
+%
+%      locale_t AcquireMagickLocale(void)
+%
+*/
+MagickExport locale_t AcquireMagickLocale(void)
+{
+#if defined(MAGICKCORE_HAVE_NEWLOCALE)
+  if (locale_cache == (locale_t) NULL)
+    locale_cache=newlocale(LC_ALL_MASK,"C",(locale_t) 0);
+#elif defined(MAGICKCORE_WINDOWS_SUPPORT)
+  if (locale_cache == (locale_t) NULL)
+    locale_cache=_create_locale(LC_ALL,"C");
+#endif
+  return(locale_cache);
+}
+\f
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%                                                                             %
+%                                                                             %
+%                                                                             %
 %   D e s t r o y L o c a l e O p t i o n s                                   %
 %                                                                             %
 %                                                                             %
@@ -134,6 +168,37 @@ MagickExport LinkedListInfo *DestroyLocaleOptions(LinkedListInfo *messages)
 %                                                                             %
 %                                                                             %
 %                                                                             %
++   D e s t r o y M a g i c k L o c a l e                                     %
+%                                                                             %
+%                                                                             %
+%                                                                             %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+%  DestroyMagickLocale() releases the resources allocated for a locale object
+%  returned by a call to the AcquireMagickLocale() method.
+%
+%  The format of the DestroyMagickLocale method is:
+%
+%      void DestroyMagickLocale(void)
+%
+*/
+MagickExport void DestroyMagickLocale(void)
+{
+#if defined(MAGICKCORE_HAVE_NEWLOCALE)
+  if (locale_cache != (locale_t) NULL)
+    freelocale(locale_cache);
+#elif defined(MAGICKCORE_WINDOWS_SUPPORT)
+  if (locale_cache != (locale_t) NULL)
+    _free_locale(locale_cache);
+#endif
+  locale_cache=(locale_t) NULL;
+}
+\f
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%                                                                             %
+%                                                                             %
+%                                                                             %
 +   G e t L o c a l e I n f o _                                               %
 %                                                                             %
 %                                                                             %
@@ -1091,8 +1156,7 @@ MagickExport void LocaleComponentTerminus(void)
   if (locale_semaphore == (SemaphoreInfo *) NULL)
     AcquireSemaphoreInfo(&locale_semaphore);
   LockSemaphoreInfo(locale_semaphore);
-  if (locale_list != (SplayTreeInfo *) NULL)
-    locale_list=DestroySplayTree(locale_list);
+  DestroyMagickLocale();
   instantiate_locale=MagickFalse;
   UnlockSemaphoreInfo(locale_semaphore);
   DestroySemaphoreInfo(&locale_semaphore);
index 43755b363ce7e41d50794bfa1f24cb075f474065..af13311a8248001d30f5a289ae723a659b6d6685 100644 (file)
 #define MAGICKCORE_HAVE_UNISTD_H 1
 #endif
 
+/* Define to 1 if you have the `uselocale' function. */
+#ifndef MAGICKCORE_HAVE_USELOCALE
+#define MAGICKCORE_HAVE_USELOCALE 1
+#endif
+
 /* Define to 1 if you have the `usleep' function. */
 #ifndef MAGICKCORE_HAVE_USLEEP
 #define MAGICKCORE_HAVE_USLEEP 1
index e91d98771f2c72400904a9abe9c9eba467675d13..10786ad4c7ab7ff6dbf3c65246213815041e91f1 100644 (file)
@@ -45,6 +45,7 @@
 #include "magick/exception.h"
 #include "magick/exception-private.h"
 #include "magick/list.h"
+#include "magick/locale-private.h"
 #include "magick/log.h"
 #include "magick/memory_.h"
 #include "magick/property.h"
@@ -1093,8 +1094,37 @@ MagickExport ssize_t FormatMagickStringList(char *string,const size_t length,
   int
     n;
 
-#if defined(MAGICKCORE_HAVE_VSNPRINTF)
+#if defined(MAGICKCORE_HAVE_VSNPRINTF_L)
+  {
+    locale_t
+      locale;
+
+    locale=AcquireMagickLocale();
+    if (locale == (locale_t) NULL)
+      n=vsnprintf(string,length,format,operands);
+    else
+      n=vsnprintf_l(string,length,format,operands);
+  }
+#elif defined(MAGICKCORE_HAVE_VSNPRINTF)
+#if defined(MAGICKCORE_HAVE_USELOCALE)
+  {
+    locale_t
+      locale,
+      previous_locale;
+
+    locale=AcquireMagickLocale();
+    if (locale == (locale_t) NULL)
+      n=vsnprintf(string,length,format,operands);
+    else
+      {
+        previous_locale=uselocale(locale);
+        n=vsnprintf(string,length,format,operands);
+        uselocale(previous_locale);
+      }
+  }
+#else
   n=vsnprintf(string,length,format,operands);
+#endif
 #else
   n=vsprintf(string,format,operands);
 #endif
@@ -1914,7 +1944,7 @@ MagickExport char **StringToArgv(const char *text,int *argc)
   {
     while (isspace((int) ((unsigned char) *p)) != 0)
       p++;
-    if (*p == '\0') 
+    if (*p == '\0')
       break;
     (*argc)++;
     if (*p == '"')
@@ -1983,7 +2013,10 @@ MagickExport char **StringToArgv(const char *text,int *argc)
 %                                                                             %
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %
-%  StringToDouble() returns the contents of a file as a string.
+%  StringToDouble() interprets the string as a floating point number and
+%  returns its value as a double. If sentinal is not a null pointer, the
+%  method also sets the value pointed by sentinal to point to the first
+%  character after the number.
 %
 %  The format of the StringToDouble method is:
 %
@@ -1991,7 +2024,7 @@ MagickExport char **StringToArgv(const char *text,int *argc)
 %
 %  A description of each parameter follows:
 %
-%    o value:  the string value.
+%    o value: the string value.
 %
 %    o sentinal:  if sentinal is not NULL, a pointer to the character after the
 %      last character used in the conversion is stored in the location
@@ -2000,6 +2033,16 @@ MagickExport char **StringToArgv(const char *text,int *argc)
 */
 MagickExport double StringToDouble(const char *value,char **sentinal)
 {
+#if defined(MAGICKCORE_HAVE_STRTOD_L)
+  {
+    locale_t
+      locale;
+
+    locale=AcquireMagickLocale();
+    if (locale != (locale_t) NULL)
+      return(strtod_l(value,sentinal,locale));
+  }
+#endif
   return(strtod(value,sentinal));
 }
 \f
index e359ded5c1f7131b22479314512289be7713a6c5..d4fdf1512175ba4fb0040b2bb3565c80f35e6887 100644 (file)
@@ -27,14 +27,14 @@ extern "C" {
 */
 #define MagickPackageName "ImageMagick"
 #define MagickCopyright  "Copyright (C) 1999-2011 ImageMagick Studio LLC"
-#define MagickSVNRevision  "4448"
+#define MagickSVNRevision  "4455"
 #define MagickLibVersion  0x669
 #define MagickLibVersionText  "6.6.9"
 #define MagickLibVersionNumber  4,0,1
 #define MagickLibAddendum  "-10"
 #define MagickLibInterface  4
 #define MagickLibMinInterface  4
-#define MagickReleaseDate  "2011-05-18"
+#define MagickReleaseDate  "2011-05-19"
 #define MagickChangeDate   "20110516"
 #define MagickAuthoritativeURL  "http://www.imagemagick.org"
 #if defined(MAGICKCORE_OPENMP_SUPPORT)