From fed0d959b71c4026fc193f903f86b5d0669bc87c Mon Sep 17 00:00:00 2001 From: Warren Toomey Date: Fri, 11 Mar 2016 22:18:04 +1000 Subject: [PATCH] Replace numeric literal with constant. --- tools/mkfs7 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/mkfs7 b/tools/mkfs7 index e97ea21..9c269a7 100755 --- a/tools/mkfs7 +++ b/tools/mkfs7 @@ -23,6 +23,7 @@ use constant DIRENTSIZE => 8; # Size of an directory entry use constant DIRENTSPERBLK => WORDSPERBLK / DIRENTSIZE; use constant DD_INUM => 2; # I-number of the dd directory +use constant MAXINT => 0777777; # Biggest unsigned integer # i-node field offsets use constant I_FLAGS => 0; @@ -190,7 +191,7 @@ sub fill_inode { my ( $inum, $perms, $filetype, $uid, $size, @blklist ) = @_; die("Too many blocks\n") if ( @blklist > 7 ); - $uid &= 0777777; # truncate negative UID to 18 bits + $uid &= MAXINT; # truncate negative UID to 18 bits # Calculate the block number and word offset for this $inum = allocate_inode() if ( !defined($inum) );