Skip to content

Commit da00c95

Browse files
committed
Fix C++20 warning - don't call init to initialize atomic variables, use the constructor
1 parent aeb9d69 commit da00c95

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ The MIT License (MIT)
22

33
Copyright (c) 2013-2018 Ronald de Man
44
Copyright (c) 2015 basil00
5-
Copyright (c) 2016-2023 by Jon Dart
5+
Copyright (c) 2016-2024 by Jon Dart
66

77
Permission is hereby granted, free of charge, to any person obtaining a copy
88
of this software and associated documentation files (the "Software"), to deal

src/tbprobe.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
Copyright (c) 2013-2018 Ronald de Man
33
Copyright (c) 2015 basil00
4-
Modifications Copyright (c) 2016-2023 by Jon Dart
4+
Modifications Copyright (c) 2016-2024 by Jon Dart
55
66
Permission is hereby granted, free of charge, to any person obtaining a copy
77
of this software and associated documentation files (the "Software"), to deal
@@ -447,7 +447,11 @@ struct BaseEntry {
447447
uint8_t *data[3];
448448
map_t mapping[3];
449449
#ifdef __cplusplus
450+
#if __cplusplus >= 202002L
451+
atomic<bool> ready[3]({false, false, false});
452+
#else
450453
atomic<bool> ready[3];
454+
#endif
451455
#else
452456
atomic_bool ready[3];
453457
#endif
@@ -772,8 +776,10 @@ static void init_tb(char *str)
772776
TB_MaxCardinalityDTM = be->num;
773777
}
774778

779+
#if !defined(__cplusplus)
775780
for (int type = 0; type < 3; type++)
776781
atomic_init(&be->ready[type], false);
782+
#endif
777783

778784
if (!be->hasPawns) {
779785
int j = 0;

0 commit comments

Comments
 (0)