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

compact_lang_det.h: loadDataFromRawAddress should use types from stdint.h instead of "int" #12

Closed
ghost opened this issue Jul 27, 2015 · 3 comments

Comments

@ghost
Copy link

ghost commented Jul 27, 2015

Originally reported on Google Code with ID 12

The existing signature of loadDataFromRawAddress:
void loadDataFromRawAddress(const void* rawAddress, const int length);

The use of "int" here is dangerous because we don't know what the length will be on
any platform. This is my fault, since I'm the one who introduced this API. Before much
more time elapses, we should use a type from stdint.h instead. In this case I think
uint32_t would make the most sense, as we need more than 16 bits for sure but more
than 32 would be truly insane.

It's a simple patch; any objections?

Reported by andrewhayden@chromium.org on 2014-03-26 11:56:54

@ghost ghost self-assigned this Jul 27, 2015
@ghost
Copy link
Author

ghost commented Jul 27, 2015

Here's the patch.

Reported by andrewhayden@chromium.org on 2014-04-03 08:38:42


- _Attachment: [cld2_use_uint32.patch](https://storage.googleapis.com/google-code-attachments/cld2/issue-12/comment-1/cld2_use_uint32.patch)_

@ghost
Copy link
Author

ghost commented Jul 27, 2015

Fixed in r160. All unit tests, both dynamic and non, pass without problems.

Reported by andrewhayden@chromium.org on 2014-04-03 09:59:14

@ghost
Copy link
Author

ghost commented Jul 27, 2015

Reported by andrewhayden@google.com on 2014-04-03 09:59:28

  • Status changed: Fixed

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

No branches or pull requests

1 participant