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:
Yamagi Burmeister 2016-12-17 11:02:18 +01:00
parent 4285702803
commit be91d27005

View file

@ -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;