On 11/19/2013 06:51 AM, alfonsosanchezbeato wrote:
> In plugins/smshistory.c:
>
>> +	DBG("");
>> +	if ((s == OFONO_HISTORY_SMS_STATUS_DELIVERED)
>> +			|| (s == OFONO_HISTORY_SMS_STATUS_DELIVER_FAILED)) {
>> +
>> +		DBusMessage *signal;
>> +		DBusMessageIter iter;
>> +		DBusMessageIter dict;
>> +		/* modem path + '/message_' + UUID as string */
>> +		char msg_uuid_str[160];
>> +		const char *msg_uuid_ptr;
>> +		struct ofono_atom *atom;
>> +		const char *path;
>> +		DBusConnection *conn;
>> +		int delivered;
>> +
>> +		atom = __ofono_modem_find_atom(context->modem,
>
> If I put all in line it gives me 85 columns?

My bad, I re-checked and you're correct.

> Regarding the blank line: it is true that oFono rules specify that a
> blank line is needed before an "if" statement. There is one exception,
> which is when a variable is being allocated. The rationale I see behind
> is that the "if" after allocating should be always a check to see if the
> allocation has been successful. I think that in fact this rule is "de
> facto" extended in all oFono code so whenever you have to check if a
> function call has returned a valid value, no line is introduced between
> the call and the check. This can be seen in:
>
> network.c:584, 787, ...
> call-meter.c:339
> stk.c:2055
> ...
>
> So I can change this, but I would prefer to assume that M1 exception
> should be rephrased to say:
> "The only exception to this rule applies when we have a function call
> and immediately after it we check if the returned value is valid."
> This is consistent with actual core oFono code and makes sense to me, as
> calling a function and immediately checking the return value sound to be
> the right thing to keep in close lines, as in fact you can see them as
> being part of the same logical statement.

Agreed.  You want submit the patch upstream?? ;)

/t

>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/rilmodem/ofono/pull/21/files#r7754846>.
>