Skip to content
Snippets Groups Projects
Commit e86a3f7e authored by Scott Graham's avatar Scott Graham
Browse files

[gn][minfs] Fix a few minor warnings in new gn build

Missed a few configs before. I hope to go back and tidy these helpers up
once we add a SafeInt library.

[22948->880/23885 ~58] CXX host-x64-linux-clang/obj/system/host/minfs/minfs.main.cpp.o
../system/host/minfs/main.cpp:117:12: warning: implicit conversion loses integer precision: 'ssize_t' (aka 'long') to 'zx_status_t' (aka 'int') [-Wshorten-64-to-32]
    return r;
    ~~~~~~ ^
../system/host/minfs/main.cpp:313:37: warning: implicit conversion loses integer precision: 'unsigned long' to 'uint32_t' (aka 'unsigned int') [-Wshorten-64-to-32]
    uint32_t dir_blocks = dir_count + (dir_bytes_ / minfs::kMinfsBlockSize);
             ~~~~~~~~~~   ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../system/host/minfs/main.cpp:318:37: warning: implicit conversion loses integer precision: 'long' to 'uint32_t' (aka 'unsigned int') [-Wshorten-64-to-32]
    info.block_count = data_blocks_ + dir_blocks;
                     ~ ~~~~~~~~~~~~~^~~~~~~~~~~~
../system/host/minfs/main.cpp:580:37: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'uint8_t' (aka 'unsigned char') [-Wimplicit-int-conversion]
    dir_bytes_ += minfs::DirentSize(strlen(last_slash));
                  ~~~~~             ^~~~~~~~~~~~~~~~~~
../system/host/minfs/main.cpp:585:67: warning: implicit conversion loses integer precision: 'long' to 'uint32_t' (aka 'unsigned int') [-Wshorten-64-to-32]
    uint32_t remaining = (file_size + minfs::kMinfsBlockSize - 1) / minfs::kMinfsBlockSize;
             ~~~~~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
5 warnings generated.

BLD-361 #comment [gn][minfs] Fix a few minor warnings in new gn build
ZX-3415 #comment [gn][minfs] Fix a few minor warnings in new gn build

Test: CQ
Change-Id: I7e620abc62f9b9328a4066c465f33102ff331f62
parent e1e8af40
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment