diff -ru orig/AmberTools/src/ptraj/actions.c amber12/AmberTools/src/ptraj/actions.c --- orig/AmberTools/src/ptraj/actions.c 2013-05-02 13:16:23.000000002 +0200 +++ amber12/AmberTools/src/ptraj/actions.c 2013-11-18 16:59:15.681119594 +0100 @@ -9309,7 +9309,7 @@ int i, j, k, pt, iacceptor, iacceptorH, idonor, donors, acceptors, isolvent; int i1, i2, index, id, ia, idres, iares, found, current; double mem; - long kalloc; + size_t kalloc, li; int *sortindex; double a, d; double m; @@ -10730,17 +10730,17 @@ hbondInfo->distance2 = (float *) safe_malloc(sizeof(float) * k); hbondInfo->angle = (float *) safe_malloc(sizeof(float) * k); hbondInfo->angle2 = (float *) safe_malloc(sizeof(float) * k); - for (i=0; i < k; i++) { - hbondInfo->occupied[i] = 0.0; - hbondInfo->distance[i] = 0.0; - hbondInfo->distance2[i] = 0.0; - hbondInfo->angle[i] = 0.0; - hbondInfo->angle2[i] = 0.0; + for (li=0; li < k; li++) { + hbondInfo->occupied[li] = 0.0; + hbondInfo->distance[li] = 0.0; + hbondInfo->distance2[li] = 0.0; + hbondInfo->angle[li] = 0.0; + hbondInfo->angle2[li] = 0.0; } if (hbondInfo->series) { - kalloc = hbondInfo->series * donors * acceptors; + kalloc = (long)hbondInfo->series * donors * acceptors; if ( ( kalloc * sizeof(float) ) < 0 ) { mem = (float) hbondInfo->series * (float) donors * (float) acceptors * (float) sizeof(float); fprintf(stdout,"\n WARNING in ptraj, hbond -- requesting allocation of a negative number of bytes!\n"); @@ -10752,10 +10753,10 @@ hbondInfo->seriesDistance = (float *) safe_malloc( sizeof(float) * kalloc ); hbondInfo->seriesAngle = (float *) safe_malloc( sizeof(float) * kalloc ); - for (i=0; i < kalloc; i++) { - hbondInfo->seriesOccupied[i] = 0.0; - hbondInfo->seriesDistance[i] = 0.0; - hbondInfo->seriesAngle[i] = 0.0; + for (li=0; li < kalloc; li++) { + hbondInfo->seriesOccupied[li] = 0.0; + hbondInfo->seriesDistance[li] = 0.0; + hbondInfo->seriesAngle[li] = 0.0; } } }