aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Jansen <mithi@mithi.net>2008-12-02 02:33:24 +0100
committerThomas Jansen <mithi@mithi.net>2008-12-02 02:33:24 +0100
commitc252143d5147e541a42bf7bb2530e12c62962576 (patch)
treef7b043b1e34c615b7b5db6de28b1ce3d239b6125
parent2720585731eb6a39fece86fb675a644b8ea803ae (diff)
downloadmpd-c252143d5147e541a42bf7bb2530e12c62962576.tar.gz
mpd-c252143d5147e541a42bf7bb2530e12c62962576.tar.xz
mpd-c252143d5147e541a42bf7bb2530e12c62962576.zip
replaced mpd_malloc by G_GNUC_MALLOC
We want to remove gcc.h eventually. This takes care of all the G_GNUC_MALLOC macros.
-rw-r--r--src/strset.c2
-rw-r--r--src/strset.h4
-rw-r--r--src/utils.c8
-rw-r--r--src/utils.h11
4 files changed, 12 insertions, 13 deletions
diff --git a/src/strset.c b/src/strset.c
index 475266370..eee5b2901 100644
--- a/src/strset.c
+++ b/src/strset.c
@@ -47,7 +47,7 @@ static unsigned calc_hash(const char *p) {
return hash;
}
-mpd_malloc struct strset *strset_new(void)
+G_GNUC_MALLOC struct strset *strset_new(void)
{
struct strset *set = xcalloc(1, sizeof(*set));
return set;
diff --git a/src/strset.h b/src/strset.h
index 32a145f2b..65415061e 100644
--- a/src/strset.h
+++ b/src/strset.h
@@ -28,11 +28,11 @@
#ifndef MPD_STRSET_H
#define MPD_STRSET_H
-#include "gcc.h"
+#include <glib.h>
struct strset;
-mpd_malloc struct strset *strset_new(void);
+G_GNUC_MALLOC struct strset *strset_new(void);
void strset_free(struct strset *set);
diff --git a/src/utils.c b/src/utils.c
index 892f6f39f..9b75748da 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -76,7 +76,7 @@ int ipv6Supported(void)
#endif
}
-mpd_malloc char *xstrdup(const char *s)
+G_GNUC_MALLOC char *xstrdup(const char *s)
{
char *ret = strdup(s);
if (G_UNLIKELY(!ret))
@@ -86,7 +86,7 @@ mpd_malloc char *xstrdup(const char *s)
/* borrowed from git :) */
-mpd_malloc void *xmalloc(size_t size)
+G_GNUC_MALLOC void *xmalloc(size_t size)
{
void *ret;
@@ -98,7 +98,7 @@ mpd_malloc void *xmalloc(size_t size)
return ret;
}
-mpd_malloc void *xrealloc(void *ptr, size_t size)
+G_GNUC_MALLOC void *xrealloc(void *ptr, size_t size)
{
void *ret = realloc(ptr, size);
@@ -113,7 +113,7 @@ mpd_malloc void *xrealloc(void *ptr, size_t size)
return ret;
}
-mpd_malloc void *xcalloc(size_t nmemb, size_t size)
+G_GNUC_MALLOC void *xcalloc(size_t nmemb, size_t size)
{
void *ret;
diff --git a/src/utils.h b/src/utils.h
index 6e2d288fc..0990185ee 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -19,8 +19,7 @@
#ifndef MPD_UTILS_H
#define MPD_UTILS_H
-#include "gcc.h"
-
+#include <glib.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
@@ -74,13 +73,13 @@ static inline ssize_t xwrite(int fd, const void *buf, size_t len)
}
}
-mpd_malloc char *xstrdup(const char *s);
+G_GNUC_MALLOC char *xstrdup(const char *s);
-mpd_malloc void *xmalloc(size_t size);
+G_GNUC_MALLOC void *xmalloc(size_t size);
-mpd_malloc void *xrealloc(void *ptr, size_t size);
+G_GNUC_MALLOC void *xrealloc(void *ptr, size_t size);
-mpd_malloc void *xcalloc(size_t nmemb, size_t size);
+G_GNUC_MALLOC void *xcalloc(size_t nmemb, size_t size);
/**
* free a const pointer - unfortunately free() expects a non-const