Commit 8f607402 authored by Alexander Alekhin's avatar Alexander Alekhin

fix build warning (unreachable code) and exit error codes

parent 0d9938da
...@@ -231,7 +231,7 @@ void destination(int event, int x, int y, int, void*) ...@@ -231,7 +231,7 @@ void destination(int event, int x, int y, int, void*)
if(maxxd > im1.size().width || maxyd > im1.size().height || minxd < 0 || minyd < 0) if(maxxd > im1.size().width || maxyd > im1.size().height || minxd < 0 || minyd < 0)
{ {
cout << "Index out of range" << endl; cout << "Index out of range" << endl;
exit(0); exit(1);
} }
final1 = Mat::zeros(img2.size(),CV_8UC3); final1 = Mat::zeros(img2.size(),CV_8UC3);
...@@ -322,12 +322,12 @@ int main() ...@@ -322,12 +322,12 @@ int main()
if(img0.empty()) if(img0.empty())
{ {
cout << "Source Image does not exist" << endl; cout << "Source Image does not exist" << endl;
exit(0); exit(2);
} }
if(img2.empty()) if(img2.empty())
{ {
cout << "Destination Image does not exist" << endl; cout << "Destination Image does not exist" << endl;
exit(0); exit(2);
} }
channel = img0.channels(); channel = img0.channels();
...@@ -370,7 +370,7 @@ int main() ...@@ -370,7 +370,7 @@ int main()
if(img0.empty()) if(img0.empty())
{ {
cout << "Source Image does not exist" << endl; cout << "Source Image does not exist" << endl;
exit(0); exit(2);
} }
res1 = Mat::zeros(img0.size(),CV_8UC1); res1 = Mat::zeros(img0.size(),CV_8UC1);
...@@ -400,7 +400,7 @@ int main() ...@@ -400,7 +400,7 @@ int main()
if(img0.empty()) if(img0.empty())
{ {
cout << "Source Image does not exist" << endl; cout << "Source Image does not exist" << endl;
exit(0); exit(2);
} }
res1 = Mat::zeros(img0.size(),CV_8UC1); res1 = Mat::zeros(img0.size(),CV_8UC1);
...@@ -433,7 +433,7 @@ int main() ...@@ -433,7 +433,7 @@ int main()
if(img0.empty()) if(img0.empty())
{ {
cout << "Source Image does not exist" << endl; cout << "Source Image does not exist" << endl;
exit(0); exit(2);
} }
res1 = Mat::zeros(img0.size(),CV_8UC1); res1 = Mat::zeros(img0.size(),CV_8UC1);
...@@ -448,7 +448,7 @@ int main() ...@@ -448,7 +448,7 @@ int main()
else else
{ {
cout << "Wrong Option Choosen" << endl; cout << "Wrong Option Choosen" << endl;
exit(0); exit(1);
} }
for(;;) for(;;)
...@@ -541,7 +541,7 @@ int main() ...@@ -541,7 +541,7 @@ int main()
imwrite("cloned.png",blend); imwrite("cloned.png",blend);
} }
else if(key == 'q') else if(key == 'q')
exit(0); break;
} }
waitKey(0); return 0;
} }
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