Add explicit casts for the msvc C++ compiler.
This commit is contained in:
parent
8b4d216131
commit
14b28cb993
@ -341,7 +341,7 @@ hw_frog_device_foreach (dc_device_t *abstract, dc_dive_callback_t callback, void
|
||||
device_event_emit (abstract, DC_EVENT_DEVINFO, &devinfo);
|
||||
|
||||
// Allocate memory.
|
||||
unsigned char *header = malloc (RB_LOGBOOK_SIZE * RB_LOGBOOK_COUNT);
|
||||
unsigned char *header = (unsigned char *) malloc (RB_LOGBOOK_SIZE * RB_LOGBOOK_COUNT);
|
||||
if (header == NULL) {
|
||||
ERROR (abstract->context, "Failed to allocate memory.");
|
||||
return DC_STATUS_NOMEMORY;
|
||||
@ -425,7 +425,7 @@ hw_frog_device_foreach (dc_device_t *abstract, dc_dive_callback_t callback, void
|
||||
}
|
||||
|
||||
// Allocate enough memory for the largest dive.
|
||||
unsigned char *profile = malloc (maxsize);
|
||||
unsigned char *profile = (unsigned char *) malloc (maxsize);
|
||||
if (profile == NULL) {
|
||||
ERROR (abstract->context, "Failed to allocate memory.");
|
||||
free (header);
|
||||
|
||||
@ -286,7 +286,7 @@ mares_darwin_extract_dives (dc_device_t *abstract, const unsigned char data[], u
|
||||
}
|
||||
|
||||
// Allocate memory for the largest possible dive.
|
||||
unsigned char *buffer = malloc (layout->rb_logbook_size + layout->rb_profile_end - layout->rb_profile_begin);
|
||||
unsigned char *buffer = (unsigned char *) malloc (layout->rb_logbook_size + layout->rb_profile_end - layout->rb_profile_begin);
|
||||
if (buffer == NULL) {
|
||||
ERROR (abstract->context, "Failed to allocate memory.");
|
||||
return DC_STATUS_NOMEMORY;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user