From 705fb01b59bec8acb9ff21509d25aa675d7c1dee Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Thu, 17 Jun 2010 12:59:45 -0700 Subject: [PATCH] Use glsl_program instead of an open-coded vector of shaders --- main.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/main.cpp b/main.cpp index c8a1a038af8..37057ab1c9a 100644 --- a/main.cpp +++ b/main.cpp @@ -175,20 +175,20 @@ main(int argc, char **argv) if (argc <= optind) usage_fail(argv[0]); - struct glsl_shader **prog_list = NULL; - unsigned prog_list_len = 0; + struct glsl_program whole_program; + memset(&whole_program, 0, sizeof(whole_program)); for (/* empty */; argc > optind; optind++) { - prog_list = (struct glsl_shader **) - realloc(prog_list, - sizeof(struct glsl_shader *) * (prog_list_len + 1)); - assert(prog_list != NULL); + whole_program.Shaders = (struct glsl_shader **) + realloc(whole_program.Shaders, + sizeof(struct glsl_shader *) * (whole_program.NumShaders + 1)); + assert(whole_program.Shaders != NULL); struct glsl_shader *prog = new glsl_shader; memset(prog, 0, sizeof(*prog)); - prog_list[prog_list_len] = prog; - prog_list_len++; + whole_program.Shaders[whole_program.NumShaders] = prog; + whole_program.NumShaders++; const unsigned len = strlen(argv[optind]); if (len < 6) -- 2.30.2