Skip to content

Commit

Permalink
Fixed up coding standard tests errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelchristof committed Nov 27, 2011
1 parent 7e5ab93 commit 81774d0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
5 changes: 0 additions & 5 deletions src/gc/gc_private.h
Expand Up @@ -436,9 +436,6 @@ int Parrot_gc_trace_root(PARROT_INTERP,
__attribute__nonnull__(1)
FUNC_MODIFIES(*mem_pools);

static void mark_code_segment(PARROT_INTERP)
__attribute__nonnull__(1);

#define ASSERT_ARGS_contained_in_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(pool) \
, PARROT_ASSERT_ARG(ptr))
Expand Down Expand Up @@ -473,8 +470,6 @@ static void mark_code_segment(PARROT_INTERP)
, PARROT_ASSERT_ARG(pool))
#define ASSERT_ARGS_Parrot_gc_trace_root __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_void mark_code_segment __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
/* HEADERIZER END: src/gc/mark_sweep.c */

Expand Down
11 changes: 8 additions & 3 deletions src/gc/mark_sweep.c
Expand Up @@ -50,6 +50,9 @@ static void free_pmc_in_pool(PARROT_INTERP,
FUNC_MODIFIES(*mem_pools)
FUNC_MODIFIES(*p);

static void mark_code_segment(PARROT_INTERP)
__attribute__nonnull__(1);

static void mark_interp(PARROT_INTERP)
__attribute__nonnull__(1);

Expand Down Expand Up @@ -87,6 +90,8 @@ static Fixed_Size_Pool * new_string_pool(PARROT_INTERP,
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(mem_pools) \
, PARROT_ASSERT_ARG(p))
#define ASSERT_ARGS_mark_code_segment __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_mark_interp __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_new_bufferlike_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
Expand Down Expand Up @@ -264,17 +269,17 @@ mark_interp(PARROT_INTERP)

/*
=item mark_code_segment()
=item C<static void mark_code_segment(PARROT_INTERP)>
Mark constants inside code segment.
=cut
*/
static
void
static void
mark_code_segment(PARROT_INTERP)
{
ASSERT_ARGS(mark_code_segment)
int i;
PackFile_ByteCode *bc = Parrot_pf_get_current_code_segment(interp);

Expand Down
6 changes: 5 additions & 1 deletion src/pmc/structview.pmc
Expand Up @@ -101,7 +101,7 @@ static void index_out_of_bounds(PARROT_INTERP, INTVAL i)
i = Parrot_key_integer((interp), (k)); \
(k) = orig_k; \
if (i < 0 || n_elts <= (size_t)i) \
index_out_of_bounds ((interp), i); \
index_out_of_bounds((interp), i); \
base_ptr = VTABLE_get_pointer((interp), ptr_pmc); \
ptr = ((char *)base_ptr) + elts[i].byte_offset; \
/* guard against null pointer dereference */ \
Expand Down Expand Up @@ -1153,6 +1153,7 @@ PARROT_DOES_NOT_RETURN
static void
dereference_null(PARROT_INTERP)
{
ASSERT_ARGS(dereference_null)
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNEXPECTED_NULL,
"Attempt to derefrence null pointer");
}
Expand All @@ -1161,6 +1162,7 @@ PARROT_DOES_NOT_RETURN
static void
index_out_of_bounds(PARROT_INTERP, INTVAL i)
{
ASSERT_ARGS(index_out_of_bounds)
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_OUT_OF_BOUNDS,
"Struct index out of bounds (%d)",
i);
Expand All @@ -1170,6 +1172,7 @@ PARROT_DOES_NOT_RETURN
static void
buffer_too_small(PARROT_INTERP, size_t self_size, size_t buf_size)
{
ASSERT_ARGS(buffer_too_small)
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_BAD_BUFFER_SIZE,
"Buffer length too small for struct (at least %d required, got %d)",
self_size, buf_size);
Expand All @@ -1179,6 +1182,7 @@ PARROT_DOES_NOT_RETURN
static void
dereference_unaligned(PARROT_INTERP, ARGIN(const void *base_ptr), size_t align)
{
ASSERT_ARGS(dereference_unaligned)
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
"Attempt to dereference unaligned pointer (%x, required alignment: %d)",
base_ptr, align);
Expand Down

0 comments on commit 81774d0

Please sign in to comment.