]> git.sur5r.net Git - cc65/commitdiff
added empty lines and spaces according to olivers comments. Made local functions...
authormc78 <mc78@outlook.de>
Mon, 22 May 2017 21:07:31 +0000 (23:07 +0200)
committermc78 <mc78@outlook.de>
Mon, 22 May 2017 21:07:31 +0000 (23:07 +0200)
src/cl65/main.c

index e428c96ac7cb8ceffc63fc3dd6db368c1b058222..6926199f99c6eaaec5f005eee68413616ec65d72 100644 (file)
@@ -156,22 +156,36 @@ static char* TargetLib  = 0;
 #  endif
 #endif
 
+
+
 /*****************************************************************************/
 /*                        Credential functions                               */
 /*****************************************************************************/
-void DisableAssembling(void){
+
+
+
+static void DisableAssembling (void)
+{
     DoAssemble = 0;
 }
 
-void DisableLinking(void){
+
+
+static void DisableLinking (void)
+{
     DoLink = 0;
 }
 
-void DisableAssemblingAndLinking(void){
+
+
+static void DisableAssemblingAndLinking (void)
+{
     DisableAssembling();
     DisableLinking();
 }
 
+
+
 /*****************************************************************************/
 /*                        Command structure handling                         */
 /*****************************************************************************/
@@ -1427,22 +1441,33 @@ int main (int argc, char* argv [])
                     break;
                 
                 case 'E':
-                    /*Forward -E to compiler*/
+                    /* Forward -E to compiler */
                     CmdAddArg (&CC65, Arg);  
                     DisableAssemblingAndLinking();
                     break;
+                    
                 case 'W':
-                    if (Arg[2] == 'a' && Arg[3] == '\0') {
-                        /* -Wa: Pass options to assembler */
-                        OptAsmArgs (Arg, GetArg (&I, 3));
-                    } else if (Arg[2] == 'c' && Arg[3] == '\0') {
-                        /* -Wc: Pass options to compiler */
-                        /* Remember -Wc sub arguments in cc65 arg struct */ 
-                        OptCCArgs (Arg, GetArg (&I, 3));
-                    } else if (Arg[2] == 'l' && Arg[3] == '\0') {
-                        /* -Wl: Pass options to linker */
-                        OptLdArgs (Arg, GetArg (&I, 3));
-                    } else {
+                    /* avoid && with'\0' in if clauses */
+                    if (Arg[3] == '\0') {
+                        switch (Arg[2]) {
+                        case 'a':
+                            /* -Wa: Pass options to assembler */
+                            OptAsmArgs (Arg, GetArg (&I, 3));
+                            break;
+                        case 'c':
+                            /* -Wc: Pass options to compiler 
+                            ** Remember -Wc sub arguments in cc65 arg struct 
+                            */
+                            OptCCArgs (Arg, GetArg (&I, 3));
+                            break;
+                        case 'l':
+                            /* -Wl: Pass options to linker */
+                            OptLdArgs (Arg, GetArg (&I, 3));
+                            break;
+                        default:
+                            break;
+                       }
+                    }else {
                         /* Anything else: Suppress warnings (compiler) */
                         CmdAddArg2 (&CC65, "-W", GetArg (&I, 2));
                     }