From 263830f0004481cd4921f03f4242d7c80794b08d Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 3 Dec 2010 17:05:21 +0000 Subject: Enabled GCC -Wwrite-strings warning for CMake and replaced many 'char's for 'const char's,. Only one functional change where Transform orientations passed "" to BIF_createTransformOrientation() which could then have the value written into. --- source/blender/blenkernel/intern/report.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'source/blender/blenkernel/intern/report.c') diff --git a/source/blender/blenkernel/intern/report.c b/source/blender/blenkernel/intern/report.c index f69547fd1da..5df912c871d 100644 --- a/source/blender/blenkernel/intern/report.c +++ b/source/blender/blenkernel/intern/report.c @@ -44,7 +44,7 @@ #endif #endif -static char *report_type_str(int type) +static const char *report_type_str(int type) { switch(type) { case RPT_DEBUG: return "Debug"; @@ -82,7 +82,7 @@ void BKE_reports_clear(ReportList *reports) while (report) { report_next= report->next; - MEM_freeN(report->message); + MEM_freeN((void *)report->message); MEM_freeN(report); report= report_next; } @@ -105,13 +105,15 @@ void BKE_report(ReportList *reports, ReportType type, const char *message) } if(reports && (reports->flag & RPT_STORE) && (type >= reports->storelevel)) { + char *message_alloc; report= MEM_callocN(sizeof(Report), "Report"); report->type= type; report->typestr= report_type_str(type); len= strlen(message); - report->message= MEM_callocN(sizeof(char)*(len+1), "ReportMessage"); - memcpy(report->message, message, sizeof(char)*(len+1)); + message_alloc= MEM_callocN(sizeof(char)*(len+1), "ReportMessage"); + memcpy(message_alloc, message, sizeof(char)*(len+1)); + report->message= message_alloc; report->len= len; BLI_addtail(&reports->list, report); } @@ -163,7 +165,7 @@ void BKE_reports_prepend(ReportList *reports, const char *prepend) BLI_dynstr_append(ds, prepend); BLI_dynstr_append(ds, report->message); - MEM_freeN(report->message); + MEM_freeN((void *)report->message); report->message= BLI_dynstr_get_cstring(ds); report->len= BLI_dynstr_get_len(ds); @@ -188,7 +190,7 @@ void BKE_reports_prependf(ReportList *reports, const char *prepend, ...) va_end(args); BLI_dynstr_append(ds, report->message); - MEM_freeN(report->message); + MEM_freeN((void *)report->message); report->message= BLI_dynstr_get_cstring(ds); report->len= BLI_dynstr_get_len(ds); -- cgit v1.2.3