From: handa Date: Thu, 30 Oct 2008 02:43:43 +0000 (+0000) Subject: (mface_get_prop): Fix strict aliasing bug. X-Git-Tag: XML-base~4 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=400cbf325c7cb03217a0e869b988d70fdb21ba2f;p=m17n%2Fm17n-lib.git (mface_get_prop): Fix strict aliasing bug. (mface_put_prop): Likewise. --- diff --git a/src/face.c b/src/face.c index 18fd03e..cd13c0e 100644 --- a/src/face.c +++ b/src/face.c @@ -1853,7 +1853,7 @@ mface_get_prop (MFace *face, MSymbol key) { if (key == Mhook_func) /* This unsafe code is for backward compatiblity. */ - return *(void **) &face->hook; + return (void *) face->hook; MERROR (MERROR_FACE, NULL); } return face->property[index]; @@ -1938,9 +1938,9 @@ mface_put_prop (MFace *face, MSymbol key, void *val) if (key == Mhook_func) { /* This unsafe code is for backward compatiblity. */ - if (*(void **) &face->hook == val) + if (face->hook == (MFaceHookFunc) val) return 0; - *(void **) &face->hook = val; + face->hook = (MFaceHookFunc) val; } else {