From 06784a31ca9c59aa409a852ce3cf92c5279699b7 Mon Sep 17 00:00:00 2001 From: Justin Maggard Date: Thu, 19 Mar 2009 21:42:13 +0000 Subject: [PATCH] * Initialize some variables. --- Makefile | 2 +- image_utils.c | 2 +- inotify.c | 6 +++--- minidlna.c | 2 +- scanner.c | 5 +++-- tivo_utils.c | 2 +- 6 files changed, 10 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index aec7597..5cc4162 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ # #CFLAGS = -Wall -O -D_GNU_SOURCE -g -DDEBUG #CFLAGS = -Wall -g -Os -D_GNU_SOURCE -CFLAGS = -Wall -g -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 \ +CFLAGS = -Wall -g -O3 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 \ -I/usr/include/ffmpeg \ -I/usr/include/libavutil -I/usr/include/libavcodec -I/usr/include/libavformat \ -I/usr/include/ffmpeg/libavutil -I/usr/include/ffmpeg/libavcodec -I/usr/include/ffmpeg/libavformat diff --git a/image_utils.c b/image_utils.c index 7e208e4..8230ef8 100644 --- a/image_utils.c +++ b/image_utils.c @@ -235,7 +235,7 @@ image * image_new_from_jpeg(const char * path, int is_file, const char * buf, int size) { image *vimage; - FILE *file; + FILE *file = NULL; struct jpeg_decompress_struct cinfo; unsigned char *line[16], *ptr; int x, y, i, w, h, ofs; diff --git a/inotify.c b/inotify.c index 7257fa4..1ff1c73 100644 --- a/inotify.c +++ b/inotify.c @@ -262,7 +262,7 @@ inotify_insert_file(char * name, const char * path) char * base_name = malloc(strlen(path)); char * base_copy = base_name; char * parent_buf = NULL; - char * id; + char * id = NULL; int depth = 1; /* If it's already in the database, just skip it for now. @@ -345,7 +345,7 @@ inotify_insert_directory(int fd, char *name, const char * path) struct dirent * e; char * sql; char **result; - char *id, *path_buf, *parent_buf, *esc_name; + char *id=NULL, *path_buf, *parent_buf, *esc_name; int wd; int rows, i = 0; @@ -537,7 +537,7 @@ start_inotify() char * esc_name = NULL; char * path_buf = NULL; - if (setpriority(PRIO_PROCESS, 0, 15) == -1) + if (setpriority(PRIO_PROCESS, 0, 19) == -1) DPRINTF(E_WARN, L_INOTIFY, "Failed to reduce inotify thread priority\n"); fd = inotify_init(); diff --git a/minidlna.c b/minidlna.c index 03633b3..77c7e34 100644 --- a/minidlna.c +++ b/minidlna.c @@ -596,7 +596,7 @@ main(int argc, char * * argv) int last_changecnt = 0; #ifdef TIVO_SUPPORT unsigned short int loop_cnt = 0; - int sbeacon; + int sbeacon = -1; struct sockaddr_in tivo_bcast; #endif char * sql; diff --git a/scanner.c b/scanner.c index 0bcaba8..e31c9a3 100644 --- a/scanner.c +++ b/scanner.c @@ -385,7 +385,7 @@ insert_directory(const char * name, const char * path, const char * base, const { char * sql; int ret, rows, found = 0; - sqlite_int64 detailID; + sqlite_int64 detailID = 0; char * refID = NULL; char class[] = "container.storageFolder"; char * id_buf = NULL; @@ -696,7 +696,7 @@ void ScanDirectory(const char * dir, const char * parent, enum media_types type) { struct dirent **namelist; - int n, i, startID = 0; + int i, n, startID=0; char parent_id[PATH_MAX]; char full_path[PATH_MAX]; char * name = NULL; @@ -722,6 +722,7 @@ ScanDirectory(const char * dir, const char * parent, enum media_types type) n = scandir(".", &namelist, filter_images, alphasort); break; default: + n = -1; break; } if (n < 0) { diff --git a/tivo_utils.c b/tivo_utils.c index 5c171c6..7ed3f60 100644 --- a/tivo_utils.c +++ b/tivo_utils.c @@ -31,7 +31,7 @@ decodeString(char * string, int inplace) if( !string ) return NULL; int alloc = (int)strlen(string)+1; - char *ns; + char * ns = NULL; unsigned char in; int strindex=0; long hex;