[Mesa-dev] [PATCH 09/11] clover: Add constructors to some of the module classes v2

Francisco Jerez currojerez at riseup.net
Wed May 23 04:59:24 PDT 2012


Tom Stellard <tstellar at gmail.com> writes:

> This is for the llvm code that can't use extended initializers.
>
> v2:
>   - Use const references for vector arguments
>   - Move constructor defs before data members
>   - Initialize all values in the default constructors
> ---
>  src/gallium/state_trackers/clover/core/module.hpp |   13 +++++++++++++
>  1 files changed, 13 insertions(+), 0 deletions(-)
>
> diff --git a/src/gallium/state_trackers/clover/core/module.hpp b/src/gallium/state_trackers/clover/core/module.hpp
> index bc4b203..6361898 100644
> --- a/src/gallium/state_trackers/clover/core/module.hpp
> +++ b/src/gallium/state_trackers/clover/core/module.hpp
> @@ -44,6 +44,11 @@ namespace clover {
>              data_private
>           };
>  
> +         section(resource_id id, enum type type, size_t size,
> +                 const clover::compat::vector<char> &data) :
> +                 id(id), type(type), size(size), data(data) { }
> +         section() : id(0), type(type), size(0), data() { }
> +

"type(type)" doesn't initialize it to any definite value.  Use
"type(text)", for example.

Other than that, Reviewed-by: Francisco Jerez <currojerez at riseup.net>

>           resource_id id;
>           type type;
>           size_t size;
> @@ -63,11 +68,19 @@ namespace clover {
>              sampler
>           };
>  
> +         argument(enum type type, size_t size) : type(type), size(size) { }
> +         argument() : type(scalar), size(0) { }
> +
>           type type;
>           size_t size;
>        };
>  
>        struct symbol {
> +         symbol(const clover::compat::vector<char> &name, resource_id section,
> +                size_t offset, const clover::compat::vector<argument> &args) :
> +                name(name), section(section), offset(offset), args(args) { }
> +         symbol() : name(), section(0), offset(0), args() { }
> +
>           clover::compat::vector<char> name;
>           resource_id section;
>           size_t offset;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 229 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20120523/df66aaca/attachment.pgp>


More information about the mesa-dev mailing list