gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Riccardo Mottola
Subject: Re: Base - color pparsing bug - Was: [Re: GNUstep releases this month?]
Date: Thu, 21 Jan 2021 16:05:22 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0 SeaMonkey/2.53.6

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]