[gnome-keyring/trust-store: 23/26] [gcr] Use void pointers instead of unsigned char for data.
- From: Stefan Walter <stefw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-keyring/trust-store: 23/26] [gcr] Use void pointers instead of unsigned char for data.
- Date: Mon, 6 Dec 2010 22:44:15 +0000 (UTC)
commit 1e893d514b99cf5205436c3b4ce04e6df3639ea0
Author: Stef Walter <stefw collabora co uk>
Date: Mon Dec 6 21:45:04 2010 +0000
[gcr] Use void pointers instead of unsigned char for data.
Use void pointers to make like simpler and clearer.
gcr/gcr-certificate-renderer.c | 2 +-
gcr/gcr-certificate.c | 16 ++++++++--------
gcr/gcr-certificate.h | 4 ++--
gcr/gcr-simple-certificate.c | 2 +-
4 files changed, 12 insertions(+), 12 deletions(-)
---
diff --git a/gcr/gcr-certificate-renderer.c b/gcr/gcr-certificate-renderer.c
index a0432ae..073d944 100644
--- a/gcr/gcr-certificate-renderer.c
+++ b/gcr/gcr-certificate-renderer.c
@@ -294,7 +294,7 @@ static void
gcr_certificate_renderer_real_render (GcrRenderer *renderer, GcrViewer *viewer)
{
GcrCertificateRenderer *self;
- const guchar *data, *value;
+ gconstpointer data, value;
gsize n_data, n_value, n_raw;
GcrDisplayView *view;
on_parsed_dn_args args;
diff --git a/gcr/gcr-certificate.c b/gcr/gcr-certificate.c
index 975cf28..06a7b46 100644
--- a/gcr/gcr-certificate.c
+++ b/gcr/gcr-certificate.c
@@ -55,7 +55,7 @@
*/
typedef struct _GcrCertificateInfo {
- const guchar *der;
+ gconstpointer der;
gsize n_der;
GNode *asn1;
guint key_size;
@@ -90,11 +90,11 @@ certificate_info_load (GcrCertificate *cert)
{
GcrCertificateInfo *info;
GNode *asn1;
- const guchar *der;
+ gconstpointer der;
gsize n_der;
g_assert (GCR_IS_CERTIFICATE (cert));
-
+
der = gcr_certificate_get_der_data (cert, &n_der);
g_return_val_if_fail (der, NULL);
@@ -121,7 +121,7 @@ certificate_info_load (GcrCertificate *cert)
}
static guint
-calculate_rsa_key_size (const guchar *data, gsize n_data)
+calculate_rsa_key_size (gconstpointer data, gsize n_data)
{
GNode *asn;
gsize n_content;
@@ -139,7 +139,7 @@ calculate_rsa_key_size (const guchar *data, gsize n_data)
}
static guint
-calculate_dsa_params_size (const guchar *data, gsize n_data)
+calculate_dsa_params_size (gconstpointer data, gsize n_data)
{
GNode *asn;
gsize n_content;
@@ -160,7 +160,7 @@ static guint
calculate_key_size (GcrCertificateInfo *info)
{
GNode *asn;
- const guchar *data, *params;
+ gconstpointer data, params;
gsize n_data, n_params;
guint key_size = 0, n_bits;
guchar *key = NULL;
@@ -203,7 +203,7 @@ static GChecksum*
digest_certificate (GcrCertificate *self, GChecksumType type)
{
GChecksum *digest;
- const guchar *der;
+ gconstpointer der;
gsize n_der;
g_assert (GCR_IS_CERTIFICATE (self));
@@ -275,7 +275,7 @@ gcr_certificate_get_type (void)
*
* Returns: raw DER data of the X509 certificate.
**/
-const guchar*
+gconstpointer
gcr_certificate_get_der_data (GcrCertificate *self, gsize *n_data)
{
g_return_val_if_fail (GCR_IS_CERTIFICATE (self), NULL);
diff --git a/gcr/gcr-certificate.h b/gcr/gcr-certificate.h
index 5de9eee..21f151d 100644
--- a/gcr/gcr-certificate.h
+++ b/gcr/gcr-certificate.h
@@ -39,7 +39,7 @@ typedef struct _GcrCertificateIface GcrCertificateIface;
struct _GcrCertificateIface {
GTypeInterface parent;
- const guchar* (*get_der_data) (GcrCertificate *self, gsize *n_data);
+ gconstpointer (*get_der_data) (GcrCertificate *self, gsize *n_data);
gpointer dummy1;
gpointer dummy2;
@@ -52,7 +52,7 @@ struct _GcrCertificateIface {
GType gcr_certificate_get_type (void);
-const guchar* gcr_certificate_get_der_data (GcrCertificate *self,
+gconstpointer gcr_certificate_get_der_data (GcrCertificate *self,
gsize *n_data);
gchar* gcr_certificate_get_issuer_cn (GcrCertificate *self);
diff --git a/gcr/gcr-simple-certificate.c b/gcr/gcr-simple-certificate.c
index c9521c0..fe1bc57 100644
--- a/gcr/gcr-simple-certificate.c
+++ b/gcr/gcr-simple-certificate.c
@@ -69,7 +69,7 @@ gcr_simple_certificate_class_init (GcrSimpleCertificateClass *klass)
_gcr_initialize ();
}
-static const guchar*
+static gconstpointer
gcr_simple_certificate_real_get_der_data (GcrCertificate *base, gsize *n_data)
{
GcrSimpleCertificate *self = GCR_SIMPLE_CERTIFICATE (base);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]