mesa: replace _mesa_bzero() with memset()
This commit is contained in:
@@ -70,7 +70,7 @@
|
||||
void
|
||||
_mesa_init_driver_functions(struct dd_function_table *driver)
|
||||
{
|
||||
_mesa_bzero(driver, sizeof(*driver));
|
||||
memset(driver, 0, sizeof(*driver));
|
||||
|
||||
driver->GetString = NULL; /* REQUIRED! */
|
||||
driver->UpdateState = NULL; /* REQUIRED! */
|
||||
|
@@ -72,7 +72,7 @@ static void build_state(
|
||||
{
|
||||
int unit;
|
||||
|
||||
_mesa_bzero(state, sizeof(*state));
|
||||
memset(state, 0, sizeof(*state));
|
||||
|
||||
for(unit = 0; unit < 16; ++unit) {
|
||||
if (fp->Base.ShadowSamplers & (1 << unit)) {
|
||||
|
@@ -295,7 +295,7 @@ _mesa_initialize_buffer_object( struct gl_buffer_object *obj,
|
||||
{
|
||||
(void) target;
|
||||
|
||||
_mesa_bzero(obj, sizeof(struct gl_buffer_object));
|
||||
memset(obj, 0, sizeof(struct gl_buffer_object));
|
||||
_glthread_INIT_MUTEX(obj->Mutex);
|
||||
obj->RefCount = 1;
|
||||
obj->Name = name;
|
||||
|
@@ -9711,7 +9711,7 @@ _mesa_init_display_list(GLcontext *ctx)
|
||||
|
||||
/* zero-out the instruction size table, just once */
|
||||
if (!tableInitialized) {
|
||||
_mesa_bzero(InstSize, sizeof(InstSize));
|
||||
memset(InstSize, 0, sizeof(InstSize));
|
||||
tableInitialized = GL_TRUE;
|
||||
}
|
||||
|
||||
|
@@ -127,7 +127,7 @@ _mesa_initialize_window_framebuffer(struct gl_framebuffer *fb,
|
||||
assert(fb);
|
||||
assert(visual);
|
||||
|
||||
_mesa_bzero(fb, sizeof(struct gl_framebuffer));
|
||||
memset(fb, 0, sizeof(struct gl_framebuffer));
|
||||
|
||||
_glthread_INIT_MUTEX(fb->Mutex);
|
||||
|
||||
@@ -169,7 +169,7 @@ _mesa_initialize_user_framebuffer(struct gl_framebuffer *fb, GLuint name)
|
||||
assert(fb);
|
||||
assert(name);
|
||||
|
||||
_mesa_bzero(fb, sizeof(struct gl_framebuffer));
|
||||
memset(fb, 0, sizeof(struct gl_framebuffer));
|
||||
|
||||
fb->Name = name;
|
||||
fb->RefCount = 1;
|
||||
@@ -526,7 +526,7 @@ _mesa_update_framebuffer_visual(struct gl_framebuffer *fb)
|
||||
{
|
||||
GLuint i;
|
||||
|
||||
_mesa_bzero(&fb->Visual, sizeof(fb->Visual));
|
||||
memset(&fb->Visual, 0, sizeof(fb->Visual));
|
||||
fb->Visual.rgbMode = GL_TRUE; /* assume this */
|
||||
|
||||
#if 0 /* this _might_ be needed */
|
||||
|
@@ -257,17 +257,6 @@ _mesa_memset16( unsigned short *dst, unsigned short val, size_t n )
|
||||
*dst++ = val;
|
||||
}
|
||||
|
||||
/** Wrapper around either memset() or bzero() */
|
||||
void
|
||||
_mesa_bzero( void *dst, size_t n )
|
||||
{
|
||||
#if defined(__FreeBSD__)
|
||||
bzero( dst, n );
|
||||
#else
|
||||
memset( dst, 0, n );
|
||||
#endif
|
||||
}
|
||||
|
||||
/*@}*/
|
||||
|
||||
|
||||
|
@@ -541,9 +541,6 @@ _mesa_realloc( void *oldBuffer, size_t oldSize, size_t newSize );
|
||||
extern void
|
||||
_mesa_memset16( unsigned short *dst, unsigned short val, size_t n );
|
||||
|
||||
extern void
|
||||
_mesa_bzero( void *dst, size_t n );
|
||||
|
||||
extern double
|
||||
_mesa_sin(double a);
|
||||
|
||||
|
@@ -706,7 +706,7 @@ put_mono_row_ubyte4(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count,
|
||||
ASSERT(rb->Format == MESA_FORMAT_RGBA8888);
|
||||
if (!mask && val == 0) {
|
||||
/* common case */
|
||||
_mesa_bzero(dst, count * 4 * sizeof(GLubyte));
|
||||
memset(dst, 0, count * 4 * sizeof(GLubyte));
|
||||
}
|
||||
else {
|
||||
/* general case */
|
||||
@@ -868,7 +868,7 @@ put_mono_row_ushort4(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count,
|
||||
ASSERT(rb->DataType == GL_UNSIGNED_SHORT || rb->DataType == GL_SHORT);
|
||||
if (!mask && val0 == 0 && val1 == 0 && val2 == 0 && val3 == 0) {
|
||||
/* common case for clearing accum buffer */
|
||||
_mesa_bzero(dst, count * 4 * sizeof(GLushort));
|
||||
memset(dst, 0, count * 4 * sizeof(GLushort));
|
||||
}
|
||||
else {
|
||||
GLuint i;
|
||||
|
@@ -106,7 +106,7 @@ _mesa_initialize_texture_object( struct gl_texture_object *obj,
|
||||
target == GL_TEXTURE_1D_ARRAY_EXT ||
|
||||
target == GL_TEXTURE_2D_ARRAY_EXT);
|
||||
|
||||
_mesa_bzero(obj, sizeof(*obj));
|
||||
memset(obj, 0, sizeof(*obj));
|
||||
/* init the non-zero fields */
|
||||
_glthread_INIT_MUTEX(obj->Mutex);
|
||||
obj->RefCount = 1;
|
||||
|
@@ -1483,7 +1483,7 @@ _mesa_parse_nv_fragment_program(GLcontext *ctx, GLenum dstTarget,
|
||||
programString[len] = 0;
|
||||
|
||||
/* Get ready to parse */
|
||||
_mesa_bzero(&parseState, sizeof(struct parse_state));
|
||||
memset(&parseState, 0, sizeof(struct parse_state));
|
||||
parseState.ctx = ctx;
|
||||
parseState.start = programString;
|
||||
parseState.program = program;
|
||||
|
@@ -40,7 +40,7 @@ _mesa_init_instructions(struct prog_instruction *inst, GLuint count)
|
||||
{
|
||||
GLuint i;
|
||||
|
||||
_mesa_bzero(inst, count * sizeof(struct prog_instruction));
|
||||
memset(inst, 0, count * sizeof(struct prog_instruction));
|
||||
|
||||
for (i = 0; i < count; i++) {
|
||||
inst[i].SrcReg[0].File = PROGRAM_UNDEFINED;
|
||||
|
@@ -240,7 +240,7 @@ _mesa_init_program_struct( GLcontext *ctx, struct gl_program *prog,
|
||||
(void) ctx;
|
||||
if (prog) {
|
||||
GLuint i;
|
||||
_mesa_bzero(prog, sizeof(*prog));
|
||||
memset(prog, 0, sizeof(*prog));
|
||||
prog->Id = id;
|
||||
prog->Target = target;
|
||||
prog->Resident = GL_TRUE;
|
||||
|
@@ -241,7 +241,7 @@ alloc_local_temp(slang_emit_info *emitInfo, slang_ir_storage *temp, GLint size)
|
||||
{
|
||||
assert(size >= 1);
|
||||
assert(size <= 4);
|
||||
_mesa_bzero(temp, sizeof(*temp));
|
||||
memset(temp, 0, sizeof(*temp));
|
||||
temp->Size = size;
|
||||
temp->File = PROGRAM_TEMPORARY;
|
||||
temp->Index = -1;
|
||||
@@ -1136,7 +1136,7 @@ emit_clamp(slang_emit_info *emitInfo, slang_ir_node *n)
|
||||
* dest for this clamp() is an output reg, we can't use that reg for
|
||||
* the intermediate result. Use a temp register instead.
|
||||
*/
|
||||
_mesa_bzero(&tmpNode, sizeof(tmpNode));
|
||||
memset(&tmpNode, 0, sizeof(tmpNode));
|
||||
if (!alloc_node_storage(emitInfo, &tmpNode, n->Store->Size)) {
|
||||
return NULL;
|
||||
}
|
||||
|
@@ -419,7 +419,7 @@ slang_type_specifier_compatible(const slang_type_specifier * x,
|
||||
GLboolean
|
||||
slang_typeinfo_construct(slang_typeinfo * ti)
|
||||
{
|
||||
_mesa_bzero(ti, sizeof(*ti));
|
||||
memset(ti, 0, sizeof(*ti));
|
||||
slang_type_specifier_ctr(&ti->spec);
|
||||
ti->array_len = 0;
|
||||
return GL_TRUE;
|
||||
|
@@ -259,7 +259,7 @@ depth_test_span16( GLcontext *ctx, GLuint n,
|
||||
}
|
||||
break;
|
||||
case GL_NEVER:
|
||||
_mesa_bzero(mask, n * sizeof(GLubyte));
|
||||
memset(mask, 0, n * sizeof(GLubyte));
|
||||
break;
|
||||
default:
|
||||
_mesa_problem(ctx, "Bad depth func in depth_test_span16");
|
||||
@@ -488,7 +488,7 @@ depth_test_span32( GLcontext *ctx, GLuint n,
|
||||
}
|
||||
break;
|
||||
case GL_NEVER:
|
||||
_mesa_bzero(mask, n * sizeof(GLubyte));
|
||||
memset(mask, 0, n * sizeof(GLubyte));
|
||||
break;
|
||||
default:
|
||||
_mesa_problem(ctx, "Bad depth func in depth_test_span32");
|
||||
@@ -844,7 +844,7 @@ direct_depth_test_pixels16(GLcontext *ctx, GLushort *zStart, GLuint stride,
|
||||
break;
|
||||
case GL_NEVER:
|
||||
/* depth test never passes */
|
||||
_mesa_bzero(mask, n * sizeof(GLubyte));
|
||||
memset(mask, 0, n * sizeof(GLubyte));
|
||||
break;
|
||||
default:
|
||||
_mesa_problem(ctx, "Bad depth func in direct_depth_test_pixels");
|
||||
@@ -1090,7 +1090,7 @@ direct_depth_test_pixels32(GLcontext *ctx, GLuint *zStart, GLuint stride,
|
||||
break;
|
||||
case GL_NEVER:
|
||||
/* depth test never passes */
|
||||
_mesa_bzero(mask, n * sizeof(GLubyte));
|
||||
memset(mask, 0, n * sizeof(GLubyte));
|
||||
break;
|
||||
default:
|
||||
_mesa_problem(ctx, "Bad depth func in direct_depth_test_pixels");
|
||||
@@ -1260,7 +1260,7 @@ _swrast_read_depth_span_float( GLcontext *ctx, struct gl_renderbuffer *rb,
|
||||
|
||||
if (!rb) {
|
||||
/* really only doing this to prevent FP exceptions later */
|
||||
_mesa_bzero(depth, n * sizeof(GLfloat));
|
||||
memset(depth, 0, n * sizeof(GLfloat));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1269,7 +1269,7 @@ _swrast_read_depth_span_float( GLcontext *ctx, struct gl_renderbuffer *rb,
|
||||
if (y < 0 || y >= (GLint) rb->Height ||
|
||||
x + n <= 0 || x >= (GLint) rb->Width) {
|
||||
/* span is completely outside framebuffer */
|
||||
_mesa_bzero(depth, n * sizeof(GLfloat));
|
||||
memset(depth, 0, n * sizeof(GLfloat));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1326,7 +1326,7 @@ _swrast_read_depth_span_uint( GLcontext *ctx, struct gl_renderbuffer *rb,
|
||||
|
||||
if (!rb) {
|
||||
/* really only doing this to prevent FP exceptions later */
|
||||
_mesa_bzero(depth, n * sizeof(GLuint));
|
||||
memset(depth, 0, n * sizeof(GLuint));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1337,7 +1337,7 @@ _swrast_read_depth_span_uint( GLcontext *ctx, struct gl_renderbuffer *rb,
|
||||
if (y < 0 || y >= (GLint) rb->Height ||
|
||||
x + n <= 0 || x >= (GLint) rb->Width) {
|
||||
/* span is completely outside framebuffer */
|
||||
_mesa_bzero(depth, n * sizeof(GLfloat));
|
||||
memset(depth, 0, n * sizeof(GLfloat));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -148,8 +148,7 @@ init_machine(GLcontext *ctx, struct gl_program_machine *machine,
|
||||
|
||||
if (program->Base.Target == GL_FRAGMENT_PROGRAM_NV) {
|
||||
/* Clear temporary registers (undefined for ARB_f_p) */
|
||||
_mesa_bzero(machine->Temporaries,
|
||||
MAX_PROGRAM_TEMPS * 4 * sizeof(GLfloat));
|
||||
memset(machine->Temporaries, 0, MAX_PROGRAM_TEMPS * 4 * sizeof(GLfloat));
|
||||
}
|
||||
|
||||
/* ARB_fragment_coord_conventions */
|
||||
|
@@ -1579,7 +1579,7 @@ _swrast_read_rgba_span( GLcontext *ctx, struct gl_renderbuffer *rb,
|
||||
if (y < 0 || y >= bufHeight || x + (GLint) n < 0 || x >= bufWidth) {
|
||||
/* completely above, below, or right */
|
||||
/* XXX maybe leave rgba values undefined? */
|
||||
_mesa_bzero(rgba, 4 * n * sizeof(GLchan));
|
||||
memset(rgba, 0, 4 * n * sizeof(GLchan));
|
||||
}
|
||||
else {
|
||||
GLint skip, length;
|
||||
@@ -1642,7 +1642,7 @@ _swrast_read_index_span( GLcontext *ctx, struct gl_renderbuffer *rb,
|
||||
|
||||
if (y < 0 || y >= bufHeight || x + (GLint) n < 0 || x >= bufWidth) {
|
||||
/* completely above, below, or right */
|
||||
_mesa_bzero(index, n * sizeof(GLuint));
|
||||
memset(index, 0, n * sizeof(GLuint));
|
||||
}
|
||||
else {
|
||||
GLint skip, length;
|
||||
|
Reference in New Issue
Block a user