From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCHv2 2/2] sms: Introduce message code independent of protocol stack
Date: Thu, 20 Jan 2011 12:02:09 -0600 [thread overview]
Message-ID: <4D3878A1.3020206@gmail.com> (raw)
In-Reply-To: <1295051446-22150-3-git-send-email-faiyaz.baxamusa@nokia.com>
[-- Attachment #1: Type: text/plain, Size: 2867 bytes --]
Hi Faiyaz,
> +static void message_destroy(gpointer userdata)
> +{
> + struct message *m = userdata;
> +
> + m->data = NULL;
> + m->atom = NULL;
Lets remove the above two assignments, they're not really needed.
> + g_free(m);
> +}
> +
<snip>
> diff --git a/src/message.h b/src/message.h
> new file mode 100644
> index 0000000..faa957f
> --- /dev/null
> +++ b/src/message.h
> @@ -0,0 +1,67 @@
> +/*
> + *
> + * oFono - Open Source Telephony
> + *
> + * Copyright (C) 2008-2011 Intel Corporation. All rights reserved.
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software
> + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
> + *
> + */
> +
> +#ifndef __OFONO_MESSAGE_H
> +#define __OFONO_MESSAGE_H
> +
> +#ifdef __cplusplus
> +extern "C" {
> +#endif
> +
Please remove these #ifdefs, non-public headers should not contain these
guards. The intent is to let the compiler warn us if/when we
inadvertently include a file more than once. See any other header file
in src/ for an example
> +#include <ofono/types.h>
> +
> +enum message_state {
> + MESSAGE_STATE_PENDING,
> + MESSAGE_STATE_SENT,
> + MESSAGE_STATE_FAILED
> +};
> +
> +struct ofono_atom;
> +struct message;
> +
> +struct message *message_create(const struct ofono_uuid *uuid,
> + struct ofono_atom *atom);
> +
> +gboolean message_dbus_register(struct message *m);
> +void message_dbus_unregister(struct message *m);
> +
> +const struct ofono_uuid *message_get_uuid(const struct message *m);
> +
> +void message_set_state(struct message *m, enum message_state new_state);
> +
> +void message_append_properties(struct message *m, DBusMessageIter *dict);
> +
> +void message_emit_added(struct message *m, const char *interface);
> +
> +void message_emit_removed(struct message *m, const char *interface);
> +
> +void *message_get_data(struct message *m);
> +
> +void message_set_data(struct message *m, void *data);
> +
> +const char *message_path_from_uuid(struct ofono_atom *atom,
> + const struct ofono_uuid *uuid);
> +
> +#ifdef __cplusplus
> +}
> +#endif
> +
> +#endif /* __OFONO_MESSAGE_H */
Same comment as above about the ifdefs
<snip>
Rest looks just fine to me.
Regards,
-Denis
prev parent reply other threads:[~2011-01-20 18:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-15 0:30 [PATCHv2 2/2] sms: Introduce message code independent of protocol stack Faiyaz Baxamusa
2011-01-20 18:02 ` Denis Kenzior [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4D3878A1.3020206@gmail.com \
--to=denkenz@gmail.com \
--cc=ofono@ofono.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.