mirror of
https://github.com/DrBeef/ioq3quest.git
synced 2024-11-27 06:13:01 +00:00
* (bug 3427) Single Player causes SIGBUS on SGI IRIX (Patrick Baggett)
This commit is contained in:
parent
dc3d2457e0
commit
fd69a32508
3 changed files with 15 additions and 15 deletions
|
@ -1617,7 +1617,7 @@ typedef struct operator_s
|
||||||
typedef struct value_s
|
typedef struct value_s
|
||||||
{
|
{
|
||||||
signed long int intvalue;
|
signed long int intvalue;
|
||||||
double floatvalue;
|
float floatvalue;
|
||||||
int parentheses;
|
int parentheses;
|
||||||
struct value_s *prev, *next;
|
struct value_s *prev, *next;
|
||||||
} value_t;
|
} value_t;
|
||||||
|
@ -1685,7 +1685,7 @@ int PC_OperatorPriority(int op)
|
||||||
#define FreeOperator(op)
|
#define FreeOperator(op)
|
||||||
|
|
||||||
int PC_EvaluateTokens(source_t *source, token_t *tokens, signed long int *intvalue,
|
int PC_EvaluateTokens(source_t *source, token_t *tokens, signed long int *intvalue,
|
||||||
double *floatvalue, int integer)
|
float *floatvalue, int integer)
|
||||||
{
|
{
|
||||||
operator_t *o, *firstoperator, *lastoperator;
|
operator_t *o, *firstoperator, *lastoperator;
|
||||||
value_t *v, *firstvalue, *lastvalue, *v1, *v2;
|
value_t *v, *firstvalue, *lastvalue, *v1, *v2;
|
||||||
|
@ -1696,7 +1696,7 @@ int PC_EvaluateTokens(source_t *source, token_t *tokens, signed long int *intval
|
||||||
int lastwasvalue = 0;
|
int lastwasvalue = 0;
|
||||||
int negativevalue = 0;
|
int negativevalue = 0;
|
||||||
int questmarkintvalue = 0;
|
int questmarkintvalue = 0;
|
||||||
double questmarkfloatvalue = 0;
|
float questmarkfloatvalue = 0;
|
||||||
int gotquestmarkvalue = qfalse;
|
int gotquestmarkvalue = qfalse;
|
||||||
int lastoperatortype = 0;
|
int lastoperatortype = 0;
|
||||||
//
|
//
|
||||||
|
@ -2139,7 +2139,7 @@ int PC_EvaluateTokens(source_t *source, token_t *tokens, signed long int *intval
|
||||||
// Changes Globals: -
|
// Changes Globals: -
|
||||||
//============================================================================
|
//============================================================================
|
||||||
int PC_Evaluate(source_t *source, signed long int *intvalue,
|
int PC_Evaluate(source_t *source, signed long int *intvalue,
|
||||||
double *floatvalue, int integer)
|
float *floatvalue, int integer)
|
||||||
{
|
{
|
||||||
token_t token, *firsttoken, *lasttoken;
|
token_t token, *firsttoken, *lasttoken;
|
||||||
token_t *t, *nexttoken;
|
token_t *t, *nexttoken;
|
||||||
|
@ -2238,7 +2238,7 @@ int PC_Evaluate(source_t *source, signed long int *intvalue,
|
||||||
// Changes Globals: -
|
// Changes Globals: -
|
||||||
//============================================================================
|
//============================================================================
|
||||||
int PC_DollarEvaluate(source_t *source, signed long int *intvalue,
|
int PC_DollarEvaluate(source_t *source, signed long int *intvalue,
|
||||||
double *floatvalue, int integer)
|
float *floatvalue, int integer)
|
||||||
{
|
{
|
||||||
int indent, defined = qfalse;
|
int indent, defined = qfalse;
|
||||||
token_t token, *firsttoken, *lasttoken;
|
token_t token, *firsttoken, *lasttoken;
|
||||||
|
@ -2468,7 +2468,7 @@ int PC_Directive_eval(source_t *source)
|
||||||
//============================================================================
|
//============================================================================
|
||||||
int PC_Directive_evalfloat(source_t *source)
|
int PC_Directive_evalfloat(source_t *source)
|
||||||
{
|
{
|
||||||
double value;
|
float value;
|
||||||
token_t token;
|
token_t token;
|
||||||
|
|
||||||
if (!PC_Evaluate(source, NULL, &value, qfalse)) return qfalse;
|
if (!PC_Evaluate(source, NULL, &value, qfalse)) return qfalse;
|
||||||
|
@ -2577,7 +2577,7 @@ int PC_DollarDirective_evalint(source_t *source)
|
||||||
//============================================================================
|
//============================================================================
|
||||||
int PC_DollarDirective_evalfloat(source_t *source)
|
int PC_DollarDirective_evalfloat(source_t *source)
|
||||||
{
|
{
|
||||||
double value;
|
float value;
|
||||||
token_t token;
|
token_t token;
|
||||||
|
|
||||||
if (!PC_DollarEvaluate(source, NULL, &value, qfalse)) return qfalse;
|
if (!PC_DollarEvaluate(source, NULL, &value, qfalse)) return qfalse;
|
||||||
|
|
|
@ -554,7 +554,7 @@ int PS_ReadName(script_t *script, token_t *token)
|
||||||
// Changes Globals: -
|
// Changes Globals: -
|
||||||
//============================================================================
|
//============================================================================
|
||||||
void NumberValue(char *string, int subtype, unsigned long int *intvalue,
|
void NumberValue(char *string, int subtype, unsigned long int *intvalue,
|
||||||
double *floatvalue)
|
float *floatvalue)
|
||||||
{
|
{
|
||||||
unsigned long int dotfound = 0;
|
unsigned long int dotfound = 0;
|
||||||
|
|
||||||
|
@ -573,13 +573,13 @@ void NumberValue(char *string, int subtype, unsigned long int *intvalue,
|
||||||
} //end if
|
} //end if
|
||||||
if (dotfound)
|
if (dotfound)
|
||||||
{
|
{
|
||||||
*floatvalue = *floatvalue + (double) (*string - '0') /
|
*floatvalue = *floatvalue + (float) (*string - '0') /
|
||||||
(double) dotfound;
|
(float) dotfound;
|
||||||
dotfound *= 10;
|
dotfound *= 10;
|
||||||
} //end if
|
} //end if
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
*floatvalue = *floatvalue * 10.0 + (double) (*string - '0');
|
*floatvalue = *floatvalue * 10.0 + (float) (*string - '0');
|
||||||
} //end else
|
} //end else
|
||||||
string++;
|
string++;
|
||||||
} //end while
|
} //end while
|
||||||
|
@ -1148,10 +1148,10 @@ void StripSingleQuotes(char *string)
|
||||||
// Returns: -
|
// Returns: -
|
||||||
// Changes Globals: -
|
// Changes Globals: -
|
||||||
//============================================================================
|
//============================================================================
|
||||||
double ReadSignedFloat(script_t *script)
|
float ReadSignedFloat(script_t *script)
|
||||||
{
|
{
|
||||||
token_t token;
|
token_t token;
|
||||||
double sign = 1.0;
|
float sign = 1.0;
|
||||||
|
|
||||||
PS_ExpectAnyToken(script, &token);
|
PS_ExpectAnyToken(script, &token);
|
||||||
if (!strcmp(token.string, "-"))
|
if (!strcmp(token.string, "-"))
|
||||||
|
|
|
@ -161,7 +161,7 @@ typedef struct token_s
|
||||||
int subtype; //last read token sub type
|
int subtype; //last read token sub type
|
||||||
#ifdef NUMBERVALUE
|
#ifdef NUMBERVALUE
|
||||||
unsigned long int intvalue; //integer value
|
unsigned long int intvalue; //integer value
|
||||||
double floatvalue; //floating point value
|
float floatvalue; //floating point value
|
||||||
#endif //NUMBERVALUE
|
#endif //NUMBERVALUE
|
||||||
char *whitespace_p; //start of white space before token
|
char *whitespace_p; //start of white space before token
|
||||||
char *endwhitespace_p; //start of white space before token
|
char *endwhitespace_p; //start of white space before token
|
||||||
|
@ -218,7 +218,7 @@ void StripSingleQuotes(char *string);
|
||||||
//read a possible signed integer
|
//read a possible signed integer
|
||||||
signed long int ReadSignedInt(script_t *script);
|
signed long int ReadSignedInt(script_t *script);
|
||||||
//read a possible signed floating point number
|
//read a possible signed floating point number
|
||||||
double ReadSignedFloat(script_t *script);
|
float ReadSignedFloat(script_t *script);
|
||||||
//set an array with punctuations, NULL restores default C/C++ set
|
//set an array with punctuations, NULL restores default C/C++ set
|
||||||
void SetScriptPunctuations(script_t *script, punctuation_t *p);
|
void SetScriptPunctuations(script_t *script, punctuation_t *p);
|
||||||
//set script flags
|
//set script flags
|
||||||
|
|
Loading…
Reference in a new issue