From 43cbaab1fc66139d3dfd87a2f8b6be5d906ee317 Mon Sep 17 00:00:00 2001 From: Florent Bruneau Date: Tue, 14 Oct 2008 22:58:14 +0200 Subject: [PATCH] Just one more thing... Signed-off-by: Florent Bruneau --- common.ld | 4 ++-- common/common.h | 4 ++-- mk/cflags.mk | 4 ++-- mk/common.mk | 4 ++-- postlicyd/filter.c | 5 +++-- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/common.ld b/common.ld index 6f7485f..e9b8470 100644 --- a/common.ld +++ b/common.ld @@ -2,9 +2,9 @@ SECTIONS { .rodata : { . = ALIGN(8); __madinit = . ; - *( .mad.init ) + *( MAD_INIT ) QUAD(0) - *( .mad.exit ) + *( MAD_EXIT ) __madexit = . ; } } diff --git a/common/common.h b/common/common.h index e2f2b3b..7a176a4 100644 --- a/common/common.h +++ b/common/common.h @@ -63,8 +63,8 @@ typedef int (*initcall_t)(void); typedef void (*exitcall_t)(void); -#define __init __attribute__((__used__,__section__(".mad.init"))) -#define __exit __attribute__((__used__,__section__(".mad.exit"))) +#define __init __attribute__((__used__,__section__("MAD_INIT,__text,regular"))) +#define __exit __attribute__((__used__,__section__("MAD_EXIT,__text,regular"))) #define module_init(fn) static __init initcall_t __init_##fn = fn; #define module_exit(fn) static __exit exitcall_t __exit_##fn = fn; diff --git a/mk/cflags.mk b/mk/cflags.mk index c05a843..07f1870 100644 --- a/mk/cflags.mk +++ b/mk/cflags.mk @@ -50,7 +50,7 @@ CFLAGS += -Wchar-subscripts # warn about undefined preprocessor identifiers CFLAGS += -Wundef # warn about local variable shadowing another local variable -CFLAGS += -Wshadow +#CFLAGS += -Wshadow # warn about casting of pointers to increased alignment requirements CFLAGS += -Wcast-align # make string constants const @@ -70,7 +70,7 @@ CFLAGS += $(if $(GCC4),-Winit-self) # warn about pointer arithmetic on void* and function pointers CFLAGS += -Wpointer-arith # warn about multiple declarations -CFLAGS += -Wredundant-decls +#CFLAGS += -Wredundant-decls # warn if the format string is not a string literal CFLAGS += -Wformat-nonliteral # do not warn about zero-length formats. diff --git a/mk/common.mk b/mk/common.mk index 5702837..7c81a6b 100644 --- a/mk/common.mk +++ b/mk/common.mk @@ -1,8 +1,8 @@ include ../mk/cflags.mk prefix ?= /usr/local -LDFLAGS += -Wl,--warn-common -CFLAGS += --std=gnu99 -I../ -I../common +LDFLAGS += -Wl,--warn-common -L/opt/local/lib +CFLAGS += --std=gnu99 -I../ -I../common -I/opt/local/include INSTALL_PROGS = $(addprefix install-,$(PROGRAMS)) diff --git a/postlicyd/filter.c b/postlicyd/filter.c index d145f42..6d98d26 100644 --- a/postlicyd/filter.c +++ b/postlicyd/filter.c @@ -287,14 +287,15 @@ bool filter_add_hook(filter_t *filter, const char *name, int name_len, htokens[hook.type], ftokens[filter->type]); return false; } - hook.async = false; + hook.async = false; + hook.filter_id = -1; + hook.value = NULL; hook.postfix = (strncmp(value, "postfix:", 8) == 0); if (hook.postfix && query_format(NULL, 0, value + 8, NULL) == -1) { err("invalid formatted text \"%s\"", value + 8); return false; } hook.value = m_strdup(hook.postfix ? value + 8 : value); - hook.filter_id = -1; array_add(filter->hooks, hook); return true; } -- 2.20.1