Fixed file cluster closing and cprintf warning in moenchZmqProcess

This commit is contained in:
2020-08-18 10:56:21 +02:00
parent 1d8f9a5aed
commit afabc9a503
2 changed files with 10 additions and 7 deletions

View File

@@ -602,12 +602,14 @@ int *getClusters(char *data, int *ph=NULL) {
*/
static void writeClusters(FILE *f, single_photon_hit *cl, int nph, int fn=0){
if (nph>0) {
if (f) {
if (nph>0) {
#ifndef OLDFORMAT
if (fwrite((void*)&fn, 1, sizeof(int), f))
if (fwrite((void*)&nph, 1, sizeof(int), f))
if (fwrite((void*)&fn, 1, sizeof(int), f))
if (fwrite((void*)&nph, 1, sizeof(int), f))
#endif
for (int i=0; i<nph; i++) (cl+i)->write(f);
for (int i=0; i<nph; i++) (cl+i)->write(f);
}
}
};