diff options
author | Kristian Høgsberg <krh@bitplanet.net> | 2012-07-23 10:47:34 -0400 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2012-07-23 10:47:34 -0400 |
commit | 776a5637028e158e9b90ae7fdedb47138a9a529a (patch) | |
tree | a39b4217347fa5721ebb949cea80ac2f7341a055 /wcap | |
parent | 005d8cd9f7e99cc87dfde63016fdbccd54dfa660 (diff) | |
download | weston-776a5637028e158e9b90ae7fdedb47138a9a529a.tar.gz |
wcap: Add GCC_CFLAGS and fix more compiler warnings
Diffstat (limited to 'wcap')
-rw-r--r-- | wcap/Makefile.am | 2 | ||||
-rw-r--r-- | wcap/main.c | 3 | ||||
-rw-r--r-- | wcap/wcap-decode.c | 7 |
3 files changed, 5 insertions, 7 deletions
diff --git a/wcap/Makefile.am b/wcap/Makefile.am index da0ba904..338208e3 100644 --- a/wcap/Makefile.am +++ b/wcap/Makefile.am @@ -5,5 +5,5 @@ wcap_decode_SOURCES = \ wcap-decode.c \ wcap-decode.h -wcap_decode_CFLAGS = $(WCAP_CFLAGS) +wcap_decode_CFLAGS = $(GCC_CFLAGS) $(WCAP_CFLAGS) wcap_decode_LDADD = $(WCAP_LIBS) diff --git a/wcap/main.c b/wcap/main.c index 09e0aa7f..466030ec 100644 --- a/wcap/main.c +++ b/wcap/main.c @@ -30,6 +30,7 @@ #include <unistd.h> #include <string.h> #include <fcntl.h> +#include <assert.h> #include <cairo.h> @@ -65,6 +66,8 @@ rgb_to_yuv(uint32_t format, uint32_t p, int *u, int *v) g = (p >> 8) & 0xff; b = (p >> 16) & 0xff; break; + default: + assert(0); } y = (19595 * r + 38469 * g + 7472 * b) >> 16; diff --git a/wcap/wcap-decode.c b/wcap/wcap-decode.c index 3dc7e6d7..f7cabe3e 100644 --- a/wcap/wcap-decode.c +++ b/wcap/wcap-decode.c @@ -85,9 +85,7 @@ wcap_decoder_get_frame(struct wcap_decoder *decoder) { struct wcap_rectangle *rects; struct wcap_frame_header *header; - uint32_t *s; uint32_t i; - int width, height; if (decoder->p == decoder->end) return 0; @@ -98,11 +96,8 @@ wcap_decoder_get_frame(struct wcap_decoder *decoder) rects = (void *) (header + 1); decoder->p = (uint32_t *) (rects + header->nrects); - for (i = 0; i < header->nrects; i++) { - width = rects[i].x2 - rects[i].x1; - height = rects[i].y2 - rects[i].y1; + for (i = 0; i < header->nrects; i++) wcap_decoder_decode_rectangle(decoder, &rects[i]); - } return 1; } |