From 14b28cb993f9d027cac1657f754c282e99c67ccc Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Sun, 20 May 2012 21:16:51 +0200 Subject: [PATCH] Add explicit casts for the msvc C++ compiler. --- src/hw_frog.c | 4 ++-- src/mares_darwin.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hw_frog.c b/src/hw_frog.c index a7992ac..4d19ab2 100644 --- a/src/hw_frog.c +++ b/src/hw_frog.c @@ -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); diff --git a/src/mares_darwin.c b/src/mares_darwin.c index 8c32d99..c1af997 100644 --- a/src/mares_darwin.c +++ b/src/mares_darwin.c @@ -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;