mirror of
https://github.com/yquake2/rogue.git
synced 2024-11-10 06:42:21 +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
c61bff46d7
commit
f4002456b4
1 changed files with 3 additions and 3 deletions
|
@ -487,13 +487,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