tmalloc usage, drop explicit (unsigned) cast
This commit is contained in:
parent
32a255f47c
commit
b2aae741a0
|
|
@ -188,7 +188,7 @@ static toplink *getsubtoplink(char **ss)
|
||||||
if ((tmp =strchr(s, ':'))) {
|
if ((tmp =strchr(s, ':'))) {
|
||||||
tl->place = alloc(fplace);
|
tl->place = alloc(fplace);
|
||||||
tl->place->filename = strncpy(
|
tl->place->filename = strncpy(
|
||||||
(char*) tmalloc((unsigned) (sizeof (char) * (tmp - s + 1))),
|
(char*) tmalloc(sizeof (char) * (tmp - s + 1)),
|
||||||
s, (tmp - s));
|
s, (tmp - s));
|
||||||
tl->place->filename[tmp - s] = '\0';
|
tl->place->filename[tmp - s] = '\0';
|
||||||
strtolower(tl->place->filename);
|
strtolower(tl->place->filename);
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ main (int argc, char **argv)
|
||||||
|
|
||||||
switch (ch) {
|
switch (ch) {
|
||||||
case 'o':
|
case 'o':
|
||||||
name = (char *) tmalloc((unsigned) (strlen(optarg)*sizeof(char)));
|
name = (char *) tmalloc(strlen(optarg)*sizeof(char));
|
||||||
(void) strcpy(name,optarg);
|
(void) strcpy(name,optarg);
|
||||||
gotname=1;
|
gotname=1;
|
||||||
use_opt = 1;
|
use_opt = 1;
|
||||||
|
|
@ -158,13 +158,13 @@ main (int argc, char **argv)
|
||||||
|
|
||||||
comments(r,l,g,c,ctot,cm,lm,k,name,num,len);
|
comments(r,l,g,c,ctot,cm,lm,k,name,num,len);
|
||||||
|
|
||||||
matrix = (double **) tmalloc((unsigned) (sizeof(double*)*(num+1)));
|
matrix = (double **) tmalloc(sizeof(double*)*(num+1));
|
||||||
inverse = (double **) tmalloc((unsigned) (sizeof(double*)*(num+1)));
|
inverse = (double **) tmalloc(sizeof(double*)*(num+1));
|
||||||
tpeigenvalues = (double *) tmalloc((unsigned) (sizeof(double)*(num+1)));
|
tpeigenvalues = (double *) tmalloc(sizeof(double)*(num+1));
|
||||||
|
|
||||||
for (i=1;i<=num;i++) {
|
for (i=1;i<=num;i++) {
|
||||||
matrix[i] = (double *) tmalloc((unsigned) (sizeof(double)*(num+1)));
|
matrix[i] = (double *) tmalloc(sizeof(double)*(num+1));
|
||||||
inverse[i] = (double *) tmalloc((unsigned) (sizeof(double)*(num+1)));
|
inverse[i] = (double *) tmalloc(sizeof(double)*(num+1));
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i=1;i<=num;i++) {
|
for (i=1;i<=num;i++) {
|
||||||
|
|
@ -176,7 +176,7 @@ main (int argc, char **argv)
|
||||||
matrix[i][j] = phi(i-1,tpeigenvalues[j]);
|
matrix[i][j] = phi(i-1,tpeigenvalues[j]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
gammaj = (double *) tmalloc((unsigned) (sizeof(double)*(num+1)));
|
gammaj = (double *) tmalloc(sizeof(double)*(num+1));
|
||||||
|
|
||||||
for (j=1;j<=num;j++) {
|
for (j=1;j<=num;j++) {
|
||||||
gammaj[j] = 0.0;
|
gammaj[j] = 0.0;
|
||||||
|
|
@ -203,10 +203,10 @@ main (int argc, char **argv)
|
||||||
int errflg, err, singular_row, singular_col;
|
int errflg, err, singular_row, singular_col;
|
||||||
double *elptr;
|
double *elptr;
|
||||||
|
|
||||||
rhs = (double *) tmalloc((unsigned) (sizeof(double)*(num+1)));
|
rhs = (double *) tmalloc(sizeof(double)*(num+1));
|
||||||
irhs = (double *) tmalloc((unsigned) (sizeof(double)*(num+1)));
|
irhs = (double *) tmalloc(sizeof(double)*(num+1));
|
||||||
solution = (double *) tmalloc((unsigned) (sizeof(double)*(num+1)));
|
solution = (double *) tmalloc(sizeof(double)*(num+1));
|
||||||
isolution = (double *) tmalloc((unsigned) (sizeof(double)*(num+1)));
|
isolution = (double *) tmalloc(sizeof(double)*(num+1));
|
||||||
|
|
||||||
othermatrix = spCreate(num,0,&errflg);
|
othermatrix = spCreate(num,0,&errflg);
|
||||||
|
|
||||||
|
|
@ -264,7 +264,7 @@ main (int argc, char **argv)
|
||||||
fprintf(stdout,"\n");
|
fprintf(stdout,"\n");
|
||||||
fprintf(stdout,"* Lossy line models\n");
|
fprintf(stdout,"* Lossy line models\n");
|
||||||
|
|
||||||
options = (char *) tmalloc((unsigned) 256);
|
options = (char *) tmalloc(256);
|
||||||
(void) strcpy(options,"rel=1.2 nocontrol");
|
(void) strcpy(options,"rel=1.2 nocontrol");
|
||||||
for (i=1;i<=num;i++) {
|
for (i=1;i<=num;i++) {
|
||||||
fprintf(stdout,".model mod%d_%s ltra %s r=%0.12g l=%0.12g g=%0.12g c=%0.12g len=%0.12g\n",
|
fprintf(stdout,".model mod%d_%s ltra %s r=%0.12g l=%0.12g g=%0.12g c=%0.12g len=%0.12g\n",
|
||||||
|
|
|
||||||
|
|
@ -503,13 +503,13 @@ static int vectoblt TCL_CMDPROCARGS(clientData,interp,argc,argv) {
|
||||||
Tcl_AppendResult(interp, (char *)var, TCL_STATIC);
|
Tcl_AppendResult(interp, (char *)var, TCL_STATIC);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
realData = (double *)tmalloc((unsigned) sizeof(double)*(var_dvec->v_length));
|
realData = (double *)tmalloc(sizeof(double)*(var_dvec->v_length));
|
||||||
for (compIndex=0; compIndex<var_dvec->v_length; compIndex++){
|
for (compIndex=0; compIndex<var_dvec->v_length; compIndex++){
|
||||||
realData[compIndex] = ((var_dvec->v_compdata+compIndex)->cx_real);
|
realData[compIndex] = ((var_dvec->v_compdata+compIndex)->cx_real);
|
||||||
}
|
}
|
||||||
Blt_ResetVector(real_BltVector, realData, var_dvec->v_length, var_dvec->v_length, TCL_VOLATILE);
|
Blt_ResetVector(real_BltVector, realData, var_dvec->v_length, var_dvec->v_length, TCL_VOLATILE);
|
||||||
if (imag_BltVector != NULL) {
|
if (imag_BltVector != NULL) {
|
||||||
compData = (double *)tmalloc((unsigned) sizeof(double)*(var_dvec->v_length));
|
compData = (double *)tmalloc(sizeof(double)*(var_dvec->v_length));
|
||||||
for (compIndex=0; compIndex<var_dvec->v_length; compIndex++){
|
for (compIndex=0; compIndex<var_dvec->v_length; compIndex++){
|
||||||
compData[compIndex] = ((var_dvec->v_compdata+compIndex)->cx_imag);
|
compData[compIndex] = ((var_dvec->v_compdata+compIndex)->cx_imag);
|
||||||
}
|
}
|
||||||
|
|
@ -520,7 +520,7 @@ static int vectoblt TCL_CMDPROCARGS(clientData,interp,argc,argv) {
|
||||||
{
|
{
|
||||||
Blt_ResetVector(real_BltVector, var_dvec->v_realdata, var_dvec->v_length, var_dvec->v_length, TCL_VOLATILE);
|
Blt_ResetVector(real_BltVector, var_dvec->v_realdata, var_dvec->v_length, var_dvec->v_length, TCL_VOLATILE);
|
||||||
if (imag_BltVector != NULL) {
|
if (imag_BltVector != NULL) {
|
||||||
compData = (double *)tmalloc((unsigned) sizeof(double)*(var_dvec->v_length));
|
compData = (double *)tmalloc(sizeof(double)*(var_dvec->v_length));
|
||||||
for (compIndex=0; compIndex<var_dvec->v_length; compIndex++){
|
for (compIndex=0; compIndex<var_dvec->v_length; compIndex++){
|
||||||
compData[compIndex] = 0;
|
compData[compIndex] = 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue