MCPcopy Create free account
hub / github.com/OpenNFS/OpenNFS / sanity_check

Function sanity_check

tools/fshtool.c:76–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74}
75
76void sanity_check() /* make sure we haven't used a braindead compiler */
77{
78 int x;
79
80 if (sizeof(int)!=4) { printf("Problem: int is not 32-bit\n"); abandon_ship(); }
81 if (sizeof(short)!=2) { printf("Problem: short is not 16-bit\n"); abandon_ship(); }
82 if ((sizeof(struct BMPHEAD)!=52)||(sizeof(struct FSH_HDR)!=16)||
83 (sizeof(struct BMPDIR)!=8)||(sizeof(struct ENTRYHDR)!=16))
84 { printf("Problem: structs are not correctly packed\n"); abandon_ship(); }
85 x=0;
86 *((char *)(&x))=1;
87 if (x!=1) { printf("Problem: incorrect endianness on this architecture\n"); abandon_ship(); }
88}
89
90void mmemcpy(char *dest,char *src,int len) /* LZ-compatible memcopy */
91{

Callers 1

fsh_mainFunction · 0.85

Calls 1

abandon_shipFunction · 0.85

Tested by

no test coverage detected