~ubuntu-branches/ubuntu/precise/p7zip/precise-updates

« back to all changes in this revision

Viewing changes to CPP/Common/Buffer.h

  • Committer: Bazaar Package Importer
  • Author(s): Mohammed Adnène Trojette
  • Date: 2009-02-14 20:12:27 UTC
  • mfrom: (1.1.11 upstream) (2.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20090214201227-go63qxm9ozfdma60
Tags: 4.65~dfsg.1-1
* New upstream release.
* Remove wx2.8 Build-Depends added by mistakes (7zG is not yet
  intended to be built).
* Use dh_clean without -k.

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
#include "Defs.h"
7
7
 
8
8
template <class T> class CBuffer
9
 
{    
 
9
{
10
10
protected:
11
11
  size_t _capacity;
12
12
  T *_items;
32
32
    if (newCapacity > 0)
33
33
    {
34
34
      newBuffer = new T[newCapacity];
35
 
      if(_capacity > 0)
 
35
      if (_capacity > 0)
36
36
        memmove(newBuffer, _items, MyMin(_capacity, newCapacity) * sizeof(T));
37
37
    }
38
38
    else
44
44
  CBuffer& operator=(const CBuffer &buffer)
45
45
  {
46
46
    Free();
47
 
    if(buffer._capacity > 0)
 
47
    if (buffer._capacity > 0)
48
48
    {
49
49
      SetCapacity(buffer._capacity);
50
50
      memmove(_items, buffer._items, buffer._capacity * sizeof(T));