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! */
{
int unit;
- _mesa_bzero(state, sizeof(*state));
+ memset(state, 0, sizeof(*state));
for(unit = 0; unit < 16; ++unit) {
if (fp->Base.ShadowSamplers & (1 << unit)) {
{
(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;
/* zero-out the instruction size table, just once */
if (!tableInitialized) {
- _mesa_bzero(InstSize, sizeof(InstSize));
+ memset(InstSize, 0, sizeof(InstSize));
tableInitialized = GL_TRUE;
}
assert(fb);
assert(visual);
- _mesa_bzero(fb, sizeof(struct gl_framebuffer));
+ memset(fb, 0, sizeof(struct gl_framebuffer));
_glthread_INIT_MUTEX(fb->Mutex);
assert(fb);
assert(name);
- _mesa_bzero(fb, sizeof(struct gl_framebuffer));
+ memset(fb, 0, sizeof(struct gl_framebuffer));
fb->Name = name;
fb->RefCount = 1;
{
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 */
*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
-}
-
/*@}*/
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);
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 */
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;
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;
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;
{
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;
(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;
{
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;
* 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;
}
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;
}
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");
}
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");
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");
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");
if (!rb) {
/* really only doing this to prevent FP exceptions later */
- _mesa_bzero(depth, n * sizeof(GLfloat));
+ memset(depth, 0, n * sizeof(GLfloat));
return;
}
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;
}
if (!rb) {
/* really only doing this to prevent FP exceptions later */
- _mesa_bzero(depth, n * sizeof(GLuint));
+ memset(depth, 0, n * sizeof(GLuint));
return;
}
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;
}
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 */
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;
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;