| 945 | // |
| 946 | |
| 947 | float // O - Number |
| 948 | ppdcSource::get_float(ppdcFile *fp) // I - File to read |
| 949 | { |
| 950 | char temp[256], // String buffer |
| 951 | *ptr; // Pointer into buffer |
| 952 | float val; // Floating point value |
| 953 | |
| 954 | |
| 955 | // Get the number from the file and range-check... |
| 956 | if (!get_token(fp, temp, sizeof(temp))) |
| 957 | { |
| 958 | _cupsLangPrintf(stderr, _("ppdc: Expected real number on line %d of %s."), |
| 959 | fp->line, fp->filename); |
| 960 | return (-1.0f); |
| 961 | } |
| 962 | |
| 963 | val = (float)_cupsStrScand(temp, &ptr, locdata); |
| 964 | |
| 965 | if (*ptr) |
| 966 | { |
| 967 | _cupsLangPrintf(stderr, |
| 968 | _("ppdc: Unknown trailing characters in real number \"%s\" " |
| 969 | "on line %d of %s."), temp, fp->line, fp->filename); |
| 970 | return (-1.0f); |
| 971 | } |
| 972 | else |
| 973 | return (val); |
| 974 | } |
| 975 | |
| 976 | |
| 977 | // |
nothing calls this directly
no test coverage detected