Merged changes into my iBook's hg repo.
--- a/mojoshader.c Fri May 09 23:06:12 2008 -0400
+++ b/mojoshader.c Fri May 09 23:12:51 2008 -0400
@@ -388,9 +388,9 @@
return FAIL;
} // out_of_memory
-static inline void *Malloc(Context *ctx, const int len)
-{
- void *retval = ctx->malloc(len, ctx->malloc_data);
+static inline void *Malloc(Context *ctx, const size_t len)
+{
+ void *retval = ctx->malloc((int) len, ctx->malloc_data);
if (retval == NULL)
out_of_memory(ctx);
return retval;
@@ -3870,7 +3870,7 @@
else if (shader_is_pixel(ctx))
{
if (regtype == REG_TYPE_TEXTURE)
- add_attribute_register(ctx, regtype, regnum, 0, 0, writemask);
+ add_attribute_register(ctx, regtype, regnum, MOJOSHADER_USAGE_UNKNOWN, 0, writemask);
else if (regtype == REG_TYPE_SAMPLER)
{
const TextureType ttype = (const TextureType) ctx->dwords[0];
--- a/mojoshader_opengl.c Fri May 09 23:06:12 2008 -0400
+++ b/mojoshader_opengl.c Fri May 09 23:12:51 2008 -0400
@@ -177,7 +177,7 @@
static inline void *Malloc(const size_t len)
{
- void *retval = ctx->malloc_fn(len, ctx->malloc_data);
+ void *retval = ctx->malloc_fn((int) len, ctx->malloc_data);
if (retval == NULL)
set_error("out of memory");
return retval;
@@ -626,7 +626,7 @@
MOJOSHADER_glProgram *retval = NULL;
const GLhandleARB program = ctx->glCreateProgramObject();
int numregs = 0;
- uint32 const_count = 0;
+ int const_count = 0;
if (vshader != NULL) ctx->glAttachObject(program, vshader->handle);
if (pshader != NULL) ctx->glAttachObject(program, pshader->handle);
@@ -698,7 +698,7 @@
retval->constants = (GLfloat *) Malloc(sizeof (GLfloat) * const_count);
if (retval->constants == NULL)
goto link_program_fail;
- retval->constant_count = const_count;
+ retval->constant_count = (uint32) const_count;
} // if
return retval;