From 792a3772cdcf0b05ddb18c99611cb2a11a6b04f0 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Sat, 18 May 2013 16:48:46 +0300 Subject: [PATCH] Make test case compile on MSVC. --- test cases/common/29 pipeline/srcgen.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/test cases/common/29 pipeline/srcgen.c b/test cases/common/29 pipeline/srcgen.c index c4e412bef..4d183188a 100644 --- a/test cases/common/29 pipeline/srcgen.c +++ b/test cases/common/29 pipeline/srcgen.c @@ -1,27 +1,33 @@ #include #include +#define ARRSIZE 80 + int main(int argc, char **argv) { - const int ARRSIZE = 80; char arr[ARRSIZE]; + char *ofilename; + char *ifilename; + FILE *ifile; + FILE *ofile; + size_t bytes; + if(argc != 3) { fprintf(stderr, "%s \n", argv[0]); return 1; } - char *ifilename = argv[1]; - char *ofilename = argv[2]; + ifilename = argv[1]; + ofilename = argv[2]; printf("%s\n", ifilename); - FILE *ifile = fopen(ifilename, "r"); + ifile = fopen(argv[1], "r"); if(!ifile) { - fprintf(stderr, "Could not open source file %s.\n", ifilename); + fprintf(stderr, "Could not open source file %s.\n", argv[1]); return 1; } - FILE *ofile = fopen(ofilename, "w"); + ofile = fopen(ofilename, "w"); if(!ofile) { fprintf(stderr, "Could not open target file %s\n", ofilename); return 1; } - size_t bytes; bytes = fread(arr, 1, ARRSIZE, ifile); assert(bytes < 80); assert(bytes > 0);