rpms/dosbox/devel dosbox-64bit-gcc4.1.patch, NONE, 1.1 dosbox.spec, 1.15, 1.16

Andreas Bierfert (awjb) fedora-extras-commits at redhat.com
Wed Jan 25 14:02:43 UTC 2006


Author: awjb

Update of /cvs/extras/rpms/dosbox/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv14152

Modified Files:
	dosbox.spec 
Added Files:
	dosbox-64bit-gcc4.1.patch 
Log Message:
- apply upstream patch
- fix typos


dosbox-64bit-gcc4.1.patch:

--- NEW FILE dosbox-64bit-gcc4.1.patch ---
diff -ru dosbox-0.63-orig/include/mem.h dosbox-0.63/include/mem.h
--- dosbox-0.63-orig/include/mem.h	2006-01-18 09:57:43.000000000 +0100
+++ dosbox-0.63/include/mem.h	2006-01-18 10:22:29.183958360 +0100
@@ -77,10 +77,6 @@
 	off[3]=(Bit8u)(val >> 24);
 };
 
-#define MLEB(_MLE_VAL_) (_MLE_VAL_)
-#define MLEW(_MLE_VAL_) ((_MLE_VAL_ >> 8) | (_MLE_VAL_ << 8))
-#define MLED(_MLE_VAL_) ((_MLE_VAL_ >> 24)|((_MLE_VAL_ >> 8)&0xFF00)|((_MLE_VAL_ << 8)&0xFF0000)|((_MLE_VAL_ << 24)&0xFF000000))
-
 #else
 
 INLINE Bit8u host_readb(HostPt off) {
@@ -102,16 +98,20 @@
 	*(Bit32u *)(off)=val;
 };
 
-#define MLEB(_MLE_VAL_) (_MLE_VAL_)
-#define MLEW(_MLE_VAL_) (_MLE_VAL_)
-#define MLED(_MLE_VAL_) (_MLE_VAL_)
-
 #endif
 
-#define WLE(VAR_,VAL_)						\
-	if (sizeof(VAR_)==1) VAR_=MLEB(VAL_);	\
-	if (sizeof(VAR_)==2) VAR_=MLEW(VAL_);	\
-	if (sizeof(VAR_)==4) VAR_=MLED(VAL_);
+
+INLINE void var_write(Bit8u * var, Bit8u val) {
+	host_writeb((HostPt)var, val);
+}
+
+INLINE void var_write(Bit16u * var, Bit16u val) {
+	host_writew((HostPt)var, val);
+}
+
+INLINE void var_write(Bit32u * var, Bit32u val) {
+	host_writed((HostPt)var, val);
+}
 
 /* The Folowing six functions are slower but they recognize the paged memory system */
 
diff -ru dosbox-0.63-orig/include/programs.h dosbox-0.63/include/programs.h
--- dosbox-0.63-orig/include/programs.h	2006-01-18 09:57:43.000000000 +0100
+++ dosbox-0.63/include/programs.h	2006-01-18 10:22:29.184958208 +0100
@@ -40,7 +40,7 @@
 	CommandLine * cmd;
 	DOS_PSP * psp;
 	virtual void Run(void)=0;
-	bool Program::GetEnvStr(const char * entry,std::string & result);
+	bool GetEnvStr(const char * entry,std::string & result);
 	bool GetEnvNum(Bitu num,std::string & result);
 	Bitu GetEnvCount(void);
 	bool SetEnv(const char * entry,const char * new_string);
diff -ru dosbox-0.63-orig/src/dos/cdrom_image.cpp dosbox-0.63/src/dos/cdrom_image.cpp
--- dosbox-0.63-orig/src/dos/cdrom_image.cpp	2006-01-18 09:57:43.000000000 +0100
+++ dosbox-0.63/src/dos/cdrom_image.cpp	2006-01-18 10:22:51.518562984 +0100
@@ -32,6 +32,8 @@
 
 #if !defined(WIN32)
 #include <libgen.h>
+#else
+#include <string.h>
 #endif
 
 using namespace std;
@@ -387,6 +389,22 @@
 	return (pvd[0] == 1 && !strncmp((char*)(&pvd[1]), "CD001", 5) && pvd[6] == 1);
 }
 
+#if defined(WIN32)
+static string dirname(char * file) {
+	char * sep = strrchr(file, '\\');
+	if (sep == NULL)
+		sep = strrchr(file, '/');
+	if (sep == NULL)
+		return "";
+	else {
+		int len = (int)(sep - file);
+		char tmp[MAX_FILENAME_LENGTH];
+		strncpy(tmp, file, len);
+		return tmp;
+	}
+}
+#endif
+
 bool CDROM_Interface_Image::LoadCueSheet(char *cuefile)
 {
 	Track track = {0, 0, 0, 0, 0, 0, false, NULL};
@@ -399,11 +417,7 @@
 	bool canAddTrack = false;
 	char tmp[MAX_FILENAME_LENGTH];	// dirname can change its argument
 	strncpy(tmp, cuefile, MAX_FILENAME_LENGTH);
-#if defined(WIN32)
-	string pathname("");
-#else
 	string pathname(dirname(tmp));
-#endif
 	ifstream in;
 	in.open(cuefile, ios::in);
 	if (in.fail()) return false;
@@ -572,13 +586,11 @@
 	if (stat(filename.c_str(), &test) == 0) return true;
 	
 	// check if file with path relative to cue file exists
-#ifndef WIN32
 	string tmpstr(pathname + "/" + filename);
 	if (stat(tmpstr.c_str(), &test) == 0) {
 		filename = tmpstr;
 		return true;
 	}
-#endif
 	// finally check if file is in a dosbox local drive
 	char fullname[CROSS_LEN];
 	char tmp[CROSS_LEN];
diff -ru dosbox-0.63-orig/src/dos/drive_cache.cpp dosbox-0.63/src/dos/drive_cache.cpp
--- dosbox-0.63-orig/src/dos/drive_cache.cpp	2006-01-18 09:57:43.000000000 +0100
+++ dosbox-0.63/src/dos/drive_cache.cpp	2006-01-18 10:22:29.185958056 +0100
@@ -317,7 +317,8 @@
 {
 	char* cpos = strchr(shortName,'~');
 	if (cpos) {
-		Bits compareCount1	= (int)cpos - (int)shortName;
+/* the following code is replaced as it's not safe when char* is 64 bits */
+/*		Bits compareCount1	= (int)cpos - (int)shortName;
 		char* endPos		= strchr(cpos,'.');
 		Bitu numberSize		= endPos ? int(endPos)-int(cpos) : strlen(cpos);
 		
@@ -327,6 +328,18 @@
 
 		compareCount2 -= numberSize;
 		if (compareCount2>compareCount1) compareCount1 = compareCount2;
+*/
+		size_t compareCount1 = strcspn(shortName,"~");
+		size_t numberSize    = strcspn(cpos,".");
+		size_t compareCount2 = strcspn(compareName,".");
+		if(compareCount2 > 8) compareCount2 = 8;
+		/* We want 
+		 * compareCount2 -= numberSize;
+		 * if (compareCount2>compareCount1) compareCount1 = compareCount2;
+		 * but to prevent negative numbers: 
+		 */
+		if(compareCount2 > compareCount1 + numberSize)
+			compareCount1 = compareCount2 - numberSize;
 		return strncmp(compareName,shortName,compareCount1);
 	}
 	return strcmp(compareName,shortName);
diff -ru dosbox-0.63-orig/src/dos/drive_local.cpp dosbox-0.63/src/dos/drive_local.cpp
--- dosbox-0.63-orig/src/dos/drive_local.cpp	2006-01-18 09:57:43.000000000 +0100
+++ dosbox-0.63/src/dos/drive_local.cpp	2006-01-18 10:22:29.185958056 +0100
@@ -409,7 +409,7 @@
 	//TODO Give some doserrorcode;
 		return false;//ERROR
 	}
-	int ret=fseek(fhandle,*pos,seektype);
+	int ret=fseek(fhandle,*reinterpret_cast<Bit32s*>(pos),seektype);
 	if (ret!=0) {
 		// Out of file range, pretend everythings ok 
 		// and move file pointer top end of file... ?! (Black Thorne)
diff -ru dosbox-0.63-orig/src/gui/midi_alsa.h dosbox-0.63/src/gui/midi_alsa.h
--- dosbox-0.63-orig/src/gui/midi_alsa.h	2006-01-18 09:57:43.000000000 +0100
+++ dosbox-0.63/src/gui/midi_alsa.h	2006-01-18 10:22:29.186957904 +0100
@@ -112,7 +112,7 @@
 			}
 			break;
 		default:
-			LOG(LOG_MISC,LOG_WARN)("ALSA:Unknown Command: %08x", (int)msg);
+			LOG(LOG_MISC,LOG_WARN)("ALSA:Unknown Command: %08lx", (long)msg);
 			send_event(1);
 			break;
 		}
diff -ru dosbox-0.63-orig/src/ints/int10_vesa.cpp dosbox-0.63/src/ints/int10_vesa.cpp
--- dosbox-0.63-orig/src/ints/int10_vesa.cpp	2006-01-18 09:57:43.000000000 +0100
+++ dosbox-0.63/src/ints/int10_vesa.cpp	2006-01-18 10:22:29.186957904 +0100
@@ -133,27 +133,27 @@
 	VideoModeBlock * mblock=&ModeList_VGA[i];
 	switch (mblock->type) {
 	case M_LIN8:		//Linear 8-bit
-		WLE(minfo.ModeAttributes,0x9b);
-		WLE(minfo.WinAAttributes,0x7);	//Exists/readable/writable
-		WLE(minfo.WinGranularity,64);
-		WLE(minfo.WinSize,64);
-		WLE(minfo.WinASegment,0xa000);
-//		WLE(minfo.WinBSegment,0xa000);
-		WLE(minfo.WinFuncPtr,CALLBACK_RealPointer(callback.setwindow));
-		WLE(minfo.BytesPerScanLine,mblock->swidth);
-		WLE(minfo.NumberOfPlanes,0x1);
-		WLE(minfo.BitsPerPixel,0x08);
-		WLE(minfo.NumberOfBanks,0x1);
-		WLE(minfo.MemoryModel,0x04);	//packed pixel
-		WLE(minfo.NumberOfImagePages,0x05);
-		WLE(minfo.Reserved_page,0x1);
+		var_write(&minfo.ModeAttributes,0x9b);
+		var_write(&minfo.WinAAttributes,0x7);	//Exists/readable/writable
+		var_write(&minfo.WinGranularity,64);
+		var_write(&minfo.WinSize,64);
+		var_write(&minfo.WinASegment,0xa000);
+//		var_write(&minfo.WinBSegment,0xa000);
+		var_write(&minfo.WinFuncPtr,CALLBACK_RealPointer(callback.setwindow));
+		var_write(&minfo.BytesPerScanLine,mblock->swidth);
+		var_write(&minfo.NumberOfPlanes,0x1);
+		var_write(&minfo.BitsPerPixel,0x08);
+		var_write(&minfo.NumberOfBanks,0x1);
+		var_write(&minfo.MemoryModel,0x04);	//packed pixel
+		var_write(&minfo.NumberOfImagePages,0x05);
+		var_write(&minfo.Reserved_page,0x1);
 		break;
 	}
-	WLE(minfo.XResolution,mblock->swidth);
-	WLE(minfo.YResolution,mblock->sheight);
-	WLE(minfo.XCharSize,mblock->cwidth);
-	WLE(minfo.YCharSize,mblock->cheight);
-	WLE(minfo.PhysBasePtr,S3_LFB_BASE);
+	var_write(&minfo.XResolution,mblock->swidth);
+	var_write(&minfo.YResolution,mblock->sheight);
+	var_write(&minfo.XCharSize,mblock->cwidth);
+	var_write(&minfo.YCharSize,mblock->cheight);
+	var_write(&minfo.PhysBasePtr,S3_LFB_BASE);
 
 	MEM_BlockWrite(buf,&minfo,sizeof(MODE_INFO));
 	return 0x00;


Index: dosbox.spec
===================================================================
RCS file: /cvs/extras/rpms/dosbox/devel/dosbox.spec,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- dosbox.spec	25 Jan 2006 12:56:36 -0000	1.15
+++ dosbox.spec	25 Jan 2006 14:02:43 -0000	1.16
@@ -1,6 +1,6 @@
 Name:           dosbox
 Version:        0.63
-Release:        7%{?dist}
+Release:        8%{?dist}
 
 Summary:        x86/DOS emulator with sound and graphics
 
@@ -10,8 +10,8 @@
 Source0:        http://dl.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
 Source1:        dosbox.desktop
 Source2:        dosbox.png
-Patch0:         dosbox-x86-64-build.patch
-Patch1:         dosbox-gcc4.1.patch
+# See upstream bug 1414547
+Patch0:         dosbox-64bit-gcc4.1.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root
 
 BuildRequires:  libpng-devel
@@ -33,8 +33,7 @@
 
 %prep
 %setup -q
-%patch0
-%patch1
+%patch0 -p1
 
 %build
 %configure --enable-shots
@@ -73,18 +72,23 @@
 
 
 %changelog
+* Wed Jan 25 2006 Andreas Bierfert <andreas.bierfert[AT]lowlatency.de>
+0.63-8
+- apply upstream patch
+- fix typos
+
 * Sun Jan 22 2006 Andreas Bierfert <andreas.bierfert[AT]lowlatency.de>
-0.64-7
+0.63-7
 - add dist
 - rebuild
 - add gcc4.1 patch
 
 * Mon May 30 2005 Andreas Bierfert <andreas.bierfert[AT]lowlatency.de>
-0.64-6
+0.63-6
 - add a x86_64 bugfix from upstream 
 
 * Mon May 30 2005 Andreas Bierfert <andreas.bierfert[AT]lowlatency.de>
-0.64-5
+0.63-5
 - more build fixes and cleanups...
 
 * Mon May 30 2005 Andreas Bierfert <andreas.bierfert[AT]lowlatency.de>




More information about the fedora-extras-commits mailing list