Re: Base - color pparsing bug - Was: [Re: GNUstep releases this month?]

Riccardo Mottola <[email protected]>
Newsgroups gmane.comp.lib.gnustep.devel
Message-ID <[email protected]>
Hi,

Fred Kiefer wrote:
> In a previous mail you stated that str is something like „1 1 1“ or „0 0 0“. The next step would be to write a short test program that feeds these strings to the code above and outputs the values for r, g and b and of course the result of isAtEnd. That should make it easy to track down the issue. But you are the only one with a SPARC processor
I prepared a test containing this:

  str = @"1 1 1";
  scanner = [[NSScanner alloc] initWithString: str];
  [scanner scanDouble: &r];
  [scanner scanDouble: &g];
  [scanner scanDouble: &b];
  isAtEnd = [scanner isAtEnd];
  NSLog(@"parsed: %lf, %lf, %lf - isAtEnd? %d", r, g, b, isAtEnd);
  [scanner release]; 

  str = @"0 0 0";
  scanner = [[NSScanner alloc] initWithString: str];
  [scanner scanDouble: &r];
  [scanner scanDouble: &g];
  [scanner scanDouble: &b];
  isAtEnd = [scanner isAtEnd];
  NSLog(@"parsed: %lf, %lf, %lf - isAtEnd? %d", r, g, b, isAtEnd);
  [scanner release]; 

does this look reasonable? it looks to me.

On intel I get an unexpected result:
2021-01-21 14:09:20.967 ScannerTest[26541:26541] parsed: 1.000000,
1.000000, 1.000000 - isAtEnd? 1
2021-01-21 14:09:20.968 ScannerTest[26541:26541] parsed: 1.000000,
1.000000, 1.000000 - isAtEnd? 1

which is consistent with SPARC:
2021-01-21 16:02:32.466 ScannerTest[5278:3930190648] parsed: 1.000000,
1.000000, 1.000000 - isAtEnd? 1
2021-01-21 16:02:32.555 ScannerTest[5278:3930190648] parsed: 1.000000,
1.000000, 1.000000 - isAtEnd? 1


but why not 0.0  the second time?

Riccardo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.