On 16 March 2012 11:46, Chad Versace <span dir="ltr"><<a href="mailto:chad.versace@linux.intel.com">chad.versace@linux.intel.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Overall this patch looks good. Below are some comments, some more important<br>
than others...<br>
<div class="im"><br>
On 03/12/2012 02:41 PM, Paul Berry wrote:<br>
> Previous patches introduced code generation for the auto-generated<br>
> portions of the piglit-dispatch mechanism. This patch supplies the<br>
> remaining hand-written code, which includes:<br>
><br>
> - Code to initialize piglit-dispatch.<br>
><br>
> - The actions to be taken when looking up a function, when function<br>
> lookup fails, or when a function is unsupported.<br>
><br>
> - Code to determine whether piglit-dispatch has been initialized,<br>
> which GL version is supported, and whether a given extension is<br>
> supported.<br>
><br>
> - Code to look up a function using a name supplied at run-time.<br>
><br>
> - Definitions of basic GL types.<br>
> ---<br>
> tests/util/piglit-dispatch-init.c | 122 +++++++++++++++++++<br>
> tests/util/piglit-dispatch.c | 238 +++++++++++++++++++++++++++++++++++++<br>
> tests/util/piglit-dispatch.h | 149 +++++++++++++++++++++++<br>
> 3 files changed, 509 insertions(+), 0 deletions(-)<br>
> create mode 100644 tests/util/piglit-dispatch-init.c<br>
> create mode 100644 tests/util/piglit-dispatch.c<br>
> create mode 100644 tests/util/piglit-dispatch.h<br>
<br>
</div>-- snip --<br>
<div><div class="h5"><br>
> --- /dev/null<br>
> +++ b/tests/util/piglit-dispatch.c<br>
> @@ -0,0 +1,238 @@<br>
> +/* Copyright 2012 Intel Corporation<br>
> + *<br>
> + * Permission is hereby granted, free of charge, to any person obtaining a<br>
> + * copy of this software and associated documentation files (the "Software"),<br>
> + * to deal in the Software without restriction, including without limitation<br>
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,<br>
> + * and/or sell copies of the Software, and to permit persons to whom the<br>
> + * Software is furnished to do so, subject to the following conditions:<br>
> + *<br>
> + * The above copyright notice and this permission notice (including the next<br>
> + * paragraph) shall be included in all copies or substantial portions of the<br>
> + * Software.<br>
> + *<br>
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR<br>
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,<br>
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL<br>
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER<br>
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING<br>
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS<br>
> + * IN THE SOFTWARE.<br>
> + */<br>
> +<br>
> +#include "piglit-util.h"<br>
<br>
</div></div>I think you need to #include "piglit-dispatch.h" too.<br></blockquote><div><br>Huh, I wonder why this ever worked.<br><br>Oh, I see: piglit-util.h includes gl_wrap.h, which includes piglit-dispatch.h. Your suggestion is way clearer, and there's no harm in having a redundant include. I'll include piglit-dispatch.h before piglit-util.h.<br>
</div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div class="im"><br>
> +/* Global state maintained by the Piglit dispatch mechanism: */<br>
> +<br>
> +/**<br>
> + * Which function to call to get the address of a core function.<br>
> + */<br>
> +static piglit_get_proc_address_function_ptr __get_core_proc_address = NULL;<br>
<br>
</div>Identifiers that begin with __ are reserved, even if the identifier has static<br>
or local scope. They need to be renamed.<br>
<br>