gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] gnash/libbase Buffer.h


From: Sandro Santilli
Subject: [Gnash-commit] gnash/libbase Buffer.h
Date: Wed, 11 Jun 2008 14:49:34 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  08/06/11 14:49:34

Modified files:
        libbase        : Buffer.h 

Log message:
        change constructor parameter semantic from size to capacity

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/Buffer.h?cvsroot=gnash&r1=1.3&r2=1.4

Patches:
Index: Buffer.h
===================================================================
RCS file: /sources/gnash/gnash/libbase/Buffer.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- Buffer.h    11 Jun 2008 14:21:59 -0000      1.3
+++ Buffer.h    11 Jun 2008 14:49:34 -0000      1.4
@@ -42,14 +42,20 @@
 
 public:
 
-       /// Construct a Buffer with an optional initial size
-       Buffer(size_t size=0)
+       /// Construct a Buffer with an optional initial capacity
+       //
+       /// @param capacity
+       ///     The initial buffer capacity. This is the amount of
+       ///     bytes you can append to the buffer before a new reallocation
+       ///     will occur.
+       ///
+       Buffer(size_t capacity=0)
                :
                _data(0),
-               _size(size),
-               _capacity(size)
+               _size(0),
+               _capacity(capacity)
        {
-               if ( _size ) _data = new boost::uint8_t[size];
+               if ( _capacity ) _data = new boost::uint8_t[_capacity];
        }
 
        ~Buffer()




reply via email to

[Prev in Thread] Current Thread [Next in Thread]