From 759ed1f050872ba89d30b4d7490066d7b378ad2e Mon Sep 17 00:00:00 2001 From: Francois Perrad Date: Sun, 11 Oct 2015 12:11:00 +0200 Subject: [PATCH] union initialization is not supported by ISO C --- bn_mp_export.c | 3 ++- bn_mp_import.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/bn_mp_export.c b/bn_mp_export.c index 1a82e4a..3712fc7 100644 --- a/bn_mp_export.c +++ b/bn_mp_export.c @@ -34,7 +34,8 @@ int mp_export(void* rop, size_t* countp, int order, size_t size, union { unsigned int i; char c[4]; - } lint = {0x01020304}; + } lint; + lint.i = 0x01020304; endian = (lint.c[0] == 4 ? -1 : 1); } diff --git a/bn_mp_import.c b/bn_mp_import.c index b5d4ed9..c106e02 100644 --- a/bn_mp_import.c +++ b/bn_mp_import.c @@ -30,7 +30,8 @@ int mp_import(mp_int* rop, size_t count, int order, size_t size, union { unsigned int i; char c[4]; - } lint = {0x01020304}; + } lint; + lint.i = 0x01020304; endian = (lint.c[0] == 4 ? -1 : 1); }