diff options
author | Akira TAGOH <akira@tagoh.org> | 2009-05-11 05:22:59 +0000 |
---|---|---|
committer | Akira TAGOH <akira@tagoh.org> | 2009-05-11 05:22:59 +0000 |
commit | bdcb601b486efc2a6c5b80b85920020f69dc80be (patch) | |
tree | 83f43d1b05059058217d09d2acf5fac9ee82b7fd | |
parent | 090125e4d1dde5c6f443a4f0d7a8257d456cb36b (diff) |
2009-05-11 Akira TAGOH <akira@tagoh.org>
* hieroglyph/hgobject.c (_hg_object_new): Fix the alignment issue.
* hieroglyph/hgstack.c (hg_stack_dump): Fix a warning on 64bit arch.
* tests/hgobject.c (test_hg_object_sized_new): update the aligned size.
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | hieroglyph/hgobject.c | 2 | ||||
-rw-r--r-- | hieroglyph/hgstack.c | 2 | ||||
-rw-r--r-- | tests/hgobject.c | 2 |
4 files changed, 11 insertions, 3 deletions
@@ -1,3 +1,11 @@ +2009-05-11 Akira TAGOH <akira@tagoh.org> + + * hieroglyph/hgobject.c (_hg_object_new): Fix the alignment issue. + + * hieroglyph/hgstack.c (hg_stack_dump): Fix a warning on 64bit arch. + + * tests/hgobject.c (test_hg_object_sized_new): update the aligned size. + 2007-12-31 Akira TAGOH <akira@tagoh.org> * tests/Makefile.am (test_hgstack_SOURCES): use check library. diff --git a/hieroglyph/hgobject.c b/hieroglyph/hgobject.c index 3438c3d..0eb62a4 100644 --- a/hieroglyph/hgobject.c +++ b/hieroglyph/hgobject.c @@ -45,7 +45,7 @@ _hg_object_new(hg_vm_t *vm, gsize data_size) { hg_object_t *retval; - guint32 total_size = hg_n_alignof (sizeof (hg_object_header_t) + sizeof (_hg_object_t) + data_size); + guint32 total_size = hg_n_alignof (hg_n_alignof (sizeof (hg_object_header_t) + sizeof (_hg_object_t)) + data_size); hg_attribute_t attr; hg_return_val_if_fail (vm != NULL, NULL); diff --git a/hieroglyph/hgstack.c b/hieroglyph/hgstack.c index 3f69006..2d3db9a 100644 --- a/hieroglyph/hgstack.c +++ b/hieroglyph/hgstack.c @@ -212,7 +212,7 @@ hg_stack_dump(hg_vm_t *vm, i < (stack->stack_depth - stack->current_depth); i++, data = data->prev) { p = hg_object_dump(data->data, TRUE); - printf("%d: %s\n", i + 1, p); + printf("%" G_GSIZE_FORMAT ": %s\n", i + 1, p); g_free(p); } } diff --git a/tests/hgobject.c b/tests/hgobject.c index 7a425fa..96c0a44 100644 --- a/tests/hgobject.c +++ b/tests/hgobject.c @@ -85,7 +85,7 @@ TDEF (hg_object_sized_new) TNUL (obj); fail_unless(HG_OBJECT_GET_N_OBJECTS (obj) == 1, "The amount of the object is different."); - fail_unless(HG_OBJECT_HEADER (obj)->total_length == hg_n_alignof (sizeof (hg_object_header_t) + sizeof (_hg_object_t) + 10), "The length of the object is different."); + fail_unless(HG_OBJECT_HEADER (obj)->total_length == hg_n_alignof (hg_n_alignof (sizeof (hg_object_header_t) + sizeof (_hg_object_t)) + 10), "The length of the object is different."); hg_object_free(vm, obj); |