Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.

LUCY-295 Adapt file position code for -Wconversion#46

Merged
asfgit merged 3 commits intoapache:masterfrom
rectang:LUCY-295-file-pos
May 2, 2016
Merged

LUCY-295 Adapt file position code for -Wconversion#46
asfgit merged 3 commits intoapache:masterfrom
rectang:LUCY-295-file-pos

Conversation

@rectang
Copy link
Contributor

@rectang rectang commented Apr 28, 2016

Perform casts or variable type conversions in code manipulating file positions in order to adapt for -Wconversion.

rectang added 3 commits April 28, 2016 15:38
Use int64_t rather than size_t to make overflow checking easier.
Perform casts or change variable types to make code manipulating file
positions compliant with -Wconversion.
InStream_Seek(ix_in, (int64_t)doc_id * 8);
start = InStream_Read_U64(ix_in);
InStream_Seek(ix_in, doc_id * 8);
start = InStream_Read_I64(ix_in);
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't the cast needed to avoid overflow in the multiplication?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch -- I'll add a commit to this pull request reverting that line.

@asfgit asfgit merged commit cc9a816 into apache:master May 2, 2016
asfgit pushed a commit that referenced this pull request May 2, 2016
Perform casts or variable type conversions in code manipulating file
positions in order to adapt for -Wconversion.

This closes #46.
@rectang rectang deleted the LUCY-295-file-pos branch May 2, 2016 18:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants