This commit is contained in:
AlanRen 2022-09-18 03:45:32 +08:00
parent 0e51a57875
commit defbfcb6d8
2 changed files with 27 additions and 1 deletions

6
.gitignore vendored Normal file
View File

@ -0,0 +1,6 @@
.vscode/
build/
release/

View File

@ -1,11 +1,31 @@
#include<stdlib.h>
#include<stdio.h>
#include "common.h"
typedef uint64_t u64 ;
static u64 be64_to_cpu(u64 x)
{
u64 r;
int i, len;
char *p, *q;
len = sizeof(x);
q = (char *)&x + len - 1;
p = (char *)&r;
for (i = 0; i < len; i++)
{
*p = *q;
p++;
q--;
}
return r;
}
int main(){
u64 rt,data=0xFFF;
rt=be64_to_cpu(data);
return 0;
}