shithub: dumb

Download patch

ref: 52fc437b85c46a528b604b7012ede8217d5e94ba
parent: f8d4d6f84fdef8c29af39a155baebd7d21391ae6
author: Christopher Snowhill <kode54@gmail.com>
date: Mon Sep 25 15:55:59 EDT 2017

Silence warnings.

--- a/src/helpers/resampler.c
+++ b/src/helpers/resampler.c
@@ -67,7 +67,7 @@
 __cpuid(int *data, int selector)
 {
 #if defined(__PIC__) && defined(__i386__)
-    asm("xchgl %%ebx, %%esi; cpuid; xchgl %%ebx, %%esi"
+    __asm("xchgl %%ebx, %%esi; cpuid; xchgl %%ebx, %%esi"
         : "=a" (data[0]),
         "=S" (data[1]),
         "=c" (data[2]),
@@ -74,7 +74,7 @@
         "=d" (data[3])
         : "0" (selector));
 #elif defined(__PIC__) && defined(__amd64__)
-    asm("xchg{q} {%%}rbx, %q1; cpuid; xchg{q} {%%}rbx, %q1"
+    __asm("xchg{q} {%%}rbx, %q1; cpuid; xchg{q} {%%}rbx, %q1"
         : "=a" (data[0]),
         "=&r" (data[1]),
         "=c" (data[2]),
@@ -81,7 +81,7 @@
         "=d" (data[3])
         : "0" (selector));
 #else
-    asm("cpuid"
+    __asm("cpuid"
         : "=a" (data[0]),
         "=b" (data[1]),
         "=c" (data[2]),
--- a/src/it/readam.c
+++ b/src/it/readam.c
@@ -256,7 +256,7 @@
 		++ row;
 	}
 
-	pattern->n_entries = entry - pattern->entry;
+	pattern->n_entries = (int)((long)entry - (long)pattern->entry);
 	if ( ! pattern->n_entries ) return -1;
 
 	return 0;
@@ -302,7 +302,7 @@
             if ( dumbfile_seek( f, c->offset, DFS_SEEK_SET ) ) goto error_sd;
             o = dumbfile_getc( f );
             if ( o >= sigdata->n_patterns ) sigdata->n_patterns = (o + 1);
-            o = dumbfile_igetl( f );
+            o = (int) dumbfile_igetl( f );
             if ( (unsigned)o + 5 > c->size ) goto error_sd;
 			break;
 
@@ -423,7 +423,7 @@
 		case DUMB_ID( 'P', 'A', 'T', 'T' ):
             if ( dumbfile_seek( f, c->offset, DFS_SEEK_SET ) ) goto error_usd;
             o = dumbfile_getc( f );
-            p = dumbfile_igetl( f );
+            p = (int) dumbfile_igetl( f );
             if ( it_riff_am_process_pattern( sigdata->pattern + o, f, p, 0 ) ) goto error_usd;
 			break;
 
@@ -503,7 +503,7 @@
             if ( dumbfile_seek( f, c->offset, DFS_SEEK_SET ) ) goto error_sd;
             o = dumbfile_getc( f );
             if ( o >= sigdata->n_patterns ) sigdata->n_patterns = (int)(o + 1);
-            o = dumbfile_igetl( f );
+            o = (int) dumbfile_igetl( f );
             if ( (unsigned)o + 5 > c->size ) goto error_sd;
 			break;
 
@@ -659,7 +659,7 @@
 		case DUMB_ID( 'P', 'A', 'T', 'T' ):
             if ( dumbfile_seek( f, c->offset, DFS_SEEK_SET ) ) goto error_usd;
             o = dumbfile_getc( f );
-            p = dumbfile_igetl( f );
+            p = (int) dumbfile_igetl( f );
             if ( it_riff_am_process_pattern( sigdata->pattern + o, f, p, 1 ) ) goto error_usd;
 			break;
 
--- a/src/it/readdsmf.c
+++ b/src/it/readdsmf.c
@@ -204,7 +204,7 @@
 		++ row;
 	}
 
-	pattern->n_entries = entry - pattern->entry;
+	pattern->n_entries = (int)((long)entry - (long)pattern->entry);
 	if ( ! pattern->n_entries ) return -1;
 
 	return 0;
--- a/src/it/readpsm.c
+++ b/src/it/readpsm.c
@@ -438,7 +438,7 @@
 		row++;
 	}
 
-	pattern->n_entries = entry - pattern->entry;
+	pattern->n_entries = (int)((long)entry - (long)pattern->entry);
 	if (!pattern->n_entries) return -1;
 
 	return 0;
@@ -491,7 +491,7 @@
 
 	if (dumbfile_mgetl(f) != DUMB_ID('P','S','M',' ')) goto error;
 
-	length = dumbfile_igetl(f);
+	length = (int)dumbfile_igetl(f);
 
 	if (dumbfile_mgetl(f) != DUMB_ID('F','I','L','E')) goto error;
 
@@ -500,7 +500,7 @@
 	while (length >= 8) {
 		if (n_chunks >= 768) goto error_fc;
 		chunk[n_chunks].id = (unsigned int) dumbfile_mgetl(f);
-		n = dumbfile_igetl(f);
+		n = (int)dumbfile_igetl(f);
 		length -= 8;
 		if ((signed int)n <= 0 || n > length)
 			goto error_fc;
@@ -588,7 +588,7 @@
 			ptr = c->data;
 			if (ptr[10] > 32) goto error_usd;
 			sigdata->n_pchannels = ptr[10];
-			length = c->len - 11;
+			length = (int)(c->len - 11);
 			ptr += 11;
 			songchunk = 0;
 			if (length >= 8) {
@@ -621,7 +621,7 @@
 		if (c->id == DUMB_ID('D','A','T','E')) {
 			/* date of the library build / format spec */
 			if (c->len == 6) {
-				length = c->len;
+				length = (int)c->len;
 				ptr = c->data;
 				while (length > 0) {
 					if (*ptr >= '0' && *ptr <= '9') {
@@ -686,7 +686,7 @@
 				if (!o) goto error_sc;
 				event = malloc(o * sizeof(*event));
 				if (!event) goto error_sc;
-				length = c->len - 2;
+				length = (int)(c->len - 2);
 				ptr += 2;
 				while ((length > 0) && (n_events < o)) {
 					event[n_events].type = *ptr;
@@ -748,7 +748,7 @@
 				break;
 
 			case DUMB_ID('P','P','A','N'):
-				length = c->len;
+				length = (int)c->len;
 				if (length & 1) goto error_ev;
 				ptr = c->data;
 				o = 0;
@@ -808,7 +808,7 @@
 				PSMCHUNK * c = &chunk[o];
 				if (c->id == DUMB_ID('P','B','O','D')) {
 					ptr = c->data;
-					length = c->len;
+					length = (int)c->len;
 					if (found == PSMV_OLD) {
 						if (length < 8) goto error_ev;
 						if (!pattcmp(ptr + 4, e->data, 4)) {
@@ -1223,7 +1223,7 @@
 /* Eww */
 int pattcmp( const unsigned char * a, const unsigned char * b, size_t l )
 {
-    size_t i, j;
+    long i, j;
     unsigned long na, nb;
 	char * p;
 
@@ -1260,9 +1260,9 @@
 	else if ( i > j ) return 1;
 
 	i = memcmp( a, b, j );
-	if ( i ) return i;
+	if ( i ) return (int)i;
 
-	return (int)((long)na) - ((long)nb);
+	return (int)(((long)na) - ((long)nb));
 }