Giuseppe Bilotta writes:
> Actually, it just occurred to me that a negative scaling factor could
> be interpreted as a reflection in that direction (i.e. --scale -2x1
> could be aliased to --scale 2x1 --reflect x). Or is it not worth it?
Not worth it in my eye --
On Tue, Feb 6, 2018 at 8:03 PM, Keith Packard wrote:
> Giuseppe Bilotta writes:
>> I'll add the positive check for both scale and gamma and respin the patch.
>
> Thanks.
Actually, it just occurred to me that a negative scaling factor could
be
Giuseppe Bilotta writes:
> Joking aside, this does mean that strtod could be a good option when
> parsing the single value. The check would be more verbose though, so I
> think I'll stick with sscanf.
Sure, your sscanf pattern is pretty simple to understand.
> I'll
On Tue, Feb 6, 2018 at 3:43 AM, Keith Packard wrote:
> No, strtod requires a non-empty sequence of digits.
Woah. My whole life is a lie …
(I guess it's my fault for never bothering to actually verify this.)
> strtod is actually not a terrible function (surprising for libc, I
Giuseppe Bilotta writes:
> Not in the sense I mean above. If the string is a sequences of
> whitespace characters, strtod would return 0 as value (no conversion),
> and set endptr to the end of the string, because it would gobble the
> whitespace. This would be
On Tue, Feb 6, 2018 at 1:01 AM, Keith Packard wrote:
> Giuseppe Bilotta writes:
>
>> I'm not a big fan of strtod because with it it's impossible to know if
>> a conversion actually happened. xrandr --scale ' ' would actually be
>> accepted
Giuseppe Bilotta writes:
> I'm not a big fan of strtod because with it it's impossible to know if
> a conversion actually happened. xrandr --scale ' ' would actually be
> accepted (resulting in a scale value of 0), while the scanf catches
> it.
strtod takes an
Am 05.02.2018 11:24, schrieb Giuseppe Bilotta:
> On Mon, Feb 5, 2018 at 10:44 AM, walter harms wrote:
>>
>> Am 05.02.2018 02:47, schrieb Giuseppe Bilotta:
>>> {
>>> double sx, sy;
>>> + char junk;
>>> if (!config_output) argerr ("%s must be used
On Mon, Feb 5, 2018 at 10:44 AM, walter harms wrote:
>
> Am 05.02.2018 02:47, schrieb Giuseppe Bilotta:
>> {
>> double sx, sy;
>> + char junk;
>> if (!config_output) argerr ("%s must be used after --output\n",
>> argv[i]);
>> if (++i >=
Am 05.02.2018 02:47, schrieb Giuseppe Bilotta:
> We used to accept something like --scale 2x3junk as a valid input
> (scaling x by 2 and y by 3), even though this isn't really a valid
> scaling factor.
>
> Fix by making sure there is nothing after the parsed number(s).
>
> Signed-off-by:
10 matches
Mail list logo