Motion - Signed Unsigned Chars In Motion

Signed and Unsigned Chars in Motion

Safe means that the function works with both signed and unsigned.

This topic was created to figure out what needed to be changed to match signed/unsigned chars in the Motion code to avoid warnings in gcc 4 and potential errors. After having analysed just alg.c it was clear what we had to do and I doubt we will need to finish this topic -- KennethLavrsen - 14 Jul 2005

alg.c

  • alg_locate_center_size - safe
  • alg_draw_location - safe
  • alg_noise_tune - must be unsigned ALERT!
  • alg_threshold_tune - safe
  • iflood - seems safe
  • alg_labeling - seems safe
  • dilate9 - safe
  • dilate5 - safe
  • erode9 - safe
  • erode5 - safe
  • alg_despeckle - safe
  • tune_smartmask - must be unsigned ALERT!

I stop here.

Conclusion. It is best to keep images unsigned.

I do the following.
  • Make all images unsigned in all function where possible. Otherwise cast.
  • Keep all strings as normal char (signed)
  • Split the *filename parameter in event() in two. unsigned char *image and char *filename.

-- KennethLavrsen - 20 Jun 2005
Topic attachments
I Attachment Action Size Date Who Comment
avilib.c.signed-fix.diffdiff avilib.c.signed-fix.diff manage 13 K 20 Jun 2005 - 18:26 AngelCarpintero signed/unsigned gcc4 warnings fixes
Topic revision: r6 - 14 Jul 2005, KennethLavrsen
Copyright © 1999-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Please do not email Kenneth for support questions (read why). Use the Support Requests page or join the Mailing List.
This website only use harmless session cookies. See Cookie Policy for details. By using this website you accept the use of these cookies.