Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » FIX: UPP::Scan returns int64 for INT_V
Re: FIX: UPP::Scan returns int64 for INT_V [message #32460 is a reply to message #32445] Wed, 18 May 2011 22:57 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14265
Registered: November 2005
Ultimate Member
kohait00 wrote on Wed, 18 May 2011 05:14

Quote:


Actually, why not.. (patch welcome to speed it up


how should i understand this? will you apply a change yourself or should i point to sth again? in that case this'd be it
Convert.cpp:ConvertInt::Scan
if(m >= minval && m <= maxval) return int(m);//v; <====




minval/maxval are int64....

Well, I was rather thinking about:

Value ConvertInt::Scan(const Value& text) const {
	Value v = UPP::Scan(INT_V, text);
	if(IsError(v)) return v;
	if(IsNull(v)) return notnull ? NotNullError() : v;
	int64 m = v;
	if(m >= minval && m <= maxval)
		if(m >= -INT_MIN && m <= INT_MAX)
			return (int)m;
		else
			return v;
	return ErrorValue(UPP::Format(t_("Number must be between %d and %d."), minval, maxval));
}


Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Rect_<T>::SetNull not correct for Rectf (Rect_<double>)
Next Topic: Ptr improve
Goto Forum:
  


Current Time: Mon Jul 14 23:57:12 CEST 2025

Total time taken to generate the page: 0.03545 seconds