niobio / cld2

Automatically exported from code.google.com/p/cld2
0 stars 0 forks source link

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

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
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?

Original issue reported on code.google.com by andrewha...@chromium.org on 26 Mar 2014 at 11:56

GoogleCodeExporter commented 9 years ago
Here's the patch.

Original comment by andrewha...@chromium.org on 3 Apr 2014 at 8:38

Attachments:

GoogleCodeExporter commented 9 years ago
Fixed in r160. All unit tests, both dynamic and non, pass without problems.

Original comment by andrewha...@chromium.org on 3 Apr 2014 at 9:59

GoogleCodeExporter commented 9 years ago

Original comment by andrewha...@google.com on 3 Apr 2014 at 9:59