Skip to content

Instantly share code, notes, and snippets.

@guidovranken
Created December 28, 2019 01:33
Show Gist options
  • Select an option

  • Save guidovranken/88da11e0f96e0d8bae52b9ab96afc9c2 to your computer and use it in GitHub Desktop.

Select an option

Save guidovranken/88da11e0f96e0d8bae52b9ab96afc9c2 to your computer and use it in GitHub Desktop.
#include <string.h>
#include <stdio.h>
static void
xcp(unsigned long *dst, const unsigned long *src, int top)
{
for (int i = 0; i < top; i++) {
dst[i] = src[i];
printf("%zu\n", src[i]);
}
}
#define X 6
unsigned int x(int top)
{
unsigned int* bp;
unsigned long a_d[12];
union {
unsigned long bn[X];
unsigned int ui[X];
} buf;
memset(a_d, 0, sizeof(a_d));
xcp(buf.bn, a_d + X, top - X);
bp = buf.ui;
return *bp;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment