squashfs_swap: Use explicit sizeof(struct xxx) rather than sizeof(*s)

Many years ago when Squashfs used bitfields the copying swap
macros relied on s(ource) (the first parameter) to be a pointer
to the appropriate structure type.  Beginning with the removal
of the bitfields the swap macros were rewritten, and over
a number of iterations the need for s to be a pointer to the
appropriate type has been removed - except for one vestigal (*)
requirement, when the host is a little endian system but the
destination/source is unaligned, no swapping is
required and memcpy is used to copy from the source
buffer to the destination buffer.  This code still requires
s to be pointer of the appropriate structure type to compute
the size of the memcpy, but, this is unnecessary, so replace
it with an explicit sizeof(struct xxx).  This finally removes
any requirement for either s(ource) or d(estination) to be of
any type.

(*) Note: the new SQUASHFS_INSWAP_XXX macros that were added
at the time of the macro rewrite to more efficiently swap
inplace rather than copying (where possible) still require the
passed pointer to be of the correct type, but, this is entirely
correct as the code by definition relies on a correctly aligned
structure of the appropriate type.

The whole point of removing the need for pointer typing from the
copying macros is it should prevent the compiler from making
assumptions about alignment based on type.  Problems with this
on ARM is what prompted the initial changes!

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
diff --git a/squashfs-tools/squashfs_swap.h b/squashfs-tools/squashfs_swap.h
index c21e4d7..afdee40 100644
--- a/squashfs-tools/squashfs_swap.h
+++ b/squashfs-tools/squashfs_swap.h
@@ -3,7 +3,7 @@
 /*
  * Squashfs
  *
- * Copyright (c) 2008, 2009, 2010
+ * Copyright (c) 2008, 2009, 2010, 2013
  * Phillip Lougher <phillip@squashfs.org.uk>
  *
  * This program is free software; you can redistribute it and/or
@@ -335,43 +335,43 @@
 #else
 /* little endian architecture, just copy */
 #define SQUASHFS_SWAP_SUPER_BLOCK(s, d)	\
-		SQUASHFS_MEMCPY(s, d, sizeof(*(s)))
+		SQUASHFS_MEMCPY(s, d, sizeof(struct squashfs_super_block))
 #define SQUASHFS_SWAP_DIR_INDEX(s, d) \
-		SQUASHFS_MEMCPY(s, d, sizeof(*(s)))
+		SQUASHFS_MEMCPY(s, d, sizeof(struct squashfs_dir_index))
 #define SQUASHFS_SWAP_BASE_INODE_HEADER(s, d) \
-		SQUASHFS_MEMCPY(s, d, sizeof(*(s)))
+		SQUASHFS_MEMCPY(s, d, sizeof(struct squashfs_base_inode_header))
 #define SQUASHFS_SWAP_IPC_INODE_HEADER(s, d) \
-		SQUASHFS_MEMCPY(s, d, sizeof(*(s)))
+		SQUASHFS_MEMCPY(s, d, sizeof(struct squashfs_ipc_inode_header))
 #define SQUASHFS_SWAP_LIPC_INODE_HEADER(s, d) \
-		SQUASHFS_MEMCPY(s, d, sizeof(*(s)))
+		SQUASHFS_MEMCPY(s, d, sizeof(struct squashfs_lipc_inode_header))
 #define SQUASHFS_SWAP_DEV_INODE_HEADER(s, d) \
-		SQUASHFS_MEMCPY(s, d, sizeof(*(s)))
+		SQUASHFS_MEMCPY(s, d, sizeof(struct squashfs_dev_inode_header))
 #define SQUASHFS_SWAP_LDEV_INODE_HEADER(s, d) \
-		SQUASHFS_MEMCPY(s, d, sizeof(*(s)))
+		SQUASHFS_MEMCPY(s, d, sizeof(struct squashfs_ldev_inode_header))
 #define SQUASHFS_SWAP_SYMLINK_INODE_HEADER(s, d) \
-		SQUASHFS_MEMCPY(s, d, sizeof(*(s)))
+		SQUASHFS_MEMCPY(s, d, sizeof(struct squashfs_symlink_inode_header))
 #define SQUASHFS_SWAP_REG_INODE_HEADER(s, d) \
-		SQUASHFS_MEMCPY(s, d, sizeof(*(s)))
+		SQUASHFS_MEMCPY(s, d, sizeof(struct squashfs_reg_inode_header))
 #define SQUASHFS_SWAP_LREG_INODE_HEADER(s, d) \
-		SQUASHFS_MEMCPY(s, d, sizeof(*(s)))
+		SQUASHFS_MEMCPY(s, d, sizeof(struct squashfs_lreg_inode_header))
 #define SQUASHFS_SWAP_DIR_INODE_HEADER(s, d) \
-		SQUASHFS_MEMCPY(s, d, sizeof(*(s)))
+		SQUASHFS_MEMCPY(s, d, sizeof(struct squashfs_dir_inode_header))
 #define SQUASHFS_SWAP_LDIR_INODE_HEADER(s, d) \
-		SQUASHFS_MEMCPY(s, d, sizeof(*(s)))
+		SQUASHFS_MEMCPY(s, d, sizeof(struct squashfs_ldir_inode_header))
 #define SQUASHFS_SWAP_DIR_ENTRY(s, d) \
-		SQUASHFS_MEMCPY(s, d, sizeof(*(s)))
+		SQUASHFS_MEMCPY(s, d, sizeof(struct squashfs_dir_entry))
 #define SQUASHFS_SWAP_DIR_HEADER(s, d) \
-		SQUASHFS_MEMCPY(s, d, sizeof(*(s)))
+		SQUASHFS_MEMCPY(s, d, sizeof(struct squashfs_dir_header))
 #define SQUASHFS_SWAP_FRAGMENT_ENTRY(s, d) \
-		SQUASHFS_MEMCPY(s, d, sizeof(*(s)))
+		SQUASHFS_MEMCPY(s, d, sizeof(struct squashfs_fragment_entry))
 #define SQUASHFS_SWAP_XATTR_ENTRY(s, d) \
-		SQUASHFS_MEMCPY(s, d, sizeof(*(s)))
+		SQUASHFS_MEMCPY(s, d, sizeof(struct squashfs_xattr_entry))
 #define SQUASHFS_SWAP_XATTR_VAL(s, d) \
-		SQUASHFS_MEMCPY(s, d, sizeof(*(s)))
+		SQUASHFS_MEMCPY(s, d, sizeof(struct squashfs_xattr_val))
 #define SQUASHFS_SWAP_XATTR_ID(s, d) \
-		SQUASHFS_MEMCPY(s, d, sizeof(*(s)))
+		SQUASHFS_MEMCPY(s, d, sizeof(struct squashfs_xattr_id))
 #define SQUASHFS_SWAP_XATTR_TABLE(s, d) \
-		SQUASHFS_MEMCPY(s, d, sizeof(*(s)))
+		SQUASHFS_MEMCPY(s, d, sizeof(struct squashfs_xattr_table))
 #define SQUASHFS_SWAP_INODE_T(s, d) SQUASHFS_SWAP_LONG_LONGS(s, d, 1)
 #define SQUASHFS_SWAP_FRAGMENT_INDEXES(s, d, n) \
 			SQUASHFS_SWAP_LONG_LONGS(s, d, n)