Commit c5d0a955 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

FlexeLinting: 'oper' is an incredibly bad global name.

parent 957dee5c
......@@ -70,8 +70,6 @@ static const char * const arg_name[BAN_ARGARRSZ + 1] = {
[BAN_ARGARRSZ] = NULL
};
extern const char * const oper[BAN_OPERARRSZ + 1];
/*--------------------------------------------------------------------
* Storage handling of bans
*/
......@@ -806,7 +804,7 @@ ban_render(struct cli *cli, const uint8_t *bs, int quote)
else
VCLI_Out(cli, "%s", arg_name[BAN_ARGIDX(bt.arg1)]);
VCLI_Out(cli, " %s ", oper[BAN_OPERIDX(bt.oper)]);
VCLI_Out(cli, " %s ", ban_oper[BAN_OPERIDX(bt.oper)]);
if (BANS_HAS_ARG2_DOUBLE(bt.arg1)) {
vdur_render(buf, bt.arg2_double);
......
......@@ -145,6 +145,7 @@ extern struct ban * volatile ban_start;
extern pthread_cond_t ban_lurker_cond;
extern uint64_t bans_persisted_bytes;
extern uint64_t bans_persisted_fragmentation;
extern const char * const ban_oper[BAN_OPERARRSZ + 1];
void ban_mark_completed(struct ban *);
unsigned ban_len(const uint8_t *banspec);
......
......@@ -76,7 +76,7 @@ static const unsigned arg_opervalid[BAN_ARGARRSZ + 1] = {
static const char *arg_operhelp[BAN_ARGARRSZ + 1];
// operators
const char * const oper[BAN_OPERARRSZ + 1] = {
const char * const ban_oper[BAN_OPERARRSZ + 1] = {
#define OPER(op, str) [BAN_OPERIDX(op)] = (str),
#include "tbl/ban_oper.h"
[BAN_OPERARRSZ] = NULL
......@@ -205,7 +205,7 @@ ban_parse_oper(const char *p)
int i;
for (i = 0; i < BAN_OPERARRSZ; i++) {
if (!strcmp(p, oper[i]))
if (!strcmp(p, ban_oper[i]))
return (_BANS_OPER_OFF + i);
}
return (-1);
......@@ -396,14 +396,14 @@ ban_build_arg_operhelp(struct vsb *vsb, int arg)
if ((mask & (1U << i)) == 0)
continue;
if (p == NULL)
p = oper[i];
p = ban_oper[i];
else if (n == NULL)
n = oper[i];
n = ban_oper[i];
else {
VSB_cat(vsb, p);
VSB_cat(vsb, ", ");
p = n;
n = oper[i];
n = ban_oper[i];
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment