From 55f6f7d0463ddbc4df3d10344096f36d4ee49faa Mon Sep 17 00:00:00 2001 From: MrDave Date: Mon, 22 Mar 2021 17:17:36 -0600 Subject: [PATCH] Add variable names to functions in headers --- src/alg.hpp | 9 ++++----- src/draw.hpp | 7 +++---- src/event.hpp | 3 ++- src/exif.hpp | 4 +++- src/jpegutils.hpp | 11 +++++++---- src/util.hpp | 18 ++++++++++-------- 6 files changed, 29 insertions(+), 23 deletions(-) diff --git a/src/alg.hpp b/src/alg.hpp index 657388c4..8f526e14 100644 --- a/src/alg.hpp +++ b/src/alg.hpp @@ -22,15 +22,14 @@ struct ctx_coord; - void alg_locate_center_size(struct ctx_images *, int width, int height, struct ctx_coord *); + void alg_locate_center_size(struct ctx_images *imgs, int width, int height, struct ctx_coord *cent); void alg_diff(struct ctx_cam *cam); void alg_lightswitch(struct ctx_cam *cam); - void alg_noise_tune(struct ctx_cam *cam, unsigned char *); - void alg_threshold_tune(struct ctx_cam *cam, int, int); + void alg_noise_tune(struct ctx_cam *cam, unsigned char *new_var); + void alg_threshold_tune(struct ctx_cam *cam, int diffs, int motion); void alg_despeckle(struct ctx_cam *cam); void alg_tune_smartmask(struct ctx_cam *cam); - void alg_update_reference_frame(struct ctx_cam *cam, int); - + void alg_update_reference_frame(struct ctx_cam *cam, int action); void alg_new_update_frame(ctx_cam *cam); void alg_new_diff(ctx_cam *cam); diff --git a/src/draw.hpp b/src/draw.hpp index 88ee8890..c73638ba 100644 --- a/src/draw.hpp +++ b/src/draw.hpp @@ -21,7 +21,6 @@ #ifndef _INCLUDE_DRAW_H_ #define _INCLUDE_DRAW_H_ -/* date/time drawing, draw.c */ int draw_text(unsigned char *image, int width, int height, int startx, int starty, @@ -31,8 +30,8 @@ void draw_locate_preview(struct ctx_cam *cam, struct ctx_image_data *img); void draw_locate(struct ctx_cam *cam, struct ctx_image_data *img); - void draw_smartmask(struct ctx_cam *cam, unsigned char *); - void draw_fixed_mask(struct ctx_cam *cam, unsigned char *); - void draw_largest_label(struct ctx_cam *cam, unsigned char *); + void draw_smartmask(struct ctx_cam *cam, unsigned char *out); + void draw_fixed_mask(struct ctx_cam *cam, unsigned char *out); + void draw_largest_label(struct ctx_cam *cam, unsigned char *out); #endif \ No newline at end of file diff --git a/src/event.hpp b/src/event.hpp index 45805c85..f196ca1b 100644 --- a/src/event.hpp +++ b/src/event.hpp @@ -47,7 +47,8 @@ typedef enum { typedef void(* event_handler)(struct ctx_cam *cam, motion_event, struct ctx_image_data *, char *, void *, struct timespec *); -void event(struct ctx_cam *cam, motion_event, struct ctx_image_data *img_data, char *, void *, struct timespec *); +void event(struct ctx_cam *cam, motion_event evnt + ,struct ctx_image_data *img_data, char *fname,void *ftype, struct timespec *ts1); const char * imageext(struct ctx_cam *cam); #endif /* _INCLUDE_EVENT_H_ */ diff --git a/src/exif.hpp b/src/exif.hpp index 914870d2..715b13b7 100644 --- a/src/exif.hpp +++ b/src/exif.hpp @@ -24,5 +24,7 @@ #ifndef _INCLUDE_EXIF_H_ #define _INCLUDE_EXIF_H_ - unsigned exif_prepare(unsigned char **, const struct ctx_cam *cam, const struct timespec *, const struct ctx_coord *); + unsigned exif_prepare(unsigned char **exif, const struct ctx_cam *cam, + const struct timespec *ts_in1, const struct ctx_coord *box); + #endif \ No newline at end of file diff --git a/src/jpegutils.hpp b/src/jpegutils.hpp index 7b4c70c8..107c2194 100644 --- a/src/jpegutils.hpp +++ b/src/jpegutils.hpp @@ -23,9 +23,12 @@ #define __JPEGUTILS_H__ int jpgutl_decode_jpeg (unsigned char *jpeg_data_in, int jpeg_data_len, - unsigned int width, unsigned int height, unsigned char *volatile img_out); - - int jpgutl_put_yuv420p(unsigned char *, int image, unsigned char *, int, int, int, struct ctx_cam *cam, struct timespec *, struct ctx_coord *); - int jpgutl_put_grey(unsigned char *, int image, unsigned char *, int, int, int, struct ctx_cam *cam, struct timespec *, struct ctx_coord *); + unsigned int width, unsigned int height, unsigned char *volatile img_out); + int jpgutl_put_yuv420p(unsigned char *dest_image, int image_size, + unsigned char *input_image, int width, int height, int quality, + struct ctx_cam *cam, struct timespec *ts1, struct ctx_coord *box); + int jpgutl_put_grey(unsigned char *dest_image, int image_size, + unsigned char *input_image, int width, int height, int quality, + struct ctx_cam *cam, struct timespec *ts1, struct ctx_coord *box); #endif diff --git a/src/util.hpp b/src/util.hpp index 5a980404..736805d1 100644 --- a/src/util.hpp +++ b/src/util.hpp @@ -93,12 +93,14 @@ typedef int mhdrslt; /* Version independent return result from MHD */ #endif - void * mymalloc(size_t); - void * myrealloc(void *, size_t, const char *); - FILE * myfopen(const char *, const char *); - int myfclose(FILE *); - size_t mystrftime(const struct ctx_cam *, char *, size_t, const char *, const struct timespec *, const char *, int); - int mycreate_path(const char *); + + void *mymalloc(size_t nbytes); + void *myrealloc(void *ptr, size_t size, const char *desc); + int mycreate_path(const char *path); + FILE *myfopen(const char *path, const char *mode); + int myfclose(FILE *fh); + size_t mystrftime(const struct ctx_cam *cam, char *s, size_t max, const char *userformat, + const struct timespec *ts1, const char *filename, int sqltype); void util_exec_command(struct ctx_cam *cam, const char *command, char *filename, int filetype); void mythreadname_set(const char *abbr, int threadnbr, const char *threadname); @@ -112,8 +114,8 @@ int mystrcne(const char* var1, const char* var2); int mystreq(const char* var1, const char* var2); int mystrne(const char* var1, const char* var2); - char *mystrdup(const char *); - char *mystrcpy(char *, const char *); + char *mystrdup(const char *from); + char *mystrcpy(char *to, const char *from); void myltrim(std::string &parm); void myrtrim(std::string &parm); void mytrim(std::string &parm);