Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
c252143d
Commit
c252143d
authored
Dec 02, 2008
by
Thomas Jansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
replaced mpd_malloc by G_GNUC_MALLOC
We want to remove gcc.h eventually. This takes care of all the G_GNUC_MALLOC macros.
parent
27205857
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
13 deletions
+12
-13
strset.c
src/strset.c
+1
-1
strset.h
src/strset.h
+2
-2
utils.c
src/utils.c
+4
-4
utils.h
src/utils.h
+5
-6
No files found.
src/strset.c
View file @
c252143d
...
...
@@ -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
;
...
...
src/strset.h
View file @
c252143d
...
...
@@ -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
);
...
...
src/utils.c
View file @
c252143d
...
...
@@ -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
;
...
...
src/utils.h
View file @
c252143d
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment