File: main.cpp

package info (click to toggle)
cegui-mk2 0.8.7%2Bgit20220615-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 57,816 kB
  • sloc: cpp: 306,263; python: 1,175; ansic: 812; sh: 616; xml: 191; java: 162; makefile: 21
file content (22 lines) | stat: -rw-r--r-- 435 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <unistd.h>

extern "C"
{

void swab(const void* bfrom, void* bto, ssize_t n) __attribute__((visibility("default")));

void swab(const void* bfrom, void* bto, ssize_t n)
{
    const char* from = (const char*)bfrom;
    char* to = (char*)bto;
    n &= ~((ssize_t)1);
    while (n > 1)
    {
        const char b0 = from[--n];
        const char b1 = from[--n];
        to[n] = b0;
        to[n+1] = b1;
    }
}

} // extern "C"