replace stddef.h with cstddef

The former is deprecated with C++14. The standard says both are the same:

The contents and meaning of the header<cstddef>are the same as the C
standard library header<stddef.h>,except that it does not declare the type
wchar_t, that it also declares the type byte and its associated
operations (21.2.5), and as noted in 21.2.3 and 21.2.4.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev 2020-03-12 16:46:28 -07:00
parent c846ee0d1b
commit 2db8bcc353
No known key found for this signature in database
GPG Key ID: 36D31CFA845F0E3B
50 changed files with 60 additions and 70 deletions

View File

@ -24,10 +24,9 @@
#include "tag/Tag.hxx" #include "tag/Tag.hxx"
#include "config.h" #include "config.h"
#include <cstddef>
#include <memory> #include <memory>
#include <stddef.h>
class IcyMetaDataParser { class IcyMetaDataParser {
size_t data_size = 0, data_rest; size_t data_size = 0, data_rest;

View File

@ -29,10 +29,10 @@
#include "pcm/AudioFormat.hxx" #include "pcm/AudioFormat.hxx"
#endif #endif
#include <cstddef>
#include <memory> #include <memory>
#include <stdint.h> #include <stdint.h>
#include <stddef.h>
static constexpr size_t CHUNK_SIZE = 4096; static constexpr size_t CHUNK_SIZE = 4096;

View File

@ -31,12 +31,11 @@
#include <boost/intrusive/link_mode.hpp> #include <boost/intrusive/link_mode.hpp>
#include <boost/intrusive/list_hook.hpp> #include <boost/intrusive/list_hook.hpp>
#include <set> #include <cstddef>
#include <string>
#include <list> #include <list>
#include <memory> #include <memory>
#include <set>
#include <stddef.h> #include <string>
class SocketAddress; class SocketAddress;
class UniqueSocketDescriptor; class UniqueSocketDescriptor;

View File

@ -24,8 +24,7 @@
#include "util/Compiler.h" #include "util/Compiler.h"
#include <cstdarg> #include <cstdarg>
#include <cstddef>
#include <stddef.h>
template<typename T> struct ConstBuffer; template<typename T> struct ConstBuffer;
class Client; class Client;

View File

@ -20,7 +20,7 @@
#ifndef MPD_CONFIG_PARSER_HXX #ifndef MPD_CONFIG_PARSER_HXX
#define MPD_CONFIG_PARSER_HXX #define MPD_CONFIG_PARSER_HXX
#include <stddef.h> #include <cstddef>
/** /**
* Throws on error. * Throws on error.

View File

@ -24,7 +24,8 @@
#include "util/DynamicFifoBuffer.hxx" #include "util/DynamicFifoBuffer.hxx"
#include "util/ConstBuffer.hxx" #include "util/ConstBuffer.hxx"
#include <stddef.h> #include <cstddef>
#include <stdint.h> #include <stdint.h>
class DecoderClient; class DecoderClient;

View File

@ -20,7 +20,7 @@
#ifndef MPD_OPUS_HEAD_HXX #ifndef MPD_OPUS_HEAD_HXX
#define MPD_OPUS_HEAD_HXX #define MPD_OPUS_HEAD_HXX
#include <stddef.h> #include <cstddef>
bool bool
ScanOpusHeader(const void *data, size_t size, unsigned &channels_r); ScanOpusHeader(const void *data, size_t size, unsigned &channels_r);

View File

@ -20,7 +20,7 @@
#ifndef MPD_OPUS_TAGS_HXX #ifndef MPD_OPUS_TAGS_HXX
#define MPD_OPUS_TAGS_HXX #define MPD_OPUS_TAGS_HXX
#include <stddef.h> #include <cstddef>
struct ReplayGainInfo; struct ReplayGainInfo;
class TagHandler; class TagHandler;

View File

@ -24,8 +24,7 @@
#include "util/Compiler.h" #include "util/Compiler.h"
#include <cassert> #include <cassert>
#include <cstddef>
#include <stddef.h>
struct AudioFormat; struct AudioFormat;
struct Tag; struct Tag;

View File

@ -22,10 +22,10 @@
#include "PollResultGeneric.hxx" #include "PollResultGeneric.hxx"
#include <cstddef>
#include <vector> #include <vector>
#include <unordered_map> #include <unordered_map>
#include <stddef.h>
#include <sys/poll.h> #include <sys/poll.h>
class PollGroupPoll class PollGroupPoll

View File

@ -20,10 +20,9 @@
#ifndef MPD_EVENT_POLLRESULT_GENERIC_HXX #ifndef MPD_EVENT_POLLRESULT_GENERIC_HXX
#define MPD_EVENT_POLLRESULT_GENERIC_HXX #define MPD_EVENT_POLLRESULT_GENERIC_HXX
#include <cstddef>
#include <vector> #include <vector>
#include <stddef.h>
class PollResultGeneric class PollResultGeneric
{ {
struct Item struct Item

View File

@ -24,10 +24,9 @@
#include "net/SocketDescriptor.hxx" #include "net/SocketDescriptor.hxx"
#include <cassert> #include <cassert>
#include <cstddef>
#include <type_traits> #include <type_traits>
#include <stddef.h>
class EventLoop; class EventLoop;
/** /**

View File

@ -21,8 +21,7 @@
#define MPD_FS_LIMITS_HXX #define MPD_FS_LIMITS_HXX
#include <climits> #include <climits>
#include <cstddef>
#include <stddef.h>
#if defined(_WIN32) #if defined(_WIN32)
static constexpr size_t MPD_PATH_MAX = 260; static constexpr size_t MPD_PATH_MAX = 260;

View File

@ -33,7 +33,7 @@
#include "util/Compiler.h" #include "util/Compiler.h"
#include "util/DynamicFifoBuffer.hxx" #include "util/DynamicFifoBuffer.hxx"
#include <stddef.h> #include <cstddef>
#ifdef _UNICODE #ifdef _UNICODE
#include <wchar.h> #include <wchar.h>

View File

@ -33,7 +33,7 @@
#include "util/Compiler.h" #include "util/Compiler.h"
#include "util/DynamicFifoBuffer.hxx" #include "util/DynamicFifoBuffer.hxx"
#include <stddef.h> #include <cstddef>
class Reader; class Reader;

View File

@ -30,7 +30,7 @@
#ifndef OUTPUT_STREAM_HXX #ifndef OUTPUT_STREAM_HXX
#define OUTPUT_STREAM_HXX #define OUTPUT_STREAM_HXX
#include <stddef.h> #include <cstddef>
class OutputStream { class OutputStream {
public: public:

View File

@ -32,7 +32,7 @@
#include "util/Compiler.h" #include "util/Compiler.h"
#include <stddef.h> #include <cstddef>
/** /**
* An interface that can read bytes from a stream until the stream * An interface that can read bytes from a stream until the stream

View File

@ -20,7 +20,7 @@
#ifndef MPD_INPUT_CACHE_CONFIG_HXX #ifndef MPD_INPUT_CACHE_CONFIG_HXX
#define MPD_INPUT_CACHE_CONFIG_HXX #define MPD_INPUT_CACHE_CONFIG_HXX
#include <stddef.h> #include <cstddef>
struct ConfigBlock; struct ConfigBlock;

View File

@ -34,10 +34,9 @@
#include <jni.h> #include <jni.h>
#include <cstddef>
#include <string> #include <string>
#include <stddef.h>
namespace Java { namespace Java {
/** /**
* Wrapper for a local "jstring" reference. * Wrapper for a local "jstring" reference.

View File

@ -30,7 +30,7 @@
#ifndef BASE64_HXX #ifndef BASE64_HXX
#define BASE64_HXX #define BASE64_HXX
#include <stddef.h> #include <cstddef>
template<typename T> struct WritableBuffer; template<typename T> struct WritableBuffer;
struct StringView; struct StringView;

View File

@ -24,7 +24,7 @@ extern "C" {
#include <libavutil/mem.h> #include <libavutil/mem.h>
} }
#include <stddef.h> #include <cstddef>
/* suppress the ffmpeg compatibility macro */ /* suppress the ffmpeg compatibility macro */
#ifdef SampleFormat #ifdef SampleFormat

View File

@ -25,11 +25,11 @@
#include "event/DeferEvent.hxx" #include "event/DeferEvent.hxx"
#include "util/Compiler.h" #include "util/Compiler.h"
#include <string> #include <cstddef>
#include <exception> #include <exception>
#include <string>
#include <stdint.h> #include <stdint.h>
#include <stddef.h>
#include <sys/stat.h> #include <sys/stat.h>
struct nfsfh; struct nfsfh;

View File

@ -22,7 +22,8 @@
#include <ogg/ogg.h> #include <ogg/ogg.h>
#include <stddef.h> #include <cstddef>
#include <stdint.h> #include <stdint.h>
class Reader; class Reader;

View File

@ -34,9 +34,9 @@
#include <pulse/version.h> #include <pulse/version.h>
#include <cassert> #include <cassert>
#include <cstddef>
#include <stdexcept> #include <stdexcept>
#include <stddef.h>
#include <stdlib.h> #include <stdlib.h>
#define MPD_PULSE_NAME "Music Player Daemon" #define MPD_PULSE_NAME "Music Player Daemon"

View File

@ -27,10 +27,9 @@
#include <boost/intrusive/link_mode.hpp> #include <boost/intrusive/link_mode.hpp>
#include <boost/intrusive/list_hook.hpp> #include <boost/intrusive/list_hook.hpp>
#include <queue> #include <cstddef>
#include <list> #include <list>
#include <queue>
#include <stddef.h>
class UniqueSocketDescriptor; class UniqueSocketDescriptor;
class HttpdOutput; class HttpdOutput;

View File

@ -22,9 +22,8 @@
#include "util/AllocatedArray.hxx" #include "util/AllocatedArray.hxx"
#include <cstddef>
#include <memory> #include <memory>
#include <stddef.h>
#include <stdint.h> #include <stdint.h>
/** /**

View File

@ -24,10 +24,9 @@
#include "pcm/ChannelDefs.hxx" #include "pcm/ChannelDefs.hxx"
#include "util/Compiler.h" #include "util/Compiler.h"
#include <cstddef>
#include <cstdint> #include <cstdint>
#include <stddef.h>
template<size_t CAPACITY> class StringBuffer; template<size_t CAPACITY> class StringBuffer;
/** /**

View File

@ -34,8 +34,8 @@ or implied, of Sebastian Gesemann.
#include "ChannelDefs.hxx" #include "ChannelDefs.hxx"
#include <array> #include <array>
#include <cstddef>
#include <stddef.h>
#include <stdint.h> #include <stdint.h>
/** /**

View File

@ -23,7 +23,7 @@
#include "SampleFormat.hxx" #include "SampleFormat.hxx"
#include "util/Compiler.h" #include "util/Compiler.h"
#include <stddef.h> #include <cstddef>
class PcmDither; class PcmDither;

View File

@ -24,8 +24,7 @@
#include <algorithm> #include <algorithm>
#include <cassert> #include <cassert>
#include <cstddef>
#include <stddef.h>
template<typename T> struct ConstBuffer; template<typename T> struct ConstBuffer;
class PcmBuffer; class PcmBuffer;

View File

@ -22,8 +22,9 @@
#include "SampleFormat.hxx" #include "SampleFormat.hxx"
#include <cstddef>
#include <stdint.h> #include <stdint.h>
#include <stddef.h>
/** /**
* This template describes the specified #SampleFormat. This is an * This template describes the specified #SampleFormat. This is an

View File

@ -27,7 +27,7 @@
#include "thread/Mutex.hxx" #include "thread/Mutex.hxx"
#include <stddef.h> #include <cstddef>
class InputStream; class InputStream;

View File

@ -27,7 +27,7 @@
#include "thread/Mutex.hxx" #include "thread/Mutex.hxx"
#include <stddef.h> #include <cstddef>
class InputStream; class InputStream;

View File

@ -38,7 +38,7 @@
#include <chrono> #include <chrono>
#include <utility> #include <utility>
#include <stddef.h> #include <cstddef>
struct tm; struct tm;
template<size_t CAPACITY> class StringBuffer; template<size_t CAPACITY> class StringBuffer;

View File

@ -22,7 +22,7 @@
#include "Compiler.h" #include "Compiler.h"
#include <stddef.h> #include <cstddef>
/** /**
* Allocate memory. Use free() to free it. * Allocate memory. Use free() to free it.

View File

@ -20,8 +20,9 @@
#ifndef MPD_BYTE_REVERSE_HXX #ifndef MPD_BYTE_REVERSE_HXX
#define MPD_BYTE_REVERSE_HXX #define MPD_BYTE_REVERSE_HXX
#include <cstddef>
#include <stdint.h> #include <stdint.h>
#include <stddef.h>
/** /**
* Reverse the bytes in each 16 bit "frame". This function can be * Reverse the bytes in each 16 bit "frame". This function can be

View File

@ -33,7 +33,7 @@
#include "OffsetPointer.hxx" #include "OffsetPointer.hxx"
#include "Compiler.h" #include "Compiler.h"
#include <stddef.h> #include <cstddef>
template<typename T, typename U> template<typename T, typename U>
constexpr T * constexpr T *

View File

@ -33,8 +33,7 @@
#include "WritableBuffer.hxx" #include "WritableBuffer.hxx"
#include <cassert> #include <cassert>
#include <cstddef>
#include <stddef.h>
/** /**
* A circular buffer. * A circular buffer.

View File

@ -34,7 +34,8 @@
#include "StringBuffer.hxx" #include "StringBuffer.hxx"
#include "Compiler.h" #include "Compiler.h"
#include <stddef.h> #include <cstddef>
#include <stdint.h> #include <stdint.h>
/** /**

View File

@ -32,10 +32,9 @@
#include "WritableBuffer.hxx" #include "WritableBuffer.hxx"
#include <cstddef>
#include <utility> #include <utility>
#include <stddef.h>
#ifdef __linux__ #ifdef __linux__
/** /**

View File

@ -29,7 +29,7 @@
#pragma once #pragma once
#include <stddef.h> #include <cstddef>
/** /**
* Offset the given pointer by the specified number of bytes. * Offset the given pointer by the specified number of bytes.

View File

@ -22,7 +22,8 @@
#include "Compiler.h" #include "Compiler.h"
#include <stddef.h> #include <cstddef>
#include <stdint.h> #include <stdint.h>
template<typename T> struct WritableBuffer; template<typename T> struct WritableBuffer;

View File

@ -32,10 +32,9 @@
#include "Compiler.h" #include "Compiler.h"
#include <cstddef>
#include <utility> #include <utility>
#include <stddef.h>
/** /**
* Manager for a temporary array which grows as needed. This attempts * Manager for a temporary array which grows as needed. This attempts
* to reduce the number of consecutive heap allocations and * to reduce the number of consecutive heap allocations and

View File

@ -24,11 +24,10 @@
#include "Compiler.h" #include "Compiler.h"
#include <cassert> #include <cassert>
#include <cstddef>
#include <new> #include <new>
#include <utility> #include <utility>
#include <stddef.h>
/** /**
* This class pre-allocates a certain number of objects, and allows * This class pre-allocates a certain number of objects, and allows
* callers to allocate and free these objects ("slices"). * callers to allocate and free these objects ("slices").

View File

@ -32,7 +32,7 @@
#include "Compiler.h" #include "Compiler.h"
#include <stddef.h> #include <cstddef>
/** /**
* Skips whitespace at the beginning of the string, and returns the * Skips whitespace at the beginning of the string, and returns the

View File

@ -22,7 +22,7 @@
#include "Compiler.h" #include "Compiler.h"
#include <stddef.h> #include <cstddef>
struct StringView; struct StringView;

View File

@ -30,7 +30,7 @@
#ifndef TEMPLATE_STRING_HXX #ifndef TEMPLATE_STRING_HXX
#define TEMPLATE_STRING_HXX #define TEMPLATE_STRING_HXX
#include <stddef.h> #include <cstddef>
namespace TemplateString { namespace TemplateString {
/** /**

View File

@ -30,7 +30,7 @@
#ifndef TRANSFORM_N_HXX #ifndef TRANSFORM_N_HXX
#define TRANSFORM_N_HXX #define TRANSFORM_N_HXX
#include <stddef.h> #include <cstddef>
/** /**
* The std::transform_n() function that is missing in the C++ standard * The std::transform_n() function that is missing in the C++ standard

View File

@ -32,7 +32,7 @@
#include "Compiler.h" #include "Compiler.h"
#include <stddef.h> #include <cstddef>
/** /**
* Copy a string. If the buffer is too small, then the string is * Copy a string. If the buffer is too small, then the string is

View File

@ -33,7 +33,7 @@
#include "Compiler.h" #include "Compiler.h"
#include <stddef.h> #include <cstddef>
/** /**
* Is this a valid UTF-8 string? * Is this a valid UTF-8 string?