C++ compiler doesn't like Pythonic code.

This commit is contained in:
Quantum 2014-11-03 00:08:37 -05:00
parent 1f1e1196ca
commit a809e6c203

View file

@ -56,12 +56,9 @@ ZalgoProcess &ZalgoProcess::zalgo(int level, bool up, bool mid, bool down) {
std::uniform_int_distribution<> dist_mid(level / 6, level / 2); std::uniform_int_distribution<> dist_mid(level / 6, level / 2);
std::uniform_int_distribution<> dist_down(level / 3, level); std::uniform_int_distribution<> dist_down(level / 3, level);
bool initial = true; bool initial = true;
wint_t ch;
while (true) { while ((ch = fgetwc(infile)) != WEOF) {
wint_t ch = fgetwc(infile);
if (ch == WEOF)
return *this;
if (ch == 0xFEFF) if (ch == 0xFEFF)
continue; continue;
if (ch == L'?' && initial) { if (ch == L'?' && initial) {
@ -88,15 +85,14 @@ ZalgoProcess &ZalgoProcess::zalgo(int level, bool up, bool mid, bool down) {
IMPLEMENT_ZALGO(mid); IMPLEMENT_ZALGO(mid);
IMPLEMENT_ZALGO(down); IMPLEMENT_ZALGO(down);
} }
return *this;
} }
ZalgoProcess &ZalgoProcess::unzalgo() { ZalgoProcess &ZalgoProcess::unzalgo() {
bool initial = true; bool initial = true;
while (true) { wint_t ch;
wint_t ch = fgetwc(infile);
if (ch == WEOF)
return *this;
while ((ch = fgetwc(infile)) != WEOF) {
if (ch == 0xFEFF) if (ch == 0xFEFF)
continue; continue;
if (ch == L'?' && initial) { if (ch == L'?' && initial) {
@ -108,6 +104,7 @@ ZalgoProcess &ZalgoProcess::unzalgo() {
continue; continue;
fputwc(ch, outfile); fputwc(ch, outfile);
} }
return *this;
} }
ZalgoProcess &ZalgoProcess::close() { ZalgoProcess &ZalgoProcess::close() {