mirror of
https://github.com/rkd77/elinks.git
synced 2025-01-03 14:57:44 -05:00
Added macro foreach_module_builtin. Killed some warnings of gcc-4.2.
This commit is contained in:
parent
036d2d8475
commit
99cff6aa70
@ -45,6 +45,11 @@ struct module {
|
|||||||
module; \
|
module; \
|
||||||
i++, module = modules[i])
|
i++, module = modules[i])
|
||||||
|
|
||||||
|
#define foreach_module_builtin(module, modules, i) \
|
||||||
|
for (i = 0, module = modules[i]; \
|
||||||
|
module; \
|
||||||
|
i++, module = modules[i])
|
||||||
|
|
||||||
/* The module table has to be NULL terminates */
|
/* The module table has to be NULL terminates */
|
||||||
static inline int
|
static inline int
|
||||||
sizeof_modules(struct module **modules)
|
sizeof_modules(struct module **modules)
|
||||||
|
@ -54,7 +54,7 @@ add_modules_to_string(struct string *string, struct terminal *term)
|
|||||||
if (last_newline)
|
if (last_newline)
|
||||||
last_split = last_newline - string->source;
|
last_split = last_newline - string->source;
|
||||||
|
|
||||||
foreach_module (module, builtin_modules, i) {
|
foreach_module_builtin (module, builtin_modules, i) {
|
||||||
if (i > 0) add_to_string(string, ", ");
|
if (i > 0) add_to_string(string, ", ");
|
||||||
if (string->length - last_split > 70) {
|
if (string->length - last_split > 70) {
|
||||||
add_char_to_string(string, '\n');
|
add_char_to_string(string, '\n');
|
||||||
|
@ -42,7 +42,7 @@ get_content_type_backends(unsigned char *extension)
|
|||||||
struct mime_backend *backend;
|
struct mime_backend *backend;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
foreach_module (backend, mime_backends, i) {
|
foreach_module_builtin (backend, mime_backends, i) {
|
||||||
if (backend->get_content_type) {
|
if (backend->get_content_type) {
|
||||||
unsigned char *content_type;
|
unsigned char *content_type;
|
||||||
|
|
||||||
@ -60,7 +60,7 @@ get_mime_handler_backends(unsigned char *ctype, int have_x)
|
|||||||
struct mime_backend *backend;
|
struct mime_backend *backend;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
foreach_module (backend, mime_backends, i) {
|
foreach_module_builtin (backend, mime_backends, i) {
|
||||||
if (backend->get_mime_handler) {
|
if (backend->get_mime_handler) {
|
||||||
struct mime_handler *handler;
|
struct mime_handler *handler;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user