Remove _mesa_memset in favor of plain memset.

This may break the SUNOS4 build, but it's no longer relevant.
This commit is contained in:
Kenneth Graunke
2010-02-18 23:51:00 -08:00
committed by Kristian Høgsberg
parent c7ac486261
commit 26f8fad145
23 changed files with 26 additions and 46 deletions
+2 -5
View File
@@ -48,17 +48,14 @@
# include <string.h>
# define _mesa_malloc(b) malloc(b)
# define _mesa_free(m) free(m)
# define _mesa_memset memset
#else
# ifdef XFree86Server
# include <os.h>
# include <string.h>
# define _mesa_malloc(b) xalloc(b)
# define _mesa_free(m) xfree(m)
# define _mesa_memset memset
# else
# include <X11/Xlibint.h>
# define _mesa_memset memset
# define _mesa_malloc(b) Xmalloc(b)
# define _mesa_free(m) Xfree(m)
# endif /* XFree86Server */
@@ -133,7 +130,7 @@ _gl_copy_visual_to_context_mode(__GLcontextModes * mode,
{
__GLcontextModes *const next = mode->next;
(void) _mesa_memset(mode, 0, sizeof(__GLcontextModes));
(void) memset(mode, 0, sizeof(__GLcontextModes));
mode->next = next;
mode->visualID = config->vid;
@@ -402,7 +399,7 @@ _gl_context_modes_create(unsigned count, size_t minimum_size)
break;
}
(void) _mesa_memset(*next, 0, size);
(void) memset(*next, 0, size);
(*next)->visualID = GLX_DONT_CARE;
(*next)->visualType = GLX_DONT_CARE;
(*next)->visualRating = GLX_NONE;
+1 -1
View File
@@ -349,7 +349,7 @@ void brw_upload_state(struct brw_context *brw)
* state atoms are ordered correctly in the list.
*/
struct brw_state_flags examined, prev;
_mesa_memset(&examined, 0, sizeof(examined));
memset(&examined, 0, sizeof(examined));
prev = *state;
for (i = 0; i < Elements(atoms); i++) {
@@ -105,7 +105,7 @@ static void brw_update_sampler_state(struct wm_sampler_entry *key,
dri_bo *sdc_bo,
struct brw_sampler_state *sampler)
{
_mesa_memset(sampler, 0, sizeof(*sampler));
memset(sampler, 0, sizeof(*sampler));
switch (key->minfilter) {
case GL_NEAREST:
-1
View File
@@ -899,7 +899,6 @@ EXPORTS
_mesa_init_renderbuffer
_mesa_initialize_context
_mesa_make_current
_mesa_memset
_mesa_new_array_object
_mesa_new_framebuffer
_mesa_new_program
-1
View File
@@ -54,7 +54,6 @@ EXPORTS
_mesa_init_driver_functions
_mesa_initialize_context
_mesa_make_current
_mesa_memset
_mesa_new_buffer_object
_mesa_new_texture_object
_mesa_problem
+1 -1
View File
@@ -336,7 +336,7 @@ clear_32bit_ximage(GLcontext *ctx, struct xmesa_renderbuffer *xrb,
GLuint *ptr4 = (GLuint *) xrb->ximage->data;
if (pixel == 0) {
/* common case */
_mesa_memset(ptr4, pixel, 4 * n);
memset(ptr4, pixel, 4 * n);
}
else {
GLuint i;
-1
View File
@@ -134,7 +134,6 @@ def PrintTail():
print '\t_mesa_init_default_imports'
print '\t_mesa_initialize_context'
print '\t_mesa_make_current'
print '\t_mesa_memset'
print '\t_mesa_new_buffer_object'
print '\t_mesa_new_texture_object'
print '\t_mesa_problem'
+2 -2
View File
@@ -49,8 +49,8 @@
*/
#define BITSET_COPY(x, y) memcpy( (x), (y), sizeof (x) )
#define BITSET_EQUAL(x, y) (_mesa_memcmp( (x), (y), sizeof (x) ) == 0)
#define BITSET_ZERO(x) _mesa_memset( (x), 0, sizeof (x) )
#define BITSET_ONES(x) _mesa_memset( (x), 0xff, sizeof (x) )
#define BITSET_ZERO(x) memset( (x), 0, sizeof (x) )
#define BITSET_ONES(x) memset( (x), 0xff, sizeof (x) )
#define BITSET_BITWORD(b) ((b) / BITSET_WORDBITS)
#define BITSET_BIT(b) (1 << ((b) % BITSET_WORDBITS))
+1 -1
View File
@@ -1590,7 +1590,7 @@ create_new_program( const struct state_key *key,
{
struct tnl_program p;
_mesa_memset(&p, 0, sizeof(p));
memset(&p, 0, sizeof(p));
p.state = key;
p.program = program;
p.eye_position = undef;
-11
View File
@@ -244,17 +244,6 @@ _mesa_realloc(void *oldBuffer, size_t oldSize, size_t newSize)
return newBuffer;
}
/** Wrapper around memset() */
void
_mesa_memset( void *dst, int val, size_t n )
{
#if defined(SUNOS4)
memset( (char *) dst, (int) val, (int) n );
#else
memset(dst, val, n);
#endif
}
/**
* Fill memory with a constant 16bit word.
* \param dst destination pointer.
+1 -4
View File
@@ -74,7 +74,7 @@ extern "C" {
/** Copy \p BYTES bytes from \p SRC into \p DST */
#define MEMCPY( DST, SRC, BYTES) memcpy(DST, SRC, BYTES)
/** Set \p N bytes in \p DST to \p VAL */
#define MEMSET( DST, VAL, N ) _mesa_memset(DST, VAL, N)
#define MEMSET( DST, VAL, N ) memset(DST, VAL, N)
/*@}*/
@@ -543,9 +543,6 @@ _mesa_exec_free( void *addr );
extern void *
_mesa_realloc( void *oldBuffer, size_t oldSize, size_t newSize );
extern void
_mesa_memset( void *dst, int val, size_t n );
extern void
_mesa_memset16( unsigned short *dst, unsigned short val, size_t n );
+2 -2
View File
@@ -548,7 +548,7 @@ put_mono_row_ubyte3(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count,
ASSERT(rb->DataType == GL_UNSIGNED_BYTE);
if (!mask && val0 == val1 && val1 == val2) {
/* optimized case */
_mesa_memset(dst, val0, 3 * count);
memset(dst, val0, 3 * count);
}
else {
GLuint i;
@@ -1319,7 +1319,7 @@ put_mono_row_alpha8(GLcontext *ctx, struct gl_renderbuffer *arb, GLuint count,
}
}
else {
_mesa_memset(dst, val, count);
memset(dst, val, count);
}
}
+2 -2
View File
@@ -406,7 +406,7 @@ fxt1_choose (GLfloat vec[][MAX_COMP], GLint nv,
} hist[N_TEXELS];
GLint lenh = 0;
_mesa_memset(hist, 0, sizeof(hist));
memset(hist, 0, sizeof(hist));
for (k = 0; k < n; k++) {
GLint l;
@@ -1211,7 +1211,7 @@ fxt1_quantize (GLuint *cc, const GLubyte *lines[], GLint comps)
if (comps == 3) {
/* make the whole block opaque */
_mesa_memset(input, -1, sizeof(input));
memset(input, -1, sizeof(input));
}
/* 8 texels each line */
+1 -1
View File
@@ -1416,7 +1416,7 @@ create_new_program(GLcontext *ctx, struct state_key *key,
GLuint unit;
struct ureg cf, out;
_mesa_memset(&p, 0, sizeof(p));
memset(&p, 0, sizeof(p));
p.state = key;
p.program = program;
+1 -1
View File
@@ -96,7 +96,7 @@ create_dst_mod_str(GLuint mod)
{
static char ret_str[1024];
_mesa_memset(ret_str, 0, 1024);
memset(ret_str, 0, 1024);
if (mod & GL_2X_BIT_ATI)
strncat(ret_str, "|2X", 1024);
+1 -1
View File
@@ -88,7 +88,7 @@ rehash(struct gl_program_cache *cache)
size = cache->size * 3;
items = (struct cache_item**) _mesa_malloc(size * sizeof(*items));
_mesa_memset(items, 0, size * sizeof(*items));
memset(items, 0, size * sizeof(*items));
for (i = 0; i < cache->size; i++)
for (c = cache->items[i]; c; c = next) {
+2 -2
View File
@@ -146,8 +146,8 @@ _mesa_add_parameter(struct gl_program_parameter_list *paramList,
paramList->NumParameters = oldNum + sz4;
_mesa_memset(&paramList->Parameters[oldNum], 0,
sz4 * sizeof(struct gl_program_parameter));
memset(&paramList->Parameters[oldNum], 0,
sz4 * sizeof(struct gl_program_parameter));
for (i = 0; i < sz4; i++) {
struct gl_program_parameter *p = paramList->Parameters + oldNum + i;
+1 -1
View File
@@ -809,7 +809,7 @@ _mesa_find_used_registers(const struct gl_program *prog,
{
GLuint i, j;
_mesa_memset(used, 0, usedSize);
memset(used, 0, usedSize);
for (i = 0; i < prog->NumInstructions; i++) {
const struct prog_instruction *inst = prog->Instructions + i;
+1 -1
View File
@@ -1438,7 +1438,7 @@ _swrast_clear_depth_buffer( GLcontext *ctx, struct gl_renderbuffer *rb )
/* optimized case */
GLushort *dst = (GLushort *) rb->GetPointer(ctx, rb, x, y);
GLuint len = width * height * sizeof(GLushort);
_mesa_memset(dst, (clearValue & 0xff), len);
memset(dst, (clearValue & 0xff), len);
}
else {
/* general case */
+2 -2
View File
@@ -869,7 +869,7 @@ _swrast_write_index_span( GLcontext *ctx, SWspan *span)
span->writeAll = GL_FALSE;
}
else {
_mesa_memset(span->array->mask, 1, span->end);
memset(span->array->mask, 1, span->end);
span->writeAll = GL_TRUE;
}
@@ -1338,7 +1338,7 @@ _swrast_write_rgba_span( GLcontext *ctx, SWspan *span)
span->writeAll = GL_FALSE;
}
else {
_mesa_memset(span->array->mask, 1, span->end);
memset(span->array->mask, 1, span->end);
span->writeAll = GL_TRUE;
}
+2 -2
View File
@@ -1181,7 +1181,7 @@ _swrast_clear_stencil_buffer( GLcontext *ctx, struct gl_renderbuffer *rb )
/* Note: bottom-to-top raster assumed! */
GLubyte *stencil = (GLubyte *) rb->GetPointer(ctx, rb, x, y);
GLuint len = width * height * sizeof(GLubyte);
_mesa_memset(stencil, clearVal, len);
memset(stencil, clearVal, len);
}
else {
/* general case */
@@ -1189,7 +1189,7 @@ _swrast_clear_stencil_buffer( GLcontext *ctx, struct gl_renderbuffer *rb )
for (i = 0; i < height; i++) {
GLvoid *stencil = rb->GetPointer(ctx, rb, x, y + i);
if (rb->DataType == GL_UNSIGNED_BYTE) {
_mesa_memset(stencil, clearVal, width);
memset(stencil, clearVal, width);
}
else {
_mesa_memset16((short unsigned int*) stencil, clearVal, width);
+1 -1
View File
@@ -648,7 +648,7 @@ void _tnl_generate_sse_emit( GLcontext *ctx )
return;
}
_mesa_memset(&p, 0, sizeof(p));
memset(&p, 0, sizeof(p));
p.ctx = ctx;
p.inputs_safe = 0; /* for now */
+1 -1
View File
@@ -629,7 +629,7 @@ void vf_generate_sse_emit( struct vertex_fetch *vf )
return;
}
_mesa_memset(&p, 0, sizeof(p));
memset(&p, 0, sizeof(p));
p.vf = vf;
p.inputs_safe = 0; /* for now */