aboutsummaryrefslogtreecommitdiffstats
path: root/net/minidlna/files/patch-warnings
blob: a3038bbc7b7a3c8ce196e75d3a1a3da496ee55fa (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
--- 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 @@
 }
 
-char *
+static char *
 check_embedded_art(const char *path, const char *image_data, int image_size)
 {
@@ -218,5 +219,5 @@
    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 @@
 }
 
-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 @@
 }
 
-pix
+static pix
 get_pix(image_s *pimage, int32_t x, int32_t y)
 {
@@ -223,5 +223,5 @@
 }
 
-void
+static void
 put_pix_alpha_replace(image_s *pimage, int32_t x, int32_t y, pix col)
 {
@@ -399,5 +399,5 @@
 }
 
-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 @@
 
    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 @@
 }
 
-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 @@
 #include <stdlib.h>
 #include <sys/stat.h>
-
+#include <libgen.h>
 #include <unistd.h>
 #include <sys/types.h>
@@ -95,5 +95,5 @@
 #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 @@
 }
 
-void
+static void
 parse_nfo(const char * path, metadata_t * m)
 {
@@ -239,5 +239,5 @@
 }
 
-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 @@
 {
    struct stat file;
-   int ret, i;
+   int ret;
+   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 @@
 {
    struct sockaddr_in sockname;
-   int l, n, dup, i=0;
+   int n, dup, i = 0;
+   size_t l;
    char bufr[512];
 
@@ -352,5 +353,5 @@
 }
 
-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 @@
  * 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)
 {
    const char * attname;
@@ -107,5 +108,6 @@
 /* parseelt parse the xml stream and
  * call the callback functions when needed... */
-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 @@
    char *t;
    int linenum = 0;
-   int i;
+   unsigned 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 @@
 #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 @@
 #include <libgen.h>
 #include <inttypes.h>
+#include <limits.h>
 #include <sys/stat.h>
 #include <sys/time.h>
@@ -73,5 +74,5 @@
 }
 
-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 @@
        {
            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);
            last_date.objectID = objectID;
            strcpy(last_date.name, date_taken);
@@ -189,5 +191,6 @@
        {
            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);
            strncpy(last_cam.name, camera, 255);
            last_camdate.name[0] = '\0';
@@ -201,5 +204,6 @@
        {
            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);
            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 @@
            {
                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);
                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);
                last_artistAlbumAll.objectID = objectID;
            }
@@ -291,5 +297,6 @@
                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);
                last_artistAlbum.objectID = objectID;
                strcpy(last_artistAlbum.name, album?album:_("Unknown Album"));
@@ -312,10 +319,12 @@
            {
                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);
                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);
                last_genreArtistAll.objectID = objectID;
            }
@@ -332,5 +341,6 @@
                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);
                last_genreArtist.objectID = objectID;
                strcpy(last_genreArtist.name, artist?artist:_("Unknown Artist"));
@@ -656,5 +666,5 @@
 }
 
-int
+static int
 filter_audio(const struct dirent *d)
 {
@@ -670,5 +680,5 @@
 }
 
-int
+static int
 filter_video(const struct dirent *d)
 {
@@ -682,5 +692,5 @@
 }
 
-int
+static int
 filter_images(const struct dirent *d)
 {
@@ -694,5 +704,5 @@
 }
 
-int
+static int
 filter_media(const struct dirent *d)
 {
@@ -710,5 +720,5 @@
 }
 
-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 @@
    {"SinkProtocolInfo", 1<<7, 0, 0, 48}, /* required */
    {"CurrentConnectionIDs", 1<<7, 0, 0, 46}, /* required */
-   {"A_ARG_TYPE_ConnectionStatus", 0, 0, 27}, /* required */
-   {"A_ARG_TYPE_ConnectionManager", 0, 0}, /* required */
-   {"A_ARG_TYPE_Direction", 0, 0, 33}, /* required */
-   {"A_ARG_TYPE_ProtocolInfo", 0, 0}, /* required */
-   {"A_ARG_TYPE_ConnectionID", 4, 0}, /* required */
-   {"A_ARG_TYPE_AVTransportID", 4, 0}, /* required */
-   {"A_ARG_TYPE_RcsID", 4, 0}, /* required */
-   {0, 0}
+   {"A_ARG_TYPE_ConnectionStatus", 0, 0, 27, 0}, /* required */
+   {"A_ARG_TYPE_ConnectionManager", 0, 0, 0, 0}, /* required */
+   {"A_ARG_TYPE_Direction", 0, 0, 33, 0}, /* required */
+   {"A_ARG_TYPE_ProtocolInfo", 0, 0, 0, 0}, /* required */
+   {"A_ARG_TYPE_ConnectionID", 4, 0, 0, 0}, /* required */
+   {"A_ARG_TYPE_AVTransportID", 4, 0, 0, 0}, /* required */
+   {"A_ARG_TYPE_RcsID", 4, 0, 0, 0}, /* required */
+   {NULL, 0, 0, 0, 0}
 };
 
@@ -340,5 +340,5 @@
 {
    {"SearchCaps", 2, 10},
-   {0, 0}
+   {NULL, 0, 0}
 };
 
@@ -346,5 +346,5 @@
 {
    {"SortCaps", 2, 11},
-   {0, 0}
+   {NULL, 0, 0}
 };
 
@@ -352,5 +352,5 @@
 {
    {"Id", 2, 12},
-   {0, 0}
+   {NULL, 0, 0}
 };
 
@@ -367,5 +367,5 @@
    {"TotalMatches", 2, 8},
    {"UpdateID", 2, 9},
-   {0, 0}
+   {NULL, 0, 0}
 };
 
@@ -382,5 +382,5 @@
    {"TotalMatches", 2, 8},
    {"UpdateID", 2, 9},
-   {0, 0}
+   {NULL, 0, 0}
 };
 
@@ -409,14 +409,14 @@
 {
    {"TransferIDs", 1<<7, 0, 0, 48}, /* 0 */
-   {"A_ARG_TYPE_ObjectID", 0, 0},
-   {"A_ARG_TYPE_Result", 0, 0},
-   {"A_ARG_TYPE_SearchCriteria", 0, 0},
-   {"A_ARG_TYPE_BrowseFlag", 0, 0, 36},
+   {"A_ARG_TYPE_ObjectID", 0, 0, 0, 0},
+   {"A_ARG_TYPE_Result", 0, 0, 0, 0},
+   {"A_ARG_TYPE_SearchCriteria", 0, 0, 0, 0},
+   {"A_ARG_TYPE_BrowseFlag", 0, 0, 36, 0},
    /* Allowed Values : BrowseMetadata / BrowseDirectChildren */
-   {"A_ARG_TYPE_Filter", 0, 0}, /* 5 */
-   {"A_ARG_TYPE_SortCriteria", 0, 0},
-   {"A_ARG_TYPE_Index", 3, 0},
-   {"A_ARG_TYPE_Count", 3, 0},
-   {"A_ARG_TYPE_UpdateID", 3, 0},
+   {"A_ARG_TYPE_Filter", 0, 0, 0, 0}, /* 5 */
+   {"A_ARG_TYPE_SortCriteria", 0, 0, 0, 0},
+   {"A_ARG_TYPE_Index", 3, 0, 0, 0},
+   {"A_ARG_TYPE_Count", 3, 0, 0, 0},
+   {"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 @@
    //JM{"A_ARG_TYPE_TagValueList", 0, 0},
    //JM{"A_ARG_TYPE_URI", 5, 0}, /* 15 */
-   {"SearchCapabilities", 0, 0},
-   {"SortCapabilities", 0, 0},
+   {"SearchCapabilities", 0, 0, 0, 0},
+   {"SortCapabilities", 0, 0, 0, 0},
    {"SystemUpdateID", 3|0x80, 0, 0, 255},
-   //{"ContainerUpdateIDs", 0, 0},
-   {0, 0}
+   //{"ContainerUpdateIDs", 0, 0, 0, 0},
+   {NULL, 0, 0, 0, 0}
 };
 
@@ -466,13 +466,12 @@
 static const struct stateVar X_MS_MediaReceiverRegistrarVars[] =
 {
-   {"A_ARG_TYPE_DeviceID", 0, 0},
-   {"A_ARG_TYPE_RegistrationReqMsg", 7, 0},
-   {"A_ARG_TYPE_RegistrationRespMsg", 7, 0},
-   {"A_ARG_TYPE_Result", 6, 0},
-   {"AuthorizationDeniedUpdateID", 3, 0},
-   {"AuthorizationGrantedUpdateID", 3, 0},
-   {"ValidationRevokedUpdateID", 3, 0},
-   {"ValidationSucceededUpdateID", 3, 0},
-   {0, 0}
+   {"A_ARG_TYPE_DeviceID", 0, 0, 0, 0},
+   {"A_ARG_TYPE_RegistrationReqMsg", 7, 0, 0, 0},
+   {"A_ARG_TYPE_RegistrationRespMsg", 7, 0, 0, 0},
+   {"A_ARG_TYPE_Result", 6, 0, 0, 0},
+   {"AuthorizationDeniedUpdateID", 3, 0, 0, 0},
+   {"AuthorizationGrantedUpdateID", 3, 0, 0, 0},
+   {"ValidationRevokedUpdateID", 3, 0, 0, 0},
+   {"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 @@
 }
 
-int
+static int
 send_data(struct upnphttp * h, char * header, size_t size, int flags)
 {
@@ -1710,5 +1743,5 @@
                    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 @@
 }
 
-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 @@
 #include <string.h>
 #include <stdlib.h>
-#include <linux/limits.h>
+#include <limits.h>
 #include <sys/stat.h>
 #include <unistd.h>
@@ -31,6 +31,7 @@
 #include "upnpglobalvars.h"
 #include "log.h"
+#include "utils.h"
 
-inline int
+int
 strcatf(struct string_s *str, const char *fmt, ...)
 {
@@ -282,5 +283,5 @@
 {
    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 @@
 #include "getifaddr.h"
 #include "log.h"
+#include "uuid.h"
 
 #define ETH_ALEN 6
@@ -108,3 +88,3 @@
 
-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 @@
 }
 
-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)
 {
-   int i;
+   unsigned int i;
    const char * p;
    unsigned short port;