From 8cd7b99f7da87f43c723eac13fccaed0a220cb9d Mon Sep 17 00:00:00 2001 From: Sanil Rao Date: Fri, 17 Jun 2016 13:55:53 -0400 Subject: [PATCH 1/3] main fixed for me --- src/main.cpp | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 6db08ca..f9ed254 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,10 +1,3 @@ -<<<<<<< HEAD - -//Dummy line for pull request test -//Hello at the top -======= -// ->>>>>>> upstream/master #include "automata.h" #include "pass.h" #include "profiler.h" @@ -15,6 +8,7 @@ #include #include #include +#include "errno.h" #define FROM_INPUT_STRING false @@ -65,11 +59,22 @@ uint32_t fileSize(string fn) { return fileSize; } - +void InputFileCheck() +{ + if(errno == ENOENT) + { + cout<< "VAsim Error: no such input file." << endl; + exit(-1); + } +} vector file2CharVector(string fn) { // open the file: std::ifstream file(fn, ios::binary); + if(file.fail()) + { + InputFileCheck(); + } // get its size: std::streampos fileSize; From 777bf1f389666b5640e244d0bd07c079f07b97f0 Mon Sep 17 00:00:00 2001 From: Sanil Rao Date: Fri, 17 Jun 2016 14:34:07 -0400 Subject: [PATCH 2/3] changed bracket location and used camel casing --- src/main.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index f9ed254..681bc59 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -59,10 +59,8 @@ uint32_t fileSize(string fn) { return fileSize; } -void InputFileCheck() -{ - if(errno == ENOENT) - { +void inputFileCheck() { + if(errno == ENOENT) { cout<< "VAsim Error: no such input file." << endl; exit(-1); } @@ -71,9 +69,8 @@ vector file2CharVector(string fn) { // open the file: std::ifstream file(fn, ios::binary); - if(file.fail()) - { - InputFileCheck(); + if(file.fail()){ + inputFileCheck(); } // get its size: From bdfa5aedc42fac377da507e0fbea50aaae292f4d Mon Sep 17 00:00:00 2001 From: Sanil Rao Date: Fri, 17 Jun 2016 14:45:22 -0400 Subject: [PATCH 3/3] fixed brackets --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 681bc59..68b1860 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -59,7 +59,7 @@ uint32_t fileSize(string fn) { return fileSize; } -void inputFileCheck() { +void inputFileCheck() { if(errno == ENOENT) { cout<< "VAsim Error: no such input file." << endl; exit(-1);