[gmime] code cleanup
- From: Jeffrey Stedfast <fejj src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gmime] code cleanup
- Date: Tue, 14 Mar 2017 00:27:15 +0000 (UTC)
commit e4c1719f899bf441e4ede4fc051f0cc1c087f92d
Author: Jeffrey Stedfast <jestedfa microsoft com>
Date: Mon Mar 13 11:25:03 2017 -0400
code cleanup
gmime/gmime-filter-html.c | 24 ++++++++++++------------
gmime/gmime-filter-html.h | 7 ++++---
2 files changed, 16 insertions(+), 15 deletions(-)
---
diff --git a/gmime/gmime-filter-html.c b/gmime/gmime-filter-html.c
index d5b7ea8..309afab 100644
--- a/gmime/gmime-filter-html.c
+++ b/gmime/gmime-filter-html.c
@@ -141,7 +141,7 @@ g_mime_filter_html_init (GMimeFilterHTML *filter, GMimeFilterHTMLClass *klass)
filter->colour = 0;
filter->column = 0;
filter->pre_open = FALSE;
- filter->prev_cit_depth = 0;
+ filter->citation_depth = 0;
}
static void
@@ -389,14 +389,14 @@ html_convert (GMimeFilter *filter, char *in, size_t inlen, size_t prespace,
depth = citation_depth (start, inend);
if (html->flags & GMIME_FILTER_HTML_BLOCKQUOTE_CITATION) {
- if (html->prev_cit_depth < depth) {
- while (html->prev_cit_depth < depth) {
+ if (html->citation_depth < depth) {
+ while (html->citation_depth < depth) {
char tag[33];
int ldepth;
- html->prev_cit_depth++;
+ html->citation_depth++;
- ldepth = MIN (html->prev_cit_depth, 999);
+ ldepth = MIN (html->citation_depth, 999);
g_snprintf (tag, 31, "<blockquote class=\"level_%03d\">", ldepth);
@@ -405,12 +405,12 @@ html_convert (GMimeFilter *filter, char *in, size_t inlen, size_t prespace,
}
start = citation_cut (start, inptr);
- } else if (html->prev_cit_depth > depth) {
+ } else if (html->citation_depth > depth) {
/* close quotes */
- while (html->prev_cit_depth > depth) {
+ while (html->citation_depth > depth) {
outptr = check_size (filter, outptr, &outend, 14);
outptr = g_stpcpy (outptr, "</blockquote>");
- html->prev_cit_depth--;
+ html->citation_depth--;
}
start = citation_cut (start, inptr);
@@ -509,12 +509,12 @@ html_convert (GMimeFilter *filter, char *in, size_t inlen, size_t prespace,
outptr = g_stpcpy (outptr, "</pre>");
}
- if ((html->flags & GMIME_FILTER_HTML_BLOCKQUOTE_CITATION) && html->prev_cit_depth > 0) {
+ if ((html->flags & GMIME_FILTER_HTML_BLOCKQUOTE_CITATION) && html->citation_depth > 0) {
/* close open blockquotes */
- while (html->prev_cit_depth > 0) {
+ while (html->citation_depth > 0) {
outptr = check_size (filter, outptr, &outend, 14);
outptr = g_stpcpy (outptr, "</blockquote>");
- html->prev_cit_depth--;
+ html->citation_depth--;
}
}
} else if (start < inend) {
@@ -548,7 +548,7 @@ filter_reset (GMimeFilter *filter)
html->column = 0;
html->pre_open = FALSE;
- html->prev_cit_depth = 0;
+ html->citation_depth = 0;
}
diff --git a/gmime/gmime-filter-html.h b/gmime/gmime-filter-html.h
index 2adea8b..0a3350f 100644
--- a/gmime/gmime-filter-html.h
+++ b/gmime/gmime-filter-html.h
@@ -41,7 +41,7 @@ typedef struct _GMimeFilterHTMLClass GMimeFilterHTMLClass;
/**
* GMIME_FILTER_HTML_PRE:
*
- * Wrap stream in <pre> tags.
+ * Wrap stream in <pre> and </pre> tags.
**/
#define GMIME_FILTER_HTML_PRE (1 << 0)
@@ -118,7 +118,7 @@ typedef struct _GMimeFilterHTMLClass GMimeFilterHTMLClass;
* @colour: cite colour
* @column: current column
* @pre_open: currently inside of a 'pre' tag.
- * @prev_cit_depth: current citation depth level.
+ * @citation_depth: current citation depth level.
*
* A filter for converting text/plain into text/html.
**/
@@ -132,7 +132,8 @@ struct _GMimeFilterHTML {
guint32 column : 31;
guint32 pre_open : 1;
- guint32 prev_cit_depth : 31;
+
+ guint32 citation_depth;
};
struct _GMimeFilterHTMLClass {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]