Skip to content

Commit

Permalink
Apply new code standard ( chuck 1 )
Browse files Browse the repository at this point in the history
  • Loading branch information
AngelCarpintero authored and AngelCarpintero committed Jul 16, 2008
1 parent 7474948 commit 623085d
Show file tree
Hide file tree
Showing 17 changed files with 917 additions and 866 deletions.
35 changes: 35 additions & 0 deletions CODE_STANDARD
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ if ((picture=fopen(cnt->conf.mask_file, "r"))) {


BAD EXAMPLE (even though Kenneth loves this one personally)

if ((picture=fopen(cnt->conf.mask_file, "r")))
{
cnt->imgs.mask=get_pgm(cnt, picture, cnt->imgs.width, cnt->imgs.height);
Expand All @@ -129,6 +130,40 @@ else
printf("Hello world\n");
}



GOOD EXAMPLE

switch (expr) {
case ABC:
case DEF:
statement;
break;
case UVW:
statement;
break;
default:
/* default case */
statement;
}

BAD EXAMPLE

switch (expr) {
case ABC:
case DEF:
statement;
break;
case UVW:
statement;
break;
default:
/* default case */
statement;
}



--------------------
RULE 6
Whitespace.
Expand Down
238 changes: 119 additions & 119 deletions conf.h
Original file line number Diff line number Diff line change
@@ -1,126 +1,126 @@
/*
**
** conf.h - function prototypes for the config handling routines
**
** Originally written for the dproxy package by Matthew Pratt.
**
** Copyright 2000 Jeroen Vreeken ([email protected])
**
** This software is licensed under the terms of the GNU General
** Public License (GPL). Please see the file COPYING for details.
**
**
*/
*
* conf.h - function prototypes for the config handling routines
*
* Originally written for the dproxy package by Matthew Pratt.
*
* Copyright 2000 Jeroen Vreeken ([email protected])
*
* This software is licensed under the terms of the GNU General
* Public License (GPL). Please see the file COPYING for details.
*
*
*/

#ifndef _INCLUDE_CONF_H
#define _INCLUDE_CONF_H

/*
more parameters may be added later.
more parameters may be added later.
*/
struct config {
int setup_mode;
int width;
int height;
int quality;
int rotate_deg;
int max_changes;
int threshold_tune;
const char *output_pictures;
int motion_img;
int emulate_motion;
int event_gap;
int max_movie_time;
int snapshot_interval;
const char *locate_motion;
int input;
int norm;
int frame_limit;
int quiet;
const char *picture_type;
int noise;
int noise_tune;
int minimum_frame_time;
int lightswitch;
int autobright;
int brightness;
int contrast;
int saturation;
int hue;
int roundrobin_frames;
int roundrobin_skip;
int pre_capture;
int post_capture;
int switchfilter;
int ffmpeg_output;
int ffmpeg_output_debug;
int ffmpeg_bps;
int ffmpeg_vbr;
int ffmpeg_deinterlace;
const char *ffmpeg_video_codec;
int stream_port;
int stream_quality;
int stream_motion;
int stream_maxrate;
int stream_localhost;
int stream_limit;
int webcontrol_port;
int webcontrol_localhost;
int webcontrol_html_output;
const char *webcontrol_authentication;
unsigned long frequency;
int tuner_number;
int timelapse;
const char *timelapse_mode;
int setup_mode;
int width;
int height;
int quality;
int rotate_deg;
int max_changes;
int threshold_tune;
const char *output_pictures;
int motion_img;
int emulate_motion;
int event_gap;
int max_movie_time;
int snapshot_interval;
const char *locate_motion;
int input;
int norm;
int frame_limit;
int quiet;
const char *picture_type;
int noise;
int noise_tune;
int minimum_frame_time;
int lightswitch;
int autobright;
int brightness;
int contrast;
int saturation;
int hue;
int roundrobin_frames;
int roundrobin_skip;
int pre_capture;
int post_capture;
int switchfilter;
int ffmpeg_output;
int ffmpeg_output_debug;
int ffmpeg_bps;
int ffmpeg_vbr;
int ffmpeg_deinterlace;
const char *ffmpeg_video_codec;
int stream_port;
int stream_quality;
int stream_motion;
int stream_maxrate;
int stream_localhost;
int stream_limit;
int webcontrol_port;
int webcontrol_localhost;
int webcontrol_html_output;
const char *webcontrol_authentication;
unsigned long frequency;
int tuner_number;
int timelapse;
const char *timelapse_mode;
#if (defined(BSD))
const char *tuner_device;
const char *tuner_device;
#endif
const char *video_device;
short unsigned int v4l2_palette;
const char *vidpipe;
const char *filepath;
const char *imagepath;
const char *moviepath;
const char *snappath;
const char *timepath;
char *on_event_start;
char *on_event_end;
const char *mask_file;
int smart_mask_speed;
int sql_log_image;
int sql_log_snapshot;
int sql_log_movie;
int sql_log_timelapse;
const char *sql_query;
const char *database_type;
const char *database_dbname;
const char *database_host;
const char *database_user;
const char *database_password;
int database_port;
char *on_picture_save;
char *on_area_detected;
char *on_motion_detected;
char *on_movie_start;
char *on_movie_end;
char *on_camera_lost;
const char *motionvidpipe;
const char *netcam_url;
const char *netcam_userpass;
const char *netcam_keepalive;
const char *netcam_proxy;
unsigned int netcam_broken;
int text_changes;
const char *text_left;
const char *text_right;
const char *text_event;
int text_double;
const char *despeckle_filter;
const char *area_detect;
int minimum_motion_frames;
char *pid_file;
int argc;
char **argv;
const char *video_device;
short unsigned int v4l2_palette;
const char *vidpipe;
const char *filepath;
const char *imagepath;
const char *moviepath;
const char *snappath;
const char *timepath;
char *on_event_start;
char *on_event_end;
const char *mask_file;
int smart_mask_speed;
int sql_log_image;
int sql_log_snapshot;
int sql_log_movie;
int sql_log_timelapse;
const char *sql_query;
const char *database_type;
const char *database_dbname;
const char *database_host;
const char *database_user;
const char *database_password;
int database_port;
char *on_picture_save;
char *on_area_detected;
char *on_motion_detected;
char *on_movie_start;
char *on_movie_end;
char *on_camera_lost;
const char *motionvidpipe;
const char *netcam_url;
const char *netcam_userpass;
const char *netcam_keepalive;
const char *netcam_proxy;
unsigned int netcam_broken;
int text_changes;
const char *text_left;
const char *text_right;
const char *text_event;
int text_double;
const char *despeckle_filter;
const char *area_detect;
int minimum_motion_frames;
char *pid_file;
int argc;
char **argv;
};

/**
Expand All @@ -133,12 +133,12 @@ typedef const char *(* conf_print_func)(struct context **, char **, int, unsigne
* description for parameters in the config file
*/
typedef struct {
const char *param_name; /* name for this parameter */
const char *param_help; /* short explanation for parameter */
unsigned short int main_thread; /* belong only to main thread when value>0 */
int conf_value; /* pointer to a field in struct context */
conf_copy_func copy; /* a function to set the value in 'config' */
conf_print_func print; /* a function to output the value to a file */
const char *param_name; /* name for this parameter */
const char *param_help; /* short explanation for parameter */
unsigned short int main_thread; /* belong only to main thread when value>0 */
int conf_value; /* pointer to a field in struct context */
conf_copy_func copy; /* a function to set the value in 'config' */
conf_print_func print; /* a function to output the value to a file */
} config_param;


Expand Down
18 changes: 9 additions & 9 deletions configure
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.61 for motion trunk-r375.
# Generated by GNU Autoconf 2.61 for motion trunk-r380.
#
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
Expand Down Expand Up @@ -572,8 +572,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='motion'
PACKAGE_TARNAME='motion'
PACKAGE_VERSION='trunk-r375'
PACKAGE_STRING='motion trunk-r375'
PACKAGE_VERSION='trunk-r380'
PACKAGE_STRING='motion trunk-r380'
PACKAGE_BUGREPORT=''

ac_unique_file="motion.c"
Expand Down Expand Up @@ -1177,7 +1177,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 trunk-r375 to adapt to many kinds of systems.
\`configure' configures motion trunk-r380 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
Expand Down Expand Up @@ -1238,7 +1238,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of motion trunk-r375:";;
short | recursive ) echo "Configuration of motion trunk-r380:";;
esac
cat <<\_ACEOF
Expand Down Expand Up @@ -1374,7 +1374,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
motion configure trunk-r375
motion configure trunk-r380
generated by GNU Autoconf 2.61
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
Expand All @@ -1388,7 +1388,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 trunk-r375, which was
It was created by motion $as_me trunk-r380, which was
generated by GNU Autoconf 2.61. Invocation command line was
$ $0 $@
Expand Down Expand Up @@ -8666,7 +8666,7 @@ exec 6>&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 trunk-r375, which was
This file was extended by motion $as_me trunk-r380, which was
generated by GNU Autoconf 2.61. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -8715,7 +8715,7 @@ Report bugs to <[email protected]>."
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
motion config.status trunk-r375
motion config.status trunk-r380
configured by $0, generated by GNU Autoconf 2.61,
with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
Expand Down
Loading

0 comments on commit 623085d

Please sign in to comment.