]> sourceware.org Git - glibc.git/commitdiff
Update.
authorUlrich Drepper <drepper@redhat.com>
Mon, 8 Nov 1999 23:44:12 +0000 (23:44 +0000)
committerUlrich Drepper <drepper@redhat.com>
Mon, 8 Nov 1999 23:44:12 +0000 (23:44 +0000)
1999-11-08  Andreas Jaeger  <aj@suse.de>

* locale/findlocale.c (_nl_find_locale): Free normalized_codeset;
this fixes a memory leak (closes PR libc/1435).

* intl/l10nflist.c (_nl_normalize_codeset): Update comment to
reflect memory allocation.

* intl/loadinfo.h: Comment _nl_normalize_codeset, comment memory
allocation in _nl_explode_name.

1999-11-06  Andreas Jaeger  <aj@suse.de>

* time/tzset.c: Use __libc_lock_define_initialized for tzset_lock
to initialize it.
Reported by wes@surety.com, closes PR libc/1432.

1999-11-05  Geoff Keating  <geoffk@cygnus.com>

* sysdeps/powerpc/fpu/bits/fenv.h: Don't put commas at the end of
enumerator lists (-pedantic complains).
(feraiseexcept): Use i#*X as the constraint.  Fix a bug in the
test for 'one bit set'.
(feclearexcept): Likewise.

ChangeLog
intl/l10nflist.c
intl/loadinfo.h
locale/findlocale.c
sysdeps/powerpc/fpu/bits/fenv.h
sysdeps/unix/sysv/linux/setrlimit.c
time/tzset.c

index f06e03a4c09b2567e3708eb58c1f1bfda6e40a23..f9bfe76692e7937bbec5abc87b7aa5b7395a9be9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,28 @@
+1999-11-08  Andreas Jaeger  <aj@suse.de>
+
+       * locale/findlocale.c (_nl_find_locale): Free normalized_codeset;
+       this fixes a memory leak (closes PR libc/1435).
+
+       * intl/l10nflist.c (_nl_normalize_codeset): Update comment to
+       reflect memory allocation.
+
+       * intl/loadinfo.h: Comment _nl_normalize_codeset, comment memory
+       allocation in _nl_explode_name.
+
+1999-11-06  Andreas Jaeger  <aj@suse.de>
+
+       * time/tzset.c: Use __libc_lock_define_initialized for tzset_lock
+       to initialize it.
+       Reported by wes@surety.com, closes PR libc/1432.
+
+1999-11-05  Geoff Keating  <geoffk@cygnus.com>
+
+       * sysdeps/powerpc/fpu/bits/fenv.h: Don't put commas at the end of
+       enumerator lists (-pedantic complains).
+       (feraiseexcept): Use i#*X as the constraint.  Fix a bug in the
+       test for 'one bit set'.
+       (feclearexcept): Likewise.
+
 1999-11-05  Ulrich Drepper  <drepper@cygnus.com>
 
        * sysdeps/unix/sysv/linux/setrlimit.c: New file.
index 5edba3a4d89580fcca9fca7a2ba49df1a97f0fa2..871b42814e0e8957f09dee64bf3cfcafaf249eb2 100644 (file)
@@ -352,7 +352,8 @@ _nl_make_l10nflist (l10nfile_list, dirlist, dirlist_len, mask, language,
 \f
 /* Normalize codeset name.  There is no standard for the codeset
    names.  Normalization allows the user to use any of the common
-   names.  */
+   names.  The return value is dynamically allocated and has to be
+   freed by the caller.  */
 const char *
 _nl_normalize_codeset (codeset, name_len)
      const char *codeset;
index ea1bf05806f92b13240b7369f32e89820d0f7f23..09b2fdf6ac7a07eaa03aff9cacbd23d165d61108 100644 (file)
@@ -54,6 +54,10 @@ struct loaded_l10nfile
 };
 
 
+/* Normalize codeset name.  There is no standard for the codeset
+   names.  Normalization allows the user to use any of the common
+   names.  The return value is dynamically allocated and has to be
+   freed by the caller.  */
 extern const char *_nl_normalize_codeset PARAMS ((const char *codeset,
                                                  size_t name_len));
 
@@ -70,6 +74,8 @@ _nl_make_l10nflist PARAMS ((struct loaded_l10nfile **l10nfile_list,
 
 extern const char *_nl_expand_alias PARAMS ((const char *name));
 
+/* normalized_codeset is dynamically allocated and has to be freed by
+   the caller.  */
 extern int _nl_explode_name PARAMS ((char *name, const char **language,
                                     const char **modifier,
                                     const char **territory,
index c6717f108d5035df37ab32deae8af2a9a7905ef2..9cb22068f7bf30eb9d98d43f36818a3ea58c0547 100644 (file)
@@ -141,6 +141,10 @@ _nl_find_locale (const char *locale_path, size_t locale_path_len,
        between two locales would slowly eat up all memory.  */
     free ((void *) loc_name);
 
+  /* The space for normalized_codeset is dynamically allocated.  Free it.  */
+  if (mask & XPG_NORM_CODESET)
+    free ((void *) normalized_codeset);
+
   if (locale_file->decided == 0)
     _nl_load_locale (locale_file, category);
 
index f86d02d01494824d4d47a0c43579de2100f5d2d2..459821f48193e8c5cf0f3ff16c4b77200239076d 100644 (file)
@@ -86,7 +86,7 @@ enum
 # define FE_INVALID_SQRT       FE_INVALID_SQRT
 
     /* Conversion-to-integer of a NaN or a number too large or too small.  */
-    FE_INVALID_INTEGER_CONVERSION = 1 << (31 - 23),
+    FE_INVALID_INTEGER_CONVERSION = 1 << (31 - 23)
 # define FE_INVALID_INTEGER_CONVERSION FE_INVALID_INTEGER_CONVERSION
 
 # define FE_ALL_INVALID \
@@ -110,7 +110,7 @@ enum
 #define FE_TOWARDZERO  FE_TOWARDZERO
     FE_UPWARD = 2,
 #define FE_UPWARD      FE_UPWARD
-    FE_DOWNWARD = 3,
+    FE_DOWNWARD = 3
 #define FE_DOWNWARD    FE_DOWNWARD
   };
 
@@ -152,27 +152,33 @@ extern const fenv_t *__fe_nomask_env __P ((void));
                             : "=r"(__fegetround_result) : : "cr7");          \
                     __fegetround_result & 3; }))
 
+/* The weird 'i#*X' constraints on the following suppress a gcc
+   warning when __excepts is not a constant.  Otherwise, they mean the
+   same as just plain 'i'.  */
+
 /* Inline definition for feraiseexcept.  */
 # define feraiseexcept(__excepts) \
-  (__extension__ ({ if (__builtin_constant_p (__excepts)                     \
-                       && ((__excepts) & -(__excepts)) == 0                  \
-                       && (__excepts) != FE_INVALID) {                       \
-                     if ((__excepts) != 0)                                   \
-                       __asm__ __volatile__                                  \
-                         ("mtfsb1 %0"                                        \
-                          : : "i"(32 - __builtin_ffs (__excepts)));          \
-                   } else                                                    \
-                     (feraiseexcept) (__excepts); }))
+  ((__builtin_constant_p (__excepts)                                         \
+    && ((__excepts) & ((__excepts)-1)) == 0                                  \
+    && (__excepts) != FE_INVALID)                                            \
+   ? ((__excepts) != 0                                                       \
+      ? (__extension__ ({ __asm__ __volatile__                               \
+                         ("mtfsb1 %s0"                                       \
+                          : : "i#*X"(__builtin_ffs (__excepts)));            \
+                         (void)0; }))                                        \
+      : (void)0)                                                             \
+   : (feraiseexcept) (__excepts))
 
 /* Inline definition for feclearexcept.  */
 # define feclearexcept(__excepts) \
-  (__extension__  ({ if (__builtin_constant_p (__excepts)                    \
-                        && ((__excepts) & -(__excepts)) == 0                 \
-                        && (__excepts) != FE_INVALID) {                      \
-                      if ((__excepts) != 0)                                  \
-                        __asm__ __volatile__                                 \
-                          ("mtfsb0 %0"                                       \
-                           : : "i"(32 - __builtin_ffs (__excepts)));         \
-                    } else                                                   \
-                      (feclearexcept) (__excepts); }))
+  ((__builtin_constant_p (__excepts)                                         \
+    && ((__excepts) & ((__excepts)-1)) == 0                                  \
+    && (__excepts) != FE_INVALID)                                            \
+   ? ((__excepts) != 0                                                       \
+      ? (__extension__ ({ __asm__ __volatile__                               \
+                         ("mtfsb0 %s0"                                       \
+                          : : "i#*X"(__builtin_ffs (__excepts)));            \
+                         (void)0; }))                                        \
+      : (void)0)                                                             \
+   : (feclearexcept) (__excepts))
 #endif /* __OPTIMIZE__ && !_SOFT_FLOAT */
index 674a2cf8c3618e93fd98294972f1de0d7b09572c..13161593534ba68460f24dcb84ad6791eb70ca9c 100644 (file)
@@ -23,7 +23,7 @@
 #include <sysdep.h>
 #include <sys/syscall.h>
 
-#include "../kernel-features.h"
+#include "kernel-features.h"
 
 
 /* Linux 2.3.25 introduced a new system call since the types used for
index 6af2fbaf004770cc17d4186db58c58b71040b083..db08a47e86fc2b49c464594a8c7db6a48762aec3 100644 (file)
@@ -38,7 +38,7 @@ weak_alias (__daylight, daylight)
 weak_alias (__timezone, timezone)
 
 /* This locks all the state variables in tzfile.c and this file.  */
-__libc_lock_define (static, tzset_lock)
+__libc_lock_define_initialized (static, tzset_lock)
 
 
 #define        min(a, b)       ((a) < (b) ? (a) : (b))
This page took 0.058419 seconds and 5 git commands to generate.