[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
CVS gss/gl
From: |
gss-commit |
Subject: |
CVS gss/gl |
Date: |
Tue, 05 Oct 2004 21:15:21 +0200 |
Update of /home/cvs/gss/gl
In directory dopio:/tmp/cvs-serv17343/gl
Modified Files:
Makefile.am xalloc.h xmalloc.c
Removed Files:
xstrdup.c
Log Message:
Update Gnulib.
Fix callers.
--- /home/cvs/gss/gl/Makefile.am 2004/08/16 16:34:42 1.17
+++ /home/cvs/gss/gl/Makefile.am 2004/10/05 19:15:20 1.18
@@ -10,7 +10,7 @@
# Generated by gnulib-tool.
#
# Invoked as: gnulib-tool --import
-# Reproduce by: gnulib-tool --import --dir=. --lib=libgl --source-base=gl
--m4-base=gl/m4 --libtool gethostname getopt gettext xalloc xgethostname
+# Reproduce by: gnulib-tool --import --dir=. --lib=libgl --source-base=gl
--m4-base=gl/m4 --libtool gethostname getopt gettext xalloc xgethostname
AUTOMAKE_OPTIONS = 1.8 gnits
@@ -39,7 +39,7 @@
libgl_la_SOURCES += gettext.h
-libgl_la_SOURCES += xalloc.h xmalloc.c xstrdup.c
+libgl_la_SOURCES += xalloc.h xmalloc.c
libgl_la_SOURCES += xgethostname.h xgethostname.c
--- /home/cvs/gss/gl/xalloc.h 2004/08/09 08:43:58 1.5
+++ /home/cvs/gss/gl/xalloc.h 2004/10/05 19:15:20 1.6
@@ -53,8 +53,8 @@
void *xnrealloc (void *p, size_t n, size_t s);
void *x2realloc (void *p, size_t *pn);
void *x2nrealloc (void *p, size_t *pn, size_t s);
-void *xclone (void const *p, size_t s);
-char *xstrdup (const char *str);
+void *xmemdup (void const *p, size_t s);
+char *xstrdup (char const *str);
/* Return 1 if an array of N objects, each of size S, cannot exist due
to size arithmetic overflow. S must be positive and N must be
@@ -71,17 +71,6 @@
# define xalloc_oversized(n, s) \
((size_t) (sizeof (ptrdiff_t) <= sizeof (size_t) ? -1 : -2) / (s) < (n))
-/* These macros are deprecated; they will go away soon, and are retained
- temporarily only to ease conversion to the functions described above. */
-# define CCLONE(p, n) xclone (p, (n) * sizeof *(p))
-# define CLONE(p) xclone (p, sizeof *(p))
-# define NEW(type, var) type *var = xmalloc (sizeof (type))
-# define XCALLOC(type, n) xcalloc (n, sizeof (type))
-# define XMALLOC(type, n) xnmalloc (n, sizeof (type))
-# define XREALLOC(p, type, n) xnrealloc (p, n, sizeof (type))
-# define XFREE(p) free (p)
-
-
# ifdef __cplusplus
}
# endif
--- /home/cvs/gss/gl/xmalloc.c 2004/08/09 08:43:58 1.9
+++ /home/cvs/gss/gl/xmalloc.c 2004/10/05 19:15:20 1.10
@@ -211,11 +211,19 @@
}
/* Clone an object P of size S, with error checking. There's no need
- for xnclone (P, N, S), since xclone (P, N * S) works without any
+ for xnmemdup (P, N, S), since xmemdup (P, N * S) works without any
need for an arithmetic overflow check. */
void *
-xclone (void const *p, size_t s)
+xmemdup (void const *p, size_t s)
{
return memcpy (xmalloc (s), p, s);
}
+
+/* Clone STRING. */
+
+char *
+xstrdup (char const *string)
+{
+ return xmemdup (string, strlen (string) + 1);
+}
- CVS gss/gl,
gss-commit <=