Skip to content

Conversation

@clhin
Copy link
Contributor

@clhin clhin commented Nov 16, 2025

This eliminates roughly 1500 lines of sign compare warnings

*/
static inline ScreenPtr dixGetScreenPtr(unsigned int idx) {
if (idx < screenInfo.numScreens)
if (idx < (unsigned int)screenInfo.numScreens)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder what’s the best way of fixing that. Alternatively we could make the index signed. Or make numScreens unsigned if that doesn’t break the ABI.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that making the index signed is better, since it gives the compiler more room for optimization.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I've been planning to make this unsigned some day - but we yet have to make sure this wouldn't cause any ABI break (because it's part of the ABI).

@clhin
Copy link
Contributor Author

clhin commented Nov 18, 2025

I think it makes more sense to make numScreens unsigned, but I went with the least potentially disruptive fix for the ABI's sake

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants