Mostly line breaks, one instance of tabs!

For some reason clang-format insists on two spaces before a same-line comment?

(I continue to be unimpressed with super-strict line length limits,
but I continue to believe in automatic styling, so it is what it is)

[ci skip]
This commit is contained in:
Fabian Homborg
2020-02-17 14:12:27 +01:00
parent 4cefcd4327
commit 65883e0e40
11 changed files with 44 additions and 31 deletions

View File

@@ -17,8 +17,8 @@
#include <procfs.h>
#endif
#if __APPLE__
#include <sys/time.h> // Required to build with old SDK versions
#include <sys/proc.h>
#include <sys/time.h> // Required to build with old SDK versions
#else
#include <dirent.h>
#include <sys/stat.h>
@@ -194,7 +194,7 @@ static size_t parse_slice(const wchar_t *in, wchar_t **end_ptr, std::vector<long
if (idx.empty() && in[pos] == L'.' && in[pos + 1] == L'.') {
// If we are at the first index expression, a missing start index means the range starts
// at the first item.
tmp = 1; // first index
tmp = 1; // first index
end = &in[pos];
} else {
tmp = fish_wcstol(&in[pos], &end);
@@ -212,13 +212,13 @@ static size_t parse_slice(const wchar_t *in, wchar_t **end_ptr, std::vector<long
if (in[pos] == L'.' && in[pos + 1] == L'.') {
pos += 2;
while (in[pos] == INTERNAL_SEPARATOR) pos++;
while (iswspace(in[pos])) pos++; // Allow the space in "[.. ]".
while (iswspace(in[pos])) pos++; // Allow the space in "[.. ]".
long tmp1;
// Check if we are at the last index range expression, a missing end index means the
// range spans until the last item.
if (in[pos] == L']') {
tmp1 = -1; // last index
tmp1 = -1; // last index
end = &in[pos];
} else {
tmp1 = fish_wcstol(&in[pos], &end);

View File

@@ -4,7 +4,7 @@
#include <pthread.h>
#include <cstdint> // for uint64_t
#include <cstdint> // for uint64_t
#include <functional>
#include <type_traits>

View File

@@ -268,10 +268,13 @@ bool process_t::is_internal() const {
case process_type_t::exec:
return false;
default:
assert(false && "The fish developers forgot to include a process_t. Please report a bug");
assert(false &&
"The fish developers forgot to include a process_t. Please report a bug");
return true;
}
assert(false && "process_t::is_internal: Total logic failure, universe is broken. Please replace universe and retry.");
assert(false &&
"process_t::is_internal: Total logic failure, universe is broken. Please replace "
"universe and retry.");
return true;
}

View File

@@ -375,7 +375,8 @@ maybe_t<pipe_or_redir_t> pipe_or_redir_t::from_string(const wchar_t *buff) {
: STDOUT_FILENO; // like >|
} else if (try_consume(L'&')) {
// This is a redirection to an fd.
// Note that we allow ">>&", but it's still just writing to the fd - "appending" to it doesn't make sense.
// Note that we allow ">>&", but it's still just writing to the fd - "appending" to
// it doesn't make sense.
result.mode = redirection_mode_t::fd;
result.fd = has_fd ? parse_fd(fd_start, fd_end) // like 1>&2
: STDOUT_FILENO; // like >&2
@@ -383,7 +384,8 @@ maybe_t<pipe_or_redir_t> pipe_or_redir_t::from_string(const wchar_t *buff) {
// This is a redirection to a file.
result.fd = has_fd ? parse_fd(fd_start, fd_end) // like 1> file.txt
: STDOUT_FILENO; // like > file.txt
if (result.mode != redirection_mode_t::append) result.mode = redirection_mode_t::overwrite;
if (result.mode != redirection_mode_t::append)
result.mode = redirection_mode_t::overwrite;
// Note 'echo abc >>? file' is valid: it means append and noclobber.
// But here "noclobber" means the file must not exist, so appending
// can be ignored.

View File

@@ -266,8 +266,8 @@ int fd_check_is_remote(int fd) {
// these are in varying headers. Simply hard code them.
// NOTE: The cast is necessary for 32-bit systems because of the 4-byte CIFS_MAGIC_NUMBER
switch ((unsigned int)buf.f_type) {
case 0x6969: // NFS_SUPER_MAGIC
case 0x517B: // SMB_SUPER_MAGIC
case 0x6969: // NFS_SUPER_MAGIC
case 0x517B: // SMB_SUPER_MAGIC
case 0xFF534D42u: // CIFS_MAGIC_NUMBER
return 1;
default: