return error("What the hell? Do you think we adhere to the Goof standard?");
}
+
//
// .opt - turn a specific (or all) optimisation on or off
//
int d_opt(void)
{
- char * tmpstr;
-
while (*tok != EOL)
{
if (*tok == STRING)
{
tok++;
- tmpstr = string[*tok++];
+ char * tmpstr = string[*tok++];
if (ParseOptimization(tmpstr) != OK)
{
char temperr[256];
- sprintf(temperr, "unknown optimisation flag '%s'.", tmpstr);
+ sprintf(temperr, "unknown optimisation flag '%s'", tmpstr);
return error(temperr);
}
}
else
- return error(".opt directive needs every switch enclosed inside quotation marks.");
+ return error(".opt directive needs every switch enclosed inside quotation marks");
}
-}
\ No newline at end of file
+}
+
return OK;
}
- if (v + 0x8000 >= 0x18000)
+ if ((v + 0x8000) >= 0x18000)
return error(range_error);
D_word(v);
//
int ParseOptimization(char * optstring)
{
- int onoff = 0;
-
- if (*optstring == '+')
- onoff = 1;
- else if (*optstring != '~')
- return ERROR;
-
- if ((optstring[2] == 'a' || optstring[2] == 'A') &&
- (optstring[3] == 'l' || optstring[3] == 'L') &&
- (optstring[4] == 'l' || optstring[4] == 'L'))
- {
- memset(optim_flags, onoff, OPT_COUNT * sizeof(int));
- return OK;
- }
- else if (optstring[1] == 'o' || optstring[1] == 'O') //Turn on specific optimisation
+ int onoff = 0;
+
+ if (*optstring == '+')
+ onoff = 1;
+ else if (*optstring != '~')
+ return ERROR;
+
+ if ((optstring[2] == 'a' || optstring[2] == 'A')
+ && (optstring[3] == 'l' || optstring[3] == 'L')
+ && (optstring[4] == 'l' || optstring[4] == 'L'))
{
- int opt_no = atoi(&optstring[2]);
- if ((opt_no >= 0) && (opt_no < OPT_COUNT))
- optim_flags[opt_no] = onoff;
- else
- {
- return ERROR;
- }
- }
- else
- {
- return ERROR;
- }
+ memset(optim_flags, onoff, OPT_COUNT * sizeof(int));
+ return OK;
+ }
+ else if (optstring[1] == 'o' || optstring[1] == 'O') // Turn on specific optimisation
+ {
+ int opt_no = atoi(&optstring[2]);
+
+ if ((opt_no >= 0) && (opt_no < OPT_COUNT))
+ optim_flags[opt_no] = onoff;
+ else
+ return ERROR;
+ }
+ else
+ {
+ return ERROR;
+ }
}
// WARNING(FIXME: Code removed because...)
#else
- //If we're not compiling for Visual Studio let's assume that we're using
- //some flavour of gcc instead. So let's use the gcc compliant macro instead.
- //If some weirdo uses something else (I dunno, Intel compiler or something?)
- //this is probably going to explode spectacularly. Let's wait for the fireworks!
+ // If we're not compiling for Visual Studio let's assume that we're using
+ // some flavour of gcc instead. So let's use the gcc compliant macro
+ // instead. If some weirdo uses something else (I dunno, Intel compiler or
+ // something?) this is probably going to explode spectacularly. Let's wait
+ // for the fireworks!
#define DO_PRAGMA(x) _Pragma (#x)
#define WARNING(desc) DO_PRAGMA(message (#desc))
#define inline __inline
#define MAJOR 1 // Major version number
#define MINOR 4 // Minor version number
-#define PATCH 16 // Patch release number
+#define PATCH 17 // Patch release number
#endif // __VERSION_H__