From b165c4c21bafcb14e2b7ef3a57f9fc07b128c3be Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Mon, 30 May 2011 11:39:12 -0400 Subject: [PATCH] Bug 659546 - Silence clang warnings about alignment requirement increase in nsID::Equals after bug 164580; r=bsmedberg --- xpcom/glue/nsID.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xpcom/glue/nsID.h b/xpcom/glue/nsID.h index 2abb34c2c7c5..26da5d6bb966 100644 --- a/xpcom/glue/nsID.h +++ b/xpcom/glue/nsID.h @@ -73,9 +73,10 @@ struct nsID { */ inline PRBool Equals(const nsID& other) const { + // First cast to void* in order to silence the alignment warnings. return - ((PRUint64*) &m0)[0] == ((PRUint64*) &other.m0)[0] && - ((PRUint64*) &m0)[1] == ((PRUint64*) &other.m0)[1]; + ((PRUint64*)(void*) &m0)[0] == ((PRUint64*)(void*) &other.m0)[0] && + ((PRUint64*)(void*) &m0)[1] == ((PRUint64*)(void*) &other.m0)[1]; } /**