From: Philippe Nunes <philippe.nunes@linux.intel.com>
To: ofono@ofono.org
Subject: [PATCH v4 1/3] smsutil: Fix style issues
Date: Fri, 31 Aug 2012 17:03:56 +0200 [thread overview]
Message-ID: <1346425438-12220-1-git-send-email-philippe.nunes@linux.intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 3727 bytes --]
---
src/smsutil.c | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/src/smsutil.c b/src/smsutil.c
index a541964..b4d129f 100644
--- a/src/smsutil.c
+++ b/src/smsutil.c
@@ -81,11 +81,11 @@ void extract_bcd_number(const unsigned char *buf, int len, char *out)
for (i = 0; i < len; i++) {
oct = buf[i];
- out[i*2] = digit_lut[oct & 0x0f];
- out[i*2+1] = digit_lut[(oct & 0xf0) >> 4];
+ out[i * 2] = digit_lut[oct & 0x0f];
+ out[i * 2 + 1] = digit_lut[(oct & 0xf0) >> 4];
}
- out[i*2] = '\0';
+ out[i * 2] = '\0';
}
static inline int to_semi_oct(char in)
@@ -600,7 +600,7 @@ gboolean sms_encode_address_field(const struct sms_address *in, gboolean sc,
out:
pdu[0] = addr_len;
pdu[1] = (in->number_type << 4) | in->numbering_plan | 0x80;
- memcpy(pdu+2, p, (sc ? addr_len - 1 : (addr_len + 1) / 2));
+ memcpy(pdu + 2, p, (sc ? addr_len - 1 : (addr_len + 1) / 2));
*offset = *offset + 2 + (sc ? addr_len - 1 : (addr_len + 1) / 2);
@@ -768,7 +768,7 @@ static gboolean decode_deliver(const unsigned char *pdu, int len,
if ((len - offset) < expected)
return FALSE;
- memcpy(out->deliver.ud, pdu+offset, expected);
+ memcpy(out->deliver.ud, pdu + offset, expected);
return TRUE;
}
@@ -929,11 +929,11 @@ static gboolean decode_submit_report(const unsigned char *pdu, int len,
if (out->type == SMS_TYPE_SUBMIT_REPORT_ERROR) {
out->submit_err_report.udl = udl;
memcpy(out->submit_err_report.ud,
- pdu+offset, expected);
+ pdu + offset, expected);
} else {
out->submit_ack_report.udl = udl;
memcpy(out->submit_ack_report.ud,
- pdu+offset, expected);
+ pdu + offset, expected);
}
}
@@ -1063,7 +1063,7 @@ static gboolean decode_status_report(const unsigned char *pdu, int len,
if ((len - offset) < expected)
return FALSE;
- memcpy(out->status_report.ud, pdu+offset, expected);
+ memcpy(out->status_report.ud, pdu + offset, expected);
}
return TRUE;
@@ -1214,11 +1214,11 @@ static gboolean decode_deliver_report(const unsigned char *pdu, int len,
if (out->type == SMS_TYPE_DELIVER_REPORT_ERROR) {
out->deliver_err_report.udl = udl;
memcpy(out->deliver_err_report.ud,
- pdu+offset, expected);
+ pdu + offset, expected);
} else {
out->deliver_ack_report.udl = udl;
memcpy(out->deliver_ack_report.ud,
- pdu+offset, expected);
+ pdu + offset, expected);
}
}
@@ -1371,7 +1371,7 @@ static gboolean decode_submit(const unsigned char *pdu, int len,
if (expected > (int) sizeof(out->submit.ud))
return FALSE;
- memcpy(out->submit.ud, pdu+offset, expected);
+ memcpy(out->submit.ud, pdu + offset, expected);
return TRUE;
}
@@ -1450,7 +1450,7 @@ static gboolean decode_command(const unsigned char *pdu, int len,
if ((len - offset) < out->command.cdl)
return FALSE;
- memcpy(out->command.cd, pdu+offset, out->command.cdl);
+ memcpy(out->command.cd, pdu + offset, out->command.cdl);
return TRUE;
}
@@ -1866,7 +1866,7 @@ void sms_address_from_string(struct sms_address *addr, const char *str)
addr->numbering_plan = SMS_NUMBERING_PLAN_ISDN;
if (str[0] == '+') {
addr->number_type = SMS_NUMBER_TYPE_INTERNATIONAL;
- strcpy(addr->address, str+1);
+ strcpy(addr->address, str + 1);
} else {
addr->number_type = SMS_NUMBER_TYPE_UNKNOWN;
strcpy(addr->address, str);
@@ -4139,7 +4139,7 @@ char *cbs_decode_text(GSList *cbs_list, char *iso639_lang)
break;
buf[bufsize] = ud[i];
- buf[bufsize + 1] = ud[i+1];
+ buf[bufsize + 1] = ud[i + 1];
bufsize += 2;
i += 2;
--
1.7.9.5
next reply other threads:[~2012-08-31 15:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-31 15:03 Philippe Nunes [this message]
2012-08-31 15:03 ` [PATCH v4 2/3] smsutil: <CR> is not necessarily a CBS padding character Philippe Nunes
2012-09-17 16:58 ` Denis Kenzior
2012-08-31 15:03 ` [PATCH v4 3/3] unit: Add test to check " Philippe Nunes
2012-09-17 16:58 ` Denis Kenzior
2012-09-17 16:57 ` [PATCH v4 1/3] smsutil: Fix style issues Denis Kenzior
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=1346425438-12220-1-git-send-email-philippe.nunes@linux.intel.com \
--to=philippe.nunes@linux.intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox