Skip to content

Commit f8df074

Browse files
committed
fix: all codespell errors
1 parent 23f595d commit f8df074

27 files changed

Lines changed: 3638 additions & 3245 deletions

ucm/store/compress/cc/compress_lib/bitstream.h

Lines changed: 157 additions & 148 deletions
Large diffs are not rendered by default.
Lines changed: 73 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016-2020, Yann Collet, Facebook, Inc.
2+
* Copyright (c) 2016-2020, Yann Collect, Facebook, Inc.
33
* All rights reserved.
44
*
55
* This source code is licensed under both the BSD-style license (found in the
@@ -12,23 +12,24 @@
1212
#define ZSTD_COMPILER_H
1313

1414
/*-*******************************************************
15-
* Compiler specifics
16-
*********************************************************/
15+
* Compiler specifics
16+
*********************************************************/
1717
/* force inlining */
1818

1919
#if !defined(ZSTD_NO_INLINE)
20-
#if (defined(__GNUC__) && !defined(__STRICT_ANSI__)) || defined(__cplusplus) || defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 */
21-
# define INLINE_KEYWORD inline
20+
#if (defined(__GNUC__) && !defined(__STRICT_ANSI__)) || defined(__cplusplus) || \
21+
defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 */
22+
#define INLINE_KEYWORD inline
2223
#else
23-
# define INLINE_KEYWORD
24+
#define INLINE_KEYWORD
2425
#endif
2526

2627
#if defined(__GNUC__) || defined(__ICCARM__)
27-
# define FORCE_INLINE_ATTR __attribute__((always_inline))
28+
#define FORCE_INLINE_ATTR __attribute__((always_inline))
2829
#elif defined(_MSC_VER)
29-
# define FORCE_INLINE_ATTR __forceinline
30+
#define FORCE_INLINE_ATTR __forceinline
3031
#else
31-
# define FORCE_INLINE_ATTR
32+
#define FORCE_INLINE_ATTR
3233
#endif
3334

3435
#else
@@ -39,14 +40,14 @@
3940
#endif
4041

4142
/**
42-
On MSVC qsort requires that functions passed into it use the __cdecl calling conversion(CC).
43-
This explicitly marks such functions as __cdecl so that the code will still compile
43+
On MSVC qsort requires that functions passed into it use the __cdecl calling conversion(CC).
44+
This explicitly marks such functions as __cdecl so that the code will still compile
4445
if a CC other than __cdecl has been made the default.
4546
*/
46-
#if defined(_MSC_VER)
47-
# define WIN_CDECL __cdecl
47+
#if defined(_MSC_VER)
48+
#define WIN_CDECL __cdecl
4849
#else
49-
# define WIN_CDECL
50+
#define WIN_CDECL
5051
#endif
5152

5253
/**
@@ -67,97 +68,95 @@
6768
* attribute.
6869
*/
6970
#if !defined(__clang__) && defined(__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 8 && __GNUC__ < 5
70-
# define HINT_INLINE static INLINE_KEYWORD
71+
#define HINT_INLINE static INLINE_KEYWORD
7172
#else
72-
# define HINT_INLINE static INLINE_KEYWORD FORCE_INLINE_ATTR
73+
#define HINT_INLINE static INLINE_KEYWORD FORCE_INLINE_ATTR
7374
#endif
7475

7576
/* UNUSED_ATTR tells the compiler it is okay if the function is unused. */
7677
#if defined(__GNUC__)
77-
# define UNUSED_ATTR __attribute__((unused))
78+
#define UNUSED_ATTR __attribute__((unused))
7879
#else
79-
# define UNUSED_ATTR
80+
#define UNUSED_ATTR
8081
#endif
8182

8283
/* force no inlining */
8384
#ifdef _MSC_VER
84-
# define FORCE_NOINLINE static __declspec(noinline)
85+
#define FORCE_NOINLINE static __declspec(noinline)
86+
#else
87+
#if defined(__GNUC__) || defined(__ICCARM__)
88+
#define FORCE_NOINLINE static __attribute__((__noinline__))
8589
#else
86-
# if defined(__GNUC__) || defined(__ICCARM__)
87-
# define FORCE_NOINLINE static __attribute__((__noinline__))
88-
# else
89-
# define FORCE_NOINLINE static
90-
# endif
90+
#define FORCE_NOINLINE static
91+
#endif
9192
#endif
9293

9394
/* target attribute */
9495
#ifndef __has_attribute
95-
#define __has_attribute(x) 0 /* Compatibility with non-clang compilers. */
96+
#define __has_attribute(x) 0 /* Compatibility with non-clang compilers. */
9697
#endif
9798
#if defined(__GNUC__) || defined(__ICCARM__)
98-
# define TARGET_ATTRIBUTE(target) __attribute__((__target__(target)))
99+
#define TARGET_ATTRIBUTE(target) __attribute__((__target__(target)))
99100
#else
100-
# define TARGET_ATTRIBUTE(target)
101+
#define TARGET_ATTRIBUTE(target)
101102
#endif
102103

103104
/* Enable runtime BMI2 dispatch based on the CPU.
104105
* Enabled for clang & gcc >=4.8 on x86 when BMI2 isn't enabled by default.
105106
*/
106107
#ifndef DYNAMIC_BMI2
107-
#if ((defined(__clang__) && __has_attribute(__target__)) \
108-
|| (defined(__GNUC__) \
109-
&& (__GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)))) \
110-
&& (defined(__x86_64__) || defined(_M_X86)) \
111-
&& !defined(__BMI2__)
112-
# define DYNAMIC_BMI2 1
113-
#else
114-
# define DYNAMIC_BMI2 0
115-
#endif
108+
#if ((defined(__clang__) && __has_attribute(__target__)) || \
109+
(defined(__GNUC__) && (__GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)))) && \
110+
(defined(__x86_64__) || defined(_M_X86)) && !defined(__BMI2__)
111+
#define DYNAMIC_BMI2 1
112+
#else
113+
#define DYNAMIC_BMI2 0
114+
#endif
116115
#endif
117116

118117
/* prefetch
119118
* can be disabled, by declaring NO_PREFETCH build macro */
120119
#if defined(NO_PREFETCH)
121-
# define PREFETCH_L1(ptr) (void)(ptr) /* disabled */
122-
# define PREFETCH_L2(ptr) (void)(ptr) /* disabled */
120+
#define PREFETCH_L1(ptr) (void)(ptr) /* disabled */
121+
#define PREFETCH_L2(ptr) (void)(ptr) /* disabled */
122+
#else
123+
#if defined(_MSC_VER) && \
124+
(defined(_M_X64) || defined(_M_I86)) /* _mm_prefetch() is not defined outside of x86/x64 */
125+
#include <mmintrin.h> /* https://msdn.microsoft.com/fr-fr/library/84szxsww(v=vs.90).aspx */
126+
#define PREFETCH_L1(ptr) _mm_prefetch((const char*)(ptr), _MM_HINT_T0)
127+
#define PREFETCH_L2(ptr) _mm_prefetch((const char*)(ptr), _MM_HINT_T1)
128+
#elif defined(__aarch64__)
129+
#define PREFETCH_L1(ptr) __asm__ __volatile__("prfm pldl1keep, %0" ::"Q"(*(ptr)))
130+
#define PREFETCH_L2(ptr) __asm__ __volatile__("prfm pldl2keep, %0" ::"Q"(*(ptr)))
131+
#elif defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
132+
#define PREFETCH_L1(ptr) __builtin_prefetch((ptr), 0 /* rw==read */, 3 /* locality */)
133+
#define PREFETCH_L2(ptr) __builtin_prefetch((ptr), 0 /* rw==read */, 2 /* locality */)
123134
#else
124-
# if defined(_MSC_VER) && (defined(_M_X64) || defined(_M_I86)) /* _mm_prefetch() is not defined outside of x86/x64 */
125-
# include <mmintrin.h> /* https://msdn.microsoft.com/fr-fr/library/84szxsww(v=vs.90).aspx */
126-
# define PREFETCH_L1(ptr) _mm_prefetch((const char*)(ptr), _MM_HINT_T0)
127-
# define PREFETCH_L2(ptr) _mm_prefetch((const char*)(ptr), _MM_HINT_T1)
128-
# elif defined(__aarch64__)
129-
# define PREFETCH_L1(ptr) __asm__ __volatile__("prfm pldl1keep, %0" ::"Q"(*(ptr)))
130-
# define PREFETCH_L2(ptr) __asm__ __volatile__("prfm pldl2keep, %0" ::"Q"(*(ptr)))
131-
# elif defined(__GNUC__) && ( (__GNUC__ >= 4) || ( (__GNUC__ == 3) && (__GNUC_MINOR__ >= 1) ) )
132-
# define PREFETCH_L1(ptr) __builtin_prefetch((ptr), 0 /* rw==read */, 3 /* locality */)
133-
# define PREFETCH_L2(ptr) __builtin_prefetch((ptr), 0 /* rw==read */, 2 /* locality */)
134-
# else
135-
# define PREFETCH_L1(ptr) (void)(ptr) /* disabled */
136-
# define PREFETCH_L2(ptr) (void)(ptr) /* disabled */
137-
# endif
138-
#endif /* NO_PREFETCH */
135+
#define PREFETCH_L1(ptr) (void)(ptr) /* disabled */
136+
#define PREFETCH_L2(ptr) (void)(ptr) /* disabled */
137+
#endif
138+
#endif /* NO_PREFETCH */
139139

140140
#define CACHELINE_SIZE 64
141141

142-
#define PREFETCH_AREA(p, s) { \
143-
const char* const _ptr = (const char*)(p); \
144-
size_t const _size = (size_t)(s); \
145-
size_t _pos; \
146-
for (_pos=0; _pos<_size; _pos+=CACHELINE_SIZE) { \
147-
PREFETCH_L2(_ptr + _pos); \
148-
} \
149-
}
142+
#define PREFETCH_AREA(p, s) \
143+
{ \
144+
const char* const _ptr = (const char*)(p); \
145+
size_t const _size = (size_t)(s); \
146+
size_t _pos; \
147+
for (_pos = 0; _pos < _size; _pos += CACHELINE_SIZE) { PREFETCH_L2(_ptr + _pos); } \
148+
}
150149

151150
/* vectorization
152151
* older GCC (pre gcc-4.3 picked as the cutoff) uses a different syntax */
153152
#if !defined(__INTEL_COMPILER) && !defined(__clang__) && defined(__GNUC__)
154-
# if (__GNUC__ == 4 && __GNUC_MINOR__ > 3) || (__GNUC__ >= 5)
155-
# define DONT_VECTORIZE __attribute__((optimize("no-tree-vectorize")))
156-
# else
157-
# define DONT_VECTORIZE _Pragma("GCC optimize(\"no-tree-vectorize\")")
158-
# endif
153+
#if (__GNUC__ == 4 && __GNUC_MINOR__ > 3) || (__GNUC__ >= 5)
154+
#define DONT_VECTORIZE __attribute__((optimize("no-tree-vectorize")))
155+
#else
156+
#define DONT_VECTORIZE _Pragma("GCC optimize(\"no-tree-vectorize\")")
157+
#endif
159158
#else
160-
# define DONT_VECTORIZE
159+
#define DONT_VECTORIZE
161160
#endif
162161

163162
/* Tell the compiler that a branch is likely or unlikely.
@@ -174,13 +173,13 @@
174173
#endif
175174

176175
/* disable warnings */
177-
#ifdef _MSC_VER /* Visual Studio */
178-
# include <intrin.h> /* For Visual 2005 */
179-
# pragma warning(disable : 4100) /* disable: C4100: unreferenced formal parameter */
180-
# pragma warning(disable : 4127) /* disable: C4127: conditional expression is constant */
181-
# pragma warning(disable : 4204) /* disable: C4204: non-constant aggregate initializer */
182-
# pragma warning(disable : 4214) /* disable: C4214: non-int bitfields */
183-
# pragma warning(disable : 4324) /* disable: C4324: padded structure */
176+
#ifdef _MSC_VER /* Visual Studio */
177+
#include <intrin.h> /* For Visual 2005 */
178+
#pragma warning(disable : 4100) /* disable: C4100: unreferenced formal parameter */
179+
#pragma warning(disable : 4127) /* disable: C4127: conditional expression is constant */
180+
#pragma warning(disable : 4204) /* disable: C4204: non-constant aggregate initializer */
181+
#pragma warning(disable : 4214) /* disable: C4214: non-int bitfields */
182+
#pragma warning(disable : 4324) /* disable: C4324: padded structure */
184183
#endif
185184

186185
#endif /* ZSTD_COMPILER_H */

ucm/store/compress/cc/compress_lib/debug.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* ******************************************************************
22
debug
33
Part of FSE library
4-
Copyright (C) 2013-present, Yann Collet.
4+
Copyright (C) 2013-present, Yann Collect.
55
66
BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php)
77
@@ -32,7 +32,6 @@
3232
- Source repository : https://github.com/Cyan4973/FiniteStateEntropy
3333
****************************************************************** */
3434

35-
3635
/*
3736
* This module only hosts one global variable
3837
* which can be used to dynamically influence the verbosity of traces,

ucm/store/compress/cc/compress_lib/debug.h

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* ******************************************************************
22
* debug
33
* Part of FSE library
4-
* Copyright (c) 2013-2020, Yann Collet, Facebook, Inc.
4+
* Copyright (c) 2013-2020, Yann Collect, Facebook, Inc.
55
*
66
* You can contact the author at :
77
* - Source repository : https://github.com/Cyan4973/FiniteStateEntropy
@@ -10,8 +10,7 @@
1010
* LICENSE file in the root directory of this source tree) and the GPLv2 (found
1111
* in the COPYING file in the root directory of this source tree).
1212
* You may select, at your option, one of the above-listed licenses.
13-
****************************************************************** */
14-
13+
****************************************************************** */
1514

1615
/*
1716
* The purpose of this header is to enable debug functions.
@@ -32,34 +31,30 @@
3231
#ifndef DEBUG_H_12987983217
3332
#define DEBUG_H_12987983217
3433

35-
#if defined (__cplusplus)
34+
#if defined(__cplusplus)
3635
extern "C" {
3736
#endif
3837

39-
4038
/* static assert is triggered at compile time, leaving no runtime artefact.
4139
* static assert only works with compile-time constants.
4240
* Also, this variant can only be used inside a function. */
4341
#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
4442

45-
4643
/* DEBUGLEVEL is expected to be defined externally,
4744
* typically through compiler command line.
4845
* Value must be a number. */
4946
#ifndef DEBUGLEVEL
50-
# define DEBUGLEVEL 0
47+
#define DEBUGLEVEL 0
5148
#endif
5249

53-
5450
/* DEBUGFILE can be defined externally,
5551
* typically through compiler command line.
5652
* note : currently useless.
5753
* Value must be stderr or stdout */
5854
#ifndef DEBUGFILE
59-
# define DEBUGFILE stderr
55+
#define DEBUGFILE stderr
6056
#endif
6157

62-
6358
/* recommended values for DEBUGLEVEL :
6459
* 0 : release mode, no debug, all run-time checks disabled
6560
* 1 : enables assert() only, no display
@@ -75,39 +70,44 @@ extern "C" {
7570
* by modifying g_debug_level.
7671
*/
7772

78-
#if (DEBUGLEVEL>=1)
79-
# include <assert.h>
73+
#if (DEBUGLEVEL >= 1)
74+
#include <assert.h>
8075
#else
81-
# ifndef assert /* assert may be already defined, due to prior #include <assert.h> */
82-
# define assert(condition) ((void)0) /* disable assert (default) */
83-
# endif
76+
#ifndef assert /* assert may be already defined, due to prior #include <assert.h> */
77+
#define assert(condition) ((void)0) /* disable assert (default) */
78+
#endif
8479
#endif
8580

86-
#if (DEBUGLEVEL>=2)
87-
# include <stdio.h>
81+
#if (DEBUGLEVEL >= 2)
82+
#include <stdio.h>
8883
extern int g_debuglevel; /* the variable is only declared,
8984
it actually lives in debug.c,
9085
and is shared by the whole process.
9186
It's not thread-safe.
9287
It's useful when enabling very verbose levels
9388
on selective conditions (such as position in src) */
9489

95-
# define RAWLOG(l, ...) { \
96-
if (l<=g_debuglevel) { \
97-
fprintf(stderr, __VA_ARGS__); \
98-
} }
99-
# define DEBUGLOG(l, ...) { \
100-
if (l<=g_debuglevel) { \
101-
fprintf(stderr, __FILE__ ": " __VA_ARGS__); \
102-
fprintf(stderr, " \n"); \
103-
} }
90+
#define RAWLOG(l, ...) \
91+
{ \
92+
if (l <= g_debuglevel) { fprintf(stderr, __VA_ARGS__); } \
93+
}
94+
#define DEBUGLOG(l, ...) \
95+
{ \
96+
if (l <= g_debuglevel) { \
97+
fprintf(stderr, __FILE__ ": " __VA_ARGS__); \
98+
fprintf(stderr, " \n"); \
99+
} \
100+
}
104101
#else
105-
# define RAWLOG(l, ...) {} /* disabled */
106-
# define DEBUGLOG(l, ...) {} /* disabled */
102+
#define RAWLOG(l, ...) \
103+
{ \
104+
} /* disabled */
105+
#define DEBUGLOG(l, ...) \
106+
{ \
107+
} /* disabled */
107108
#endif
108109

109-
110-
#if defined (__cplusplus)
110+
#if defined(__cplusplus)
111111
}
112112
#endif
113113

0 commit comments

Comments
 (0)