@@ -262,6 +262,9 @@ double* orient (Calibration* cal_in, control_par *cpar, int nfix, vec3d fix[],
262262 double * P , * y , * yh , * Xbeta , * resi ;
263263 vec3d glass_dir , tmp_vec , e1 , e2 ;
264264
265+ double (* X )[NPAR ];
266+ double (* Xh )[NPAR ];
267+
265268 Calibration * cal ;
266269
267270 /* small perturbation for translation/rotation in meters and in radians */
@@ -278,8 +281,8 @@ double* orient (Calibration* cal_in, control_par *cpar, int nfix, vec3d fix[],
278281 Xbeta = (double * ) calloc (maxsize , sizeof (double ));
279282 resi = (double * ) calloc (maxsize , sizeof (double ));
280283
281- double ( * X )[ NPAR ] = malloc (sizeof (* X ) * maxsize );
282- double ( * Xh )[ NPAR ] = malloc (sizeof (* Xh ) * maxsize );
284+ X = malloc (sizeof (* X ) * maxsize );
285+ Xh = malloc (sizeof (* Xh ) * maxsize );
283286
284287 for (i = 0 ; i < maxsize ; i ++ ) {
285288 for (j = 0 ; j < NPAR ; j ++ ) {
@@ -759,13 +762,13 @@ int read_man_ori_fix(vec3d fix4[4], char* calblock_filename,
759762 * Returns: pointer to a new orient_par structure.
760763 */
761764orient_par * read_orient_par (char * filename ) {
765+ orient_par * ret ;
762766 FILE * file = fopen (filename , "r" );
763767 if (file == NULL ) {
764768 printf ("Could not open orientation parameters file %s.\n" , filename );
765769 return NULL ;
766770 }
767771
768- orient_par * ret ;
769772 ret = malloc (sizeof (orient_par ));
770773
771774 if ( !(fscanf (file , "%d" , & ret -> useflag )== 1 ) /* use every point or every other pt */
0 commit comments