modernize: use bool literals, raw string literal

This commit is contained in:
Valient Gough 2017-08-03 22:10:25 -07:00
parent 5a99506ea8
commit 169101c80b
No known key found for this signature in database
GPG Key ID: 33C65E29813C14DF
4 changed files with 7 additions and 6 deletions

View File

@ -22,7 +22,8 @@
#ifdef linux #ifdef linux
#define _XOPEN_SOURCE 500 // make sure pwrite() is pulled in #define _XOPEN_SOURCE 500 // make sure pwrite() is pulled in
#endif #endif
#define _BSD_SOURCE // pick up setenv on RH7.3 #define _BSD_SOURCE // pick up setenv on RH7.3
#define _DEFAULT_SOURCE // Replaces _BSD_SOURCE
#include "internal/easylogging++.h" #include "internal/easylogging++.h"
#include <cctype> #include <cctype>
@ -1416,7 +1417,7 @@ std::string readPassword(int FD) {
char buffer[1024]; char buffer[1024];
string result; string result;
while (1) { while (true) {
ssize_t rdSize = recv(FD, buffer, sizeof(buffer), 0); ssize_t rdSize = recv(FD, buffer, sizeof(buffer), 0);
if (rdSize > 0) { if (rdSize > 0) {

View File

@ -139,7 +139,7 @@ class NameIO {
delete[] Name; \ delete[] Name; \
Name = Name##_Raw; \ Name = Name##_Raw; \
} \ } \
} while (0); } while (false);
} // namespace encfs } // namespace encfs

View File

@ -101,7 +101,7 @@ bool XmlValue::readB64(const char *path, unsigned char *data,
return false; return false;
} }
if (!B64StandardDecode(data, (unsigned char *)s.data(), s.size())) { if (!B64StandardDecode(data, (unsigned char *)s.data(), s.size())) {
RLOG(ERROR) << "B64 decode failure on \"" << s << "\""; RLOG(ERROR) << R"(B64 decode failure on ")" << s << R"(")";
return false; return false;
} }

View File

@ -169,7 +169,7 @@ static void FuseUsage() {
do { \ do { \
rAssert(out->fuseArgc < MaxFuseArgs); \ rAssert(out->fuseArgc < MaxFuseArgs); \
out->fuseArgv[out->fuseArgc++] = (ARG); \ out->fuseArgv[out->fuseArgc++] = (ARG); \
} while (0) } while (false)
static string slashTerminate(const string &src) { static string slashTerminate(const string &src) {
string result = src; string result = src;
@ -233,7 +233,7 @@ static bool processArgs(int argc, char *argv[],
{"require-macs", 0, nullptr, LONG_OPT_REQUIRE_MAC}, // require MACs {"require-macs", 0, nullptr, LONG_OPT_REQUIRE_MAC}, // require MACs
{nullptr, 0, nullptr, 0}}; {nullptr, 0, nullptr, 0}};
while (1) { while (true) {
int option_index = 0; int option_index = 0;
// 's' : single-threaded mode // 's' : single-threaded mode