[multiple] quiet compiler warnings --without-pcre

quiet compiler warnings for ./configure --without-pcre
personal/stbuehler/fix-fdevent
Glenn Strauss 2018-09-25 20:49:25 -04:00
parent 0257c822c0
commit 5b327e0089
3 changed files with 13 additions and 10 deletions

View File

@ -213,6 +213,9 @@ int data_config_pcre_exec(data_config *dc, cond_cache_t *cache, buffer *b) {
cache->comp_value = b; /* holds pointer to b (!) for pattern subst */
return cache->patterncount;
#else
UNUSED(dc);
UNUSED(cache);
UNUSED(b);
return 0;
#endif
}

View File

@ -87,8 +87,8 @@ static excludes_buffer *excludes_buffer_init(void) {
return exb;
}
static int excludes_buffer_append(excludes_buffer *exb, buffer *string) {
#ifdef HAVE_PCRE_H
static int excludes_buffer_append(excludes_buffer *exb, buffer *string) {
size_t i;
const char *errptr;
int erroff;
@ -126,13 +126,8 @@ static int excludes_buffer_append(excludes_buffer *exb, buffer *string) {
exb->used++;
return 0;
#else
UNUSED(exb);
UNUSED(string);
return -1;
#endif
}
#endif
static void excludes_buffer_free(excludes_buffer *exb) {
#ifdef HAVE_PCRE_H
@ -291,7 +286,6 @@ SETDEFAULTS_FUNC(mod_dirlisting_set_defaults) {
if (NULL != (du_excludes = array_get_element(config->value, CONFIG_EXCLUDE))) {
array *excludes_list;
size_t j;
excludes_list = ((data_array*)du_excludes)->value;
@ -308,7 +302,7 @@ SETDEFAULTS_FUNC(mod_dirlisting_set_defaults) {
return HANDLER_ERROR;
}
#else
for (j = 0; j < excludes_list->used; j++) {
for (size_t j = 0; j < excludes_list->used; ++j) {
data_unset *du_exclude = excludes_list->data[j];
if (du_exclude->type != TYPE_STRING) {
@ -967,7 +961,9 @@ static int http_list_directory(server *srv, connection *con, plugin_data *p, buf
files.used = 0;
while ((dent = readdir(dp)) != NULL) {
#ifdef HAVE_PCRE_H
unsigned short exclude_match = 0;
#endif
if (dent->d_name[0] == '.') {
if (hide_dotfiles)

View File

@ -257,6 +257,8 @@ SETDEFAULTS_FUNC(mod_trigger_b4_dl_set_defaults) {
return HANDLER_GO_ON;
}
#if defined(HAVE_PCRE_H)
#define PATCH(x) \
p->conf.x = s->x;
static int mod_trigger_b4_dl_patch_connection(server *srv, connection *con, plugin_data *p) {
@ -322,12 +324,14 @@ static int mod_trigger_b4_dl_patch_connection(server *srv, connection *con, plug
}
#undef PATCH
#endif
URIHANDLER_FUNC(mod_trigger_b4_dl_uri_handler) {
#if defined(HAVE_PCRE_H)
plugin_data *p = p_d;
const char *remote_ip;
buffer *vb;
#if defined(HAVE_PCRE_H)
int n;
# define N 10
int ovec[N * 3];