Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ptrdiff_t for pointer-difference types #232

Closed
wants to merge 1 commit into from

Conversation

ec1oud
Copy link
Contributor

@ec1oud ec1oud commented Jan 26, 2024

This fixes warnings on msvc in several places:

md4c.c(3087): warning C4244: 'function': conversion from '__int64' to 'int', possible loss of data

This fixes warnings on msvc in several places:

md4c.c(3087): warning C4244: 'function': conversion from '__int64' to 'int', possible loss of data
@ec1oud
Copy link
Contributor Author

ec1oud commented Jan 26, 2024

Copy link

codecov bot commented Jan 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (aeddaf5) 91.80% compared to head (8d807b0) 91.81%.
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #232   +/-   ##
=======================================
  Coverage   91.80%   91.81%           
=======================================
  Files           5        5           
  Lines        3406     3408    +2     
=======================================
+ Hits         3127     3129    +2     
  Misses        279      279           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

mity pushed a commit that referenced this pull request Jan 26, 2024
* Use consistently type MD_SIZE for line indeces.
* Remove pointer arithmetics if lines and replace it with line index
  arithmetics.

This resolves some warnigns in MSVC builds.
See PR #232.
mity pushed a commit that referenced this pull request Jan 26, 2024
* Use consistently type MD_SIZE for line indeces.
* Remove pointer arithmetics if lines and replace it with line index
  arithmetics.

This resolves some warnigns in MSVC builds.
See PR #232.

Co-authored-by: Shawn Rutledge <[email protected]>
mity pushed a commit that referenced this pull request Jan 26, 2024
* Use consistently type MD_SIZE for line indeces.
* Remove pointer arithmetic if lines and replace it with line index
  arithmetic.

This resolves some warnings in MSVC builds.
See PR #232.

Co-authored-by: Shawn Rutledge <[email protected]>
mity added a commit that referenced this pull request Jan 26, 2024
* Use consistently type MD_SIZE for line indeces.
* Remove pointer arithmetic if lines and replace it with line index
  arithmetic.

This resolves some warnings in MSVC builds.
See PR #232.

Co-authored-by: Martin Mitas <[email protected]>
Co-authored-by: Shawn Rutledge <[email protected]>
@mity
Copy link
Owner

mity commented Jan 26, 2024

Thanks for it.

However I have to admit I dislike the patch because it now uses ptrdiff_t on numerous places which have nothing to do with pointer difference and I find the result misleading and not really improving quality of the code.

I've created an alternative patch based on this, if youre ok with it. See PR #233.

mity added a commit that referenced this pull request Jan 26, 2024
* Use consistently type MD_SIZE for line indeces.
* Remove pointer arithmetic if lines and replace it with line index
  arithmetic.

This resolves some warnings in MSVC builds.
See PR #232.

Co-authored-by: Martin Mitas <[email protected]>
Co-authored-by: Shawn Rutledge <[email protected]>
mity added a commit that referenced this pull request Jan 26, 2024
* Use consistently type MD_SIZE for line indeces.
* Remove pointer arithmetic if lines and replace it with line index
  arithmetic.

This resolves some warnings in MSVC builds.
See PR #232.

Co-authored-by: Martin Mitas <[email protected]>
Co-authored-by: Shawn Rutledge <[email protected]>
mity added a commit that referenced this pull request Jan 26, 2024
* Use consistently type MD_SIZE for line indeces.
* Remove pointer arithmetic if lines and replace it with line index
  arithmetic.

This resolves some warnings in MSVC builds.
See PR #232.

Co-authored-by: Martin Mitas <[email protected]>
Co-authored-by: Shawn Rutledge <[email protected]>
@mity
Copy link
Owner

mity commented Jan 26, 2024

Closing, as the #233 was merged instead.

@mity mity closed this Jan 26, 2024
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