MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / _parse_quadhex

Function _parse_quadhex

externals/picojson/picojson.h:717–736  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

715};
716
717template <typename Iter> inline int _parse_quadhex(input<Iter> &in) {
718 int uni_ch = 0, hex;
719 for (int i = 0; i < 4; i++) {
720 if ((hex = in.getc()) == -1) {
721 return -1;
722 }
723 if ('0' <= hex && hex <= '9') {
724 hex -= '0';
725 } else if ('A' <= hex && hex <= 'F') {
726 hex -= 'A' - 0xa;
727 } else if ('a' <= hex && hex <= 'f') {
728 hex -= 'a' - 0xa;
729 } else {
730 in.ungetc();
731 return -1;
732 }
733 uni_ch = uni_ch * 16 + hex;
734 }
735 return uni_ch;
736}
737
738template <typename String, typename Iter> inline bool _parse_codepoint(String &out, input<Iter> &in) {
739 int uni_ch;

Callers 1

_parse_codepointFunction · 0.85

Calls 2

getcMethod · 0.80
ungetcMethod · 0.80

Tested by

no test coverage detected