Author: infinoid
Date: Sat Jul 19 15:19:33 2008
New Revision: 29614
Modified:
branches/pdd13pbc/src/pmc/packfile.pmc
branches/pdd13pbc/src/pmc/packfiledirectory.pmc
Log:
[PDD13]
* Fix some datatype-related warnings.
* Remove the VTABLE set_pointer() I had hacked into packfiledirectory;
for now, just calling PMC_data() directly in the creation function
works fine. (And will work for the rest of the segment types, too.)
Modified: branches/pdd13pbc/src/pmc/packfile.pmc
==============================================================================
--- branches/pdd13pbc/src/pmc/packfile.pmc (original)
+++ branches/pdd13pbc/src/pmc/packfile.pmc Sat Jul 19 15:19:33 2008
@@ -65,13 +65,14 @@
VTABLE STRING *get_string() {
PackFile *pf = PMC_data_typed(SELF, PackFile *);
opcode_t length = PackFile_pack_size(interp, pf) * sizeof(opcode_t);
- char *ptr = mem_sys_allocate(length);
+ opcode_t *ptr = (opcode_t*)mem_sys_allocate(length);
+ STRING *str;
PackFile_pack(interp, pf, ptr);
/* FIXME: PARROT_BINARY_CHARSET seems like a better choice, but the
* comparison function for the binary charset plugin always returns
* "equal", which means tests fail.
*/
- STRING *str = string_make_direct(interp, ptr, length,
+ str = string_make_direct(interp, (const char*)ptr, length,
PARROT_FIXED_8_ENCODING, PARROT_DEFAULT_CHARSET, 0);
mem_sys_free(ptr);
return str;
@@ -291,7 +292,7 @@
METHOD get_directory() {
PackFile *pf = PMC_data_typed(SELF, PackFile *);
PMC *dir = pmc_new(interp, enum_class_PackfileDirectory);
- VTABLE_set_pointer(interp, dir, &pf->directory);
+ PMC_data(dir) = &pf->directory;
RETURN(PMC *dir);
}
Modified: branches/pdd13pbc/src/pmc/packfiledirectory.pmc
==============================================================================
--- branches/pdd13pbc/src/pmc/packfiledirectory.pmc (original)
+++ branches/pdd13pbc/src/pmc/packfiledirectory.pmc Sat Jul 19 15:19:33 2008
@@ -32,23 +32,6 @@
/*
-=item C<void set_pointer(void *dir)>
-
-Initialize this object with a pointer to a Packfile_Directory.
-
-FIXME: This isn't listed as part of the PDD13 API; it is just a hack
-to get Packfile.get_directory() working.
-
-=cut
-
-*/
- VTABLE void set_pointer(void *dir) {
- PMC_data(SELF) = dir;
- }
-
-
-/*
-
=item C<STRING *pack()>
Serialize the segment.