Fixes for Visual Studio level 4 compiler warnings. trunk
authorRyan C. Gordon <icculus@icculus.org>
Fri, 09 May 2008 20:32:27 -0400
branchtrunk
changeset 307 42f6a7ba69e2
parent 306 053aaa9b4fb1
child 309 fe4e94d46cda
Fixes for Visual Studio level 4 compiler warnings.
mojoshader.c
mojoshader_opengl.c
--- a/mojoshader.c	Fri May 09 02:33:22 2008 -0400
+++ b/mojoshader.c	Fri May 09 20:32:27 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;
@@ -3863,7 +3863,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 02:33:22 2008 -0400
+++ b/mojoshader_opengl.c	Fri May 09 20:32:27 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;