From 7f0913d6000175cdcb772e04854a82588585f7c8 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Mon, 18 Apr 2011 13:16:49 +0200 Subject: [PATCH] Use gpointer instead of guchar in several places. This makes for cleaner and simpler code. --- egg/egg-openssl.c | 8 ++++---- egg/egg-openssl.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/egg/egg-openssl.c b/egg/egg-openssl.c index 001e61e..c95c4ad 100644 --- a/egg/egg-openssl.c +++ b/egg/egg-openssl.c @@ -234,7 +234,7 @@ egg_openssl_headers_new (void) } guint -egg_openssl_pem_parse (const guchar *data, gsize n_data, +egg_openssl_pem_parse (gconstpointer data, gsize n_data, EggOpensslPemCallback callback, gpointer user_data) { const gchar *beg, *end; @@ -258,7 +258,7 @@ egg_openssl_pem_parse (const guchar *data, gsize n_data, g_assert (type); /* This returns the character position before the PEM END header */ - end = pem_find_end ((const gchar*)beg, n_data - ((const guchar*)beg - data), type); + end = pem_find_end ((const gchar*)beg, n_data - ((const gchar*)beg - (const gchar *)data), type); if (!end) break; @@ -274,8 +274,8 @@ egg_openssl_pem_parse (const guchar *data, gsize n_data, /* Try for another block */ end += PEM_SUFF_L; - n_data -= (const guchar*)end - data; - data = (const guchar*)end; + n_data -= (const gchar*)end - (const gchar*)data; + data = end; } if (headers) diff --git a/egg/egg-openssl.h b/egg/egg-openssl.h index 301172a..1539c4d 100644 --- a/egg/egg-openssl.h +++ b/egg/egg-openssl.h @@ -31,7 +31,7 @@ typedef void (*EggOpensslPemCallback) (GQuark type, const guchar *data, gsize n_ GHashTable* egg_openssl_headers_new (void); -guint egg_openssl_pem_parse (const guchar *data, gsize n_data, +guint egg_openssl_pem_parse (gconstpointer data, gsize n_data, EggOpensslPemCallback callback, gpointer user_data); -- 2.7.4