MCPcopy Create free account
hub / github.com/OpenPrinting/cups / get_float

Method get_float

ppdc/ppdc-source.cxx:947–974  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

945//
946
947float // O - Number
948ppdcSource::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//

Callers

nothing calls this directly

Calls 2

_cupsLangPrintfFunction · 0.85
_cupsStrScandFunction · 0.85

Tested by

no test coverage detected