sed: replace ck_memdup with gnulib's xmemdup
* bootstrap.conf: Add gnulib's xalloc module.
* basicdefs.h (MEMDUP): Remove.
* sed/utils.{c,h} (ck_memdup): Remove.
This commit is contained in:
1 parent
007a417687
commit
f593b21980
4 files changed
+4
-10
No files matched your search
+3
-1
@@ -31,10 +31,12 @@
|
||||
/* type countT is used to keep track of line numbers, etc. */
|
||||
typedef unsigned long countT;
|
||||
|
||||
#include "xalloc.h"
|
||||
|
||||
/* some basic definitions to avoid undue promulgating of ugliness */
|
||||
#define MALLOC(n,t) ((t *)ck_malloc((n)*sizeof(t)))
|
||||
#define REALLOC(x,n,t) ((t *)ck_realloc((void *)(x),(n)*sizeof(t)))
|
||||
#define MEMDUP(x,n,t) ((t *)ck_memdup((void *)(x),(n)*sizeof(t)))
|
||||
#define MEMDUP(x,n,t) ((t *)xmemdup((x),(n)*sizeof(t)))
|
||||
#define OB_MALLOC(o,n,t) ((t *)(void *)obstack_alloc(o,(n)*sizeof(t)))
|
||||
|
||||
#define obstack_chunk_alloc ck_malloc
|
||||
|
||||
@@ -64,6 +64,7 @@ verify
|
||||
version-etc-fsf
|
||||
wcrtomb
|
||||
wctob
|
||||
xalloc
|
||||
'
|
||||
gnulib_name=libsed
|
||||
|
||||
|
||||
@@ -429,13 +429,6 @@ ck_strdup(const char *str)
|
||||
return strcpy(ret, str);
|
||||
}
|
||||
|
||||
/* Return a malloc()'d copy of a block of memory */
|
||||
void *
|
||||
ck_memdup(const void *buf, size_t len)
|
||||
{
|
||||
void *ret = ck_malloc(len);
|
||||
return memcpy(ret, buf, len);
|
||||
}
|
||||
|
||||
|
||||
/* Implement a variable sized buffer of `stuff'. We don't know what it is,
|
||||
|
||||
@@ -43,10 +43,8 @@ FILE * ck_mkstemp (char **p_filename, const char *tmpdir, const char *base,
|
||||
void ck_rename (const char *from, const char *to, const char *unlink_if_fail);
|
||||
|
||||
void *ck_malloc (size_t size);
|
||||
void *xmalloc (size_t size);
|
||||
void *ck_realloc (void *ptr, size_t size);
|
||||
char *ck_strdup (const char *str);
|
||||
void *ck_memdup (const void *buf, size_t len);
|
||||
|
||||
struct buffer *init_buffer (void);
|
||||
char *get_buffer (struct buffer const *b) _GL_ATTRIBUTE_PURE;
|
||||
|
||||
Reference in new issue
Block a user