Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ TryParseInt64()

static bool System.Xml.XmlConverter.TryParseInt64 ( byte[] chars,
int offset,
int count,
out long result )
inlinestaticprivate

Definition at line 628 of file XmlConverter.cs.

629 {
630 result = 0L;
631 if (count < 11)
632 {
634 {
635 return false;
636 }
637 result = result2;
638 return true;
639 }
640 long num = 0L;
641 int num2 = offset + count;
642 if (chars[offset] == 45)
643 {
644 for (int i = offset + 1; i < num2; i++)
645 {
646 int num3 = chars[i] - 48;
647 if ((uint)num3 > 9u)
648 {
649 return false;
650 }
651 if (num < -922337203685477580L)
652 {
653 return false;
654 }
655 num *= 10;
656 if (num < long.MinValue + num3)
657 {
658 return false;
659 }
660 num -= num3;
661 }
662 }
663 else
664 {
665 for (int j = offset; j < num2; j++)
666 {
667 int num4 = chars[j] - 48;
668 if ((uint)num4 > 9u)
669 {
670 return false;
671 }
672 if (num > 922337203685477580L)
673 {
674 return false;
675 }
676 num *= 10;
677 if (num > long.MaxValue - num4)
678 {
679 return false;
680 }
681 num += num4;
682 }
683 }
684 result = num;
685 return true;
686 }
static bool TryParseInt32(byte[] chars, int offset, int count, out int result)

References System.chars, System.count, System.Xml.Dictionary, System.Xml.L, System.offset, and System.Xml.XmlConverter.TryParseInt32().

Referenced by System.Xml.XmlConverter.ToInt64().