From 8d5ab875f6370a9433824c6d2803f18fb57fb3de Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Wed, 3 Jun 2015 17:25:35 +0000 Subject: [PATCH] fallback_malloc: silence conversion warning (NFC) This silences some conversion warnings from GCC 4.9.2. Simply casting the RHS doesn't seem to be sufficient to silence the warning. Convert the operation equal operator usage to calculation and assignment. llvm-svn: 238945 --- libcxxabi/src/fallback_malloc.ipp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libcxxabi/src/fallback_malloc.ipp b/libcxxabi/src/fallback_malloc.ipp index 56da36c17ffa..71b65bed888d 100644 --- a/libcxxabi/src/fallback_malloc.ipp +++ b/libcxxabi/src/fallback_malloc.ipp @@ -97,8 +97,8 @@ void *fallback_malloc(size_t len) { if (p->len > nelems) { // chunk is larger, shorten, and return the tail heap_node *q; - - p->len -= nelems; + + p->len = static_cast(p->len - nelems); q = p + p->len; q->next_node = 0; q->len = static_cast(nelems); @@ -143,14 +143,14 @@ void fallback_free (void *ptr) { #ifdef DEBUG_FALLBACK_MALLOC std::cout << " Appending onto chunk at " << offset_from_node ( p ) << std::endl; #endif - p->len += cp->len; // make the free heap_node larger + p->len = static_cast(p->len + cp->len); // make the free heap_node larger return; } else if ( after ( cp ) == p ) { // there's a free heap_node right after #ifdef DEBUG_FALLBACK_MALLOC std::cout << " Appending free chunk at " << offset_from_node ( p ) << std::endl; #endif - cp->len += p->len; + cp->len = static_cast(cp->len + p->len); if ( prev == 0 ) { freelist = cp; cp->next_node = p->next_node;