X-Git-Url: http://git.code-monkey.de/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fdata%2Fsegment.cpp;h=9afc8ea2d5b49a9f65ea31fb76f10c97069ac002;hp=bc08fd07917564d86e13f35f3d37ad20dcae64e9;hb=efdec55aec1a137460fa362a381ed1904182bfed;hpb=e7216ae0a66fe1563514cbd3f67f2e240d010315 diff --git a/pv/data/segment.cpp b/pv/data/segment.cpp index bc08fd0..9afc8ea 100644 --- a/pv/data/segment.cpp +++ b/pv/data/segment.cpp @@ -14,8 +14,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * along with this program; if not, see . */ #include "segment.hpp" @@ -52,7 +51,7 @@ uint64_t Segment::get_sample_count() const return sample_count_; } -double Segment::start_time() const +const pv::util::Timestamp& Segment::start_time() const { return start_time_; } @@ -98,9 +97,8 @@ void Segment::append_data(void *data, uint64_t samples) // Ensure there's enough capacity to copy. const uint64_t free_space = capacity_ - sample_count_; - if (free_space < samples) { + if (free_space < samples) set_capacity(sample_count_ + samples); - } memcpy((uint8_t*)data_.data() + sample_count_ * unit_size_, data, samples * unit_size_);