summaryrefslogtreecommitdiff
path: root/src/mesa/shader
diff options
context:
space:
mode:
authorKarl Schultz <kschultz@freedesktop.org>2005-05-05 21:08:07 +0000
committerKarl Schultz <kschultz@freedesktop.org>2005-05-05 21:08:07 +0000
commit6258b76c49f49a56a7c713914b798e80c6553b06 (patch)
tree2cc86a17fdda506fc9c86daba7ff3900d2d64996 /src/mesa/shader
parent203dcb733d36cc91107554b0d323ed8ccef6e105 (diff)
Port Mesa to build on a P64 platform (e.g., Win64). P64 platforms
use 64-bit pointers and 32-bit longs. So, operations like casting pointers to unsigned long and back to pointer won't work. glheader.h now includes files to define uintptr_t, which should instead be used for this sort of operation. It is an integer type that is the same size as a pointer.
Diffstat (limited to 'src/mesa/shader')
-rw-r--r--src/mesa/shader/arbprogparse.c2
-rw-r--r--src/mesa/shader/arbprogram.c2
-rw-r--r--src/mesa/shader/grammar.h8
-rw-r--r--src/mesa/shader/grammar_mesa.c12
-rw-r--r--src/mesa/shader/nvfragparse.c2
-rw-r--r--src/mesa/shader/nvprogram.c2
-rw-r--r--src/mesa/shader/nvvertparse.c2
7 files changed, 15 insertions, 15 deletions
diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c
index d46e5a3a83..ffb451d8ae 100644
--- a/src/mesa/shader/arbprogparse.c
+++ b/src/mesa/shader/arbprogparse.c
@@ -3884,7 +3884,7 @@ static int extension_is_supported (const GLubyte *ext)
{
const GLubyte *extensions = GL_CALL(GetString)(GL_EXTENSIONS);
const GLubyte *end = extensions + _mesa_strlen ((const char *) extensions);
- const GLint ext_len = _mesa_strlen ((const char *) ext);
+ const GLint ext_len = (GLint)_mesa_strlen ((const char *) ext);
while (extensions < end)
{
diff --git a/src/mesa/shader/arbprogram.c b/src/mesa/shader/arbprogram.c
index ad8683f00b..43baab4b0f 100644
--- a/src/mesa/shader/arbprogram.c
+++ b/src/mesa/shader/arbprogram.c
@@ -509,7 +509,7 @@ _mesa_GetProgramivARB(GLenum target, GLenum pname, GLint *params)
switch (pname) {
case GL_PROGRAM_LENGTH_ARB:
- *params = prog->String ? _mesa_strlen((char *) prog->String) : 0;
+ *params = prog->String ? (GLint)_mesa_strlen((char *) prog->String) : 0;
break;
case GL_PROGRAM_FORMAT_ARB:
*params = prog->Format;
diff --git a/src/mesa/shader/grammar.h b/src/mesa/shader/grammar.h
index 622cdb2398..3b537f6040 100644
--- a/src/mesa/shader/grammar.h
+++ b/src/mesa/shader/grammar.h
@@ -36,13 +36,13 @@ extern "C" {
#endif
void grammar_alloc_free (void *);
-void *grammar_alloc_malloc (unsigned int);
-void *grammar_alloc_realloc (void *, unsigned int, unsigned int);
+void *grammar_alloc_malloc (size_t);
+void *grammar_alloc_realloc (void *, size_t, size_t);
void *grammar_memory_copy (void *, const void *, unsigned int);
int grammar_string_compare (const byte *, const byte *);
-int grammar_string_compare_n (const byte *, const byte *, unsigned int);
+int grammar_string_compare_n (const byte *, const byte *, size_t);
byte *grammar_string_copy (byte *, const byte *);
-byte *grammar_string_copy_n (byte *, const byte *, unsigned int);
+byte *grammar_string_copy_n (byte *, const byte *, size_t);
byte *grammar_string_duplicate (const byte *);
unsigned int grammar_string_length (const byte *);
diff --git a/src/mesa/shader/grammar_mesa.c b/src/mesa/shader/grammar_mesa.c
index 0aadac58bc..eb962505bf 100644
--- a/src/mesa/shader/grammar_mesa.c
+++ b/src/mesa/shader/grammar_mesa.c
@@ -40,17 +40,17 @@ void grammar_alloc_free (void *ptr)
_mesa_free (ptr);
}
-void *grammar_alloc_malloc (unsigned int size)
+void *grammar_alloc_malloc (size_t size)
{
return _mesa_malloc (size);
}
-void *grammar_alloc_realloc (void *ptr, unsigned int old_size, unsigned int size)
+void *grammar_alloc_realloc (void *ptr, size_t old_size, size_t size)
{
return _mesa_realloc (ptr, old_size, size);
}
-void *grammar_memory_copy (void *dst, const void * src, unsigned int size)
+void *grammar_memory_copy (void *dst, const void * src, size_t size)
{
return _mesa_memcpy (dst, src, size);
}
@@ -60,7 +60,7 @@ int grammar_string_compare (const byte *str1, const byte *str2)
return _mesa_strcmp ((const char *) str1, (const char *) str2);
}
-int grammar_string_compare_n (const byte *str1, const byte *str2, unsigned int n)
+int grammar_string_compare_n (const byte *str1, const byte *str2, size_t n)
{
return _mesa_strncmp ((const char *) str1, (const char *) str2, n);
}
@@ -70,7 +70,7 @@ byte *grammar_string_copy (byte *dst, const byte *src)
return (byte *) _mesa_strcpy ((char *) dst, (const char *) src);
}
-byte *grammar_string_copy_n (byte *dst, const byte *src, unsigned int n)
+byte *grammar_string_copy_n (byte *dst, const byte *src, size_t n)
{
return (byte *) _mesa_strncpy ((char *) dst, (const char *) src, n);
}
@@ -82,6 +82,6 @@ byte *grammar_string_duplicate (const byte *src)
unsigned int grammar_string_length (const byte *str)
{
- return _mesa_strlen ((const char *) str);
+ return (unsigned int)_mesa_strlen ((const char *) str);
}
diff --git a/src/mesa/shader/nvfragparse.c b/src/mesa/shader/nvfragparse.c
index e51ba314f5..f7e10b8242 100644
--- a/src/mesa/shader/nvfragparse.c
+++ b/src/mesa/shader/nvfragparse.c
@@ -373,7 +373,7 @@ Peek_Token(struct parse_state *parseState, GLubyte *token)
parseState->pos += (-i);
return GL_FALSE;
}
- len = _mesa_strlen((const char *) token);
+ len = (GLint)_mesa_strlen((const char *) token);
parseState->pos += (i - len);
return GL_TRUE;
}
diff --git a/src/mesa/shader/nvprogram.c b/src/mesa/shader/nvprogram.c
index 4db78a8cc7..4b89301764 100644
--- a/src/mesa/shader/nvprogram.c
+++ b/src/mesa/shader/nvprogram.c
@@ -266,7 +266,7 @@ _mesa_GetProgramivNV(GLuint id, GLenum pname, GLint *params)
*params = prog->Target;
return;
case GL_PROGRAM_LENGTH_NV:
- *params = prog->String ? _mesa_strlen((char *) prog->String) : 0;
+ *params = prog->String ?(GLint)_mesa_strlen((char *) prog->String) : 0;
return;
case GL_PROGRAM_RESIDENT_NV:
*params = prog->Resident;
diff --git a/src/mesa/shader/nvvertparse.c b/src/mesa/shader/nvvertparse.c
index 23a01c7617..c6fb72d931 100644
--- a/src/mesa/shader/nvvertparse.c
+++ b/src/mesa/shader/nvvertparse.c
@@ -233,7 +233,7 @@ Peek_Token(struct parse_state *parseState, GLubyte *token)
parseState->pos += (-i);
return GL_FALSE;
}
- len = _mesa_strlen((const char *) token);
+ len = (GLint)_mesa_strlen((const char *) token);
parseState->pos += (i - len);
return GL_TRUE;
}