[libobjc] Wrap CLASS_TABLE_HASH in do {} while (0)

2017-11-23  Tom de Vries  <tom@codesourcery.com>

	* class.c (CLASS_TABLE_HASH): Wrap in "do {} while (0)".

From-SVN: r255099
This commit is contained in:
Tom de Vries 2017-11-23 15:03:29 +00:00 committed by Tom de Vries
parent 77abf71fdf
commit 7f339ecbd3
2 changed files with 14 additions and 8 deletions

View File

@ -1,3 +1,7 @@
2017-11-23 Tom de Vries <tom@codesourcery.com>
* class.c (CLASS_TABLE_HASH): Wrap in "do {} while (0)".
2017-11-17 Igor Tsimbalist <igor.v.tsimbalist@intel.com>
* Makefile.in: Regenerate.

View File

@ -153,14 +153,16 @@ static objc_mutex_t __class_table_lock = NULL;
string, and HASH the computed hash of the string; CLASS_NAME is
untouched. */
#define CLASS_TABLE_HASH(INDEX, HASH, CLASS_NAME) \
HASH = 0; \
for (INDEX = 0; CLASS_NAME[INDEX] != '\0'; INDEX++) \
{ \
HASH = (HASH << 4) ^ (HASH >> 28) ^ CLASS_NAME[INDEX]; \
} \
\
HASH = (HASH ^ (HASH >> 10) ^ (HASH >> 20)) & CLASS_TABLE_MASK;
#define CLASS_TABLE_HASH(INDEX, HASH, CLASS_NAME) \
do { \
HASH = 0; \
for (INDEX = 0; CLASS_NAME[INDEX] != '\0'; INDEX++) \
{ \
HASH = (HASH << 4) ^ (HASH >> 28) ^ CLASS_NAME[INDEX]; \
} \
\
HASH = (HASH ^ (HASH >> 10) ^ (HASH >> 20)) & CLASS_TABLE_MASK; \
} while (0)
/* Setup the table. */
static void