+// Copyright 2011 Paul Hänsch
+// This file is part of Stereofy
+//
+// Stereofy is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Stereofy is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Stereofy. If not, see <http://www.gnu.org/licenses/>.
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int error(int code){
char *msg = "Unknown Error\n";
switch (code) {
- case 1: msg = "Usage: anaglyph [ -[fhd]gm | -[fhd]rc | -fmc | -dab ] left.rgb right.rgb output.rgb\n";
- case 2: msg = "Could not open input file for reading\n";
- case 3: msg = "Could not open output file for writing\n";
- case 4: msg = "Unexpected end of file\n";
- case 5: msg = "Cannot write to output file\n";
+ case 1: msg = "Usage: anaglyph [ -[fhd]gm | -[fhd]rc | -fmc | -dab ] left.rgb right.rgb output.rgb\n"; break;
+ case 2: msg = "Could not open input file for reading\n"; break;
+ case 3: msg = "Could not open output file for writing\n"; break;
+ case 4: msg = "Unexpected end of file\n"; break;
+ case 5: msg = "Cannot write to output file\n"; break;
}
- fprintf(stderr, msg); return code;
+ fprintf(stderr, "%s", msg); return code;
}
// min-max to prevent overflowing in Dubois calculations