[Scummvm-cvs-logs] CVS: scummvm/backends/PalmOS/Src/missing _stdlib.cpp,1.11,1.12 math.h,1.5,1.6

Chris Apers chrilith at users.sourceforge.net
Sat Sep 3 10:13:04 CEST 2005


Update of /cvsroot/scummvm/scummvm/backends/PalmOS/Src/missing
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6325

Modified Files:
	_stdlib.cpp math.h 
Log Message:
More ARM stuffs

Index: _stdlib.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/PalmOS/Src/missing/_stdlib.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- _stdlib.cpp	30 Jul 2005 21:10:50 -0000	1.11
+++ _stdlib.cpp	3 Sep 2005 17:11:44 -0000	1.12
@@ -23,10 +23,15 @@
 #include <stdlib.h>
 
 void *bsearch(const void *key, const void *base, UInt32 nmemb, UInt32 size, int (*compar)(const void *, const void *)) {
+#ifdef PALMOS_68K
 	Int32 position;
-
 	if (SysBinarySearch(base, nmemb, size, (SearchFuncPtr)compar, key, 0, &position, true))
 		return (void *)((UInt32)base + size * position);
+#else
+	for (int i = 0; i < nmemb; i++) 
+		if (compar(key, (void*)((UInt32)base + size * i)) == 0)
+			return (void*)((UInt32)base + size * i);
+#endif
 
 	return NULL;
 }
@@ -34,11 +39,11 @@
 long strtol(const char *s, char **endptr, int base) {
 	// WARNING : only base = 10 supported
 	long val = StrAToI(s);
-
+	
 	if (endptr) {
 		Char str[maxStrIToALen];
 		StrIToA(str, val);
-
+		
 		if (StrNCompare(s, str, StrLen(str)) == 0)
 			*endptr = (char *)s + StrLen(str);
 	}
@@ -65,18 +70,18 @@
 }
 
 MemPtr realloc(MemPtr oldP, UInt32 size) {
-
+	
 	if (oldP != NULL)
 		if (MemPtrResize(oldP,size) == 0)
 			return oldP;
 
 	MemPtr	newP = MemPtrNew(size);
-
+	
 	if (oldP!=NULL)
 	{
 		MemMove(newP,oldP,MemPtrSize(oldP));
 		MemPtrFree(oldP);
-	}
+	}	
 	return newP;
 }
 
@@ -84,8 +89,13 @@
 #define ERR_MAGIC	0xDADA
 
 void exit(Int16 status) {
+#ifdef PALMOS_68K
 	EventType event;
 	event.eType = keyDownEvent;
+#else
+	SysEventType event;
+	event.eType = sysEventKeyDownEvent;
+#endif
 	event.data.keyDown.chr = vchrLaunch;
 	event.data.keyDown.modifiers = commandKeyMask;
 	EvtAddUniqueEventToQueue(&event, 0, true);

Index: math.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/PalmOS/Src/missing/math.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- math.h	1 Jan 2005 16:08:45 -0000	1.5
+++ math.h	3 Sep 2005 17:11:44 -0000	1.6
@@ -23,7 +23,11 @@
 #ifndef __MATH_H__
 #define __MATH_H__
 
-#include "mathlib.h"
+#ifndef PALMOS_ARM
+#	include "mathlib.h"
+#else
+#	include "matharm.h"
+#endif
 
 #ifndef M_PI
 #	define M_PI 3.14159265358979323846





More information about the Scummvm-git-logs mailing list