mirror of
https://github.com/yquake2/xatrix.git
synced 2024-11-10 06:42:22 +00:00
In ED_ParseField() replace atof() with strtof().
On most implementations atof() is just a wrapper around strtod(). Calling strtof() saves one cast. For the sake of cinsistency change atoi() to (int)strtol(), it's a noop. Reported by maraakate in yquake2 issue #160.
This commit is contained in:
parent
4285702803
commit
be91d27005
1 changed files with 3 additions and 3 deletions
|
@ -419,13 +419,13 @@ ED_ParseField(const char *key, const char *value, edict_t *ent)
|
|||
((float *)(b + f->ofs))[2] = vec[2];
|
||||
break;
|
||||
case F_INT:
|
||||
*(int *)(b + f->ofs) = atoi(value);
|
||||
*(int *)(b + f->ofs) = (int)strtol(value, (char **)NULL, 10);
|
||||
break;
|
||||
case F_FLOAT:
|
||||
*(float *)(b + f->ofs) = atof(value);
|
||||
*(float *)(b + f->ofs) = strtof(value, (char **)NULL);
|
||||
break;
|
||||
case F_ANGLEHACK:
|
||||
v = atof(value);
|
||||
v = strtof(value, (char **)NULL);
|
||||
((float *)(b + f->ofs))[0] = 0;
|
||||
((float *)(b + f->ofs))[1] = v;
|
||||
((float *)(b + f->ofs))[2] = 0;
|
||||
|
|
Loading…
Reference in a new issue