a4100d62e1f3a6864f70e651b6b41517c662f496 markd Wed Dec 9 21:34:41 2020 -0800 improved doc on reserved files diff --git src/jkOwnLib/genoFind.c src/jkOwnLib/genoFind.c index d727250..56b50b3 100644 --- src/jkOwnLib/genoFind.c +++ src/jkOwnLib/genoFind.c @@ -114,34 +114,33 @@ int stepSize; int tileSpaceSize; int tileMask; int sourceCount; bool isPep; bool allowOneMismatch; bool noSimpRepMask; int segSize; int totalSeqSize; off_t sourcesOff; // offset of sequences sources off_t listSizesOff; // offset of listSizes off_t listsOff; // offset of lists or endLists off_t endListsOff; - // Reserved area. This is really padding, as all structures are accessed via - // offsets, so fields can be added without decreasing padding as long as the - // reserved is not consumed. - bits64 reserved[32]; // vesion 1.0: 32 + // Reserved area. These are bytes of zero, so that need fields can be added + // that default to zero without needed check the version in code. + bits64 reserved[32]; // vesion 1.0: 32 words }; static void genoFindInitHdr(struct genoFind *gf, struct genoFindFileHdr *hdr) /* fill in the file header struct from in-memory struct */ { zeroBytes(hdr, sizeof(struct genoFindFileHdr)); hdr->maxPat = gf->maxPat; hdr->minMatch = gf->minMatch; hdr->maxGap = gf->maxGap; hdr->tileSize = gf->tileSize; hdr->stepSize = gf->stepSize; hdr->tileSpaceSize = gf->tileSpaceSize; hdr->tileMask = gf->tileMask; hdr->sourceCount = gf->sourceCount; @@ -370,34 +369,33 @@ stepSize, noSimpRepMask); return gfIdx; } struct genoFindIndexFileHdr /* header for genoFind section in file */ { char magic[32]; char version[32]; bits32 indexAddressSize; // 32 or 64 bit, compile time. boolean isTrans; // offsets to data, only one is filed in based on being translated or note off_t untransOff; off_t transOff[2][3]; - // Reserved area. This is really padding, as all structures are accessed via - // offsets, so fields can be added without decreasing padding as long as the - // reserved is not consumed. - bits64 reserved[32]; // vesion 1.0: 32 + // Reserved area. These are bytes of zero, so that need fields can be added + // that default to zero without needed check the version in code. + bits64 reserved[32]; // vesion 1.0: 32 words }; static void genoFindIndexInitHeader(struct genoFindIndex *gfIdx, struct genoFindIndexFileHdr* hdr) /* fill in the file header struct from in-memory struct */ { zeroBytes(hdr, sizeof(struct genoFindIndexFileHdr)); safecpy(hdr->magic, sizeof(hdr->magic), indexFileMagic); safecpy(hdr->version, sizeof(hdr->version), indexFileVerison); hdr->indexAddressSize = 32; hdr->isTrans = gfIdx->isTrans; } static void genoFindIndexReadHeader(void* memMapped, struct genoFindIndexFileHdr* hdr, struct genoFindIndex* gfIdx)