Silence a couple of warnings given when compiling with clang:
../examples/am7xxx-play.c:764:28: warning: will never be executed [-Wunreachable-code]
AM7XXX_ZOOM_ORIGINAL, AM7XXX_ZOOM_TEST);
^~~~~~~~~~~~~~~~
../examples/am7xxx-play.c:748:24: warning: will never be executed [-Wunreachable-code]
AM7XXX_POWER_OFF, AM7XXX_POWER_TURBO);
2 warnings generated.
../examples/picoproj.c:142:28: warning: will never be executed [-Wunreachable-code]
AM7XXX_ZOOM_ORIGINAL, AM7XXX_ZOOM_TEST);
^~~~~~~~~~~~~~~~
../examples/picoproj.c:127:24: warning: will never be executed [-Wunreachable-code]
AM7XXX_POWER_OFF, AM7XXX_POWER_TURBO);
2 warnings generated.
The warnings refer to the default case of a switch statement over an
enum variable, clang fails to understand that the default case can still
be reached because any integer value can be assigned to the enum
variables via the atoi() function. Work around the warning.
The behavior is also documented here:
http://lists.cs.uiuc.edu/pipermail/cfe-dev/2012-September/024174.html
In general assigning arbitrary values to enum variables will just be
weird; using enums in read mode is always safe tho.
unsigned int quality = 95;
int log_level = AM7XXX_LOG_INFO;
int device_index = 0;
unsigned int quality = 95;
int log_level = AM7XXX_LOG_INFO;
int device_index = 0;
- am7xxx_power_mode power_mode = AM7XXX_POWER_LOW;
- am7xxx_zoom_mode zoom = AM7XXX_ZOOM_ORIGINAL;
+ int power_mode = AM7XXX_POWER_LOW;
+ int zoom = AM7XXX_ZOOM_ORIGINAL;
int format = AM7XXX_IMAGE_FORMAT_JPEG;
am7xxx_context *ctx;
am7xxx_device *dev;
int format = AM7XXX_IMAGE_FORMAT_JPEG;
am7xxx_context *ctx;
am7xxx_device *dev;
am7xxx_device *dev;
int log_level = AM7XXX_LOG_INFO;
int device_index = 0;
am7xxx_device *dev;
int log_level = AM7XXX_LOG_INFO;
int device_index = 0;
- am7xxx_power_mode power_mode = AM7XXX_POWER_LOW;
- am7xxx_zoom_mode zoom = AM7XXX_ZOOM_ORIGINAL;
+ int power_mode = AM7XXX_POWER_LOW;
+ int zoom = AM7XXX_ZOOM_ORIGINAL;
int format = AM7XXX_IMAGE_FORMAT_JPEG;
int width = 800;
int height = 480;
int format = AM7XXX_IMAGE_FORMAT_JPEG;
int width = 800;
int height = 480;