Belle II Software  release-05-01-25
util.cc
1 /* util.c */
2 
3 #include <stdio.h>
4 
5 
6 void
7 dump_binary(FILE* fp, const void* ptr, const size_t size)
8 {
9  int i;
10  const unsigned int* p = (const unsigned int*)ptr;
11  const size_t _size = size / sizeof(unsigned int);
12 
13 
14  for (i = 0; i < _size; i++) {
15  fprintf(fp, "%08x ", p[i]);
16  if (i % 8 == 7) fprintf(fp, "\n");
17  }
18  if (_size % 8 != 0) fprintf(fp, "\n");
19 }
20