diff --git a/src/command_manager.cc b/src/command_manager.cc index 2255b7c45..c8e5d05aa 100644 --- a/src/command_manager.cc +++ b/src/command_manager.cc @@ -31,9 +31,11 @@ void CommandManager::register_commands(memoryview command_names, m_commands[command_name] = { command, completer }; } -parse_error::parse_error(const String& error) - : runtime_error{"parse error: " + error} {} - +struct parse_error : runtime_error +{ + parse_error(const String& error) + : runtime_error{"parse error: " + error} {} +}; namespace { diff --git a/src/command_manager.hh b/src/command_manager.hh index c63633ef9..9aee1e0c2 100644 --- a/src/command_manager.hh +++ b/src/command_manager.hh @@ -14,15 +14,9 @@ namespace Kakoune { -struct parse_error : runtime_error -{ - parse_error(const String& error); -}; - struct Context; using CommandParameters = memoryview; -using Command = std::function; +using Command = std::function; using CommandCompleter = std::function; diff --git a/src/main.cc b/src/main.cc index ad41d8434..536ca1577 100644 --- a/src/main.cc +++ b/src/main.cc @@ -43,7 +43,7 @@ String runtime_directory() #elif defined(__APPLE__) uint32_t bufsize = 2048; _NSGetExecutablePath(buffer, &bufsize); - char* canonical_path = realpath(buffer, NULL); + char* canonical_path = realpath(buffer, nullptr); strncpy(buffer, canonical_path, 2048); free(canonical_path); #else diff --git a/src/remote.cc b/src/remote.cc index 5776d6241..6bb267505 100644 --- a/src/remote.cc +++ b/src/remote.cc @@ -327,7 +327,7 @@ bool RemoteUI::is_key_available() tv.tv_sec = 0; tv.tv_usec = 0; - int res = select(sock+1, &rfds, NULL, NULL, &tv); + int res = select(sock+1, &rfds, nullptr, nullptr, &tv); return res == 1; } @@ -500,7 +500,7 @@ private: FD_ZERO(&rfds); FD_SET(socket, &rfds); } - while (select(socket+1, &rfds, NULL, NULL, &tv) == 1); + while (select(socket+1, &rfds, nullptr, nullptr, &tv) == 1); } String m_buffer; diff --git a/src/shell_manager.cc b/src/shell_manager.cc index d293a1377..7663e2f85 100644 --- a/src/shell_manager.cc +++ b/src/shell_manager.cc @@ -67,7 +67,7 @@ String ShellManager::pipe(const String& input, if (not errorout.empty()) write_debug("shell stderr: <<<\n" + errorout + ">>>"); - waitpid(pid, NULL, 0); + waitpid(pid, nullptr, 0); } else try { @@ -125,7 +125,7 @@ String ShellManager::pipe(const String& input, execparams.push_back(shell.c_str()); for (auto& param : params) execparams.push_back(param.c_str()); - execparams.push_back(NULL); + execparams.push_back(nullptr); execvp(shell.c_str(), (char* const*)execparams.data()); exit(-1);