diff options
author | lippe <lippe@FreeBSD.org> | 2013-03-20 04:26:47 +0800 |
---|---|---|
committer | lippe <lippe@FreeBSD.org> | 2013-03-20 04:26:47 +0800 |
commit | 69c0324dd633f7e74d52647f0f4ff77ca4618f70 (patch) | |
tree | c9e1ed26b540fe35d5e469b02d6843fbc9300ed1 | |
parent | c8eb2479d1c6d6106b9ba1cd4d6cd7cd9b8a9a4b (diff) | |
download | freebsd-ports-gnome-69c0324dd633f7e74d52647f0f4ff77ca4618f70.tar.gz freebsd-ports-gnome-69c0324dd633f7e74d52647f0f4ff77ca4618f70.tar.zst freebsd-ports-gnome-69c0324dd633f7e74d52647f0f4ff77ca4618f70.zip |
- Update to 1.0.25.
- Pass maintainership to submitter.
PR: ports/176327
Submitted by: William Grzybowski <william88@gmail.com>
Approved by: Mikhail T. <mi@aldan.algebra.com>
-rw-r--r-- | net/minidlna/Makefile | 5 | ||||
-rw-r--r-- | net/minidlna/distinfo | 4 | ||||
-rw-r--r-- | net/minidlna/files/BSDmakefile | 2 | ||||
-rw-r--r-- | net/minidlna/files/getifaddr.c | 70 | ||||
-rw-r--r-- | net/minidlna/files/patch-type-mismatch | 52 | ||||
-rw-r--r-- | net/minidlna/files/patch-utils-mpo | 11 | ||||
-rw-r--r-- | net/minidlna/files/patch-warnings | 930 |
7 files changed, 600 insertions, 474 deletions
diff --git a/net/minidlna/Makefile b/net/minidlna/Makefile index 2df093c6bea7..eeb0dd605a5c 100644 --- a/net/minidlna/Makefile +++ b/net/minidlna/Makefile @@ -2,14 +2,13 @@ # $FreeBSD$ PORTNAME= minidlna -PORTVERSION= 1.0.24 -PORTREVISION= 3 +PORTVERSION= 1.0.25 PORTEPOCH= 1 CATEGORIES= net multimedia www MASTER_SITES= SF DISTFILES= ${PORTNAME}_${PORTVERSION}_src.tar.gz -MAINTAINER= mi@aldan.algebra.com +MAINTAINER= william88@gmail.com COMMENT= Media-server compatible with "Digital Life Network Alliance" LIB_DEPENDS= sqlite3:${PORTSDIR}/databases/sqlite3 \ diff --git a/net/minidlna/distinfo b/net/minidlna/distinfo index 882132c55ef0..5fd03fd99de2 100644 --- a/net/minidlna/distinfo +++ b/net/minidlna/distinfo @@ -1,2 +1,2 @@ -SHA256 (minidlna_1.0.24_src.tar.gz) = 840ac2303c23d63066912750391d1ebef7761b5b23493e590624a17670ceb942 -SIZE (minidlna_1.0.24_src.tar.gz) = 210775 +SHA256 (minidlna_1.0.25_src.tar.gz) = 170560fbe042c2bbcba78c5f15b54f4fac321ff770490b23b55789be463f2851 +SIZE (minidlna_1.0.25_src.tar.gz) = 211756 diff --git a/net/minidlna/files/BSDmakefile b/net/minidlna/files/BSDmakefile index cbe8e6e97cf3..14b2646e1122 100644 --- a/net/minidlna/files/BSDmakefile +++ b/net/minidlna/files/BSDmakefile @@ -4,7 +4,7 @@ NO_MAN= Ha-ha... OS!= uname VERS!= uname -r -CFLAGS+=-I${FILESDIR} -I${.CURDIR} -I${LOCALBASE}/include -I${LOCALBASE}/include/ffmpeg +CFLAGS=-I${FILESDIR} -I${.CURDIR} -I${LOCALBASE}/include -I${LOCALBASE}/include/ffmpeg CFLAGS+=-I${LOCALBASE}/include/libavutil CFLAGS+=-DPREFIX='"${PREFIX}"' -DOS='"${OS}"' -DOSVERSION='"${VERS}"' CFLAGS+=-Wformat -Wunused -Wall diff --git a/net/minidlna/files/getifaddr.c b/net/minidlna/files/getifaddr.c index ef54cf957f8a..c87415271d79 100644 --- a/net/minidlna/files/getifaddr.c +++ b/net/minidlna/files/getifaddr.c @@ -6,6 +6,7 @@ * All rights reserved. * * Adapted to BSD by jayp and Mikhail T. -- 2010 + * William Grzybowski -- 2013 * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -55,6 +56,7 @@ #include <sys/param.h> #include <net/if_dl.h> +#include "upnpglobalvars.h" #include "getifaddr.h" #include "log.h" @@ -91,40 +93,6 @@ getifaddr(const char * ifname, char * buf, int len) return 0; } -int -getsysaddr(char * buf, int len) -{ - int rv=-1; - struct ifaddrs *ifap = NULL; - struct ifaddrs *ifnr; - - if (getifaddrs(&ifap) != 0) - err(1, "getifaddrs"); - - for (ifnr = ifap; ifnr != NULL; ifnr = ifnr->ifa_next) { - if (ifnr->ifa_addr->sa_family == AF_INET) { - struct sockaddr_in *addr_in = - (struct sockaddr_in *)ifnr->ifa_addr; - - unsigned a = - (htonl(addr_in->sin_addr.s_addr) >> 0x18) & 0xFF; - - if (a==127) - continue; - - if(!inet_ntop(AF_INET, &addr_in->sin_addr, buf, len)) { - warn("inet_ntop()"); - break; - } - rv=0; - break; - } - rv=0; - } - freeifaddrs(ifap); - return rv; -} - static int getsysifname(char * buf, size_t len) { @@ -242,3 +210,37 @@ get_remote_mac(struct in_addr ip_addr, unsigned char *mac) free(buf); return !found_entry; } + + +int +getsysaddrs(void) +{ + struct sockaddr_in *addr; + struct ifaddrs *ifap, *ifa; + + getifaddrs(&ifap); + for(ifa=ifap;ifa;ifa=ifa->ifa_next) { + if(ifa->ifa_addr == NULL || ifa->ifa_netmask == NULL) + continue; + + addr = (struct sockaddr_in *) ifa->ifa_addr; + if(addr->sin_family != AF_INET) + continue; + + memcpy(&lan_addr[n_lan_addr].addr, (void *) &addr->sin_addr, sizeof(lan_addr[n_lan_addr].addr)); + if( !inet_ntop(AF_INET, (void *) &addr->sin_addr, lan_addr[n_lan_addr].str, sizeof(lan_addr[0].str)) ) + { + DPRINTF(E_ERROR, L_GENERAL, "inet_ntop(): %s\n", strerror(errno)); + continue; + } + + addr = (struct sockaddr_in *) ifa->ifa_netmask; + memcpy(&lan_addr[n_lan_addr].mask, (void *) &addr->sin_addr, sizeof(lan_addr[n_lan_addr].mask)); + n_lan_addr++; + if (n_lan_addr >= MAX_LAN_ADDR) + break; + } + freeifaddrs(ifap); + + return(n_lan_addr); +} diff --git a/net/minidlna/files/patch-type-mismatch b/net/minidlna/files/patch-type-mismatch new file mode 100644 index 000000000000..de028f04b8c0 --- /dev/null +++ b/net/minidlna/files/patch-type-mismatch @@ -0,0 +1,52 @@ +diff --git log.c log.c +index 91aa564..3f3b503 100644 +--- log.c ++++ log.c +@@ -63,14 +63,14 @@ log_init(const char *fname, const char *debug) + if (debug) + { + const char *rhs, *lhs, *nlhs, *p; +- int n; ++ size_t n; + int level, facility; + memset(&log_level_set, 0, sizeof(log_level_set)); + rhs = nlhs = debug; + while (rhs && (rhs = strchr(rhs, '='))) { + rhs++; + p = strchr(rhs, ','); +- n = p ? p - rhs : strlen(rhs); ++ n = p ? (size_t) (p - rhs) : strlen(rhs); + for (level=0; level_name[level]; level++) { + if (!(strncasecmp(level_name[level], rhs, n))) + break; +@@ -84,7 +84,7 @@ log_init(const char *fname, const char *debug) + do { + if (*lhs==',') lhs++; + p = strpbrk(lhs, ",="); +- n = p ? p - lhs : strlen(lhs); ++ n = p ? (size_t) (p - lhs) : strlen(lhs); + for (facility=0; facility_name[facility]; facility++) { + if (!(strncasecmp(facility_name[facility], lhs, n))) + break; +diff --git tagutils/tagutils-wav.c tagutils/tagutils-wav.c +index 956eef7..f2e397e 100644 +--- tagutils/tagutils-wav.c ++++ tagutils/tagutils-wav.c +@@ -33,7 +33,7 @@ static int + _get_wavtags(char *filename, struct song_metadata *psong) + { + int fd; +- uint32_t len; ++ ssize_t len; + unsigned char hdr[12]; + unsigned char fmt[16]; + //uint32_t chunk_data_length; +@@ -47,7 +47,7 @@ _get_wavtags(char *filename, struct song_metadata *psong) + uint32_t sec, ms; + + uint32_t current_offset; +- uint32_t block_len; ++ int32_t block_len; + + //DEBUG DPRINTF(E_DEBUG,L_SCANNER,"Getting WAV file info\n"); + diff --git a/net/minidlna/files/patch-utils-mpo b/net/minidlna/files/patch-utils-mpo index 0a5221b424a7..870dcfd699a2 100644 --- a/net/minidlna/files/patch-utils-mpo +++ b/net/minidlna/files/patch-utils-mpo @@ -1,15 +1,16 @@ Submitted by Vladimir B. Grebenschikov this patch recognizes Samsung's images as JPEGs. ---- utils.c 2012-01-04 14:16:46.000000000 +0000 -+++ utils.c 2012-01-09 00:29:31.000000000 +0000 -@@ -261,7 +261,8 @@ +diff --git utils.c utils.c +index 36ff168..5a7ff87 100644 +--- utils.c ++++ utils.c +@@ -324,7 +324,7 @@ is_audio(const char * file) int is_image(const char * file) { - return (ends_with(file, ".jpg") || ends_with(file, ".jpeg")); -+ return (ends_with(file, ".jpg") || ends_with(file, ".jpeg") || -+ ends_with(file, ".mpo")); ++ return (ends_with(file, ".jpg") || ends_with(file, ".jpeg") || ends_with(file, ".mpo")); } int diff --git a/net/minidlna/files/patch-warnings b/net/minidlna/files/patch-warnings index a3038bbc7b7a..55da4ab49614 100644 --- a/net/minidlna/files/patch-warnings +++ b/net/minidlna/files/patch-warnings @@ -1,153 +1,133 @@ ---- albumart.c 2012-02-10 18:37:22.000000000 -0500 -+++ albumart.c 2012-04-10 11:54:08.000000000 -0400 -@@ -26,4 +26,5 @@ - #include <setjmp.h> - #include <errno.h> -+#include <limits.h> - - #include <jpeglib.h> -@@ -157,5 +158,5 @@ +diff --git albumart.c albumart.c +index 54899c6..6cc6192 100644 +--- albumart.c ++++ albumart.c +@@ -156,7 +156,7 @@ update_if_album_art(const char *path) + closedir(dh); } -char * +static char * check_embedded_art(const char *path, const char *image_data, int image_size) { -@@ -218,5 +219,5 @@ + int width = 0, height = 0; +@@ -217,7 +217,7 @@ check_embedded_art(const char *path, const char *image_data, int image_size) + } else if( width > 0 && height > 0 ) { - size_t nwritten; + int nwritten; if( art_cache_exists(path, &art_path) ) goto end_art; ---- image_utils.c 2011-08-22 14:24:18.000000000 -0400 -+++ image_utils.c 2012-04-11 11:50:16.000000000 -0400 -@@ -173,5 +173,5 @@ + cache_dir = strdup(art_path); +diff --git image_utils.c image_utils.c +index ee4fcf3..09330a3 100644 +--- image_utils.c ++++ image_utils.c +@@ -172,7 +172,7 @@ term_source(j_decompress_ptr cinfo) + return; } -void +static void jpeg_memory_src(j_decompress_ptr cinfo, const unsigned char * buffer, size_t bufsize) { -@@ -192,5 +192,5 @@ - } - --jmp_buf setjmp_buffer; -+static jmp_buf setjmp_buffer; - /* Don't exit on error like libjpeg likes to do */ - static void -@@ -209,5 +209,5 @@ + struct my_src_mgr *src; +@@ -208,7 +208,7 @@ image_free(image_s *pimage) + free(pimage); } -pix +static pix get_pix(image_s *pimage, int32_t x, int32_t y) { -@@ -223,5 +223,5 @@ + if((x >= 0) && (y >= 0) && (x < pimage->width) && (y < pimage->height)) +@@ -222,7 +222,7 @@ get_pix(image_s *pimage, int32_t x, int32_t y) + } } -void +static void put_pix_alpha_replace(image_s *pimage, int32_t x, int32_t y, pix col) { -@@ -399,5 +399,5 @@ + if((x >= 0) && (y >= 0) && (x < pimage->width) && (y < pimage->height)) +@@ -398,7 +398,7 @@ image_get_jpeg_date_xmp(const char * path, char ** date) + return ret; } -image_s * +static image_s * image_new(int32_t width, int32_t height) { -@@ -423,6 +423,15 @@ - image_new_from_jpeg(const char * path, int is_file, const char * buf, int size, int scale, int rotate) - { -- image_s *vimage; -- FILE *file = NULL; -+ struct { -+ /* -+ * Using the struct to prevent pointers cached in -+ * in registers and being clobbered by longjmp(). -+ * http://lists.apple.com/archives/xcode-users/2003/Dec/msg00050.html -+ */ -+ image_s *vimage; -+ FILE *file; -+ } s = { NULL, NULL }; -+#define vimage s.vimage -+#define file s.file - struct jpeg_decompress_struct cinfo; - unsigned char *line[16], *ptr; -@@ -562,7 +571,9 @@ - + image_s *vimage; +@@ -563,7 +563,7 @@ image_new_from_jpeg(const char * path, int is_file, const char * buf, int size, return vimage; -+#undef vimage -+#undef file } -void +static void image_upsize(image_s * pdest, image_s * psrc, int32_t width, int32_t height) { -@@ -627,5 +638,5 @@ + int32_t vx, vy; +@@ -626,7 +626,7 @@ image_upsize(image_s * pdest, image_s * psrc, int32_t width, int32_t height) + } } -void +static void image_downsize(image_s * pdest, image_s * psrc, int32_t width, int32_t height) { ---- log.c 2011-06-20 22:08:21.000000000 -0400 -+++ log.c 2012-01-09 17:57:41.000000000 -0500 -@@ -71,5 +71,5 @@ - rhs++; - p = strchr(rhs, ','); -- n = p ? p - rhs : strlen(rhs); -+ n = p ? (size_t)(p - rhs) : strlen(rhs); - for (level=0; level_name[level]; level++) { - if (!(strncasecmp(level_name[level], rhs, n))) -@@ -84,5 +84,5 @@ - if (*lhs==',') lhs++; - p = strpbrk(lhs, ",="); -- n = p ? p - lhs : strlen(lhs); -+ n = p ? (size_t)(p - lhs) : strlen(lhs); - for (facility=0; facility_name[facility]; facility++) { - if (!(strncasecmp(facility_name[facility], lhs, n))) ---- metadata.c 2011-08-22 14:24:19.000000000 -0400 -+++ metadata.c 2012-01-09 18:00:06.000000000 -0500 -@@ -21,5 +21,5 @@ + int32_t vx, vy; +diff --git metadata.c metadata.c +index 39a65ef..0ce2ceb 100644 +--- metadata.c ++++ metadata.c +@@ -21,6 +21,7 @@ #include <stdlib.h> #include <sys/stat.h> -- + +#include <libgen.h> #include <unistd.h> #include <sys/types.h> -@@ -95,5 +95,5 @@ + #include <sys/stat.h> +@@ -118,7 +119,7 @@ lav_close(AVFormatContext *ctx) + } + + #if LIBAVFORMAT_VERSION_INT >= ((52<<16)+(31<<8)+0) +-# if LIBAVUTIL_VERSION_INT < ((51<<16)+(5<<8)+0) ++# if LIBAVUTIL_VERSION_INT < ((51<<16)+(5<<8)+0) && LIBAVUTIL_VERSION_INT < AV_VERSION_INT(50, 43, 0) + #define AV_DICT_IGNORE_SUFFIX AV_METADATA_IGNORE_SUFFIX + #define av_dict_get av_metadata_get + typedef AVMetadataTag AVDictionaryEntry; +@@ -129,7 +130,7 @@ typedef AVMetadataTag AVDictionaryEntry; + #define MPEG_TS_SYNC_CODE 0x47 #define MPEG_TS_PACKET_LENGTH 188 #define MPEG_TS_PACKET_LENGTH_DLNA 192 /* prepends 4 bytes to TS packet */ -int +static int dlna_timestamp_is_present(const char * filename, int * raw_packet_size) { -@@ -188,5 +188,5 @@ + unsigned char buffer[3*MPEG_TS_PACKET_LENGTH_DLNA]; +@@ -222,7 +223,7 @@ no_source_video: + free(file); } -void +static void parse_nfo(const char * path, metadata_t * m) { -@@ -239,5 +239,5 @@ + FILE *nfo; +@@ -273,7 +274,7 @@ parse_nfo(const char * path, metadata_t * m) + fclose(nfo); } -void +static void free_metadata(metadata_t * m, uint32_t flags) { -@@ -507,5 +507,6 @@ - struct jpeg_error_mgr jerr; - FILE *infile; -- int width=0, height=0, thumb=0; -+ int width = 0, height = 0; -+ volatile int thumb = 0; - char make[32], model[64] = {'\0'}; - char b[1024]; -@@ -648,5 +649,6 @@ + if( flags & FLAG_TITLE ) +@@ -712,7 +713,8 @@ sqlite_int64 + GetVideoMetadata(const char * path, char * name) { struct stat file; - int ret, i; @@ -155,208 +135,464 @@ + unsigned i; struct tm *modtime; AVFormatContext *ctx = NULL; ---- minissdp.h 2011-07-22 19:03:38.000000000 -0400 -+++ minissdp.h 2012-01-09 18:03:04.000000000 -0500 -@@ -32,7 +32,5 @@ - /*#include "minidlnatypes.h"*/ - --int --OpenAndConfSSDPReceiveSocket(); --/* OpenAndConfSSDPReceiveSocket(int n_lan_addr, struct lan_addr_s * lan_addr);*/ -+int OpenAndConfSSDPReceiveSocket(void); - - /*int ---- scanner.h 2010-11-11 18:48:13.000000000 -0500 -+++ scanner.h 2012-01-09 18:04:19.000000000 -0500 -@@ -82,5 +82,5 @@ - - void --start_scanner(); -+start_scanner(void); - - #endif ---- minissdp.c 2011-08-24 21:27:56.000000000 -0400 -+++ minissdp.c 2012-01-09 18:15:43.000000000 -0500 -@@ -289,5 +289,6 @@ + AVCodecContext *ac = NULL, *vc = NULL; +diff --git minissdp.c minissdp.c +index 81ae23e..ac492db 100644 +--- minissdp.c ++++ minissdp.c +@@ -292,7 +292,8 @@ SendSSDPNotifies(int s, const char * host, unsigned short port, + unsigned int lifetime) { struct sockaddr_in sockname; - int l, n, dup, i=0; -+ int n, dup, i = 0; ++ int n, dup, i=0; + size_t l; char bufr[512]; -@@ -352,5 +353,5 @@ + memset(&sockname, 0, sizeof(struct sockaddr_in)); +@@ -355,7 +356,7 @@ SendSSDPNotifies2(int * sockets, + } } -void +static void ParseUPnPClient(char *location) { ---- minixml.c 2008-10-23 13:30:45.000000000 -0400 -+++ minixml.c 2012-01-09 18:17:20.000000000 -0500 -@@ -36,5 +36,6 @@ + char buf[8192]; +diff --git minissdp.h minissdp.h +index bcc7ff4..be8cb5d 100644 +--- minissdp.h ++++ minissdp.h +@@ -32,7 +32,7 @@ + /*#include "minidlnatypes.h"*/ + + int +-OpenAndConfSSDPReceiveSocket(); ++OpenAndConfSSDPReceiveSocket(void); + /* OpenAndConfSSDPReceiveSocket(int n_lan_addr, struct lan_addr_s * lan_addr);*/ + + /*int +diff --git minixml.c minixml.c +index 3dfb9a2..0831443 100644 +--- minixml.c ++++ minixml.c +@@ -34,7 +34,7 @@ POSSIBILITY OF SUCH DAMAGE. + /* parseatt : used to parse the argument list * return 0 (false) in case of success and -1 (true) if the end * of the xmlbuffer is reached. */ -int parseatt(struct xmlparser * p) -+static int -+parseatt(struct xmlparser * p) ++static int parseatt(struct xmlparser * p) { const char * attname; -@@ -107,5 +108,6 @@ + int attnamelen; +@@ -105,7 +105,7 @@ int parseatt(struct xmlparser * p) + /* parseelt parse the xml stream and * call the callback functions when needed... */ -void parseelt(struct xmlparser * p) -+static void -+parseelt(struct xmlparser * p) ++static void parseelt(struct xmlparser * p) { int i; ---- options.c 2011-08-24 21:27:56.000000000 -0400 -+++ options.c 2012-01-09 18:18:31.000000000 -0500 -@@ -74,5 +74,5 @@ + const char * elementname; +diff --git options.c options.c +index 435cf9b..1b2d825 100644 +--- options.c ++++ options.c +@@ -74,7 +74,7 @@ readoptionsfile(const char * fname) + char *value; char *t; int linenum = 0; - int i; -+ unsigned i; ++ size_t i; enum upnpconfigoptions id; ---- playlist.c 2011-08-04 20:31:20.000000000 -0400 -+++ playlist.c 2012-01-09 18:20:32.000000000 -0500 -@@ -35,4 +35,5 @@ + if(!fname || (strlen(fname) == 0)) +diff --git playlist.c playlist.c +index 789b48c..8cf1df7 100644 +--- playlist.c ++++ playlist.c +@@ -35,6 +35,7 @@ + #include "utils.h" #include "sql.h" #include "log.h" +#include "playlist.h" int ---- scanner.c 2011-08-24 20:37:10.000000000 -0400 -+++ scanner.c 2012-04-11 11:11:02.000000000 -0400 -@@ -24,4 +24,5 @@ + insert_playlist(const char * path, char * name) +diff --git scanner.c scanner.c +index dc10229..abd0c89 100644 +--- scanner.c ++++ scanner.c +@@ -23,6 +23,7 @@ + #include <locale.h> #include <libgen.h> #include <inttypes.h> +#include <limits.h> #include <sys/stat.h> #include <sys/time.h> -@@ -73,5 +74,5 @@ + #include <sys/resource.h> +@@ -76,7 +77,7 @@ get_next_available_id(const char * table, const char * parentID) + return objectID; } -int +static int insert_container(const char * item, const char * rootParent, const char * refID, const char *class, const char *artist, const char *genre, const char *album_art, sqlite3_int64 *objectID, sqlite3_int64 *parentID) -@@ -166,5 +167,6 @@ + { +@@ -169,7 +170,7 @@ insert_containers(const char * name, const char *path, const char * refID, const + else { insert_container(date_taken, IMAGE_DATE_ID, NULL, "album.photoAlbum", NULL, NULL, NULL, &objectID, &parentID); - sprintf(last_date.parentID, IMAGE_DATE_ID"$%"PRIX64, parentID); -+ sprintf(last_date.parentID, IMAGE_DATE_ID"$%"PRIX64, -+ (int64_t)parentID); ++ sprintf(last_date.parentID, IMAGE_DATE_ID"$%"PRIX64, (int64_t)parentID); last_date.objectID = objectID; strcpy(last_date.name, date_taken); -@@ -189,5 +191,6 @@ + //DEBUG DPRINTF(E_DEBUG, L_SCANNER, "Creating cached date item: %s/%s/%X\n", last_date.name, last_date.parentID, last_date.objectID); +@@ -192,7 +193,7 @@ insert_containers(const char * name, const char *path, const char * refID, const + if( !valid_cache || strcmp(camera, last_cam.name) != 0 ) { insert_container(camera, IMAGE_CAMERA_ID, NULL, "storageFolder", NULL, NULL, NULL, &objectID, &parentID); - sprintf(last_cam.parentID, IMAGE_CAMERA_ID"$%"PRIX64, parentID); -+ sprintf(last_cam.parentID, IMAGE_CAMERA_ID"$%"PRIX64, -+ (int64_t)parentID); ++ sprintf(last_cam.parentID, IMAGE_CAMERA_ID"$%"PRIX64, (int64_t)parentID); strncpy(last_cam.name, camera, 255); last_camdate.name[0] = '\0'; -@@ -201,5 +204,6 @@ + } +@@ -204,7 +205,7 @@ insert_containers(const char * name, const char *path, const char * refID, const + else { insert_container(date_taken, last_cam.parentID, NULL, "album.photoAlbum", NULL, NULL, NULL, &objectID, &parentID); - sprintf(last_camdate.parentID, "%s$%"PRIX64, last_cam.parentID, parentID); -+ sprintf(last_camdate.parentID, "%s$%"PRIX64, last_cam.parentID, -+ (int64_t)parentID); ++ sprintf(last_camdate.parentID, "%s$%"PRIX64, last_cam.parentID, (int64_t)parentID); last_camdate.objectID = objectID; strcpy(last_camdate.name, date_taken); -@@ -224,5 +228,5 @@ - else if( strstr(class, "audioItem") ) - { -- snprintf(sql, sizeof(sql), "SELECT ALBUM, ARTIST, GENRE, ALBUM_ART from DETAILS where ID = %lld", detailID); -+ snprintf(sql, sizeof(sql), "SELECT ALBUM, ARTIST, GENRE, ALBUM_ART from DETAILS where ID = %jd", (intmax_t)detailID); - ret = sql_get_table(db, sql, &result, &row, &cols); - if( ret != SQLITE_OK ) -@@ -270,10 +274,12 @@ + //DEBUG DPRINTF(E_DEBUG, L_SCANNER, "Creating cached camdate item: %s/%s/%s/%X\n", camera, last_camdate.name, last_camdate.parentID, last_camdate.objectID); +@@ -273,12 +274,12 @@ insert_containers(const char * name, const char *path, const char * refID, const + if( !valid_cache || strcmp(artist, last_artist.name) != 0 ) { insert_container(artist, MUSIC_ARTIST_ID, NULL, "person.musicArtist", NULL, genre, NULL, &objectID, &parentID); - sprintf(last_artist.parentID, MUSIC_ARTIST_ID"$%"PRIX64, parentID); -+ sprintf(last_artist.parentID, MUSIC_ARTIST_ID"$%"PRIX64, -+ (int64_t)parentID); ++ sprintf(last_artist.parentID, MUSIC_ARTIST_ID"$%"PRIX64, (int64_t)parentID); strcpy(last_artist.name, artist); last_artistAlbum.name[0] = '\0'; /* Add this file to the "- All Albums -" container as well */ insert_container(_("- All Albums -"), last_artist.parentID, NULL, "album", artist, genre, NULL, &objectID, &parentID); - sprintf(last_artistAlbumAll.parentID, "%s$%"PRIX64, last_artist.parentID, parentID); -+ sprintf(last_artistAlbumAll.parentID, "%s$%"PRIX64, last_artist.parentID, -+ (int64_t)parentID); ++ sprintf(last_artistAlbumAll.parentID, "%s$%"PRIX64, last_artist.parentID, (int64_t)parentID); last_artistAlbumAll.objectID = objectID; } -@@ -291,5 +297,6 @@ + else +@@ -294,7 +295,7 @@ insert_containers(const char * name, const char *path, const char * refID, const + { insert_container(album?album:_("Unknown Album"), last_artist.parentID, album?last_album.parentID:NULL, "album.musicAlbum", artist, genre, album_art, &objectID, &parentID); - sprintf(last_artistAlbum.parentID, "%s$%"PRIX64, last_artist.parentID, parentID); -+ sprintf(last_artistAlbum.parentID, "%s$%"PRIX64, last_artist.parentID, -+ (int64_t)parentID); ++ sprintf(last_artistAlbum.parentID, "%s$%"PRIX64, last_artist.parentID, (int64_t)parentID); last_artistAlbum.objectID = objectID; strcpy(last_artistAlbum.name, album?album:_("Unknown Album")); -@@ -312,10 +319,12 @@ + //DEBUG DPRINTF(E_DEBUG, L_SCANNER, "Creating cached artist/album item: %s/%s/%X\n", last_artist.name, last_artist.parentID, last_artist.objectID); +@@ -315,12 +316,12 @@ insert_containers(const char * name, const char *path, const char * refID, const + if( !valid_cache || strcmp(genre, last_genre.name) != 0 ) { insert_container(genre, MUSIC_GENRE_ID, NULL, "genre.musicGenre", NULL, NULL, NULL, &objectID, &parentID); - sprintf(last_genre.parentID, MUSIC_GENRE_ID"$%"PRIX64, parentID); -+ sprintf(last_genre.parentID, MUSIC_GENRE_ID"$%"PRIX64, -+ (int64_t)parentID); ++ sprintf(last_genre.parentID, MUSIC_GENRE_ID"$%"PRIX64, (int64_t)parentID); strcpy(last_genre.name, genre); last_genreArtist.name[0] = '\0'; /* Add this file to the "- All Artists -" container as well */ insert_container(_("- All Artists -"), last_genre.parentID, NULL, "person", NULL, genre, NULL, &objectID, &parentID); - sprintf(last_genreArtistAll.parentID, "%s$%"PRIX64, last_genre.parentID, parentID); -+ sprintf(last_genreArtistAll.parentID, "%s$%"PRIX64, last_genre.parentID, -+ (int64_t)parentID); ++ sprintf(last_genreArtistAll.parentID, "%s$%"PRIX64, last_genre.parentID, (int64_t)parentID); last_genreArtistAll.objectID = objectID; } -@@ -332,5 +341,6 @@ + else +@@ -335,7 +336,7 @@ insert_containers(const char * name, const char *path, const char * refID, const + { insert_container(artist?artist:_("Unknown Artist"), last_genre.parentID, artist?last_artist.parentID:NULL, "person.musicArtist", NULL, genre, NULL, &objectID, &parentID); - sprintf(last_genreArtist.parentID, "%s$%"PRIX64, last_genre.parentID, parentID); -+ sprintf(last_genreArtist.parentID, "%s$%"PRIX64, last_genre.parentID, -+ (int64_t)parentID); ++ sprintf(last_genreArtist.parentID, "%s$%"PRIX64, last_genre.parentID, (int64_t)parentID); last_genreArtist.objectID = objectID; strcpy(last_genreArtist.name, artist?artist:_("Unknown Artist")); -@@ -656,5 +666,5 @@ + //DEBUG DPRINTF(E_DEBUG, L_SCANNER, "Creating cached genre/artist item: %s/%s/%X\n", last_genreArtist.name, last_genreArtist.parentID, last_genreArtist.objectID); +@@ -659,7 +660,7 @@ sql_failed: + return (ret != SQLITE_OK); } -int +static int filter_audio(const struct dirent *d) { -@@ -670,5 +680,5 @@ + return ( (*d->d_name != '.') && +@@ -673,7 +674,7 @@ filter_audio(const struct dirent *d) + ) )); } -int +static int filter_video(const struct dirent *d) { -@@ -682,5 +692,5 @@ + return ( (*d->d_name != '.') && +@@ -685,7 +686,7 @@ filter_video(const struct dirent *d) + ) ); } -int +static int filter_images(const struct dirent *d) { -@@ -694,5 +704,5 @@ + return ( (*d->d_name != '.') && +@@ -697,7 +698,7 @@ filter_images(const struct dirent *d) + ) ); } -int +static int filter_media(const struct dirent *d) { -@@ -710,5 +720,5 @@ + return ( (*d->d_name != '.') && +@@ -713,7 +714,7 @@ filter_media(const struct dirent *d) + ) )); } -void +static void ScanDirectory(const char * dir, const char * parent, enum media_types dir_type) { ---- upnpdescgen.c 2011-05-02 19:50:52.000000000 -0400 -+++ upnpdescgen.c 2012-01-09 18:30:11.000000000 -0500 -@@ -327,12 +327,12 @@ + struct dirent **namelist; +@@ -804,7 +805,7 @@ ScanDirectory(const char * dir, const char * parent, enum media_types dir_type) + } + + void +-start_scanner() ++start_scanner(void) + { + struct media_dir_s * media_path = media_dirs; + char name[PATH_MAX]; +diff --git scanner.h scanner.h +index a57eedd..7eaa3a0 100644 +--- scanner.h ++++ scanner.h +@@ -81,6 +81,6 @@ int + CreateDatabase(void); + + void +-start_scanner(); ++start_scanner(void); + + #endif +diff --git tagutils/tagutils-aac.c tagutils/tagutils-aac.c +index 4224d5f..609710a 100644 +--- tagutils/tagutils-aac.c ++++ tagutils/tagutils-aac.c +@@ -81,7 +81,7 @@ _get_aactags(char *file, struct song_metadata *psong) + long atom_offset; + unsigned int atom_length; + +- long current_offset = 0; ++ unsigned int current_offset = 0; + int current_size; + char current_atom[4]; + char *current_data; +@@ -119,7 +119,7 @@ _get_aactags(char *file, struct song_metadata *psong) + current_data = (char*)malloc(len); // extra byte + memset(current_data, 0x00, len); + +- if(fread(current_data, 1, current_size - 8, fin) != current_size - 8) ++ if((int)fread(current_data, 1, current_size - 8, fin) != current_size - 8) + break; + + if(!memcmp(current_atom, "\xA9" "nam", 4)) +@@ -243,7 +243,7 @@ _aac_lookforatom(FILE *aac_fp, char *atom_path, unsigned int *atom_length) + return ftell(aac_fp) - 8; + } + +-int ++static int + _aac_check_extended_descriptor(FILE *infile) + { + short int i; +diff --git tagutils/tagutils-asf.c tagutils/tagutils-asf.c +index 11da1ae..abc5b78 100644 +--- tagutils/tagutils-asf.c ++++ tagutils/tagutils-asf.c +@@ -23,7 +23,7 @@ + static int + _asf_read_file_properties(FILE *fp, asf_file_properties_t *p, __u32 size) + { +- int len; ++ unsigned int len; + + len = sizeof(*p) - offsetof(asf_file_properties_t, FileID); + if(size < len) +@@ -66,10 +66,10 @@ static int + _asf_read_audio_stream(FILE *fp, struct song_metadata *psong, int size) + { + asf_audio_stream_t s; +- int len; ++ unsigned long len; + + len = sizeof(s) - sizeof(s.Hdr); +- if(len > size) ++ if(len > (unsigned long) size) + len = size; + + if(len != fread(&s.wfx, 1, len, fp)) +@@ -90,7 +90,7 @@ _asf_read_media_stream(FILE *fp, struct song_metadata *psong, __u32 size) + { + asf_media_stream_t s; + avi_audio_format_t wfx; +- int len; ++ unsigned int len; + + len = sizeof(s) - sizeof(s.Hdr); + if(len > size) +@@ -121,7 +121,7 @@ static int + _asf_read_stream_object(FILE *fp, struct song_metadata *psong, __u32 size) + { + asf_stream_object_t s; +- int len; ++ unsigned int len; + + len = sizeof(s) - sizeof(asf_object_t); + if(size < len) +@@ -145,8 +145,8 @@ _asf_read_stream_object(FILE *fp, struct song_metadata *psong, __u32 size) + static int + _asf_read_extended_stream_object(FILE *fp, struct song_metadata *psong, __u32 size) + { +- int i, len; +- long off; ++ unsigned int i, len; ++ size_t off; + asf_object_t tmp; + asf_extended_stream_object_t xs; + asf_stream_name_t nm; +@@ -201,7 +201,7 @@ static int + _asf_read_header_extension(FILE *fp, struct song_metadata *psong, __u32 size) + { + off_t pos; +- long off; ++ size_t off; + asf_header_extension_t ext; + asf_object_t tmp; + +@@ -233,7 +233,7 @@ _asf_read_header_extension(FILE *fp, struct song_metadata *psong, __u32 size) + } + + static int +-_asf_load_string(FILE *fp, int type, int size, char *buf, int len) ++_asf_load_string(FILE *fp, int type, unsigned short size, char *buf, int len) + { + unsigned char data[2048]; + __u16 wc; +@@ -302,7 +302,7 @@ _asf_load_string(FILE *fp, int type, int size, char *buf, int len) + static void * + _asf_load_picture(FILE *fp, int size, void *bm, int *bm_size) + { +- int i; ++ unsigned long i; + char buf[256]; + #if 0 + // +diff --git tagutils/tagutils-flc.c tagutils/tagutils-flc.c +index b8f41d4..839327f 100644 +--- tagutils/tagutils-flc.c ++++ tagutils/tagutils-flc.c +@@ -26,7 +26,7 @@ _get_flctags(char *filename, struct song_metadata *psong) + FLAC__Metadata_SimpleIterator *iterator = 0; + FLAC__StreamMetadata *block; + unsigned int sec, ms; +- int i; ++ unsigned int i; + int err = 0; + + if(!(iterator = FLAC__metadata_simple_iterator_new())) +diff --git tagutils/tagutils-mp3.c tagutils/tagutils-mp3.c +index 770f231..698f743 100644 +--- tagutils/tagutils-mp3.c ++++ tagutils/tagutils-mp3.c +@@ -31,7 +31,7 @@ _get_mp3tags(char *file, struct song_metadata *psong) + struct id3_tag *pid3tag; + struct id3_frame *pid3frame; + int err; +- int index; ++ unsigned int index; + int used; + unsigned char *utf8_text; + int genre = WINAMP_GENRE_UNKNOWN; +@@ -405,7 +405,7 @@ static void _mp3_get_average_bitrate(FILE *infile, struct mp3_frameinfo *pfi, co + off_t file_size; + unsigned char frame_buffer[2900]; + unsigned char header[4]; +- int index = 0; ++ unsigned int index = 0; + int found = 0; + off_t pos; + struct mp3_frameinfo fi; +@@ -549,11 +549,11 @@ _get_mp3fileinfo(char *file, struct song_metadata *psong) + struct id3header *pid3; + struct mp3_frameinfo fi; + unsigned int size = 0; +- unsigned int n_read; ++ size_t n_read; + off_t fp_size = 0; + off_t file_size; + unsigned char buffer[1024]; +- int index; ++ unsigned int index; + + int xing_flags; + int found; +diff --git tagutils/tagutils-wav.c tagutils/tagutils-wav.c +index e9f6c20..956eef7 100644 +--- tagutils/tagutils-wav.c ++++ tagutils/tagutils-wav.c +@@ -79,7 +79,7 @@ _get_wavtags(char *filename, struct song_metadata *psong) + + /* now, walk through the chunks */ + current_offset = 12; +- while(current_offset + 8 < psong->file_size) ++ while(current_offset + 8 < (unsigned int) psong->file_size) + { + len = 8; + if(!(len = read(fd, hdr, len)) || (len != 8)) +@@ -162,7 +162,7 @@ _get_wavtags(char *filename, struct song_metadata *psong) + + off = 4; + p = tags + off; +- while(off < len - 8) ++ while(off < (int) len - 8) + { + taglen = GET_WAV_INT32(p + 4); + +diff --git tagutils/tagutils.c tagutils/tagutils.c +index 7e147e7..b344552 100644 +--- tagutils/tagutils.c ++++ tagutils/tagutils.c +@@ -96,7 +96,7 @@ char *winamp_genre[] = { + "Unknown" + }; + +-#define WINAMP_GENRE_UNKNOWN ((sizeof(winamp_genre) / sizeof(winamp_genre[0])) - 1) ++#define WINAMP_GENRE_UNKNOWN ((int)(sizeof(winamp_genre) / sizeof(winamp_genre[0])) - 1) + + + /* +@@ -132,7 +132,7 @@ static taghandler taghandlers[] = { + { "asf", 0, _get_asffileinfo }, + { "wav", _get_wavtags, _get_wavfileinfo }, + { "pcm", 0, _get_pcmfileinfo }, +- { NULL, 0 } ++ { NULL, NULL, 0 } + }; + + +diff --git upnpdescgen.c upnpdescgen.c +index c3b94e0..2ce8c31 100644 +--- upnpdescgen.c ++++ upnpdescgen.c +@@ -325,32 +325,32 @@ static const struct stateVar ConnectionManagerVars[] = + {"SourceProtocolInfo", 1<<7, 0, 0, 44}, /* required */ {"SinkProtocolInfo", 1<<7, 0, 0, 48}, /* required */ {"CurrentConnectionIDs", 1<<7, 0, 0, 46}, /* required */ - {"A_ARG_TYPE_ConnectionStatus", 0, 0, 27}, /* required */ @@ -377,42 +613,48 @@ + {NULL, 0, 0, 0, 0} }; -@@ -340,5 +340,5 @@ + static const struct argument GetSearchCapabilitiesArgs[] = { {"SearchCaps", 2, 10}, - {0, 0} + {NULL, 0, 0} }; -@@ -346,5 +346,5 @@ + static const struct argument GetSortCapabilitiesArgs[] = { {"SortCaps", 2, 11}, - {0, 0} + {NULL, 0, 0} }; -@@ -352,5 +352,5 @@ + static const struct argument GetSystemUpdateIDArgs[] = { {"Id", 2, 12}, - {0, 0} + {NULL, 0, 0} }; -@@ -367,5 +367,5 @@ + static const struct argument BrowseArgs[] = +@@ -365,7 +365,7 @@ static const struct argument BrowseArgs[] = + {"NumberReturned", 2, 8}, {"TotalMatches", 2, 8}, {"UpdateID", 2, 9}, - {0, 0} + {NULL, 0, 0} }; -@@ -382,5 +382,5 @@ + static const struct argument SearchArgs[] = +@@ -380,7 +380,7 @@ static const struct argument SearchArgs[] = + {"NumberReturned", 2, 8}, {"TotalMatches", 2, 8}, {"UpdateID", 2, 9}, - {0, 0} + {NULL, 0, 0} }; -@@ -409,14 +409,14 @@ + static const struct action ContentDirectoryActions[] = +@@ -407,16 +407,16 @@ static const struct action ContentDirectoryActions[] = + static const struct stateVar ContentDirectoryVars[] = { {"TransferIDs", 1<<7, 0, 0, 48}, /* 0 */ - {"A_ARG_TYPE_ObjectID", 0, 0}, @@ -436,7 +678,9 @@ + {"A_ARG_TYPE_UpdateID", 3, 0, 0, 0}, //JM{"A_ARG_TYPE_TransferID", 3, 0}, /* 10 */ //JM{"A_ARG_TYPE_TransferStatus", 0, 0, 39}, -@@ -426,9 +426,9 @@ + /* Allowed Values : COMPLETED / ERROR / IN_PROGRESS / STOPPED */ +@@ -424,11 +424,11 @@ static const struct stateVar ContentDirectoryVars[] = + //JM{"A_ARG_TYPE_TransferTotal", 0, 0}, //JM{"A_ARG_TYPE_TagValueList", 0, 0}, //JM{"A_ARG_TYPE_URI", 5, 0}, /* 15 */ - {"SearchCapabilities", 0, 0}, @@ -444,13 +688,14 @@ + {"SearchCapabilities", 0, 0, 0, 0}, + {"SortCapabilities", 0, 0, 0, 0}, {"SystemUpdateID", 3|0x80, 0, 0, 255}, -- //{"ContainerUpdateIDs", 0, 0}, + //{"ContainerUpdateIDs", 0, 0}, - {0, 0} -+ //{"ContainerUpdateIDs", 0, 0, 0, 0}, + {NULL, 0, 0, 0, 0} }; -@@ -466,13 +466,12 @@ + static const struct argument GetIsAuthorizedArgs[] = +@@ -464,15 +464,15 @@ static const struct action X_MS_MediaReceiverRegistrarActions[] = + static const struct stateVar X_MS_MediaReceiverRegistrarVars[] = { - {"A_ARG_TYPE_DeviceID", 0, 0}, @@ -472,307 +717,134 @@ + {"ValidationSucceededUpdateID", 3, 0, 0, 0}, + {NULL, 0, 0, 0, 0} }; ---- upnphttp.c 2011-08-18 14:34:59.000000000 -0400 -+++ upnphttp.c 2012-01-09 18:32:37.000000000 -0500 -@@ -1138,5 +1149,5 @@ + + /* WANCfg.xml */ +diff --git upnpevents.c upnpevents.c +index 1b5f018..2438bf3 100644 +--- upnpevents.c ++++ upnpevents.c +@@ -256,7 +256,7 @@ error: + static void + upnp_event_notify_connect(struct upnp_event_notify * obj) + { +- int i; ++ unsigned long i; + const char * p; + unsigned short port; + struct sockaddr_in addr; +diff --git upnphttp.c upnphttp.c +index b368cd9..58f3f2c 100644 +--- upnphttp.c ++++ upnphttp.c +@@ -1283,7 +1283,7 @@ SendResp_upnphttp(struct upnphttp * h) + } } -int +static int send_data(struct upnphttp * h, char * header, size_t size, int flags) { -@@ -1710,5 +1743,5 @@ + int n; +@@ -1853,7 +1853,7 @@ SendResp_dlnafile(struct upnphttp * h, char * object) + char path[PATH_MAX]; char mime[32]; char dlna[96]; - } last_file = { 0, 0 }; + } last_file = { 0, 0, { '\0' }, { '\0' }, { '\0' } }; #if USE_FORK pid_t newpid = 0; ---- upnpsoap.c 2011-08-18 19:24:17.000000000 -0400 -+++ upnpsoap.c 2012-01-09 18:38:42.000000000 -0500 -@@ -488,5 +488,5 @@ + #endif +diff --git upnpsoap.c upnpsoap.c +index 3182ca4..ae4ff95 100644 +--- upnpsoap.c ++++ upnpsoap.c +@@ -542,7 +542,7 @@ set_filter_flags(char * filter, struct upnphttp *h) + return flags; } -char * +static char * - parse_sort_criteria(char * sortCriteria, int * error) - { ---- utils.h 2011-05-13 18:10:15.000000000 -0400 -+++ utils.h 2012-01-09 19:00:08.000000000 -0500 -@@ -26,5 +26,9 @@ - - int --strcatf(struct string_s *str, char *fmt, ...); -+strcatf(struct string_s *str, const char *fmt, ...) -+#ifdef __GNUC__ -+ __attribute__((format(printf, 2, 3))) -+#endif -+; - - int ---- utils.c 2011-07-18 14:13:25.000000000 -0400 -+++ utils.c 2012-01-09 18:57:14.000000000 -0500 -@@ -20,5 +20,5 @@ + parse_sort_criteria(char *sortCriteria, int *error) + { + char *order = NULL; +diff --git utils.c utils.c +index d8cba4d..36ff168 100644 +--- utils.c ++++ utils.c +@@ -19,7 +19,11 @@ + #include <ctype.h> #include <string.h> #include <stdlib.h> --#include <linux/limits.h> ++#if defined(__FreeBSD__) +#include <limits.h> ++#else + #include <linux/limits.h> ++#endif #include <sys/stat.h> #include <unistd.h> -@@ -31,6 +31,7 @@ + #include <sys/types.h> +@@ -30,6 +34,7 @@ + #include "minidlnatypes.h" #include "upnpglobalvars.h" #include "log.h" +#include "utils.h" --inline int -+int + inline int strcatf(struct string_s *str, const char *fmt, ...) - { -@@ -282,5 +283,5 @@ +@@ -277,7 +282,7 @@ unsigned int + DJBHash(const char *str, int len) { unsigned int hash = 5381; - unsigned int i = 0; + int i = 0; for(i = 0; i < len; str++, i++) ---- uuid.c 2010-11-11 18:48:13.000000000 -0500 -+++ uuid.c 2012-01-09 19:43:31.000000000 -0500 -@@ -38,4 +39,5 @@ + { +diff --git utils.h utils.h +index fbd0a91..b5b433a 100644 +--- utils.h ++++ utils.h +@@ -25,7 +25,11 @@ + #define __UTILS_H__ + + int +-strcatf(struct string_s *str, char *fmt, ...); ++strcatf(struct string_s *str, const char *fmt, ...) ++#ifdef __GNUC__ ++ __attribute__((format(printf, 2, 3))) ++#endif ++; + + void + strncpyt(char *dst, const char *src, size_t len); +diff --git uuid.c uuid.c +index bdb4abc..bfa22b7 100644 +--- uuid.c ++++ uuid.c +@@ -37,6 +37,7 @@ + #include "getifaddr.h" #include "log.h" +#include "uuid.h" #define ETH_ALEN 6 -@@ -108,3 +88,3 @@ + #define NSEC_PER_SEC 1000000000L +@@ -106,7 +107,7 @@ read_random_bytes(unsigned char *buf, size_t size) + } + } -void +static void init_clockseq(void) -@@ -118,5 +98,5 @@ - } - --int -+static int - generate_uuid(unsigned char uuid_out[16]) { ---- tagutils/tagutils.c 2010-11-11 18:48:14.000000000 -0500 -+++ tagutils/tagutils.c 2012-01-09 19:08:06.000000000 -0500 -@@ -97,5 +98,5 @@ - }; - --#define WINAMP_GENRE_UNKNOWN ((sizeof(winamp_genre) / sizeof(winamp_genre[0])) - 1) -+#define WINAMP_GENRE_UNKNOWN ((int)(sizeof(winamp_genre) / sizeof(winamp_genre[0])) - 1) - - -@@ -133,5 +134,5 @@ - { "wav", _get_wavtags, _get_wavfileinfo }, - { "pcm", 0, _get_pcmfileinfo }, -- { NULL, 0 } -+ { NULL, NULL, 0 } - }; - ---- tagutils/tagutils-mp3.c 2010-11-11 18:48:14.000000000 -0500 -+++ tagutils/tagutils-mp3.c 2012-01-09 19:14:45.000000000 -0500 -@@ -405,5 +406,5 @@ - unsigned char frame_buffer[2900]; - unsigned char header[4]; -- int index = 0; -+ unsigned int index = 0; - int found = 0; - off_t pos; -@@ -549,9 +550,9 @@ - struct mp3_frameinfo fi; - unsigned int size = 0; -- unsigned int n_read; -+ size_t n_read; - off_t fp_size = 0; - off_t file_size; - unsigned char buffer[1024]; -- int index; -+ unsigned int index; - - int xing_flags; -@@ -618,5 +619,5 @@ - { - fseek(infile, fp_size, SEEK_SET); -- if((n_read = fread(buffer, 1, sizeof(buffer), infile)) < 4) // at least mp3 frame header size (i.e. 4 bytes) -+ if((n_read = fread(buffer, 1, sizeof(buffer), infile)) < 50) - { - fclose(infile); ---- tagutils/tagutils-aac.c 2010-11-11 18:48:14.000000000 -0500 -+++ tagutils/tagutils-aac.c 2012-01-09 19:20:35.000000000 -0500 -@@ -82,5 +82,5 @@ - unsigned int atom_length; - -- long current_offset = 0; -+ unsigned int current_offset = 0; - int current_size; - char current_atom[4]; -@@ -120,5 +120,6 @@ - memset(current_data, 0x00, len); - -- if(fread(current_data, 1, current_size - 8, fin) != current_size - 8) -+ if ((int)fread(current_data, 1, current_size - 8, fin) -+ != current_size - 8) - break; - -@@ -244,5 +245,5 @@ + unsigned char buf[4]; +@@ -117,7 +118,7 @@ init_clockseq(void) + clock_seq_initialized = 1; } -int +static int - _aac_check_extended_descriptor(FILE *infile) - { ---- tagutils/tagutils-flc.c 2011-05-02 19:50:52.000000000 -0400 -+++ tagutils/tagutils-flc.c 2012-01-09 19:22:35.000000000 -0500 -@@ -27,5 +27,5 @@ - FLAC__StreamMetadata *block; - unsigned int sec, ms; -- int i; -+ unsigned int i; - int err = 0; - ---- tagutils/tagutils-asf.c 2011-05-16 20:25:03.000000000 -0400 -+++ tagutils/tagutils-asf.c 2012-01-09 19:28:32.000000000 -0500 -@@ -24,5 +24,5 @@ - _asf_read_file_properties(FILE *fp, asf_file_properties_t *p, __u32 size) - { -- int len; -+ unsigned int len; - - len = sizeof(*p) - offsetof(asf_file_properties_t, FileID); -@@ -64,8 +64,8 @@ - - static int --_asf_read_audio_stream(FILE *fp, struct song_metadata *psong, int size) -+_asf_read_audio_stream(FILE *fp, struct song_metadata *psong, __u32 size) - { - asf_audio_stream_t s; -- int len; -+ unsigned int len; - - len = sizeof(s) - sizeof(s.Hdr); -@@ -91,5 +91,5 @@ - asf_media_stream_t s; - avi_audio_format_t wfx; -- int len; -+ unsigned int len; - - len = sizeof(s) - sizeof(s.Hdr); -@@ -122,5 +122,5 @@ - { - asf_stream_object_t s; -- int len; -+ unsigned int len; - - len = sizeof(s) - sizeof(asf_object_t); -@@ -146,6 +146,6 @@ - _asf_read_extended_stream_object(FILE *fp, struct song_metadata *psong, __u32 size) - { -- int i, len; -- long off; -+ unsigned int i, len; -+ size_t off; - asf_object_t tmp; - asf_extended_stream_object_t xs; -@@ -202,5 +202,5 @@ - { - off_t pos; -- long off; -+ size_t off; - asf_header_extension_t ext; - asf_object_t tmp; -@@ -234,5 +234,5 @@ - - static int --_asf_load_string(FILE *fp, int type, int size, char *buf, int len) -+_asf_load_string(FILE *fp, int type, unsigned short size, char *buf, int len) - { - unsigned char data[2048]; -@@ -303,5 +303,5 @@ - _asf_load_picture(FILE *fp, int size, void *bm, int *bm_size) - { -- int i; -+ unsigned int i; - char buf[256]; - #if 0 ---- tagutils/tagutils.h 2011-05-16 20:25:03.000000000 -0400 -+++ tagutils/tagutils.h 2012-01-09 19:31:58.000000000 -0500 -@@ -44,5 +44,5 @@ - - struct song_metadata { -- int file_size; -+ off_t file_size; - char *dirpath; - char *path; ---- tagutils/tagutils-wav.c 2012-01-17 17:49:02.000000000 -0500 -+++ tagutils/tagutils-wav.c 2012-04-10 12:01:10.000000000 -0400 -@@ -34,5 +34,4 @@ - { - int fd; -- uint32_t len; - unsigned char hdr[12]; - unsigned char fmt[16]; -@@ -58,6 +57,5 @@ - } - -- len = 12; -- if(!(len = read(fd, hdr, len)) || (len != 12)) -+ if (read(fd, hdr, sizeof hdr) != sizeof hdr) - { - DPRINTF(E_WARN, L_SCANNER, "Could not read wav header from %s\n", filename); -@@ -82,6 +80,5 @@ - while(current_offset < psong->file_size) - { -- len = 8; -- if(!(len = read(fd, hdr, len)) || (len != 8)) -+ if (read(fd, hdr, 8) != 8) - { - close(fd); -@@ -101,16 +98,8 @@ - // block_len); - -- if(block_len < 0) -- { -- close(fd); -- DPRINTF(E_WARN, L_SCANNER, "Bad block len: %s\n", filename); -- return -1; -- } -- - if(strncmp((char*)&hdr, "fmt ", 4) == 0) - { - //DEBUG DPRINTF(E_DEBUG,L_SCANNER,"Found 'fmt ' header\n"); -- len = 16; -- if(!read(fd, fmt, len) || (len != 16)) -+ if (read(fd, fmt, 16) != 16) - { - close(fd); -@@ -144,12 +133,17 @@ - int taglen; - char **m; -+ ssize_t len; - - len = GET_WAV_INT32(hdr + 4); -- if(len > 65536) -+ if(len <=0 || len > 65536) - goto next_block; - - tags = malloc(len+1); -- if(!tags) -+ if(!tags) { -+ DPRINTF(E_WARN, L_SCANNER, -+ "Failed to malloc %ld bytes", -+ (long)len); - goto next_block; -+ } - - if(read(fd, tags, len) < len || ---- upnpevents.c 2012-02-13 17:48:56.000000000 -0500 -+++ upnpevents.c 2012-04-11 11:31:14.000000000 -0400 -@@ -257,5 +257,5 @@ - upnp_event_notify_connect(struct upnp_event_notify * obj) + generate_uuid(unsigned char uuid_out[16]) { -- int i; -+ unsigned int i; - const char * p; - unsigned short port; + static u_int64_t last_time_all; + |