mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-17 07:42:45 +08:00
Attempt to silence some warnings
This commit is contained in:
parent
36ef521c0e
commit
58ebdd4a7e
|
@ -428,7 +428,7 @@ static void builtin_bind_list(const wchar_t *bind_mode)
|
|||
if (input_terminfo_get_name(seq, tname))
|
||||
{
|
||||
append_format(stdout_buffer, L"bind -k %ls -M %ls -m %ls", tname.c_str(), mode.c_str(), sets_mode.c_str());
|
||||
for (int i = 0; i < ecmds.size(); i++)
|
||||
for (size_t i = 0; i < ecmds.size(); i++)
|
||||
{
|
||||
wcstring ecmd = ecmds.at(i);
|
||||
append_format(stdout_buffer, L" %ls", escape(ecmd.c_str(), 1));
|
||||
|
@ -439,7 +439,7 @@ static void builtin_bind_list(const wchar_t *bind_mode)
|
|||
{
|
||||
const wcstring eseq = escape_string(seq, 1);
|
||||
append_format(stdout_buffer, L"bind -k %ls -M %ls -m %ls", eseq.c_str(), mode.c_str(), sets_mode.c_str());
|
||||
for (int i = 0; i < ecmds.size(); i++)
|
||||
for (size_t i = 0; i < ecmds.size(); i++)
|
||||
{
|
||||
wcstring ecmd = ecmds.at(i);
|
||||
append_format(stdout_buffer, L" %ls", escape(ecmd.c_str(), 1));
|
||||
|
|
|
@ -464,7 +464,7 @@ static wcstring full_escape(const wchar_t *in)
|
|||
{
|
||||
out.push_back(c);
|
||||
}
|
||||
else if (c <= ASCII_MAX)
|
||||
else if (c <= (wchar_t)ASCII_MAX)
|
||||
{
|
||||
// See #1225 for discussion of use of ASCII_MAX here
|
||||
append_format(out, L"\\x%.2x", c);
|
||||
|
|
|
@ -802,6 +802,7 @@ wchar_t *wcstok(wchar_t *wcs, const wchar_t *delim, wchar_t **save_ptr)
|
|||
|
||||
/* Fallback implementations of wcsdup and wcscasecmp. On systems where these are not needed (e.g. building on Linux) these should end up just being stripped, as they are static functions that are not referenced in this file.
|
||||
*/
|
||||
__attribute__((unused))
|
||||
static wchar_t *wcsdup_fallback(const wchar_t *in)
|
||||
{
|
||||
size_t len=wcslen(in);
|
||||
|
|
|
@ -156,7 +156,7 @@ static const wchar_t * const name_arr[] =
|
|||
|
||||
wcstring describe_char(wint_t c)
|
||||
{
|
||||
wchar_t initial_cmd_char = R_BEGINNING_OF_LINE;
|
||||
wint_t initial_cmd_char = R_BEGINNING_OF_LINE;
|
||||
size_t name_count = sizeof name_arr / sizeof *name_arr;
|
||||
if (c >= initial_cmd_char && c < initial_cmd_char + name_count)
|
||||
{
|
||||
|
|
13
iothread.cpp
13
iothread.cpp
|
@ -114,6 +114,11 @@ static void enqueue_thread_result(SpawnRequest_t *req)
|
|||
s_result_queue.push(req);
|
||||
}
|
||||
|
||||
static void *this_thread()
|
||||
{
|
||||
return (void *)(intptr_t)pthread_self();
|
||||
}
|
||||
|
||||
/* The function that does thread work. */
|
||||
static void *iothread_worker(void *unused)
|
||||
{
|
||||
|
@ -121,7 +126,7 @@ static void *iothread_worker(void *unused)
|
|||
struct SpawnRequest_t *req;
|
||||
while ((req = dequeue_spawn_request()) != NULL)
|
||||
{
|
||||
IOTHREAD_LOG fprintf(stderr, "pthread %p dequeued %p\n", pthread_self(), req);
|
||||
IOTHREAD_LOG fprintf(stderr, "pthread %p dequeued %p\n", this_thread(), req);
|
||||
/* Unlock the queue while we execute the request */
|
||||
locker.unlock();
|
||||
|
||||
|
@ -150,7 +155,7 @@ static void *iothread_worker(void *unused)
|
|||
assert(s_active_thread_count > 0);
|
||||
s_active_thread_count -= 1;
|
||||
|
||||
IOTHREAD_LOG fprintf(stderr, "pthread %p exiting\n", pthread_self());
|
||||
IOTHREAD_LOG fprintf(stderr, "pthread %p exiting\n", this_thread());
|
||||
|
||||
/* We're done */
|
||||
return NULL;
|
||||
|
@ -165,13 +170,13 @@ static void iothread_spawn()
|
|||
VOMIT_ON_FAILURE(pthread_sigmask(SIG_BLOCK, &new_set, &saved_set));
|
||||
|
||||
/* Spawn a thread. If this fails, it means there's already a bunch of threads; it is very unlikely that they are all on the verge of exiting, so one is likely to be ready to handle extant requests. So we can ignore failure with some confidence. */
|
||||
pthread_t thread = NULL;
|
||||
pthread_t thread = 0;
|
||||
pthread_create(&thread, NULL, iothread_worker, NULL);
|
||||
|
||||
/* We will never join this thread */
|
||||
VOMIT_ON_FAILURE(pthread_detach(thread));
|
||||
|
||||
IOTHREAD_LOG fprintf(stderr, "pthread %p spawned\n", thread);
|
||||
IOTHREAD_LOG fprintf(stderr, "pthread %p spawned\n", (void *)(intptr_t)thread);
|
||||
|
||||
/* Restore our sigmask */
|
||||
VOMIT_ON_FAILURE(pthread_sigmask(SIG_SETMASK, &saved_set, NULL));
|
||||
|
|
|
@ -525,7 +525,7 @@ class parse_ll_t
|
|||
{
|
||||
PARSE_ASSERT(! symbol_stack.empty());
|
||||
const parse_stack_element_t &top_symbol = symbol_stack.back();
|
||||
PARSE_ASSERT(top_symbol.node_idx != -1);
|
||||
PARSE_ASSERT(top_symbol.node_idx != NODE_OFFSET_INVALID);
|
||||
PARSE_ASSERT(top_symbol.node_idx < nodes.size());
|
||||
return nodes.at(top_symbol.node_idx);
|
||||
}
|
||||
|
|
|
@ -866,10 +866,9 @@ int parser_t::eval(const wcstring &cmd, const io_chain_t &io, enum block_type_t
|
|||
execution_contexts.push_back(ctx);
|
||||
|
||||
/* Execute the first node */
|
||||
int result = 1;
|
||||
if (! tree.empty())
|
||||
{
|
||||
result = this->eval_block_node(0, io, block_type);
|
||||
this->eval_block_node(0, io, block_type);
|
||||
}
|
||||
|
||||
/* Clean up the execution context stack */
|
||||
|
|
2
proc.cpp
2
proc.cpp
|
@ -383,7 +383,7 @@ static void mark_process_status(const job_t *j, process_t *p, int status)
|
|||
}
|
||||
else
|
||||
{
|
||||
ssize_t ignore;
|
||||
ssize_t ignore __attribute__((unused));
|
||||
|
||||
/* This should never be reached */
|
||||
p->completed = 1;
|
||||
|
|
|
@ -48,7 +48,7 @@ efficient way for transforming that to the desired screen content.
|
|||
#include "pager.h"
|
||||
|
||||
/** The number of characters to indent new blocks */
|
||||
#define INDENT_STEP 4
|
||||
#define INDENT_STEP 4u
|
||||
|
||||
/** The initial screen width */
|
||||
#define SCREEN_WIDTH_UNINITIALIZED -1
|
||||
|
|
Loading…
Reference in New Issue
Block a user