File deadbeef-compiler-warnings.patch of Package deadbeef

> I: Program causes undefined operation
>    (likely same variable used twiceand post/pre incremented in the same expression).
>    e.g. x = x++; Split it in two operations.
> W: deadbeef sequence-point adplug/cff.cpp:381
> W: deadbeef sequence-point adplug/dmo.cpp:323, 343, 367
> W: deadbeef sequence-point lh5dec.c:95
> W: deadbeef sequence-point ttadec.c:515
>
> I: Statement might be overflowing a buffer in strncat. Common mistake:
>    BAD: strncat(buffer,charptr,sizeof(buffer)) is wrong, it takes the left over size as 3rd argument
>    GOOD: strncat(buffer,charptr,sizeof(buffer)-strlen(buffer)-1)
> E: deadbeef bufferoverflowstrncat libsc68/conf68.c:198:12
> E: deadbeef bufferoverflowstrncat libsc68/conf68.c:258:14
>
> I: Program returns random data in a function
> E: deadbeef no-return-in-nonvoid-function pltbrowser.c:748, 759
> E: deadbeef no-return-in-nonvoid-function search.c:308
> E: deadbeef no-return-in-nonvoid-function widgets.c:3347
>
> I: Program returns random data in a function
> E: deadbeef no-return-in-nonvoid-function pltbrowser.c:748, 759
> E: deadbeef no-return-in-nonvoid-function search.c:308
> E: deadbeef no-return-in-nonvoid-function widgets.c:3347
---

--- a/plugins/adplug/adplug/cff.cpp
+++ b/plugins/adplug/adplug/cff.cpp
@@ -377,8 +377,10 @@ long CcffLoader::cff_unpacker::unpack(un
 	    goto out;
 	  }
 
-	  for (unsigned int i=0;i<repeat_counter*repeat_length;i++)
-	    output[output_length++] = output[output_length - repeat_length];
+	  for (unsigned int i=0;i<repeat_counter*repeat_length;i++) {
+	    output[output_length] = output[output_length - repeat_length];
+	    output_length++;
+	  }
 
 	  code_length = old_code_length;
 
--- a/plugins/adplug/adplug/dmo.cpp
+++ b/plugins/adplug/adplug/dmo.cpp
@@ -319,8 +319,10 @@ short CdmoLoader::dmo_unpacker::unpack_b
 	  if(opos + cx >= oend)
 	    return -1;
 
-	  for(int i=0;i<cx;i++)
-	    *opos++ = *(opos - ax);
+	  for(int i=0;i<cx;i++) {
+	    *opos = *(opos - ax);
+	    *opos++;
+	  }
 
 	  continue;
 	}
@@ -339,8 +341,10 @@ short CdmoLoader::dmo_unpacker::unpack_b
 	  if(opos + bx + cx >= oend)
 	    return -1;
 
-	  for(i=0;i<cx;i++)
-	    *opos++ = *(opos - ax);
+	  for(i=0;i<cx;i++) {
+	    *opos = *(opos - ax);
+	    *opos++;
+	  }
 
 	  for (i=0;i<bx;i++)
 	    *opos++ = *ipos++;
@@ -363,8 +367,10 @@ short CdmoLoader::dmo_unpacker::unpack_b
 	  if(opos + ax + cx >= oend)
 	    return -1;
 
-	  for(i=0;i<cx;i++)
-	    *opos++ = *(opos - bx);
+	  for(i=0;i<cx;i++) {
+	    *opos = *(opos - bx);
+	    *opos++;
+	  }
 
 	  for (i=0;i<ax;i++)
 	    *opos++ = *ipos++;
--- a/plugins/gtkui/search.c
+++ b/plugins/gtkui/search.c
@@ -299,7 +299,7 @@ submit_refresh (void) {
     }
 }
 
-static gboolean
+static void
 playlistswitch_cb (void) {
     DdbListview *listview = playlist_visible();
     if (listview) {
--- a/plugins/gtkui/widgets.c
+++ b/plugins/gtkui/widgets.c
@@ -3338,7 +3338,7 @@ spectrum_realize (GtkWidget *widget, gpo
 #endif
 }
 
-static int
+static void
 w_spectrum_message (ddb_gtkui_widget_t *w, uint32_t id, uintptr_t ctx, uint32_t p1, uint32_t p2) {
     switch (id) {
     case DB_EV_SONGCHANGED: {
--- a/plugins/pltbrowser/pltbrowser.c
+++ b/plugins/pltbrowser/pltbrowser.c
@@ -736,7 +736,7 @@ add_treeview_column (w_pltbrowser_t *w,
 
 static gboolean drag_row_active = FALSE;
 
-static gboolean
+static void
 on_pltbrowser_drag_begin_event          (GtkWidget       *widget,
                                         GdkDragContext  *drag_context,
                                         gint             x,
@@ -748,7 +748,7 @@ on_pltbrowser_drag_begin_event
     return FALSE;
 }
 
-static gboolean
+static void
 on_pltbrowser_drag_end_event          (GtkWidget       *widget,
                                         GdkDragContext  *drag_context,
                                         gint             x,
--- a/plugins/sc68/libsc68/conf68.c
+++ b/plugins/sc68/libsc68/conf68.c
@@ -195,7 +195,7 @@ int config68_save(const char * confname)
     const int sizeof_config_hd = sizeof(config_header)-1;
 
     strncpy(tmp, "sc68://config/", sizeof(tmp));
-    strncat(tmp, confname, sizeof(tmp));
+    strncat(tmp, confname, sizeof(tmp)-strlen(tmp)-1);
     os = uri68_vfs(tmp, 2, 0);
     err = vfs68_open(os);
     if (!err) {
@@ -255,7 +255,7 @@ static int load_from_registry(const char
 
     for (k=0; k<2; ++k) {
       strncpy(path, paths[k], sizeof(path));
-      strncat(path, opt->name, sizeof(path));
+      strncat(path, opt->name, sizeof(path)-strlen(path)-1);
 
       TRACE68(config68_cat, "conf68: trying -- '%s'\n", path);
       switch (opt->type) {
--- a/plugins/tta/ttadec.c
+++ b/plugins/tta/ttadec.c
@@ -459,7 +459,7 @@ int get_samples (tta_info *info, byte *b
 	byte *p = buffer;
 	decoder *dec = info->tta;
 	int *prev = info->cache;
-	int value, res;
+	int value, res, tmp;
 
 	for (res = 0; p < buffer + info->pcm_buffer_size;) {
 		fltst *fst = &dec->fst;
@@ -512,7 +512,8 @@ int get_samples (tta_info *info, byte *b
 			rice->k0++;
 		}
 
-		value = DEC(value);
+		tmp = DEC(value);
+		value = tmp;
 
 		// decompress stage 1: adaptive hybrid filter
 		hybrid_filter(fst, &value);
--- a/plugins/vtx/lh5dec.c
+++ b/plugins/vtx/lh5dec.c
@@ -92,7 +92,7 @@ static void make_table(int nchar, unsign
     start[i] >>= jutbits;
     weight[i] = 1U << (tablebits - i);
   }
-  while (i <= 16) weight[i++] = 1U << (16 - i);
+  while (i <= 16) { weight[i] = 1U << (16 - i); i++; }
 
   i = start[tablebits + 1] >> jutbits;
   if (i != (unsigned short)(1U << 16)) {