Page MenuHomeFreeBSD

Fix build on aarch64

Authored by adridg on Jan 21 2018, 5:24 PM.



The later chunks (using i2b) are compile fixes on aarch64 (presumably with
clang6 as well). Typical error message reads

readConfig.cpp:407:54: error: non-constant-expression cannot be narrowed 
from type 'int' to 'unsigned char' in initializer list [-Wc++11-narrowing]
    unsigned char color[3] = { r & 0xff, g & 0xff, b & 0xff };
readConfig.cpp:407:54: note: insert an explicit cast to silence this issue
    unsigned char color[3] = { r & 0xff, g & 0xff, b & 0xff };
                               static_cast<unsigned char>( )

Since it happens in a half-dozen places, introduce a trivial helper function.

Diff Detail

rP FreeBSD ports repository
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

I would bump the PORTREVISION too -- otherwise it looks fine.

This revision is now accepted and ready to land.Jan 21 2018, 7:40 PM
This revision was automatically updated to reflect the committed changes.

Thanks for fixing that! You could have added me (maintainer) to reviewers though.
Also, what's the reason to bump PORTREVISION?

@novel You're right, I should have added you to the review. I don't often do fix-it-so-it-builds changes to other people's ports, I got caught up in the whole clang6-fixing party. As for the PORTREVISION bump, well .. PHB says "any change that may change the contents of a package", and us KDE folks interpret that fairly broadly; it's possible this code results in different output executable.