Skip to content

Commit

Permalink
fixing arg annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
petdance committed May 2, 2011
1 parent c9d66d7 commit e0e46b5
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 29 deletions.
54 changes: 35 additions & 19 deletions include/parrot/io.h
Expand Up @@ -109,8 +109,9 @@ void Parrot_IOData_mark(PARROT_INTERP, ARGIN(ParrotIOData *piodata))
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */

PARROT_EXPORT
INTVAL Parrot_io_close_handle(PARROT_INTERP, ARGMOD_NULLOK(PMC *pmc))
INTVAL Parrot_io_close_handle(PARROT_INTERP, ARGMOD(PMC *pmc))
__attribute__nonnull__(1)
__attribute__nonnull__(2)
FUNC_MODIFIES(*pmc);

PARROT_EXPORT
Expand All @@ -133,25 +134,28 @@ PARROT_EXPORT
PARROT_WARN_UNUSED_RESULT
PARROT_CANNOT_RETURN_NULL
PMC * Parrot_io_fdopen(PARROT_INTERP,
ARGIN_NULLOK(PMC *pmc),
ARGIN(PMC *pmc),
PIOHANDLE fd,
ARGIN(STRING *sflags))
__attribute__nonnull__(1)
__attribute__nonnull__(2)
__attribute__nonnull__(4);

PARROT_EXPORT
PARROT_WARN_UNUSED_RESULT
PARROT_CANNOT_RETURN_NULL
PMC * Parrot_io_fdopen_flags(PARROT_INTERP,
ARGMOD_NULLOK(PMC *filehandle),
ARGMOD(PMC *filehandle),
PIOHANDLE fd,
INTVAL flags)
__attribute__nonnull__(1)
__attribute__nonnull__(2)
FUNC_MODIFIES(*filehandle);

PARROT_EXPORT
void Parrot_io_flush_handle(PARROT_INTERP, ARGMOD_NULLOK(PMC *pmc))
void Parrot_io_flush_handle(PARROT_INTERP, ARGMOD(PMC *pmc))
__attribute__nonnull__(1)
__attribute__nonnull__(2)
FUNC_MODIFIES(*pmc);

PARROT_EXPORT
Expand Down Expand Up @@ -196,16 +200,20 @@ PARROT_EXPORT
PARROT_WARN_UNUSED_RESULT
PARROT_CANNOT_RETURN_NULL
PMC * Parrot_io_open_handle(PARROT_INTERP,
ARGIN_NULLOK(PMC *pmc),
ARGIN_NULLOK(STRING *path),
ARGIN_NULLOK(STRING *mode))
__attribute__nonnull__(1);
ARGIN(PMC *pmc),
ARGIN(STRING *path),
ARGIN(STRING *mode))
__attribute__nonnull__(1)
__attribute__nonnull__(2)
__attribute__nonnull__(3)
__attribute__nonnull__(4);

PARROT_EXPORT
PARROT_WARN_UNUSED_RESULT
INTVAL Parrot_io_parse_open_flags(PARROT_INTERP,
ARGIN_NULLOK(const STRING *mode_str))
__attribute__nonnull__(1);
ARGIN(const STRING *mode_str))
__attribute__nonnull__(1)
__attribute__nonnull__(2);

PARROT_EXPORT
PARROT_WARN_UNUSED_RESULT
Expand Down Expand Up @@ -235,11 +243,10 @@ Parrot_io_printf(PARROT_INTERP,
__attribute__nonnull__(2);

PARROT_EXPORT
INTVAL Parrot_io_putps(PARROT_INTERP,
ARGMOD(PMC *pmc),
ARGMOD_NULLOK(STRING *s))
INTVAL Parrot_io_putps(PARROT_INTERP, ARGMOD(PMC *pmc), ARGMOD(STRING *s))
__attribute__nonnull__(1)
__attribute__nonnull__(2)
__attribute__nonnull__(3)
FUNC_MODIFIES(*pmc)
FUNC_MODIFIES(*s);

Expand Down Expand Up @@ -327,19 +334,23 @@ PIOOFF_T Parrot_io_make_offset_pmc(PARROT_INTERP, ARGMOD(PMC *pmc))
FUNC_MODIFIES(*pmc);

#define ASSERT_ARGS_Parrot_io_close_handle __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(pmc))
#define ASSERT_ARGS_Parrot_io_eof __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(pmc))
#define ASSERT_ARGS_Parrot_io_eprintf __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(s))
#define ASSERT_ARGS_Parrot_io_fdopen __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(pmc) \
, PARROT_ASSERT_ARG(sflags))
#define ASSERT_ARGS_Parrot_io_fdopen_flags __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(filehandle))
#define ASSERT_ARGS_Parrot_io_flush_handle __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(pmc))
#define ASSERT_ARGS_Parrot_io_fprintf __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(pmc) \
Expand All @@ -356,9 +367,13 @@ PIOOFF_T Parrot_io_make_offset_pmc(PARROT_INTERP, ARGMOD(PMC *pmc))
#define ASSERT_ARGS_Parrot_io_make_offset __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
#define ASSERT_ARGS_Parrot_io_make_offset32 __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
#define ASSERT_ARGS_Parrot_io_open_handle __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(pmc) \
, PARROT_ASSERT_ARG(path) \
, PARROT_ASSERT_ARG(mode))
#define ASSERT_ARGS_Parrot_io_parse_open_flags __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(mode_str))
#define ASSERT_ARGS_Parrot_io_peek __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(pmc))
Expand All @@ -370,7 +385,8 @@ PIOOFF_T Parrot_io_make_offset_pmc(PARROT_INTERP, ARGMOD(PMC *pmc))
, PARROT_ASSERT_ARG(s))
#define ASSERT_ARGS_Parrot_io_putps __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(pmc))
, PARROT_ASSERT_ARG(pmc) \
, PARROT_ASSERT_ARG(s))
#define ASSERT_ARGS_Parrot_io_puts __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(pmc) \
Expand Down
17 changes: 7 additions & 10 deletions src/io/api.c
Expand Up @@ -71,7 +71,7 @@ C<a> for append, and C<p> for pipe) and returns the combined generic bit flags.
PARROT_EXPORT
PARROT_WARN_UNUSED_RESULT
INTVAL
Parrot_io_parse_open_flags(PARROT_INTERP, ARGIN_NULLOK(const STRING *mode_str))
Parrot_io_parse_open_flags(PARROT_INTERP, ARGIN(const STRING *mode_str))
{
ASSERT_ARGS(Parrot_io_parse_open_flags)
INTVAL i, mode_len;
Expand Down Expand Up @@ -158,8 +158,7 @@ PARROT_EXPORT
PARROT_WARN_UNUSED_RESULT
PARROT_CANNOT_RETURN_NULL
PMC *
Parrot_io_open_handle(PARROT_INTERP, ARGIN_NULLOK(PMC *pmc),
ARGIN_NULLOK(STRING *path), ARGIN_NULLOK(STRING *mode))
Parrot_io_open_handle(PARROT_INTERP, ARGIN(PMC *pmc), ARGIN(STRING *path), ARGIN(STRING *mode))
{
ASSERT_ARGS(Parrot_io_open_handle)
PMC *filehandle;
Expand Down Expand Up @@ -255,8 +254,7 @@ PARROT_EXPORT
PARROT_WARN_UNUSED_RESULT
PARROT_CANNOT_RETURN_NULL
PMC *
Parrot_io_fdopen(PARROT_INTERP, ARGIN_NULLOK(PMC *pmc), PIOHANDLE fd,
ARGIN(STRING *sflags))
Parrot_io_fdopen(PARROT_INTERP, ARGIN(PMC *pmc), PIOHANDLE fd, ARGIN(STRING *sflags))
{
ASSERT_ARGS(Parrot_io_fdopen)
PMC *new_filehandle;
Expand Down Expand Up @@ -295,8 +293,7 @@ PARROT_EXPORT
PARROT_WARN_UNUSED_RESULT
PARROT_CANNOT_RETURN_NULL
PMC *
Parrot_io_fdopen_flags(PARROT_INTERP, ARGMOD_NULLOK(PMC *filehandle),
PIOHANDLE fd, INTVAL flags)
Parrot_io_fdopen_flags(PARROT_INTERP, ARGMOD(PMC *filehandle), PIOHANDLE fd, INTVAL flags)
{
ASSERT_ARGS(Parrot_io_fdopen_flags)

Expand Down Expand Up @@ -334,7 +331,7 @@ filehandle-PMC object.

PARROT_EXPORT
INTVAL
Parrot_io_close_handle(PARROT_INTERP, ARGMOD_NULLOK(PMC *pmc))
Parrot_io_close_handle(PARROT_INTERP, ARGMOD(PMC *pmc))
{
ASSERT_ARGS(Parrot_io_close_handle)
INTVAL result = 1;
Expand Down Expand Up @@ -409,7 +406,7 @@ filehandle PMC.

PARROT_EXPORT
void
Parrot_io_flush_handle(PARROT_INTERP, ARGMOD_NULLOK(PMC *pmc))
Parrot_io_flush_handle(PARROT_INTERP, ARGMOD(PMC *pmc))
{
ASSERT_ARGS(Parrot_io_flush_handle)
if (PMC_IS_NULL(pmc))
Expand Down Expand Up @@ -828,7 +825,7 @@ on the filehandle PMC.

PARROT_EXPORT
INTVAL
Parrot_io_putps(PARROT_INTERP, ARGMOD(PMC *pmc), ARGMOD_NULLOK(STRING *s))
Parrot_io_putps(PARROT_INTERP, ARGMOD(PMC *pmc), ARGMOD(STRING *s))
{
ASSERT_ARGS(Parrot_io_putps)
INTVAL result;
Expand Down

0 comments on commit e0e46b5

Please sign in to comment.