[Beignet] [PATCH 1/5] remove dollar sign in identifier

Lu, Guanqun guanqun.lu at intel.com
Tue Apr 16 22:28:45 PDT 2013


Sorry that I missed this mail.

I've no idea why there's dollar sign in the C++ identifier. But for portability and compatibility, we'd better remove this dollar sign. I don't have there's any reason to use that. It only confuses people.

> -----Original Message-----
> From: beignet-bounces+guanqun.lu=intel.com at lists.freedesktop.org
> [mailto:beignet-bounces+guanqun.lu=intel.com at lists.freedesktop.org] On
> Behalf Of Xing, Homer
> Sent: Tuesday, April 16, 2013 2:00 PM
> To: beignet at lists.freedesktop.org
> Subject: Re: [Beignet] [PATCH 1/5] remove dollar sign in identifier
> 
> Interesting ...  Why did the code have dollar sign inside ? What was the dollar
> sign used for ?
> 
> -----Original Message-----
> From: beignet-bounces+homer.xing=intel.com at lists.freedesktop.org
> [mailto:beignet-bounces+homer.xing=intel.com at lists.freedesktop.org] On
> Behalf Of Lu Guanqun
> Sent: Tuesday, April 16, 2013 2:39 PM
> To: Lu, Guanqun; beignet at lists.freedesktop.org
> Subject: [Beignet] [PATCH 1/5] remove dollar sign in identifier
> 
> Therefore it removes compiler warnings.
> 
> Signed-off-by: Lu Guanqun <guanqun.lu at intel.com>
> ---
>  backend/src/sys/mutex.hpp |   10 +++++-----
>  1 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/backend/src/sys/mutex.hpp b/backend/src/sys/mutex.hpp index
> c8e3f2f..1a462b0 100644
> --- a/backend/src/sys/mutex.hpp
> +++ b/backend/src/sys/mutex.hpp
> @@ -42,17 +42,17 @@ namespace gbe
>    /*! active mutex */
>    class MutexActive {
>    public:
> -    INLINE MutexActive(void) : $lock(LOCK_IS_FREE) {}
> +    INLINE MutexActive(void) : _lock(LOCK_IS_FREE) {}
>      INLINE void lock(void) {
>        GBE_COMPILER_READ_BARRIER;
> -      while (cmpxchg($lock, LOCK_IS_TAKEN, LOCK_IS_FREE) !=
> LOCK_IS_FREE)
> +      while (cmpxchg(_lock, LOCK_IS_TAKEN, LOCK_IS_FREE) !=
> + LOCK_IS_FREE)
>          _mm_pause();
>        GBE_COMPILER_READ_BARRIER;
>      }
> -    INLINE void unlock(void) { $lock.storeRelease(LOCK_IS_FREE); }
> +    INLINE void unlock(void) { _lock.storeRelease(LOCK_IS_FREE); }
>    protected:
> -    enum ${ LOCK_IS_FREE = 0, LOCK_IS_TAKEN = 1 };
> -    Atomic $lock;
> +    enum { LOCK_IS_FREE = 0, LOCK_IS_TAKEN = 1 };
> +    Atomic _lock;
>      MutexActive(const MutexActive&); // don't implement
>      MutexActive& operator=(const MutexActive&); // don't implement
>      GBE_CLASS(MutexActive);
> 
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet


More information about the Beignet mailing list