SMcC> Using ceil() to do the rounding would probably fix your version
SMcC> of the problem. I think the best fix, though, might be to change
SMcC> the calculation to "ceil(x - epsilon)", where epsilon is chosen
SMcC> to be about the amount that would show up as a single pixel in
SMcC> the display: in other words, we don't want to increase the scale
SMcC> unless there would actually be some swap usage visible.

>>>>> "MK" == Michelle Konzack <linux4miche...@tamay-dogan.net> writes:

MK> ----[ '/Development/xmem/xmem-1.20/MemStripChart.c' ]-------------------
MK> <snip>
MK> static int 
MK> repaint_window(w, left, width)
MK>     MemStripChartWidget w;
MK>     int left, width;
MK> {
MK>     int i, j;
MK>     int next = w->mem_strip_chart.interval;
MK>     int scale = w->mem_strip_chart.scale;
MK>     int scalewidth = 0;

MK>     /* Compute the minimum scale required to graph the data, but don't go
MK>        lower than min_scale. */
MK>     if (w->mem_strip_chart.interval != 0 || scale <= 
(int)w->mem_strip_chart.max_value)
MK>     scale = ((int) (w->mem_strip_chart.max_value)) + 1;
MK> ------------------------------------------------------------------------

MK> So this is line 400 but I do not understand what to change...  :-/

MK> I have searched for ceil() or ceiling() but not found it.
MK> Which header must I ad to get it?

If you have "manpages-dev" installed, I think "man ceil" should
provide the information you need: ceil() is from C89, it's declared in
math.h, and you should link with "-lm". Alternatively, you can get the
same effect as ceil() by adding a number that's slightly less than 1.0
and then doing a truncating conversion like the code is currently
doing. For instance, if you compute the "epsilon" value my previous
message refers to, you could add "1 - epsilon".

 -- Stephen




-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to