use _mesa_copy_instructions()
authorBrian <brian@yutani.localnet.net>
Thu, 22 Mar 2007 15:11:26 +0000 (09:11 -0600)
committerBrian <brian@yutani.localnet.net>
Thu, 22 Mar 2007 15:11:26 +0000 (09:11 -0600)
src/mesa/shader/nvfragparse.c
src/mesa/shader/nvvertparse.c
src/mesa/shader/program.c
src/mesa/shader/programopt.c

index c46d8aa083308eaa30f4f6654faa3fc13850cc02..ffa7ba4701b6eb512b44df7a125e9354713bae09 100644 (file)
@@ -1545,8 +1545,7 @@ _mesa_parse_nv_fragment_program(GLcontext *ctx, GLenum dstTarget,
          _mesa_error(ctx, GL_OUT_OF_MEMORY, "glLoadProgramNV");
          return;  /* out of memory */
       }
-      _mesa_memcpy(newInst, instBuffer,
-                   parseState.numInst * sizeof(struct prog_instruction));
+      _mesa_copy_instructions(newInst, instBuffer, parseState.numInst);
 
       /* install the program */
       program->Base.Target = target;
index 0bc0c055dad52dee7e3bf088fa30d4e5269dea17..ac96d4a60edca4e91e90856dfb3e1e75999ad62f 100644 (file)
@@ -1378,8 +1378,7 @@ _mesa_parse_nv_vertex_program(GLcontext *ctx, GLenum dstTarget,
          _mesa_free(programString);
          return;  /* out of memory */
       }
-      _mesa_memcpy(newInst, instBuffer,
-                   parseState.numInst * sizeof(struct prog_instruction));
+      _mesa_copy_instructions(newInst, instBuffer, parseState.numInst);
 
       /* install the program */
       program->Base.Target = target;
index ae26c3cc14e86708de9563d709ae28fbf7b3d890..c1606acb1a72581a7d05f1e3a8639bfaaa289070 100644 (file)
@@ -342,8 +342,8 @@ _mesa_clone_program(GLcontext *ctx, const struct gl_program *prog)
       _mesa_delete_program(ctx, clone);
       return NULL;
    }
-   memcpy(clone->Instructions, prog->Instructions,
-          prog->NumInstructions * sizeof(struct prog_instruction));
+   _mesa_copy_instructions(clone->Instructions, prog->Instructions,
+                           prog->NumInstructions);
    clone->InputsRead = prog->InputsRead;
    clone->OutputsWritten = prog->OutputsWritten;
    memcpy(clone->TexturesUsed, prog->TexturesUsed, sizeof(prog->TexturesUsed));
index d427ee38f8165b22778c576c12241248ff37fdcb..f1d8ce3065409ef98f5a734b587adb5054bc147f 100644 (file)
@@ -150,8 +150,7 @@ _mesa_append_fog_code(GLcontext *ctx, struct gl_fragment_program *fprog)
    }
 
    /* Copy orig instructions into new instruction buffer */
-   _mesa_memcpy(newInst, fprog->Base.Instructions,
-                origLen * sizeof(struct prog_instruction));
+   _mesa_copy_instructions(newInst, fprog->Base.Instructions, origLen);
 
    /* PARAM fogParamsRefOpt = internal optimized fog params; */
    fogPRefOpt