Page MenuHomeFreeBSD

tests/fusefs: fix sign-compare warning on armv7
ClosedPublic

Authored by siva on Fri, Mar 13, 1:46 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Apr 5, 7:00 PM
Unknown Object (File)
Sun, Apr 5, 1:18 PM
Unknown Object (File)
Wed, Mar 25, 7:23 AM
Unknown Object (File)
Wed, Mar 25, 6:45 AM
Unknown Object (File)
Wed, Mar 25, 6:28 AM
Unknown Object (File)
Wed, Mar 25, 6:05 AM
Unknown Object (File)
Sun, Mar 22, 7:54 AM
Unknown Object (File)
Sun, Mar 22, 7:43 AM
Subscribers

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

siva requested review of this revision.Fri, Mar 13, 1:46 PM

Fixed weird whitespace in v2

This seems fine to me (and the generally correct way to handle size_t and ssize_t comparisons) but I'd like to see what @asomers thinks.

I note that bufsize and size2 cannot be negative, and fuse_read_in::size is uint32_t so maybe there's an opportunity to change (some) types and avoid (some) casts?

The real tension is between in.body.read.size being unsigned and read() returning signed. We could change size1 and size2 to unsigned numbers, but then we'd have to cast them when checking the output of read, as is done on line 1521. I don't have a strong preference for which, but I think you can remove the "size1 >= 0" check. We can't change the type of fuse_read_in::size, because that's part of the FUSE API.

How about this? I think keeping the static_cast instead is more consistent with the rest of this source file.

Yes, I like this version better.

This revision is now accepted and ready to land.Fri, Mar 13, 9:35 PM
This revision was automatically updated to reflect the committed changes.