MCPcopy Create free account
hub / github.com/coreutils/coreutils / simple_strtod_fatal

Function simple_strtod_fatal

src/numfmt.c:736–772  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

734
735
736static void
737simple_strtod_fatal (enum simple_strtod_error err, char const *input_str)
738{
739 char const *msgid = NULL;
740
741 switch (err)
742 {
743 case SSE_OK_PRECISION_LOSS:
744 case SSE_OK:
745 /* should never happen - this function isn't called when OK. */
746 unreachable ();
747
748 case SSE_OVERFLOW:
749 msgid = N_("value too large to be converted: %s");
750 break;
751
752 case SSE_INVALID_NUMBER:
753 msgid = N_("invalid number: %s");
754 break;
755
756 case SSE_VALID_BUT_FORBIDDEN_SUFFIX:
757 msgid = N_("rejecting suffix in input: %s (consider using --from)");
758 break;
759
760 case SSE_INVALID_SUFFIX:
761 msgid = N_("invalid suffix in input: %s");
762 break;
763
764 case SSE_MISSING_I_SUFFIX:
765 msgid = N_("missing 'i' suffix in input: %s (e.g Ki/Mi/Gi)");
766 break;
767
768 }
769
770 if (inval_style != inval_ignore)
771 error (conv_exit_code, 0, gettext (msgid), quote (input_str));
772}
773
774/* Convert VAL to a human format string using PRECISION in BUF of size
775 BUF_SIZE. Use SCALE, GROUP, and ROUND to format. Return

Callers 1

parse_human_numberFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected