mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-29 06:13:20 +00:00
Tighten up includes, some typedefs -> using
clangd was unable to resolve some symbols
This commit is contained in:
parent
b4b84f6847
commit
db72a05e89
17 changed files with 33 additions and 11 deletions
|
@ -5,6 +5,9 @@
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <cwchar>
|
#include <cwchar>
|
||||||
|
|
||||||
|
#include "io.h"
|
||||||
|
#include "maybe.h"
|
||||||
|
|
||||||
class parser_t;
|
class parser_t;
|
||||||
|
|
||||||
maybe_t<int> builtin_commandline(parser_t &parser, io_streams_t &streams, const wchar_t **argv);
|
maybe_t<int> builtin_commandline(parser_t &parser, io_streams_t &streams, const wchar_t **argv);
|
||||||
|
|
|
@ -5,6 +5,9 @@
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <cwchar>
|
#include <cwchar>
|
||||||
|
|
||||||
|
#include "io.h"
|
||||||
|
#include "maybe.h"
|
||||||
|
|
||||||
class parser_t;
|
class parser_t;
|
||||||
|
|
||||||
maybe_t<int> builtin_complete(parser_t &parser, io_streams_t &streams, const wchar_t **argv);
|
maybe_t<int> builtin_complete(parser_t &parser, io_streams_t &streams, const wchar_t **argv);
|
||||||
|
|
|
@ -5,6 +5,9 @@
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <cwchar>
|
#include <cwchar>
|
||||||
|
|
||||||
|
#include "io.h"
|
||||||
|
#include "maybe.h"
|
||||||
|
|
||||||
class parser_t;
|
class parser_t;
|
||||||
|
|
||||||
maybe_t<int> builtin_jobs(parser_t &parser, io_streams_t &streams, const wchar_t **argv);
|
maybe_t<int> builtin_jobs(parser_t &parser, io_streams_t &streams, const wchar_t **argv);
|
||||||
|
|
|
@ -5,6 +5,9 @@
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <cwchar>
|
#include <cwchar>
|
||||||
|
|
||||||
|
#include "io.h"
|
||||||
|
#include "maybe.h"
|
||||||
|
|
||||||
class parser_t;
|
class parser_t;
|
||||||
|
|
||||||
maybe_t<int> builtin_printf(parser_t &parser, io_streams_t &streams, const wchar_t **argv);
|
maybe_t<int> builtin_printf(parser_t &parser, io_streams_t &streams, const wchar_t **argv);
|
||||||
|
|
|
@ -5,6 +5,9 @@
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <cwchar>
|
#include <cwchar>
|
||||||
|
|
||||||
|
#include "io.h"
|
||||||
|
#include "maybe.h"
|
||||||
|
|
||||||
class parser_t;
|
class parser_t;
|
||||||
|
|
||||||
maybe_t<int> builtin_set_color(parser_t &parser, io_streams_t &streams, const wchar_t **argv);
|
maybe_t<int> builtin_set_color(parser_t &parser, io_streams_t &streams, const wchar_t **argv);
|
||||||
|
|
|
@ -5,6 +5,9 @@
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <cwchar>
|
#include <cwchar>
|
||||||
|
|
||||||
|
#include "maybe.h"
|
||||||
|
#include "io.h"
|
||||||
|
|
||||||
class parser_t;
|
class parser_t;
|
||||||
|
|
||||||
maybe_t<int> builtin_string(parser_t &parser, io_streams_t &streams, const wchar_t **argv);
|
maybe_t<int> builtin_string(parser_t &parser, io_streams_t &streams, const wchar_t **argv);
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <cwchar>
|
#include <cwchar>
|
||||||
|
|
||||||
|
#include "io.h"
|
||||||
|
|
||||||
class parser_t;
|
class parser_t;
|
||||||
|
|
||||||
maybe_t<int> builtin_ulimit(parser_t &parser, io_streams_t &streams, const wchar_t **argv);
|
maybe_t<int> builtin_ulimit(parser_t &parser, io_streams_t &streams, const wchar_t **argv);
|
||||||
|
|
|
@ -46,7 +46,7 @@ enum {
|
||||||
/// This completion looks to have the same string as an existing argument.
|
/// This completion looks to have the same string as an existing argument.
|
||||||
COMPLETE_DUPLICATES_ARGUMENT = 1 << 7
|
COMPLETE_DUPLICATES_ARGUMENT = 1 << 7
|
||||||
};
|
};
|
||||||
typedef int complete_flags_t;
|
using complete_flags_t = int;
|
||||||
|
|
||||||
/// std::function which accepts a completion string and returns its description.
|
/// std::function which accepts a completion string and returns its description.
|
||||||
using description_func_t = std::function<wcstring(const wcstring &)>;
|
using description_func_t = std::function<wcstring(const wcstring &)>;
|
||||||
|
|
|
@ -121,7 +121,7 @@ class enum_iter_t {
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
iterator_t operator++(int) {
|
const iterator_t operator++(int) {
|
||||||
auto res = *this;
|
auto res = *this;
|
||||||
v_ += 1;
|
v_ += 1;
|
||||||
return res;
|
return res;
|
||||||
|
|
|
@ -54,9 +54,9 @@ int fish_mkstemp_cloexec(char *);
|
||||||
/// expects a int (*func)(int) as its last parameter. tputs_arg_t is defined to always be what tputs
|
/// expects a int (*func)(int) as its last parameter. tputs_arg_t is defined to always be what tputs
|
||||||
/// expects. Hopefully.
|
/// expects. Hopefully.
|
||||||
#if defined(NCURSES_VERSION) || defined(__NetBSD__)
|
#if defined(NCURSES_VERSION) || defined(__NetBSD__)
|
||||||
typedef int tputs_arg_t;
|
using tputs_arg_t = int;
|
||||||
#else
|
#else
|
||||||
typedef char tputs_arg_t;
|
using tputs_arg_t = char;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef HAVE_WINSIZE
|
#ifndef HAVE_WINSIZE
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
// FISH_BUILD_VERSION="2.7.1-62-gc0480092-dirty"
|
// FISH_BUILD_VERSION="2.7.1-62-gc0480092-dirty"
|
||||||
// Arrange for it to become a variable.
|
// Arrange for it to become a variable.
|
||||||
static const char *const
|
static const char *const
|
||||||
#include "FISH-BUILD-VERSION-FILE"
|
#include "../FISH-BUILD-VERSION-FILE"
|
||||||
;
|
;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -270,7 +270,7 @@ class lru_cache_t {
|
||||||
const lru_link_t *node;
|
const lru_link_t *node;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
typedef std::pair<const wcstring &, const Contents &> value_type;
|
using value_type = std::pair<const wcstring &, const Contents &>;
|
||||||
|
|
||||||
explicit iterator(const lru_link_t *val) : node(val) {}
|
explicit iterator(const lru_link_t *val) : node(val) {}
|
||||||
void operator++() { node = node->prev; }
|
void operator++() { node = node->prev; }
|
||||||
|
|
|
@ -123,7 +123,7 @@ rgb_color_t parse_color(const env_var_t &var, bool is_background);
|
||||||
|
|
||||||
/// Sets what colors are supported.
|
/// Sets what colors are supported.
|
||||||
enum { color_support_term256 = 1 << 0, color_support_term24bit = 1 << 1 };
|
enum { color_support_term256 = 1 << 0, color_support_term24bit = 1 << 1 };
|
||||||
typedef unsigned int color_support_t;
|
using color_support_t = unsigned int;
|
||||||
color_support_t output_get_color_support();
|
color_support_t output_get_color_support();
|
||||||
void output_set_color_support(color_support_t val);
|
void output_set_color_support(color_support_t val);
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ void safe_report_exec_error(int err, const char *actual_cmd, const char *const *
|
||||||
|
|
||||||
#if FISH_USE_POSIX_SPAWN
|
#if FISH_USE_POSIX_SPAWN
|
||||||
/// A RAII type which wraps up posix_spawn's data structures.
|
/// A RAII type which wraps up posix_spawn's data structures.
|
||||||
class posix_spawner_t : noncopyable_t, nonmovable_t {
|
class posix_spawner_t : maybe_detail::noncopyable_t, maybe_detail::noncopyable_t {
|
||||||
public:
|
public:
|
||||||
/// Attempt to construct from a job and dup2 list.
|
/// Attempt to construct from a job and dup2 list.
|
||||||
/// The caller must check the error function, as this may fail.
|
/// The caller must check the error function, as this may fail.
|
||||||
|
|
|
@ -2,13 +2,14 @@
|
||||||
#include "config.h" // IWYU pragma: keep
|
#include "config.h" // IWYU pragma: keep
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <signal.h>
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#ifdef HAVE_SIGINFO_H
|
#ifdef HAVE_SIGINFO_H
|
||||||
#include <siginfo.h>
|
#include <siginfo.h>
|
||||||
#endif
|
#endif
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
|
|
||||||
|
#include <csignal>
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "event.h"
|
#include "event.h"
|
||||||
#include "fallback.h" // IWYU pragma: keep
|
#include "fallback.h" // IWYU pragma: keep
|
||||||
|
|
|
@ -2,7 +2,8 @@
|
||||||
#ifndef FISH_SIGNALH
|
#ifndef FISH_SIGNALH
|
||||||
#define FISH_SIGNALH
|
#define FISH_SIGNALH
|
||||||
|
|
||||||
#include <signal.h>
|
#include <cstdint>
|
||||||
|
#include <csignal>
|
||||||
|
|
||||||
/// Get the integer signal value representing the specified signal, or -1 of no signal was found.
|
/// Get the integer signal value representing the specified signal, or -1 of no signal was found.
|
||||||
int wcs2sig(const wchar_t *str);
|
int wcs2sig(const wchar_t *str);
|
||||||
|
|
|
@ -37,7 +37,7 @@ enum class token_type_t {
|
||||||
/// Make an effort to continue after an error.
|
/// Make an effort to continue after an error.
|
||||||
#define TOK_CONTINUE_AFTER_ERROR 8
|
#define TOK_CONTINUE_AFTER_ERROR 8
|
||||||
|
|
||||||
typedef unsigned int tok_flags_t;
|
using tok_flags_t = unsigned int;
|
||||||
|
|
||||||
enum class tokenizer_error_t {
|
enum class tokenizer_error_t {
|
||||||
none,
|
none,
|
||||||
|
|
Loading…
Reference in a new issue