Fedora rawhide has moved to gcc 3.8 and I'm seeing:

$ ./x02a -dev psc -o x02a.psc

raised CONSTRAINT_ERROR : x02a.adb:138 overflow check failed

I'm taking that this is due to some increased checking with ada in 3.8.  
Thoughts?

  98     procedure demo2 is
  99         -- Set up cmap0
100         -- Use 100 custom colors in addition to base 16
101         r, g, b: Integer_Array_1D(0..115);
102
103         -- Min & max lightness values
104         lmin : Long_Float := 0.15;
105         lmax : Long_Float := 0.85;
106         h, l, s : Long_Float;
107         r1, g1, b1 : Long_Float;
108     begin
109         plbop;
110
111         -- Divide screen into 100 regions.
112         plssub(10, 10);
113
114         for i in 0..99 loop
115
116             -- Bounds on HLS, from plhlsrgb() commentary
117             -- hue        [0., 360.] degrees
118             -- lightness  [0., 1.]   magnitude
119             -- saturation [0., 1.]   magnitude
120
121             -- Vary hue uniformly from left to right
122             h := (360.0 / 10.0 ) * Long_Float( i mod 10 );
123
124             -- Vary lightness uniformly from top to bottom, between min & 
max.
125             l := lmin + (lmax - lmin) * Long_Float(i / 10) / 9.0;
126
127             -- Use max saturation.
128             s := 1.0;
129
130             plhlsrgb(h, l, s, r1, g1, b1);
131
132             -- Ada converts floats to integers by rounding while C does so 
by
133             -- truncation. There is no fool-proof way to fix that but this 
is pretty
134             -- close: Add a bit less than 1/2 to the float before 
converting. A good
135             -- number to use appears to be about 0.5 - 10^-16 which _might_
136             -- be an exact fix for 64-bit floats since they have about 16 
digits
137             -- of accuracy.
138             r(i+16) := Integer((r1 * 255.001) - 0.499999999999999);
139             g(i+16) := Integer((g1 * 255.001) - 0.499999999999999);
140             b(i+16) := Integer((b1 * 255.001) - 0.499999999999999);
141         end loop;
142
143         -- Load default cmap0 colors into our custom set.
144         for i in 0..15 loop
145             plgcol0(i, r(i), g(i), b(i));
146         end loop;
147
148         -- Now set cmap0 all at once (faster, since fewer driver calls).
149         plscmap0(r, g, b);
150
151         draw_windows(100, 16);
152
153         pleop;
154     end demo2;
-- 
Orion Poplawski
Technical Manager                     303-415-9701 x222
NWRA, Boulder Office                  FAX: 303-415-9702
3380 Mitchell Lane                       or...@nwra.com
Boulder, CO 80301                   http://www.nwra.com

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to