• R/O
  • SSH

posixpp: 提交

The main posixpp library and associated tests.


Commit MetaInfo

修订版857a394ad592a342eaa1a1b07f06bc316c99a4cb (tree)
时间2022-01-11 04:19:25
作者Eric Hopper <hopper@omni...>
CommiterEric Hopper

Log Message

Fix various random clang-tidy complaints.

更改概述

差异

diff -r 15ec4b4900e4 -r 857a394ad592 pubincludes/posixpp/expected.h
--- a/pubincludes/posixpp/expected.h Mon Jan 10 10:43:12 2022 -0800
+++ b/pubincludes/posixpp/expected.h Mon Jan 10 11:19:25 2022 -0800
@@ -27,18 +27,20 @@
2727 class no_error_here : public ::std::exception
2828 {
2929 public:
30- no_error_here() noexcept { }
30+ no_error_here() noexcept = default;
3131
32+ [[nodiscard]]
3233 char const *what() const noexcept override
3334 {
3435 return reason_;
3536 }
3637
3738 private:
38- no_error_here(char const *reason) noexcept : reason_(reason) { }
39+ explicit
40+ no_error_here(char const *reason) noexcept : reason_(reason) { }
3941
40- // Must point to a string with static storage duration:
41- char const *reason_ = "no error in expected when error requested";
42+ // Must point to a string with static storage duration:
43+ char const *reason_ = "no error in expected when error requested";
4244 };
4345
4446
diff -r 15ec4b4900e4 -r 857a394ad592 pubincludes/syscalls/linux/basic.h
--- a/pubincludes/syscalls/linux/basic.h Mon Jan 10 10:43:12 2022 -0800
+++ b/pubincludes/syscalls/linux/basic.h Mon Jan 10 11:19:25 2022 -0800
@@ -5,8 +5,7 @@
55 #include <cstdint>
66 #include <syscalls/linux/syscall.h>
77
8-namespace syscalls {
9-namespace linux {
8+namespace syscalls::linux {
109
1110 inline void exit [[noreturn]](int status) noexcept {
1211 syscall_expected(call_id::exit, status);
@@ -18,5 +17,4 @@
1817 __builtin_unreachable();
1918 }
2019
21-} // namespace linux
22-} // namespace syscalls
20+} // namespace syscalls::linux
diff -r 15ec4b4900e4 -r 857a394ad592 pubincludes/syscalls/linux/simple_io.h
--- a/pubincludes/syscalls/linux/simple_io.h Mon Jan 10 10:43:12 2022 -0800
+++ b/pubincludes/syscalls/linux/simple_io.h Mon Jan 10 11:19:25 2022 -0800
@@ -3,8 +3,7 @@
33 #include <cstdint>
44 #include <syscalls/linux/syscall.h>
55
6-namespace syscalls {
7-namespace linux {
6+namespace syscalls::linux {
87
98 inline expected_t open(char const *path, int flags, int mode) noexcept
109 {
@@ -46,5 +45,4 @@
4645 return syscall_expected(call_id::dup3, oldfd, newfd, flags);
4746 }
4847
49-}
50-}
48+} // namespace syscalls::linux
diff -r 15ec4b4900e4 -r 857a394ad592 pubincludes/syscalls/linux/syscall.h
--- a/pubincludes/syscalls/linux/syscall.h Mon Jan 10 10:43:12 2022 -0800
+++ b/pubincludes/syscalls/linux/syscall.h Mon Jan 10 11:19:25 2022 -0800
@@ -9,15 +9,13 @@
99 #ifdef __x86_64
1010 #include <syscalls/linux/x86_64/syscall.h>
1111
12-namespace syscalls {
13-namespace linux {
12+namespace syscalls::linux {
1413
1514 using x86_64::syscall_expected;
1615 using x86_64::expected_t;
1716 using x86_64::call_id;
1817
19-}
20-}
18+} // namespace syscalls::linux
2119
2220 #else
2321
diff -r 15ec4b4900e4 -r 857a394ad592 pubincludes/syscalls/linux/x86_64/syscall.h
--- a/pubincludes/syscalls/linux/x86_64/syscall.h Mon Jan 10 10:43:12 2022 -0800
+++ b/pubincludes/syscalls/linux/x86_64/syscall.h Mon Jan 10 11:19:25 2022 -0800
@@ -4,9 +4,7 @@
44 #include <utility>
55 #include <posixpp/expected.h>
66
7-namespace syscalls {
8-namespace linux {
9-namespace x86_64 {
7+namespace syscalls::linux::x86_64 {
108
119 enum class call_id : ::std::uint16_t;
1210 using val_t = ::std::int64_t;
@@ -359,6 +357,4 @@
359357 }
360358 } // namespace priv_
361359
362-} // namespace x86_64
363-} // namespace os_linux
364-} // namespace posixpp
360+} // namespace syscalls::linux::x86_64
diff -r 15ec4b4900e4 -r 857a394ad592 tests/simplefd.cpp
--- a/tests/simplefd.cpp Mon Jan 10 10:43:12 2022 -0800
+++ b/tests/simplefd.cpp Mon Jan 10 11:19:25 2022 -0800
@@ -1,8 +1,6 @@
1-#include <algorithm>
21 #include <posixpp/fd.h>
32 #include <posixpp/expected.h>
43 #include <posixpp/simpleio.h>
5-#include <fcntl.h>
64 #include <unistd.h>
75 #include "tempdir.h"
86 #define CATCH_CONFIG_MAIN
Show on old repository browser