summary refs log tree commit diff
path: root/src/libstddjb/uint32_reverse.c
blob: 6a33f23f8eea75a3db355256b056a9ea28638d10 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/* ISC license. */

#include <sys/types.h>
#include <skalibs/uint32.h>

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