Coverage Report

Created: 2025-08-28 06:57

/src/gdal/port/cpl_port.h
Line
Count
Source (jump to first uncovered line)
1
/******************************************************************************
2
 *
3
 * Project:  CPL - Common Portability Library
4
 * Author:   Frank Warmerdam, warmerdam@pobox.com
5
 * Purpose:  Include file providing low level portability services for CPL.
6
 *           This should be the first include file for any CPL based code.
7
 *
8
 ******************************************************************************
9
 * Copyright (c) 1998, 2005, Frank Warmerdam <warmerdam@pobox.com>
10
 * Copyright (c) 2008-2013, Even Rouault <even dot rouault at spatialys.com>
11
 *
12
 * SPDX-License-Identifier: MIT
13
 ****************************************************************************/
14
15
#ifndef CPL_BASE_H_INCLUDED
16
#define CPL_BASE_H_INCLUDED
17
18
/**
19
 * \file cpl_port.h
20
 *
21
 * Core portability definitions for CPL.
22
 *
23
 */
24
25
/* -------------------------------------------------------------------- */
26
/*      The following apparently allow you to use strcpy() and other    */
27
/*      functions judged "unsafe" by microsoft in VS 8 (2005).          */
28
/* -------------------------------------------------------------------- */
29
#ifdef _MSC_VER
30
#ifndef _CRT_SECURE_NO_DEPRECATE
31
#define _CRT_SECURE_NO_DEPRECATE
32
#endif
33
#ifndef _CRT_NONSTDC_NO_DEPRECATE
34
#define _CRT_NONSTDC_NO_DEPRECATE
35
#endif
36
#endif
37
38
#include "cpl_config.h"
39
40
/* ==================================================================== */
41
/*      A few sanity checks, mainly to detect problems that sometimes   */
42
/*      arise with bad configured cross-compilation.                    */
43
/* ==================================================================== */
44
45
#if !defined(SIZEOF_INT) || SIZEOF_INT != 4
46
#error "Unexpected value for SIZEOF_INT"
47
#endif
48
49
#if !defined(SIZEOF_UNSIGNED_LONG) ||                                          \
50
    (SIZEOF_UNSIGNED_LONG != 4 && SIZEOF_UNSIGNED_LONG != 8)
51
#error "Unexpected value for SIZEOF_UNSIGNED_LONG"
52
#endif
53
54
#if !defined(SIZEOF_VOIDP)
55
#error "Unexpected value for SIZEOF_VOIDP"
56
#endif
57
58
/* ==================================================================== */
59
/*      This will disable most WIN32 stuff in a Cygnus build which      */
60
/*      defines unix to 1.                                              */
61
/* ==================================================================== */
62
63
#ifdef unix
64
#undef WIN32
65
#endif
66
67
/*! @cond Doxygen_Suppress */
68
#if defined(VSI_NEED_LARGEFILE64_SOURCE) && !defined(_LARGEFILE64_SOURCE)
69
#define _LARGEFILE64_SOURCE 1
70
#endif
71
72
/* ==================================================================== */
73
/*      If iconv() is available use extended recoding module.           */
74
/*      Stub implementation is always compiled in, because it works     */
75
/*      faster than iconv() for encodings it supports.                  */
76
/* ==================================================================== */
77
78
#if defined(HAVE_ICONV)
79
#define CPL_RECODE_ICONV
80
#endif
81
82
#define CPL_RECODE_STUB
83
/*! @endcond */
84
85
/* ==================================================================== */
86
/*      MinGW stuff                                                     */
87
/* ==================================================================== */
88
89
/* Needed for std=c11 on Solaris to have strcasecmp() */
90
#if defined(GDAL_COMPILATION) && defined(__sun__) &&                           \
91
    (__STDC_VERSION__ + 0) >= 201112L && (_XOPEN_SOURCE + 0) < 600
92
#ifdef _XOPEN_SOURCE
93
#undef _XOPEN_SOURCE
94
#endif
95
#define _XOPEN_SOURCE 600
96
#endif
97
98
/* ==================================================================== */
99
/*      Standard include files.                                         */
100
/* ==================================================================== */
101
102
#include <stdio.h>
103
#include <stdlib.h>
104
#include <math.h>
105
#include <stdarg.h>
106
#include <string.h>
107
#include <ctype.h>
108
#include <limits.h>
109
110
#include <time.h>
111
112
#include <errno.h>
113
114
#ifdef HAVE_LOCALE_H
115
#include <locale.h>
116
#endif
117
118
#ifdef HAVE_DIRECT_H
119
#include <direct.h>
120
#endif
121
122
#if !defined(_WIN32)
123
#include <strings.h>
124
#endif
125
126
#ifdef __cplusplus
127
extern "C++"
128
{
129
#include <cmath>
130
}
131
#endif
132
133
/* ==================================================================== */
134
/*      Base portability stuff ... this stuff may need to be            */
135
/*      modified for new platforms.                                     */
136
/* ==================================================================== */
137
138
/* -------------------------------------------------------------------- */
139
/*      Which versions of C++ are available.                            */
140
/* -------------------------------------------------------------------- */
141
142
/* MSVC fails to define a decent value of __cplusplus. Try to target VS2015*/
143
/* as a minimum */
144
145
#if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS)
146
#if !(__cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1900))
147
#error Must have C++11 or newer.
148
#endif
149
#if __cplusplus >= 201402L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201402L)
150
#define HAVE_CXX14 1
151
#endif
152
#if __cplusplus >= 201703L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)
153
#define HAVE_CXX17 1
154
#endif
155
#endif /* __cplusplus */
156
157
/*---------------------------------------------------------------------
158
 *        types for 16 and 32 bits integers, etc...
159
 *--------------------------------------------------------------------*/
160
#if UINT_MAX == 65535
161
typedef long GInt32;
162
typedef unsigned long GUInt32;
163
#else
164
/** Int32 type */
165
typedef int GInt32;
166
/** Unsigned int32 type */
167
typedef unsigned int GUInt32;
168
#endif
169
170
/** Int16 type */
171
typedef short GInt16;
172
/** Unsigned int16 type */
173
typedef unsigned short GUInt16;
174
/** Unsigned byte type */
175
typedef unsigned char GByte;
176
/** Signed int8 type */
177
typedef signed char GInt8;
178
/* hack for PDF driver and poppler >= 0.15.0 that defines incompatible "typedef
179
 * bool GBool" */
180
/* in include/poppler/goo/gtypes.h */
181
#ifndef CPL_GBOOL_DEFINED
182
/*! @cond Doxygen_Suppress */
183
#define CPL_GBOOL_DEFINED
184
/*! @endcond */
185
/** Type for boolean values (alias to int) */
186
typedef int GBool;
187
#endif
188
189
/*! @cond Doxygen_Suppress */
190
#ifdef __cplusplus
191
992
#define CPL_STATIC_CAST(type, expr) static_cast<type>(expr)
192
0
#define CPL_REINTERPRET_CAST(type, expr) reinterpret_cast<type>(expr)
193
#else
194
#define CPL_STATIC_CAST(type, expr) ((type)(expr))
195
#define CPL_REINTERPRET_CAST(type, expr) ((type)(expr))
196
#endif
197
/*! @endcond */
198
199
/* -------------------------------------------------------------------- */
200
/*      64bit support                                                   */
201
/* -------------------------------------------------------------------- */
202
203
/** Large signed integer type (generally 64-bit integer type).
204
 *  Use GInt64 when exactly 64 bit is needed */
205
typedef long long GIntBig;
206
/** Large unsigned integer type (generally 64-bit unsigned integer type).
207
 *  Use GUInt64 when exactly 64 bit is needed */
208
typedef unsigned long long GUIntBig;
209
210
/** Minimum GIntBig value */
211
0
#define GINTBIG_MIN (CPL_STATIC_CAST(GIntBig, 0x80000000) << 32)
212
/** Maximum GIntBig value */
213
0
#define GINTBIG_MAX ((CPL_STATIC_CAST(GIntBig, 0x7FFFFFFF) << 32) | 0xFFFFFFFFU)
214
/** Maximum GUIntBig value */
215
#define GUINTBIG_MAX                                                           \
216
992
    ((CPL_STATIC_CAST(GUIntBig, 0xFFFFFFFFU) << 32) | 0xFFFFFFFFU)
217
218
/*! @cond Doxygen_Suppress */
219
#define CPL_HAS_GINT64 1
220
/*! @endcond */
221
222
/* Note: we might want to use instead int64_t / uint64_t if they are available
223
 */
224
225
/** Signed 64 bit integer type */
226
typedef GIntBig GInt64;
227
/** Unsigned 64 bit integer type */
228
typedef GUIntBig GUInt64;
229
230
/** Minimum GInt64 value */
231
#define GINT64_MIN GINTBIG_MIN
232
/** Maximum GInt64 value */
233
#define GINT64_MAX GINTBIG_MAX
234
/** Minimum GUInt64 value */
235
0
#define GUINT64_MAX GUINTBIG_MAX
236
237
#if SIZEOF_VOIDP > 8
238
#include <stddef.h>  // ptrdiff_t
239
/** Integer type large enough to hold the difference between 2 addresses */
240
typedef ptrdiff_t GPtrDiff_t;
241
#elif SIZEOF_VOIDP == 8
242
/** Integer type large enough to hold the difference between 2 addresses */
243
typedef GIntBig GPtrDiff_t;
244
#else
245
/** Integer type large enough to hold the difference between 2 addresses */
246
typedef int GPtrDiff_t;
247
#endif
248
249
#ifdef GDAL_COMPILATION
250
#include <stdint.h>
251
typedef uintptr_t GUIntptr_t;
252
#define CPL_IS_ALIGNED(ptr, quant)                                             \
253
0
    ((CPL_REINTERPRET_CAST(GUIntptr_t, CPL_STATIC_CAST(const void *, ptr)) %   \
254
0
      (quant)) == 0)
255
256
#endif
257
258
#if (defined(__MSVCRT__) && !(defined(__MINGW64__) && __GNUC__ >= 10)) ||      \
259
    (defined(_WIN32) && defined(_MSC_VER))
260
#define CPL_FRMT_GB_WITHOUT_PREFIX "I64"
261
#else
262
/** Printf formatting suffix for GIntBig */
263
#define CPL_FRMT_GB_WITHOUT_PREFIX "ll"
264
#endif
265
266
/** Printf formatting for GIntBig */
267
0
#define CPL_FRMT_GIB "%" CPL_FRMT_GB_WITHOUT_PREFIX "d"
268
/** Printf formatting for GUIntBig */
269
622
#define CPL_FRMT_GUIB "%" CPL_FRMT_GB_WITHOUT_PREFIX "u"
270
271
/*! @cond Doxygen_Suppress */
272
#ifdef COMPAT_WITH_ICC_CONVERSION_CHECK
273
#define CPL_INT64_FITS_ON_INT32(x) ((x) >= INT_MIN && (x) <= INT_MAX)
274
#else
275
#define CPL_INT64_FITS_ON_INT32(x)                                             \
276
0
    (CPL_STATIC_CAST(GIntBig, CPL_STATIC_CAST(int, x)) == (x))
277
#endif
278
/*! @endcond */
279
280
/* ==================================================================== */
281
/*      Other standard services.                                        */
282
/* ==================================================================== */
283
#ifdef __cplusplus
284
/** Macro to start a block of C symbols */
285
#define CPL_C_START                                                            \
286
    extern "C"                                                                 \
287
    {
288
/** Macro to end a block of C symbols */
289
#define CPL_C_END }
290
#else
291
#define CPL_C_START
292
#define CPL_C_END
293
#endif
294
295
#ifndef CPL_DLL
296
#if defined(_MSC_VER) && !defined(CPL_DISABLE_DLL)
297
#ifdef GDAL_COMPILATION
298
#define CPL_DLL __declspec(dllexport)
299
#else
300
#define CPL_DLL
301
#endif
302
#define CPL_INTERNAL
303
#else
304
#if defined(USE_GCC_VISIBILITY_FLAG)
305
#define CPL_DLL __attribute__((visibility("default")))
306
#if !defined(__MINGW32__)
307
#define CPL_INTERNAL __attribute__((visibility("hidden")))
308
#else
309
#define CPL_INTERNAL
310
#endif
311
#else
312
#define CPL_DLL
313
#define CPL_INTERNAL
314
#endif
315
#endif
316
317
// Marker for unstable API
318
#define CPL_UNSTABLE_API CPL_DLL
319
320
#endif
321
322
/*! @cond Doxygen_Suppress */
323
/* Should optional (normally private) interfaces be exported? */
324
#ifdef CPL_OPTIONAL_APIS
325
#define CPL_ODLL CPL_DLL
326
#else
327
#define CPL_ODLL
328
#endif
329
/*! @endcond */
330
331
#ifndef CPL_STDCALL
332
#if defined(_MSC_VER) && !defined(CPL_DISABLE_STDCALL)
333
#define CPL_STDCALL __stdcall
334
#else
335
#define CPL_STDCALL
336
#endif
337
#endif
338
339
/*! @cond Doxygen_Suppress */
340
#ifdef _MSC_VER
341
#define FORCE_CDECL __cdecl
342
#else
343
#define FORCE_CDECL
344
#endif
345
/*! @endcond */
346
347
/*! @cond Doxygen_Suppress */
348
/* TODO : support for other compilers needed */
349
#if (defined(__GNUC__) && !defined(__NO_INLINE__)) || defined(_MSC_VER)
350
#define HAS_CPL_INLINE 1
351
#define CPL_INLINE __inline
352
#elif defined(__SUNPRO_CC)
353
#define HAS_CPL_INLINE 1
354
#define CPL_INLINE inline
355
#else
356
#define CPL_INLINE
357
#endif
358
/*! @endcond*/
359
360
#ifndef MAX
361
/** Macro to compute the minimum of 2 values */
362
0
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
363
/** Macro to compute the maximum of 2 values */
364
0
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
365
#endif
366
367
#ifndef ABS
368
/** Macro to compute the absolute value */
369
0
#define ABS(x) (((x) < 0) ? (-1 * (x)) : (x))
370
#endif
371
372
#ifndef M_PI
373
/** PI definition */
374
#define M_PI 3.14159265358979323846
375
/* 3.1415926535897932384626433832795 */
376
#endif
377
378
/* -------------------------------------------------------------------- */
379
/*      Macro to test equality of two floating point values.            */
380
/*      We use fabs() function instead of ABS() macro to avoid side     */
381
/*      effects.                                                        */
382
/* -------------------------------------------------------------------- */
383
/*! @cond Doxygen_Suppress */
384
#ifndef CPLIsEqual
385
0
#define CPLIsEqual(x, y) (fabs((x) - (y)) < 0.0000000000001)
386
#endif
387
/*! @endcond */
388
389
/* -------------------------------------------------------------------- */
390
/*      Provide macros for case insensitive string comparisons.         */
391
/* -------------------------------------------------------------------- */
392
#ifndef EQUAL
393
394
#if defined(AFL_FRIENDLY) && defined(__GNUC__)
395
396
static inline int CPL_afl_friendly_memcmp(const void *ptr1, const void *ptr2,
397
                                          size_t len)
398
    __attribute__((always_inline));
399
400
static inline int CPL_afl_friendly_memcmp(const void *ptr1, const void *ptr2,
401
                                          size_t len)
402
{
403
    const unsigned char *bptr1 = (const unsigned char *)ptr1;
404
    const unsigned char *bptr2 = (const unsigned char *)ptr2;
405
    while (len--)
406
    {
407
        unsigned char b1 = *(bptr1++);
408
        unsigned char b2 = *(bptr2++);
409
        if (b1 != b2)
410
            return b1 - b2;
411
    }
412
    return 0;
413
}
414
415
static inline int CPL_afl_friendly_strcmp(const char *ptr1, const char *ptr2)
416
    __attribute__((always_inline));
417
418
static inline int CPL_afl_friendly_strcmp(const char *ptr1, const char *ptr2)
419
{
420
    const unsigned char *usptr1 = (const unsigned char *)ptr1;
421
    const unsigned char *usptr2 = (const unsigned char *)ptr2;
422
    while (1)
423
    {
424
        unsigned char ch1 = *(usptr1++);
425
        unsigned char ch2 = *(usptr2++);
426
        if (ch1 == 0 || ch1 != ch2)
427
            return ch1 - ch2;
428
    }
429
}
430
431
static inline int CPL_afl_friendly_strncmp(const char *ptr1, const char *ptr2,
432
                                           size_t len)
433
    __attribute__((always_inline));
434
435
static inline int CPL_afl_friendly_strncmp(const char *ptr1, const char *ptr2,
436
                                           size_t len)
437
{
438
    const unsigned char *usptr1 = (const unsigned char *)ptr1;
439
    const unsigned char *usptr2 = (const unsigned char *)ptr2;
440
    while (len--)
441
    {
442
        unsigned char ch1 = *(usptr1++);
443
        unsigned char ch2 = *(usptr2++);
444
        if (ch1 == 0 || ch1 != ch2)
445
            return ch1 - ch2;
446
    }
447
    return 0;
448
}
449
450
static inline int CPL_afl_friendly_strcasecmp(const char *ptr1,
451
                                              const char *ptr2)
452
    __attribute__((always_inline));
453
454
static inline int CPL_afl_friendly_strcasecmp(const char *ptr1,
455
                                              const char *ptr2)
456
{
457
    const unsigned char *usptr1 = (const unsigned char *)ptr1;
458
    const unsigned char *usptr2 = (const unsigned char *)ptr2;
459
    while (1)
460
    {
461
        unsigned char ch1 = *(usptr1++);
462
        unsigned char ch2 = *(usptr2++);
463
        ch1 = (unsigned char)toupper(ch1);
464
        ch2 = (unsigned char)toupper(ch2);
465
        if (ch1 == 0 || ch1 != ch2)
466
            return ch1 - ch2;
467
    }
468
}
469
470
static inline int CPL_afl_friendly_strncasecmp(const char *ptr1,
471
                                               const char *ptr2, size_t len)
472
    __attribute__((always_inline));
473
474
static inline int CPL_afl_friendly_strncasecmp(const char *ptr1,
475
                                               const char *ptr2, size_t len)
476
{
477
    const unsigned char *usptr1 = (const unsigned char *)ptr1;
478
    const unsigned char *usptr2 = (const unsigned char *)ptr2;
479
    while (len--)
480
    {
481
        unsigned char ch1 = *(usptr1++);
482
        unsigned char ch2 = *(usptr2++);
483
        ch1 = (unsigned char)toupper(ch1);
484
        ch2 = (unsigned char)toupper(ch2);
485
        if (ch1 == 0 || ch1 != ch2)
486
            return ch1 - ch2;
487
    }
488
    return 0;
489
}
490
491
static inline char *CPL_afl_friendly_strstr(const char *haystack,
492
                                            const char *needle)
493
    __attribute__((always_inline));
494
495
static inline char *CPL_afl_friendly_strstr(const char *haystack,
496
                                            const char *needle)
497
{
498
    const char *ptr_haystack = haystack;
499
    while (1)
500
    {
501
        const char *ptr_haystack2 = ptr_haystack;
502
        const char *ptr_needle = needle;
503
        while (1)
504
        {
505
            char ch1 = *(ptr_haystack2++);
506
            char ch2 = *(ptr_needle++);
507
            if (ch2 == 0)
508
                return (char *)ptr_haystack;
509
            if (ch1 != ch2)
510
                break;
511
        }
512
        if (*ptr_haystack == 0)
513
            return NULL;
514
        ptr_haystack++;
515
    }
516
}
517
518
#undef strcmp
519
#undef strncmp
520
#define memcmp CPL_afl_friendly_memcmp
521
#define strcmp CPL_afl_friendly_strcmp
522
#define strncmp CPL_afl_friendly_strncmp
523
#define strcasecmp CPL_afl_friendly_strcasecmp
524
#define strncasecmp CPL_afl_friendly_strncasecmp
525
#define strstr CPL_afl_friendly_strstr
526
527
#endif /* defined(AFL_FRIENDLY) && defined(__GNUC__) */
528
529
#if defined(_WIN32)
530
#define STRCASECMP(a, b) (_stricmp(a, b))
531
#define STRNCASECMP(a, b, n) (_strnicmp(a, b, n))
532
#else
533
/** Alias for strcasecmp() */
534
681k
#define STRCASECMP(a, b) (strcasecmp(a, b))
535
/** Alias for strncasecmp() */
536
146M
#define STRNCASECMP(a, b, n) (strncasecmp(a, b, n))
537
#endif
538
/** Alias for strncasecmp() == 0 */
539
265M
#define EQUALN(a, b, n) (STRNCASECMP(a, b, n) == 0)
540
/** Alias for strcasecmp() == 0 */
541
798k
#define EQUAL(a, b) (STRCASECMP(a, b) == 0)
542
#endif
543
544
/*---------------------------------------------------------------------
545
 * Does a string "a" start with string "b".  Search is case-sensitive or,
546
 * with CI, it is a case-insensitive comparison.
547
 *--------------------------------------------------------------------- */
548
#ifndef STARTS_WITH_CI
549
/** Returns whether a starts with b */
550
497k
#define STARTS_WITH(a, b) (strncmp(a, b, strlen(b)) == 0)
551
/** Returns whether a starts with b (case insensitive comparison) */
552
443k
#define STARTS_WITH_CI(a, b) EQUALN(a, b, strlen(b))
553
#endif
554
555
/*! @cond Doxygen_Suppress */
556
#ifndef CPL_THREADLOCAL
557
#define CPL_THREADLOCAL
558
#endif
559
/*! @endcond */
560
561
/*! @cond Doxygen_Suppress */
562
#ifndef __cplusplus
563
/* -------------------------------------------------------------------- */
564
/*      Handle isnan() and isinf().  Note that isinf() and isnan()      */
565
/*      are supposed to be macros according to C99, defined in math.h   */
566
/*      Some systems (i.e. Tru64) don't have isinf() at all, so if      */
567
/*      the macro is not defined we just assume nothing is infinite.    */
568
/*      This may mean we have no real CPLIsInf() on systems with isinf()*/
569
/*      function but no corresponding macro, but I can live with        */
570
/*      that since it isn't that important a test.                      */
571
/* -------------------------------------------------------------------- */
572
#ifdef _MSC_VER
573
#include <float.h>
574
#define CPLIsNan(x) _isnan(x)
575
#define CPLIsInf(x) (!_isnan(x) && !_finite(x))
576
#define CPLIsFinite(x) _finite(x)
577
#elif defined(__GNUC__) &&                                                     \
578
    (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
579
/* When including <cmath> in C++11 the isnan() macro is undefined, so that */
580
/* std::isnan() can work (#6489). This is a GCC specific workaround for now. */
581
#define CPLIsNan(x) __builtin_isnan(x)
582
#define CPLIsInf(x) __builtin_isinf(x)
583
#define CPLIsFinite(x) __builtin_isfinite(x)
584
#elif defined(isinf) || defined(__FreeBSD__)
585
/** Return whether a floating-pointer number is nan */
586
#define CPLIsNan(x) isnan(x)
587
/** Return whether a floating-pointer number is +/- infinity */
588
#define CPLIsInf(x) isinf(x)
589
/** Return whether a floating-pointer number is finite */
590
#define CPLIsFinite(x) (!isnan(x) && !isinf(x))
591
#elif defined(__sun__)
592
#include <ieeefp.h>
593
#define CPLIsNan(x) isnan(x)
594
#define CPLIsInf(x) (!finite(x) && !isnan(x))
595
#define CPLIsFinite(x) finite(x)
596
#else
597
#define CPLIsNan(x) ((x) != (x))
598
#define CPLIsInf(x) (0)
599
#define CPLIsFinite(x) (!isnan(x))
600
#endif
601
#endif
602
/*! @endcond */
603
604
/*! @cond Doxygen_Suppress */
605
/*---------------------------------------------------------------------
606
 *                         CPL_LSB and CPL_MSB
607
 * Only one of these 2 macros should be defined and specifies the byte
608
 * ordering for the current platform.
609
 * This should be defined in the Makefile, but if it is not then
610
 * the default is CPL_LSB (Intel ordering, LSB first).
611
 *--------------------------------------------------------------------*/
612
#if defined(WORDS_BIGENDIAN) && !defined(CPL_MSB) && !defined(CPL_LSB)
613
#define CPL_MSB
614
#endif
615
616
#if !(defined(CPL_LSB) || defined(CPL_MSB))
617
#define CPL_LSB
618
#endif
619
620
#if defined(CPL_LSB)
621
0
#define CPL_IS_LSB 1
622
#else
623
#define CPL_IS_LSB 0
624
#endif
625
/*! @endcond */
626
627
#if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS)
628
629
/*! @cond Doxygen_Suppress */
630
extern "C++"
631
{
632
633
    template <bool b> struct CPLStaticAssert
634
    {
635
    };
636
637
    template <> struct CPLStaticAssert<true>
638
    {
639
        static void my_function()
640
0
        {
641
0
        }
642
    };
643
644
} /* extern "C++" */
645
646
0
#define CPL_STATIC_ASSERT(x) CPLStaticAssert<x>::my_function()
647
0
#define CPL_STATIC_ASSERT_IF_AVAILABLE(x) CPL_STATIC_ASSERT(x)
648
649
#else /* __cplusplus */
650
651
#define CPL_STATIC_ASSERT_IF_AVAILABLE(x)
652
653
#endif /* __cplusplus */
654
/*! @endcond */
655
656
/*---------------------------------------------------------------------
657
 *        Little endian <==> big endian byte swap macros.
658
 *--------------------------------------------------------------------*/
659
660
/** Byte-swap a 16bit unsigned integer */
661
#define CPL_SWAP16(x)                                                          \
662
0
    CPL_STATIC_CAST(GUInt16, (CPL_STATIC_CAST(GUInt16, x) << 8) |              \
663
0
                                 (CPL_STATIC_CAST(GUInt16, x) >> 8))
664
665
#ifdef __GNUC__
666
/** Byte-swap a 32bit unsigned integer */
667
#define CPL_SWAP32(x)                                                          \
668
0
    CPL_STATIC_CAST(GUInt32, __builtin_bswap32(CPL_STATIC_CAST(GUInt32, x)))
669
/** Byte-swap a 64bit unsigned integer */
670
#define CPL_SWAP64(x)                                                          \
671
0
    CPL_STATIC_CAST(GUInt64, __builtin_bswap64(CPL_STATIC_CAST(GUInt64, x)))
672
#elif defined(_MSC_VER)
673
#define CPL_SWAP32(x)                                                          \
674
    CPL_STATIC_CAST(GUInt32, _byteswap_ulong(CPL_STATIC_CAST(GUInt32, x)))
675
#define CPL_SWAP64(x)                                                          \
676
    CPL_STATIC_CAST(GUInt64, _byteswap_uint64(CPL_STATIC_CAST(GUInt64, x)))
677
#else
678
/** Byte-swap a 32bit unsigned integer */
679
#define CPL_SWAP32(x)                                                          \
680
    CPL_STATIC_CAST(GUInt32,                                                   \
681
                    ((CPL_STATIC_CAST(GUInt32, x) & 0x000000ffU) << 24) |      \
682
                        ((CPL_STATIC_CAST(GUInt32, x) & 0x0000ff00U) << 8) |   \
683
                        ((CPL_STATIC_CAST(GUInt32, x) & 0x00ff0000U) >> 8) |   \
684
                        ((CPL_STATIC_CAST(GUInt32, x) & 0xff000000U) >> 24))
685
686
/** Byte-swap a 64bit unsigned integer */
687
#define CPL_SWAP64(x)                                                          \
688
    ((CPL_STATIC_CAST(GUInt64, CPL_SWAP32(CPL_STATIC_CAST(GUInt32, x)))        \
689
      << 32) |                                                                 \
690
     (CPL_STATIC_CAST(GUInt64,                                                 \
691
                      CPL_SWAP32(CPL_STATIC_CAST(                              \
692
                          GUInt32, CPL_STATIC_CAST(GUInt64, x) >> 32)))))
693
694
#endif
695
696
/** Byte-swap a 16 bit pointer */
697
#define CPL_SWAP16PTR(x)                                                       \
698
0
    do                                                                         \
699
0
    {                                                                          \
700
0
        GUInt16 _n16;                                                          \
701
0
        void *_lx = x;                                                         \
702
0
        memcpy(&_n16, _lx, 2);                                                 \
703
0
        CPL_STATIC_ASSERT_IF_AVAILABLE(sizeof(*(x)) == 1 ||                    \
704
0
                                       sizeof(*(x)) == 2);                     \
705
0
        _n16 = CPL_SWAP16(_n16);                                               \
706
0
        memcpy(_lx, &_n16, 2);                                                 \
707
0
    } while (0)
708
709
/** Byte-swap a 32 bit pointer */
710
#define CPL_SWAP32PTR(x)                                                       \
711
0
    do                                                                         \
712
0
    {                                                                          \
713
0
        GUInt32 _n32;                                                          \
714
0
        void *_lx = x;                                                         \
715
0
        memcpy(&_n32, _lx, 4);                                                 \
716
0
        CPL_STATIC_ASSERT_IF_AVAILABLE(sizeof(*(x)) == 1 ||                    \
717
0
                                       sizeof(*(x)) == 4);                     \
718
0
        _n32 = CPL_SWAP32(_n32);                                               \
719
0
        memcpy(_lx, &_n32, 4);                                                 \
720
0
    } while (0)
721
722
/** Byte-swap a 64 bit pointer */
723
#define CPL_SWAP64PTR(x)                                                       \
724
0
    do                                                                         \
725
0
    {                                                                          \
726
0
        GUInt64 _n64;                                                          \
727
0
        void *_lx = x;                                                         \
728
0
        memcpy(&_n64, _lx, 8);                                                 \
729
0
        CPL_STATIC_ASSERT_IF_AVAILABLE(sizeof(*(x)) == 1 ||                    \
730
0
                                       sizeof(*(x)) == 8);                     \
731
0
        _n64 = CPL_SWAP64(_n64);                                               \
732
0
        memcpy(_lx, &_n64, 8);                                                 \
733
0
    } while (0)
734
735
/** Byte-swap a 64 bit pointer */
736
0
#define CPL_SWAPDOUBLE(p) CPL_SWAP64PTR(p)
737
738
#ifdef CPL_MSB
739
#define CPL_MSBWORD16(x) (x)
740
#define CPL_LSBWORD16(x) CPL_SWAP16(x)
741
#define CPL_MSBWORD32(x) (x)
742
#define CPL_LSBWORD32(x) CPL_SWAP32(x)
743
#define CPL_MSBPTR16(x)                                                        \
744
    CPL_STATIC_ASSERT_IF_AVAILABLE(sizeof(*(x)) == 1 || sizeof(*(x)) == 2)
745
#define CPL_LSBPTR16(x) CPL_SWAP16PTR(x)
746
#define CPL_MSBPTR32(x)                                                        \
747
    CPL_STATIC_ASSERT_IF_AVAILABLE(sizeof(*(x)) == 1 || sizeof(*(x)) == 4)
748
#define CPL_LSBPTR32(x) CPL_SWAP32PTR(x)
749
#define CPL_MSBPTR64(x)                                                        \
750
    CPL_STATIC_ASSERT_IF_AVAILABLE(sizeof(*(x)) == 1 || sizeof(*(x)) == 8)
751
#define CPL_LSBPTR64(x) CPL_SWAP64PTR(x)
752
#else
753
/** Return a 16bit word from a originally LSB ordered word */
754
0
#define CPL_LSBWORD16(x) (x)
755
/** Return a 16bit word from a originally MSB ordered word */
756
#define CPL_MSBWORD16(x) CPL_SWAP16(x)
757
/** Return a 32bit word from a originally LSB ordered word */
758
0
#define CPL_LSBWORD32(x) (x)
759
/** Return a 32bit word from a originally MSB ordered word */
760
#define CPL_MSBWORD32(x) CPL_SWAP32(x)
761
/** Byte-swap if necessary a 16bit word at the location pointed from a
762
 * originally LSB ordered pointer */
763
#define CPL_LSBPTR16(x)                                                        \
764
0
    CPL_STATIC_ASSERT_IF_AVAILABLE(sizeof(*(x)) == 1 || sizeof(*(x)) == 2)
765
/** Byte-swap if necessary a 16bit word at the location pointed from a
766
 * originally MSB ordered pointer */
767
#define CPL_MSBPTR16(x) CPL_SWAP16PTR(x)
768
/** Byte-swap if necessary a 32bit word at the location pointed from a
769
 * originally LSB ordered pointer */
770
#define CPL_LSBPTR32(x)                                                        \
771
0
    CPL_STATIC_ASSERT_IF_AVAILABLE(sizeof(*(x)) == 1 || sizeof(*(x)) == 4)
772
/** Byte-swap if necessary a 32bit word at the location pointed from a
773
 * originally MSB ordered pointer */
774
0
#define CPL_MSBPTR32(x) CPL_SWAP32PTR(x)
775
/** Byte-swap if necessary a 64bit word at the location pointed from a
776
 * originally LSB ordered pointer */
777
#define CPL_LSBPTR64(x)                                                        \
778
0
    CPL_STATIC_ASSERT_IF_AVAILABLE(sizeof(*(x)) == 1 || sizeof(*(x)) == 8)
779
/** Byte-swap if necessary a 64bit word at the location pointed from a
780
 * originally MSB ordered pointer */
781
#define CPL_MSBPTR64(x) CPL_SWAP64PTR(x)
782
#endif
783
784
/** Return a Int16 from the 2 bytes ordered in LSB order at address x.
785
 * @deprecated Use rather CPL_LSBSINT16PTR or CPL_LSBUINT16PTR for explicit
786
 * signedness. */
787
#define CPL_LSBINT16PTR(x)                                                     \
788
    ((*CPL_REINTERPRET_CAST(const GByte *, x)) |                               \
789
     (*((CPL_REINTERPRET_CAST(const GByte *, x)) + 1) << 8))
790
791
/** Return a Int32 from the 4 bytes ordered in LSB order at address x.
792
 * @deprecated Use rather CPL_LSBSINT32PTR or CPL_LSBUINT32PTR for explicit
793
 * signedness. */
794
#define CPL_LSBINT32PTR(x)                                                     \
795
    ((*CPL_REINTERPRET_CAST(const GByte *, x)) |                               \
796
     (*((CPL_REINTERPRET_CAST(const GByte *, x)) + 1) << 8) |                  \
797
     (*((CPL_REINTERPRET_CAST(const GByte *, x)) + 2) << 16) |                 \
798
     (*((CPL_REINTERPRET_CAST(const GByte *, x)) + 3) << 24))
799
800
/** Return a signed Int16 from the 2 bytes ordered in LSB order at address x */
801
#define CPL_LSBSINT16PTR(x) CPL_STATIC_CAST(GInt16, CPL_LSBINT16PTR(x))
802
803
/** Return a unsigned Int16 from the 2 bytes ordered in LSB order at address x
804
 */
805
#define CPL_LSBUINT16PTR(x) CPL_STATIC_CAST(GUInt16, CPL_LSBINT16PTR(x))
806
807
/** Return a signed Int32 from the 4 bytes ordered in LSB order at address x */
808
#define CPL_LSBSINT32PTR(x) CPL_STATIC_CAST(GInt32, CPL_LSBINT32PTR(x))
809
810
/** Return a unsigned Int32 from the 4 bytes ordered in LSB order at address x
811
 */
812
#define CPL_LSBUINT32PTR(x) CPL_STATIC_CAST(GUInt32, CPL_LSBINT32PTR(x))
813
814
/*! @cond Doxygen_Suppress */
815
/* Utility macro to explicitly mark intentionally unreferenced parameters. */
816
#ifndef UNREFERENCED_PARAM
817
#ifdef UNREFERENCED_PARAMETER /* May be defined by Windows API */
818
#define UNREFERENCED_PARAM(param) UNREFERENCED_PARAMETER(param)
819
#else
820
#define UNREFERENCED_PARAM(param) ((void)param)
821
#endif /* UNREFERENCED_PARAMETER */
822
#endif /* UNREFERENCED_PARAM */
823
/*! @endcond */
824
825
/* We exclude mingw64 4.6 which seems to be broken regarding this */
826
#if defined(__GNUC__) && __GNUC__ >= 4 && !defined(DOXYGEN_SKIP) &&            \
827
    !(defined(__MINGW64__) && __GNUC__ == 4 && __GNUC_MINOR__ == 6)
828
/** Null terminated variadic */
829
#define CPL_NULL_TERMINATED __attribute__((__sentinel__))
830
#else
831
/** Null terminated variadic */
832
#define CPL_NULL_TERMINATED
833
#endif
834
835
#if defined(__GNUC__) && __GNUC__ >= 3 && !defined(DOXYGEN_SKIP)
836
/** Tag a function to have printf() formatting */
837
#define CPL_PRINT_FUNC_FORMAT(format_idx, arg_idx)                             \
838
    __attribute__((__format__(__printf__, format_idx, arg_idx)))
839
/** Tag a function to have scanf() formatting */
840
#define CPL_SCAN_FUNC_FORMAT(format_idx, arg_idx)                              \
841
    __attribute__((__format__(__scanf__, format_idx, arg_idx)))
842
#else
843
/** Tag a function to have printf() formatting */
844
#define CPL_PRINT_FUNC_FORMAT(format_idx, arg_idx)
845
/** Tag a function to have scanf() formatting */
846
#define CPL_SCAN_FUNC_FORMAT(format_idx, arg_idx)
847
#endif
848
849
#if defined(_MSC_VER) &&                                                       \
850
    (defined(GDAL_COMPILATION) || defined(CPL_ENABLE_MSVC_ANNOTATIONS))
851
#include <sal.h>
852
/** Macro into which to wrap the format argument of a printf-like function.
853
 * Only used if ANALYZE=1 is specified to nmake */
854
#define CPL_FORMAT_STRING(arg) _Printf_format_string_ arg
855
/** Macro into which to wrap the format argument of a sscanf-like function.
856
 * Only used if ANALYZE=1 is specified to nmake */
857
#define CPL_SCANF_FORMAT_STRING(arg) _Scanf_format_string_ arg
858
#else
859
/** Macro into which to wrap the format argument of a printf-like function */
860
#define CPL_FORMAT_STRING(arg) arg
861
/** Macro into which to wrap the format argument of a sscanf-like function. */
862
#define CPL_SCANF_FORMAT_STRING(arg) arg
863
#endif /* defined(_MSC_VER) && defined(GDAL_COMPILATION) */
864
865
#if defined(__GNUC__) && __GNUC__ >= 4 && !defined(DOXYGEN_SKIP)
866
/** Qualifier to warn when the return value of a function is not used */
867
#define CPL_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
868
#else
869
/** Qualifier to warn when the return value of a function is not used */
870
#define CPL_WARN_UNUSED_RESULT
871
#endif
872
873
#if defined(__GNUC__) && __GNUC__ >= 4
874
/** Qualifier for an argument that is unused */
875
#define CPL_UNUSED __attribute((__unused__))
876
#else
877
/* TODO: add cases for other compilers */
878
/** Qualifier for an argument that is unused */
879
#define CPL_UNUSED
880
#endif
881
882
#if defined(__GNUC__) && __GNUC__ >= 3 && !defined(DOXYGEN_SKIP)
883
/** Qualifier for a function that does not return at all (terminates the
884
 * process) */
885
#define CPL_NO_RETURN __attribute__((noreturn))
886
#else
887
/** Qualifier for a function that does not return at all (terminates the
888
 * process) */
889
#define CPL_NO_RETURN
890
#endif
891
892
/*! @cond Doxygen_Suppress */
893
/* Clang __has_attribute */
894
#ifndef __has_attribute
895
#define __has_attribute(x) 0  // Compatibility with non-clang compilers.
896
#endif
897
898
/*! @endcond */
899
900
#if ((defined(__GNUC__) &&                                                     \
901
      (__GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 9))) ||            \
902
     __has_attribute(returns_nonnull)) &&                                      \
903
    !defined(DOXYGEN_SKIP) && !defined(__INTEL_COMPILER)
904
/** Qualifier for a function that does not return NULL */
905
#define CPL_RETURNS_NONNULL __attribute__((returns_nonnull))
906
#else
907
/** Qualifier for a function that does not return NULL */
908
#define CPL_RETURNS_NONNULL
909
#endif
910
911
#if defined(__GNUC__) && __GNUC__ >= 4 && !defined(DOXYGEN_SKIP)
912
/** restrict keyword to declare that pointers do not alias */
913
#define CPL_RESTRICT __restrict__
914
#else
915
/** restrict keyword to declare that pointers do not alias */
916
#define CPL_RESTRICT
917
#endif
918
919
#if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS)
920
921
/** To be used in public headers only. For non-public headers or .cpp files,
922
 * use override directly. */
923
#define CPL_OVERRIDE override
924
925
/** C++11 final qualifier */
926
#define CPL_FINAL final
927
928
/** Mark that a class is explicitly recognized as non-final */
929
#define CPL_NON_FINAL
930
931
/** Helper to remove the copy and assignment constructors so that the compiler
932
   will not generate the default versions.
933
934
   Must be placed in the private section of a class and should be at the end.
935
*/
936
#define CPL_DISALLOW_COPY_ASSIGN(ClassName)                                    \
937
    ClassName(const ClassName &) = delete;                                     \
938
    ClassName &operator=(const ClassName &) = delete;
939
940
#endif /* __cplusplus */
941
942
#ifdef CPL_DISABLE_WARN_DEPRECATED
943
#define CPL_WARN_DEPRECATED(x)
944
#elif !defined(DOXYGEN_SKIP) && !defined(CPL_WARN_DEPRECATED)
945
#if defined(__has_extension)
946
#if __has_extension(attribute_deprecated_with_message)
947
/* Clang extension */
948
#define CPL_WARN_DEPRECATED(x) __attribute__((deprecated(x)))
949
#else
950
#define CPL_WARN_DEPRECATED(x)
951
#endif
952
#elif defined(__GNUC__)
953
#define CPL_WARN_DEPRECATED(x) __attribute__((deprecated))
954
#else
955
#define CPL_WARN_DEPRECATED(x)
956
#endif
957
#endif
958
959
#if !defined(_MSC_VER) && !defined(__APPLE__) && !defined(_FORTIFY_SOURCE)
960
CPL_C_START
961
#if defined(GDAL_COMPILATION) && defined(WARN_STANDARD_PRINTF)
962
int vsnprintf(char *str, size_t size, const char *fmt, va_list args)
963
    CPL_WARN_DEPRECATED("Use CPLvsnprintf() instead");
964
int snprintf(char *str, size_t size, const char *fmt, ...)
965
    CPL_PRINT_FUNC_FORMAT(3, 4)
966
        CPL_WARN_DEPRECATED("Use CPLsnprintf() instead");
967
int sprintf(char *str, const char *fmt, ...) CPL_PRINT_FUNC_FORMAT(2, 3)
968
    CPL_WARN_DEPRECATED("Use CPLsnprintf() instead");
969
#elif defined(GDAL_COMPILATION) && !defined(DONT_DEPRECATE_SPRINTF)
970
int sprintf(char *str, const char *fmt, ...) CPL_PRINT_FUNC_FORMAT(2, 3)
971
    CPL_WARN_DEPRECATED("Use snprintf() or CPLsnprintf() instead");
972
#endif /* defined(GDAL_COMPILATION) && defined(WARN_STANDARD_PRINTF) */
973
CPL_C_END
974
#endif /* !defined(_MSC_VER) && !defined(__APPLE__) */
975
976
#if defined(__cplusplus)
977
#ifndef CPPCHECK
978
/** Returns the size of C style arrays. */
979
#define CPL_ARRAYSIZE(array)                                                   \
980
2.15k
    ((sizeof(array) / sizeof(*(array))) /                                      \
981
2.15k
     static_cast<size_t>(!(sizeof(array) % sizeof(*(array)))))
982
#else
983
/* simplified version for cppcheck */
984
#define CPL_ARRAYSIZE(array) (sizeof(array) / sizeof(array[0]))
985
#endif
986
987
extern "C++"
988
{
989
    template <class T> static void CPL_IGNORE_RET_VAL(const T &)
990
5.42k
    {
991
5.42k
    }
cpl_error.cpp:void CPL_IGNORE_RET_VAL<int>(int const&)
Line
Count
Source
990
1.30k
    {
991
1.30k
    }
Unexecuted instantiation: cpl_string.cpp:void CPL_IGNORE_RET_VAL<int>(int const&)
Unexecuted instantiation: cpl_minixml.cpp:void CPL_IGNORE_RET_VAL<int>(int const&)
Unexecuted instantiation: cpl_vsil.cpp:void CPL_IGNORE_RET_VAL<char const* const*>(char const* const* const&)
cpl_vsil.cpp:void CPL_IGNORE_RET_VAL<int>(int const&)
Line
Count
Source
990
647
    {
991
647
    }
Unexecuted instantiation: cpl_vsi_mem.cpp:void CPL_IGNORE_RET_VAL<std::__1::shared_ptr<VSIMemFile> >(std::__1::shared_ptr<VSIMemFile> const&)
Unexecuted instantiation: cpl_vsil_sparsefile.cpp:void CPL_IGNORE_RET_VAL<int>(int const&)
cpl_vsil_tar.cpp:void CPL_IGNORE_RET_VAL<int>(int const&)
Line
Count
Source
990
960
    {
991
960
    }
cpl_vsil_gzip.cpp:void CPL_IGNORE_RET_VAL<int>(int const&)
Line
Count
Source
990
298
    {
991
298
    }
Unexecuted instantiation: cpl_vsil_gzip.cpp:void CPL_IGNORE_RET_VAL<unsigned long>(unsigned long const&)
cpl_vsil_gzip.cpp:void CPL_IGNORE_RET_VAL<char const*>(char const* const&)
Line
Count
Source
990
2.20k
    {
991
2.20k
    }
Unexecuted instantiation: cpl_minizip_unzip.cpp:void CPL_IGNORE_RET_VAL<long>(long const&)
Unexecuted instantiation: ogrlinestring.cpp:void CPL_IGNORE_RET_VAL<OGRPoint const*>(OGRPoint const* const&)
Unexecuted instantiation: ogrfeaturestyle.cpp:void CPL_IGNORE_RET_VAL<int>(int const&)
Unexecuted instantiation: ogrspatialreference.cpp:void CPL_IGNORE_RET_VAL<OGRSpatialReference::Private::OptionalLockGuard>(OGRSpatialReference::Private::OptionalLockGuard const&)
Unexecuted instantiation: ogrspatialreference.cpp:void CPL_IGNORE_RET_VAL<CPLErrorAccumulator::Context>(CPLErrorAccumulator::Context const&)
Unexecuted instantiation: ogrspatialreference.cpp:void CPL_IGNORE_RET_VAL<int>(int const&)
Unexecuted instantiation: ogrspatialreference.cpp:void CPL_IGNORE_RET_VAL<char const* const*>(char const* const* const&)
Unexecuted instantiation: ogrspatialreference.cpp:void CPL_IGNORE_RET_VAL<char**>(char** const&)
Unexecuted instantiation: ogr2gmlgeometry.cpp:void CPL_IGNORE_RET_VAL<bool>(bool const&)
Unexecuted instantiation: gml2ogrgeometry.cpp:void CPL_IGNORE_RET_VAL<int>(int const&)
Unexecuted instantiation: ograpispy.cpp:void CPL_IGNORE_RET_VAL<int>(int const&)
Unexecuted instantiation: ogr_wkb.cpp:void CPL_IGNORE_RET_VAL<bool>(bool const&)
Unexecuted instantiation: ogr2kmlgeometry.cpp:void CPL_IGNORE_RET_VAL<unsigned long>(unsigned long const&)
Unexecuted instantiation: ogrgeojsonseqdriver.cpp:void CPL_IGNORE_RET_VAL<bool>(bool const&)
Unexecuted instantiation: ogrlayer.cpp:void CPL_IGNORE_RET_VAL<OGRFeature*>(OGRFeature* const&)
Unexecuted instantiation: ogrlayerarrow.cpp:void CPL_IGNORE_RET_VAL<bool>(bool const&)
Unexecuted instantiation: ogrlayerarrow.cpp:void CPL_IGNORE_RET_VAL<unsigned long>(unsigned long const&)
Unexecuted instantiation: ogrlayerarrow.cpp:void CPL_IGNORE_RET_VAL<char const*>(char const* const&)
Unexecuted instantiation: gdal_misc.cpp:void CPL_IGNORE_RET_VAL<int>(int const&)
Unexecuted instantiation: gdal_misc.cpp:void CPL_IGNORE_RET_VAL<unsigned long>(unsigned long const&)
Unexecuted instantiation: gdalopeninfo.cpp:void CPL_IGNORE_RET_VAL<int>(int const&)
Unexecuted instantiation: gdaldriver.cpp:void CPL_IGNORE_RET_VAL<int>(int const&)
Unexecuted instantiation: gdaldriver.cpp:void CPL_IGNORE_RET_VAL<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)
Unexecuted instantiation: gdaldrivermanager.cpp:void CPL_IGNORE_RET_VAL<char const*>(char const* const&)
Unexecuted instantiation: gdaldataset.cpp:void CPL_IGNORE_RET_VAL<int>(int const&)
Unexecuted instantiation: gdaldataset.cpp:void CPL_IGNORE_RET_VAL<GDALDataset::RawBinaryLayout>(GDALDataset::RawBinaryLayout const&)
Unexecuted instantiation: gdalrasterband.cpp:void CPL_IGNORE_RET_VAL<long>(long const&)
Unexecuted instantiation: gdalrasterband.cpp:void CPL_IGNORE_RET_VAL<unsigned long>(unsigned long const&)
Unexecuted instantiation: gdalrasterband.cpp:void CPL_IGNORE_RET_VAL<signed char>(signed char const&)
Unexecuted instantiation: gdalrasterband.cpp:void CPL_IGNORE_RET_VAL<unsigned char>(unsigned char const&)
Unexecuted instantiation: gdalrasterband.cpp:void CPL_IGNORE_RET_VAL<short>(short const&)
Unexecuted instantiation: gdalrasterband.cpp:void CPL_IGNORE_RET_VAL<unsigned short>(unsigned short const&)
Unexecuted instantiation: gdalrasterband.cpp:void CPL_IGNORE_RET_VAL<int>(int const&)
Unexecuted instantiation: gdalrasterband.cpp:void CPL_IGNORE_RET_VAL<unsigned int>(unsigned int const&)
Unexecuted instantiation: gdalrasterband.cpp:void CPL_IGNORE_RET_VAL<cpl::Float16>(cpl::Float16 const&)
Unexecuted instantiation: gdalrasterband.cpp:void CPL_IGNORE_RET_VAL<float>(float const&)
Unexecuted instantiation: gdalrasterband.cpp:void CPL_IGNORE_RET_VAL<double>(double const&)
Unexecuted instantiation: gdaldefaultoverviews.cpp:void CPL_IGNORE_RET_VAL<int>(int const&)
Unexecuted instantiation: gdalpamproxydb.cpp:void CPL_IGNORE_RET_VAL<int>(int const&)
Unexecuted instantiation: gdalvirtualmem.cpp:void CPL_IGNORE_RET_VAL<CPLErr>(CPLErr const&)
Unexecuted instantiation: gdalthreadsafedataset.cpp:void CPL_IGNORE_RET_VAL<lru11::Cache<GDALThreadSafeDataset const*, std::__1::shared_ptr<GDALDataset>, lru11::NullLock, std::__1::unordered_map<GDALThreadSafeDataset const*, std::__1::__list_iterator<lru11::KeyValuePair<GDALThreadSafeDataset const*, std::__1::shared_ptr<GDALDataset> >, void*>, std::__1::hash<GDALThreadSafeDataset const*>, std::__1::equal_to<GDALThreadSafeDataset const*>, std::__1::allocator<std::__1::pair<GDALThreadSafeDataset const* const, std::__1::__list_iterator<lru11::KeyValuePair<GDALThreadSafeDataset const*, std::__1::shared_ptr<GDALDataset> >, void*> > > > >*>(lru11::Cache<GDALThreadSafeDataset const*, std::__1::shared_ptr<GDALDataset>, lru11::NullLock, std::__1::unordered_map<GDALThreadSafeDataset const*, std::__1::__list_iterator<lru11::KeyValuePair<GDALThreadSafeDataset const*, std::__1::shared_ptr<GDALDataset> >, void*>, std::__1::hash<GDALThreadSafeDataset const*>, std::__1::equal_to<GDALThreadSafeDataset const*>, std::__1::allocator<std::__1::pair<GDALThreadSafeDataset const* const, std::__1::__list_iterator<lru11::KeyValuePair<GDALThreadSafeDataset const*, std::__1::shared_ptr<GDALDataset> >, void*> > > > >* const&)
Unexecuted instantiation: gdalthreadsafedataset.cpp:void CPL_IGNORE_RET_VAL<char const* const*>(char const* const* const&)
Unexecuted instantiation: overview.cpp:void CPL_IGNORE_RET_VAL<char const* const*>(char const* const* const&)
Unexecuted instantiation: rasterio.cpp:void CPL_IGNORE_RET_VAL<CPLErr>(CPLErr const&)
Unexecuted instantiation: rasterio.cpp:void CPL_IGNORE_RET_VAL<int (*)(double, char const*, void*)>(int (* const&)(double, char const*, void*))
Unexecuted instantiation: gdalmultidim.cpp:void CPL_IGNORE_RET_VAL<bool>(bool const&)
Unexecuted instantiation: gdalmultidim.cpp:void CPL_IGNORE_RET_VAL<CPLErr>(CPLErr const&)
Unexecuted instantiation: gdalmultidim.cpp:void CPL_IGNORE_RET_VAL<CPLErrorAccumulator::Context>(CPLErrorAccumulator::Context const&)
Unexecuted instantiation: gdalmultidim_gridded.cpp:void CPL_IGNORE_RET_VAL<int>(int const&)
Unexecuted instantiation: gdalmultidim_gltorthorectification.cpp:void CPL_IGNORE_RET_VAL<bool>(bool const&)
Unexecuted instantiation: gdalpythondriverloader.cpp:void CPL_IGNORE_RET_VAL<bool>(bool const&)
Unexecuted instantiation: gdal_translate_lib.cpp:void CPL_IGNORE_RET_VAL<double>(double const&)
Unexecuted instantiation: gdalwarp_lib.cpp:void CPL_IGNORE_RET_VAL<GDALDataset*>(GDALDataset* const&)
Unexecuted instantiation: cpl_spawn.cpp:void CPL_IGNORE_RET_VAL<int>(int const&)
Unexecuted instantiation: cpl_virtualmem.cpp:void CPL_IGNORE_RET_VAL<int>(int const&)
cpl_cpu_features.cpp:void CPL_IGNORE_RET_VAL<unsigned int>(unsigned int const&)
Line
Count
Source
990
6
    {
991
6
    }
Unexecuted instantiation: cpl_json.cpp:void CPL_IGNORE_RET_VAL<bool>(bool const&)
Unexecuted instantiation: gdalgrid.cpp:void CPL_IGNORE_RET_VAL<unsigned int>(unsigned int const&)
Unexecuted instantiation: gdalgrid.cpp:void CPL_IGNORE_RET_VAL<char const*>(char const* const&)
Unexecuted instantiation: gdalwarpkernel.cpp:void CPL_IGNORE_RET_VAL<bool>(bool const&)
Unexecuted instantiation: gdalwarpoperation.cpp:void CPL_IGNORE_RET_VAL<CPLErrorAccumulator::Context>(CPLErrorAccumulator::Context const&)
Unexecuted instantiation: gdalwarpoperation.cpp:void CPL_IGNORE_RET_VAL<unsigned long>(unsigned long const&)
Unexecuted instantiation: gnmgenericnetwork.cpp:void CPL_IGNORE_RET_VAL<int>(int const&)
Unexecuted instantiation: geotiff.cpp:void CPL_IGNORE_RET_VAL<int>(int const&)
Unexecuted instantiation: gt_overview.cpp:void CPL_IGNORE_RET_VAL<int>(int const&)
Unexecuted instantiation: gt_wkt_srs.cpp:void CPL_IGNORE_RET_VAL<int>(int const&)
Unexecuted instantiation: tifvsi.cpp:void CPL_IGNORE_RET_VAL<int>(int const&)
Unexecuted instantiation: vrtsourcedrasterband.cpp:void CPL_IGNORE_RET_VAL<CPLErrorAccumulator::Context>(CPLErrorAccumulator::Context const&)
Unexecuted instantiation: vrtsourcedrasterband.cpp:void CPL_IGNORE_RET_VAL<double>(double const&)
Unexecuted instantiation: vrtwarped.cpp:void CPL_IGNORE_RET_VAL<double>(double const&)
Unexecuted instantiation: vrtdataset.cpp:void CPL_IGNORE_RET_VAL<int>(int const&)
Unexecuted instantiation: vrtdataset.cpp:void CPL_IGNORE_RET_VAL<CPLErrorAccumulator::Context>(CPLErrorAccumulator::Context const&)
Unexecuted instantiation: vrtdataset.cpp:void CPL_IGNORE_RET_VAL<std::__1::unique_ptr<std::__1::lock_guard<std::__1::mutex>, std::__1::default_delete<std::__1::lock_guard<std::__1::mutex> > > >(std::__1::unique_ptr<std::__1::lock_guard<std::__1::mutex>, std::__1::default_delete<std::__1::lock_guard<std::__1::mutex> > > const&)
Unexecuted instantiation: vrtprocesseddataset.cpp:void CPL_IGNORE_RET_VAL<CPLErr>(CPLErr const&)
Unexecuted instantiation: vrtprocesseddatasetfunctions.cpp:void CPL_IGNORE_RET_VAL<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)
Unexecuted instantiation: vrtprocesseddatasetfunctions.cpp:void CPL_IGNORE_RET_VAL<GDALDataType>(GDALDataType const&)
Unexecuted instantiation: vrtprocesseddatasetfunctions.cpp:void CPL_IGNORE_RET_VAL<unsigned long>(unsigned long const&)
Unexecuted instantiation: vrtprocesseddatasetfunctions.cpp:void CPL_IGNORE_RET_VAL<int>(int const&)
Unexecuted instantiation: vrtprocesseddatasetfunctions.cpp:void CPL_IGNORE_RET_VAL<CPLErr>(CPLErr const&)
Unexecuted instantiation: vrtprocesseddatasetfunctions.cpp:void CPL_IGNORE_RET_VAL<bool>(bool const&)
Unexecuted instantiation: vrtprocesseddatasetfunctions.cpp:void CPL_IGNORE_RET_VAL<GDALRIOResampleAlg>(GDALRIOResampleAlg const&)
Unexecuted instantiation: ogrgeojsondatasource.cpp:void CPL_IGNORE_RET_VAL<int>(int const&)
Unexecuted instantiation: ogrgeojsonlayer.cpp:void CPL_IGNORE_RET_VAL<int>(int const&)
Unexecuted instantiation: ogrshapedatasource.cpp:void CPL_IGNORE_RET_VAL<bool>(bool const&)
Unexecuted instantiation: ogrshapelayer.cpp:void CPL_IGNORE_RET_VAL<bool>(bool const&)
Unexecuted instantiation: ogrlayerpool.cpp:void CPL_IGNORE_RET_VAL<int>(int const&)
Unexecuted instantiation: gdalalgorithm.cpp:void CPL_IGNORE_RET_VAL<GDALAlgorithmArg*>(GDALAlgorithmArg* const&)
Unexecuted instantiation: gdalalgorithm.cpp:void CPL_IGNORE_RET_VAL<bool>(bool const&)
Unexecuted instantiation: gdalcomputedrasterband.cpp:void CPL_IGNORE_RET_VAL<char const*>(char const* const&)
Unexecuted instantiation: rawdataset.cpp:void CPL_IGNORE_RET_VAL<int>(int const&)
Unexecuted instantiation: ogr2ogr_lib.cpp:void CPL_IGNORE_RET_VAL<int>(int const&)
Unexecuted instantiation: gdalapplyverticalshiftgrid.cpp:void CPL_IGNORE_RET_VAL<CPLErr>(CPLErr const&)
Unexecuted instantiation: gdalpansharpen.cpp:void CPL_IGNORE_RET_VAL<CPLErr>(CPLErr const&)
Unexecuted instantiation: gtiffdataset.cpp:void CPL_IGNORE_RET_VAL<bool>(bool const&)
Unexecuted instantiation: gtiffdataset_read.cpp:void CPL_IGNORE_RET_VAL<int>(int const&)
Unexecuted instantiation: gtiffdataset_read.cpp:void CPL_IGNORE_RET_VAL<bool>(bool const&)
Unexecuted instantiation: gtiffdataset_read.cpp:void CPL_IGNORE_RET_VAL<CPLErrorAccumulator::Context>(CPLErrorAccumulator::Context const&)
Unexecuted instantiation: gtiffdataset_write.cpp:void CPL_IGNORE_RET_VAL<int>(int const&)
Unexecuted instantiation: gtiffjpegoverviewds.cpp:void CPL_IGNORE_RET_VAL<int>(int const&)
Unexecuted instantiation: gtiffrasterband_write.cpp:void CPL_IGNORE_RET_VAL<double>(double const&)
Unexecuted instantiation: gtiffrasterband_write.cpp:void CPL_IGNORE_RET_VAL<long>(long const&)
Unexecuted instantiation: gtiffrasterband_write.cpp:void CPL_IGNORE_RET_VAL<unsigned long>(unsigned long const&)
Unexecuted instantiation: gt_citation.cpp:void CPL_IGNORE_RET_VAL<int>(int const&)
Unexecuted instantiation: vrtderivedrasterband.cpp:void CPL_IGNORE_RET_VAL<CPLErr>(CPLErr const&)
Unexecuted instantiation: gdalexif.cpp:void CPL_IGNORE_RET_VAL<int>(int const&)
Unexecuted instantiation: gdalexif.cpp:void CPL_IGNORE_RET_VAL<unsigned long>(unsigned long const&)
Unexecuted instantiation: gdal_mdreader.cpp:void CPL_IGNORE_RET_VAL<int>(int const&)
992
993
    inline static bool CPL_TO_BOOL(int x)
994
440k
    {
995
440k
        return x != 0;
996
440k
    }
Unexecuted instantiation: cpl_conv.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: cpl_error.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: cpl_string.cpp:CPL_TO_BOOL(int)
cplstringlist.cpp:CPL_TO_BOOL(int)
Line
Count
Source
994
13.6k
    {
995
13.6k
        return x != 0;
996
13.6k
    }
Unexecuted instantiation: cpl_strtod.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: cpl_path.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: cpl_minixml.cpp:CPL_TO_BOOL(int)
cpl_multiproc.cpp:CPL_TO_BOOL(int)
Line
Count
Source
994
416k
    {
995
416k
        return x != 0;
996
416k
    }
Unexecuted instantiation: cplstring.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: cpl_vsisimple.cpp:CPL_TO_BOOL(int)
cpl_vsil.cpp:CPL_TO_BOOL(int)
Line
Count
Source
994
5.01k
    {
995
5.01k
        return x != 0;
996
5.01k
    }
cpl_vsi_mem.cpp:CPL_TO_BOOL(int)
Line
Count
Source
994
5.76k
    {
995
5.76k
        return x != 0;
996
5.76k
    }
Unexecuted instantiation: cpl_recode.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: cpl_recode_stub.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: cpl_atomic_ops.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: cpl_vsil_subfile.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: cpl_vsil_stdout.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: cpl_vsil_sparsefile.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: cpl_vsil_tar.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: cpl_vsil_stdin.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: cpl_vsil_curl.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: cpl_vsil_cache.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: cpl_progress.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: cpl_vsil_crypt.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: cpl_vsi_error.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: cpl_vsil_hdfs.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: cpl_vsil_unix_stdio_64.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: cpl_vsil_gzip.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: cpl_minizip_unzip.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: cpl_minizip_zip.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: cpl_recode_iconv.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: contour.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogrgeometryfactory.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogrpoint.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogrcurve.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogrlinestring.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogrlinearring.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogrpolygon.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogrtriangle.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogrutils.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogrgeometry.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogrgeometrycollection.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogrmultipolygon.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogrsurface.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogrpolyhedralsurface.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogrtriangulatedsurface.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogrmultipoint.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogrmultilinestring.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogrcircularstring.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogrcompoundcurve.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogrcurvepolygon.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogrcurvecollection.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogrmulticurve.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogrmultisurface.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogr_api.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogrfeature.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogrfeaturedefn.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogrfeaturestyle.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogrfielddefn.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogrspatialreference.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogr_srsnode.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogrct.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogr_srs_dict.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogr_srs_xml.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogr2gmlgeometry.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gml2ogrgeometry.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogrgeomfielddefn.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ograpispy.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogr_geo_utils.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogr_proj_p.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogr_wkb.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogr2kmlgeometry.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogrlibjsonutils.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogrgeojsongeometry.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogrgeojsonwriter.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogrmitabspatialref.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: mitab_bounds.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdalallregister.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogrregisterall.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogrgeojsondriver.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogrgeojsonseqdriver.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogresrijsondriver.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogrtopojsondriver.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogrshapedriver.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogrsfdriverregistrar.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogrlayer.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogrlayerarrow.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogrdatasource.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogrsfdriver.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ograrrowarrayhelper.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdal_misc.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdalopeninfo.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdaldriver.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdaldrivermanager.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdaldataset.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdalrasterband.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdalrasterblock.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdalcolortable.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdalmajorobject.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdaldefaultoverviews.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdalmultidomainmetadata.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdalpamproxydb.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdalallvalidmaskband.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdalnodatamaskband.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdalnodatavaluesmaskband.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdalproxypool.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdaldefaultasync.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdaldllmain.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdalvirtualmem.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdaloverviewdataset.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdalrescaledalphaband.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdalabstractbandblockcache.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdalarraybandblockcache.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdalhashsetbandblockcache.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdalsubdatasetinfo.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdalthreadsafedataset.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: overview.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: rasterio.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdalmultidim.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdalmultidim_gridded.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdalmultidim_gltorthorectification.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdalmultidim_meshgrid.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdalmultidim_subsetdimension.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdalpython.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdalpythondriverloader.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdal_thread_pool.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdal_translate_lib.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdalwarp_lib.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: commonutils.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: cplgetsymbol.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: cpl_csv.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: cpl_findfile.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: cpl_http.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: cpl_hash_set.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: cpl_time.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: cpl_vsil_abstract_archive.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: cpl_vsil_buffered_reader.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: cpl_base64.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: cpl_spawn.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: cpl_virtualmem.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: cpl_worker_thread_pool.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: cpl_cpu_features.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: cpl_json.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: cpl_compressor.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: cpl_float.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: cpl_minizip_ioapi.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdalgeoloc.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdalgeolocquadtree.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdalgrid.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdaltransformer.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdalwarper.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdalwarpkernel.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdalwarpoperation.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: rasterfill.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdal_interpolateatpoint.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdalgridsse.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdalgridavx.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogrgeomcoordinateprecision.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogrfeaturequery.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogr_srs_ozi.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: swq.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: swq_expr_node.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: swq_parser.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: swq_select.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: swq_op_registrar.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: swq_op_general.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gnmregisterall.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gnmdbdriver.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gnmdbnetwork.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gnmfiledriver.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gnmfilenetwork.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gnmlayer.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gnmgenericnetwork.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gnmgraph.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gnmnetwork.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gnmresultlayer.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gnmrule.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: cogdriver.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: geotiff.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gt_overview.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gt_wkt_srs.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: tifvsi.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: memdataset.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogrmemlayer.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: vrtdriver.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: vrtfilters.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: vrtrasterband.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: vrtsourcedrasterband.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: vrtsources.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: vrtwarped.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: vrtdataset.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: pixelfunctions.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: vrtpansharpened.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: vrtprocesseddataset.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: vrtprocesseddatasetfunctions.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: vrtmultidim.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: vrtreclassifier.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: vrtrawrasterband.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogrgeojsondatasource.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogrgeojsonlayer.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogrgeojsonreader.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogrgeojsonutils.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogrgeojsonwritelayer.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogresrijsonreader.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogrtopojsonreader.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogrjsoncollectionstreamingparser.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogrshapedatasource.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogrshapelayer.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: sbnsearch_wrapper.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: shpopen_wrapper.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: shptree_wrapper.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: dbfopen_wrapper.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogr_gensql.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogrunionlayer.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogrlayerpool.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: rasterio_ssse3.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdalalgorithm.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdalalgorithmregistry.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdalcomputedrasterband.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdalpamdataset.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdalpamrasterband.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdal_rat.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdalproxydataset.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: rawdataset.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: tilematrixset.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: tiff_common.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdalargumentparser.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdalalg_main.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdalbuildvrt_lib.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogr2ogr_lib.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: cpl_levenshtein.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: cpl_list.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: cpl_quad_tree.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: cpl_json_streaming_parser.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: cpl_vax.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdal_crs.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdal_homography.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdal_rpc.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdal_tps.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdalapplyverticalshiftgrid.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdalcutline.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdallinearsystem.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdalpansharpen.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdalrasterize.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: llrasterize.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: thinplatespline.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogr_fromepsg.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogr_srs_esri.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogr_schema_override.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogresrijsongeometry.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gtiffdataset.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gtiffdataset_read.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gtiffdataset_write.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gtiffjpegoverviewds.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gtiffoddbitsband.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gtiffrasterband.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gtiffrasterband_read.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gtiffrasterband_write.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gtiffrgbaband.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gtiffsplitband.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gtiffsplitbitmapband.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gt_citation.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: vrtderivedrasterband.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: shape2ogr.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: shp_vsi.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogrwarpedlayer.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogrlayerdecorator.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogrlayerwithtranslatefeature.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdal_rat_vat_dbf.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdalexif.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gdal_mdreader.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: reader_alos.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: reader_digital_globe.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: reader_eros.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: reader_geo_eye.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: reader_kompsat.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: reader_landsat.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: reader_orb_view.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: reader_pleiades.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: reader_rapid_eye.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: reader_rdk1.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: reader_spot.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: cplkeywordparser.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: cpl_md5.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: ogrpgeogeometry.cpp:CPL_TO_BOOL(int)
Unexecuted instantiation: gtiffbitmapband.cpp:CPL_TO_BOOL(int)
997
} /* extern "C++" */
998
999
#endif /* __cplusplus */
1000
1001
#if (((__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) ||              \
1002
      (defined(__clang__) && __clang_major__ >= 3)) &&                         \
1003
     !defined(_MSC_VER))
1004
#define HAVE_GCC_DIAGNOSTIC_PUSH
1005
#endif
1006
1007
#if ((__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)) &&               \
1008
     !defined(_MSC_VER))
1009
#define HAVE_GCC_SYSTEM_HEADER
1010
#endif
1011
1012
/*! @cond Doxygen_Suppress */
1013
1014
#ifndef FALSE
1015
677k
#define FALSE 0
1016
#endif
1017
1018
#ifndef TRUE
1019
461k
#define TRUE 1
1020
#endif
1021
1022
#if __clang_major__ >= 4 || (__clang_major__ == 3 && __clang_minor__ >= 8)
1023
#define CPL_NOSANITIZE_UNSIGNED_INT_OVERFLOW                                   \
1024
    __attribute__((no_sanitize("unsigned-integer-overflow")))
1025
#else
1026
#define CPL_NOSANITIZE_UNSIGNED_INT_OVERFLOW
1027
#endif
1028
1029
#if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS) &&                 \
1030
    defined(GDAL_COMPILATION)
1031
extern "C++"
1032
{
1033
    template <class C, class A, class B>
1034
    CPL_NOSANITIZE_UNSIGNED_INT_OVERFLOW inline C CPLUnsanitizedAdd(A a, B b)
1035
0
    {
1036
0
        return a + b;
1037
0
    }
1038
}
1039
#endif
1040
1041
#if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS)
1042
51.8k
#define CPL_NULLPTR nullptr
1043
#else
1044
#define CPL_NULLPTR NULL
1045
#endif
1046
1047
#if defined(__cplusplus) && defined(GDAL_COMPILATION)
1048
extern "C++"
1049
{
1050
    namespace cpl
1051
    {
1052
    /** Function to indicate that the result of an arithmetic operation
1053
         * does fit on the specified type. Typically used to avoid warnings
1054
         * about potentially overflowing multiplications by static analyzers.
1055
         */
1056
    template <typename T> inline T fits_on(T t)
1057
0
    {
1058
0
        return t;
1059
0
    }
1060
1061
    /** Emulates the C++20 .contains() method */
1062
    template <typename C, typename V>
1063
    inline bool contains(const C &container, const V &value)
1064
13.6k
    {
1065
13.6k
        return container.find(value) != container.end();
1066
13.6k
    }
bool cpl::contains<std::__1::set<CPLString, std::__1::less<CPLString>, std::__1::allocator<CPLString> >, CPLString>(std::__1::set<CPLString, std::__1::less<CPLString>, std::__1::allocator<CPLString> > const&, CPLString const&)
Line
Count
Source
1064
13.6k
    {
1065
13.6k
        return container.find(value) != container.end();
1066
13.6k
    }
Unexecuted instantiation: bool cpl::contains<std::__1::set<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >, char*>(std::__1::set<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, char* const&)
Unexecuted instantiation: bool cpl::contains<std::__1::map<int, std::__1::set<int, std::__1::less<int>, std::__1::allocator<int> >, std::__1::less<int>, std::__1::allocator<std::__1::pair<int const, std::__1::set<int, std::__1::less<int>, std::__1::allocator<int> > > > >, int>(std::__1::map<int, std::__1::set<int, std::__1::less<int>, std::__1::allocator<int> >, std::__1::less<int>, std::__1::allocator<std::__1::pair<int const, std::__1::set<int, std::__1::less<int>, std::__1::allocator<int> > > > > const&, int const&)
Unexecuted instantiation: bool cpl::contains<std::__1::set<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >, CPLString>(std::__1::set<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, CPLString const&)
Unexecuted instantiation: bool cpl::contains<std::__1::set<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::set<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)
Unexecuted instantiation: bool cpl::contains<std::__1::map<CPLString, GDALDriver*, std::__1::less<CPLString>, std::__1::allocator<std::__1::pair<CPLString const, GDALDriver*> > >, CPLString>(std::__1::map<CPLString, GDALDriver*, std::__1::less<CPLString>, std::__1::allocator<std::__1::pair<CPLString const, GDALDriver*> > > const&, CPLString const&)
Unexecuted instantiation: bool cpl::contains<std::__1::map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::unique_ptr<GDALDriver, std::__1::default_delete<GDALDriver> >, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::unique_ptr<GDALDriver, std::__1::default_delete<GDALDriver> > > > >, char const*>(std::__1::map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::unique_ptr<GDALDriver, std::__1::default_delete<GDALDriver> >, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::unique_ptr<GDALDriver, std::__1::default_delete<GDALDriver> > > > > const&, char const* const&)
Unexecuted instantiation: bool cpl::contains<std::__1::set<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >, char const*>(std::__1::set<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, char const* const&)
Unexecuted instantiation: bool cpl::contains<std::__1::set<GDALAntiRecursionStruct::DatasetContext, GDALAntiRecursionStruct::DatasetContextCompare, std::__1::allocator<GDALAntiRecursionStruct::DatasetContext> >, GDALAntiRecursionStruct::DatasetContext>(std::__1::set<GDALAntiRecursionStruct::DatasetContext, GDALAntiRecursionStruct::DatasetContextCompare, std::__1::allocator<GDALAntiRecursionStruct::DatasetContext> > const&, GDALAntiRecursionStruct::DatasetContext const&)
Unexecuted instantiation: bool cpl::contains<std::__1::map<GDALThreadSafeDataset const*, GDALThreadLocalDatasetCache::SharedPtrDatasetThreadLocalConfigOptionsPair, std::__1::less<GDALThreadSafeDataset const*>, std::__1::allocator<std::__1::pair<GDALThreadSafeDataset const* const, GDALThreadLocalDatasetCache::SharedPtrDatasetThreadLocalConfigOptionsPair> > >, GDALThreadSafeDataset const*>(std::__1::map<GDALThreadSafeDataset const*, GDALThreadLocalDatasetCache::SharedPtrDatasetThreadLocalConfigOptionsPair, std::__1::less<GDALThreadSafeDataset const*>, std::__1::allocator<std::__1::pair<GDALThreadSafeDataset const* const, GDALThreadLocalDatasetCache::SharedPtrDatasetThreadLocalConfigOptionsPair> > > const&, GDALThreadSafeDataset const* const&)
Unexecuted instantiation: bool cpl::contains<std::__1::map<GDALRasterBand*, GDALDataset*, std::__1::less<GDALRasterBand*>, std::__1::allocator<std::__1::pair<GDALRasterBand* const, GDALDataset*> > >, GDALRasterBand*>(std::__1::map<GDALRasterBand*, GDALDataset*, std::__1::less<GDALRasterBand*>, std::__1::allocator<std::__1::pair<GDALRasterBand* const, GDALDataset*> > > const&, GDALRasterBand* const&)
Unexecuted instantiation: bool cpl::contains<std::__1::map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<GDALDimension>, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::shared_ptr<GDALDimension> > > >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<GDALDimension>, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::shared_ptr<GDALDimension> > > > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)
Unexecuted instantiation: bool cpl::contains<std::__1::map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)
Unexecuted instantiation: bool cpl::contains<std::__1::set<CPLString, swq_summary::Comparator, std::__1::allocator<CPLString> >, char const*>(std::__1::set<CPLString, swq_summary::Comparator, std::__1::allocator<CPLString> > const&, char const* const&)
Unexecuted instantiation: bool cpl::contains<std::__1::set<long long, std::__1::less<long long>, std::__1::allocator<long long> >, long long>(std::__1::set<long long, std::__1::less<long long>, std::__1::allocator<long long> > const&, long long const&)
Unexecuted instantiation: bool cpl::contains<std::__1::map<long long, std::__1::pair<unsigned long long, unsigned long long>, std::__1::less<long long>, std::__1::allocator<std::__1::pair<long long const, std::__1::pair<unsigned long long, unsigned long long> > > >, long long>(std::__1::map<long long, std::__1::pair<unsigned long long, unsigned long long>, std::__1::less<long long>, std::__1::allocator<std::__1::pair<long long const, std::__1::pair<unsigned long long, unsigned long long> > > > const&, long long const&)
Unexecuted instantiation: bool cpl::contains<std::__1::set<int, std::__1::less<int>, std::__1::allocator<int> >, int>(std::__1::set<int, std::__1::less<int>, std::__1::allocator<int> > const&, int const&)
Unexecuted instantiation: bool cpl::contains<std::__1::map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, int, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, int> > >, char*>(std::__1::map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, int, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, int> > > const&, char* const&)
Unexecuted instantiation: bool cpl::contains<std::__1::map<GDALAlgorithmArg*, std::__1::variant<std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >, std::__1::vector<int, std::__1::allocator<int> >, std::__1::vector<double, std::__1::allocator<double> >, std::__1::vector<GDALArgDatasetValue, std::__1::allocator<GDALArgDatasetValue> > >, std::__1::less<GDALAlgorithmArg*>, std::__1::allocator<std::__1::pair<GDALAlgorithmArg* const, std::__1::variant<std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >, std::__1::vector<int, std::__1::allocator<int> >, std::__1::vector<double, std::__1::allocator<double> >, std::__1::vector<GDALArgDatasetValue, std::__1::allocator<GDALArgDatasetValue> > > > > >, GDALAlgorithmArg*>(std::__1::map<GDALAlgorithmArg*, std::__1::variant<std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >, std::__1::vector<int, std::__1::allocator<int> >, std::__1::vector<double, std::__1::allocator<double> >, std::__1::vector<GDALArgDatasetValue, std::__1::allocator<GDALArgDatasetValue> > >, std::__1::less<GDALAlgorithmArg*>, std::__1::allocator<std::__1::pair<GDALAlgorithmArg* const, std::__1::variant<std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >, std::__1::vector<int, std::__1::allocator<int> >, std::__1::vector<double, std::__1::allocator<double> >, std::__1::vector<GDALArgDatasetValue, std::__1::allocator<GDALArgDatasetValue> > > > > > const&, GDALAlgorithmArg* const&)
Unexecuted instantiation: bool cpl::contains<std::__1::map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, GDALAlgorithmArg*, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, GDALAlgorithmArg*> > >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, GDALAlgorithmArg*, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, GDALAlgorithmArg*> > > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)
Unexecuted instantiation: bool cpl::contains<std::__1::map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, GDALAlgorithmRegistry::AlgInfo, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, GDALAlgorithmRegistry::AlgInfo> > >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, GDALAlgorithmRegistry::AlgInfo, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, GDALAlgorithmRegistry::AlgInfo> > > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)
1067
1068
    }  // namespace cpl
1069
}
1070
#endif
1071
1072
/*! @endcond */
1073
1074
/* This typedef is for C functions that take char** as argument, but */
1075
/* with the semantics of a const list. In C, char** is not implicitly cast to */
1076
/* const char* const*, contrary to C++. So when seen for C++, it is OK */
1077
/* to expose the prototypes as const char* const*, but for C we keep the */
1078
/* historical definition to avoid warnings. */
1079
#if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS) &&                 \
1080
    !defined(DOXYGEN_SKIP)
1081
/** Type of a constant null-terminated list of nul terminated strings.
1082
 * Seen as char** from C and const char* const* from C++ */
1083
typedef const char *const *CSLConstList;
1084
#else
1085
/** Type of a constant null-terminated list of nul terminated strings.
1086
 * Seen as char** from C and const char* const* from C++ */
1087
typedef char **CSLConstList;
1088
#endif
1089
1090
#if defined(__cplusplus) && defined(GDAL_COMPILATION)
1091
#if defined(__GNUC__) && !defined(DOXYGEN_SKIP)
1092
/** Macro that evaluates to (cond), and possibly gives a hint to the compiler
1093
 * than (cond) is unlikely to be true.
1094
 */
1095
0
#define CPL_UNLIKELY(cond) __builtin_expect(static_cast<bool>(cond), 0)
1096
#else
1097
#define CPL_UNLIKELY(cond) (cond)
1098
#endif
1099
#endif
1100
1101
#endif /* ndef CPL_BASE_H_INCLUDED */