[evolution-exchange] Bug #573125 - Use new bdata_extract_ functions instead of own macros
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-exchange] Bug #573125 - Use new bdata_extract_ functions instead of own macros
- Date: Thu, 9 Dec 2010 12:59:16 +0000 (UTC)
commit 7566563c2a05967ae8362a754f06e9fc2549784b
Author: Milan Crha <mcrha redhat com>
Date: Thu Dec 9 13:57:50 2010 +0100
Bug #573125 - Use new bdata_extract_ functions instead of own macros
camel/camel-exchange-summary.c | 24 +++++-------------------
1 files changed, 5 insertions(+), 19 deletions(-)
---
diff --git a/camel/camel-exchange-summary.c b/camel/camel-exchange-summary.c
index c68b38e..cc79bb8 100644
--- a/camel/camel-exchange-summary.c
+++ b/camel/camel-exchange-summary.c
@@ -34,11 +34,6 @@
#define CAMEL_EXCHANGE_SUMMARY_VERSION (2)
-#define EXTRACT_FIRST_DIGIT(val) val=strtoul (part, &part, 10);
-#define EXTRACT_DIGIT(val) part++; val=strtoul (part, &part, 10);
-#define EXTRACT_FIRST_STRING(val) len=strtoul (part, &part, 10); if (*part) part++; val=g_strndup (part, len); part+=len;
-#define EXTRACT_STRING(val) if (*part) part++; len=strtoul (part, &part, 10); if (*part) part++; val=g_strndup (part, len); part+=len;
-
#define d(x)
G_DEFINE_TYPE (CamelExchangeSummary, camel_exchange_summary, CAMEL_TYPE_FOLDER_SUMMARY)
@@ -276,17 +271,9 @@ exchange_summary_summary_header_from_db (CamelFolderSummary *s,
part = mir->bdata;
- if (part) {
- EXTRACT_FIRST_DIGIT (exchange->version)
- }
-
- if (part) {
- EXTRACT_DIGIT (exchange->readonly)
- }
-
- if (part) {
- EXTRACT_DIGIT (exchange->high_article_num)
- }
+ exchange->version = bdata_extract_digit (&part);
+ exchange->readonly = bdata_extract_digit (&part);
+ exchange->high_article_num = bdata_extract_digit (&part);
return 0;
}
@@ -323,10 +310,9 @@ exchange_summary_message_info_from_db (CamelFolderSummary *s,
info = folder_summary_class->message_info_from_db (s, mir);
if (info) {
gchar *part = mir->bdata;
- gint len;
einfo = (CamelExchangeMessageInfo *)info;
- EXTRACT_FIRST_STRING (einfo->thread_index)
- EXTRACT_FIRST_STRING (einfo->href)
+ einfo->thread_index = bdata_extract_string (&part);
+ einfo->href = bdata_extract_string (&part);
}
return info;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]