Skip to content

Commit

Permalink
refactor: fix compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jorainer committed Jan 16, 2024
1 parent 9c41f81 commit 538f651
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/fastMatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ SEXP fastMatch(SEXP x, SEXP y, SEXP xidx, SEXP yidx, SEXP xolength, SEXP tol) {

struct idxStruct * pidxS = (struct idxStruct *) calloc(nx, sizeof(struct idxStruct));
if (pidxS == NULL)
error("fastMatch/calloc: memory could not be allocated ! (%llu bytes)\n", nx * sizeof(struct idxStruct) );
error("fastMatch/calloc: memory could not be allocated ! (%lu bytes)\n", nx * sizeof(struct idxStruct) );
for (xi=0;xi < nx;xi++)
pidxS[xi].from = ny+1;

Expand Down
10 changes: 5 additions & 5 deletions src/mzROI.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ struct mzROIStruct * checkmzROIBufSize(struct mzROIStruct *mzROI, const unsigned

mzROI = (struct mzROIStruct *) realloc(mzROI, newLength * sizeof(struct mzROIStruct));
if (mzROI == NULL)
error("findmzROI/realloc: buffer memory could not be allocated ! (%llu bytes)\n", newLength * sizeof(struct mzROIStruct) );
error("findmzROI/realloc: buffer memory could not be allocated ! (%lu bytes)\n", newLength * sizeof(struct mzROIStruct) );

mzLength->mzROITotal = newLength;
}
Expand All @@ -99,7 +99,7 @@ struct mzROIStruct * checkmzvalBufSize(struct mzROIStruct *mzval, const unsigned

mzval = (struct mzROIStruct *) realloc(mzval, newLength * sizeof(struct mzROIStruct));
if (mzval == NULL)
error("findmzROI/realloc: buffer memory could not be allocated ! (%llu bytes)\n", newLength * sizeof(struct mzROIStruct));
error("findmzROI/realloc: buffer memory could not be allocated ! (%lu bytes)\n", newLength * sizeof(struct mzROIStruct));

mzLength->mzvalTotal = newLength;
}
Expand Down Expand Up @@ -328,7 +328,7 @@ int i,p,del=0;
p=0;
struct mzROIStruct * tmp = (struct mzROIStruct *) calloc(mzLength->mzval - del, sizeof(struct mzROIStruct));
if (tmp == NULL)
error("findmzROI/cleanup: buffer memory could not be allocated ! (%llu bytes)\n", (mzLength->mzval - del) * sizeof(struct mzROIStruct));
error("findmzROI/cleanup: buffer memory could not be allocated ! (%lu bytes)\n", (mzLength->mzval - del) * sizeof(struct mzROIStruct));
for (i=0; i < mzLength->mzval; i++) {
if (mzval[i].deleteMe == FALSE) {
tmp[p].mz = mzval[i].mz;
Expand Down Expand Up @@ -626,11 +626,11 @@ SEXP findmzROI(SEXP mz, SEXP intensity, SEXP scanindex, SEXP mzrange,

struct mzROIStruct * mzROI = (struct mzROIStruct *) calloc(ROI_INIT_LENGTH, sizeof(struct mzROIStruct));
if (mzROI == NULL)
error("findmzROI/calloc: buffer memory could not be allocated ! (%llu bytes)\n",ROI_INIT_LENGTH * sizeof(struct mzROIStruct) );
error("findmzROI/calloc: buffer memory could not be allocated ! (%lu bytes)\n",ROI_INIT_LENGTH * sizeof(struct mzROIStruct) );

struct mzROIStruct * mzval = (struct mzROIStruct *) calloc(MZVAL_INIT_LENGTH, sizeof(struct mzROIStruct));
if (mzval == NULL)
error("findmzROI/calloc: buffer memory could not be allocated ! (%llu bytes)\n",MZVAL_INIT_LENGTH * sizeof(struct mzROIStruct) );
error("findmzROI/calloc: buffer memory could not be allocated ! (%lu bytes)\n",MZVAL_INIT_LENGTH * sizeof(struct mzROIStruct) );

mzLength.mzvalTotal = MZVAL_INIT_LENGTH;
mzLength.mzROITotal = ROI_INIT_LENGTH;
Expand Down

0 comments on commit 538f651

Please sign in to comment.