From: Frédéric Dalleau Date: Tue, 3 Sep 2013 08:31:13 +0000 (+0200) Subject: VirtGL: Fix warnings in shadersrc_gles_to_gl X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.1~749^2~22 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=21e55831d62f2812f717ce3499353129f218344a;p=sdk%2Femulator%2Fqemu.git VirtGL: Fix warnings in shadersrc_gles_to_gl Change-Id: Iba3adc23af24ca62d050865297aaeecbae411632 --- diff --git a/tizen/src/hw/opengl_exec.c b/tizen/src/hw/opengl_exec.c index 7dd5665a48..87fcdca24d 100644 --- a/tizen/src/hw/opengl_exec.c +++ b/tizen/src/hw/opengl_exec.c @@ -1302,7 +1302,7 @@ void vmgl_context_switch(ProcessStruct *p, int switch_gl_context) } } -static const char *opengl_strtok(const char *s, int *n, char const **saveptr, char *prevbuf) +static char *opengl_strtok(const char *s, int *n, char const **saveptr, char *prevbuf) { const char *start; char *ret; @@ -1410,15 +1410,18 @@ static char *do_eglShaderPatch(const char *source, int length, int *patched_len) ; } } else { + const char *p2; if (!strncmp(p, "gl_MaxVertexUniformVectors", 26)) { - p = "(gl_MaxVertexUniformComponents / 4)"; + p2 = "(gl_MaxVertexUniformComponents / 4)"; } else if (!strncmp(p, "gl_MaxFragmentUniformVectors", 28)) { - p = "(gl_MaxFragmentUniformComponents / 4)"; + p2 = "(gl_MaxFragmentUniformComponents / 4)"; } else if (!strncmp(p, "gl_MaxVaryingVectors", 20)) { - p = "(gl_MaxVaryingFloats / 4)"; + p2 = "(gl_MaxVaryingFloats / 4)"; + } else { + p2 = p; } - int new_len = strlen(p); + int new_len = strlen(p2); if (*patched_len + new_len > patched_size) { patched_size *= 2; patched = realloc(patched, patched_size + 1); @@ -1427,7 +1430,7 @@ static char *do_eglShaderPatch(const char *source, int length, int *patched_len) return NULL; } - memcpy(patched + *patched_len, p, new_len); + memcpy(patched + *patched_len, p2, new_len); *patched_len += new_len; } } @@ -2735,7 +2738,7 @@ int do_function_call(ProcessState *process, int func_number, unsigned long *args acc_length += tab_length[i]; } - shadersrc_gles_to_gl(args[1], tab_prog, tab_prog_new, tab_length, tab_length_new); + shadersrc_gles_to_gl(args[1], (const char **)tab_prog, tab_prog_new, tab_length, tab_length_new); if (!tab_prog_new || !tab_length_new) break;