diff --git a/usr.bin/kdump/mksubr b/usr.bin/kdump/mksubr
index f551cb2bf3..244356b1b6 100644
--- a/usr.bin/kdump/mksubr
+++ b/usr.bin/kdump/mksubr
@@ -37,7 +37,7 @@ include_dir=$1
 # The XOR is necessary to prevent including the "0"-value in every
 # line.
 #
-auto_or_type () {
+auto_or_uint () {
 	local name grep file
 	name=$1
 	grep=$2
@@ -46,9 +46,9 @@ auto_or_type () {
 	cat <<_EOF_
 /* AUTO */
 void
-$name (int arg)
+$name (unsigned int arg)
 {
-	int	or = 0;
+	bool	or = false;
 	printf("%#x<", arg);
 _EOF_
 	egrep "^#[[:space:]]*define[[:space:]]+"${grep}"[[:space:]]*" \
@@ -60,8 +60,8 @@ _EOF_
 		printf "\tif(!((arg>0)^((%s)>0)))\n\t\tif_print_or(arg, %s, or);\n", $i, $i }'
 cat <<_EOF_
 	printf(">");
-	if (or == 0)
-		printf("<invalid>%ld", (long)arg);
+	if (or == false)
+		printf("<invalid>%u", arg);
 }
 
 _EOF_
@@ -75,7 +75,7 @@ _EOF_
 # The XOR is necessary to prevent including the "0"-value in every
 # line.
 #
-auto_or_typelong () {
+auto_or_ulong () {
 	local name grep file
 	name=$1
 	grep=$2
@@ -84,9 +84,9 @@ auto_or_typelong () {
 	cat <<_EOF_
 /* AUTO */
 void
-$name (long arg)
+$name (unsigned long arg)
 {
-	long	or = 0;
+	bool	or = 0;
 	printf("%#lx<", arg);
 _EOF_
 	egrep "^#[[:space:]]*define[[:space:]]+"${grep}"[[:space:]]*" \
@@ -98,8 +98,8 @@ _EOF_
 		printf "\tif(!((arg>0)^((%s)>0)))\n\t\tif_print_or(arg, %s, or);\n", $i, $i }'
 cat <<_EOF_
 	printf(">");
-	if (or == 0)
-		printf("<invalid>%ld", (long)arg);
+	if (or == false)
+		printf("<invalid>%lu", arg);
 }
 
 _EOF_
@@ -224,7 +224,7 @@ cat <<_EOF_
  * of this file.
  */
 #define print_or(str,orflag) do {                  \\
-	if (orflag) putchar('|'); else orflag = 1; \\
+	if (orflag) putchar('|'); else orflag = true; \\
 	printf (str); }                            \\
 	while (0)
 #define if_print_or(i,flag,orflag) do {            \\
@@ -357,21 +357,21 @@ sockoptlevelname (int level, int decimal)
 
 _EOF_
 
-auto_or_type "modename" "S_[A-Z]+[[:space:]]+[0-6]{7}" "sys/stat.h"
-auto_or_type "flagsname" "O_[A-Z]+[[:space:]]+0x[0-9A-Fa-f]+" "sys/fcntl.h"
-auto_or_type "accessmodename" "[A-Z]_OK[[:space:]]+0?x?[0-9A-Fa-f]+" "sys/unistd.h"
-auto_or_type "mmapprotname" "PROT_[A-Z]+[[:space:]]+0x[0-9A-Fa-f]+" "sys/mman.h"
-auto_or_type "mmapflagsname" "MAP_[A-Z]+[[:space:]]+0x[0-9A-Fa-f]+" "sys/mman.h"
-auto_or_type "wait4optname" "W[A-Z]+[[:space:]]+[0-9]+" "sys/wait.h"
-auto_or_type "getfsstatflagsname" "MNT_[A-Z]+[[:space:]]+0x[0-9][0-9][0-9][0-9][^0-9]" "sys/mount.h"
-auto_or_type "mountflagsname" "MNT_[A-Z]+[[:space:]]+0x[0-9][0-9][0-9][0-9][0-9]+" "sys/mount.h"
-auto_or_type "rebootoptname" "RB_[A-Z]+[[:space:]]+0x[0-9]+" "sys/reboot.h"
-auto_or_type "flockname" "LOCK_[A-Z]+[[:space:]]+0x[0-9]+" "sys/fcntl.h"
-auto_or_type "mlockallname" "MCL_[A-Z]+[[:space:]]+0x[0-9]+" "sys/mman.h"
-auto_or_type "shmatname" "SHM_[A-Z]+[[:space:]]+[0-9]{6}+" "sys/shm.h"
-auto_or_type "rforkname" "RF[A-Z]+[[:space:]]+\([0-9]+<<[0-9]+\)" "sys/unistd.h"
-auto_or_typelong "chflagsname" "[SU]F_[A-Z]+[[:space:]]+0x[0-9]+" "sys/stat.h"
-auto_or_type "atflagsname" "AT_[A-Z_]+[[:space:]]+[1-9]+[0-9]*" "sys/fcntl.h"
+auto_or_uint "modename" "S_[A-Z]+[[:space:]]+[0-6]{7}" "sys/stat.h"
+auto_or_uint "flagsname" "O_[A-Z]+[[:space:]]+0x[0-9A-Fa-f]+" "sys/fcntl.h"
+auto_or_uint "accessmodename" "[A-Z]_OK[[:space:]]+0?x?[0-9A-Fa-f]+" "sys/unistd.h"
+auto_or_uint "mmapprotname" "PROT_[A-Z]+[[:space:]]+0x[0-9A-Fa-f]+" "sys/mman.h"
+auto_or_uint "mmapflagsname" "MAP_[A-Z]+[[:space:]]+0x[0-9A-Fa-f]+" "sys/mman.h"
+auto_or_uint "wait4optname" "W[A-Z]+[[:space:]]+[0-9]+" "sys/wait.h"
+auto_or_uint "getfsstatflagsname" "MNT_[A-Z]+[[:space:]]+0x[0-9][0-9][0-9][0-9][^0-9]" "sys/mount.h"
+auto_or_uint "mountflagsname" "MNT_[A-Z]+[[:space:]]+0x[0-9][0-9][0-9][0-9][0-9]+" "sys/mount.h"
+auto_or_uint "rebootoptname" "RB_[A-Z]+[[:space:]]+0x[0-9]+" "sys/reboot.h"
+auto_or_uint "flockname" "LOCK_[A-Z]+[[:space:]]+0x[0-9]+" "sys/fcntl.h"
+auto_or_uint "mlockallname" "MCL_[A-Z]+[[:space:]]+0x[0-9]+" "sys/mman.h"
+auto_or_uint "shmatname" "SHM_[A-Z]+[[:space:]]+[0-9]{6}+" "sys/shm.h"
+auto_or_uint "rforkname" "RF[A-Z]+[[:space:]]+\([0-9]+<<[0-9]+\)" "sys/unistd.h"
+auto_or_ulong "chflagsname" "[SU]F_[A-Z]+[[:space:]]+0x[0-9]+" "sys/stat.h"
+auto_or_uint "atflagsname" "AT_[A-Z_]+[[:space:]]+[1-9]+[0-9]*" "sys/fcntl.h"
 
 auto_switch_type "whencename" "SEEK_[A-Z]+[[:space:]]+[0-9]+" "sys/unistd.h"
 auto_switch_type "rlimitname" "RLIMIT_[A-Z]+[[:space:]]+[0-9]+" "sys/resource.h"
