aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorMax Horn2009-01-23 03:23:30 +0000
committerMax Horn2009-01-23 03:23:30 +0000
commit3e7155981e020bc19540abc8486b816cb57c8a41 (patch)
tree47df27d81c33ac61f86ce9aff0a7b99109a5547b /backends
parent72702130d95477eb84904f22b0024ea30765922b (diff)
downloadscummvm-rg350-3e7155981e020bc19540abc8486b816cb57c8a41.tar.gz
scummvm-rg350-3e7155981e020bc19540abc8486b816cb57c8a41.tar.bz2
scummvm-rg350-3e7155981e020bc19540abc8486b816cb57c8a41.zip
DS: Nothing is supposed to use time(), so don't globally include <time.h> -- in particular, no need to fake a time() impl if the only code using it is the backend itself ;)
svn-id: r36012
Diffstat (limited to 'backends')
-rw-r--r--backends/platform/ds/arm9/source/osystem_ds.cpp11
-rw-r--r--backends/platform/ds/arm9/source/portdefs.cpp21
-rw-r--r--backends/platform/ds/arm9/source/portdefs.h11
3 files changed, 10 insertions, 33 deletions
diff --git a/backends/platform/ds/arm9/source/osystem_ds.cpp b/backends/platform/ds/arm9/source/osystem_ds.cpp
index df7e426df5..38aa57948c 100644
--- a/backends/platform/ds/arm9/source/osystem_ds.cpp
+++ b/backends/platform/ds/arm9/source/osystem_ds.cpp
@@ -38,6 +38,9 @@
#include "touchkeyboard.h"
#include "backends/fs/ds/ds-fs-factory.h"
+#include <time.h>
+
+
OSystem_DS* OSystem_DS::_instance = NULL;
OSystem_DS::OSystem_DS()
@@ -545,8 +548,14 @@ void OSystem_DS::delayMillis(uint msecs) {
DS::addEventsToQueue();
}
+
void OSystem_DS::getTimeAndDate(struct tm &t) const {
- time_t curTime = time(0);
+ time_t curTime;
+#if 0
+ curTime = time(0);
+#else
+ curTime = 0xABCD1234 + getMillis() / 1000;
+#endif
t = *localtime(&curTime);
}
diff --git a/backends/platform/ds/arm9/source/portdefs.cpp b/backends/platform/ds/arm9/source/portdefs.cpp
index 74a41faca0..0dcdc1d5a3 100644
--- a/backends/platform/ds/arm9/source/portdefs.cpp
+++ b/backends/platform/ds/arm9/source/portdefs.cpp
@@ -33,24 +33,3 @@ extern "C" time_t __wrap_time(time_t* t) {
return OSystem_DS::instance()->getMillis() / 1000;
}
*/
-
-
-
-time_t DS_time(time_t) {
- if (OSystem_DS::instance()) {
- return 0xABCD1234 + (OSystem_DS::instance()->getMillis() / 1000);
- } else {
- return 0xABCD1234;
- }
-}
-
-time_t DS_time(long* t) {
- if (OSystem_DS::instance()) {
- if (t) *t = 0xABCD1234 + (OSystem_DS::instance()->getMillis() / 1000);
- return 0xABCD1234 + (OSystem_DS::instance()->getMillis() / 1000);
- } else {
- if (t) *t = 0xABCD1234;
- return 0xABCD1234;
- }
-}
-
diff --git a/backends/platform/ds/arm9/source/portdefs.h b/backends/platform/ds/arm9/source/portdefs.h
index 8a14420907..58d4df9020 100644
--- a/backends/platform/ds/arm9/source/portdefs.h
+++ b/backends/platform/ds/arm9/source/portdefs.h
@@ -38,7 +38,6 @@ typedef signed int s32;
#include "nds/jtypes.h"
-
// Somebody removed these from scummsys.h, but they're still required, so I'm adding them here
// in the hope that they'll stay.
#include <stdio.h>
@@ -47,7 +46,6 @@ typedef signed int s32;
#include <stdarg.h>
#include <ctype.h>
#include <math.h>
-#include <time.h>
#define double float
@@ -76,8 +74,6 @@ int consolePrintf(const char* s, ...);
//#define debug(fmt, ...) consolePrintf(fmt, ##__VA_ARGS__)
//#define debug(fmt, ...) debug(0, fmt, ##__VA_ARGS__)
-#define time(t) DS_time(t)
-//#define memcpy(dest, src, size) DS_memcpy(dest, src, size)
#define ITCM_DATA __attribute__((section(".itcm")))
@@ -86,11 +82,4 @@ int consolePrintf(const char* s, ...);
// a more conventional form of input where the menus can be clicked on.
#define LURE_CLICKABLE_MENUS
-//#include "common/array.h"
-//#include "common/str.h"
-
-time_t DS_time(time_t* t);
-time_t DS_time(long* t);
-void* DS_memcpy(void* s1, void const* s2, size_t n);
-
#endif