Avoid reinterpret_cast to same type

...as GCC 4.6 reports "error: invalid cast from type 'pthread_t {aka long
unsigned int}' to type 'long unsigned int'" despite [expr.reinterpret.cast]/2:
"An expression of integral, enumeration, pointer, or pointer-to-member type can
be explicitly converted to its own type; such a cast yields the value of its
operand."

Change-Id: I26f1a3e6df2f0e55c665ad4f49185e0ebf432e95
This commit is contained in:
Stephan Bergmann 2015-01-21 14:25:23 +01:00
parent 921cea89da
commit ed8110e101
2 changed files with 6 additions and 3 deletions

View File

@ -309,9 +309,12 @@ int macxp_resolveAlias(char *path, int buflen);
# define INIT_GROUPS(name, gid) ((setgid((gid)) == 0) && (initgroups((name), (gid)) == 0))
#endif
#ifndef PTHREAD_VALUE
# define PTHREAD_VALUE(t) (t)
#if defined MACOSX
#define PTHREAD_VALUE(t) reinterpret_cast<unsigned long>(t)
#else
#define PTHREAD_VALUE(t) (t)
#endif
#ifndef PTHREAD_NONE
# define PTHREAD_NONE _pthread_none_
# ifndef PTHREAD_NONE_INIT

View File

@ -551,7 +551,7 @@ void SAL_CALL osl_setThreadName(char const * name) {
/* osl_getThreadIdentifier @@@ see TODO @@@ */
/*****************************************************************************/
#define HASHID(x) (reinterpret_cast<unsigned long>(PTHREAD_VALUE(x)) % HashSize)
#define HASHID(x) ((unsigned long)PTHREAD_VALUE(x) % HashSize)
typedef struct _HashEntry
{