From 99cff6aa7036c90305b71ef0a3c9c85b23c5d341 Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Thu, 18 Jan 2007 17:05:16 +0100 Subject: [PATCH] Added macro foreach_module_builtin. Killed some warnings of gcc-4.2. --- src/main/module.h | 5 +++++ src/main/version.c | 2 +- src/mime/backend/common.c | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main/module.h b/src/main/module.h index 3b56e40bd..e3ebf8f5b 100644 --- a/src/main/module.h +++ b/src/main/module.h @@ -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) diff --git a/src/main/version.c b/src/main/version.c index 5f425037c..ebca1878e 100644 --- a/src/main/version.c +++ b/src/main/version.c @@ -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'); diff --git a/src/mime/backend/common.c b/src/mime/backend/common.c index 33ae01e79..8295e14b6 100644 --- a/src/mime/backend/common.c +++ b/src/mime/backend/common.c @@ -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;