As said on #794 there was nothing wrong in those `sizeof` expressions, if anything they weren't as readable as possible; and the real issue is a bug in cppcheck.
This said, the changes here look fine, and will indeed work around that cppcheck issue, and IMO makes that `pointer_size` logic a little clearer. So, LGTM.