Commit 79ed1a94 authored by Vinson Lee's avatar Vinson Lee Committed by Brian Paul

MSVC fixes for shaders tests

This patch fixes some shaders tests compilation errors with MSVC.
Reorder includes.
Remove inclusion of unistd.h.
Move variable declarations to start of a block.
parent ad6d87e3
......@@ -60,6 +60,18 @@ static PFNGLFOGCOORDFPROC pglFogCoordf = NULL;
static void Redisplay(void)
{
static const struct {
float x, y, r;
}
probes[4] = {
{ 0.5, 1.5, 0.3 },
{ 1.5, 1.5, 0.6 },
{ 0.5, 0.5, 0.8 },
{ 1.5, 0.5, 0.4 },
};
int pass = 1;
unsigned i;
glClear(GL_COLOR_BUFFER_BIT);
pglFogCoordf(0.3);
......@@ -94,18 +106,6 @@ static void Redisplay(void)
glVertex2f(1, 1);
glEnd();
static const struct {
float x, y, r;
}
probes[4] = {
{ 0.5, 1.5, 0.3 },
{ 1.5, 1.5, 0.6 },
{ 0.5, 0.5, 0.8 },
{ 1.5, 0.5, 0.4 },
};
int pass = 1;
unsigned i;
for (i = 0; i < 4; i++) {
float expected_color[4];
......
......@@ -128,9 +128,10 @@ static void readTestcase(struct testcase* tc, const char* filename)
/* Yeah, this is not especially efficient... */
tc->programtext = strdup("");
while(fgets(buf, sizeof(buf), filp)) {
int newlen;
if (!*tc->programtext && buf[0] != '!')
continue;
int newlen = tc->programtext ? strlen(tc->programtext) : 0;
newlen = tc->programtext ? strlen(tc->programtext) : 0;
newlen += strlen(buf);
tc->programtext = (char*)realloc(tc->programtext, newlen+1);
strcat(tc->programtext, buf);
......
......@@ -34,6 +34,12 @@
* catches a bug found in the 965 driver in an app I was writing.
*/
#include <assert.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/stat.h>
#define GL_GLEXT_PROTOTYPES
#include <GL/glew.h>
#if defined(__APPLE__)
......@@ -41,12 +47,6 @@
#else
#include "GL/glut.h"
#endif
#include <assert.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/stat.h>
#include "piglit-util.h"
......
......@@ -34,6 +34,12 @@
* conditional in the fragment shader is required to trigger brw_wm_glsl.c.
*/
#include <assert.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/stat.h>
#define GL_GLEXT_PROTOTYPES
#include <GL/glew.h>
#if defined(__APPLE__)
......@@ -41,12 +47,6 @@
#else
#include "GL/glut.h"
#endif
#include <assert.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/stat.h>
#include "piglit-util.h"
......
......@@ -37,6 +37,12 @@
* This was conceived as a test case for freedesktop.org bug #20171.
*/
#include <assert.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/stat.h>
#define GL_GLEXT_PROTOTYPES
#include <GL/glew.h>
#if defined(__APPLE__)
......@@ -44,12 +50,6 @@
#else
#include "GL/glut.h"
#endif
#include <assert.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/stat.h>
#include "piglit-util.h"
......@@ -67,11 +67,12 @@ display(void)
float color[] = {1.0, 0.0, 0.0, 0.0};
unsigned i;
unsigned j;
glClearColor(0.5, 0.5, 0.5, 0.5);
glClear(GL_COLOR_BUFFER_BIT);
unsigned i;
unsigned j;
for (i = 0; i < 3; i++) {
float temp;
float line_color[4];
......
......@@ -34,6 +34,11 @@
* Wine likes to do that to us to see how strict we are on the VP language.
*/
#include <assert.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#define GL_GLEXT_PROTOTYPES
#if defined(__APPLE__)
......@@ -41,11 +46,6 @@
#else
#include "GL/glut.h"
#endif
#include <assert.h>
#include <string.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include "piglit-util.h"
......
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