<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Maybe this function should be in util.c.<br><br>A+<br><br>David<br><br><br>--- En date de&nbsp;: <b>Lun 19.4.10, Henri Verbeet <i>&lt;hverbeet@gmail.com&gt;</i></b> a écrit&nbsp;:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>De: Henri Verbeet &lt;hverbeet@gmail.com&gt;<br>Objet: Re: [PATCH] d3dx9_36: Implement D3DXCheckTextureRequirements + tests<br>À: wine-devel@winehq.org<br>Date: Lundi 19 avril 2010, 11h43<br><br><div class="plainMail">On 19 April 2010 09:43, Christian Costa &lt;<a ymailto="mailto:titan.costa@wanadoo.fr" href="/mc/compose?to=titan.costa@wanadoo.fr">titan.costa@wanadoo.fr</a>&gt; wrote:<br>&gt; +BOOL is_pow2(UINT num)<br>&gt; +{<br>&gt; +&nbsp; &nbsp; UINT i;<br>&gt; +<br>&gt; +&nbsp; &nbsp; if (!num) return FALSE;<br>&gt; +&nbsp; &nbsp; for (i = 0; num &gt;&gt; 1; i++) num
 &gt;&gt;= 1;<br>&gt; +<br>&gt; +&nbsp; &nbsp; return (num &lt;&lt; i) == num;<br>&gt; +}<br>This should at least be static. You can also just replace it with<br>"return !(num &amp; (num - 1));". You don't care about 0, since you<br>already check that earlier in D3DXCheckTextureRequirements().<br>make_pow2() can probably be simplified as well.<br><br><br></div></blockquote></td></tr></table><br>