diff --git a/libguile/ChangeLog b/libguile/ChangeLog index efd196325..46729996d 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,6 +1,7 @@ 2001-02-05 Keisuke Nishida * dump.c, dump.h: Modified a lot. + (SCM_DUMP_COOKIE): Version 0.1 (scm_dump_mark): Removed. (scm_restore_cell_object, scm_store_cell_object): New functions. diff --git a/libguile/dump.c b/libguile/dump.c index 71141c6a6..870c08df4 100644 --- a/libguile/dump.c +++ b/libguile/dump.c @@ -60,7 +60,7 @@ #include "libguile/validate.h" #include "libguile/dump.h" -#define SCM_DUMP_COOKIE "\x7fGBF-0.0" +#define SCM_DUMP_COOKIE "\x7fGBF-0.1" #define SCM_DUMP_HASH_SIZE 151 #define SCM_DUMP_IMAGE_SIZE 4096 @@ -285,7 +285,7 @@ scm_store_string (const char *addr, scm_sizet size, SCM dstate) } void -scm_store_bytes (const char *addr, scm_sizet size, SCM dstate) +scm_store_bytes (const void *addr, scm_sizet size, SCM dstate) { struct scm_dstate *p = SCM_DSTATE_DATA (dstate); while (p->image_index + size >= p->image_size) @@ -298,7 +298,7 @@ scm_store_bytes (const char *addr, scm_sizet size, SCM dstate) void scm_store_word (const scm_bits_t word, SCM dstate) { - scm_store_bytes ((const char *) &word, sizeof (scm_bits_t), dstate); + scm_store_bytes (&word, sizeof (scm_bits_t), dstate); } void @@ -337,21 +337,21 @@ scm_restore_pad (SCM dstate) } const char * -scm_restore_string (SCM dstate, int *lenp) +scm_restore_string (scm_sizet *sizep, SCM dstate) { struct scm_dstate *p = SCM_DSTATE_DATA (dstate); const char *addr = p->image_base + p->image_index; - *lenp = strlen (addr); - p->image_index += *lenp + 1; + *sizep = strlen (addr); + p->image_index += *sizep + 1; scm_restore_pad (dstate); return addr; } -const char * -scm_restore_bytes (SCM dstate, scm_sizet size) +const void * +scm_restore_bytes (scm_sizet size, SCM dstate) { struct scm_dstate *p = SCM_DSTATE_DATA (dstate); - const char *addr = p->image_base + p->image_index; + const void *addr = p->image_base + p->image_index; p->image_index += size; scm_restore_pad (dstate); return addr; @@ -510,14 +510,14 @@ scm_undump (SCM dstate) case scm_tc7_symbol: { int len; - const char *mem = scm_restore_string (dstate, &len); + const char *mem = scm_restore_string (&len, dstate); obj = scm_mem2symbol (mem, len); goto store_object; } case scm_tc7_string: { int len; - const char *mem = scm_restore_string (dstate, &len); + const char *mem = scm_restore_string (&len, dstate); obj = scm_makfromstr (mem, len, 0); goto store_object; } diff --git a/libguile/dump.h b/libguile/dump.h index 1c7181809..f00b95866 100644 --- a/libguile/dump.h +++ b/libguile/dump.h @@ -46,13 +46,13 @@ #include "libguile/__scm.h" extern void scm_store_string (const char *addr, scm_sizet size, SCM dstate); -extern void scm_store_bytes (const char *addr, scm_sizet size, SCM dstate); +extern void scm_store_bytes (const void *addr, scm_sizet size, SCM dstate); extern void scm_store_word (const scm_bits_t word, SCM dstate); extern void scm_store_object (SCM obj, SCM dstate); extern void scm_store_cell_object (SCM cell, int n, SCM dstate); -extern const char *scm_restore_string (SCM dstate, int *lenp); -extern const char *scm_restore_bytes (SCM dstate, scm_sizet size); +extern const char *scm_restore_string (scm_sizet *sizep, SCM dstate); +extern const void *scm_restore_bytes (scm_sizet size, SCM dstate); extern scm_bits_t scm_restore_word (SCM dstate); extern void scm_restore_object (SCM *objp, SCM dstate); extern void scm_restore_cell_object (SCM cell, int n, SCM dstate); diff --git a/libguile/keywords.c b/libguile/keywords.c index 7361499b8..1810d6df0 100644 --- a/libguile/keywords.c +++ b/libguile/keywords.c @@ -81,7 +81,7 @@ static SCM keyword_undump (SCM dstate) { int len; - const char *mem = scm_restore_string (dstate, &len); + const char *mem = scm_restore_string (&len, dstate); SCM sym = scm_mem2symbol (mem, len); return scm_make_keyword_from_dash_symbol (sym); }