summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2016-02-10 14:37:54 +1000
committerDave Airlie <airlied@redhat.com>2016-02-10 14:41:25 +1000
commit454a868a8b8fa8fff1fd67a27a938f4827892018 (patch)
tree60678c1258df1104b2fa92a6dae72ef26a1f0cb7
parent7026fde02f34d8de5251e0967a49e2b6a1ddcabe (diff)
renderer: make some char * into const char *.
This fixes a bunch of warnings about losing constness. Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--src/vrend_blitter.c2
-rw-r--r--src/vrend_shader.c12
2 files changed, 7 insertions, 7 deletions
diff --git a/src/vrend_blitter.c b/src/vrend_blitter.c
index 0ff73c6..7ecd8c1 100644
--- a/src/vrend_blitter.c
+++ b/src/vrend_blitter.c
@@ -107,7 +107,7 @@ static GLuint blit_build_frag_tex_col(struct vrend_blitter_ctx *blit_ctx, int tg
char shader_buf[4096];
int is_shad;
const char *twm;
- char *ext_str = "";
+ const char *ext_str = "";
switch (tgsi_tex_target) {
case TGSI_TEXTURE_1D:
case TGSI_TEXTURE_BUFFER:
diff --git a/src/vrend_shader.c b/src/vrend_shader.c
index 0e7078d..b5e3d9f 100644
--- a/src/vrend_shader.c
+++ b/src/vrend_shader.c
@@ -197,7 +197,7 @@ static char *strcat_realloc(char *str, const char *catstr)
return new;
}
-static char *add_str_to_glsl_main(struct dump_ctx *ctx, char *buf)
+static char *add_str_to_glsl_main(struct dump_ctx *ctx, const char *buf)
{
ctx->glsl_main = strcat_realloc(ctx->glsl_main, buf);
return ctx->glsl_main;
@@ -237,7 +237,7 @@ iter_declaration(struct tgsi_iterate_context *iter,
struct dump_ctx *ctx = (struct dump_ctx *)iter;
int i;
int color_offset = 0;
- char *name_prefix = "";
+ const char *name_prefix = "";
bool add_two_side = false;
switch (decl->Declaration.File) {
@@ -895,7 +895,7 @@ static int emit_clip_dist_movs(struct dump_ctx *ctx)
#define emit_ucompare(op) snprintf(buf, 255, "%s = %s(uintBitsToFloat(%s(%s(%s(%s), %s(%s))%s) * %s(0xffffffff)));\n", dsts[0], dstconv, udstconv, op, svec4, srcs[0], svec4, srcs[1], writemask, udstconv)
-static int emit_buf(struct dump_ctx *ctx, char *buf)
+static int emit_buf(struct dump_ctx *ctx, const char *buf)
{
int i;
char *sret;
@@ -923,13 +923,13 @@ static int translate_tex(struct dump_ctx *ctx,
const char *dstconv,
const char *dtypeprefix)
{
- char *twm, *gwm = NULL, *txfi;
+ const char *twm, *gwm = NULL, *txfi;
bool is_shad = false;
char buf[512];
char offbuf[128] = {0};
char bias[128] = {0};
int sampler_index;
- char *tex_ext;
+ const char *tex_ext;
ctx->samplers[sreg_index].tgsi_sampler_type = inst->Texture.Texture;
@@ -1194,7 +1194,7 @@ iter_instruction(struct tgsi_iterate_context *iter,
char writemask[6] = {0};
enum tgsi_opcode_type dtype = tgsi_opcode_infer_dst_type(inst->Instruction.Opcode);
enum tgsi_opcode_type stype = tgsi_opcode_infer_src_type(inst->Instruction.Opcode);
- char *dtypeprefix="", *stypeprefix = "", *svec4 = "vec4";
+ const char *dtypeprefix="", *stypeprefix = "", *svec4 = "vec4";
bool stprefix = false;
bool override_no_wm[4];
char *sret;