Skip to content

Conversation

@Maw-Fox
Copy link
Contributor

@Maw-Fox Maw-Fox commented Mar 24, 2016

Maybe? I'm sure it'd help a lot of people!

LOG(WARNING) << "String size_t const exceeds maximum signed integer size. Overflow immenent."; // For the rare, rare case that this may occur.
}

intLength = static_cast<int>(length);
Copy link
Contributor

Choose a reason for hiding this comment

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

why do you need to cast to int? For loops work fine with size_t

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Size_t conversions to int produce compiler warnings.

"warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data"

Copy link
Contributor

Choose a reason for hiding this comment

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

http://sprunge.us/iaNL?diff
This compiles 100% fine, no compile warnings. You'll get a warning if you define i as an int instead of size_t, but it's perfectly valid to use size_t.

@boopcat
Copy link
Contributor

boopcat commented Mar 27, 2016

getLower can (and probably should) be implemented using setLower (DRY!), and you don't need to be casting from int.
also, do you need any help with rebasing?

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.

2 participants