FDBPDCAT, // concatenate values
FDBPDADDINT, // add an integer
FDBPDADDDBL, // add a real number
- FDBPDPROC // process by a callback function
+ FDBPDPROC // process by a callback fun
};
typedef struct { // type of structure for a duplication callback
}
TCDODEBUG(fdb->cnt_writerec++);
fdb->rnum++;
- if (fdb->min < 1 || id < fdb->min) fdb->min = id;
- if (fdb->max < 1 || id > fdb->max) fdb->max = id;
+ if (fdb->min < 1 || id < fdb->min) {
+ fdb->min = id;
+ }
+ if (fdb->max < 1 || id > fdb->max) {
+ fdb->max = id;
+ }
}
}
FDBUNLOCKATTR(fdb);
fdb->max = fdb->min;
}
} else {
- if (id == fdb->min) fdb->min = tcfdbnextid(fdb, id);
- if (id == fdb->max) fdb->max = tcfdbprevid(fdb, id);
+ if (id == fdb->min) {
+ fdb->min = tcfdbnextid(fdb, id);
+ }
+ if (id == fdb->max) {
+ fdb->max = tcfdbprevid(fdb, id);
+ }
}
FDBUNLOCKATTR(fdb);
goto finish;
goto finish;
}
fdb->rnum++;
- if (fdb->min < 1 || id < fdb->min) fdb->min = id;
- if (fdb->max < 1 || id > fdb->max) fdb->max = id;
+ if (fdb->min < 1 || id < fdb->min) {
+ fdb->min = id;
+ }
+ if (fdb->max < 1 || id > fdb->max) {
+ fdb->max = id;
+ }
FDBUNLOCKATTR(fdb);
}
finish:
fdb->max = fdb->min;
}
} else {
- if (id == fdb->min) fdb->min = tcfdbnextid(fdb, id);
- if (id == fdb->max) fdb->max = tcfdbprevid(fdb, id);
+ if (id == fdb->min) {
+ fdb->min = tcfdbnextid(fdb, id);
+ }
+ if (id == fdb->max) {
+ fdb->max = tcfdbprevid(fdb, id);
+ }
}
FDBUNLOCKATTR(fdb);
finish:
if (!FDBLOCKSMEM(fdb, false)) {
return NULL;
}
- if (lower < fdb->min) lower = fdb->min;
- if (upper > fdb->max) upper = fdb->max;
+ if (lower < fdb->min) {
+ lower = fdb->min;
+ }
+ if (upper > fdb->max) {
+ upper = fdb->max;
+ }
if (max < 0) max = INT_MAX;
int anum = FDBIDARYUNIT;
uint64_t *ids;
uint64_t limid; /* limit ID number */
#ifndef NDEBUG
- int64_t cnt_writerec; /* tesing counter for record write times */
- int64_t cnt_readrec; /* tesing counter for record read times */
- int64_t cnt_truncfile; /* tesing counter for file truncate times */
+ volatile int64_t cnt_writerec; /* tesing counter for record write times */
+ volatile int64_t cnt_readrec; /* tesing counter for record read times */
+ volatile int64_t cnt_truncfile; /* tesing counter for file truncate times */
#endif
} TCFDB;