util/{Const,Writable}Buffer: use std::size_t

This commit is contained in:
Max Kellermann 2020-01-03 15:38:02 +01:00
parent 4b0e288f00
commit e654c6e005
5 changed files with 11 additions and 10 deletions

View File

@ -33,6 +33,7 @@
#include "StringPointer.hxx" #include "StringPointer.hxx"
#include <algorithm> #include <algorithm>
#include <cstddef>
/** /**
* A string pointer whose memory is managed by this class. * A string pointer whose memory is managed by this class.
@ -47,7 +48,7 @@ public:
typedef typename StringPointer<T>::const_reference_type const_reference_type; typedef typename StringPointer<T>::const_reference_type const_reference_type;
typedef typename StringPointer<T>::pointer_type pointer_type; typedef typename StringPointer<T>::pointer_type pointer_type;
typedef typename StringPointer<T>::const_pointer_type const_pointer_type; typedef typename StringPointer<T>::const_pointer_type const_pointer_type;
typedef size_t size_type; typedef std::size_t size_type;
static constexpr value_type SENTINEL = '\0'; static constexpr value_type SENTINEL = '\0';

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2013-2017 Max Kellermann <max.kellermann@gmail.com> * Copyright 2013-2020 Max Kellermann <max.kellermann@gmail.com>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
@ -43,7 +43,7 @@ struct ConstBuffer;
template<> template<>
struct ConstBuffer<void> { struct ConstBuffer<void> {
typedef size_t size_type; typedef std::size_t size_type;
typedef void value_type; typedef void value_type;
typedef const void *pointer_type; typedef const void *pointer_type;
typedef pointer_type const_pointer_type; typedef pointer_type const_pointer_type;
@ -91,7 +91,7 @@ struct ConstBuffer<void> {
*/ */
template<typename T> template<typename T>
struct ConstBuffer { struct ConstBuffer {
typedef size_t size_type; typedef std::size_t size_type;
typedef T value_type; typedef T value_type;
typedef const T &reference_type; typedef const T &reference_type;
typedef reference_type const_reference_type; typedef reference_type const_reference_type;

View File

@ -51,7 +51,7 @@
template<typename T> template<typename T>
class ForeignFifoBuffer { class ForeignFifoBuffer {
public: public:
using size_type = size_t; using size_type = std::size_t;
using Range = WritableBuffer<T>; using Range = WritableBuffer<T>;
using pointer_type = typename Range::pointer_type; using pointer_type = typename Range::pointer_type;
using const_pointer_type = typename Range::const_pointer_type; using const_pointer_type = typename Range::const_pointer_type;

View File

@ -34,9 +34,9 @@
#include <utility> #include <utility>
#include <algorithm> #include <algorithm>
#include <cstddef>
#include <assert.h> #include <assert.h>
#include <stddef.h>
/** /**
* A first-in-first-out buffer: you can append data at the end, and * A first-in-first-out buffer: you can append data at the end, and
@ -46,7 +46,7 @@
template<class T, size_t size> template<class T, size_t size>
class StaticFifoBuffer { class StaticFifoBuffer {
public: public:
using size_type = size_t; using size_type = std::size_t;
using Range = WritableBuffer<T>; using Range = WritableBuffer<T>;
protected: protected:

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2013-2018 Max Kellermann <max.kellermann@gmail.com> * Copyright 2013-2020 Max Kellermann <max.kellermann@gmail.com>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
@ -44,7 +44,7 @@ struct WritableBuffer;
template<> template<>
struct WritableBuffer<void> { struct WritableBuffer<void> {
typedef size_t size_type; typedef std::size_t size_type;
typedef void value_type; typedef void value_type;
typedef void *pointer_type; typedef void *pointer_type;
typedef const void *const_pointer_type; typedef const void *const_pointer_type;
@ -90,7 +90,7 @@ struct WritableBuffer<void> {
*/ */
template<typename T> template<typename T>
struct WritableBuffer { struct WritableBuffer {
typedef size_t size_type; typedef std::size_t size_type;
typedef T value_type; typedef T value_type;
typedef T &reference_type; typedef T &reference_type;
typedef const T &const_reference_type; typedef const T &const_reference_type;