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 <wachs@net.in.tum.de>
and NIIBE Yutaka <gniibe@fsij.org>.

* 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.
This commit is contained in:
Ludovic Courtès 2013-09-12 14:09:29 +02:00
parent 8eaa8a3bf0
commit ea16738085
2 changed files with 6 additions and 6 deletions

View File

@ -1,5 +1,5 @@
/* GNU Guix --- Functional package management for GNU /* GNU Guix --- Functional package management for GNU
Copyright (C) 2012 Ludovic Courtès <ludo@gnu.org> Copyright (C) 2012, 2013 Ludovic Courtès <ludo@gnu.org>
This file is part of GNU Guix. This file is part of GNU Guix.
@ -24,7 +24,7 @@
extern "C" { extern "C" {
void 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; gcry_error_t err;
@ -40,7 +40,7 @@ guix_hash_update (struct guix_hash_context *ctx, const void *buffer, size_t len)
void void
guix_hash_final (void *resbuf, struct guix_hash_context *ctx, 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), memcpy (resbuf, gcry_md_read (ctx->md_handle, algo),
gcry_md_get_algo_dlen (algo)); gcry_md_get_algo_dlen (algo));

View File

@ -1,5 +1,5 @@
/* GNU Guix --- Functional package management for GNU /* GNU Guix --- Functional package management for GNU
Copyright (C) 2012 Ludovic Courtès <ludo@gnu.org> Copyright (C) 2012, 2013 Ludovic Courtès <ludo@gnu.org>
This file is part of GNU Guix. This file is part of GNU Guix.
@ -30,10 +30,10 @@ struct guix_hash_context
gcry_md_hd_t md_handle; 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, extern void guix_hash_update (struct guix_hash_context *ctx, const void *buffer,
size_t len); size_t len);
extern void guix_hash_final (void *resbuf, struct guix_hash_context *ctx, extern void guix_hash_final (void *resbuf, struct guix_hash_context *ctx,
gcry_md_algo_t algo); int algo);
} }