* modules/bitset: Depend on 'attribute'.
* lib/bitset/base.h (ATTRIBUTE_UNUSED): Remove.
* lib/bitset.c, lib/bitset/array.c, lib/bitset/list.c,
* lib/bitset/stats.c, lib/bitset/table.c, lib/bitset/vector.c:
Use MAYBE_UNUSED instead of ATTRIBUTE_UNUSED.
+2020-05-09 Akim Demaille <akim@lrde.epita.fr>
+
+ bitset: use the attribute module
+ * modules/bitset: Depend on 'attribute'.
+ * lib/bitset/base.h (ATTRIBUTE_UNUSED): Remove.
+ * lib/bitset.c, lib/bitset/array.c, lib/bitset/list.c,
+ * lib/bitset/stats.c, lib/bitset/table.c, lib/bitset/vector.c:
+ Use MAYBE_UNUSED instead of ATTRIBUTE_UNUSED.
+
2020-05-09 Bruno Haible <bruno@clisp.org>
c-stack: Fix warning when DEBUG is enabled.
specified by ATTR. For variable size bitsets, N_BITS is only a
hint and may be zero. */
enum bitset_type
-bitset_type_choose (bitset_bindex n_bits ATTRIBUTE_UNUSED, unsigned attr)
+bitset_type_choose (bitset_bindex n_bits MAYBE_UNUSED, unsigned attr)
{
/* Check attributes. */
if (attr & BITSET_FIXED && attr & BITSET_VARIABLE)
/* Set bit BITNO in bitset DST. */
static void
-abitset_set (bitset dst ATTRIBUTE_UNUSED, bitset_bindex bitno ATTRIBUTE_UNUSED)
+abitset_set (bitset dst MAYBE_UNUSED, bitset_bindex bitno MAYBE_UNUSED)
{
/* This should never occur for abitsets since we should always hit
the cache. It is likely someone is trying to access outside the
/* Reset bit BITNO in bitset DST. */
static void
-abitset_reset (bitset dst ATTRIBUTE_UNUSED,
- bitset_bindex bitno ATTRIBUTE_UNUSED)
+abitset_reset (bitset dst MAYBE_UNUSED,
+ bitset_bindex bitno MAYBE_UNUSED)
{
/* This should never occur for abitsets since we should always hit
the cache. It is likely someone is trying to access outside the
/* Test bit BITNO in bitset SRC. */
static bool
-abitset_test (bitset src ATTRIBUTE_UNUSED,
- bitset_bindex bitno ATTRIBUTE_UNUSED)
+abitset_test (bitset src MAYBE_UNUSED,
+ bitset_bindex bitno MAYBE_UNUSED)
{
/* This should never occur for abitsets since we should always
hit the cache. */
#include <stdbool.h>
#include <stddef.h>
+#include "attribute.h"
#include "xalloc.h"
-#define ATTRIBUTE_UNUSED _GL_ATTRIBUTE_MAYBE_UNUSED
-
/* Currently we support five flavours of bitsets:
BITSET_ARRAY: Array of bits (fixed size, fast for dense bitsets).
Memory for bit array and bitset structure allocated
/* Return size of initial structure. */
size_t
-lbitset_bytes (bitset_bindex n_bits ATTRIBUTE_UNUSED)
+lbitset_bytes (bitset_bindex n_bits MAYBE_UNUSED)
{
return sizeof (struct lbitset_struct);
}
/* Initialize a bitset. */
bitset
-lbitset_init (bitset bset, bitset_bindex n_bits ATTRIBUTE_UNUSED)
+lbitset_init (bitset bset, bitset_bindex n_bits MAYBE_UNUSED)
{
BITSET_NBITS_ (bset) = n_bits;
bset->b.vtable = &lbitset_vtable;
/* Print all bitset statistics to FILE. */
static void
-bitset_stats_print (FILE *file, bool verbose ATTRIBUTE_UNUSED)
+bitset_stats_print (FILE *file, bool verbose MAYBE_UNUSED)
{
if (!bitset_stats_info)
return;
/* Return size of initial structure. */
size_t
-tbitset_bytes (bitset_bindex n_bits ATTRIBUTE_UNUSED)
+tbitset_bytes (bitset_bindex n_bits MAYBE_UNUSED)
{
return sizeof (struct tbitset_struct);
}
/* Reset bit BITNO in bitset DST. */
static void
-vbitset_reset (bitset dst ATTRIBUTE_UNUSED, bitset_bindex bitno ATTRIBUTE_UNUSED)
+vbitset_reset (bitset dst MAYBE_UNUSED, bitset_bindex bitno MAYBE_UNUSED)
{
/* We must be accessing outside the cache so the bit is
zero anyway. */
/* Test bit BITNO in bitset SRC. */
static bool
-vbitset_test (bitset src ATTRIBUTE_UNUSED,
- bitset_bindex bitno ATTRIBUTE_UNUSED)
+vbitset_test (bitset src MAYBE_UNUSED,
+ bitset_bindex bitno MAYBE_UNUSED)
{
/* We must be accessing outside the cache so the bit is
zero anyway. */
size_t
-vbitset_bytes (bitset_bindex n_bits ATTRIBUTE_UNUSED)
+vbitset_bytes (bitset_bindex n_bits MAYBE_UNUSED)
{
return sizeof (struct vbitset_struct);
}
lib/bitset/vector.h
Depends-on:
+attribute
c99
gettext-h
obstack