Author: petdance
Date: Wed Jul 18 12:38:03 2007
New Revision: 19977

Modified:
   trunk/src/interpreter.c
   trunk/src/io/io_mmap.c

Log:
Finished up decorating io_mmap.c

Modified: trunk/src/interpreter.c
==============================================================================
--- trunk/src/interpreter.c     (original)
+++ trunk/src/interpreter.c     Wed Jul 18 12:38:03 2007
@@ -79,22 +79,27 @@
         __attribute__nonnull__(2);
 
 static void prederef_args(
-    void **pc_prederef,
+    NOTNULL(void **pc_prederef),
     PARROT_INTERP,
     NOTNULL(opcode_t *pc),
     NOTNULL(const op_info_t *opinfo) )
+        __attribute__nonnull__(1)
         __attribute__nonnull__(2)
         __attribute__nonnull__(3)
         __attribute__nonnull__(4);
 
-static opcode_t * runops_cgp( PARROT_INTERP, opcode_t *pc )
-        __attribute__nonnull__(1);
+PARROT_CANNOT_RETURN_NULL
+static opcode_t * runops_cgp( PARROT_INTERP, NOTNULL(opcode_t *pc) )
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
 
-static opcode_t * runops_exec( PARROT_INTERP, opcode_t *pc )
-        __attribute__nonnull__(1);
+static opcode_t * runops_exec( PARROT_INTERP, NOTNULL(opcode_t *pc) )
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
 
-static opcode_t * runops_jit( PARROT_INTERP, opcode_t *pc )
-        __attribute__nonnull__(1);
+static opcode_t * runops_jit( PARROT_INTERP, NOTNULL(opcode_t *pc) )
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
 
 static opcode_t * runops_switch( PARROT_INTERP, NOTNULL(opcode_t *pc) )
         __attribute__nonnull__(1)
@@ -119,7 +124,7 @@
 */
 
 static void
-prederef_args(void **pc_prederef, PARROT_INTERP,
+prederef_args(NOTNULL(void **pc_prederef), PARROT_INTERP,
         NOTNULL(opcode_t *pc), NOTNULL(const op_info_t *opinfo))
 {
     const PackFile_ConstTable * const const_table = interp->code->const_table;
@@ -574,7 +579,7 @@
 */
 
 static opcode_t *
-runops_jit(PARROT_INTERP, opcode_t *pc)
+runops_jit(PARROT_INTERP, NOTNULL(opcode_t *pc))
 {
 #if JIT_CAPABLE
 #  ifdef PARROT_EXEC_OS_AIX
@@ -609,7 +614,7 @@
 */
 
 static opcode_t *
-runops_exec(PARROT_INTERP, opcode_t *pc)
+runops_exec(PARROT_INTERP, NOTNULL(opcode_t *pc))
 {
 #if EXEC_CAPABLE
     opcode_t *code_start;
@@ -655,11 +660,12 @@
 
 */
 
+PARROT_CANNOT_RETURN_NULL
 static opcode_t *
-runops_cgp(PARROT_INTERP, opcode_t *pc)
+runops_cgp(PARROT_INTERP, NOTNULL(opcode_t *pc))
 {
 #ifdef HAVE_COMPUTED_GOTO
-    opcode_t *code_start = (opcode_t *)interp->code->base.data;
+    opcode_t * const code_start = (opcode_t *)interp->code->base.data;
     opcode_t *pc_prederef;
     init_prederef(interp, PARROT_CGP_CORE);
     pc_prederef = (opcode_t*)interp->code->prederef.code + (pc - code_start);
@@ -669,7 +675,6 @@
     PIO_eprintf(interp,
             "Computed goto unavailable in this configuration.\n");
     Parrot_exit(interp, 1);
-    return NULL;
 #endif
 }
 

Modified: trunk/src/io/io_mmap.c
==============================================================================
--- trunk/src/io/io_mmap.c      (original)
+++ trunk/src/io/io_mmap.c      Wed Jul 18 12:38:03 2007
@@ -1,5 +1,5 @@
 /*
-Copyright (C) 2005, The Perl Foundation.
+Copyright (C) 2005-2007, The Perl Foundation.
 $Id$
 
 =head1 NAME
@@ -12,10 +12,6 @@
 
 =head2 mmap layer functions
 
-=over 4
-
-=cut
-
 */
 
 #include "parrot/parrot.h"
@@ -26,21 +22,28 @@
 /* HEADERIZER BEGIN: static */
 
 static INTVAL PIO_mmap_close( PARROT_INTERP,
-    ParrotIOLayer *layer,
-    ParrotIO *io )
-        __attribute__nonnull__(1);
+    NOTNULL(ParrotIOLayer *layer),
+    NOTNULL(ParrotIO *io) )
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3);
 
 static ParrotIO * PIO_mmap_open( PARROT_INTERP,
-    ParrotIOLayer *layer,
-    const char *path,
+    NOTNULL(ParrotIOLayer *layer),
+    NOTNULL(const char *path),
     INTVAL flags )
-        __attribute__nonnull__(1);
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3);
 
 static size_t PIO_mmap_read( PARROT_INTERP,
-    ParrotIOLayer *layer,
-    ParrotIO *io,
-    STRING **buf )
-        __attribute__nonnull__(1);
+    NOTNULL(ParrotIOLayer *layer),
+    NOTNULL(ParrotIO *io),
+    NOTNULL(STRING **buf) )
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3)
+        __attribute__nonnull__(4);
 
 /* HEADERIZER END: static */
 
@@ -70,14 +73,14 @@
     PIO_null_getcount,
     PIO_null_fill,
     PIO_null_eof,
-    0, /* no poll */
-    0, /* no socket */
-    0, /* no connect */
-    0, /* no send */
-    0, /* no recv */
-    0, /* no bind */
-    0, /* no listen */
-    0  /* no accept */
+    NULL, /* no poll */
+    NULL, /* no socket */
+    NULL, /* no connect */
+    NULL, /* no send */
+    NULL, /* no recv */
+    NULL, /* no bind */
+    NULL, /* no listen */
+    NULL  /* no accept */
 };
 
 ParrotIOLayer pio_mmap_layer = {
@@ -85,7 +88,7 @@
     "mmap",
     0,
     &pio_mmap_layer_api,
-    0, 0
+    NULL, NULL
 };
 
 ParrotIOLayer *
@@ -96,19 +99,15 @@
 
 /*
 
-=item C<static ParrotIO *
-PIO_mmap_open(PARROT_INTERP, ParrotIOLayer *layer,
-               const char *path, INTVAL flags)>
+FUNCDOC: PIO_mmap_open
 
 The buffer layer's C<Open> function.
 
-=cut
-
 */
 
 static ParrotIO *
-PIO_mmap_open(PARROT_INTERP, ParrotIOLayer *layer,
-               const char *path, INTVAL flags)
+PIO_mmap_open(PARROT_INTERP, NOTNULL(ParrotIOLayer *layer),
+               NOTNULL(const char *path), INTVAL flags)
 {
     ParrotIO *io;
     ParrotIOLayer *l = PIO_DOWNLAYER(layer);
@@ -145,20 +144,16 @@
 
 /*
 
-=item C<static size_t
-PIO_mmap_read(PARROT_INTERP, ParrotIOLayer *layer, ParrotIO *io,
-              STRING ** buf)>
+FUNCDOC: PIO_mmap_read
 
 Calls C<read()> to return up to C<len> bytes in the memory starting at
 C<buffer>.
 
-=cut
-
 */
 
 static size_t
-PIO_mmap_read(PARROT_INTERP, ParrotIOLayer *layer, ParrotIO *io,
-              STRING **buf)
+PIO_mmap_read(PARROT_INTERP, NOTNULL(ParrotIOLayer *layer), NOTNULL(ParrotIO 
*io),
+              NOTNULL(STRING **buf))
 {
     STRING *s;
     UINTVAL len;
@@ -184,30 +179,24 @@
 
 /*
 
-=item C<static INTVAL
-PIO_mmap_close(PARROT_INTERP, ParrotIOLayer *layer, ParrotIO *io)>
+FUNCDOC: PIO_mmap_close
 
 Closes C<*io>'s file descriptor.
 
-=cut
-
 */
 
 static INTVAL
-PIO_mmap_close(PARROT_INTERP, ParrotIOLayer *layer, ParrotIO *io)
+PIO_mmap_close(PARROT_INTERP, NOTNULL(ParrotIOLayer *layer), NOTNULL(ParrotIO 
*io))
 {
     INTVAL ret = -1;
 
-    if (io->fd >= 0) {
+    if (io->fd >= 0)
         ret = PIO_close_down(interp, PIO_DOWNLAYER(layer), io);
-    }
     return ret;
 }
 
 /*
 
-=back
-
 =head1 SEE ALSO
 
 F<src/io/io_passdown.c>,
@@ -219,8 +208,6 @@
 
 Initially written by Leo.
 
-=cut
-
 */
 
 

Reply via email to