reiserfsprogs: add helpers for constant endian routines

Initializing structures with little endian values requires a const
value. This means that the endian routines that are macro blocks
cause build failures.

This patch introduces constant_ macros that don't involve an
assignment. These can only be used with constant values or
unexpected results may occur.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
This commit is contained in:
Jeff Mahoney committed 2013-09-17 13:28:53 -04:00
1 parent 19566d0878
commit 57eac8416c
3 files changed
+55 -32

No files matched your search

+3 -2
View File
@@ -13,8 +13,9 @@ struct reiserfs_key root_dir_key = { 0, 0, {{0, 0},} };
struct reiserfs_key parent_root_dir_key = { 0, 0, {{0, 0},} };
struct reiserfs_key lost_found_dir_key = { 0, 0, {{0, 0},} };
static struct reiserfs_key badblock_key =
{ cpu_to_le32(BADBLOCK_DIRID), cpu_to_le32(BADBLOCK_OBJID),
{{cpu_to_le32(0), cpu_to_le32(0)},} };
{ constant_cpu_to_le32(BADBLOCK_DIRID),
constant_cpu_to_le32(BADBLOCK_OBJID),
{{constant_cpu_to_le32(0), constant_cpu_to_le32(0)},} };
__u16 root_dir_format = 0;
__u16 lost_found_dir_format = 0;