Tighten up includes, some typedefs -> using

clangd was unable to resolve some symbols
This commit is contained in:
Aaron Gyes 2021-09-21 17:57:25 -07:00
parent b4b84f6847
commit db72a05e89
17 changed files with 33 additions and 11 deletions

View file

@ -5,6 +5,9 @@
#include <cstring>
#include <cwchar>
#include "io.h"
#include "maybe.h"
class parser_t;
maybe_t<int> builtin_commandline(parser_t &parser, io_streams_t &streams, const wchar_t **argv);

View file

@ -5,6 +5,9 @@
#include <cstring>
#include <cwchar>
#include "io.h"
#include "maybe.h"
class parser_t;
maybe_t<int> builtin_complete(parser_t &parser, io_streams_t &streams, const wchar_t **argv);

View file

@ -5,6 +5,9 @@
#include <cstring>
#include <cwchar>
#include "io.h"
#include "maybe.h"
class parser_t;
maybe_t<int> builtin_jobs(parser_t &parser, io_streams_t &streams, const wchar_t **argv);

View file

@ -5,6 +5,9 @@
#include <cstring>
#include <cwchar>
#include "io.h"
#include "maybe.h"
class parser_t;
maybe_t<int> builtin_printf(parser_t &parser, io_streams_t &streams, const wchar_t **argv);

View file

@ -5,6 +5,9 @@
#include <cstring>
#include <cwchar>
#include "io.h"
#include "maybe.h"
class parser_t;
maybe_t<int> builtin_set_color(parser_t &parser, io_streams_t &streams, const wchar_t **argv);

View file

@ -5,6 +5,9 @@
#include <cstring>
#include <cwchar>
#include "maybe.h"
#include "io.h"
class parser_t;
maybe_t<int> builtin_string(parser_t &parser, io_streams_t &streams, const wchar_t **argv);

View file

@ -5,6 +5,8 @@
#include <cstring>
#include <cwchar>
#include "io.h"
class parser_t;
maybe_t<int> builtin_ulimit(parser_t &parser, io_streams_t &streams, const wchar_t **argv);

View file

@ -46,7 +46,7 @@ enum {
/// This completion looks to have the same string as an existing argument.
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.
using description_func_t = std::function<wcstring(const wcstring &)>;

View file

@ -121,7 +121,7 @@ class enum_iter_t {
return *this;
}
iterator_t operator++(int) {
const iterator_t operator++(int) {
auto res = *this;
v_ += 1;
return res;

View file

@ -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. Hopefully.
#if defined(NCURSES_VERSION) || defined(__NetBSD__)
typedef int tputs_arg_t;
using tputs_arg_t = int;
#else
typedef char tputs_arg_t;
using tputs_arg_t = char;
#endif
#ifndef HAVE_WINSIZE

View file

@ -9,7 +9,7 @@
// FISH_BUILD_VERSION="2.7.1-62-gc0480092-dirty"
// Arrange for it to become a variable.
static const char *const
#include "FISH-BUILD-VERSION-FILE"
#include "../FISH-BUILD-VERSION-FILE"
;
#endif

View file

@ -270,7 +270,7 @@ class lru_cache_t {
const lru_link_t *node;
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) {}
void operator++() { node = node->prev; }

View file

@ -123,7 +123,7 @@ rgb_color_t parse_color(const env_var_t &var, bool is_background);
/// Sets what colors are supported.
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();
void output_set_color_support(color_support_t val);

View file

@ -55,7 +55,7 @@ void safe_report_exec_error(int err, const char *actual_cmd, const char *const *
#if FISH_USE_POSIX_SPAWN
/// 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:
/// Attempt to construct from a job and dup2 list.
/// The caller must check the error function, as this may fail.

View file

@ -2,13 +2,14 @@
#include "config.h" // IWYU pragma: keep
#include <errno.h>
#include <signal.h>
#include <stdio.h>
#ifdef HAVE_SIGINFO_H
#include <siginfo.h>
#endif
#include <pthread.h>
#include <csignal>
#include "common.h"
#include "event.h"
#include "fallback.h" // IWYU pragma: keep

View file

@ -2,7 +2,8 @@
#ifndef 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.
int wcs2sig(const wchar_t *str);

View file

@ -37,7 +37,7 @@ enum class token_type_t {
/// Make an effort to continue after an error.
#define TOK_CONTINUE_AFTER_ERROR 8
typedef unsigned int tok_flags_t;
using tok_flags_t = unsigned int;
enum class tokenizer_error_t {
none,