From 3e53086a81e23799a27f5e7e26d5f91b787fa0bd Mon Sep 17 00:00:00 2001 From: AngelCarpintero Date: Mon, 5 Apr 2010 18:35:19 +0000 Subject: [PATCH] fix spelling and code standard compliant --- alg.c | 2 +- conf.c | 20 ++++++++++---------- configure | 18 +++++++++--------- ffmpeg.c | 2 +- jpegutils.c | 4 ++-- logger.c | 12 ++++++------ motion.1 | 2 +- motion.c | 6 +++--- netcam.c | 2 +- netcam_jpeg.c | 4 ++-- picture.c | 6 ++---- rotate.c | 2 +- track.c | 2 +- video.c | 2 +- video2.c | 6 +++--- video_freebsd.c | 2 +- 16 files changed, 45 insertions(+), 47 deletions(-) diff --git a/alg.c b/alg.c index f2e22bd..93c260f 100644 --- a/alg.c +++ b/alg.c @@ -576,7 +576,7 @@ static int alg_labeling(struct context *cnt) } MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO, "%s: %i Labels found. Largest connected Area: %i Pixel(s). " - "Largest Label: %i", imgs->largest_label, imgs->labelsize_max, + "Largest Label: %i", imgs->largest_label, imgs->labelsize_max, cnt->current_image->total_labels); /* Return group of significant labels. */ diff --git a/conf.c b/conf.c index f22eadf..d84ee16 100644 --- a/conf.c +++ b/conf.c @@ -104,7 +104,7 @@ struct config conf_template = { tuner_device: NULL, #endif video_device: VIDEO_DEVICE, - v4l2_palette: DEF_PALETTE, + v4l2_palette: DEF_PALETTE, vidpipe: NULL, filepath: NULL, imagepath: DEF_IMAGEPATH, @@ -224,9 +224,9 @@ config_param config_params[] = { }, { "log_type", - "# Filter to log messages by type (STR, ENC, NET, DBL, EVT, TRK, VID, ALL). (default: ALL)", + "# Filter to log messages by type (STR, ENC, NET, DBL, EVT, TRK, VID, ALL). (default: ALL)", 1, - CONF_OFFSET(log_type_str), + CONF_OFFSET(log_type_str), copy_string, print_string }, @@ -400,7 +400,7 @@ config_param config_params[] = { { "netcam_tolerant_check", "# Set less strict jpeg checks for network cameras with a poor/buggy firmware.\n" - "# Default: off", + "# Default: off", 0, CONF_OFFSET(netcam_tolerant_check), copy_bool, @@ -658,7 +658,7 @@ config_param config_params[] = { print_int }, { - "picture_type", + "picture_type", "# Type of output images\n" "# Valid values: jpeg, ppm (default: jpeg)", 0, @@ -758,7 +758,7 @@ config_param config_params[] = { }, #endif /* HAVE_FFMPEG */ { - "use_extpipe", + "use_extpipe", "\n############################################################\n" "# External pipe to video encoder\n" "# Replacement for FFMPEG builtin encoder for ffmpeg_output_movies only.\n" @@ -1074,7 +1074,7 @@ config_param config_params[] = { CONF_OFFSET(webcontrol_authentication), copy_string, print_string - }, + }, { "track_type", "\n############################################################\n" @@ -1401,13 +1401,13 @@ config_param config_params[] = { print_string }, { - "database_dbname", + "database_dbname", "# database to log to (default: not defined)", 0, CONF_OFFSET(database_dbname), copy_string, print_string - }, + }, { "database_host", "# The host on which the database is located (default: not defined)", @@ -1462,7 +1462,7 @@ config_param config_params[] = { "# Video Loopback Device (vloopback project)\n" "############################################################\n\n" "# Output images to a video4linux loopback device\n" - "# The value '-' means next available (default: not defined)", + "# The value '-' means next available (default: not defined)", 0, CONF_OFFSET(vidpipe), copy_string, diff --git a/configure b/configure index b48d305..3844498 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.64 for motion trunkREV502. +# Generated by GNU Autoconf 2.64 for motion trunkREV504. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software @@ -546,8 +546,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='motion' PACKAGE_TARNAME='motion' -PACKAGE_VERSION='trunkREV502' -PACKAGE_STRING='motion trunkREV502' +PACKAGE_VERSION='trunkREV504' +PACKAGE_STRING='motion trunkREV504' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1210,7 +1210,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures motion trunkREV502 to adapt to many kinds of systems. +\`configure' configures motion trunkREV504 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1271,7 +1271,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of motion trunkREV502:";; + short | recursive ) echo "Configuration of motion trunkREV504:";; esac cat <<\_ACEOF @@ -1412,7 +1412,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -motion configure trunkREV502 +motion configure trunkREV504 generated by GNU Autoconf 2.64 Copyright (C) 2009 Free Software Foundation, Inc. @@ -2009,7 +2009,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by motion $as_me trunkREV502, which was +It was created by motion $as_me trunkREV504, which was generated by GNU Autoconf 2.64. Invocation command line was $ $0 $@ @@ -5790,7 +5790,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by motion $as_me trunkREV502, which was +This file was extended by motion $as_me trunkREV504, which was generated by GNU Autoconf 2.64. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -5850,7 +5850,7 @@ Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_version="\\ -motion config.status trunkREV502 +motion config.status trunkREV504 configured by $0, generated by GNU Autoconf 2.64, with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" diff --git a/ffmpeg.c b/ffmpeg.c index 72d1f5b..606e5e2 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -253,7 +253,7 @@ static int mpeg1_write_trailer(AVFormatContext *s) void ffmpeg_init() { MOTION_LOG(ERR, TYPE_ENCODER, NO_ERRNO, "%s: ffmpeg LIBAVCODEC_BUILD %d" - " LIBAVFORMAT_BUILD %d", LIBAVCODEC_BUILD, LIBAVFORMAT_BUILD); + " LIBAVFORMAT_BUILD %d", LIBAVCODEC_BUILD, LIBAVFORMAT_BUILD); av_register_all(); #if LIBAVCODEC_BUILD > 4680 diff --git a/jpegutils.c b/jpegutils.c index e458d5c..b44daa8 100644 --- a/jpegutils.c +++ b/jpegutils.c @@ -820,7 +820,7 @@ int decode_jpeg_gray_raw(unsigned char *jpeg_data, int len, numfields = 2; } else { MOTION_LOG(ERR, TYPE_ALL, NO_ERRNO, "%s: Read JPEG: requested height = %d, " - "height of image = %d", height, dinfo.output_height); + "height of image = %d", height, dinfo.output_height); goto ERR_EXIT; } @@ -1089,7 +1089,7 @@ int encode_jpeg_raw(unsigned char *jpeg_data, int len, int quality, if ((width > 4096) || (height > 4096)) { MOTION_LOG(ERR, TYPE_ALL, NO_ERRNO, "%s: Image dimensions (%dx%d) exceed" - " lavtools' max (4096x4096)", width, height); + " lavtools' max (4096x4096)", width, height); goto ERR_EXIT; } diff --git a/logger.c b/logger.c index afa6f1c..ee39685 100644 --- a/logger.c +++ b/logger.c @@ -188,7 +188,7 @@ void motion_log(int level, unsigned int type, int errno_flag, const char *fmt, . /* * Prefix the message with the log level string, log type string, - * time and thread number. i.ex [1] [ERR] [ENC] [Apr 03 00:08:44] blah + * time and thread number. e.g. [1] [ERR] [ENC] [Apr 03 00:08:44] blah * */ if (!log_mode) { @@ -198,17 +198,17 @@ void motion_log(int level, unsigned int type, int errno_flag, const char *fmt, . } else { /* * Prefix the message with the log level string, log type string - * and thread number. i.ex [1] [DBG] [TRK] blah + * and thread number. e.g. [1] [DBG] [TRK] blah */ n = snprintf(buf, sizeof(buf), "[%d] [%s] [%s] ", threadnr, get_log_level_str(level), get_log_type_str(type)); } - /* Next add the user's message */ + /* Next add the user's message. */ va_start(ap, fmt); n += vsnprintf(buf + n, sizeof(buf) - n, fmt, ap); - /* If errno_flag is set, add on the library error message */ + /* If errno_flag is set, add on the library error message. */ if (errno_flag) { strncat(buf, ": ", 1024 - strlen(buf)); n += 2; @@ -237,7 +237,7 @@ void motion_log(int level, unsigned int type, int errno_flag, const char *fmt, . fputs(buf, logfile); fflush(logfile); - /* If log_mode, send the message to the syslog */ + /* If log_mode, send the message to the syslog. */ } else { syslog(level, "%s", buf); strncat(buf, "\n", 1024 - strlen(buf)); @@ -245,7 +245,7 @@ void motion_log(int level, unsigned int type, int errno_flag, const char *fmt, . fflush(stderr); } - /* Clean up the argument list routine */ + /* Clean up the argument list routine. */ va_end(ap); } diff --git a/motion.1 b/motion.1 index 75baa57..6d12d13 100644 --- a/motion.1 +++ b/motion.1 @@ -116,7 +116,7 @@ Values: Max 4095 characters / Default: Not defined .br pipe raw video to generally - 'STDIN', allowing to use an external video encoder. .br -i.ex with memcoder : +e.g. using memcoder : .br extpipe mencoder -demuxer rawvideo -rawvideo w=320:h=240:i420 -ovc x264 -x264encopts bframes=4:frameref=1:subq=1:scenecut=-1:nob_adapt: threads=1:keyint=1000:8x8dct:vbv_bufsize=4000:crf=24:partitions=i8x8,i4x4:vbv_maxrate=800:no-chroma-me -vf denoise3d=16:12:48:4,pp=lb -of avi -o %f.avi - -fps %fps .TP diff --git a/motion.c b/motion.c index 75a6235..5628488 100644 --- a/motion.c +++ b/motion.c @@ -2505,8 +2505,8 @@ static void setup_signals(struct sigaction *sig_handler_action, struct sigaction sigaction(SIGCHLD, sigchild_action, NULL); sigaction(SIGPIPE, sigchild_action, NULL); sigaction(SIGALRM, sig_handler_action, NULL); - sigaction(SIGHUP, sig_handler_action, NULL); - sigaction(SIGINT, sig_handler_action, NULL); + sigaction(SIGHUP, sig_handler_action, NULL); + sigaction(SIGINT, sig_handler_action, NULL); sigaction(SIGQUIT, sig_handler_action, NULL); sigaction(SIGTERM, sig_handler_action, NULL); sigaction(SIGUSR1, sig_handler_action, NULL); @@ -2732,7 +2732,7 @@ int main (int argc, char **argv) if (cnt_list[i]->watchdog == 0) { MOTION_LOG(ERR, TYPE_ALL, NO_ERRNO, "%s: Thread %d - Watchdog timeout, trying to do " - "a graceful restart", cnt_list[i]->threadnr); + "a graceful restart", cnt_list[i]->threadnr); cnt_list[i]->finish = 1; } diff --git a/netcam.c b/netcam.c index e091ea2..45b8a38 100644 --- a/netcam.c +++ b/netcam.c @@ -1262,7 +1262,7 @@ static int netcam_read_html_jpeg(netcam_context_ptr netcam) MOTION_LOG(NTC, TYPE_NETCAM, NO_ERRNO, "%s: Potential split boundary - " "%d chars flushed, %d " - "re-positioned", ix, + "re-positioned", ix, (int) netcam->response->buffer_left); memmove(netcam->response->buffer, ptr, diff --git a/netcam_jpeg.c b/netcam_jpeg.c index b07fcaa..f4c27db 100644 --- a/netcam_jpeg.c +++ b/netcam_jpeg.c @@ -445,7 +445,7 @@ int netcam_proc_jpeg(netcam_context_ptr netcam, unsigned char *image) * netcam->mutex to do this. */ MOTION_LOG(INF, TYPE_NETCAM, NO_ERRNO, "%s: processing jpeg image" - " - content length %d", netcam->latest->content_length); + " - content length %d", netcam->latest->content_length); ret = netcam_init_jpeg(netcam, &cinfo); @@ -466,7 +466,7 @@ int netcam_proc_jpeg(netcam_context_ptr netcam, unsigned char *image) retval = NETCAM_RESTART_ERROR; MOTION_LOG(ERR, TYPE_NETCAM, NO_ERRNO, "%s: Camera width/height mismatch " "with JPEG image - expected %dx%d, JPEG %dx%d", - " retval %d", netcam->width, netcam->height, + " retval %d", netcam->width, netcam->height, cinfo.output_width, cinfo.output_height, retval); return retval; } diff --git a/picture.c b/picture.c index 219a973..a75eaab 100644 --- a/picture.c +++ b/picture.c @@ -599,15 +599,13 @@ void put_picture(struct context *cnt, char *file, unsigned char *image, int ftyp if (errno == EACCES) { MOTION_LOG(ERR, TYPE_ALL, SHOW_ERRNO, "%s: Can't write picture to file %s - check access rights to target directory\n" - "Thread is going to finish due to this fatal error", - file); + "Thread is going to finish due to this fatal error", file); cnt->finish = 1; cnt->restart = 0; return; } else { /* If target dir is temporarily unavailable we may survive. */ - MOTION_LOG(ERR, TYPE_ALL, SHOW_ERRNO, "%s: Can't write picture to file %s", - file); + MOTION_LOG(ERR, TYPE_ALL, SHOW_ERRNO, "%s: Can't write picture to file %s", file); return; } } diff --git a/rotate.c b/rotate.c index c89b633..793323b 100644 --- a/rotate.c +++ b/rotate.c @@ -239,7 +239,7 @@ void rotate_init(struct context *cnt) */ if ((cnt->conf.rotate_deg % 90) > 0) { MOTION_LOG(ERR, TYPE_ALL, NO_ERRNO, "%s: Config option \"rotate\" not a multiple of 90: %d", - cnt->conf.rotate_deg); + cnt->conf.rotate_deg); cnt->conf.rotate_deg = 0; /* Disable rotation. */ cnt->rotate_data.degrees = 0; /* Force return below. */ } else { diff --git a/track.c b/track.c index 438c110..2f82ebc 100644 --- a/track.c +++ b/track.c @@ -164,7 +164,7 @@ static unsigned int stepper_command(struct context *cnt, unsigned int motor, } -static unsigned int stepper_status(struct context *cnt, unsigned int motor) +static unsigned int stepper_status(struct context *cnt, unsigned int motor) { return stepper_command(cnt, motor, STEPPER_COMMAND_STATUS, 0); } diff --git a/video.c b/video.c index 2ac3a91..37280ea 100644 --- a/video.c +++ b/video.c @@ -426,7 +426,7 @@ void v4l_set_input(struct context *cnt, struct video_dev *viddev, unsigned char if (ioctl (dev, VIDIOCSCHAN, &vid_chnl) == -1) { MOTION_LOG(ERR, TYPE_VIDEO, SHOW_ERRNO, "%s: ioctl (VIDIOCSCHAN) Input %d" - " Standard method %d", input, norm); + " Standard method %d", input, norm); return; } diff --git a/video2.c b/video2.c index e2b27aa..abe486d 100644 --- a/video2.c +++ b/video2.c @@ -30,7 +30,7 @@ * - setting tuner - NOT TESTED * - access to V4L2 device controls is missing. Partially added but requires some improvements likely. * - changing resolution at run-time may not work. - * - ucvideo svn r75 or above to work with MJPEG ( i.ex Logitech 5000 pro ) + * - ucvideo svn r75 or above to work with MJPEG ( e.g. Logitech 5000 pro ) * This work is inspired by fswebcam and current design of motion. * This interface has been tested with ZC0301 driver from kernel 2.6.17.3 and Labtec's usb camera (PAS202 sensor) @@ -204,7 +204,7 @@ static int v4l2_get_capability(src_v4l2_t * vid_source) "cap.driver: \"%s\"\n" "cap.card: \"%s\"\n" "cap.bus_info: \"%s\"\n" - "cap.capabilities=0x%08X\n------------------------", + "cap.capabilities=0x%08X\n------------------------", vid_source->cap.driver, vid_source->cap.card, vid_source->cap.bus_info, vid_source->cap.capabilities); @@ -469,7 +469,7 @@ static int v4l2_set_pix_format(struct context *cnt, src_v4l2_t * vid_source, int } MOTION_LOG(ERR, TYPE_VIDEO, NO_ERRNO, "%s: Using palette %c%c%c%c (%dx%d) bytesperlines %d sizeimage " - "%d colorspace %08x", pixformat >> 0, pixformat >> 8, pixformat >> 16, + "%d colorspace %08x", pixformat >> 0, pixformat >> 8, pixformat >> 16, pixformat >> 24, *width, *height, vid_source->dst_fmt.fmt.pix.bytesperline, vid_source->dst_fmt.fmt.pix.sizeimage, vid_source->dst_fmt.fmt.pix.colorspace); diff --git a/video_freebsd.c b/video_freebsd.c index 153cb35..cd7956b 100644 --- a/video_freebsd.c +++ b/video_freebsd.c @@ -183,7 +183,7 @@ static int set_hue(int viddev, int new_hue) return -1; } - MOTION_LOG(NTC, TYPE_VIDEO, NO_ERRNO, "%s: to [%d]", ioctlval); + MOTION_LOG(NTC, TYPE_VIDEO, NO_ERRNO, "%s: to [%d]", ioctlval); return ioctlval; }