Commit 2b63d32
Fix shorten-64-to-32 narrowing when reading requestedAttributes
Summary:
requestedAttributes is a thrift unsigned64, but EntryAttributeFlags::raw takes std::underlying_type_t<FileAttributes> (int), so passing it directly performs an implicit 64-to-32 narrowing that clang-tidy flags as clang-diagnostic-shorten-64-to-32. Make the narrowing explicit with a static_cast.
This cleans up every call site in EdenServiceHandler.cpp, covering both the futures paths (getAttributesFromFiles, readdir, semifuture_getAttributesFromFilesV2Impl) and the new coroutine paths (co_getAttributesFromFilesV2Impl). No behavior change: FileAttributes only uses the low bits, so no data was ever lost.
Reviewed By: zzl0
Differential Revision: D112026415
fbshipit-source-id: c128fb1e147f16bd153a9261a3fbd96ecaba4db11 parent f2dd20e commit 2b63d32
1 file changed
Lines changed: 12 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4341 | 4341 | | |
4342 | 4342 | | |
4343 | 4343 | | |
4344 | | - | |
4345 | | - | |
| 4344 | + | |
| 4345 | + | |
| 4346 | + | |
4346 | 4347 | | |
4347 | 4348 | | |
4348 | 4349 | | |
| |||
4403 | 4404 | | |
4404 | 4405 | | |
4405 | 4406 | | |
4406 | | - | |
4407 | | - | |
| 4407 | + | |
| 4408 | + | |
| 4409 | + | |
4408 | 4410 | | |
4409 | 4411 | | |
4410 | 4412 | | |
| |||
4751 | 4753 | | |
4752 | 4754 | | |
4753 | 4755 | | |
4754 | | - | |
| 4756 | + | |
| 4757 | + | |
| 4758 | + | |
4755 | 4759 | | |
4756 | 4760 | | |
4757 | 4761 | | |
| |||
4788 | 4792 | | |
4789 | 4793 | | |
4790 | 4794 | | |
4791 | | - | |
| 4795 | + | |
| 4796 | + | |
| 4797 | + | |
4792 | 4798 | | |
4793 | 4799 | | |
4794 | 4800 | | |
| |||
0 commit comments