diff --git a/src/io/io_private.h b/src/io/io_private.h index b2e651d60b..0634da69ab 100644 --- a/src/io/io_private.h +++ b/src/io/io_private.h @@ -1,5 +1,5 @@ /* -Copyright (C) 2001-2008, Parrot Foundation. +Copyright (C) 2001-2014, Parrot Foundation. =head1 NAME @@ -165,7 +165,7 @@ struct _ParrotIOData { /* Get an editable version of the IO_VTABLE structure, typically used during vtable initialization. */ -#define IO_EDITABLE_IO_VTABLE(i, idx) ((IO_VTABLE *)(void *)(&((i)->piodata->vtables[(idx)]))) +#define IO_EDITABLE_IO_VTABLE(i, idx) (IO_VTABLE *)(&((i)->piodata->vtables[(idx)])) /* HEADERIZER BEGIN: src/io/utilities.c */ diff --git a/src/io/pipe.c b/src/io/pipe.c index 3979306f8b..46eac80c1b 100644 --- a/src/io/pipe.c +++ b/src/io/pipe.c @@ -1,5 +1,5 @@ /* -Copyright (C) 2001-2012, Parrot Foundation. +Copyright (C) 2001-2014, Parrot Foundation. =head1 NAME @@ -29,7 +29,6 @@ This file implements the IO_VTABLE for pipes and helper functions. static void io_pipe_adv_position(PARROT_INTERP, ARGMOD(PMC *handle), size_t offset) - __attribute__nonnull__(1) __attribute__nonnull__(2) FUNC_MODIFIES(*handle); @@ -51,7 +50,6 @@ static const STR_VTABLE * io_pipe_get_encoding(PARROT_INTERP, __attribute__nonnull__(2); static INTVAL io_pipe_get_flags(PARROT_INTERP, ARGIN(PMC *handle)) - __attribute__nonnull__(1) __attribute__nonnull__(2); static PIOHANDLE io_pipe_get_piohandle(PARROT_INTERP, ARGIN(PMC *handle)) @@ -59,7 +57,6 @@ static PIOHANDLE io_pipe_get_piohandle(PARROT_INTERP, ARGIN(PMC *handle)) __attribute__nonnull__(2); static PIOOFF_T io_pipe_get_position(PARROT_INTERP, ARGMOD(PMC *handle)) - __attribute__nonnull__(1) __attribute__nonnull__(2) FUNC_MODIFIES(*handle); @@ -105,20 +102,17 @@ static PIOOFF_T io_pipe_seek(PARROT_INTERP, static void io_pipe_set_eof(PARROT_INTERP, ARGMOD(PMC *handle), INTVAL is_set) - __attribute__nonnull__(1) __attribute__nonnull__(2) FUNC_MODIFIES(*handle); static void io_pipe_set_flags(PARROT_INTERP, ARGIN(PMC *handle), INTVAL flags) - __attribute__nonnull__(1) __attribute__nonnull__(2); static void io_pipe_set_position(PARROT_INTERP, ARGMOD(PMC *handle), PIOOFF_T pos) - __attribute__nonnull__(1) __attribute__nonnull__(2) FUNC_MODIFIES(*handle); @@ -128,7 +122,6 @@ static PIOOFF_T io_pipe_tell(PARROT_INTERP, ARGMOD(PMC *handle)) FUNC_MODIFIES(*handle); static size_t io_pipe_total_size(PARROT_INTERP, ARGIN(PMC *handle)) - __attribute__nonnull__(1) __attribute__nonnull__(2); static INTVAL io_pipe_write_b(PARROT_INTERP, @@ -141,8 +134,7 @@ static INTVAL io_pipe_write_b(PARROT_INTERP, FUNC_MODIFIES(*handle); #define ASSERT_ARGS_io_pipe_adv_position __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ - PARROT_ASSERT_ARG(interp) \ - , PARROT_ASSERT_ARG(handle)) + PARROT_ASSERT_ARG(handle)) #define ASSERT_ARGS_io_pipe_close __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(handle)) @@ -153,14 +145,12 @@ static INTVAL io_pipe_write_b(PARROT_INTERP, PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(handle)) #define ASSERT_ARGS_io_pipe_get_flags __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ - PARROT_ASSERT_ARG(interp) \ - , PARROT_ASSERT_ARG(handle)) + PARROT_ASSERT_ARG(handle)) #define ASSERT_ARGS_io_pipe_get_piohandle __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(handle)) #define ASSERT_ARGS_io_pipe_get_position __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ - PARROT_ASSERT_ARG(interp) \ - , PARROT_ASSERT_ARG(handle)) + PARROT_ASSERT_ARG(handle)) #define ASSERT_ARGS_io_pipe_is_eof __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(handle)) @@ -180,20 +170,16 @@ static INTVAL io_pipe_write_b(PARROT_INTERP, PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(handle)) #define ASSERT_ARGS_io_pipe_set_eof __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ - PARROT_ASSERT_ARG(interp) \ - , PARROT_ASSERT_ARG(handle)) + PARROT_ASSERT_ARG(handle)) #define ASSERT_ARGS_io_pipe_set_flags __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ - PARROT_ASSERT_ARG(interp) \ - , PARROT_ASSERT_ARG(handle)) + PARROT_ASSERT_ARG(handle)) #define ASSERT_ARGS_io_pipe_set_position __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ - PARROT_ASSERT_ARG(interp) \ - , PARROT_ASSERT_ARG(handle)) + PARROT_ASSERT_ARG(handle)) #define ASSERT_ARGS_io_pipe_tell __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(handle)) #define ASSERT_ARGS_io_pipe_total_size __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ - PARROT_ASSERT_ARG(interp) \ - , PARROT_ASSERT_ARG(handle)) + PARROT_ASSERT_ARG(handle)) #define ASSERT_ARGS_io_pipe_write_b __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(handle) \ @@ -332,7 +318,7 @@ io_pipe_is_eof(PARROT_INTERP, ARGMOD(PMC *handle)) } static void -io_pipe_set_eof(PARROT_INTERP, ARGMOD(PMC *handle), INTVAL is_set) +io_pipe_set_eof(SHIM_INTERP, ARGMOD(PMC *handle), INTVAL is_set) { ASSERT_ARGS(io_pipe_set_eof) if (is_set) @@ -394,7 +380,7 @@ Pipes don't keep track of position. Ignore. */ static void -io_pipe_adv_position(PARROT_INTERP, ARGMOD(PMC *handle), size_t offset) +io_pipe_adv_position(SHIM_INTERP, ARGMOD(PMC *handle), size_t offset) { ASSERT_ARGS(io_pipe_adv_position) UNUSED(handle); @@ -414,7 +400,7 @@ Pipes don't keep track of position. Ignore. */ static void -io_pipe_set_position(PARROT_INTERP, ARGMOD(PMC *handle), PIOOFF_T pos) +io_pipe_set_position(SHIM_INTERP, ARGMOD(PMC *handle), PIOOFF_T pos) { ASSERT_ARGS(io_pipe_set_position) UNUSED(handle); @@ -433,9 +419,10 @@ Pipes don't keep track of position. Return 0. */ static PIOOFF_T -io_pipe_get_position(PARROT_INTERP, ARGMOD(PMC *handle)) +io_pipe_get_position(SHIM_INTERP, ARGMOD(PMC *handle)) { ASSERT_ARGS(io_pipe_get_position) + UNUSED(handle); /* Pipes don't keep track of file position internally. Return 0 */ return (PIOOFF_T)0; } @@ -577,7 +564,7 @@ Set flags on the Pipe. */ static void -io_pipe_set_flags(PARROT_INTERP, ARGIN(PMC *handle), INTVAL flags) +io_pipe_set_flags(SHIM_INTERP, ARGIN(PMC *handle), INTVAL flags) { ASSERT_ARGS(io_pipe_set_flags) PARROT_FILEHANDLE(handle)->flags = flags; @@ -594,7 +581,7 @@ Get the flags from the pipe. */ static INTVAL -io_pipe_get_flags(PARROT_INTERP, ARGIN(PMC *handle)) +io_pipe_get_flags(SHIM_INTERP, ARGIN(PMC *handle)) { ASSERT_ARGS(io_pipe_get_flags) return PARROT_FILEHANDLE(handle)->flags; @@ -611,9 +598,10 @@ Pipes have an unknown total size. */ static size_t -io_pipe_total_size(PARROT_INTERP, ARGIN(PMC *handle)) +io_pipe_total_size(SHIM_INTERP, ARGIN(PMC *handle)) { ASSERT_ARGS(io_pipe_total_size) + UNUSED(handle); return PIO_UNKNOWN_SIZE; } diff --git a/src/io/socket.c b/src/io/socket.c index b65ee26dca..5e840638cb 100644 --- a/src/io/socket.c +++ b/src/io/socket.c @@ -1,5 +1,5 @@ /* -Copyright (C) 2001-2011, Parrot Foundation. +Copyright (C) 2001-2014, Parrot Foundation. =head1 NAME @@ -33,7 +33,6 @@ This file implements the Socket IO_VTABLE and some helper routines. static void io_socket_adv_position(PARROT_INTERP, ARGMOD(PMC *handle), size_t offset) - __attribute__nonnull__(1) __attribute__nonnull__(2) FUNC_MODIFIES(*handle); @@ -43,7 +42,6 @@ static INTVAL io_socket_close(PARROT_INTERP, ARGMOD(PMC *handle)) FUNC_MODIFIES(*handle); static INTVAL io_socket_flush(PARROT_INTERP, ARGMOD(PMC *handle)) - __attribute__nonnull__(1) __attribute__nonnull__(2) FUNC_MODIFIES(*handle); @@ -55,7 +53,6 @@ static const STR_VTABLE * io_socket_get_encoding(PARROT_INTERP, __attribute__nonnull__(2); static INTVAL io_socket_get_flags(PARROT_INTERP, ARGIN(PMC *handle)) - __attribute__nonnull__(1) __attribute__nonnull__(2); static PIOHANDLE io_socket_get_piohandle(PARROT_INTERP, ARGIN(PMC *handle)) @@ -63,7 +60,6 @@ static PIOHANDLE io_socket_get_piohandle(PARROT_INTERP, ARGIN(PMC *handle)) __attribute__nonnull__(2); static PIOOFF_T io_socket_get_position(PARROT_INTERP, ARGMOD(PMC *handle)) - __attribute__nonnull__(1) __attribute__nonnull__(2) FUNC_MODIFIES(*handle); @@ -116,13 +112,11 @@ static void io_socket_set_eof(PARROT_INTERP, static void io_socket_set_flags(PARROT_INTERP, ARGIN(PMC *handle), INTVAL flags) - __attribute__nonnull__(1) __attribute__nonnull__(2); static void io_socket_set_position(PARROT_INTERP, ARGMOD(PMC *handle), PIOOFF_T pos) - __attribute__nonnull__(1) __attribute__nonnull__(2) FUNC_MODIFIES(*handle); @@ -145,26 +139,22 @@ static INTVAL io_socket_write_b(PARROT_INTERP, FUNC_MODIFIES(*handle); #define ASSERT_ARGS_io_socket_adv_position __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ - PARROT_ASSERT_ARG(interp) \ - , PARROT_ASSERT_ARG(handle)) + PARROT_ASSERT_ARG(handle)) #define ASSERT_ARGS_io_socket_close __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(handle)) #define ASSERT_ARGS_io_socket_flush __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ - PARROT_ASSERT_ARG(interp) \ - , PARROT_ASSERT_ARG(handle)) + PARROT_ASSERT_ARG(handle)) #define ASSERT_ARGS_io_socket_get_encoding __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(handle)) #define ASSERT_ARGS_io_socket_get_flags __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ - PARROT_ASSERT_ARG(interp) \ - , PARROT_ASSERT_ARG(handle)) + PARROT_ASSERT_ARG(handle)) #define ASSERT_ARGS_io_socket_get_piohandle __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(handle)) #define ASSERT_ARGS_io_socket_get_position __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ - PARROT_ASSERT_ARG(interp) \ - , PARROT_ASSERT_ARG(handle)) + PARROT_ASSERT_ARG(handle)) #define ASSERT_ARGS_io_socket_is_eof __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(handle)) @@ -187,11 +177,9 @@ static INTVAL io_socket_write_b(PARROT_INTERP, PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(handle)) #define ASSERT_ARGS_io_socket_set_flags __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ - PARROT_ASSERT_ARG(interp) \ - , PARROT_ASSERT_ARG(handle)) + PARROT_ASSERT_ARG(handle)) #define ASSERT_ARGS_io_socket_set_position __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ - PARROT_ASSERT_ARG(interp) \ - , PARROT_ASSERT_ARG(handle)) + PARROT_ASSERT_ARG(handle)) #define ASSERT_ARGS_io_socket_tell __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(handle)) @@ -297,9 +285,10 @@ Flush the socket. Currently this does nothing. */ static INTVAL -io_socket_flush(PARROT_INTERP, ARGMOD(PMC *handle)) +io_socket_flush(SHIM_INTERP, ARGMOD(PMC *handle)) { ASSERT_ARGS(io_socket_flush) + UNUSED(handle) /* TODO: Do we need to fsync the socket? */ return 0; } @@ -399,7 +388,7 @@ Do nothing. Sockets don't keep track of position. */ static void -io_socket_adv_position(PARROT_INTERP, ARGMOD(PMC *handle), size_t offset) +io_socket_adv_position(SHIM_INTERP, ARGMOD(PMC *handle), size_t offset) { ASSERT_ARGS(io_socket_adv_position) UNUSED(handle) @@ -408,7 +397,7 @@ io_socket_adv_position(PARROT_INTERP, ARGMOD(PMC *handle), size_t offset) } static void -io_socket_set_position(PARROT_INTERP, ARGMOD(PMC *handle), PIOOFF_T pos) +io_socket_set_position(SHIM_INTERP, ARGMOD(PMC *handle), PIOOFF_T pos) { ASSERT_ARGS(io_socket_set_position) UNUSED(handle) @@ -417,9 +406,10 @@ io_socket_set_position(PARROT_INTERP, ARGMOD(PMC *handle), PIOOFF_T pos) } static PIOOFF_T -io_socket_get_position(PARROT_INTERP, ARGMOD(PMC *handle)) +io_socket_get_position(SHIM_INTERP, ARGMOD(PMC *handle)) { ASSERT_ARGS(io_socket_get_position) + UNUSED(handle) /* Socket doesn't keep track of position internally. Return 0 */ return (PIOOFF_T)0; } @@ -441,9 +431,10 @@ io_socket_open(PARROT_INTERP, ARGMOD(PMC *handle), ARGIN(STRING *path), { ASSERT_ARGS(io_socket_open) PIOHANDLE os_handle; - GETATTR_Socket_os_handle(interp, handle, os_handle); + UNUSED(path); UNUSED(flags); UNUSED(mode); + GETATTR_Socket_os_handle(interp, handle, os_handle); return Parrot_io_internal_flush(interp, os_handle); } @@ -506,17 +497,19 @@ Return C. Sockets are always flagged r/w. */ static void -io_socket_set_flags(PARROT_INTERP, ARGIN(PMC *handle), INTVAL flags) +io_socket_set_flags(SHIM_INTERP, ARGIN(PMC *handle), INTVAL flags) { ASSERT_ARGS(io_socket_set_flags) + UNUSED(handle) UNUSED(flags) /* Ignore, for now */ } static INTVAL -io_socket_get_flags(PARROT_INTERP, ARGIN(PMC *handle)) +io_socket_get_flags(SHIM_INTERP, ARGIN(PMC *handle)) { ASSERT_ARGS(io_socket_get_flags) + UNUSED(handle) /* For now, just say that all sockets are read/write handles */ return PIO_F_WRITE | PIO_F_READ; } diff --git a/src/io/stringhandle.c b/src/io/stringhandle.c index 5e9b0c5ee4..cdfd05287f 100644 --- a/src/io/stringhandle.c +++ b/src/io/stringhandle.c @@ -1,5 +1,5 @@ /* -Copyright (C) 2001-2012, Parrot Foundation. +Copyright (C) 2001-2014, Parrot Foundation. =head1 NAME @@ -31,7 +31,6 @@ The StringHandle IO_VTABLE and helper methods. static void io_stringhandle_adv_position(PARROT_INTERP, ARGMOD(PMC *handle), size_t offset) - __attribute__nonnull__(1) __attribute__nonnull__(2) FUNC_MODIFIES(*handle); @@ -53,7 +52,6 @@ static const STR_VTABLE * io_stringhandle_get_encoding(PARROT_INTERP, __attribute__nonnull__(2); static INTVAL io_stringhandle_get_flags(PARROT_INTERP, ARGIN(PMC *handle)) - __attribute__nonnull__(1) __attribute__nonnull__(2); static PIOHANDLE io_stringhandle_get_piohandle(PARROT_INTERP, @@ -116,13 +114,11 @@ static void io_stringhandle_set_eof(PARROT_INTERP, static void io_stringhandle_set_flags(PARROT_INTERP, ARGIN(PMC *handle), INTVAL flags) - __attribute__nonnull__(1) __attribute__nonnull__(2); static void io_stringhandle_set_position(PARROT_INTERP, ARGMOD(PMC *handle), PIOOFF_T pos) - __attribute__nonnull__(1) __attribute__nonnull__(2) FUNC_MODIFIES(*handle); @@ -145,8 +141,7 @@ static INTVAL io_stringhandle_write_b(PARROT_INTERP, FUNC_MODIFIES(*handle); #define ASSERT_ARGS_io_stringhandle_adv_position __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ - PARROT_ASSERT_ARG(interp) \ - , PARROT_ASSERT_ARG(handle)) + PARROT_ASSERT_ARG(handle)) #define ASSERT_ARGS_io_stringhandle_close __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(handle)) @@ -157,8 +152,7 @@ static INTVAL io_stringhandle_write_b(PARROT_INTERP, PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(handle)) #define ASSERT_ARGS_io_stringhandle_get_flags __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ - PARROT_ASSERT_ARG(interp) \ - , PARROT_ASSERT_ARG(handle)) + PARROT_ASSERT_ARG(handle)) #define ASSERT_ARGS_io_stringhandle_get_piohandle __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(handle)) @@ -187,11 +181,9 @@ static INTVAL io_stringhandle_write_b(PARROT_INTERP, PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(handle)) #define ASSERT_ARGS_io_stringhandle_set_flags __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ - PARROT_ASSERT_ARG(interp) \ - , PARROT_ASSERT_ARG(handle)) + PARROT_ASSERT_ARG(handle)) #define ASSERT_ARGS_io_stringhandle_set_position __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ - PARROT_ASSERT_ARG(interp) \ - , PARROT_ASSERT_ARG(handle)) + PARROT_ASSERT_ARG(handle)) #define ASSERT_ARGS_io_stringhandle_tell __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(handle)) @@ -453,7 +445,7 @@ Fall back to io_stringhandle_tell; */ static void -io_stringhandle_adv_position(PARROT_INTERP, ARGMOD(PMC *handle), size_t offset) +io_stringhandle_adv_position(SHIM_INTERP, ARGMOD(PMC *handle), size_t offset) { ASSERT_ARGS(io_stringhandle_adv_position) UNUSED(handle) @@ -462,7 +454,7 @@ io_stringhandle_adv_position(PARROT_INTERP, ARGMOD(PMC *handle), size_t offset) } static void -io_stringhandle_set_position(PARROT_INTERP, ARGMOD(PMC *handle), PIOOFF_T pos) +io_stringhandle_set_position(SHIM_INTERP, ARGMOD(PMC *handle), PIOOFF_T pos) { ASSERT_ARGS(io_stringhandle_set_position) UNUSED(handle) @@ -601,14 +593,14 @@ Get the flags from the StringHandle. */ static void -io_stringhandle_set_flags(PARROT_INTERP, ARGIN(PMC *handle), INTVAL flags) +io_stringhandle_set_flags(SHIM_INTERP, ARGIN(PMC *handle), INTVAL flags) { ASSERT_ARGS(io_stringhandle_set_flags) PARROT_STRINGHANDLE(handle)->flags = flags; } static INTVAL -io_stringhandle_get_flags(PARROT_INTERP, ARGIN(PMC *handle)) +io_stringhandle_get_flags(SHIM_INTERP, ARGIN(PMC *handle)) { ASSERT_ARGS(io_stringhandle_get_flags) return PARROT_STRINGHANDLE(handle)->flags;