[cairo] [PATCH] The pot() function may be hard to understand. Add comment.

Maarten Bosmans mkbosmans at gmail.com
Wed May 30 13:38:49 PDT 2012


2012/5/30 Homer Hsing <homer.hsing at gmail.com>:
> From d6330f4af88a02d39e39eaa13de94e48b1767c8e Mon Sep 17 00:00:00 2001
> From: Homer Hsing <homer.hsing at gmail.com>
> Date: Wed, 30 May 2012 14:06:02 +0800
> Subject: [PATCH] The pot() function may be hard to understand. Add comment.
>
> ---
>  src/cairo-clip-boxes.c    |    1 +
>  src/drm/cairo-drm-intel.c |    1 +
>  2 files changed, 2 insertions(+)
>
> diff --git a/src/cairo-clip-boxes.c b/src/cairo-clip-boxes.c
> index bbb4197..7b93de6 100644
> --- a/src/cairo-clip-boxes.c
> +++ b/src/cairo-clip-boxes.c
> @@ -52,6 +52,7 @@
>  #include "cairo-composite-rectangles-private.h"
>  #include "cairo-region-private.h"
>
> +/* return pow (2, ceil (log2 (v))) */

Why not simply do this in words? Something like:

/* Round up to the next power of two */

Maarten


More information about the cairo mailing list