eldbus-codegen no longer passes garbage values to error callbacks

@fix
This commit is contained in:
Mike Blumenkrantz 2014-05-04 20:36:58 -04:00
parent faf8f51ff6
commit caf27c4fc3
1 changed files with 9 additions and 9 deletions

View File

@ -7,6 +7,14 @@
static const char *code_prefix = NULL; static const char *code_prefix = NULL;
static char buffer[4028]; static char buffer[4028];
static const char *
null_or_zero(const char *type)
{
if (type[0] == 's' || type[0] == 'o' || type[0] == 'v' || type[1])
return "NULL";
return "0";
}
static const char * static const char *
prefix_append(const char *text) prefix_append(const char *text)
{ {
@ -252,7 +260,7 @@ source_client_simple_method_callback_generate(const DBus_Method *method, Eina_St
continue; continue;
eina_strbuf_append(full_signature, arg->type); eina_strbuf_append(full_signature, arg->type);
eina_strbuf_append_printf(h, ", %s%s", dbus_type2c_type(arg->type), arg->c_name); eina_strbuf_append_printf(h, ", %s%s", dbus_type2c_type(arg->type), arg->c_name);
eina_strbuf_append_printf(c_code, " %s%s;\n", dbus_type2c_type(arg->type), arg->c_name); eina_strbuf_append_printf(c_code, " %s%s = %s;\n", dbus_type2c_type(arg->type), arg->c_name, null_or_zero(arg->type));
eina_strbuf_append_printf(end_cb, ", %s", arg->c_name); eina_strbuf_append_printf(end_cb, ", %s", arg->c_name);
eina_strbuf_append_printf(arguments_get, ", &%s", arg->c_name); eina_strbuf_append_printf(arguments_get, ", &%s", arg->c_name);
} }
@ -416,14 +424,6 @@ prop_cb_get(const DBus_Property *prop)
} }
} }
static const char *
null_or_zero(const char *type)
{
if (type[0] == 's' || type[0] == 'o' || type[0] == 'v' || type[1])
return "NULL";
return "0";
}
static void static void
source_client_property_generate_get(const DBus_Property *prop, Eina_Strbuf *c_code, Eina_Strbuf *h) source_client_property_generate_get(const DBus_Property *prop, Eina_Strbuf *c_code, Eina_Strbuf *h)
{ {