remove superfluous #defines, types and includes

This commit is contained in:
Moritz Bunkus 2021-02-20 20:23:20 +01:00
parent 997d5a54fa
commit 1b096e66c7
No known key found for this signature in database
GPG Key ID: 74AF00ADF2E32C85
4 changed files with 10 additions and 73 deletions

View File

@ -476,9 +476,9 @@ static int avi_add_odml_index_entry(avi_t *AVI, unsigned char *tag, long flags,
if (AVI->video_superindex->nEntriesInUse > NR_IXNN_CHUNKS) {
fprintf (stderr, "Internal error in avilib - redefine NR_IXNN_CHUNKS\n");
fprintf (stderr, "[avilib dump] cur_std_idx=%d NR_IXNN_CHUNKS=%d"
"POS=" LLD " towrite=" LLD "\n",
cur_std_idx,NR_IXNN_CHUNKS, AVI->pos, towrite);
/* fprintf (stderr, "[avilib dump] cur_std_idx=%d NR_IXNN_CHUNKS=%d" */
/* "POS=" LLD " towrite=" LLD "\n", */
/* cur_std_idx,NR_IXNN_CHUNKS, AVI->pos, towrite); */
return -1;
}

View File

@ -1000,14 +1000,12 @@ void rmff_put_uint32_be(void *buf, uint32_t value);
*/
void rmff_put_uint32_le(void *buf, uint32_t value);
#if defined(ARCH_LITTLEENDIAN)
#if !defined(WORDS_BIGENDIAN) || (WORDS_BIGENDIAN != 1)
# define rmff_get_uint32_me(b) rmff_get_uint32_le(b)
# define rmff_put_uint32_me(b) rmff_put_uint32_le(b)
#elif defined(ARCH_BIGENDIAN)
#else
# define rmff_get_uint32_me(b) rmff_get_uint32_be(b)
# define rmff_put_uint32_me(b) rmff_put_uint32_be(b)
#else
# error Neither ARCH_LITTLEENDIAN nor ARCH_BIGENDIAN has been defined.
#endif
#if defined(__cplusplus)

View File

@ -16,9 +16,10 @@
#undef min
#undef max
#include <type_traits>
#include <algorithm>
#include <cassert>
#include <cstdint>
#include <cstring>
#include <filesystem>
#include <functional>
#include <memory>
@ -26,20 +27,10 @@
#include <optional>
#include <stdexcept>
#include <string>
#include <type_traits>
#include <vector>
#include <cassert>
#include <cstring>
#if defined(HAVE_SYS_TYPES_H)
# include <sys/types.h>
#endif // HAVE_SYS_TYPES_H
#if defined(HAVE_STDINT_H)
# include <stdint.h>
#endif // HAVE_STDINT_H
#if defined(HAVE_INTTYPES_H)
# include <inttypes.h>
#endif // HAVE_INTTYPES_H
#include <stdint.h>
// Don't support user-defined literals in fmt as they aren't used by
// MKVToolNix and produce a compiler warning in -Wpedantic

View File

@ -14,9 +14,6 @@
#include "config.h"
// For PRId64 and PRIu64:
#define __STDC_FORMAT_MACROS
#if (defined(_WIN32) || defined(WIN32) || defined(__MINGW32__)) && !defined(__CYGWIN__)
# define SYS_WINDOWS
#elif defined(__APPLE__)
@ -53,57 +50,8 @@
# define strncasecmp _strnicmp
# define strcasecmp _stricmp
using int64_t = __int64;
using int32_t = __int32;
using int16_t = __int16;
using int8_t = __int8;
using uint64_t = unsigned __int64;
using uint32_t = unsigned __int32;
using uint16_t = unsigned __int16;
using uint8_t = unsigned __int8;
# define nice(a)
using ssize_t = _fsize_t;
#define PACKED_STRUCTURE
#else // COMP_MSC
#define PACKED_STRUCTURE __attribute__((__packed__))
#endif // COMP_MSC
#if defined(COMP_MINGW) || defined(COMP_MSC)
# if defined(COMP_MINGW)
// mingw is a special case. It does have inttypes.h declaring
// PRId64 to be I64d, but it warns about "int type format, different
// type argument" if %I64d is used with a int64_t. The mx* functions
// convert %lld to %I64d on mingw/msvc anyway.
# undef PRId64
# define PRId64 "lld"
# undef PRIu64
# define PRIu64 "llu"
# undef PRIx64
# define PRIx64 "llx"
# else
// MSVC doesn't have inttypes, nor the PRI?64 defines.
# define PRId64 "I64d"
# define PRIu64 "I64u"
# define PRIx64 "I64x"
# endif // defined(COMP_MINGW)
#endif // COMP_MINGW || COMP_MSC
#define LLD "%" PRId64
#define LLU "%" PRIu64
#if defined(HAVE_NO_INT64_T)
using int64_t = INT64_TYPE;
#endif
#if defined(HAVE_NO_UINT64_T)
using uint64_t = UINT64_TYPE;
#endif
#if defined(WORDS_BIGENDIAN) && (WORDS_BIGENDIAN == 1)
# define ARCH_BIGENDIAN
#else
# define ARCH_LITTLEENDIAN
#endif