File: uniondef.c

package info (click to toggle)
libffi-c-perl 0.15-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 484 kB
  • sloc: perl: 1,517; ansic: 57; sh: 19; makefile: 2
file content (14 lines) | stat: -rw-r--r-- 190 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <stdint.h>
#include <stdio.h>

typedef union {
  uint8_t  u8;
  uint16_t u16;
  uint32_t u32;
} anyint_t;

void
print_anyint_as_u32(anyint_t *any)
{
  printf("0x%x\n", any->u32);
}