return r;
}
+/** Wrapper around vsnprintf() */
+int
+_mesa_snprintf( char *str, size_t size, const char *fmt, ... )
+{
+ int r;
+ va_list args;
+ va_start( args, fmt );
+ r = vsnprintf( str, size, fmt, args );
+ va_end( args );
+ return r;
+}
+
/** Wrapper around printf(), using vsprintf() for the formatting. */
void
_mesa_printf( const char *fmtString, ... )
extern int
_mesa_sprintf( char *str, const char *fmt, ... );
+extern int
+_mesa_snprintf( char *str, size_t size, const char *fmt, ... );
+
extern void
_mesa_printf( const char *fmtString, ... );
*/
slang_variable *p = slang_variable_scope_grow(fun->parameters);
char name[10];
- snprintf(name, sizeof(name), "p%d", i);
+ _mesa_snprintf(name, sizeof(name), "p%d", i);
p->a_name = slang_atom_pool_atom(A->atoms, name);
p->type.qualifier = SLANG_QUAL_CONST;
p->type.specifier.type = baseType;
if (index < 0) {
/* error */
char s[100];
- snprintf(s, sizeof(s), "Undefined variable '%s'",
- (char *) n->Var->a_name);
+ _mesa_snprintf(s, sizeof(s), "Undefined variable '%s'",
+ (char *) n->Var->a_name);
slang_info_log_error(emitInfo->log, s);
return NULL;
}
}
if (!bits_agree(var->Flags, v->Flags, PROG_PARAM_BIT_CENTROID)) {
char msg[100];
- snprintf(msg, sizeof(msg),
- "centroid modifier mismatch for '%s'", var->Name);
+ _mesa_snprintf(msg, sizeof(msg),
+ "centroid modifier mismatch for '%s'", var->Name);
link_error(shProg, msg);
return GL_FALSE;
}
if (!bits_agree(var->Flags, v->Flags, PROG_PARAM_BIT_INVARIANT)) {
char msg[100];
- snprintf(msg, sizeof(msg),
- "invariant modifier mismatch for '%s'", var->Name);
+ _mesa_snprintf(msg, sizeof(msg),
+ "invariant modifier mismatch for '%s'", var->Name);
link_error(shProg, msg);
return GL_FALSE;
}