linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Adam Buchbinder <abuchbinder@google.com>
To: linux-btrfs@vger.kernel.org
Cc: abuchbinder@google.com
Subject: [PATCH] btrfs-progs: Tighten integer types in print-tree.
Date: Mon, 10 Jul 2017 14:29:09 -0700	[thread overview]
Message-ID: <20170710212909.31559-2-abuchbinder@google.com> (raw)
In-Reply-To: <20170710212909.31559-1-abuchbinder@google.com>

There are likely more places where the wrong size types are used, but
these tripped Clang's warnings because they eventually get passed to
printf.

Signed-off-by: Adam Buchbinder <abuchbinder@google.com>
---
 print-tree.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/print-tree.c b/print-tree.c
index a0d3395..82d6572 100644
--- a/print-tree.c
+++ b/print-tree.c
@@ -197,7 +197,7 @@ static void qgroup_flags_to_str(u64 flags, char *ret)
 
 void print_chunk(struct extent_buffer *eb, struct btrfs_chunk *chunk)
 {
-	int num_stripes = btrfs_chunk_num_stripes(eb, chunk);
+	u16 num_stripes = btrfs_chunk_num_stripes(eb, chunk);
 	int i;
 	u32 chunk_item_size = btrfs_chunk_item_size(num_stripes);
 	char chunk_flags_str[32] = {0};
@@ -336,7 +336,7 @@ static void print_file_extent_item(struct extent_buffer *eb,
 				   int slot,
 				   struct btrfs_file_extent_item *fi)
 {
-	int extent_type = btrfs_file_extent_type(eb, fi);
+	unsigned char extent_type = btrfs_file_extent_type(eb, fi);
 	char compress_str[16];
 
 	compress_type_to_str(btrfs_file_extent_compression(eb, fi),
-- 
2.13.2.725.g09c95d1e9-goog


  reply	other threads:[~2017-07-10 21:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-10 21:29 [PATCH] btrfs-progs: Fix missing internal deps in tests Adam Buchbinder
2017-07-10 21:29 ` Adam Buchbinder [this message]
2017-07-12 22:26   ` [PATCH] btrfs-progs: Tighten integer types in print-tree David Sterba
2017-07-12 22:24 ` [PATCH] btrfs-progs: Fix missing internal deps in tests David Sterba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170710212909.31559-2-abuchbinder@google.com \
    --to=abuchbinder@google.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).