G'day,
Talk about "set stack pointers to NULL", extra comments, and other stuff
have impeded adoption of a patch to get rid of six of the diagnostics.
So, attached is a patch labelled
"im-r711-im_analyze-misleading-indent-part-1.patch",
generated by "svn diff". It's "part 1", because there's another block,
very similarly-written, further down, that I'll target in a separate
patch.
Hopefully this patch will be more palatable than its predecessor. [I've
even named it relative to IM's r711, not CD's r737!] Note that the second
patch will be written assuming that the first has been applied.
cheers,
sur-behoffski (Brenton Hoff)
programmer, Grouse Software
--- src/process/im_analyze.cpp (revision 711)
+++ src/process/im_analyze.cpp (working copy)
@@ -719,35 +719,19 @@
double* cm11 = (double*)malloc(region_count*sizeof(double));
ret = iCalcMoment(cm20, 2, 0, image, data_cx, data_cy, region_count, counter);
+ if (ret)
+ ret = iCalcMoment(cm02, 0, 2, image, data_cx, data_cy, region_count, counter);
+ if (ret)
+ ret = iCalcMoment(cm11, 1, 1, image, data_cx, data_cy, region_count, counter);
if (!ret)
{
- if (local_data_area) free(local_data_area);
- if (local_data_cx) free(local_data_cx);
- if (local_data_cy) free(local_data_cy);
- if (cm20) free(cm20); if (cm02) free(cm02); if (cm11) free(cm11);
+ free(local_data_area);
+ free(local_data_cx);
+ free(local_data_cy);
+ free(cm20); free(cm02); free(cm11);
imProcessCounterEnd(counter);
return 0;
}
- ret = iCalcMoment(cm02, 0, 2, image, data_cx, data_cy, region_count, counter);
- if (!ret)
- {
- if (local_data_area) free(local_data_area);
- if (local_data_cx) free(local_data_cx);
- if (local_data_cy) free(local_data_cy);
- if (cm20) free(cm20); if (cm02) free(cm02); if (cm11) free(cm11);
- imProcessCounterEnd(counter);
- return 0;
- }
- ret = iCalcMoment(cm11, 1, 1, image, data_cx, data_cy, region_count, counter);
- if (!ret)
- {
- if (local_data_area) free(local_data_area);
- if (local_data_cx) free(local_data_cx);
- if (local_data_cy) free(local_data_cy);
- if (cm20) free(cm20); if (cm02) free(cm02); if (cm11) free(cm11);
- imProcessCounterEnd(counter);
- return 0;
- }
double *local_major_slope = 0, *local_minor_slope = 0;
if (!major_slope)
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Iup-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/iup-users