Skip to content

Commit a1fab9d

Browse files
authored
Merge pull request #10699 from gpsimenos/iotcore556-fix_buffer_param_type
MbedCRC: make buffers const void *
2 parents dda79d4 + f82b7d8 commit a1fab9d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/MbedCRC.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ class MbedCRC {
146146
* @param crc CRC is the output value
147147
* @return 0 on success, negative error code on failure
148148
*/
149-
int32_t compute(void *buffer, crc_data_size_t size, uint32_t *crc)
149+
int32_t compute(const void *buffer, crc_data_size_t size, uint32_t *crc)
150150
{
151151
MBED_ASSERT(crc != NULL);
152152
int32_t status = 0;
@@ -193,14 +193,14 @@ class MbedCRC {
193193
* @note: CRC as output in compute_partial is not final CRC value, call `compute_partial_stop`
194194
* to get final correct CRC value.
195195
*/
196-
int32_t compute_partial(void *buffer, crc_data_size_t size, uint32_t *crc)
196+
int32_t compute_partial(const void *buffer, crc_data_size_t size, uint32_t *crc)
197197
{
198198
int32_t status = 0;
199199

200200
switch (_mode) {
201201
#if DEVICE_CRC
202202
case HARDWARE:
203-
hal_crc_compute_partial((uint8_t *)buffer, size);
203+
hal_crc_compute_partial(static_cast<const uint8_t *>(buffer), size);
204204
*crc = 0;
205205
break;
206206
#endif

0 commit comments

Comments
 (0)