Diff for /qemu/qstring.c between versions 1.1.1.1 and 1.1.1.3

version 1.1.1.1, 2018/04/24 17:33:43 version 1.1.1.3, 2018/04/24 19:16:35
Line 1 Line 1
 /*  /*
  * QString data type.   * QString Module
  *   *
  * Copyright (C) 2009 Red Hat Inc.   * Copyright (C) 2009 Red Hat Inc.
  *   *
  * Authors:   * Authors:
  *  Luiz Capitulino <lcapitulino@redhat.com>   *  Luiz Capitulino <lcapitulino@redhat.com>
  *   *
  * This work is licensed under the terms of the GNU GPL, version 2.  See   * This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
  * the COPYING file in the top-level directory.   * See the COPYING.LIB file in the top-level directory.
  */   */
   
 #include "qobject.h"  #include "qobject.h"
 #include "qstring.h"  #include "qstring.h"
 #include "qemu-common.h"  #include "qemu-common.h"
Line 39  QString *qstring_from_substr(const char  Line 40  QString *qstring_from_substr(const char 
 {  {
     QString *qstring;      QString *qstring;
   
     qstring = qemu_malloc(sizeof(*qstring));      qstring = g_malloc(sizeof(*qstring));
   
     qstring->length = end - start + 1;      qstring->length = end - start + 1;
     qstring->capacity = qstring->length;      qstring->capacity = qstring->length;
   
     qstring->string = qemu_malloc(qstring->capacity + 1);      qstring->string = g_malloc(qstring->capacity + 1);
     memcpy(qstring->string, str + start, qstring->length);      memcpy(qstring->string, str + start, qstring->length);
     qstring->string[qstring->length] = 0;      qstring->string[qstring->length] = 0;
   
Line 69  static void capacity_increase(QString *q Line 70  static void capacity_increase(QString *q
         qstring->capacity += len;          qstring->capacity += len;
         qstring->capacity *= 2; /* use exponential growth */          qstring->capacity *= 2; /* use exponential growth */
   
         qstring->string = qemu_realloc(qstring->string, qstring->capacity + 1);          qstring->string = g_realloc(qstring->string, qstring->capacity + 1);
     }      }
 }  }
   
Line 135  static void qstring_destroy_obj(QObject  Line 136  static void qstring_destroy_obj(QObject 
   
     assert(obj != NULL);      assert(obj != NULL);
     qs = qobject_to_qstring(obj);      qs = qobject_to_qstring(obj);
     qemu_free(qs->string);      g_free(qs->string);
     qemu_free(qs);      g_free(qs);
 }  }

Removed from v.1.1.1.1  
changed lines
  Added in v.1.1.1.3


unix.superglobalmegacorp.com