1
0
Fork 0

Compare commits

...

8 Commits

Author SHA1 Message Date
Witold Filipczyk e136d663c9 [idn2] This else does not make sense 2024-04-18 20:33:52 +02:00
Witold Filipczyk ac7292ef82 [idn] one variable less 2024-04-18 19:31:48 +02:00
Witold Filipczyk 4d7e94c5e4 [idn2] Warnings when built with -Didn=false . Spotted by jon 2024-04-18 19:08:23 +02:00
Witold Filipczyk cdf02f5e0c [libcss] Removed unused function 2024-04-18 17:12:27 +02:00
Witold Filipczyk 9ee4ebfa46 [bfu] clang's warning 2024-04-18 17:09:11 +02:00
Witold Filipczyk 77addf7277 [scripting] silence warning 2024-04-18 09:15:10 +02:00
Witold Filipczyk ebe3672e10 [select] unused function 2024-04-18 08:57:52 +02:00
Witold Filipczyk 324bd02aa9 [encoding] compilation fix (unsigned int bitfields) 2024-04-18 08:51:56 +02:00
8 changed files with 19 additions and 93 deletions

View File

@ -222,6 +222,7 @@ struct widget_data *select_widget_by_id(struct dialog_data *dlg_data, int i);
#define add_dlg_end(dlg, n) \
do { \
if (0 && (n)); \
assert(n == (dlg)->number_of_widgets); \
} while (0)

View File

@ -166,8 +166,10 @@ lookup_cmd(struct option *o, char ***argv, int *argc)
{
struct sockaddr_storage *addrs = NULL;
int addrno, i;
char *idname, *idname2;
int allocated = 0;
char *idname;
#ifdef CONFIG_IDN2
char *idname2 = NULL;
#endif
if (!*argc) return gettext("Parameter expected");
if (*argc > 1) return gettext("Too many parameters");
@ -182,7 +184,6 @@ lookup_cmd(struct option *o, char ***argv, int *argc)
if (code == IDN2_OK) {
idname = idname2;
allocated = 1;
}
}
#endif
@ -193,9 +194,12 @@ lookup_cmd(struct option *o, char ***argv, int *argc)
#else
usrerror(gettext("Host not found"));
#endif
if (allocated) {
#ifdef CONFIG_IDN2
if (idname2) {
free(idname2);
}
#endif
return "";
}
@ -224,9 +228,11 @@ lookup_cmd(struct option *o, char ***argv, int *argc)
fflush(stdout);
if (allocated) {
#ifdef CONFIG_IDN2
if (idname2) {
free(idname2);
}
#endif
return "";
}

View File

@ -78,9 +78,6 @@ static css_error set_libcss_node_data(void *pw, void *node,
static css_error get_libcss_node_data(void *pw, void *node,
void **libcss_node_data);
static css_error compute_font_size(void *pw, const css_hint *parent,
css_hint *size);
static css_error named_ancestor_node(void *pw, void *node,
const css_qname *qname, void **ancestor);
@ -391,80 +388,6 @@ css_computed_style *nscss_get_blank_style(nscss_select_ctx *ctx,
return composed;
}
/**
* Font size computation callback for libcss
*
* \param pw Computation context
* \param parent Parent font size (absolute)
* \param size Font size to compute
* \return CSS_OK on success
*
* \post \a size will be an absolute font size
*/
css_error compute_font_size(void *pw, const css_hint *parent, css_hint *size)
{
#if 0
static css_hint_length sizes[] = {
{ FLTTOFIX(6.75), CSS_UNIT_PT },
{ FLTTOFIX(7.50), CSS_UNIT_PT },
{ FLTTOFIX(9.75), CSS_UNIT_PT },
{ FLTTOFIX(12.0), CSS_UNIT_PT },
{ FLTTOFIX(13.5), CSS_UNIT_PT },
{ FLTTOFIX(18.0), CSS_UNIT_PT },
{ FLTTOFIX(24.0), CSS_UNIT_PT }
};
const css_hint_length *parent_size;
UNUSED(pw);
/* Grab parent size, defaulting to medium if none */
if (parent == NULL) {
parent_size = &sizes[CSS_FONT_SIZE_MEDIUM - 1];
} else {
assert(parent->status == CSS_FONT_SIZE_DIMENSION);
assert(parent->data.length.unit != CSS_UNIT_EM);
assert(parent->data.length.unit != CSS_UNIT_EX);
parent_size = &parent->data.length;
}
assert(size->status != CSS_FONT_SIZE_INHERIT);
if (size->status < CSS_FONT_SIZE_LARGER) {
/* Keyword -- simple */
size->data.length = sizes[size->status - 1];
} else if (size->status == CSS_FONT_SIZE_LARGER) {
/** \todo Step within table, if appropriate */
size->data.length.value =
FMUL(parent_size->value, FLTTOFIX(1.2));
size->data.length.unit = parent_size->unit;
} else if (size->status == CSS_FONT_SIZE_SMALLER) {
/** \todo Step within table, if appropriate */
size->data.length.value =
FMUL(parent_size->value, FLTTOFIX(1.2));
size->data.length.unit = parent_size->unit;
} else if (size->data.length.unit == CSS_UNIT_EM ||
size->data.length.unit == CSS_UNIT_EX) {
size->data.length.value =
FMUL(size->data.length.value, parent_size->value);
if (size->data.length.unit == CSS_UNIT_EX) {
size->data.length.value = FMUL(size->data.length.value,
FLTTOFIX(0.6));
}
size->data.length.unit = parent_size->unit;
} else if (size->data.length.unit == CSS_UNIT_PCT) {
size->data.length.value = FDIV(FMUL(size->data.length.value,
parent_size->value), FLTTOFIX(100));
size->data.length.unit = parent_size->unit;
}
#endif
size->data.length.unit = CSS_UNIT_EM;
size->data.length.value = FMUL(1, 1);
size->status = CSS_FONT_SIZE_DIMENSION;
return CSS_OK;
}
/******************************************************************************
* Style selection callbacks *

View File

@ -36,8 +36,8 @@ struct bz2_enc_data {
* end-of-stream marker and all data has been decompressed.
* Then we neither read from the file nor call BZ2_bzDecompress
* any more. */
int last_read:1;
int after_end:1;
unsigned int last_read:1;
unsigned int after_end:1;
/* A buffer for data that has been read from the file but not
* yet decompressed. fbz_stream.next_in and fbz_stream.avail_in

View File

@ -27,8 +27,8 @@
struct lzma_enc_data {
lzma_stream flzma_stream;
int fdread;
int last_read:1;
int after_end:1;
unsigned int last_read:1;
unsigned int after_end:1;
unsigned char buf[ELINKS_BZ_BUFFER_LENGTH];
};

View File

@ -35,7 +35,7 @@ struct zstd_enc_data {
size_t sent_pos;
/* The file descriptor from which we read. */
int fdread;
int decoded:1;
unsigned int decoded:1;
};
static int

View File

@ -790,12 +790,6 @@ int event_enabled = 0;
#define sizeof_struct_event (event_get_struct_event_size())
#endif
static inline
struct event *timer_event(struct timer *tm)
{
return (struct event *)((char *)tm - sizeof_struct_event);
}
#ifdef HAVE_EVENT_BASE_SET
struct event_base *event_base;
#endif

View File

@ -164,6 +164,8 @@ script_hook_pre_format_html(va_list ap, void *data)
struct fragment *fragment = get_cache_fragment(cached);
char *url = struri(cached->uri);
evhook_use_params(ses && cached);
if (my_perl && url && cached->length && *fragment->data)
do_script_hook_pre_format_html(url, cached, fragment);