Skip to content

Commit

Permalink
[cage] fix --debugging and some of the latest SHIM/UNUSED decl
Browse files Browse the repository at this point in the history
make headerizer and --debugging tested.
TODO: UNUSED should be switched to SHIM in the decl.
  • Loading branch information
Reini Urban committed Mar 7, 2014
1 parent 771ca09 commit 5b3e6c0
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 44 deletions.
4 changes: 1 addition & 3 deletions include/parrot/context.h
Expand Up @@ -265,7 +265,6 @@ PARROT_EXPORT
void Parrot_pcc_set_pc_func(PARROT_INTERP,
ARGIN(const PMC *ctx),
ARGIN_NULLOK(opcode_t *pc))
__attribute__nonnull__(1)
__attribute__nonnull__(2);

PARROT_EXPORT
Expand Down Expand Up @@ -404,8 +403,7 @@ UINTVAL Parrot_pcc_warnings_test_func(PARROT_INTERP,
, PARROT_ASSERT_ARG(ctx) \
, PARROT_ASSERT_ARG(outer_ctx))
#define ASSERT_ARGS_Parrot_pcc_set_pc_func __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(ctx))
PARROT_ASSERT_ARG(ctx))
#define ASSERT_ARGS_Parrot_pcc_set_recursion_depth_func \
__attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(ctx))
Expand Down
8 changes: 2 additions & 6 deletions include/parrot/io.h
Expand Up @@ -966,7 +966,6 @@ IO_BUFFER * Parrot_io_buffer_allocate(PARROT_INTERP,
FUNC_MODIFIES(*owner);

void Parrot_io_buffer_clear(PARROT_INTERP, ARGMOD_NULLOK(IO_BUFFER *buffer))
__attribute__nonnull__(1)
FUNC_MODIFIES(*buffer);

PARROT_WARN_UNUSED_RESULT
Expand Down Expand Up @@ -1034,7 +1033,6 @@ void Parrot_io_buffer_remove_from_handle(PARROT_INTERP,
size_t Parrot_io_buffer_resize(PARROT_INTERP,
ARGMOD(IO_BUFFER *buffer),
size_t new_size)
__attribute__nonnull__(1)
__attribute__nonnull__(2)
FUNC_MODIFIES(*buffer);

Expand Down Expand Up @@ -1100,8 +1098,7 @@ size_t Parrot_io_buffer_write_b(PARROT_INTERP,
#define ASSERT_ARGS_Parrot_io_buffer_allocate __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(owner))
#define ASSERT_ARGS_Parrot_io_buffer_clear __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_Parrot_io_buffer_clear __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
#define ASSERT_ARGS_Parrot_io_buffer_content_size __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(buffer))
#define ASSERT_ARGS_Parrot_io_buffer_fill __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
Expand Down Expand Up @@ -1130,8 +1127,7 @@ size_t Parrot_io_buffer_write_b(PARROT_INTERP,
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(handle))
#define ASSERT_ARGS_Parrot_io_buffer_resize __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(buffer))
PARROT_ASSERT_ARG(buffer))
#define ASSERT_ARGS_Parrot_io_buffer_seek __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(buffer) \
Expand Down
8 changes: 4 additions & 4 deletions src/gc/gc_gms.c
Expand Up @@ -2162,10 +2162,10 @@ static size_t
gc_gms_count_used_string_memory(PARROT_INTERP, ARGIN(Parrot_Pointer_Array *list))
{
ASSERT_ARGS(gc_gms_count_used_string_memory)
UNUSED(interp);
UNUSED(list);

size_t total_amount = 0;
UNUSED(interp)
UNUSED(list)
#if 0
List_Item_Header *tmp = list->first;
while (tmp) {
Expand Down Expand Up @@ -2201,10 +2201,10 @@ static size_t
gc_gms_count_used_pmc_memory(PARROT_INTERP, ARGIN(Parrot_Pointer_Array *list))
{
ASSERT_ARGS(gc_gms_count_used_pmc_memory)
UNUSED(interp);
UNUSED(list);

size_t total_amount = 0;
UNUSED(interp)
UNUSED(list)
#if 0
List_Item_Header *tmp = list->first;
while (tmp) {
Expand Down
6 changes: 2 additions & 4 deletions src/io/buffer.c
Expand Up @@ -31,7 +31,6 @@ static void io_buffer_add_bytes(PARROT_INTERP,
ARGMOD(IO_BUFFER *buffer),
ARGIN(char *s),
size_t length)
__attribute__nonnull__(1)
__attribute__nonnull__(2)
__attribute__nonnull__(3)
FUNC_MODIFIES(*buffer);
Expand All @@ -58,8 +57,7 @@ static size_t io_buffer_transfer_to_mem(PARROT_INTERP,
FUNC_MODIFIES(* s);

#define ASSERT_ARGS_io_buffer_add_bytes __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(buffer) \
PARROT_ASSERT_ARG(buffer) \
, PARROT_ASSERT_ARG(s))
#define ASSERT_ARGS_io_buffer_normalize __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
Expand Down Expand Up @@ -94,10 +92,10 @@ IO_BUFFER *
Parrot_io_buffer_allocate(PARROT_INTERP, ARGMOD(PMC *owner), INTVAL flags,
ARGIN_NULLOK(const STR_VTABLE *encoding), size_t init_size)
{
UNUSED(owner)
ASSERT_ARGS(Parrot_io_buffer_allocate)
IO_BUFFER * const buffer =
(IO_BUFFER *)Parrot_gc_allocate_fixed_size_storage(interp, sizeof (IO_BUFFER));
UNUSED(owner);
buffer->encoding = encoding;
if (init_size == BUFFER_SIZE_ANY) {
if (flags & PIO_BF_LINEBUF)
Expand Down
24 changes: 6 additions & 18 deletions src/io/filehandle.c
Expand Up @@ -33,7 +33,6 @@ src/platform/xxx/io.c.
static void io_filehandle_adv_position(PARROT_INTERP,
ARGMOD(PMC *handle),
size_t len)
__attribute__nonnull__(1)
__attribute__nonnull__(2)
FUNC_MODIFIES(*handle);

Expand All @@ -55,7 +54,6 @@ static const STR_VTABLE * io_filehandle_get_encoding(PARROT_INTERP,
__attribute__nonnull__(2);

static INTVAL io_filehandle_get_flags(PARROT_INTERP, ARGIN(PMC *handle))
__attribute__nonnull__(1)
__attribute__nonnull__(2);

static PIOHANDLE io_filehandle_get_piohandle(PARROT_INTERP,
Expand All @@ -65,7 +63,6 @@ static PIOHANDLE io_filehandle_get_piohandle(PARROT_INTERP,

static PIOOFF_T io_filehandle_get_position(PARROT_INTERP,
ARGMOD(PMC *handle))
__attribute__nonnull__(1)
__attribute__nonnull__(2)
FUNC_MODIFIES(*handle);

Expand Down Expand Up @@ -111,20 +108,17 @@ static PIOOFF_T io_filehandle_seek(PARROT_INTERP,
static void io_filehandle_set_eof(PARROT_INTERP,
ARGMOD(PMC *handle),
INTVAL is_set)
__attribute__nonnull__(1)
__attribute__nonnull__(2)
FUNC_MODIFIES(*handle);

static void io_filehandle_set_flags(PARROT_INTERP,
ARGIN(PMC *handle),
INTVAL flags)
__attribute__nonnull__(1)
__attribute__nonnull__(2);

static void io_filehandle_set_position(PARROT_INTERP,
ARGMOD(PMC *handle),
PIOOFF_T pos)
__attribute__nonnull__(1)
__attribute__nonnull__(2)
FUNC_MODIFIES(*handle);

Expand All @@ -147,8 +141,7 @@ static INTVAL io_filehandle_write_b(PARROT_INTERP,
FUNC_MODIFIES(*handle);

#define ASSERT_ARGS_io_filehandle_adv_position __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(handle))
PARROT_ASSERT_ARG(handle))
#define ASSERT_ARGS_io_filehandle_close __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(handle))
Expand All @@ -159,14 +152,12 @@ static INTVAL io_filehandle_write_b(PARROT_INTERP,
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(handle))
#define ASSERT_ARGS_io_filehandle_get_flags __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(handle))
PARROT_ASSERT_ARG(handle))
#define ASSERT_ARGS_io_filehandle_get_piohandle __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(handle))
#define ASSERT_ARGS_io_filehandle_get_position __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(handle))
PARROT_ASSERT_ARG(handle))
#define ASSERT_ARGS_io_filehandle_is_eof __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(handle))
Expand All @@ -186,14 +177,11 @@ static INTVAL io_filehandle_write_b(PARROT_INTERP,
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(handle))
#define ASSERT_ARGS_io_filehandle_set_eof __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(handle))
PARROT_ASSERT_ARG(handle))
#define ASSERT_ARGS_io_filehandle_set_flags __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(handle))
PARROT_ASSERT_ARG(handle))
#define ASSERT_ARGS_io_filehandle_set_position __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(handle))
PARROT_ASSERT_ARG(handle))
#define ASSERT_ARGS_io_filehandle_tell __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(handle))
Expand Down
12 changes: 4 additions & 8 deletions src/pmc/bignum.pmc
Expand Up @@ -284,7 +284,6 @@ static void bignum_fdiv_bignum_int(PARROT_INTERP,
FUNC_MODIFIES(*dest);

static INTVAL bignum_get_default_prec(PARROT_INTERP, ARGIN(PMC *self))
__attribute__nonnull__(1)
__attribute__nonnull__(2);

PARROT_WARN_UNUSED_RESULT
Expand Down Expand Up @@ -378,7 +377,6 @@ static void bignum_set(PARROT_INTERP, ARGMOD(PMC *dest), ARGIN(PMC *src))
static void bignum_set_default_prec(PARROT_INTERP,
ARGIN(PMC *self),
INTVAL prec)
__attribute__nonnull__(1)
__attribute__nonnull__(2);

static void bignum_set_double(PARROT_INTERP, ARGIN(PMC *self), double value)
Expand Down Expand Up @@ -493,8 +491,7 @@ static void bignum_sub_bignum_int(PARROT_INTERP,
, PARROT_ASSERT_ARG(self) \
, PARROT_ASSERT_ARG(dest))
#define ASSERT_ARGS_bignum_get_default_prec __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(self))
PARROT_ASSERT_ARG(self))
#define ASSERT_ARGS_bignum_get_double __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(self))
Expand Down Expand Up @@ -542,8 +539,7 @@ static void bignum_sub_bignum_int(PARROT_INTERP,
, PARROT_ASSERT_ARG(dest) \
, PARROT_ASSERT_ARG(src))
#define ASSERT_ARGS_bignum_set_default_prec __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(self))
PARROT_ASSERT_ARG(self))
#define ASSERT_ARGS_bignum_set_double __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(self))
Expand Down Expand Up @@ -1064,16 +1060,16 @@ bignum_neg(PARROT_INTERP, ARGIN(PMC *self), ARGMOD(PMC *dest)) {

static INTVAL
bignum_get_default_prec(SHIM_INTERP, ARGIN(PMC *self)) {
UNUSED(self)
ASSERT_ARGS(bignum_get_default_prec)
UNUSED(self)

return mpf_get_default_prec();
}

static void
bignum_set_default_prec(SHIM_INTERP, ARGIN(PMC *self), INTVAL prec) {
UNUSED(self)
ASSERT_ARGS(bignum_set_default_prec)
UNUSED(self)

mpf_set_default_prec(prec);
}
Expand Down
2 changes: 1 addition & 1 deletion src/string/encoding/shared.c
Expand Up @@ -1214,8 +1214,8 @@ void
fixed8_iter_skip(SHIM_INTERP,
ARGIN(const STRING *str), ARGMOD(String_iter *iter), INTVAL skip)
{
UNUSED(str)
ASSERT_ARGS(fixed8_iter_skip)
UNUSED(str)

iter->bytepos += skip;
iter->charpos += skip;
Expand Down

0 comments on commit 5b3e6c0

Please sign in to comment.