Commit 67da604e authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Get rid of a few stack buffers.

parent 1fa83c95
......@@ -52,17 +52,12 @@ void shader_buffer_free(struct SHADER_BUFFER *buffer)
HeapFree(GetProcessHeap(), 0, buffer->buffer);
}
int shader_addline(
SHADER_BUFFER* buffer,
const char *format, ...) {
int shader_vaddline(SHADER_BUFFER* buffer, const char *format, va_list args)
{
char* base = buffer->buffer + buffer->bsize;
int rc;
va_list args;
va_start(args, format);
rc = vsnprintf(base, SHADER_PGMSIZE - 1 - buffer->bsize, format, args);
va_end(args);
if (rc < 0 || /* C89 */
rc > SHADER_PGMSIZE - 1 - buffer->bsize) { /* C99 */
......@@ -88,6 +83,18 @@ int shader_addline(
return 0;
}
int shader_addline(SHADER_BUFFER* buffer, const char *format, ...)
{
int ret;
va_list args;
va_start(args, format);
ret = shader_vaddline(buffer, format, args);
va_end(args);
return ret;
}
void shader_init(struct IWineD3DBaseShaderClass *shader,
IWineD3DDevice *device, const SHADER_OPCODE *instruction_table)
{
......
......@@ -2219,6 +2219,7 @@ typedef struct SHADER_PARSE_STATE {
extern int shader_addline(
SHADER_BUFFER* buffer,
const char* fmt, ...) PRINTF_ATTR(2,3);
int shader_vaddline(SHADER_BUFFER *buffer, const char *fmt, va_list args);
const SHADER_OPCODE *shader_get_opcode(const SHADER_OPCODE *shader_ins, DWORD shader_version, DWORD code);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment