[Scummvm-cvs-logs] SF.net SVN: scummvm:[54089] scummvm/trunk/backends

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Fri Nov 5 11:31:37 CET 2010


Revision: 54089
          http://scummvm.svn.sourceforge.net/scummvm/?rev=54089&view=rev
Author:   fingolfin
Date:     2010-11-05 10:31:36 +0000 (Fri, 05 Nov 2010)

Log Message:
-----------
WINCE: Remove tons of obsolete workaround code for 'missing' headers and funcs

Modified Paths:
--------------
    scummvm/trunk/backends/platform/wince/missing/missing.cpp
    scummvm/trunk/backends/platform/wince/portdefs.h
    scummvm/trunk/backends/saves/default/default-saves.cpp

Removed Paths:
-------------
    scummvm/trunk/backends/platform/wince/missing/conio.h
    scummvm/trunk/backends/platform/wince/missing/dir.h
    scummvm/trunk/backends/platform/wince/missing/direct.h
    scummvm/trunk/backends/platform/wince/missing/dirent.h
    scummvm/trunk/backends/platform/wince/missing/fcntl.h
    scummvm/trunk/backends/platform/wince/missing/gcc/assert.h
    scummvm/trunk/backends/platform/wince/missing/gcc/direct.h
    scummvm/trunk/backends/platform/wince/missing/gcc/errno.h
    scummvm/trunk/backends/platform/wince/missing/gcc/sys/stat.h
    scummvm/trunk/backends/platform/wince/missing/signal.h
    scummvm/trunk/backends/platform/wince/missing/sys/stat.h
    scummvm/trunk/backends/platform/wince/missing/sys/time.h
    scummvm/trunk/backends/platform/wince/missing/sys/types.h
    scummvm/trunk/backends/platform/wince/missing/unistd.h

Deleted: scummvm/trunk/backends/platform/wince/missing/conio.h
===================================================================
--- scummvm/trunk/backends/platform/wince/missing/conio.h	2010-11-05 10:16:36 UTC (rev 54088)
+++ scummvm/trunk/backends/platform/wince/missing/conio.h	2010-11-05 10:31:36 UTC (rev 54089)
@@ -1,2 +0,0 @@
-/* Header is not present in Windows CE SDK */
-

Deleted: scummvm/trunk/backends/platform/wince/missing/dir.h
===================================================================
--- scummvm/trunk/backends/platform/wince/missing/dir.h	2010-11-05 10:16:36 UTC (rev 54088)
+++ scummvm/trunk/backends/platform/wince/missing/dir.h	2010-11-05 10:31:36 UTC (rev 54089)
@@ -1 +0,0 @@
-/* Header is not present in Windows CE SDK */

Deleted: scummvm/trunk/backends/platform/wince/missing/direct.h
===================================================================
--- scummvm/trunk/backends/platform/wince/missing/direct.h	2010-11-05 10:16:36 UTC (rev 54088)
+++ scummvm/trunk/backends/platform/wince/missing/direct.h	2010-11-05 10:31:36 UTC (rev 54089)
@@ -1 +0,0 @@
-/* Header is not present in Windows CE SDK */

Deleted: scummvm/trunk/backends/platform/wince/missing/dirent.h
===================================================================
--- scummvm/trunk/backends/platform/wince/missing/dirent.h	2010-11-05 10:16:36 UTC (rev 54088)
+++ scummvm/trunk/backends/platform/wince/missing/dirent.h	2010-11-05 10:31:36 UTC (rev 54089)
@@ -1,52 +0,0 @@
-/* Header is not present in Windows CE SDK */
-/* It would not be a bad idea to take this thing from gcc distro and port
-   it properly. For now only required part is ported. */
-
-struct dirent
-{
-	long		d_ino;		/* Always zero. */
-	unsigned short	d_reclen;	/* Always zero. */
-	unsigned short	d_namlen;	/* Length of name in d_name. */
-	char*		d_name;		/* File name. */
-	/* NOTE: The name in the dirent structure points to the name in the
-	 *		 finddata_t structure in the DIR. */
-};
-
-/*
- * This is an internal data structure. Good programmers will not use it
- * except as an argument to one of the functions below.
- */
-typedef struct
-{
-	/* disk transfer area for this dir */
-/*	struct _finddata_t	dd_dta; */
-
-	/* dirent struct to return from dir (NOTE: this makes this thread
-	 * safe as long as only one thread uses a particular DIR struct at
-	 * a time) */
-	struct dirent		dd_dir;
-
-	/* _findnext handle */
-	long			dd_handle;
-
-	/*
-		 * Status of search:
-	 *	 0 = not started yet (next entry to read is first entry)
-	 *	-1 = off the end
-	 *	 positive = 0 based index of next entry
-	 */
-	short			dd_stat;
-
-	/* given path for dir with search pattern (struct is extended) */
-	char			dd_name[1];
-} DIR;
-
-
-DIR*		opendir (const char*);
-struct dirent*	readdir (DIR*);
-int		closedir (DIR*);
-/*
-void		rewinddir (DIR*);
-long		telldir (DIR*);
-void		seekdir (DIR*, long);
-*/

Deleted: scummvm/trunk/backends/platform/wince/missing/fcntl.h
===================================================================
--- scummvm/trunk/backends/platform/wince/missing/fcntl.h	2010-11-05 10:16:36 UTC (rev 54088)
+++ scummvm/trunk/backends/platform/wince/missing/fcntl.h	2010-11-05 10:31:36 UTC (rev 54089)
@@ -1 +0,0 @@
-/* Header is not present in Windows CE SDK */

Deleted: scummvm/trunk/backends/platform/wince/missing/gcc/assert.h
===================================================================
--- scummvm/trunk/backends/platform/wince/missing/gcc/assert.h	2010-11-05 10:16:36 UTC (rev 54088)
+++ scummvm/trunk/backends/platform/wince/missing/gcc/assert.h	2010-11-05 10:31:36 UTC (rev 54089)
@@ -1,9 +0,0 @@
-/* Header is not present in Windows CE SDK */
-
-// defined in common/util.h
-void CDECL _declspec(noreturn) error(const char *s, ...);
-
-#define assert(e) ((e) ? (void) 0 : (::error("Assertion failed %s (%s, %d)", #e, __FILE__, __LINE__)))
-
-#define abort() ::error("Abort (%s, %d)", __FILE__, __LINE__)
-

Deleted: scummvm/trunk/backends/platform/wince/missing/gcc/direct.h
===================================================================
--- scummvm/trunk/backends/platform/wince/missing/gcc/direct.h	2010-11-05 10:16:36 UTC (rev 54088)
+++ scummvm/trunk/backends/platform/wince/missing/gcc/direct.h	2010-11-05 10:31:36 UTC (rev 54089)
@@ -1 +0,0 @@
-/* Header is not present in Windows CE SDK */

Deleted: scummvm/trunk/backends/platform/wince/missing/gcc/errno.h
===================================================================
--- scummvm/trunk/backends/platform/wince/missing/gcc/errno.h	2010-11-05 10:16:36 UTC (rev 54088)
+++ scummvm/trunk/backends/platform/wince/missing/gcc/errno.h	2010-11-05 10:31:36 UTC (rev 54089)
@@ -1 +0,0 @@
-/* Header is not present in Windows CE SDK */

Deleted: scummvm/trunk/backends/platform/wince/missing/gcc/sys/stat.h
===================================================================
--- scummvm/trunk/backends/platform/wince/missing/gcc/sys/stat.h	2010-11-05 10:16:36 UTC (rev 54088)
+++ scummvm/trunk/backends/platform/wince/missing/gcc/sys/stat.h	2010-11-05 10:31:36 UTC (rev 54089)
@@ -1,23 +0,0 @@
-/* Header is not present in Windows CE SDK */
-
-#include <sys/types.h>
-
-struct stat {
-	_dev_t st_dev;
-	_ino_t st_ino;
-	unsigned short st_mode;
-	short st_nlink;
-	short st_uid;
-	short st_gid;
-	_dev_t st_rdev;
-	_off_t st_size;
-	time_t st_atime;
-	time_t st_mtime;
-	time_t st_ctime;
-};
-
-
-#define _S_IFDIR        0040000         /* directory */
-#define S_IFDIR  _S_IFDIR
-
-int stat(const char *, struct stat *);

Modified: scummvm/trunk/backends/platform/wince/missing/missing.cpp
===================================================================
--- scummvm/trunk/backends/platform/wince/missing/missing.cpp	2010-11-05 10:16:36 UTC (rev 54088)
+++ scummvm/trunk/backends/platform/wince/missing/missing.cpp	2010-11-05 10:31:36 UTC (rev 54089)
@@ -36,14 +36,7 @@
 #include <tchar.h>
 #include <string.h>
 #include <stdlib.h>
-#include "sys/stat.h"
-#ifndef __GNUC__
-#include "sys/time.h"
-#else
 #include <stdio.h>
-#endif
-#include "time.h"
-#include "dirent.h"
 #include "common/debug.h"
 
 char *strdup(const char *strSource);
@@ -76,44 +69,8 @@
 	return NULL;
 }
 
-static WIN32_FIND_DATA wfd;
+static char cwd[MAX_PATH+1] = "";
 
-int stat(const char *fname, struct stat *ss) {
-	TCHAR fnameUnc[MAX_PATH+1];
-	HANDLE handle;
-	int len;
-
-	if (fname == NULL || ss == NULL)
-		return -1;
-
-	/* Special case (dummy on WinCE) */
-	len = strlen(fname);
-	if (len >= 2 && fname[len-1] == '.' && fname[len-2] == '.' &&
-		(len == 2 || fname[len-3] == '\\')) {
-		/* That's everything implemented so far */
-		memset(ss, 0, sizeof(struct stat));
-		ss->st_size = 1024;
-		ss->st_mode |= S_IFDIR;
-		return 0;
-	}
-
-	MultiByteToWideChar(CP_ACP, 0, fname, -1, fnameUnc, MAX_PATH);
-	handle = FindFirstFile(fnameUnc, &wfd);
-	FindClose(handle);
-	if (handle == INVALID_HANDLE_VALUE)
-		return -1;
-	else
-	{
-		/* That's everything implemented so far */
-		memset(ss, 0, sizeof(struct stat));
-		ss->st_size = wfd.nFileSizeLow;
-		if (wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
-			ss->st_mode |= S_IFDIR;
-	}
-	return 0;
-}
-
-char cwd[MAX_PATH+1] = "";
 EXT_C char *getcwd(char *buffer, int maxlen) {
 	TCHAR fileUnc[MAX_PATH+1];
 	char* plast;
@@ -228,112 +185,6 @@
 // evc only functions follow
 #ifndef __GNUC__
 
-/* Limited dirent implementation. Used by UI.C and DEVICES.C */
-DIR* opendir(const char* fname) {
-	DIR* pdir;
-	char fnameMask[MAX_PATH+1];
-	TCHAR fnameUnc[MAX_PATH+1];
-	char nameFound[MAX_PATH+1];
-
-	if (fname == NULL)
-		return NULL;
-
-	strcpy(fnameMask, fname);
-	if (!strlen(fnameMask) || fnameMask[strlen(fnameMask)-1] != '\\')
-		strncat(fnameMask, "\\", MAX_PATH-strlen(fnameMask)-1);
-	strncat(fnameMask, "*.*", MAX_PATH-strlen(fnameMask)-4);
-
-	pdir = (DIR*)malloc(sizeof(DIR)+strlen(fname));
-	pdir->dd_dir.d_ino = 0;
-	pdir->dd_dir.d_reclen = 0;
-	pdir->dd_dir.d_name = 0;
-	pdir->dd_dir.d_namlen = 0;
-
-	pdir->dd_handle = 0;
-	pdir->dd_stat = 0;
-	strcpy(pdir->dd_name, fname); /* it has exactly enough space for fname and nul char */
-
-	MultiByteToWideChar(CP_ACP, 0, fnameMask, -1, fnameUnc, MAX_PATH);
-	if ((pdir->dd_handle = (long)FindFirstFile(fnameUnc, &wfd)) == (long)INVALID_HANDLE_VALUE) {
-		free(pdir);
-		return NULL;
-	} else {
-		WideCharToMultiByte(CP_ACP, 0, wfd.cFileName, -1, nameFound, MAX_PATH, NULL, NULL);
-
-		pdir->dd_dir.d_name = strdup(nameFound);
-		pdir->dd_dir.d_namlen = strlen(nameFound);
-	}
-	return pdir;
-}
-
-struct dirent* readdir(DIR* dir) {
-	char nameFound[MAX_PATH+1];
-	static struct dirent dummy;
-
-	if (dir->dd_stat == 0) {
-		dummy.d_name = ".";
-		dummy.d_namlen = 1;
-		dir->dd_stat ++;
-		return &dummy;
-	} else if (dir->dd_stat == 1) {
-		dummy.d_name = "..";
-		dummy.d_namlen = 2;
-		dir->dd_stat ++;
-		return &dummy;
-	} else if (dir->dd_stat == 2) {
-		dir->dd_stat++;
-		return &dir->dd_dir;
-	} else {
-		if (FindNextFile((HANDLE)dir->dd_handle, &wfd) == 0) {
-			dir->dd_stat = -1;
-			return NULL;
-		}
-		WideCharToMultiByte(CP_ACP, 0, wfd.cFileName, -1, nameFound, MAX_PATH, NULL, NULL);
-
-		free(dir->dd_dir.d_name);
-
-		dir->dd_dir.d_name = strdup(nameFound);
-		dir->dd_dir.d_namlen = strlen(nameFound);
-
-		dir->dd_stat ++;
-
-		return &dir->dd_dir;
-	}
-}
-
-int closedir(DIR* dir) {
-	if (dir == NULL)
-		return 0;
-
-	if (dir->dd_handle)
-		FindClose((HANDLE)dir->dd_handle);
-
-	free(dir->dd_dir.d_name);
-	free(dir);
-	return 1;
-}
-
-/* Make directory, Unix style */
-void mkdir(char* dirname, int mode) {
-	char  path[MAX_PATH+1];
-	TCHAR pathUnc[MAX_PATH+1];
-	char *ptr;
-	strncpy(path, dirname, MAX_PATH);
-	if (*path == '/')
-		*path = '\\';
-	/* Run through the string and attempt creating all subdirs on the path */
-	for (ptr = path+1; *ptr; ptr ++) {
-		if (*ptr == '\\' || *ptr == '/') {
-			*ptr = 0;
-			MultiByteToWideChar(CP_ACP, 0, path, -1, pathUnc, MAX_PATH);
-			CreateDirectory(pathUnc, 0);
-			*ptr = '\\';
-		}
-	}
-	MultiByteToWideChar(CP_ACP, 0, path, -1, pathUnc, MAX_PATH);
-	CreateDirectory(pathUnc, 0);
-}
-
 char *strdup(const char *strSource) {
 	char *buffer;
 	size_z len = strlen(strSource) + 1;

Deleted: scummvm/trunk/backends/platform/wince/missing/signal.h
===================================================================
--- scummvm/trunk/backends/platform/wince/missing/signal.h	2010-11-05 10:16:36 UTC (rev 54088)
+++ scummvm/trunk/backends/platform/wince/missing/signal.h	2010-11-05 10:31:36 UTC (rev 54089)
@@ -1,3 +0,0 @@
-/* Header is not present in Windows CE SDK */
-/* Functionality is not critical -- Pocket PC devices do not have Ctrl+C */
-#define signal(a,b)

Deleted: scummvm/trunk/backends/platform/wince/missing/sys/stat.h
===================================================================
--- scummvm/trunk/backends/platform/wince/missing/sys/stat.h	2010-11-05 10:16:36 UTC (rev 54088)
+++ scummvm/trunk/backends/platform/wince/missing/sys/stat.h	2010-11-05 10:31:36 UTC (rev 54089)
@@ -1,25 +0,0 @@
-/* Header is not present in Windows CE SDK */
-
-#include <sys/types.h>
-
-#ifndef __MINGW32CE__
-struct stat {
-	_dev_t st_dev;
-	_ino_t st_ino;
-	unsigned short st_mode;
-	short st_nlink;
-	short st_uid;
-	short st_gid;
-	_dev_t st_rdev;
-	_off_t st_size;
-	time_t st_atime;
-	time_t st_mtime;
-	time_t st_ctime;
-};
-
-int stat(const char *, struct stat *);
-
-#endif
-
-#define _S_IFDIR        0040000         /* directory */
-#define S_IFDIR  _S_IFDIR

Deleted: scummvm/trunk/backends/platform/wince/missing/sys/time.h
===================================================================
--- scummvm/trunk/backends/platform/wince/missing/sys/time.h	2010-11-05 10:16:36 UTC (rev 54088)
+++ scummvm/trunk/backends/platform/wince/missing/sys/time.h	2010-11-05 10:31:36 UTC (rev 54089)
@@ -1,10 +0,0 @@
-/* Header is not present in Windows CE SDK */
-
-struct timeval
-{
-	int tv_sec;
-	int tv_usec;
-};
-
-void gettimeofday(struct timeval* tp, void* dummy);
-void usleep(long usec);

Deleted: scummvm/trunk/backends/platform/wince/missing/sys/types.h
===================================================================
--- scummvm/trunk/backends/platform/wince/missing/sys/types.h	2010-11-05 10:16:36 UTC (rev 54088)
+++ scummvm/trunk/backends/platform/wince/missing/sys/types.h	2010-11-05 10:31:36 UTC (rev 54089)
@@ -1,5 +0,0 @@
-/* Header is not present in Windows CE SDK */
-
-typedef unsigned short _ino_t;
-typedef unsigned int _dev_t;
-typedef long _off_t;

Deleted: scummvm/trunk/backends/platform/wince/missing/unistd.h
===================================================================
--- scummvm/trunk/backends/platform/wince/missing/unistd.h	2010-11-05 10:16:36 UTC (rev 54088)
+++ scummvm/trunk/backends/platform/wince/missing/unistd.h	2010-11-05 10:31:36 UTC (rev 54089)
@@ -1 +0,0 @@
-/* Header is not present in Windows CE SDK */

Modified: scummvm/trunk/backends/platform/wince/portdefs.h
===================================================================
--- scummvm/trunk/backends/platform/wince/portdefs.h	2010-11-05 10:16:36 UTC (rev 54088)
+++ scummvm/trunk/backends/platform/wince/portdefs.h	2010-11-05 10:31:36 UTC (rev 54089)
@@ -69,14 +69,10 @@
 #include <string.h>
 #include <io.h>
 #include <stdarg.h>
-#include <fcntl.h>
-#include <conio.h>
-#include <malloc.h>
 #include <assert.h>
 #include <mmsystem.h>
 #include <ctype.h>
 //#include <direct.h>
-#include <time.h>
 
 #ifdef __MINGW32CE__
 	void *bsearch(const void *, const void *, size_t, size_t, int (*x) (const void *, const void *));

Modified: scummvm/trunk/backends/saves/default/default-saves.cpp
===================================================================
--- scummvm/trunk/backends/saves/default/default-saves.cpp	2010-11-05 10:16:36 UTC (rev 54088)
+++ scummvm/trunk/backends/saves/default/default-saves.cpp	2010-11-05 10:31:36 UTC (rev 54089)
@@ -34,9 +34,10 @@
 #include "common/config-manager.h"
 #include "common/zlib.h"
 
+#ifndef _WIN32_WCE
 #include <errno.h>	// for removeSavefile()
+#endif
 
-
 DefaultSaveFileManager::DefaultSaveFileManager() {
 }
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list