Bug 46251 - xkbcomp fails on geometry files with negative floating point values
Summary: xkbcomp fails on geometry files with negative floating point values
Status: RESOLVED MOVED
Alias: None
Product: xorg
Classification: Unclassified
Component: App/xkbcomp (show other bugs)
Version: unspecified
Hardware: Other All
: medium major
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-18 08:59 UTC by Martin
Modified: 2018-08-10 20:31 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Sample file to demontrate problem (294 bytes, application/octet-stream)
2012-02-18 08:59 UTC, Martin
no flags Details

Description Martin 2012-02-18 08:59:23 UTC
Created attachment 57236 [details]
Sample file to demontrate problem

xkbcomp has problems with shapes, that contain negative floating point values.


To reproduce:
See attachment file.
1) $ xkbcomp sample.xkb sample2.xkm
2) $ xkbcomp sample2.xkb sample3.xkb
3)
$ xkbcomp sample3.xkb
syntax error: line 10 of sample3.xkb
last scanned symbol is: corner
Errors encountered in sample3.xkb; not compiled.

Compare original file (sample.xkb) with sample3.xkb.
While positive floating points and negative integers pose no problem, negative floating point values become something like -3.-4 which makes no sense and gets a syntax error.
Comment 1 Daniel Stone 2012-08-08 17:38:44 UTC
... is this actually a problem though, given that negative co-ordinates don't make any sense there?
Comment 2 Martin 2012-10-27 05:43:38 UTC
What do you mean with "negative co-ordinates don't make any sense there"?
Every coordinate system allow
Comment 3 Martin 2012-10-27 06:43:54 UTC
What do you mean with "negative co-ordinates don't make any sense there"?
Every coordinate system allows negative coordinates. And even if not, then it should at least be mentioned somewhere.

And then there is just the point, that the same input values should result in the same output, or at least a valid output.



I tracked the problem even deeper, back to the library libxkbfile, where in the file libxkbfile-1.0.8/src/xkbtext.c on line 708 is written:
frac= val%XkbGeomPtsPerMM;

which /should/ be:
frac= abs(val%XkbGeomPtsPerMM);
(positions after decimal point are always absolute).
Comment 4 Daniel Stone 2012-10-31 01:14:45 UTC
Thanks for the fix.  But what effect would negative co-ordinates in a shape actually achieve, and why would you want them? I understand the general concept that co-ordinate systems should support negative co-ordinates.  But what's the value in supporting them in this specific case?
Comment 5 GitLab Migration User 2018-08-10 20:31:47 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/xorg/app/xkbcomp/issues/2.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.