[Scummvm-cvs-logs] CVS: scummvm/sound midiparser.h,1.6,1.7 midiparser.cpp,1.1,1.2 midiparser_smf.cpp,1.6,1.7 midiparser_xmidi.cpp,1.5,1.6

Jamieson Christian jamieson630 at users.sourceforge.net
Mon May 19 12:25:20 CEST 2003


Update of /cvsroot/scummvm/scummvm/sound
In directory sc8-pr-cvs1:/tmp/cvs-serv30255

Modified Files:
	midiparser.h midiparser.cpp midiparser_smf.cpp 
	midiparser_xmidi.cpp 
Log Message:
Fixed anonymous structs warning.

Index: midiparser.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/midiparser.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- midiparser.h	19 May 2003 18:47:50 -0000	1.6
+++ midiparser.h	19 May 2003 19:24:22 -0000	1.7
@@ -36,12 +36,12 @@
 		struct {
 			byte param1;
 			byte param2;
-		};
+		} basic;
 		struct {
 			byte   type; // Used for METAs
 			byte * data; // Used for SysEx and METAs
 			uint32 length; // Used for SysEx and METAs
-		};
+		} ext;
 	};
 
 	byte channel() { return event & 0x0F; }

Index: midiparser.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/midiparser.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- midiparser.cpp	19 May 2003 18:47:50 -0000	1.1
+++ midiparser.cpp	19 May 2003 19:24:22 -0000	1.2
@@ -98,10 +98,10 @@
 
 		if (info.event == 0xF0) {
 			// SysEx event
-			_driver->sysEx (info.data, (uint16) info.length);
+			_driver->sysEx (info.ext.data, (uint16) info.ext.length);
 		} else if (info.event == 0xFF) {
 			// META event
-			if (info.type == 0x2F) {
+			if (info.ext.type == 0x2F) {
 				// End of Track must be processed by us,
 				// as well as sending it to the output device.
 				allNotesOff();
@@ -110,18 +110,18 @@
 					parseNextEvent (_next_event);
 				} else {
 					_play_pos = 0;
-					_driver->metaEvent (info.type, info.data, (uint16) info.length);
+					_driver->metaEvent (info.ext.type, info.ext.data, (uint16) info.ext.length);
 				}
 				return;
-			} else if (info.type == 0x51) {
-				if (info.length >= 3) {
-					_tempo = info.data[0] << 16 | info.data[1] << 8 | info.data[2];
+			} else if (info.ext.type == 0x51) {
+				if (info.ext.length >= 3) {
+					_tempo = info.ext.data[0] << 16 | info.ext.data[1] << 8 | info.ext.data[2];
 					_psec_per_tick = (_tempo + (_ppqn >> 2)) / _ppqn;
 				}
 			}
-			_driver->metaEvent (info.type, info.data, (uint16) info.length);
+			_driver->metaEvent (info.ext.type, info.ext.data, (uint16) info.ext.length);
 		} else {
-			_driver->send (info.event | info.param1 << 8 | info.param2 << 16);
+			_driver->send (info.event | info.basic.param1 << 8 | info.basic.param2 << 16);
 		}
 
 
@@ -185,18 +185,18 @@
 		_last_event_time = _play_time;
 
 		if (info.event == 0xFF) {
-			if (info.type == 0x2F) { // End of track
+			if (info.ext.type == 0x2F) { // End of track
 				if (_autoLoop) {
 					_play_pos = _tracks[_active_track];
 					parseNextEvent (_next_event);
 				} else {
 					_play_pos = 0;
-					_driver->metaEvent (0x2F, info.data, (uint16) info.length);
+					_driver->metaEvent (0x2F, info.ext.data, (uint16) info.ext.length);
 				}
 				break;
-			} else if (info.type == 0x51) { // Tempo
-				if (info.length >= 3) {
-					_tempo = info.data[0] << 16 | info.data[1] << 8 | info.data[2];
+			} else if (info.ext.type == 0x51) { // Tempo
+				if (info.ext.length >= 3) {
+					_tempo = info.ext.data[0] << 16 | info.ext.data[1] << 8 | info.ext.data[2];
 					_psec_per_tick = (_tempo + (_ppqn >> 2)) / _ppqn;
 				}
 			}

Index: midiparser_smf.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/midiparser_smf.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- midiparser_smf.cpp	19 May 2003 18:48:18 -0000	1.6
+++ midiparser_smf.cpp	19 May 2003 19:24:22 -0000	1.7
@@ -98,42 +98,42 @@
 
 	switch (info.event >> 4) {
 	case 0xC: case 0xD:
-		info.param1 = *(_play_pos++);
-		info.param2 = 0;
+		info.basic.param1 = *(_play_pos++);
+		info.basic.param2 = 0;
 		break;
 
 	case 0x8: case 0x9: case 0xA: case 0xB: case 0xE:
-		info.param1 = *(_play_pos++);
-		info.param2 = *(_play_pos++);
+		info.basic.param1 = *(_play_pos++);
+		info.basic.param2 = *(_play_pos++);
 		break;
 
 	case 0xF: // System Common, Meta or SysEx event
 		switch (info.event & 0x0F) {
 		case 0x2: // Song Position Pointer
-			info.param1 = *(_play_pos++);
-			info.param2 = *(_play_pos++);
+			info.basic.param1 = *(_play_pos++);
+			info.basic.param2 = *(_play_pos++);
 			break;
 
 		case 0x3: // Song Select
-			info.param1 = *(_play_pos++);
-			info.param2 = 0;
+			info.basic.param1 = *(_play_pos++);
+			info.basic.param2 = 0;
 			break;
 
 		case 0x6: case 0x8: case 0xA: case 0xB: case 0xC: case 0xE:
-			info.param1 = info.param2 = 0;
+			info.basic.param1 = info.basic.param2 = 0;
 			break;
 
 		case 0x0: // SysEx
-			info.length = readVLQ (_play_pos);
-			info.data = _play_pos;
-			_play_pos += info.length;
+			info.ext.length = readVLQ (_play_pos);
+			info.ext.data = _play_pos;
+			_play_pos += info.ext.length;
 			break;
 
 		case 0xF: // META event
-			info.type = *(_play_pos++);
-			info.length = readVLQ (_play_pos);
-			info.data = _play_pos;
-			_play_pos += info.length;
+			info.ext.type = *(_play_pos++);
+			info.ext.length = readVLQ (_play_pos);
+			info.ext.data = _play_pos;
+			_play_pos += info.ext.length;
 			break;
 		}
 	}

Index: midiparser_xmidi.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/midiparser_xmidi.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- midiparser_xmidi.cpp	19 May 2003 18:48:18 -0000	1.5
+++ midiparser_xmidi.cpp	19 May 2003 19:24:22 -0000	1.6
@@ -100,8 +100,8 @@
 		_play_pos = info.start;
 		info.delta = best->off_time - _last_event_tick;
 		info.event = 0x80 | best->channel;
-		info.param1 = best->note;
-		info.param2 = 0;
+		info.basic.param1 = best->note;
+		info.basic.param2 = 0;
 		best->off_time = 0;
 		_inserted_delta += info.delta;
 		return;
@@ -112,8 +112,8 @@
 	info.event = *(_play_pos++);
 	switch (info.event >> 4) {
 	case 0x9: // Note On
-		info.param1 = *(_play_pos++);
-		info.param2 = *(_play_pos++);
+		info.basic.param1 = *(_play_pos++);
+		info.basic.param2 = *(_play_pos++);
 		note_length = readVLQ (_play_pos);
 
 		// In addition to sending this back, we must
@@ -126,53 +126,53 @@
 
 		if (i) {
 			ptr->channel = info.channel();
-			ptr->note = info.param1;
+			ptr->note = info.basic.param1;
 			ptr->off_time = _last_event_tick + info.delta + note_length;
 		}
 		break;
 
 	case 0xC: case 0xD:
-		info.param1 = *(_play_pos++);
-		info.param2 = 0;
+		info.basic.param1 = *(_play_pos++);
+		info.basic.param2 = 0;
 		break;
 
 	case 0x8: case 0xA: case 0xB: case 0xE:
-		info.param1 = *(_play_pos++);
-		info.param2 = *(_play_pos++);
+		info.basic.param1 = *(_play_pos++);
+		info.basic.param2 = *(_play_pos++);
 		break;
 
 	case 0xF: // Meta or SysEx event
 		switch (info.event & 0x0F) {
 		case 0x2: // Song Position Pointer
-			info.param1 = *(_play_pos++);
-			info.param2 = *(_play_pos++);
+			info.basic.param1 = *(_play_pos++);
+			info.basic.param2 = *(_play_pos++);
 			break;
 
 		case 0x3: // Song Select
-			info.param1 = *(_play_pos++);
-			info.param2 = 0;
+			info.basic.param1 = *(_play_pos++);
+			info.basic.param2 = 0;
 			break;
 
 		case 0x6: case 0x8: case 0xA: case 0xB: case 0xC: case 0xE:
-			info.param1 = info.param2 = 0;
+			info.basic.param1 = info.basic.param2 = 0;
 			break;
 
 		case 0x0: // SysEx
-			info.length = readVLQ (_play_pos);
-			info.data = _play_pos;
-			_play_pos += info.length;
+			info.ext.length = readVLQ (_play_pos);
+			info.ext.data = _play_pos;
+			_play_pos += info.ext.length;
 			break;
 
 		case 0xF: // META event
-			info.type = *(_play_pos++);
-			info.length = readVLQ (_play_pos);
-			info.data = _play_pos;
-			_play_pos += info.length;
-			if (info.type == 0x51 && info.length == 3) {
+			info.ext.type = *(_play_pos++);
+			info.ext.length = readVLQ (_play_pos);
+			info.ext.data = _play_pos;
+			_play_pos += info.ext.length;
+			if (info.ext.type == 0x51 && info.ext.length == 3) {
 				// Tempo event. We want to make these constant 500,000.
-				info.data[0] = 0x07;
-				info.data[1] = 0xA1;
-				info.data[2] = 0x20;
+				info.ext.data[0] = 0x07;
+				info.ext.data[1] = 0xA1;
+				info.ext.data[2] = 0x20;
 			}
 			break;
 		}





More information about the Scummvm-git-logs mailing list