diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-12-03 20:05:21 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-12-03 20:05:21 +0300 |
commit | 263830f0004481cd4921f03f4242d7c80794b08d (patch) | |
tree | 30b512a06df2e619681ecacf97faee69e46913f8 /source/blender/blenkernel/intern/report.c | |
parent | 7c86a1a95cbc643fdbbf8c28f0422face8a15a19 (diff) |
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.
Diffstat (limited to 'source/blender/blenkernel/intern/report.c')
-rw-r--r-- | source/blender/blenkernel/intern/report.c | 14 |
1 files changed, 8 insertions, 6 deletions
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); |