@@ -113,7 +113,7 @@ int read_xtc(XDRFILE *xd, int natoms, int *step, float *time, matrix box,
113113 return exdrOK ;
114114}
115115
116- int read_xtc_n_frames (char * fn , int * n_frames , int64_t * * offsets ) {
116+ int read_xtc_n_frames (char * fn , int * n_frames , int64_t * offsets ) {
117117 XDRFILE * xd ;
118118 int framebytes , natoms , step ;
119119 float time ;
@@ -141,10 +141,10 @@ int read_xtc_n_frames(char *fn, int *n_frames, int64_t **offsets) {
141141 * n_frames = filesize / framebytes ; /* Should we complain if framesize
142142 doesn't divide filesize? */
143143 /* Allocate memory for the frame index array */
144- if ((* offsets = ( int64_t * ) malloc (sizeof (int64_t ) * (* n_frames ))) == NULL )
144+ if ((offsets = malloc (sizeof (int64_t ) * (* n_frames ))) == NULL )
145145 return exdrNOMEM ;
146146 for (i = 0 ; i < * n_frames ; i ++ ) {
147- ( * offsets ) [i ] = i * framebytes ;
147+ offsets [i ] = i * framebytes ;
148148 }
149149 return exdrOK ;
150150 } else /* No easy way out. We must iterate. */
@@ -167,16 +167,16 @@ int read_xtc_n_frames(char *fn, int *n_frames, int64_t **offsets) {
167167 est_nframes += est_nframes / 5 ;
168168
169169 /* Allocate memory for the frame index array */
170- if ((* offsets = ( int64_t * ) malloc (sizeof (int64_t ) * est_nframes )) == NULL ) {
170+ if ((offsets = malloc (sizeof (int64_t ) * est_nframes )) == NULL ) {
171171 xdrfile_close (xd );
172172 return exdrNOMEM ;
173173 }
174- ( * offsets ) [0 ] = 0L ;
174+ offsets [0 ] = 0L ;
175175 * n_frames = 1 ;
176176 while (1 ) {
177177 if (xdr_seek (xd , (int64_t )(framebytes + XTC_HEADER_SIZE ), SEEK_CUR ) !=
178178 exdrOK ) {
179- free (* offsets );
179+ free (offsets );
180180 xdrfile_close (xd );
181181 return exdrNR ;
182182 }
@@ -186,14 +186,14 @@ int read_xtc_n_frames(char *fn, int *n_frames, int64_t **offsets) {
186186 /* Check if we need to enlarge array */
187187 if (* n_frames == est_nframes ) {
188188 est_nframes += est_nframes / 5 + 1 ; // Increase in 20% stretches
189- if ((* offsets = realloc (* offsets , sizeof (int64_t ) * est_nframes )) ==
189+ if ((offsets = realloc (offsets , sizeof (int64_t ) * est_nframes )) ==
190190 NULL ) {
191- free (* offsets );
191+ free (offsets );
192192 xdrfile_close (xd );
193193 return exdrNOMEM ;
194194 }
195195 }
196- ( * offsets ) [* n_frames ] =
196+ offsets [* n_frames ] =
197197 xdr_tell (xd ) - 4L - (int64_t )(XTC_HEADER_SIZE ); // Account for the
198198 // header and the
199199 // nbytes bytes we
0 commit comments