Skip to content

Commit 61ee4b7

Browse files
compiler: drop CONFIG_HAVE_LONG_LONG and require long long support
All compilers supported by NuttX provide "long long" types, so the CONFIG_HAVE_LONG_LONG indirection is no longer useful. Remove the configuration knob and the conditional code paths that were guarded by it; treat "long long" as unconditionally available across the OS. Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
1 parent 4b867a8 commit 61ee4b7

44 files changed

Lines changed: 22 additions & 514 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Documentation/applications/netutils/ntpclient/index.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@ The NTP client requires:
167167
- **CONFIG_NET_UDP**: UDP protocol support
168168
- **CONFIG_NET_SOCKOPTS**: Socket options support
169169
- **CONFIG_LIBC_NETDB**: DNS resolution (recommended)
170-
- **CONFIG_HAVE_LONG_LONG**: 64-bit integer support
171170

172171
For best results, ensure:
173172
- Stable network connectivity

drivers/note/note_driver.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1568,9 +1568,7 @@ void sched_note_vprintf_ip(uint32_t tag, uintptr_t ip, FAR const char *fmt,
15681568
{
15691569
int i;
15701570
long l;
1571-
#ifdef CONFIG_HAVE_LONG_LONG
15721571
long long ll;
1573-
#endif
15741572
intmax_t im;
15751573
size_t sz;
15761574
ptrdiff_t ptr;
@@ -1679,7 +1677,6 @@ void sched_note_vprintf_ip(uint32_t tag, uintptr_t ip, FAR const char *fmt,
16791677
var->im = va_arg(*va, intmax_t);
16801678
next += sizeof(var->im);
16811679
}
1682-
#ifdef CONFIG_HAVE_LONG_LONG
16831680
else if (*(p - 2) == 'l' && *(p - 3) == 'l')
16841681
{
16851682
if (next + sizeof(var->ll) > length)
@@ -1690,7 +1687,6 @@ void sched_note_vprintf_ip(uint32_t tag, uintptr_t ip, FAR const char *fmt,
16901687
var->ll = va_arg(*va, long long);
16911688
next += sizeof(var->ll);
16921689
}
1693-
#endif
16941690
else if (*(p - 2) == 'l')
16951691
{
16961692
if (next + sizeof(var->l) > length)

fs/spiffs/src/spiffs.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,7 @@ struct spiffs_s
122122
FAR uint8_t *work; /* Secondary work buffer, size of a logical page */
123123
FAR uint8_t *mtd_work; /* MTD I/O buffer for read-modify-write */
124124
FAR void *cache; /* Cache memory */
125-
#ifdef CONFIG_HAVE_LONG_LONG
126125
off64_t media_size; /* Physical size of the SPI flash */
127-
#else
128-
off_t media_size; /* Physical size of the SPI flash */
129-
#endif
130126
int free_entry; /* Cursor for free blocks, entry index */
131127
int lu_entry; /* Cursor when searching, entry index */
132128
uint32_t total_pages; /* Total number of pages on the media */

include/cxx/cstdlib

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,8 @@ namespace std
7272
using ::atol;
7373
using ::strtol;
7474
using ::strtoul;
75-
#ifdef CONFIG_HAVE_LONG_LONG
7675
using ::strtoll;
7776
using ::strtoull;
78-
#endif
7977
using ::strtof;
8078
#ifdef CONFIG_HAVE_DOUBLE
8179
using ::strtod;
@@ -114,15 +112,11 @@ namespace std
114112

115113
using ::abs;
116114
using ::labs;
117-
#ifdef CONFIG_HAVE_LONG_LONG
118115
using ::llabs;
119-
#endif
120116

121117
using ::div;
122118
using ::ldiv;
123-
#ifdef CONFIG_HAVE_LONG_LONG
124119
using ::lldiv;
125-
#endif
126120

127121
// Temporary files
128122

include/fixedmath.h

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -94,15 +94,13 @@
9494
#define b16tob8(b) (b8_t)(((b)+0x0080)>>8)
9595
#define ub16toub8(b) (ub8_t)(((b)+0x0080)>>8)
9696

97-
#ifdef CONFIG_HAVE_LONG_LONG
9897
# define b8tob32(b) (((b32_t)(b)) << 24)
9998
# define ub8toub32(b) (((ub32_t)(b)) << 24)
10099
# define b16tob32(b) (((b32_t)(b)) << 16)
101100
# define ub16toub32(b) (((ub32_t)(b)) << 16)
102101
# define b32tob16(b) (b16_t)(((b) + 0x0000000000008000)>>16)
103102
# define ub32toub16(b) (ub16_t)(((b) + 0x0000000000008000)>>16)
104103
# define b32tob8(b) (b8_t)(((b) + 0x0000000000000080)>>8)
105-
#endif
106104

107105
/* 16-bit values with 8 bits of precision ***********************************/
108106

@@ -168,7 +166,6 @@
168166
#define b16abs(b) ((b < 0) ? (-b) : (b)) /* Get the absolute value */
169167
#define b16sign(b) ((b > 0) ? (b16ONE) : (-b16ONE))
170168

171-
#ifdef CONFIG_HAVE_LONG_LONG
172169
/* Multiplication operators */
173170

174171
# define b16mulb16(a,b) b32tob16((b32_t)(a)*(b32_t)(b))
@@ -187,13 +184,9 @@
187184
/* Square root operators */
188185

189186
# define ub16sqrtub16(a) ub32sqrtub16(ub16toub32(a))
190-
#else
191-
# define ub16sqrtub16(a) ub8toub16(ub16sqrtub8(a))
192-
#endif
193187

194188
/* 64-bit values with 32 bits of precision **********************************/
195189

196-
#ifdef CONFIG_HAVE_LONG_LONG
197190
/* Conversions */
198191

199192
#define b32toi(a) ((a) >> 32) /* Conversion to integer */
@@ -206,7 +199,6 @@
206199
#define b32frac(a) ((a) & 0x00000000ffffffff) /* Take fractional part */
207200
#define b32abs(b) ((b < 0) ? (-b) : (b)) /* Get the absolute value */
208201
#define b32sign(b) ((b > 0) ? (b32ONE) : (-b32ONE))
209-
#endif
210202

211203
/****************************************************************************
212204
* Public Types
@@ -216,10 +208,8 @@ typedef int16_t b8_t;
216208
typedef uint16_t ub8_t;
217209
typedef int32_t b16_t;
218210
typedef uint32_t ub16_t;
219-
#ifdef CONFIG_HAVE_LONG_LONG
220211
typedef int64_t b32_t;
221212
typedef uint64_t ub32_t;
222-
#endif
223213

224214
/****************************************************************************
225215
* Public Function Prototypes
@@ -234,23 +224,6 @@ extern "C"
234224
#define EXTERN extern
235225
#endif
236226

237-
#ifndef CONFIG_HAVE_LONG_LONG
238-
/* Multiplication operators */
239-
240-
b16_t b16mulb16(b16_t m1, b16_t m2);
241-
ub16_t ub16mulub16(ub16_t m1, ub16_t m2);
242-
243-
/* Square operators */
244-
245-
b16_t b16sqr(b16_t a);
246-
ub16_t ub16sqr(ub16_t a);
247-
248-
/* Division operators */
249-
250-
b16_t b16divb16(b16_t num, b16_t denom);
251-
ub16_t ub16divub16(ub16_t num, ub16_t denom);
252-
#endif
253-
254227
/* Trigonometric Functions */
255228

256229
b16_t b16sin(b16_t rad);
@@ -259,9 +232,7 @@ b16_t b16atan2(b16_t y, b16_t x);
259232

260233
/* Square root operators */
261234

262-
#ifdef CONFIG_HAVE_LONG_LONG
263235
ub16_t ub32sqrtub16(ub32_t a);
264-
#endif
265236
ub8_t ub16sqrtub8(ub16_t a);
266237

267238
#undef EXTERN

include/nuttx/audio/audio.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -710,9 +710,7 @@ struct audio_caps_s
710710
uint8_t b[4];
711711
uint16_t hw[2];
712712
uint32_t w;
713-
#ifdef CONFIG_HAVE_LONG_LONG
714713
uint64_t qw;
715-
#endif
716714
} ac_controls;
717715

718716
/* Codec info */

include/nuttx/compiler.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,6 @@
442442

443443
/* Define these here and allow specific architectures to override as needed */
444444

445-
# define CONFIG_HAVE_LONG_LONG 1
446445
# define CONFIG_HAVE_FLOAT 1
447446
# define CONFIG_HAVE_DOUBLE 1
448447
# define CONFIG_HAVE_LONG_DOUBLE 1
@@ -814,7 +813,6 @@
814813
* double.
815814
*/
816815

817-
# define CONFIG_HAVE_LONG_LONG 1
818816
# define CONFIG_HAVE_FLOAT 1
819817
# undef CONFIG_HAVE_DOUBLE
820818
# undef CONFIG_HAVE_LONG_DOUBLE
@@ -982,7 +980,6 @@
982980
* simply do not support long long or double.
983981
*/
984982

985-
# undef CONFIG_HAVE_LONG_LONG
986983
# define CONFIG_HAVE_FLOAT 1
987984
# undef CONFIG_HAVE_DOUBLE
988985
# undef CONFIG_HAVE_LONG_DOUBLE
@@ -1106,7 +1103,6 @@
11061103

11071104
/* Define these here and allow specific architectures to override as needed */
11081105

1109-
# define CONFIG_HAVE_LONG_LONG 1
11101106
# define CONFIG_HAVE_FLOAT 1
11111107
# define CONFIG_HAVE_DOUBLE 1
11121108
# define CONFIG_HAVE_LONG_DOUBLE 1
@@ -1211,7 +1207,6 @@
12111207

12121208
/* Define these here and allow specific architectures to override as needed */
12131209

1214-
# define CONFIG_HAVE_LONG_LONG 1
12151210
# define CONFIG_HAVE_FLOAT 1
12161211
# define CONFIG_HAVE_DOUBLE 1
12171212
# define CONFIG_HAVE_LONG_DOUBLE 1
@@ -1379,7 +1374,6 @@
13791374
# undef CONFIG_SMALL_MEMORY
13801375
# undef CONFIG_LONG_IS_NOT_INT
13811376
# undef CONFIG_PTR_IS_NOT_INT
1382-
# undef CONFIG_HAVE_LONG_LONG
13831377
# define CONFIG_HAVE_FLOAT 1
13841378
# undef CONFIG_HAVE_DOUBLE
13851379
# undef CONFIG_HAVE_LONG_DOUBLE
@@ -1406,10 +1400,6 @@
14061400

14071401
#endif
14081402

1409-
#ifndef CONFIG_HAVE_LONG_LONG
1410-
# undef CONFIG_FS_LARGEFILE
1411-
#endif
1412-
14131403
#ifdef CONFIG_DISABLE_FLOAT
14141404
# undef CONFIG_HAVE_FLOAT
14151405
# undef CONFIG_HAVE_DOUBLE

include/nuttx/crc64.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@
3232
#include <sys/types.h>
3333
#include <stdint.h>
3434

35-
#ifdef CONFIG_HAVE_LONG_LONG
36-
3735
/****************************************************************************
3836
* Pre-processor Definitions
3937
****************************************************************************/
@@ -123,5 +121,4 @@ uint64_t crc64emac(FAR const uint8_t *src, size_t len);
123121
}
124122
#endif
125123

126-
#endif /* CONFIG_HAVE_LONG_LONG */
127124
#endif /* __INCLUDE_NUTTX_CRC64_H */

include/nuttx/lib/math.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,15 +179,13 @@ long int lround(double x);
179179
long int lroundl(long double x);
180180
#endif
181181

182-
#ifdef CONFIG_HAVE_LONG_LONG
183182
long long int llroundf(float x);
184183
#ifdef CONFIG_HAVE_DOUBLE
185184
long long int llround (double x);
186185
#endif
187186
#ifdef CONFIG_HAVE_LONG_DOUBLE
188187
long long int llroundl(long double x);
189188
#endif
190-
#endif
191189

192190
float rintf(float x); /* Not implemented */
193191
#ifdef CONFIG_HAVE_DOUBLE
@@ -205,15 +203,13 @@ long int lrint(double x);
205203
long int lrintl(long double x);
206204
#endif
207205

208-
#ifdef CONFIG_HAVE_LONG_LONG
209206
long long int llrintf(float x);
210207
#ifdef CONFIG_HAVE_DOUBLE
211208
long long int llrint(double x);
212209
#endif
213210
#ifdef CONFIG_HAVE_LONG_DOUBLE
214211
long long int llrintl(long double x);
215212
#endif
216-
#endif
217213

218214
float fabsf (float x);
219215
#ifdef CONFIG_HAVE_DOUBLE

include/nuttx/lib/math32.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,6 @@ extern "C"
196196
* (It is unfortunate that gcc doesn't perform all this internally.)
197197
*/
198198

199-
#ifdef CONFIG_HAVE_LONG_LONG
200199
/* Default C implementation for umul64_const()
201200
*
202201
* Prototype: uint64_t umul64_const(uint64_t retval, uint64_t m,
@@ -319,9 +318,7 @@ extern "C"
319318
} \
320319
while (0)
321320

322-
#endif
323-
324-
#if defined(CONFIG_HAVE_LONG_LONG) && defined(CONFIG_HAVE_EXPRESSION_STATEMENT)
321+
#if defined(CONFIG_HAVE_EXPRESSION_STATEMENT)
325322
# define div64_const(n, base) \
326323
({ \
327324
uint64_t __n = (n); \

0 commit comments

Comments
 (0)