From: Thomas S. <t.s...@fz...> - 2008-05-22 14:07:54
|
> how to repair this? > check every call to 'b_move' and 'b_vector' (i.e. '*t->move' and > '*t->vector') that all arguments are positive? > everywhere, where 'b_move' and 'b_vector' are called? > that's a lot of work... > but i don't see another solution maybe 'b_move' and 'b_vector' could check their arguments for the highest bit set and then set the too large (= negative) argument to zero. this would not be too much code: --------------------------------------------------------------------- --- bitmap.c.orig 2005-04-22 23:40:37.000000000 +0200 +++ bitmap.c 2008-05-22 15:53:01.000000000 +0200 @@ -1168,6 +1168,7 @@ b_value = value; } +static unsigned int b_negmask = (1 << (8*sizeof(unsigned int)-1)); /* * move to (x,y) @@ -1175,6 +1176,8 @@ void b_move(unsigned int x, unsigned int y) { + if (x & b_negmask) x = 0; + if (y & b_negmask) y = 0; b_currx = x; b_curry = y; } @@ -1186,6 +1189,8 @@ void b_vector(unsigned int x, unsigned int y) { + if (x & b_negmask) x = 0; + if (y & b_negmask) y = 0; b_line(b_currx, b_curry, x, y); b_currx = x; b_curry = y; --------------------------------------------------------------------- any ideas? thomas -- View this message in context: http://www.nabble.com/DPU-414-terminal-tp17371497p17405047.html Sent from the Gnuplot - Dev mailing list archive at Nabble.com. |