mirror of
https://github.com/NixOS/nix
synced 2025-07-05 16:31:47 +02:00
Merge pull request #12071 from Mic92/clang-tidy
Prepare nix to run with clang-tidy
This commit is contained in:
commit
3f3feae33e
23 changed files with 75 additions and 24 deletions
|
@ -1,6 +1,7 @@
|
|||
#pragma once
|
||||
///@file
|
||||
|
||||
#include <cassert>
|
||||
#include <future>
|
||||
#include <functional>
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
*/
|
||||
|
||||
#include "config.hh"
|
||||
#include "args.hh"
|
||||
|
||||
namespace nix {
|
||||
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
///@file
|
||||
|
||||
#include <string_view>
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
|
||||
namespace nix::regex {
|
||||
|
||||
|
@ -10,22 +12,23 @@ namespace nix::regex {
|
|||
|
||||
static inline std::string either(std::string_view a, std::string_view b)
|
||||
{
|
||||
return std::string { a } + "|" + b;
|
||||
std::stringstream ss;
|
||||
ss << a << "|" << b;
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
static inline std::string group(std::string_view a)
|
||||
{
|
||||
return std::string { "(" } + a + ")";
|
||||
}
|
||||
|
||||
static inline std::string many(std::string_view a)
|
||||
{
|
||||
return std::string { "(?:" } + a + ")*";
|
||||
std::stringstream ss;
|
||||
ss << "(" << a << ")";
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
static inline std::string list(std::string_view a)
|
||||
{
|
||||
return std::string { a } + many(group("," + a));
|
||||
std::stringstream ss;
|
||||
ss << a << "(," << a << ")*";
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
#include "error.hh"
|
||||
#include "logging.hh"
|
||||
#include "ansicolor.hh"
|
||||
#include "signals.hh"
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include "environment-variables.hh"
|
||||
|
||||
#include "processenv.h"
|
||||
#ifdef WIN32
|
||||
# include "processenv.h"
|
||||
|
||||
namespace nix {
|
||||
|
||||
|
@ -43,3 +44,4 @@ int setEnvOs(const OsString & name, const OsString & value)
|
|||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
#include "windows-error.hh"
|
||||
#include "file-path.hh"
|
||||
|
||||
#ifdef WIN32
|
||||
#include <fileapi.h>
|
||||
#include <error.h>
|
||||
#include <namedpipeapi.h>
|
||||
|
@ -152,3 +153,4 @@ Path windows::handleToPath(HANDLE handle) {
|
|||
#endif
|
||||
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#include "file-system.hh"
|
||||
|
||||
#ifdef WIN32
|
||||
namespace nix {
|
||||
|
||||
Descriptor openDirectory(const std::filesystem::path & path)
|
||||
|
@ -15,3 +16,4 @@ Descriptor openDirectory(const std::filesystem::path & path)
|
|||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
#include <ioapiset.h>
|
||||
#include "windows-error.hh"
|
||||
#ifdef WIN32
|
||||
# include <ioapiset.h>
|
||||
# include "windows-error.hh"
|
||||
|
||||
#include "logging.hh"
|
||||
#include "util.hh"
|
||||
#include "muxable-pipe.hh"
|
||||
# include "logging.hh"
|
||||
# include "util.hh"
|
||||
# include "muxable-pipe.hh"
|
||||
|
||||
namespace nix {
|
||||
|
||||
|
@ -68,3 +69,4 @@ void MuxablePipePollState::iterate(
|
|||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -7,6 +7,8 @@
|
|||
#include "file-path-impl.hh"
|
||||
#include "util.hh"
|
||||
|
||||
#ifdef WIN32
|
||||
|
||||
namespace nix {
|
||||
|
||||
std::string os_string_to_string(PathViewNG::string_view path)
|
||||
|
@ -22,3 +24,5 @@ std::filesystem::path::string_type string_to_os_string(std::string_view s)
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -23,6 +23,8 @@
|
|||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#ifdef WIN32
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
|
||||
|
@ -386,3 +388,5 @@ int execvpe(const wchar_t * file0, const wchar_t * const argv[], const wchar_t *
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
#include "file-system.hh"
|
||||
#include "windows-error.hh"
|
||||
|
||||
#ifdef WIN32
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
|
||||
|
@ -50,3 +51,4 @@ bool isRootUser() {
|
|||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#include "windows-async-pipe.hh"
|
||||
#include "windows-error.hh"
|
||||
|
||||
#ifdef WIN32
|
||||
|
||||
namespace nix::windows {
|
||||
|
||||
void AsyncPipe::createAsyncPipe(HANDLE iocp)
|
||||
|
@ -47,3 +49,5 @@ void AsyncPipe::close()
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
///@file
|
||||
|
||||
#include "file-descriptor.hh"
|
||||
#ifdef WIN32
|
||||
|
||||
namespace nix::windows {
|
||||
|
||||
|
@ -25,3 +26,4 @@ public:
|
|||
};
|
||||
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#include "windows-error.hh"
|
||||
|
||||
#ifdef WIN32
|
||||
#include <error.h>
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
|
@ -29,3 +30,4 @@ std::string WinError::renderError(DWORD lastError)
|
|||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#pragma once
|
||||
///@file
|
||||
|
||||
#ifdef WIN32
|
||||
#include <errhandlingapi.h>
|
||||
|
||||
#include "error.hh"
|
||||
|
@ -49,3 +50,4 @@ private:
|
|||
};
|
||||
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue