summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2005-09-16 18:14:24 +0000
committerBrian Paul <[email protected]>2005-09-16 18:14:24 +0000
commitaa2069586d434dd0487b0daa2b583efe801a0d51 (patch)
treecac0a05d5ebc786ae80d18080b1ad2896cac8cc6 /src/mesa/main
parent3cc67cb8cd1302c20218dda70599523102a29e10 (diff)
use mesa import wrappers, bug 4468
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/imports.c13
-rw-r--r--src/mesa/main/imports.h2
-rw-r--r--src/mesa/main/texcompress_fxt1.c4
-rw-r--r--src/mesa/main/texenvprogram.c8
-rw-r--r--src/mesa/main/texobj.c2
5 files changed, 22 insertions, 7 deletions
diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c
index fec0d338448..8d39f77b410 100644
--- a/src/mesa/main/imports.c
+++ b/src/mesa/main/imports.c
@@ -259,6 +259,19 @@ _mesa_bzero( void *dst, size_t n )
#endif
}
+/** Wrapper around either memcmp() or xf86memcmp() */
+int
+_mesa_memcmp( const void *s1, const void *s2, size_t n )
+{
+#if defined(XFree86LOADER) && defined(IN_MODULE)
+ return xf86memcmp( s1, s2, n );
+#elif defined(SUNOS4)
+ return memcmp( (char *) s1, (char *) s2, (int) n );
+#else
+ return memcmp(s1, s2, n);
+#endif
+}
+
/*@}*/
diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h
index 27cc1a57f78..134eff84b34 100644
--- a/src/mesa/main/imports.h
+++ b/src/mesa/main/imports.h
@@ -613,6 +613,8 @@ _mesa_memset16( unsigned short *dst, unsigned short val, size_t n );
extern void
_mesa_bzero( void *dst, size_t n );
+extern int
+_mesa_memcmp( const void *s1, const void *s2, size_t n );
extern double
_mesa_sin(double a);
diff --git a/src/mesa/main/texcompress_fxt1.c b/src/mesa/main/texcompress_fxt1.c
index 748824194ce..5fc41fa6bc9 100644
--- a/src/mesa/main/texcompress_fxt1.c
+++ b/src/mesa/main/texcompress_fxt1.c
@@ -474,7 +474,7 @@ fxt1_choose (GLfloat vec[][MAX_COMP], GLint nv,
} hist[N_TEXELS];
GLint lenh = 0;
- memset(hist, 0, sizeof(hist));
+ _mesa_memset(hist, 0, sizeof(hist));
for (k = 0; k < n; k++) {
GLint l;
@@ -1268,7 +1268,7 @@ fxt1_quantize (GLuint *cc, const GLubyte *lines[], GLint comps)
if (comps == 3) {
/* make the whole block opaque */
- memset(input, -1, sizeof(input));
+ _mesa_memset(input, -1, sizeof(input));
}
/* 8 texels each line */
diff --git a/src/mesa/main/texenvprogram.c b/src/mesa/main/texenvprogram.c
index 68dcc51b4c5..2ffb1774a34 100644
--- a/src/mesa/main/texenvprogram.c
+++ b/src/mesa/main/texenvprogram.c
@@ -480,7 +480,7 @@ emit_op(struct texenv_fragment_program *p,
GLuint nr = p->program->Base.NumInstructions++;
struct fp_instruction *inst = &p->program->Instructions[nr];
- memset(inst, 0, sizeof(*inst));
+ _mesa_memset(inst, 0, sizeof(*inst));
inst->Opcode = op;
emit_arg( &inst->SrcReg[0], src0 );
@@ -792,7 +792,7 @@ static struct ureg emit_combine( struct texenv_fragment_program *p,
emit_arith( p, FP_OPCODE_MAD, tmp0, WRITEMASK_XYZW, 0,
two, src[0], neg1);
- if (memcmp(&src[0], &src[1], sizeof(struct ureg)) == 0)
+ if (_mesa_memcmp(&src[0], &src[1], sizeof(struct ureg)) == 0)
tmp1 = tmp0;
else
emit_arith( p, FP_OPCODE_MAD, tmp1, WRITEMASK_XYZW, 0,
@@ -1039,7 +1039,7 @@ static void create_new_program(struct state_key *key, GLcontext *ctx,
emit_arith( &p, FP_OPCODE_ADD, out, WRITEMASK_XYZ, 0, cf, s, undef );
emit_arith( &p, FP_OPCODE_MOV, out, WRITEMASK_W, 0, cf, undef, undef );
}
- else if (memcmp(&cf, &out, sizeof(cf)) != 0) {
+ else if (_mesa_memcmp(&cf, &out, sizeof(cf)) != 0) {
/* Will wind up in here if no texture enabled or a couple of
* other scenarios (GL_REPLACE for instance).
*/
@@ -1093,7 +1093,7 @@ static void *search_cache( struct texenvprog_cache *cache,
struct texenvprog_cache *c;
for (c = cache; c; c = c->next) {
- if (c->hash == hash && memcmp(c->key, key, keysize) == 0)
+ if (c->hash == hash && _mesa_memcmp(c->key, key, keysize) == 0)
return c->data;
}
diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c
index 5594cd9382b..3c74e748722 100644
--- a/src/mesa/main/texobj.c
+++ b/src/mesa/main/texobj.c
@@ -246,7 +246,7 @@ _mesa_test_texobj_completeness( const GLcontext *ctx,
/* Always need the base level image */
if (!t->Image[0][baseLevel]) {
char s[100];
- sprintf(s, "obj %p (%d) Image[baseLevel=%d] == NULL",
+ _mesa_sprintf(s, "obj %p (%d) Image[baseLevel=%d] == NULL",
(void *) t, t->Name, baseLevel);
incomplete(t, s);
t->Complete = GL_FALSE;