Author: petdance
Date: Mon Jun 11 09:16:05 2007
New Revision: 18928
Modified:
trunk/config/gen/makefiles/root.in
trunk/include/parrot/packfile.h
trunk/src/packdump.c
Log:
headerized packdump.c
Modified: trunk/config/gen/makefiles/root.in
==============================================================================
--- trunk/config/gen/makefiles/root.in (original)
+++ trunk/config/gen/makefiles/root.in Mon Jun 11 09:16:05 2007
@@ -1844,6 +1844,7 @@
src/list.o \
src/mmd.o \
src/objects.o \
+ src/packdump.o \
src/packfile.o \
src/packout.o \
src/pic.o \
Modified: trunk/include/parrot/packfile.h
==============================================================================
--- trunk/include/parrot/packfile.h (original)
+++ trunk/include/parrot/packfile.h Mon Jun 11 09:16:05 2007
@@ -464,17 +464,24 @@
/* HEADERIZER END: src/packfile.c */
+/* HEADERIZER BEGIN: src/packdump.c */
+
+PARROT_API void PackFile_ConstTable_dump( Interp *interp /*NN*/,
+ const PackFile_ConstTable *self /*NN*/ )
+ __attribute__nonnull__(1)
+ __attribute__nonnull__(2);
+
+PARROT_API void PackFile_Fixup_dump( Interp *interp /*NN*/,
+ const PackFile_FixupTable *ft /*NN*/ )
+ __attribute__nonnull__(1)
+ __attribute__nonnull__(2);
+
+/* HEADERIZER END: src/packdump.c */
/* fingerprint functions */
PARROT_API int PackFile_check_fingerprint(void *cursor);
PARROT_API size_t PackFile_write_fingerprint(void *cursor);
-/* packdump.c */
-PARROT_API void PackFile_Fixup_dump(Interp *, PackFile_FixupTable *ft);
-PARROT_API void PackFile_ConstTable_dump(Interp *, PackFile_ConstTable *);
-
-/* packout.c */
-PARROT_API opcode_t * PackFile_Constant_pack(Interp *, PackFile_ConstTable
*ct, PackFile_Constant *, opcode_t *);
/*
* pf_items low level Parrot items fetch routines
Modified: trunk/src/packdump.c
==============================================================================
--- trunk/src/packdump.c (original)
+++ trunk/src/packdump.c Mon Jun 11 09:16:05 2007
@@ -1,5 +1,5 @@
/*
-Copyright (C) 2001-2005, The Perl Foundation.
+Copyright (C) 2001-2007, The Perl Foundation.
This program is free software. It is subject to the same license as
Parrot itself.
$Id$
@@ -14,24 +14,16 @@
=head2 Functions
-=over 4
-
-=cut
-
*/
#include "parrot/parrot.h"
#include "parrot/packfile.h"
-/*
-** FIXME: this should also be segmentized.
-** For now just remove some warnings
-*/
+/* HEADER: include/parrot/packfile.h */
-void PackFile_ConstTable_dump(Interp *, PackFile_ConstTable *);
-static void PackFile_Constant_dump(Interp *, PackFile_ConstTable *ct,
- PackFile_Constant *);
-void PackFile_Fixup_dump(Interp *, PackFile_FixupTable *ft);
+static void
+PackFile_Constant_dump(Interp *interp /*NN*/, PackFile_ConstTable *ct /*NN*/,
+ PackFile_Constant *self /*NN*/)
/*
@@ -43,7 +35,7 @@
PARROT_API
void
-PackFile_ConstTable_dump(Interp *interp, PackFile_ConstTable *self)
+PackFile_ConstTable_dump(Interp *interp /*NN*/, const PackFile_ConstTable
*self /*NN*/)
{
opcode_t i;
@@ -55,25 +47,18 @@
/*
-=item C<void
-PackFile_Constant_dump(Interp *interp, PackFile_ConstTable *ct,
- PackFile_Constant *self)>
+FUNCDOC: PackFile_Constant_dump
Dumps the constant C<self>.
-=cut
-
*/
-void
-PackFile_Constant_dump(Interp *interp, PackFile_ConstTable *ct,
- PackFile_Constant *self)
+static void
+PackFile_Constant_dump(Interp *interp /*NN*/, PackFile_ConstTable *ct /*NN*/,
+ PackFile_Constant *self /*NN*/)
{
PMC *key;
size_t i;
- size_t ct_index;
- opcode_t slice_bits;
- PackFile_Constant *detail;
switch (self->type) {
@@ -105,6 +90,8 @@
/* and now type / value per component */
for (key = self->u.key; key; key = PMC_data(key)) {
opcode_t type = PObj_get_FLAGS(key);
+ opcode_t slice_bits = 0; /* XXX slice_bits gets set, but never
used */
+
PIO_printf(interp, " {\n");
slice_bits = 0;
if ((type & (KEY_start_slice_FLAG|KEY_inf_slice_FLAG)) ==
@@ -130,14 +117,23 @@
PIO_printf(interp, " },\n");
break;
case KEY_number_FLAG:
+ {
+ const PackFile_Constant *detail;
+ size_t ct_index;
+
PIO_printf(interp, " TYPE => NUMBER\n");
ct_index = PackFile_find_in_const(interp, ct, key,
PFC_NUMBER);
PIO_printf(interp, " PFC_OFFSET => %ld\n",
ct_index);
detail = ct->constants[ct_index];
PIO_printf(interp, " DATA => %ld\n",
detail->u.number);
PIO_printf(interp, " },\n");
+ }
break;
case KEY_string_FLAG:
+ {
+ const PackFile_Constant *detail;
+ size_t ct_index;
+
PIO_printf(interp, " TYPE => STRING\n");
ct_index = PackFile_find_in_const(interp, ct, key,
PFC_STRING);
PIO_printf(interp, " PFC_OFFSET => %ld\n",
ct_index);
@@ -146,6 +142,7 @@
(int)detail->u.string->bufused,
(char *)detail->u.string->strstart);
PIO_printf(interp, " },\n");
+ }
break;
case KEY_integer_FLAG | KEY_register_FLAG:
PIO_printf(interp, " TYPE => I REGISTER\n");
@@ -178,13 +175,11 @@
case PFC_PMC:
PIO_printf(interp, " [ 'PFC_PMC', {\n");
{
- PMC *pmc = self->u.key;
+ PMC * const pmc = self->u.key;
Parrot_sub *sub;
- STRING *a_key = const_string(interp, "(keyed)");
STRING *null = const_string(interp, "(null)");
STRING *namespace_description;
- opcode_t *code_start =
- interp->code->base.data;
+
switch (pmc->vtable->base_type) {
case enum_class_FixedBooleanArray:
case enum_class_FixedFloatArray:
@@ -196,7 +191,7 @@
case enum_class_ResizablePMCArray:
case enum_class_ResizableStringArray:
{
- int n = VTABLE_get_integer(interp, pmc);
+ const int n = VTABLE_get_integer(interp, pmc);
STRING* out_buffer = VTABLE_get_repr(interp, pmc);
PIO_printf(interp,
"\tclass => %Ss,\n"
@@ -270,17 +265,15 @@
/*
-=item C<void
-PackFile_Fixup_dump(Interp *interp, PackFile_FixupTable *ft)>
+FUNCDOC: PackFile_Fixup_dump
Dumps the fix-up table C<ft>.
-=cut
-
*/
+PARROT_API
void
-PackFile_Fixup_dump(Interp *interp, PackFile_FixupTable *ft)
+PackFile_Fixup_dump(Interp *interp /*NN*/, const PackFile_FixupTable *ft
/*NN*/)
{
opcode_t i;
@@ -305,14 +298,10 @@
/*
-=back
-
=head1 SEE ALSO
F<src/pdump.c>.
-=cut
-
*/