From: paul Date: Mon, 10 Dec 2012 23:31:29 +0000 (+0000) Subject: cleaned up fprintf function, fixing last compiler warning, enabled hard optimization... X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=dd9163bfcca6056bf4def621010c751b0e251cdc;p=stereofy cleaned up fprintf function, fixing last compiler warning, enabled hard optimization im makefile svn path=/trunk/; revision=11 --- diff --git a/Makefile b/Makefile index d136b2f..93e877c 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,9 @@ CC = gcc -CCFLAGS = -Wall +CCFLAGS = -Wall -O3 BINDIR = /usr/local/bin +all: anaglyph + ${BINDIR}: echo -e "\n\n====\n The specified executable directory (${BINDIR}) does not exist.\n Please adjust the BINDIR variable in the Makefile.\n Alternatively create the directory and make sure it is in the users executable path (\$$PATH)" exit 1 @@ -11,7 +13,9 @@ anaglyph: anaglyph.c install: ${BINDIR} anaglyph stereofy.sh cp anaglyph ${BINDIR}/anaglyph + chmod a+x ${BINDIR}/anaglyph cp stereofy.sh ${BINDIR}/stereofy + chmod a+rx ${BINDIR}/stereofy clean: rm anaglyph diff --git a/anaglyph.c b/anaglyph.c index ad3f609..b0be61c 100644 --- a/anaglyph.c +++ b/anaglyph.c @@ -51,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