diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2023-12-08 15:55:00 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-08 15:55:00 +0100 |
| commit | 2c8c5025ce082df7bb751bc4f7552f3bb923964f (patch) | |
| tree | 5ad72e999a4b3b814eb46c2a84b04086e8f192cc /src/lib/openjp2 | |
| parent | 65282a0c2fe32668baef03c347ee8d289e2cb647 (diff) | |
| parent | c4b3a91ede1d0301f7f5f50287c0bda35aa7ca7e (diff) | |
Merge pull request #1484 from mayeut/mandatory-inttypes-stdint
Require `stdint.h` & `inttypes.h`
Diffstat (limited to 'src/lib/openjp2')
| -rw-r--r-- | src/lib/openjp2/CMakeLists.txt | 3 | ||||
| -rw-r--r-- | src/lib/openjp2/openjpeg.h | 2 | ||||
| -rw-r--r-- | src/lib/openjp2/opj_config.h.cmake.in | 1 | ||||
| -rw-r--r-- | src/lib/openjp2/opj_config_private.h.cmake.in | 3 | ||||
| -rw-r--r-- | src/lib/openjp2/opj_includes.h | 3 | ||||
| -rw-r--r-- | src/lib/openjp2/opj_inttypes.h | 48 | ||||
| -rw-r--r-- | src/lib/openjp2/opj_stdint.h | 52 | ||||
| -rw-r--r-- | src/lib/openjp2/t1_ht_generate_luts.c | 10 |
8 files changed, 10 insertions, 112 deletions
diff --git a/src/lib/openjp2/CMakeLists.txt b/src/lib/openjp2/CMakeLists.txt index f92044e8..8fda14dc 100644 --- a/src/lib/openjp2/CMakeLists.txt +++ b/src/lib/openjp2/CMakeLists.txt @@ -54,7 +54,6 @@ set(OPENJPEG_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/opj_intmath.h ${CMAKE_CURRENT_SOURCE_DIR}/opj_malloc.c ${CMAKE_CURRENT_SOURCE_DIR}/opj_malloc.h - ${CMAKE_CURRENT_SOURCE_DIR}/opj_stdint.h ${CMAKE_CURRENT_SOURCE_DIR}/sparse_array.c ${CMAKE_CURRENT_SOURCE_DIR}/sparse_array.h ) @@ -123,7 +122,7 @@ install(TARGETS ${INSTALL_LIBS} ) # Install includes files -install(FILES openjpeg.h opj_stdint.h +install(FILES openjpeg.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${OPENJPEG_INSTALL_SUBDIR} COMPONENT Headers ) diff --git a/src/lib/openjp2/openjpeg.h b/src/lib/openjp2/openjpeg.h index ebe78444..a421143a 100644 --- a/src/lib/openjp2/openjpeg.h +++ b/src/lib/openjp2/openjpeg.h @@ -122,7 +122,7 @@ typedef float OPJ_FLOAT32; typedef double OPJ_FLOAT64; typedef unsigned char OPJ_BYTE; -#include "opj_stdint.h" +#include <stdint.h> typedef int8_t OPJ_INT8; typedef uint8_t OPJ_UINT8; diff --git a/src/lib/openjp2/opj_config.h.cmake.in b/src/lib/openjp2/opj_config.h.cmake.in index 5f762ca3..50015fb9 100644 --- a/src/lib/openjp2/opj_config.h.cmake.in +++ b/src/lib/openjp2/opj_config.h.cmake.in @@ -1,5 +1,4 @@ /* create opj_config.h for CMake */ -#cmakedefine OPJ_HAVE_STDINT_H @OPJ_HAVE_STDINT_H@ /*--------------------------------------------------------------------------*/ /* OpenJPEG Versioning */ diff --git a/src/lib/openjp2/opj_config_private.h.cmake.in b/src/lib/openjp2/opj_config_private.h.cmake.in index c41f9066..c559282c 100644 --- a/src/lib/openjp2/opj_config_private.h.cmake.in +++ b/src/lib/openjp2/opj_config_private.h.cmake.in @@ -1,5 +1,4 @@ /* create opj_config_private.h for CMake */ -#cmakedefine OPJ_HAVE_INTTYPES_H @OPJ_HAVE_INTTYPES_H@ #define OPJ_PACKAGE_VERSION "@PACKAGE_VERSION@" @@ -11,6 +10,8 @@ /*#cmakedefine HAVE_SYS_STAT_H @HAVE_SYS_STAT_H@*/ /*#cmakedefine HAVE_SYS_TYPES_H @HAVE_SYS_TYPES_H@ */ /*#cmakedefine HAVE_UNISTD_H @HAVE_UNISTD_H@*/ +/*#cmakedefine HAVE_INTTYPES_H @HAVE_INTTYPES_H@ */ +/*#cmakedefine HAVE_STDINT_H @HAVE_STDINT_H@ */ #cmakedefine _LARGEFILE_SOURCE #cmakedefine _LARGE_FILES diff --git a/src/lib/openjp2/opj_includes.h b/src/lib/openjp2/opj_includes.h index 0a8628c9..13613ce5 100644 --- a/src/lib/openjp2/opj_includes.h +++ b/src/lib/openjp2/opj_includes.h @@ -55,6 +55,8 @@ #include <ctype.h> #include <assert.h> #include <limits.h> +#include <stdint.h> +#include <inttypes.h> /* Use fseeko() and ftello() if they are available since they use @@ -218,7 +220,6 @@ typedef unsigned int OPJ_BITFIELD; #define OPJ_UNUSED(x) (void)x -#include "opj_inttypes.h" #include "opj_clock.h" #include "opj_malloc.h" #include "event.h" diff --git a/src/lib/openjp2/opj_inttypes.h b/src/lib/openjp2/opj_inttypes.h deleted file mode 100644 index 2c9749a1..00000000 --- a/src/lib/openjp2/opj_inttypes.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * The copyright in this software is being made available under the 2-clauses - * BSD License, included below. This software may be subject to other third - * party and contributor rights, including patent rights, and no such rights - * are granted under this license. - * - * Copyright (c) 2012, Mathieu Malaterre <mathieu.malaterre@gmail.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ -#ifndef OPJ_INTTYPES_H -#define OPJ_INTTYPES_H - -#include "opj_config_private.h" -#ifdef OPJ_HAVE_INTTYPES_H -#include <inttypes.h> -#else -#if defined(_WIN32) -#define PRId64 "I64d" -#define PRIi64 "I64i" -#define PRIu64 "I64u" -#define PRIx64 "I64x" -#else -#error unsupported platform -#endif -#endif - -#endif /* OPJ_INTTYPES_H */ diff --git a/src/lib/openjp2/opj_stdint.h b/src/lib/openjp2/opj_stdint.h deleted file mode 100644 index f26c921c..00000000 --- a/src/lib/openjp2/opj_stdint.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * The copyright in this software is being made available under the 2-clauses - * BSD License, included below. This software may be subject to other third - * party and contributor rights, including patent rights, and no such rights - * are granted under this license. - * - * Copyright (c) 2012, Mathieu Malaterre <mathieu.malaterre@gmail.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ -#ifndef OPJ_STDINT_H -#define OPJ_STDINT_H - -#include "opj_config.h" -#ifdef OPJ_HAVE_STDINT_H -#include <stdint.h> -#else -#if defined(_WIN32) -typedef signed __int8 int8_t; -typedef unsigned __int8 uint8_t; -typedef signed __int16 int16_t; -typedef unsigned __int16 uint16_t; -typedef signed __int32 int32_t; -typedef unsigned __int32 uint32_t; -typedef signed __int64 int64_t; -typedef unsigned __int64 uint64_t; -#else -#error unsupported platform -#endif -#endif - -#endif /* OPJ_STDINT_H */ diff --git a/src/lib/openjp2/t1_ht_generate_luts.c b/src/lib/openjp2/t1_ht_generate_luts.c index 6876e3fd..22382a5a 100644 --- a/src/lib/openjp2/t1_ht_generate_luts.c +++ b/src/lib/openjp2/t1_ht_generate_luts.c @@ -38,12 +38,7 @@ #include <string.h> #include <stdio.h> #include <assert.h> - -typedef int OPJ_BOOL; -#define OPJ_TRUE 1 -#define OPJ_FALSE 0 - -#include "opj_stdint.h" +#include <stdint.h> typedef int8_t OPJ_INT8; typedef uint8_t OPJ_UINT8; @@ -53,6 +48,9 @@ typedef int32_t OPJ_INT32; typedef uint32_t OPJ_UINT32; typedef int64_t OPJ_INT64; typedef uint64_t OPJ_UINT64; +typedef int OPJ_BOOL; +#define OPJ_TRUE 1 +#define OPJ_FALSE 0 //************************************************************************/ /** @brief HT decoding tables, as given in the standard |
