slang: Use _mesa_snprintf() wrapper.
[mesa.git] / src / mesa / shader / prog_parameter.c
index c0602ad2c948b35588a68841519fb556802cead4..66edae9001dbcbc1fe0d90eea341a6758e828e46 100644 (file)
@@ -78,7 +78,7 @@ _mesa_free_parameter_list(struct gl_program_parameter_list *paramList)
  */
 GLint
 _mesa_add_parameter(struct gl_program_parameter_list *paramList,
-                    enum register_file type, const char *name,
+                    gl_register_file type, const char *name,
                     GLuint size, GLenum datatype, const GLfloat *values,
                     const gl_state_index state[STATE_LENGTH],
                     GLbitfield flags)
@@ -290,7 +290,8 @@ _mesa_use_uniform(struct gl_program_parameter_list *paramList,
    GLuint i;
    for (i = 0; i < paramList->NumParameters; i++) {
       struct gl_program_parameter *p = paramList->Parameters + i;
-      if (p->Type == PROGRAM_UNIFORM && _mesa_strcmp(p->Name, name) == 0) {
+      if ((p->Type == PROGRAM_UNIFORM || p->Type == PROGRAM_SAMPLER) &&
+          _mesa_strcmp(p->Name, name) == 0) {
          p->Used = GL_TRUE;
          /* Note that large uniforms may occupy several slots so we're
           * not done searching yet.
@@ -423,7 +424,7 @@ _mesa_add_state_reference(struct gl_program_parameter_list *paramList,
                           const gl_state_index stateTokens[STATE_LENGTH])
 {
    const GLuint size = 4; /* XXX fix */
-   const char *name;
+   char *name;
    GLint index;
 
    /* Check if the state reference is already in the list */
@@ -450,7 +451,7 @@ _mesa_add_state_reference(struct gl_program_parameter_list *paramList,
    paramList->StateFlags |= _mesa_program_state_flags(stateTokens);
 
    /* free name string here since we duplicated it in add_parameter() */
-   _mesa_free((void *) name);
+   _mesa_free(name);
 
    return index;
 }
@@ -516,7 +517,7 @@ _mesa_lookup_parameter_index(const struct gl_program_parameter_list *paramList,
  * swizzling to find a match.
  * \param list  the parameter list to search
  * \param v  the float vector to search for
- * \param size  number of element in v
+ * \param vSize  number of element in v
  * \param posOut  returns the position of the constant, if found
  * \param swizzleOut  returns a swizzle mask describing location of the
  *                    vector elements if found.
@@ -680,7 +681,7 @@ _mesa_combine_parameter_lists(const struct gl_program_parameter_list *listA,
  */
 GLuint
 _mesa_longest_parameter_name(const struct gl_program_parameter_list *list,
-                             enum register_file type)
+                             gl_register_file type)
 {
    GLuint i, maxLen = 0;
    if (!list)
@@ -701,7 +702,7 @@ _mesa_longest_parameter_name(const struct gl_program_parameter_list *list,
  */
 GLuint
 _mesa_num_parameters_of_type(const struct gl_program_parameter_list *list,
-                             enum register_file type)
+                             gl_register_file type)
 {
    GLuint i, count = 0;
    if (list) {