/pidgin/main: 07029c63704c: Fix novell ppc64 warning

Tomasz Wasilczyk twasilczyk at pidgin.im
Mon Feb 10 10:10:59 EST 2014


Changeset: 07029c63704c8da3aed1c2ec59641266151e3825
Author:	 Tomasz Wasilczyk <twasilczyk at pidgin.im>
Date:	 2014-02-10 16:10 +0100
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/07029c63704c

Description:

Fix novell ppc64 warning

diffstat:

 libpurple/protocols/novell/nmrtf.c |  21 +++++++++++----------
 1 files changed, 11 insertions(+), 10 deletions(-)

diffs (52 lines):

diff --git a/libpurple/protocols/novell/nmrtf.c b/libpurple/protocols/novell/nmrtf.c
--- a/libpurple/protocols/novell/nmrtf.c
+++ b/libpurple/protocols/novell/nmrtf.c
@@ -132,7 +132,8 @@ struct _NMRtfContext
 	int depth;				/* how many groups deep are we */
 	gboolean skip_unknown;	/* if true, skip any unknown destinations (this is set after encountering '\*') */
 	char *input;			/* input string */
-	char nextch;			/* next char in input */
+	guchar nextch;			/* next char in input */
+	gboolean nextch_available;	/* nextch value is set */
 	GString *ansi;   		/* Temporary ansi text, will be convert/flushed to the output string */
 	GString *output; 		/* The plain text UTF8 string */
 };
@@ -217,7 +218,7 @@ NMRtfContext *
 nm_rtf_init()
 {
 	NMRtfContext *ctx = g_new0(NMRtfContext, 1);
-	ctx->nextch = -1;
+	ctx->nextch_available = FALSE;
 	ctx->ansi = g_string_new("");
 	ctx->output = g_string_new("");
 	return ctx;
@@ -802,14 +803,13 @@ rtf_dispatch_special(NMRtfContext *ctx, 
 static int
 rtf_get_char(NMRtfContext *ctx, guchar *ch)
 {
-    if (ctx->nextch >= 0) {
-        *ch = ctx->nextch;
-        ctx->nextch = -1;
-    }
-    else {
+	if (ctx->nextch_available) {
+		*ch = ctx->nextch;
+		ctx->nextch_available = FALSE;
+	} else {
 		*ch = *(ctx->input);
 		ctx->input++;
-    }
+	}
 
 	if (*ch)
 		return NMRTF_OK;
@@ -823,6 +823,7 @@ rtf_get_char(NMRtfContext *ctx, guchar *
 static int
 rtf_unget_char(NMRtfContext *ctx, guchar ch)
 {
-    ctx->nextch = ch;
-    return NMRTF_OK;
+	ctx->nextch = ch;
+	ctx->nextch_available = TRUE;
+	return NMRTF_OK;
 }



More information about the Commits mailing list