diff options
author | Miguel de Icaza <miguel@gnome.org> | 2006-10-15 08:08:08 +0400 |
---|---|---|
committer | Miguel de Icaza <miguel@gnome.org> | 2006-10-15 08:08:08 +0400 |
commit | 34b4ac732933c6af3066f2c397d095bfa9da99da (patch) | |
tree | f79a93509c6e72b56c3e9da3df109751a80a173d /eglib | |
parent | 2466e90c86256c90cdd4667632b26b2c26b074b3 (diff) |
2006-10-15 Miguel de Icaza <miguel@novell.com>
* src/glib.h (G_STRUCT_OFFSET): fix macro definition.
fix typo.
* src/sizes.c: Add test.
* src/gshell.c: Make it build
svn path=/trunk/mono/; revision=66683
Diffstat (limited to 'eglib')
-rw-r--r-- | eglib/ChangeLog | 9 | ||||
-rw-r--r-- | eglib/src/glib.h | 2 | ||||
-rw-r--r-- | eglib/src/gshell.c | 6 | ||||
-rw-r--r-- | eglib/test/sizes.c | 18 |
4 files changed, 32 insertions, 3 deletions
diff --git a/eglib/ChangeLog b/eglib/ChangeLog index 87a912f7216..6fddabbdcf9 100644 --- a/eglib/ChangeLog +++ b/eglib/ChangeLog @@ -1,3 +1,12 @@ +2006-10-15 Miguel de Icaza <miguel@novell.com> + + * src/glib.h (G_STRUCT_OFFSET): fix macro definition. + fix typo. + + * src/sizes.c: Add test. + + * src/gshell.c: Make it build + 2006-10-14 Miguel de Icaza <miguel@novell.com> * src/glib.h: add various _TO_LE and _FROM_LE macros. diff --git a/eglib/src/glib.h b/eglib/src/glib.h index f4bf3fe3f44..b3ba7bc8bcb 100644 --- a/eglib/src/glib.h +++ b/eglib/src/glib.h @@ -58,7 +58,7 @@ typedef uint16_t gunichar2; #define ABS(a,b) (((a)>(b)) ? ((a)-(b)) : ((b)-(a))) #define G_STRUCT_OFFSET(p_type,field) \ - ((long) (((char *) (&(((p_type)NULL)->field))) - ((char *) NULL))) + ((long) (((char *) (&(((p_type *)NULL)->field))) - ((char *) NULL))) #define EGLIB_STRINGIFY(x) #x #define EGLIB_TOSTRING(x) EGLIB_STRINGIFY(x) diff --git a/eglib/src/gshell.c b/eglib/src/gshell.c index 0bd3466a05f..b53dcad21ec 100644 --- a/eglib/src/gshell.c +++ b/eglib/src/gshell.c @@ -137,11 +137,13 @@ g_shell_parse_argv (const gchar *command_line, gint *argcp, gchar ***argvp, GErr gchar * g_shell_quote (const gchar *unquoted_string) { - g_abort ("Not implemented"); + g_error ("Not implemented"); + return NULL; } gchar * g_shell_unquote (const gchar *quoted_string, GError **error) { - g_abort ("Not implemented"); + g_error ("Not implemented"); + return NULL; } diff --git a/eglib/test/sizes.c b/eglib/test/sizes.c index 771848ce3a6..1389374b1e1 100644 --- a/eglib/test/sizes.c +++ b/eglib/test/sizes.c @@ -79,9 +79,27 @@ test_ptrconv () } +typedef struct { + int a; + int b; +} my_struct; + +RESULT +test_offset () +{ + if (G_STRUCT_OFFSET (my_struct, a) != 0) + return FAILED ("offset of a is not zero"); + + if (G_STRUCT_OFFSET (my_struct, b) != 4 && G_STRUCT_OFFSET (my_struct, b) != 8) + return FAILED ("offset of b is 4 or 8, macro might be busted"); + + return OK; +} + static Test size_tests [] = { {"formats", test_formats}, {"ptrconv", test_ptrconv}, + {"g_struct_offset", test_offset}, {NULL, NULL} }; |