summaryrefslogtreecommitdiff
path: root/src/libstddjb/uint64_reverse.c
blob: 5a616f5a5b58c39b1de14d3077e596fb035d8a32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* ISC license. */

#include <skalibs/uint64.h>

void uint64_reverse (char *s, size_t n)
{
  while (n--)
  {
    char c = s[0] ; s[0] = s[7] ; s[7] = c ;
    c = s[1] ; s[1] = s[6] ; s[6] = c ;
    c = s[2] ; s[2] = s[5] ; s[5] = c ;
    c = s[3] ; s[3] = s[4] ; s[4] = c ;
    s += 8 ;
  }
}