Skip to content

Commit af89154

Browse files
committed
Fix C1090 PDB race and remaining C4244 iota warnings for clean /W4 build
1 parent f9824b5 commit af89154

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ target_include_directories(pcg-cpp INTERFACE
1616
target_compile_features(pcg-cpp INTERFACE cxx_std_11)
1717

1818
if(MSVC)
19-
target_compile_options(pcg-cpp INTERFACE /W4) # /Wall is extremely noisy on MSVC
19+
target_compile_options(pcg-cpp INTERFACE /W4 /FS) # /FS fixes C1090 PDB race conditions
2020
else()
2121
target_compile_options(pcg-cpp INTERFACE -Wall -Wextra -Wpedantic)
2222
endif()

sample/pcg-demo.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,15 +149,15 @@ int main(int argc, char** argv)
149149
rng_copy = rng;
150150
enum { SUITS = 4, NUMBERS = 13, CARDS = 52 };
151151
char cards[CARDS];
152-
iota(begin(cards), end(cards), 0);
152+
iota(begin(cards), end(cards), char(0));
153153
std::shuffle(begin(cards), end(cards), rng);
154154
auto std_shuffle_steps = rng - rng_copy;
155155

156156
/* Restore RNG and deal again using pcg_extras::shuffle, which follows
157157
* the algorithm for shuffling that most programmers would expect.
158158
*/
159159
rng = rng_copy;
160-
iota(begin(cards), end(cards), 0);
160+
iota(begin(cards), end(cards), char(0));
161161
pcg_extras::shuffle(begin(cards), end(cards), rng);
162162
auto my_shuffle_steps = rng - rng_copy;
163163

test-high/pcg-test-noadvance.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ int main(int argc, char** argv)
136136
*/
137137
enum { SUITS = 4, NUMBERS = 13, CARDS = 52 };
138138
char cards[CARDS];
139-
iota(begin(cards), end(cards), 0);
139+
iota(begin(cards), end(cards), char(0));
140140
pcg_extras::shuffle(begin(cards), end(cards), rng);
141141

142142
/* Output the shuffled deck */

test-high/pcg-test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ int main(int argc, char** argv)
148148
*/
149149
enum { SUITS = 4, NUMBERS = 13, CARDS = 52 };
150150
char cards[CARDS];
151-
iota(begin(cards), end(cards), 0);
151+
iota(begin(cards), end(cards), char(0));
152152
pcg_extras::shuffle(begin(cards), end(cards), rng);
153153

154154
/* Output the shuffled deck */

0 commit comments

Comments
 (0)