Home » U++ Library support » U++ Core » FIX: UPP::Scan returns int64 for INT_V
Re: FIX: UPP::Scan returns int64 for INT_V [message #32019 is a reply to message #31995] |
Sun, 17 April 2011 14:57   |
 |
kohait00
Messages: 939 Registered: July 2009 Location: Germany
|
Experienced Contributor |
|
|
could you provide the link to the thread? couldnt find it..
i understand, that for best/secure performance ConvertInt should be able to keep the *parsed* data type as complete as possible (int64, if enough info provided from string), even if 'later' in usage the int64 is downgraded to int.
but then, the problem should be solved in EditInt, because, at most, there, one could expect to have a true int value returned. but it is not easy, since EditInt is a EditMinMax<> typedef.
i took a look in the code again. the int64 seems to be there to be able to perform range test after conversion, and return ErrorValue. there is also the solution to the problem. if no error, the range is ok and an int can be generated.
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) return int(m);//v; <====
return ErrorValue(UPP::Format(t_("Number must be between %d and %d."), minval, maxval));
}
[Updated on: Sun, 17 April 2011 15:30] Report message to a moderator
|
|
|
 |
|
FIX: UPP::Scan returns int64 for INT_V
By: kohait00 on Wed, 13 April 2011 23:01
|
 |
|
Re: FIX: UPP::Scan returns int64 for INT_V
|
 |
|
Re: FIX: UPP::Scan returns int64 for INT_V
By: kohait00 on Sun, 17 April 2011 14:57
|
 |
|
Re: FIX: UPP::Scan returns int64 for INT_V
By: mirek on Sun, 17 April 2011 21:23
|
 |
|
Re: FIX: UPP::Scan returns int64 for INT_V
By: kohait00 on Mon, 18 April 2011 10:46
|
 |
|
Re: FIX: UPP::Scan returns int64 for INT_V
By: mirek on Tue, 19 April 2011 07:28
|
 |
|
Re: FIX: UPP::Scan returns int64 for INT_V
By: kohait00 on Wed, 27 April 2011 14:07
|
 |
|
Re: FIX: UPP::Scan returns int64 for INT_V
By: mirek on Fri, 29 April 2011 20:17
|
 |
|
Re: FIX: UPP::Scan returns int64 for INT_V
|
 |
|
Re: FIX: UPP::Scan returns int64 for INT_V
|
 |
|
Re: FIX: UPP::Scan returns int64 for INT_V
By: mirek on Fri, 06 May 2011 09:58
|
 |
|
Re: FIX: UPP::Scan returns int64 for INT_V
|
 |
|
Re: FIX: UPP::Scan returns int64 for INT_V
By: mirek on Fri, 13 May 2011 10:52
|
 |
|
Re: FIX: UPP::Scan returns int64 for INT_V
|
 |
|
Re: FIX: UPP::Scan returns int64 for INT_V
By: mirek on Tue, 17 May 2011 18:51
|
 |
|
Re: FIX: UPP::Scan returns int64 for INT_V
|
 |
|
Re: FIX: UPP::Scan returns int64 for INT_V
By: mirek on Wed, 18 May 2011 22:57
|
 |
|
Re: FIX: UPP::Scan returns int64 for INT_V
|
Goto Forum:
Current Time: Sat Jul 19 04:23:15 CEST 2025
Total time taken to generate the page: 0.03462 seconds
|