replace-rpn-hex.diff

Lakie, 2011-06-23 11:13

Download (1 KB)

View differences:

src/pseudo.cpp Mon May 09 17:55:47 2011 +0100
790 790
			IssueMessage(0, INVALID_EXTENSION);
791 791
			return 0;
792 792
		}
793
		int val, err = 0;
793
		int val, err = 0, s = in.tellg();
794 794
		val = DoCalc(in.ignore(),err);
795 795
		if (err>0)
796 796
			return 0;
797

  
798
		// Replace the original RPN with value
799
		int e = in.tellg(),
800
			p = orig.find(((istringstream&)in).str().substr(s, e - s));
801
		orig.erase(p, e - s);
802
		ostringstream Val;
803
		if (val >= 0x8000)
804
			Val << 'x' << setbase(16) << uppercase;
805
		Val << val;
806
		orig.insert(p, Val.str());
797 807
		return val;
798 808
	}
799 809

  
src/pseudo.h Mon May 09 17:55:47 2011 +0100
113 113
	static bool CanQuote(uint);
114 114
	static bool MayBeSprite(const string&);
115 115
	enum width {_B_, _BX_, _W_, _D_};
116
	static uint ReadValue(istream&, width);
116
	uint ReadValue(istream&, width);
117 117

  
118 118
private:
119 119
	bool DoQuote(uint)const;