From e87b65986d18e9a251145233990d0e4fa787a2b7 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Fri, 9 May 2008 20:32:27 -0400 Subject: [PATCH] Fixes for Visual Studio level 4 compiler warnings. --HG-- branch : trunk --- mojoshader.c | 6 +++--- mojoshader_opengl.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mojoshader.c b/mojoshader.c index f6690951..f1ba6f5b 100644 --- a/mojoshader.c +++ b/mojoshader.c @@ -388,9 +388,9 @@ static inline int out_of_memory(Context *ctx) return FAIL; } // out_of_memory -static inline void *Malloc(Context *ctx, const int len) +static inline void *Malloc(Context *ctx, const size_t len) { - void *retval = ctx->malloc(len, ctx->malloc_data); + void *retval = ctx->malloc((int) len, ctx->malloc_data); if (retval == NULL) out_of_memory(ctx); return retval; @@ -3863,7 +3863,7 @@ static void state_DCL(Context *ctx) 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]; diff --git a/mojoshader_opengl.c b/mojoshader_opengl.c index c48933ba..3e1f67f2 100644 --- a/mojoshader_opengl.c +++ b/mojoshader_opengl.c @@ -177,7 +177,7 @@ static void internal_free(void *ptr, void *d) { free(ptr); } 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 *MOJOSHADER_glLinkProgram(MOJOSHADER_glShader *vshader, 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 @@ MOJOSHADER_glProgram *MOJOSHADER_glLinkProgram(MOJOSHADER_glShader *vshader, 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;