]> git.plutz.net Git - stereofy/blobdiff - anaglyph.c
cleaned up fprintf function, fixing last compiler warning, enabled hard optimization...
[stereofy] / anaglyph.c
index 1ade9521c828b279b1e793e6adf9c015c8b2d406..b0be61c53b1bc66bcda7ea27a3a18dc9a134383a 100644 (file)
@@ -1,3 +1,19 @@
+// 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>
@@ -35,13 +51,13 @@ int main(int argc, char *argv[]){
 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