From ea1673808584f3c40cc76cc2ea570676309ba5bc Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 12 Sep 2013 14:09:29 +0200 Subject: daemon: Use 'int' instead of the internal 'gcry_md_algo_t' type. Fixes compilation with the forthcoming libgcrypt 1.6.x. Reported by Matthias Wachs and NIIBE Yutaka . * nix/libutil/gcrypt-hash.cc (guix_hash_init, guix_hash_final): Use 'int' as the type of the 'algo' parameter. * nix/libutil/gcrypt-hash.hh: Update declarations accordingly. --- nix/libutil/gcrypt-hash.cc | 6 +++--- nix/libutil/gcrypt-hash.hh | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/nix/libutil/gcrypt-hash.cc b/nix/libutil/gcrypt-hash.cc index b364a5747a..553f633b93 100644 --- a/nix/libutil/gcrypt-hash.cc +++ b/nix/libutil/gcrypt-hash.cc @@ -1,5 +1,5 @@ /* GNU Guix --- Functional package management for GNU - Copyright (C) 2012 Ludovic Courtès + Copyright (C) 2012, 2013 Ludovic Courtès This file is part of GNU Guix. @@ -24,7 +24,7 @@ extern "C" { void -guix_hash_init (struct guix_hash_context *ctx, gcry_md_algo_t algo) +guix_hash_init (struct guix_hash_context *ctx, int algo) { gcry_error_t err; @@ -40,7 +40,7 @@ guix_hash_update (struct guix_hash_context *ctx, const void *buffer, size_t len) void guix_hash_final (void *resbuf, struct guix_hash_context *ctx, - gcry_md_algo_t algo) + int algo) { memcpy (resbuf, gcry_md_read (ctx->md_handle, algo), gcry_md_get_algo_dlen (algo)); diff --git a/nix/libutil/gcrypt-hash.hh b/nix/libutil/gcrypt-hash.hh index d2d40d5fb2..d93a6eb881 100644 --- a/nix/libutil/gcrypt-hash.hh +++ b/nix/libutil/gcrypt-hash.hh @@ -1,5 +1,5 @@ /* GNU Guix --- Functional package management for GNU - Copyright (C) 2012 Ludovic Courtès + Copyright (C) 2012, 2013 Ludovic Courtès This file is part of GNU Guix. @@ -30,10 +30,10 @@ struct guix_hash_context gcry_md_hd_t md_handle; }; -extern void guix_hash_init (struct guix_hash_context *ctx, gcry_md_algo_t algo); +extern void guix_hash_init (struct guix_hash_context *ctx, int algo); extern void guix_hash_update (struct guix_hash_context *ctx, const void *buffer, size_t len); extern void guix_hash_final (void *resbuf, struct guix_hash_context *ctx, - gcry_md_algo_t algo); + int algo); } -- cgit v1.2.3