Fix a "dereference of type-punned pointer" compiler warning
commitc1b62b2eded035d22584c427487503335f519d4c
authorRamsay Jones <ramsay@ramsay1.demon.co.uk>
Tue, 1 Jun 2010 18:35:49 +0000 (1 19:35 +0100)
committerAndreas Ericsson <ae@op5.se>
Wed, 2 Jun 2010 09:18:56 +0000 (2 11:18 +0200)
treeb5e02a3b76c602bcd6230826850672f828e67d23
parent6e0fa05b58c140a42ef25dc74041e30f25772b2c
Fix a "dereference of type-punned pointer" compiler warning

gcc (4.4.0) issues the following warning:

    src/revobject.c:33: warning: dereferencing type-punned pointer \
        will break strict-aliasing rules

We suppress the warning by copying the first 4 bytes from the oid
structure into an 'unsigned int' using memcpy(). This will also
fix any potential alignment issues on certain platforms.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Andreas Ericsson <ae@op5.se>
src/revobject.c