1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

Fix various sparse warnings

Mostly non-ANSI function declarations, using 0 as NULL and inline
function prototypes. Also removed unused S_HTTP_100 network state
enum type, which text message contained unknown escape sequence: '\?'.
This commit is contained in:
Jonas Fonseca 2005-11-24 15:38:47 +01:00 committed by Jonas Fonseca
parent 2dd2e10a28
commit 5dffe2e8ac
10 changed files with 22 additions and 25 deletions

View File

@ -594,7 +594,7 @@ open_bookmark_folder(struct session *ses, unsigned char *foldername)
|| !*bookmark->url)
continue;
uri = get_translated_uri(bookmark->url, 0);
uri = get_translated_uri(bookmark->url, NULL);
if (!uri) continue;
/* Save the first bookmark for the current tab */

View File

@ -79,7 +79,7 @@ get_bookmark_uri(struct listbox_item *item)
struct bookmark *bookmark = item->udata;
return bookmark->url && *bookmark->url
? get_translated_uri(bookmark->url, 0) : NULL;
? get_translated_uri(bookmark->url, NULL) : NULL;
}
static struct listbox_item *

View File

@ -491,7 +491,7 @@ print_full_help(struct option *tree, unsigned char *path)
}
static void
print_short_help()
print_short_help(void)
{
#define ALIGN_WIDTH 20
struct option *option;

View File

@ -25,7 +25,7 @@ struct timer {
static INIT_LIST_HEAD(timers);
int
get_timers_count()
get_timers_count(void)
{
return list_size(&timers);

View File

@ -452,7 +452,19 @@ done_connection(struct connection *conn)
check_queue_bugs();
}
static inline void add_to_queue(struct connection *conn);
static inline void
add_to_queue(struct connection *conn)
{
struct connection *c;
enum connection_priority priority = get_priority(conn);
foreach (c, connection_queue)
if (get_priority(c) > priority)
break;
add_at_pos(c->prev, conn);
}
/* Returns zero if no callback was done and the keepalive connection should be
* deleted or non-zero if the keepalive connection should not be deleted. */
@ -647,19 +659,6 @@ abort_all_keepalive_connections(void)
}
static inline void
add_to_queue(struct connection *conn)
{
struct connection *c;
enum connection_priority priority = get_priority(conn);
foreach (c, connection_queue)
if (get_priority(c) > priority)
break;
add_at_pos(c->prev, conn);
}
static void
sort_queue(void)
{

View File

@ -68,7 +68,6 @@ struct s_msg_dsc {
"programs is not supported.")},
{S_HTTP_ERROR, N_("Bad HTTP response")},
{S_HTTP_100, N_("HTTP 100 (\?\?\?)")},
{S_HTTP_204, N_("No content")},
{S_FILE_TYPE, N_("Unknown file type")},

View File

@ -71,8 +71,7 @@ enum connection_state {
S_NO_FORCED_DNS = -100019,
S_HTTP_ERROR = -100100,
S_HTTP_100 = -100101,
S_HTTP_204 = -100102,
S_HTTP_204 = -100101,
S_FILE_TYPE = -100200,
S_FILE_ERROR = -100201,

View File

@ -684,7 +684,7 @@ get_output_handle(void)
}
int
get_ctl_handle()
get_ctl_handle(void)
{
static int fd = -1;

View File

@ -228,7 +228,7 @@ struct module http_protocol_module = struct_module(
static void
done_http()
done_http(void)
{
mem_free_if(proxy_auth.realm);
mem_free_if(proxy_auth.nonce);
@ -241,7 +241,7 @@ done_http()
}
static void
init_accept_charset()
init_accept_charset(void)
{
struct string ac;
unsigned char *cs;

View File

@ -481,7 +481,7 @@ fastfind_index(struct fastfind_index *index, enum fastfind_flags flags)
info->count++;
}
if (!info->count) return 0;
if (!info->count) return NULL;
init_idxtab(info);