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

Added macro foreach_module_builtin. Killed some warnings of gcc-4.2.

This commit is contained in:
Witold Filipczyk 2007-01-18 17:05:16 +01:00 committed by Witold Filipczyk
parent 036d2d8475
commit 99cff6aa70
3 changed files with 8 additions and 3 deletions

View File

@ -45,6 +45,11 @@ struct module {
module; \
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 */
static inline int
sizeof_modules(struct module **modules)

View File

@ -54,7 +54,7 @@ add_modules_to_string(struct string *string, struct terminal *term)
if (last_newline)
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 (string->length - last_split > 70) {
add_char_to_string(string, '\n');

View File

@ -42,7 +42,7 @@ get_content_type_backends(unsigned char *extension)
struct mime_backend *backend;
int i;
foreach_module (backend, mime_backends, i) {
foreach_module_builtin (backend, mime_backends, i) {
if (backend->get_content_type) {
unsigned char *content_type;
@ -60,7 +60,7 @@ get_mime_handler_backends(unsigned char *ctype, int have_x)
struct mime_backend *backend;
int i;
foreach_module (backend, mime_backends, i) {
foreach_module_builtin (backend, mime_backends, i) {
if (backend->get_mime_handler) {
struct mime_handler *handler;