Changeset 41162
- Timestamp:
- Nov 27, 2019, 11:09:40 AM (7 years ago)
- Location:
- trunk/Ohana/src/opihi/lib.data
- Files:
-
- 6 edited
-
MedImageOps.c (modified) (2 diffs)
-
SplineOps.c (modified) (1 diff)
-
open_kapa.c (modified) (2 diffs)
-
spline.c (modified) (2 diffs)
-
starfuncs.c (modified) (1 diff)
-
style_args.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/lib.data/MedImageOps.c
r36679 r41162 32 32 free (medimage[0].name); 33 33 for (i = 0; i < medimage[0].Ninput; i++) { 34 free (medimage[0].buffers[i]); 34 free (medimage[0].flx[i]); 35 FREE (medimage[0].var[i]); 35 36 } 36 free (medimage[0].buffers); 37 free (medimage[0].flx); 38 free (medimage[0].var); 37 39 free (medimage); 38 40 } … … 75 77 medimage->Nx = Nx; 76 78 medimage->Ny = Ny; 77 ALLOCATE (medimage->buffers, float *, 1); 79 ALLOCATE (medimage->flx, float *, 1); 80 ALLOCATE (medimage->var, float *, 1); 78 81 79 82 medimages[N] = medimage; -
trunk/Ohana/src/opihi/lib.data/SplineOps.c
r38441 r41162 41 41 ALLOCATE (spline[0].y2, opihi_flt, spline[0].Nknots); 42 42 } 43 memset (spline[0].xk, 0, spline[0].Nknots * sizeof(opihi_flt)); 44 memset (spline[0].yk, 0, spline[0].Nknots * sizeof(opihi_flt)); 45 memset (spline[0].y2, 0, spline[0].Nknots * sizeof(opihi_flt)); 43 if (spline[0].Nknots) { 44 memset (spline[0].xk, 0, spline[0].Nknots * sizeof(opihi_flt)); 45 memset (spline[0].yk, 0, spline[0].Nknots * sizeof(opihi_flt)); 46 memset (spline[0].y2, 0, spline[0].Nknots * sizeof(opihi_flt)); 47 } 46 48 } 47 49 -
trunk/Ohana/src/opihi/lib.data/open_kapa.c
r31635 r41162 266 266 int close_kapa (char *name) { 267 267 268 struct timespec request, remain; 268 269 int N; 269 270 … … 274 275 } 275 276 DelKapaDevice (name); 277 278 // avoid blocking on waitpid, test every 1 msec, up to 500 msec 279 request.tv_sec = 0; 280 request.tv_nsec = 1000000; 281 282 // try to harvest the child PID 283 int waitstatus = 0; 284 int result = waitpid (-1, &waitstatus, WNOHANG); 285 for (int i = 0; (i < 500) && (result == 0); i++) { 286 nanosleep (&request, &remain); 287 result = waitpid (-1, &waitstatus, WNOHANG); 288 } 289 290 if ((result == -1) && (errno != ECHILD)) { 291 fprintf (stderr, "unexpected error from waitpid (%d): programming error\n", errno); 292 } 293 if (result == 0) { 294 fprintf (stderr, "child did not exit (close_kapa), timeout"); 295 } 296 276 297 return (TRUE); 277 298 } -
trunk/Ohana/src/opihi/lib.data/spline.c
r39231 r41162 7 7 float dy, dx, *tmp; 8 8 9 // spline is not valid with < 3 points 10 if (N < 3) return; 11 9 12 ALLOCATE (tmp, float, N); 10 13 … … 69 72 opihi_flt dy, dx, *tmp; 70 73 74 // spline is not valid with < 3 points 75 if (N < 3) return; 76 71 77 ALLOCATE (tmp, opihi_flt, N); 72 78 -
trunk/Ohana/src/opihi/lib.data/starfuncs.c
r40398 r41162 75 75 FWHMx = 2.355*sqrt (fabs(x2 / I - x*x)); 76 76 FWHMy = 2.355*sqrt (fabs(y2 / I - y*y)); 77 78 fprintf (stderr, "Mxx, Myy: %f, %f\n", x2/I - x*x, y2/I - y*y); 77 79 Sxy = xy / I - x*y; 78 80 mag = -2.5*log10(I); -
trunk/Ohana/src/opihi/lib.data/style_args.c
r40570 r41162 72 72 } 73 73 74 if ((graphmode[0].style == KAPA_PLOT_POLYGON) || (graphmode[0].style == KAPA_PLOT_POLYFILL)) { 75 if ((N = get_argument (*argc, argv, "-npoint"))) { 76 remove_argument (N, argc, argv); 77 graphmode[0].ptype = atoi (argv[N]); 78 remove_argument (N, argc, argv); 79 } else { 80 gprint (GP_ERR, "polygon & polyfill styles require number of points argument: -npoint N\n"); 81 return FALSE; 82 } 83 } 74 84 return (TRUE); 75 85 }
Note:
See TracChangeset
for help on using the changeset viewer.
