shithub: dumb

Download patch

ref: 4e0faec2b81698376b78c4715d633de23140cd10
parent: e65a86fc81352fbd667269f22878365606e2cf2c
author: Carlos Rafael Giani <dv@pseudoterminal.org>
date: Wed May 22 13:35:47 EDT 2013

renamed "restrict" parameters to "restrict_"

"restrict" is a keyword since C99

--- a/dumb/include/dumb.h
+++ b/dumb/include/dumb.h
@@ -389,13 +389,13 @@
 int dumb_it_callback_terminate(void *data);
 int dumb_it_callback_midi_block(void *data, int channel, unsigned char midi_byte);
 
-/* dumb_*_mod*: restrict |= 1-Don't read 15 sample files / 2-Use old pattern counting method */
+/* dumb_*_mod*: restrict_ |= 1-Don't read 15 sample files / 2-Use old pattern counting method */
 
 DUH *dumb_load_it(const char *filename);
 DUH *dumb_load_xm(const char *filename);
 DUH *dumb_load_s3m(const char *filename);
 DUH *dumb_load_stm(const char *filename);
-DUH *dumb_load_mod(const char *filename, int restrict);
+DUH *dumb_load_mod(const char *filename, int restrict_);
 DUH *dumb_load_ptm(const char *filename);
 DUH *dumb_load_669(const char *filename);
 DUH *dumb_load_psm(const char *filename, int subsong);
@@ -410,7 +410,7 @@
 DUH *dumb_read_xm(DUMBFILE *f);
 DUH *dumb_read_s3m(DUMBFILE *f);
 DUH *dumb_read_stm(DUMBFILE *f);
-DUH *dumb_read_mod(DUMBFILE *f, int restrict);
+DUH *dumb_read_mod(DUMBFILE *f, int restrict_);
 DUH *dumb_read_ptm(DUMBFILE *f);
 DUH *dumb_read_669(DUMBFILE *f);
 DUH *dumb_read_psm(DUMBFILE *f, int subsong);
@@ -425,7 +425,7 @@
 DUH *dumb_load_xm_quick(const char *filename);
 DUH *dumb_load_s3m_quick(const char *filename);
 DUH *dumb_load_stm_quick(const char *filename);
-DUH *dumb_load_mod_quick(const char *filename, int restrict);
+DUH *dumb_load_mod_quick(const char *filename, int restrict_);
 DUH *dumb_load_ptm_quick(const char *filename);
 DUH *dumb_load_669_quick(const char *filename);
 DUH *dumb_load_psm_quick(const char *filename, int subsong);
@@ -440,7 +440,7 @@
 DUH *dumb_read_xm_quick(DUMBFILE *f);
 DUH *dumb_read_s3m_quick(DUMBFILE *f);
 DUH *dumb_read_stm_quick(DUMBFILE *f);
-DUH *dumb_read_mod_quick(DUMBFILE *f, int restrict);
+DUH *dumb_read_mod_quick(DUMBFILE *f, int restrict_);
 DUH *dumb_read_ptm_quick(DUMBFILE *f);
 DUH *dumb_read_669_quick(DUMBFILE *f);
 DUH *dumb_read_psm_quick(DUMBFILE *f, int subsong);
@@ -451,11 +451,11 @@
 DUH *dumb_read_amf_quick(DUMBFILE *f);
 DUH *dumb_read_okt_quick(DUMBFILE *f);
 
-DUH *dumb_read_any_quick(DUMBFILE *f, int restrict, int subsong);
-DUH *dumb_read_any(DUMBFILE *f, int restrict, int subsong);
+DUH *dumb_read_any_quick(DUMBFILE *f, int restrict_, int subsong);
+DUH *dumb_read_any(DUMBFILE *f, int restrict_, int subsong);
 
-DUH *dumb_load_any_quick(const char *filename, int restrict, int subsong);
-DUH *dumb_load_any(const char *filename, int restrict, int subsong);
+DUH *dumb_load_any_quick(const char *filename, int restrict_, int subsong);
+DUH *dumb_load_any(const char *filename, int restrict_, int subsong);
 
 long dumb_it_build_checkpoints(DUMB_IT_SIGDATA *sigdata, int startorder);
 void dumb_it_do_initial_runthrough(DUH *duh);
--- a/dumb/src/it/loadany.c
+++ b/dumb/src/it/loadany.c
@@ -22,7 +22,7 @@
 
 
 
-DUH *dumb_load_any_quick(const char *filename, int restrict, int subsong)
+DUH *dumb_load_any_quick(const char *filename, int restrict_, int subsong)
 {
 	DUH *duh;
 	DUMBFILE *f = dumbfile_open(filename);
@@ -30,7 +30,7 @@
 	if (!f)
 		return NULL;
 
-    duh = dumb_read_any_quick(f, restrict, subsong);
+    duh = dumb_read_any_quick(f, restrict_, subsong);
 
 	dumbfile_close(f);
 
--- a/dumb/src/it/loadany2.c
+++ b/dumb/src/it/loadany2.c
@@ -21,9 +21,9 @@
 
 
 
-DUH *dumb_load_any(const char *filename, int restrict, int subsong)
+DUH *dumb_load_any(const char *filename, int restrict_, int subsong)
 {
-    DUH *duh = dumb_load_any_quick(filename, restrict, subsong);
+    DUH *duh = dumb_load_any_quick(filename, restrict_, subsong);
 	dumb_it_do_initial_runthrough(duh);
 	return duh;
 }
--- a/dumb/src/it/loadmod.c
+++ b/dumb/src/it/loadmod.c
@@ -26,7 +26,7 @@
  * pointer to the DUH struct. When you have finished with it, you must
  * pass the pointer to unload_duh() so that the memory can be freed.
  */
-DUH *dumb_load_mod_quick(const char *filename, int restrict)
+DUH *dumb_load_mod_quick(const char *filename, int restrict_)
 {
 	DUH *duh;
 	DUMBFILE *f = dumbfile_open(filename);
@@ -34,7 +34,7 @@
 	if (!f)
 		return NULL;
 
-	duh = dumb_read_mod_quick(f, restrict);
+	duh = dumb_read_mod_quick(f, restrict_);
 
 	dumbfile_close(f);
 
--- a/dumb/src/it/loadmod2.c
+++ b/dumb/src/it/loadmod2.c
@@ -21,9 +21,9 @@
 
 
 
-DUH *dumb_load_mod(const char *filename, int restrict)
+DUH *dumb_load_mod(const char *filename, int restrict_)
 {
-	DUH *duh = dumb_load_mod_quick(filename, restrict);
+	DUH *duh = dumb_load_mod_quick(filename, restrict_);
 	dumb_it_do_initial_runthrough(duh);
 	return duh;
 }
--- a/dumb/src/it/readany.c
+++ b/dumb/src/it/readany.c
@@ -30,7 +30,7 @@
 
 enum { maximum_signature_size = 0x30 };
 
-DUH *dumb_read_any_quick(DUMBFILE *f, int restrict, int subsong)
+DUH *dumb_read_any_quick(DUMBFILE *f, int restrict_, int subsong)
 {
     unsigned char signature[ maximum_signature_size ];
     unsigned long signature_size;
@@ -122,7 +122,7 @@
     if ( !duh )
     {
         dumbfile_seek( f, 0, DFS_SEEK_SET );
-        duh = dumb_read_mod_quick( f, restrict );
+        duh = dumb_read_mod_quick( f, restrict_ );
     }
 
     return duh;
--- a/dumb/src/it/readany2.c
+++ b/dumb/src/it/readany2.c
@@ -21,9 +21,9 @@
 
 
 
-DUH *dumb_read_any(DUMBFILE *f, int restrict, int subsong)
+DUH *dumb_read_any(DUMBFILE *f, int restrict_, int subsong)
 {
-    DUH *duh = dumb_read_any_quick(f, restrict, subsong);
+    DUH *duh = dumb_read_any_quick(f, restrict_, subsong);
 	dumb_it_do_initial_runthrough(duh);
 	return duh;
 }
--- a/dumb/src/it/readmod.c
+++ b/dumb/src/it/readmod.c
@@ -273,7 +273,7 @@
 
 #define MOD_FFT_OFFSET (20 + 31*(22+2+1+1+2+2) + 1 + 1 + 128)
 
-static DUMB_IT_SIGDATA *it_mod_load_sigdata(DUMBFILE *f, int restrict)
+static DUMB_IT_SIGDATA *it_mod_load_sigdata(DUMBFILE *f, int restrict_)
 {
 	DUMB_IT_SIGDATA *sigdata;
 	int n_channels;
@@ -385,7 +385,7 @@
 	}
 
 	// moo
-	if ( ( restrict & 1 ) && sigdata->n_samples == 15 )
+	if ( ( restrict_ & 1 ) && sigdata->n_samples == 15 )
 	{
 		free(sigdata);
         return NULL;
@@ -460,7 +460,7 @@
 
 	sigdata->n_patterns = -1;
 
-    if ( ( restrict & 2 ) )
+    if ( ( restrict_ & 2 ) )
 	{
         unsigned char buffer[5];
         long sample_number;
@@ -609,13 +609,13 @@
 
 
 
-DUH *dumb_read_mod_quick(DUMBFILE *f, int restrict)
+DUH *dumb_read_mod_quick(DUMBFILE *f, int restrict_)
 {
 	sigdata_t *sigdata;
 
 	DUH_SIGTYPE_DESC *descptr = &_dumb_sigtype_it;
 
-	sigdata = it_mod_load_sigdata(f, restrict);
+	sigdata = it_mod_load_sigdata(f, restrict_);
 
 	if (!sigdata)
 		return NULL;
--- a/dumb/src/it/readmod2.c
+++ b/dumb/src/it/readmod2.c
@@ -21,9 +21,9 @@
 
 
 
-DUH *dumb_read_mod(DUMBFILE *f, int restrict)
+DUH *dumb_read_mod(DUMBFILE *f, int restrict_)
 {
-	DUH *duh = dumb_read_mod_quick(f, restrict);
+	DUH *duh = dumb_read_mod_quick(f, restrict_);
 	dumb_it_do_initial_runthrough(duh);
 	return duh;
 }