diff --git a/src/frontend/postcoms.c b/src/frontend/postcoms.c index 89ce73a5b..728a305ee 100644 --- a/src/frontend/postcoms.c +++ b/src/frontend/postcoms.c @@ -163,7 +163,7 @@ com_print(wordlist *wl) if (width < 60) width = 60; if (width > BSIZE_SP - 2) - buf = TREALLOC(char, buf, width + 1); + buf = TREALLOC(char, buf, (size_t) width + 1); for (v = vecs; v; v = v->v_link2) { char *basename = vec_basename(v); if (plotnames) @@ -239,8 +239,8 @@ com_print(wordlist *wl) if (width < 40) width = 40; if (width > BSIZE_SP - 2) { - buf = TREALLOC(char, buf, width + 1); - buf2 = TREALLOC(char, buf2, width + 1); + buf = TREALLOC(char, buf, (size_t) width + 1); + buf2 = TREALLOC(char, buf2, (size_t) width + 1); } if (cp_getvar("height", CP_NUM, &i, 0)) height = i; diff --git a/src/frontend/terminal.c b/src/frontend/terminal.c index be21a4dd4..84d882545 100644 --- a/src/frontend/terminal.c +++ b/src/frontend/terminal.c @@ -129,7 +129,7 @@ outbufputc(void) { if (ourbuf.count != BUFSIZ) { fputs(staticbuf, cp_out); - memset(staticbuf, 0, (size_t) (BUFSIZ - ourbuf.count)); + memset(staticbuf, 0, (size_t) BUFSIZ - ourbuf.count); ourbuf.count = BUFSIZ; ourbuf.ptr = staticbuf; } diff --git a/src/frontend/variable.c b/src/frontend/variable.c index 3e8ee3170..40f7e913a 100644 --- a/src/frontend/variable.c +++ b/src/frontend/variable.c @@ -275,8 +275,9 @@ cp_setparse(wordlist *wl) while (wl) { - if (name) - tfree(name); + if (name) { + txfree(name); + } name = cp_unquote(wl->wl_word); diff --git a/src/frontend/vectors.c b/src/frontend/vectors.c index dc1001f1b..060a63476 100644 --- a/src/frontend/vectors.c +++ b/src/frontend/vectors.c @@ -1140,9 +1140,11 @@ vec_mkfamily(struct dvec *v) { d->v_dims[0] = size; if (isreal(v)) { - memcpy(d->v_realdata, v->v_realdata + size*i, (size_t) size * sizeof(double)); + memcpy(d->v_realdata, v->v_realdata + (size_t) size * i, + (size_t) size * sizeof(double)); } else { - memcpy(d->v_compdata, v->v_compdata + size*i, (size_t) size * sizeof(ngcomplex_t)); + memcpy(d->v_compdata, v->v_compdata + (size_t) size * i, + (size_t) size * sizeof(ngcomplex_t)); } /* Add one to the counter. */ (void) incindex(count, v->v_numdims - 1, v->v_dims, v->v_numdims); diff --git a/src/maths/cmaths/cmath2.c b/src/maths/cmaths/cmath2.c index 4b35335df..4f61e4860 100644 --- a/src/maths/cmaths/cmath2.c +++ b/src/maths/cmaths/cmath2.c @@ -332,7 +332,7 @@ cx_avg(void *data, short int type, int length, int *newlength, short int *newtyp for (i = 0; i < length; i++) { sum_real += dd[i]; - d[i] = sum_real / (double)(i+1); + d[i] = sum_real / ((double) i + 1.0); } return ((void *) d); @@ -347,10 +347,10 @@ cx_avg(void *data, short int type, int length, int *newlength, short int *newtyp for (i = 0; i < length; i++) { sum_real += realpart(cc[i]); - realpart(c[i]) = sum_real / (double)(i+1); + realpart(c[i]) = sum_real / ((double) i + 1.0); sum_imag += imagpart(cc[i]); - imagpart(c[i]) = sum_imag / (double)(i+1); + imagpart(c[i]) = sum_imag / ((double) i + 1.0); } return ((void *) c); @@ -412,7 +412,7 @@ cx_stddev(void *data, short int type, int length, int *newlength, short int *new *newtype = VF_REAL; for (i = 0; i < length; i++) sum += (dd[i] - *mean) * (dd[i] - *mean); - *d = sqrt(sum / (length - 1)); + *d = sqrt(sum / ((double) length - 1.0)); tfree(mean); return ((void *)d); } @@ -429,7 +429,7 @@ cx_stddev(void *data, short int type, int length, int *newlength, short int *new b = imagpart(cc[i]) - imagpart(*cmean); sum += a * a + b * b; } - *d = sqrt(sum / (length - 1)); + *d = sqrt(sum / ((double) length - 1.0)); tfree(cmean); return ((void *)d); } diff --git a/src/misc/wlist.c b/src/misc/wlist.c index 0f94d6eca..e94fa93b3 100644 --- a/src/misc/wlist.c +++ b/src/misc/wlist.c @@ -131,7 +131,7 @@ char ** wl_mkvec(const wordlist *wl) { int len = wl_length(wl); - char **vec = TMALLOC(char *, len + 1); + char **vec = TMALLOC(char *, (size_t) len + 1); int i; diff --git a/src/winmain.c b/src/winmain.c index e0d168976..d7bb2644e 100644 --- a/src/winmain.c +++ b/src/winmain.c @@ -258,7 +258,7 @@ SetAnalyse(char *Analyse, /* in: analysis type */ OldPercent = DecaPercent; /* output only into hwAnalyse window and if time elapsed is larger than DELTATIME given value, or if analysis has changed, else return */ - if (hwAnalyse && ((diffsec > 0) || (diffmillisec > DELTATIME) || strcmp(OldAn, Analyse))) { + if (((diffsec > 0) || (diffmillisec > DELTATIME) || strcmp(OldAn, Analyse))) { if (DecaPercent < 0) { sprintf(s, "--ready--"); sprintf(t, "%s", PACKAGE_STRING); @@ -313,7 +313,7 @@ AdjustScroller(void) if (MyFirstLine < 0 ) MyFirstLine = 0; - Edit_Scroll(twText, MyFirstLine - FirstLine, 0); + Edit_Scroll(twText, (WPARAM) MyFirstLine - FirstLine, 0); // Das wars DoUpdate = FALSE; } @@ -1034,7 +1034,8 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLine, int nCm /* terminate */ return nReturnCode; -} +} /* end of function WinMain */ + // -------------------------------------------------------------------