<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Manuel,<br>
<br>
Yeah. I ran into the bogus warnings over the weekend and pushed a fix
this morning:<br>
<br>
commit dcbc9be38ecea30506198d0db037cbf532f070e4<br>
Author: José Fonseca <a class="moz-txt-link-rfc2396E" href="mailto:jose.r.fonseca@gmail.com"><jose.r.fonseca@gmail.com></a><br>
Date: Tue Apr 5 21:35:11 2011 +0100<br>
<br>
draw: Fix thinko in debug warnings.<br>
<br>
Thanks for letting me know.<br>
<br>
Jose<br>
<br>
<br>
On 04/06/2011 11:52 AM, Manuel Massing wrote:
<blockquote cite="mid:201104061252.44572.m.massing@warped-space.de"
type="cite">
<meta name="qrichtext" content="1">
<style type="text/css">
p, li { white-space: pre-wrap; }
</style>
<p style="margin: 0px; text-indent: 0px;">Hi Jose,</p>
<p style="margin: 0px; text-indent: 0px;">there seems to be a logic
error in the commit</p>
<p style="margin: 0px; text-indent: 0px;">
3733da31e8b4405b65e1b6ca3b6599ecc5af5fe7 </p>
<p style="margin: 0px; text-indent: 0px;">(see below for the relevant
section).</p>
<p style="margin: 0px; text-indent: 0px;">The "index out of range"
message will be printed when the index is </p>
<p style="margin: 0px; text-indent: 0px;">actually valid, the
condition should be replaced by</p>
<p style="margin: 0px; text-indent: 0px;"> if (idx < min_index ||
idx > max_index)</p>
<p style="margin: 0px; text-indent: 0px;">cheers,</p>
<p style="margin: 0px; text-indent: 0px;"> Manuel</p>
<p style="margin: 0px; text-indent: 0px;">> ---
a/src/gallium/auxiliary/draw/draw_pt_vsplit_tmp.h</p>
<p style="margin: 0px; text-indent: 0px;">> +++
b/src/gallium/auxiliary/draw/draw_pt_vsplit_tmp.h</p>
<p style="margin: 0px; text-indent: 0px;">> @@ -56,7 +56,9 @@
CONCAT(vsplit_primitive_, ELT_TYPE)(struct</p>
<p style="margin: 0px; text-indent: 0px;">> vsplit_frontend
*vsplit,</p>
<p style="margin: 0px; text-indent: 0px;">> </p>
<p style="margin: 0px; text-indent: 0px;">> for (i = 0; i <
icount; i++) {</p>
<p style="margin: 0px; text-indent: 0px;">> ELT_TYPE idx = ib[i];</p>
<p style="margin: 0px; text-indent: 0px;">> - assert(idx >=
min_index && idx <= max_index);</p>
<p style="margin: 0px; text-indent: 0px;">> + if (idx >=
min_index && idx <= max_index) {</p>
<p style="margin: 0px; text-indent: 0px;">> +
debug_printf("warning: index out of range\n");</p>
<p style="margin: 0px; text-indent: 0px;">> + }</p>
<p style="margin: 0px; text-indent: 0px;">> }</p>
<p style="margin: 0px; text-indent: 0px;">> draw_elts = (const
ushort *) ib;</p>
<p style="margin: 0px; text-indent: 0px;">> }</p>
<p style="margin: 0px; text-indent: 0px;">> @@ -87,7 +89,9 @@
CONCAT(vsplit_primitive_, ELT_TYPE)(struct</p>
<p style="margin: 0px; text-indent: 0px;">> vsplit_frontend
*vsplit, for (i = 0; i < icount; i++) {</p>
<p style="margin: 0px; text-indent: 0px;">> ELT_TYPE idx = ib[i];</p>
<p style="margin: 0px; text-indent: 0px;">> </p>
<p style="margin: 0px; text-indent: 0px;">> - assert(idx >=
min_index && idx <= max_index);</p>
<p style="margin: 0px; text-indent: 0px;">> + if (idx >=
min_index && idx <= max_index) {</p>
<p style="margin: 0px; text-indent: 0px;">> +
debug_printf("warning: index out of range\n");</p>
<p style="margin: 0px; text-indent: 0px;">> + }</p>
<p style="margin: 0px; text-indent: 0px;">>
vsplit->draw_elts[i] = (ushort) idx;</p>
<p style="margin: 0px; text-indent: 0px;">> }</p>
<p style="margin: 0px; text-indent: 0px;">> }</p>
<p style="margin: 0px; text-indent: 0px;">> @@ -95,7 +99,9 @@
CONCAT(vsplit_primitive_, ELT_TYPE)(struct</p>
<p style="margin: 0px; text-indent: 0px;">> vsplit_frontend
*vsplit, for (i = 0; i < icount; i++) {</p>
<p style="margin: 0px; text-indent: 0px;">> ELT_TYPE idx = ib[i];</p>
<p style="margin: 0px; text-indent: 0px;">> </p>
<p style="margin: 0px; text-indent: 0px;">> - assert(idx >=
min_index && idx <= max_index);</p>
<p style="margin: 0px; text-indent: 0px;">> + if (idx >=
min_index && idx <= max_index) {</p>
<p style="margin: 0px; text-indent: 0px;">> +
debug_printf("warning: index out of range\n");</p>
<p style="margin: 0px; text-indent: 0px;">> + }</p>
<p style="margin: 0px; text-indent: 0px;">>
vsplit->draw_elts[i] = (ushort) (idx - min_index);</p>
<p style="margin: 0px; text-indent: 0px;">> }</p>
<p style="margin: 0px; text-indent: 0px;">> }</p>
</blockquote>
<br>
</body>
</html>