summaryrefslogtreecommitdiff
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2012-09-01 07:47:24 -0600
committerBrian Paul <brianp@vmware.com>2012-09-01 07:47:24 -0600
commit33bb8c051df3f2561c7b4a5ad7abefa3fce99d37 (patch)
treea41341f3c9608a1540f9b26ab8eb9039d9aa09ac /src/mesa/drivers
parent66d6ba2d83255e2fe051760faf8256e897af5a64 (diff)
mesa: s/MALLOC/malloc/
v2: replace instances in dri/common/ dirs Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/common/xmlconfig.c14
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_bufferobj.c2
-rw-r--r--src/mesa/drivers/x11/xfonts.c2
-rw-r--r--src/mesa/drivers/x11/xm_api.c4
-rw-r--r--src/mesa/drivers/x11/xm_buffer.c2
5 files changed, 12 insertions, 12 deletions
diff --git a/src/mesa/drivers/dri/common/xmlconfig.c b/src/mesa/drivers/dri/common/xmlconfig.c
index 039e98a6b0..e48ceb4a93 100644
--- a/src/mesa/drivers/dri/common/xmlconfig.c
+++ b/src/mesa/drivers/dri/common/xmlconfig.c
@@ -142,10 +142,10 @@ static GLuint countOptions (const driOptionCache *cache) {
return count;
}
-/** \brief Like strdup but using MALLOC and with error checking. */
+/** \brief Like strdup but using malloc and with error checking. */
#define XSTRDUP(dest,source) do { \
GLuint len = strlen (source); \
- if (!(dest = MALLOC (len+1))) { \
+ if (!(dest = malloc(len+1))) { \
fprintf (stderr, "%s: %d: out of memory.\n", __FILE__, __LINE__); \
abort(); \
} \
@@ -347,7 +347,7 @@ static GLboolean parseRanges (driOptionInfo *info, const XML_Char *string) {
if (*range == ',')
++nRanges;
- if ((ranges = MALLOC (nRanges*sizeof(driOptionRange))) == NULL) {
+ if ((ranges = malloc(nRanges*sizeof(driOptionRange))) == NULL) {
fprintf (stderr, "%s: %d: out of memory.\n", __FILE__, __LINE__);
abort();
}
@@ -702,8 +702,8 @@ void driParseOptionInfo (driOptionCache *info,
GLuint size, log2size;
for (size = 1, log2size = 0; size < minSize; size <<= 1, ++log2size);
info->tableSize = log2size;
- info->info = CALLOC (size * sizeof (driOptionInfo));
- info->values = CALLOC (size * sizeof (driOptionValue));
+ info->info = calloc(size, sizeof (driOptionInfo));
+ info->values = calloc(size, sizeof (driOptionValue));
if (info->info == NULL || info->values == NULL) {
fprintf (stderr, "%s: %d: out of memory.\n", __FILE__, __LINE__);
abort();
@@ -895,7 +895,7 @@ static void optConfEndElem (void *userData, const XML_Char *name) {
static void initOptionCache (driOptionCache *cache, const driOptionCache *info) {
cache->info = info->info;
cache->tableSize = info->tableSize;
- cache->values = MALLOC ((1<<info->tableSize) * sizeof (driOptionValue));
+ cache->values = malloc((1<<info->tableSize) * sizeof (driOptionValue));
if (cache->values == NULL) {
fprintf (stderr, "%s: %d: out of memory.\n", __FILE__, __LINE__);
abort();
@@ -959,7 +959,7 @@ void driParseConfigFiles (driOptionCache *cache, const driOptionCache *info,
if ((home = getenv ("HOME"))) {
GLuint len = strlen (home);
- filenames[1] = MALLOC (len + 7+1);
+ filenames[1] = malloc(len + 7+1);
if (filenames[1] == NULL)
__driUtilMessage ("Can't allocate memory for %s/.drirc.", home);
else {
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_bufferobj.c b/src/mesa/drivers/dri/nouveau/nouveau_bufferobj.c
index 1782714652..1d7db52c43 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_bufferobj.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_bufferobj.c
@@ -90,7 +90,7 @@ nouveau_bufferobj_data(struct gl_context *ctx, GLenum target, GLsizeiptrARB size
(size < 512 && usage == GL_DYNAMIC_DRAW_ARB) ||
context_chipset(ctx) < 0x10) {
/* Heuristic: keep it in system ram */
- nbo->sys = MALLOC(size);
+ nbo->sys = malloc(size);
} else {
/* Get a hardware BO */
diff --git a/src/mesa/drivers/x11/xfonts.c b/src/mesa/drivers/x11/xfonts.c
index 91f819b8df..ac275bb6ae 100644
--- a/src/mesa/drivers/x11/xfonts.c
+++ b/src/mesa/drivers/x11/xfonts.c
@@ -247,7 +247,7 @@ Fake_glXUseXFont(Font font, int first, int count, int listbase)
max_bm_width = (max_width + 7) / 8;
max_bm_height = max_height;
- bm = (GLubyte *) MALLOC((max_bm_width * max_bm_height) * sizeof(GLubyte));
+ bm = (GLubyte *) malloc((max_bm_width * max_bm_height) * sizeof(GLubyte));
if (!bm) {
XFreeFontInfo(NULL, fs, 1);
_mesa_error(NULL, GL_OUT_OF_MEMORY,
diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c
index 249bbdf9a4..6696f70f5b 100644
--- a/src/mesa/drivers/x11/xm_api.c
+++ b/src/mesa/drivers/x11/xm_api.c
@@ -171,7 +171,7 @@ bits_per_pixel( XMesaVisual xmv )
/* Create a temporary XImage */
img = XCreateImage( dpy, visinfo->visual, visinfo->depth,
ZPixmap, 0, /*format, offset*/
- (char*) MALLOC(8), /*data*/
+ (char*) malloc(8), /*data*/
1, 1, /*width, height*/
32, /*bitmap_pad*/
0 /*bytes_per_line*/
@@ -781,7 +781,7 @@ XMesaVisual XMesaCreateVisual( XMesaDisplay *display,
* the struct but we may need some of the information contained in it
* at a later time.
*/
- v->visinfo = (XVisualInfo *) MALLOC(sizeof(*visinfo));
+ v->visinfo = (XVisualInfo *) malloc(sizeof(*visinfo));
if(!v->visinfo) {
free(v);
return NULL;
diff --git a/src/mesa/drivers/x11/xm_buffer.c b/src/mesa/drivers/x11/xm_buffer.c
index eb68f940f8..242b6de4c2 100644
--- a/src/mesa/drivers/x11/xm_buffer.c
+++ b/src/mesa/drivers/x11/xm_buffer.c
@@ -203,7 +203,7 @@ alloc_back_buffer(XMesaBuffer b, GLuint width, GLuint height)
_mesa_warning(NULL, "alloc_back_buffer: XCreateImage failed.\n");
return;
}
- b->backxrb->ximage->data = (char *) MALLOC(b->backxrb->ximage->height
+ b->backxrb->ximage->data = (char *) malloc(b->backxrb->ximage->height
* b->backxrb->ximage->bytes_per_line);
if (!b->backxrb->ximage->data) {
_mesa_warning(NULL, "alloc_back_buffer: MALLOC failed.\n");