+ case FIO_OPT_FLOAT_LIST: {
+ char *cp2;
+
+ if (first) {
+ /*
+ ** Initialize precision to 0 and zero out list
+ ** in case specified list is shorter than default
+ */
+ if (o->off2) {
+ ul2 = 0;
+ if (o->prof_opts)
+ ilp = td_var(o->prof_opts, o->off2);
+ else
+ ilp = td_var(data, o->off2);
+ *ilp = ul2;
+ }
+
+ if (o->prof_opts)
+ flp = td_var(o->prof_opts, o->off1);
+ else
+ flp = td_var(data, o->off1);
+ for(i = 0; i < o->maxlen; i++)
+ flp[i].u.f = 0.0;
+ }
+ if (curr >= o->maxlen) {
+ log_err("the list exceeding max length %d\n",
+ o->maxlen);
+ return 1;
+ }
+ if (!str_to_float(ptr, &uf)) {
+ log_err("not a floating point value: %s\n", ptr);
+ return 1;
+ }
+ if (uf > o->maxfp) {
+ log_err("value out of range: %f"
+ " (range max: %f)\n", uf, o->maxfp);
+ return 1;
+ }
+ if (uf < o->minfp) {
+ log_err("value out of range: %f"
+ " (range min: %f)\n", uf, o->minfp);
+ return 1;
+ }
+
+ if (o->prof_opts)
+ flp = td_var(o->prof_opts, o->off1);
+ else
+ flp = td_var(data, o->off1);
+ flp[curr].u.f = uf;
+
+ dprint(FD_PARSE, " out=%f\n", uf);
+
+ /*
+ ** Calculate precision for output by counting
+ ** number of digits after period. Find first
+ ** period in entire remaining list each time
+ */
+ cp2 = strchr(ptr, '.');
+ if (cp2 != NULL) {
+ int len = 0;
+
+ while (*++cp2 != '\0' && *cp2 >= '0' && *cp2 <= '9')
+ len++;
+
+ if (o->off2) {
+ if (o->prof_opts)
+ ilp = td_var(o->prof_opts, o->off2);
+ else
+ ilp = td_var(data, o->off2);
+ if (len > *ilp)
+ *ilp = len;
+ }
+ }
+
+ break;
+ }