[Beignet] [Patch V2 1/2] Change the KB and MB define to enum.

Zhigang Gong zhigang.gong at linux.intel.com
Wed Feb 11 00:26:37 PST 2015


This patch LGTM, will push latter.

On Wed, Feb 11, 2015 at 03:44:57PM +0800, Yang Rong wrote:
> Using the enum to avoid name conflict.
> 
> Signed-off-by: Yang Rong <rong.r.yang at intel.com>
> ---
>  backend/src/sys/platform.hpp | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/backend/src/sys/platform.hpp b/backend/src/sys/platform.hpp
> index e7aeee6..173b880 100644
> --- a/backend/src/sys/platform.hpp
> +++ b/backend/src/sys/platform.hpp
> @@ -258,10 +258,14 @@ private: \
>  /*! Default alignment for the platform */
>  #define GBE_DEFAULT_ALIGNMENT 16
>  
> +namespace gbe
> +{
>  /*! Useful constants */
> -#define KB 1024
> -#define MB (KB*KB)
> -
> +  enum {
> +    KB = 1024,
> +    MB = (KB*KB),
> +  };
> +}
>  /*! Portable AlignOf */
>  template <typename T>
>  struct AlignOf {
> -- 
> 1.8.3.2
> 
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet


More information about the Beignet mailing list