Commit 236b237d authored by Norbert Lange's avatar Norbert Lange Committed by Jan Kiszka
Browse files

fix build with clang



clang will never support 'variable length array in structure',
and there does not seem to be a reason for this weird construct.
Signed-off-by: default avatarNorbert Lange <norbert.lange@andritz.com>
Signed-off-by: Jan Kiszka's avatarJan Kiszka <jan.kiszka@siemens.com>
parent b0edf29b
......@@ -80,9 +80,7 @@ static inline void swap(void *left, void *right, const size_t size)
static void random_shuffle(void *vbase, size_t nmemb, const size_t size)
{
struct {
char x[size];
} __attribute__((packed)) *base = vbase;
char *base = (char *)vbase;
unsigned int j, k;
double u;
......@@ -92,7 +90,7 @@ static void random_shuffle(void *vbase, size_t nmemb, const size_t size)
k = (unsigned int)(j * u) + 1;
if (j == k)
continue;
swap(&base[j - 1], &base[k - 1], size);
swap(base + (j - 1) * size, base + (k - 1) * size, size);
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment