diff options
Diffstat (limited to 'mesalib/src/mesa/drivers')
-rw-r--r-- | mesalib/src/mesa/drivers/dri/common/drisw_util.c | 12 | ||||
-rw-r--r-- | mesalib/src/mesa/drivers/dri/common/xmlconfig.c | 30 | ||||
-rw-r--r-- | mesalib/src/mesa/drivers/dri/swrast/swrast.c | 6 |
3 files changed, 24 insertions, 24 deletions
diff --git a/mesalib/src/mesa/drivers/dri/common/drisw_util.c b/mesalib/src/mesa/drivers/dri/common/drisw_util.c index 0ec124ae5..d69274854 100644 --- a/mesalib/src/mesa/drivers/dri/common/drisw_util.c +++ b/mesalib/src/mesa/drivers/dri/common/drisw_util.c @@ -68,7 +68,7 @@ driCreateNewScreen(int scrn, const __DRIextension **extensions, *driver_configs = driDriverAPI.InitScreen(psp); if (*driver_configs == NULL) { - FREE(psp); + free(psp); return NULL; } @@ -79,7 +79,7 @@ static void driDestroyScreen(__DRIscreen *psp) { if (psp) { driDriverAPI.DestroyScreen(psp); - FREE(psp); + free(psp); } } @@ -178,7 +178,7 @@ driCreateContextAttribs(__DRIscreen *screen, int api, if (!driDriverAPI.CreateContext(mesa_api, modes, pcp, major_version, minor_version, flags, error, shareCtx)) { - FREE(pcp); + free(pcp); return NULL; } @@ -209,7 +209,7 @@ driDestroyContext(__DRIcontext *pcp) { if (pcp) { driDriverAPI.DestroyContext(pcp); - FREE(pcp); + free(pcp); } } @@ -289,7 +289,7 @@ static void dri_put_drawable(__DRIdrawable *pdp) return; driDriverAPI.DestroyBuffer(pdp); - FREE(pdp); + free(pdp); } } @@ -311,7 +311,7 @@ driCreateNewDrawable(__DRIscreen *psp, dri_get_drawable(pdp); if (!driDriverAPI.CreateBuffer(psp, pdp, &config->modes, GL_FALSE)) { - FREE(pdp); + free(pdp); return NULL; } diff --git a/mesalib/src/mesa/drivers/dri/common/xmlconfig.c b/mesalib/src/mesa/drivers/dri/common/xmlconfig.c index 6d1d5ec61..929748400 100644 --- a/mesalib/src/mesa/drivers/dri/common/xmlconfig.c +++ b/mesalib/src/mesa/drivers/dri/common/xmlconfig.c @@ -86,7 +86,7 @@ static const char *__getProgramName () { #endif #if !defined(GET_PROGRAM_NAME) -# if defined(__OpenBSD__) || defined(NetBSD) || defined(__UCLIBC__) +# if defined(__OpenBSD__) || defined(NetBSD) || defined(__UCLIBC__) || defined(ANDROID) /* This is a hack. It's said to work on OpenBSD, NetBSD and GNU. * Rogelio M.Serrano Jr. reported it's also working with UCLIBC. It's * used as a last resort, if there is no documented facility available. */ @@ -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(); } @@ -382,9 +382,9 @@ static GLboolean parseRanges (driOptionInfo *info, const XML_Char *string) { else range = NULL; } - FREE (cp); + free(cp); if (i < nRanges) { - FREE (ranges); + free(ranges); return GL_FALSE; } else assert (range == NULL); @@ -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 { @@ -990,7 +990,7 @@ void driParseConfigFiles (driOptionCache *cache, const driOptionCache *info, } if (filenames[1]) - FREE (filenames[1]); + free(filenames[1]); } void driDestroyOptionInfo (driOptionCache *info) { @@ -999,18 +999,18 @@ void driDestroyOptionInfo (driOptionCache *info) { GLuint i, size = 1 << info->tableSize; for (i = 0; i < size; ++i) { if (info->info[i].name) { - FREE (info->info[i].name); + free(info->info[i].name); if (info->info[i].ranges) - FREE (info->info[i].ranges); + free(info->info[i].ranges); } } - FREE (info->info); + free(info->info); } } void driDestroyOptionCache (driOptionCache *cache) { if (cache->values) - FREE (cache->values); + free(cache->values); } GLboolean driCheckOption (const driOptionCache *cache, const char *name, diff --git a/mesalib/src/mesa/drivers/dri/swrast/swrast.c b/mesalib/src/mesa/drivers/dri/swrast/swrast.c index 9aed2f6e6..5ce1eb029 100644 --- a/mesalib/src/mesa/drivers/dri/swrast/swrast.c +++ b/mesalib/src/mesa/drivers/dri/swrast/swrast.c @@ -268,7 +268,7 @@ swrast_delete_renderbuffer(struct gl_renderbuffer *rb) TRACE; free(xrb->Base.Buffer); - free(xrb); + _mesa_delete_renderbuffer(rb); } /* see bytes_per_line in libGL */ @@ -504,7 +504,7 @@ drawable_fail: if (drawable) free(drawable->row); - FREE(drawable); + free(drawable); return GL_FALSE; } @@ -806,7 +806,7 @@ dri_create_context(gl_api api, context_fail: - FREE(ctx); + free(ctx); return GL_FALSE; } |