From cc0a7860043523eb1193f0cdd5c5da7449f4f92a Mon Sep 17 00:00:00 2001 From: Anshul Maheshwari Date: Fri, 11 Jul 2014 22:13:33 +0530 Subject: [PATCH] compile on windows --- src/608.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/608.c b/src/608.c index d1dbdb26..85bfeb9c 100644 --- a/src/608.c +++ b/src/608.c @@ -514,7 +514,7 @@ int write_cc_buffer(struct s_context_cc608 *context) { sub->data = (struct eia608_screen *) realloc(sub->data,sub->size + sizeof(*data)); - memcpy(sub->data + sub->size, data, sizeof(*data)); + memcpy((struct eia608_screen *)sub->data + (sub->size/sizeof(*data)), data, sizeof(*data)); sub->size += sizeof(*data); wrote_something = 1; if(start_time < end_time) @@ -523,7 +523,7 @@ int write_cc_buffer(struct s_context_cc608 *context) int nb_data = sub->size/sizeof(*data); for(i = 0; i < nb_data; i++) { - data = sub->data + (i * sizeof(*data) ); + data = (struct eia608_screen *)sub->data + i; data->start_time = start_time + ( ( (end_time - start_time)/nb_data ) * i ); data->end_time = start_time + ( ( (end_time - start_time)/nb_data ) * (i + 1) ); } @@ -573,7 +573,7 @@ int write_cc_buffer(struct s_context_cc608 *context) if (ccx_options.gui_mode_reports) write_cc_buffer_to_gui(data, context); - data = sub->data + sizeof(struct eia608_screen); + data = (struct eia608_screen*)sub->data + 1; } return wrote_something; }