]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/journal/fsprg.c
build-sys: use #if Y instead of #ifdef Y everywhere
[thirdparty/systemd.git] / src / journal / fsprg.c
index 12ae7449f9d9fca34f10d8ad1f677dbd8b59030c..e7c22880be65411a738c904f0e12586bb96f6767 100644 (file)
@@ -1,5 +1,3 @@
-/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-
 /*
  * fsprg v0.1  -  (seekable) forward-secure pseudorandom generator
  * Copyright (C) 2012 B. Poettering
@@ -42,6 +40,9 @@
 #define RND_GEN_Q 0x02
 #define RND_GEN_X 0x03
 
+#pragma GCC diagnostic ignored "-Wpointer-arith"
+/* TODO: remove void* arithmetic and this work-around */
+
 /******************************************************************************/
 
 static void mpi_export(void *buf, size_t buflen, const gcry_mpi_t x) {
@@ -60,7 +61,7 @@ static gcry_mpi_t mpi_import(const void *buf, size_t buflen) {
         gcry_mpi_t h;
         unsigned len;
 
-        gcry_mpi_scan(&h, GCRYMPI_FMT_USG, buf, buflen, NULL);
+        assert_se(gcry_mpi_scan(&h, GCRYMPI_FMT_USG, buf, buflen, NULL) == 0);
         len = (gcry_mpi_get_nbits(h) + 7) / 8;
         assert(len <= buflen);
         assert(gcry_mpi_cmp_ui(h, 0) >= 0);