From 3fc09e5461aea11bf5b5f87b8658cd5d2dec6451 Mon Sep 17 00:00:00 2001 From: MrDave Date: Wed, 4 Dec 2019 20:04:55 -0700 Subject: [PATCH] Compiler Warnings --- .travis.yml | 23 ----------------------- configure.ac | 2 +- src/alg.cpp | 6 ++++-- src/rotate.cpp | 14 +++++++------- src/webu_text.cpp | 2 +- 5 files changed, 13 insertions(+), 34 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5450eee5..f491e8a4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,14 +2,6 @@ sudo: required matrix: include: - - os: osx - language: c - compiler: gcc - - os: linux - env: DOCKER_IMAGE=ubuntu:16.04 - services: docker - language: c - compiler: gcc - os: linux env: DOCKER_IMAGE=ubuntu:18.04 services: docker @@ -20,26 +12,11 @@ matrix: services: docker language: c compiler: gcc - - os: linux - env: DOCKER_IMAGE=debian:jessie - services: docker - language: c - compiler: gcc - - os: linux - env: DOCKER_IMAGE=debian:stretch - services: docker - language: c - compiler: gcc - os: linux env: DOCKER_IMAGE=debian:buster services: docker language: c compiler: gcc - - os: linux - env: DOCKER_IMAGE=alpine:latest - services: docker - language: c - compiler: gcc before_install: - if [ "$DOCKER_IMAGE" = "alpine:latest" ]; then diff --git a/configure.ac b/configure.ac index 501b0686..abcfa04e 100644 --- a/configure.ac +++ b/configure.ac @@ -461,7 +461,7 @@ AC_ARG_WITH([developer-flags], [DEVELOPER_FLAGS=no]) AS_IF([test "${DEVELOPER_FLAGS}" = "yes"], [ - TEMP_CPPFLAGS="$TEMP_CPPFLAGS -W -Werror -Wall -Wextra -Wformat -Wshadow -Wpointer-arith -Wwrite-strings -Winline -Wredundant-decls -Wno-long-long -ggdb -g3" + TEMP_CPPFLAGS="$TEMP_CPPFLAGS -W -Wall -Wextra -Wformat -Wshadow -Wpointer-arith -Wwrite-strings -Winline -Wredundant-decls -Wno-long-long -ggdb -g3" ] ) diff --git a/src/alg.cpp b/src/alg.cpp index a04bc41c..886bf1ad 100644 --- a/src/alg.cpp +++ b/src/alg.cpp @@ -766,13 +766,14 @@ static int alg_diff_standard(struct ctx_cam *cam, unsigned char *new_var) { unsigned char *mask = imgs->mask; unsigned char *smartmask_final = imgs->smartmask_final; int *smartmask_buffer = imgs->smartmask_buffer; + unsigned char curdiff; i = imgs->motionsize; memset(out + i, 128, i / 2); /* Motion pictures are now b/w i.o. green */ memset(out, 0, i); for (; i > 0; i--) { - register unsigned char curdiff = (int)(abs(*ref - *new_var)); /* Using a temp variable is 12% faster. */ + curdiff = (int)(abs(*ref - *new_var)); /* Using a temp variable is 12% faster. */ /* Apply fixed mask */ if (mask) curdiff = ((int)(curdiff * *mask++) / 255); @@ -812,6 +813,7 @@ static char alg_diff_fast(struct ctx_cam *cam, int max_n_changes, unsigned char int i, diffs = 0, step = imgs->motionsize/10000; int noise = cam->noise; unsigned char *ref = imgs->ref; + unsigned char curdiff; if (!step % 2) step++; @@ -821,7 +823,7 @@ static char alg_diff_fast(struct ctx_cam *cam, int max_n_changes, unsigned char i = imgs->motionsize; for (; i > 0; i -= step) { - register unsigned char curdiff = (int)(abs((char)(*ref - *new_var))); /* Using a temp variable is 12% faster. */ + curdiff = (int)(abs((char)(*ref - *new_var))); /* Using a temp variable is 12% faster. */ if (curdiff > noise) { diffs++; if (diffs > max_n_changes) diff --git a/src/rotate.cpp b/src/rotate.cpp index 4ab839f5..a89ac848 100644 --- a/src/rotate.cpp +++ b/src/rotate.cpp @@ -69,7 +69,7 @@ static void reverse_inplace_quad(unsigned char *src, int size) { uint32_t *nsrc = (uint32_t *)src; /* first quad */ uint32_t *ndst = (uint32_t *)(src + size - 4); /* last quad */ - register uint32_t tmp; + uint32_t tmp; while (nsrc < ndst) { tmp = bswap_32(*ndst); @@ -80,7 +80,7 @@ static void reverse_inplace_quad(unsigned char *src, int size) static void flip_inplace_horizontal(unsigned char *src, int width, int height) { uint8_t *nsrc, *ndst; - register uint8_t tmp; + uint8_t tmp; int l,w; for(l=0; l < height/2; l++) { @@ -98,7 +98,7 @@ static void flip_inplace_horizontal(unsigned char *src, int width, int height) { static void flip_inplace_vertical(unsigned char *src, int width, int height) { uint8_t *nsrc, *ndst; - register uint8_t tmp; + uint8_t tmp; int l; for(l=0; l < height; l++) { @@ -129,11 +129,11 @@ static void flip_inplace_vertical(unsigned char *src, int width, int height) * * Returns: nothing */ -static void rot90cw(unsigned char *src, register unsigned char *dst, int size, +static void rot90cw(unsigned char *src, unsigned char *dst, int size, int width, int height) { unsigned char *endp; - register unsigned char *base; + unsigned char *base; int j; endp = src + size; @@ -162,11 +162,11 @@ static void rot90cw(unsigned char *src, register unsigned char *dst, int size, * * Returns: nothing */ -static inline void rot90ccw(unsigned char *src, register unsigned char *dst, +static inline void rot90ccw(unsigned char *src, unsigned char *dst, int size, int width, int height) { unsigned char *endp; - register unsigned char *base; + unsigned char *base; int j; endp = src + size; diff --git a/src/webu_text.cpp b/src/webu_text.cpp index f17928b1..27ad02b5 100644 --- a/src/webu_text.cpp +++ b/src/webu_text.cpp @@ -915,7 +915,7 @@ void webu_text_get_query(struct webui_ctx *webui) { if (mystrne(webui->uri_value1, config_parms[indx_parm].parm_name.c_str())){ MOTION_LOG(NTC, TYPE_STREAM, NO_ERRNO , _("'%s' option is depreciated. New option name is `%s'") - ,webui->uri_value1, config_parms[indx_parm].parm_name); + ,webui->uri_value1, config_parms[indx_parm].parm_name.c_str()); } webu_text_header(webui);