OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 872 to Rev 873
    Reverse comparison

Rev 872 → Rev 873

/trunk/orpmon/gencrc.c
48,19 → 48,16
size = fread (buf, 1, MAX_SIZE, fi);
fclose (fi);
if (*((unsigned long *)&buf[0]) != SWAP32(0xcccccccc) || *((unsigned long *)&buf[4]) != SWAP32(0xdddddddd)) {
fprintf (stderr, "File does not have 0xcccccccc 0xdddddddd at start\n");
return 2;
}
crc = crc32 (0, buf, size);
tsize = fread (buf, 1, MAX_SIZE, fo);
 
crc = crc32 (0, buf + 8, size -= 8);
tsize = fread (buf, 1, MAX_SIZE, fo);
for (i = 0; i < tsize - 8; i++)
for (i = 0; i < tsize; i++)
if (*((unsigned long *)&buf[i]) == SWAP32(0xcccccccc) && *((unsigned long *)&buf[i + 4]) == SWAP32(0xdddddddd)) {
*(unsigned long *)&buf[i] = SWAP32(crc);
*(unsigned long *)&buf[i + 4] = SWAP32(size);
break;
}
 
if (i >= tsize - 8) return 2;
fseek (fo, 0l, SEEK_SET);
fwrite (buf, 1, tsize, fo);

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.