Permalink
Browse files

adding more function annotations

  • Loading branch information...
1 parent f17bd2d commit 81d3c0861cf1645ab5d5c4fe1d55b3f8a3dd7e21 @petdance petdance committed Apr 10, 2012
Showing with 14 additions and 8 deletions.
  1. +5 −3 include/parrot/packfile.h
  2. +2 −2 src/packfile/api.c
  3. +7 −3 src/packfile/segments.c
View
8 include/parrot/packfile.h
@@ -692,9 +692,10 @@ STRING * Parrot_pf_serialize(PARROT_INTERP, ARGIN(PackFile * const pf))
__attribute__nonnull__(2);
PARROT_EXPORT
-INTVAL Parrot_pf_serialized_size(PARROT_INTERP, ARGIN(PackFile * pf))
+INTVAL Parrot_pf_serialized_size(PARROT_INTERP, ARGMOD(PackFile *pf))
__attribute__nonnull__(1)
- __attribute__nonnull__(2);
+ __attribute__nonnull__(2)
+ FUNC_MODIFIES(*pf);
PARROT_EXPORT
void Parrot_pf_set_current_packfile(PARROT_INTERP, ARGIN(PMC *pbc))
@@ -1023,7 +1024,8 @@ void PackFile_Segment_destroy(PARROT_INTERP, ARGMOD(PackFile_Segment *self))
FUNC_MODIFIES(*self);
PARROT_EXPORT
-void PackFile_Segment_dump(PARROT_INTERP, ARGIN(PackFile_Segment *self))
+void PackFile_Segment_dump(PARROT_INTERP,
+ ARGIN(const PackFile_Segment *self))
__attribute__nonnull__(1)
__attribute__nonnull__(2);
View
4 src/packfile/api.c
@@ -274,7 +274,7 @@ PackFile_destroy(PARROT_INTERP, ARGMOD(PackFile *pf))
/*
-=item C<INTVAL Parrot_pf_serialized_size(PARROT_INTERP, PackFile * pf)>
+=item C<INTVAL Parrot_pf_serialized_size(PARROT_INTERP, PackFile *pf)>
Returns the size, in bytes, that a packfile will be if serialized
@@ -292,7 +292,7 @@ Deserialize a packfile which is stored in a STRING buffer
PARROT_EXPORT
INTVAL
-Parrot_pf_serialized_size(PARROT_INTERP, ARGIN(PackFile * pf))
+Parrot_pf_serialized_size(PARROT_INTERP, ARGMOD(PackFile *pf))
{
ASSERT_ARGS(Parrot_pf_serialized_size)
return PackFile_pack_size(interp, pf);
View
10 src/packfile/segments.c
@@ -1,5 +1,5 @@
/*
-Copyright (C) 2011, Parrot Foundation.
+Copyright (C) 2011-2012, Parrot Foundation.
=head1 NAME
@@ -88,6 +88,8 @@ static opcode_t * default_pack(
__attribute__nonnull__(2)
FUNC_MODIFIES(*dest);
+PARROT_PURE_FUNCTION
+PARROT_WARN_UNUSED_RESULT
static size_t default_packed_size(ARGIN(const PackFile_Segment *self))
__attribute__nonnull__(1);
@@ -1122,7 +1124,7 @@ PackFile_Segment_unpack(PARROT_INTERP, ARGMOD(PackFile_Segment *self),
/*
-=item C<void PackFile_Segment_dump(PARROT_INTERP, PackFile_Segment *self)>
+=item C<void PackFile_Segment_dump(PARROT_INTERP, const PackFile_Segment *self)>
Dumps the segment C<self>.
@@ -1132,7 +1134,7 @@ Dumps the segment C<self>.
PARROT_EXPORT
void
-PackFile_Segment_dump(PARROT_INTERP, ARGIN(PackFile_Segment *self))
+PackFile_Segment_dump(PARROT_INTERP, ARGIN(const PackFile_Segment *self))
{
ASSERT_ARGS(PackFile_Segment_dump)
self->pf->PackFuncs[self->type].dump(interp, self);
@@ -1634,6 +1636,8 @@ Returns the default size of the segment C<self>.
*/
+PARROT_PURE_FUNCTION
+PARROT_WARN_UNUSED_RESULT
static size_t
default_packed_size(ARGIN(const PackFile_Segment *self))
{

0 comments on commit 81d3c08

Please sign in to comment.