This patch is

Reviewed-by: Ian Romanick <ian.d.roman...@intel.com>

On 03/31/2016 05:04 PM, Dylan Baker wrote:
> This just saves a bit of typing.
> 
> Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
> ---
>  src/mapi/glapi/gen/glX_server_table.py | 12 ++----------
>  1 file changed, 2 insertions(+), 10 deletions(-)
> 
> diff --git a/src/mapi/glapi/gen/glX_server_table.py 
> b/src/mapi/glapi/gen/glX_server_table.py
> index 4549fbd..a4bc04f 100644
> --- a/src/mapi/glapi/gen/glX_server_table.py
> +++ b/src/mapi/glapi/gen/glX_server_table.py
> @@ -27,6 +27,7 @@
>  #    Ian Romanick <i...@us.ibm.com>
>  
>  import argparse
> +import math
>  
>  import glX_XML
>  import glX_proto_common
> @@ -34,15 +35,6 @@ import gl_XML
>  import license
>  
>  
> -def log2(value):
> -    for i in xrange(30):
> -        p = 1 << i
> -        if p >= value:
> -            return i
> -
> -    return -1
> -
> -
>  def round_down_to_power_of_two(n):
>      """Returns the nearest power-of-two less than or equal to n."""
>  
> @@ -77,7 +69,7 @@ class function_table:
>              self.max_opcode = opcode
>  
>              if opcode > self.next_opcode_threshold:
> -                bits = log2(opcode)
> +                bits = int(math.log(opcode, 2))
>                  if (1 << bits) <= opcode:
>                      bits += 1
>  
> 

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to