From 2a0ed36a96293edd589207b43f8c130d3b4e2cb4 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Sun, 27 Jun 2010 01:30:05 +0200 Subject: [PATCH] Bug 508905 - /Zc:wchar_t- is no longer required (wince part) r=doug.turner --HG-- extra : rebase_source : 13d6dadb676ca5e29b7e7bcfff5bbb1c964f78e4 --- build/wince/shunt/environment.cpp | 20 ++++++++++---------- build/wince/shunt/include/environment.h | 10 +++++----- build/wince/shunt/include/mozce_shunt.h | 20 ++++++++++---------- build/wince/shunt/shunt.cpp | 16 ++++++++-------- xpcom/glue/nsGREGlue.cpp | 4 ++-- 5 files changed, 35 insertions(+), 35 deletions(-) diff --git a/build/wince/shunt/environment.cpp b/build/wince/shunt/environment.cpp index 6eaa8fcdd5f..31f0e3d3cdd 100644 --- a/build/wince/shunt/environment.cpp +++ b/build/wince/shunt/environment.cpp @@ -159,8 +159,8 @@ getenv(const char* name) } char -GetEnvironmentVariableW(const unsigned short* lpName, - unsigned short* lpBuffer, +GetEnvironmentVariableW(const WCHAR* lpName, + WCHAR* lpBuffer, unsigned long nSize) { char key[256]; @@ -180,8 +180,8 @@ GetEnvironmentVariableW(const unsigned short* lpName, } char -SetEnvironmentVariableW(const unsigned short* name, - const unsigned short* value) +SetEnvironmentVariableW(const WCHAR* name, + const WCHAR* value) { char key[256]; char val[256]; @@ -204,8 +204,8 @@ SetEnvironmentVariableW(const unsigned short* name, } -unsigned int ExpandEnvironmentStringsW(const unsigned short* lpSrc, - unsigned short* lpDst, +unsigned int ExpandEnvironmentStringsW(const WCHAR* lpSrc, + WCHAR* lpDst, unsigned int nSize) { if ( NULL == lpDst ) @@ -215,8 +215,8 @@ unsigned int ExpandEnvironmentStringsW(const unsigned short* lpSrc, unsigned int index = 0; unsigned int origLen = wcslen(lpSrc); - const unsigned short *pIn = lpSrc; - unsigned short *pOut = lpDst; + const WCHAR *pIn = lpSrc; + WCHAR *pOut = lpDst; while ( index < origLen ) { @@ -228,7 +228,7 @@ unsigned int ExpandEnvironmentStringsW(const unsigned short* lpSrc, // Have a starting '%' - look for matching '%' int envlen = 0; - const unsigned short *pTmp = pIn + 1; + const WCHAR *pTmp = pIn + 1; while ( *pTmp != L'%' && *pTmp != L' ' ) { envlen++, pTmp++; if ( origLen < index + envlen ) { // Ran past end of original @@ -274,7 +274,7 @@ unsigned int ExpandEnvironmentStringsW(const unsigned short* lpSrc, return size; } -unsigned short * +WCHAR * mozce_GetEnvironmentCL() { env_entry *entry = env_head; diff --git a/build/wince/shunt/include/environment.h b/build/wince/shunt/include/environment.h index 825c03ffc18..f22aff3f308 100644 --- a/build/wince/shunt/include/environment.h +++ b/build/wince/shunt/include/environment.h @@ -47,14 +47,14 @@ extern "C" { /* Environment stuff */ char* getenv(const char* inName); int putenv(const char *a); -char SetEnvironmentVariableW(const unsigned short * name, const unsigned short * value ); -char GetEnvironmentVariableW(const unsigned short * lpName, unsigned short* lpBuffer, unsigned long nSize); +char SetEnvironmentVariableW(const wchar_t * name, const wchar_t * value ); +char GetEnvironmentVariableW(const wchar_t * lpName, wchar_t* lpBuffer, unsigned long nSize); -unsigned int ExpandEnvironmentStringsW(const unsigned short* lpSrc, - unsigned short* lpDst, +unsigned int ExpandEnvironmentStringsW(const wchar_t* lpSrc, + wchar_t* lpDst, unsigned int nSize); -unsigned short* mozce_GetEnvironmentCL(); +wchar_t* mozce_GetEnvironmentCL(); #ifdef __cplusplus }; diff --git a/build/wince/shunt/include/mozce_shunt.h b/build/wince/shunt/include/mozce_shunt.h index 84d5ea48296..155adb1b978 100644 --- a/build/wince/shunt/include/mozce_shunt.h +++ b/build/wince/shunt/include/mozce_shunt.h @@ -38,8 +38,6 @@ #ifndef MOZCE_SHUNT_H #define MOZCE_SHUNT_H -#include "environment.h" - #ifdef __cplusplus extern "C" { #endif @@ -53,6 +51,8 @@ typedef unsigned short wchar_t; } //extern "C" #endif +#include "environment.h" + #ifdef MOZ_MEMORY #ifdef __cplusplus @@ -182,18 +182,18 @@ void abort(void); /* Environment stuff */ char* getenv(const char* inName); int putenv(const char *a); -char SetEnvironmentVariableW(const unsigned short * name, const unsigned short * value ); -char GetEnvironmentVariableW(const unsigned short * lpName, unsigned short* lpBuffer, unsigned long nSize); +char SetEnvironmentVariableW(const wchar_t * name, const wchar_t * value ); +char GetEnvironmentVariableW(const wchar_t * lpName, wchar_t* lpBuffer, unsigned long nSize); -unsigned int ExpandEnvironmentStringsW(const unsigned short* lpSrc, - unsigned short* lpDst, +unsigned int ExpandEnvironmentStringsW(const wchar_t* lpSrc, + wchar_t* lpDst, unsigned int nSize); /* File system stuff */ -unsigned short * _wgetcwd(unsigned short* dir, unsigned long size); -unsigned short *_wfullpath( unsigned short *absPath, const unsigned short *relPath, unsigned long maxLength ); +wchar_t * _wgetcwd(wchar_t* dir, unsigned long size); +wchar_t *_wfullpath(wchar_t *absPath, const wchar_t *relPath, unsigned long maxLength ); int _unlink(const char *filename ); -int _wchdir(const unsigned short* path); +int _wchdir(const wchar_t* path); /* The time stuff should be defined here, but it can't be because it is already defined in time.h. @@ -228,7 +228,7 @@ struct tm* localtime_r(const time_t* inTimeT, struct tm* outRetval); */ -unsigned short* mozce_GetEnvironmentCL(); +wchar_t* mozce_GetEnvironmentCL(); /* square root of 1/2, missing from math.h */ #define M_SQRT1_2 0.707106781186547524401 diff --git a/build/wince/shunt/shunt.cpp b/build/wince/shunt/shunt.cpp index b3dd0c0e3e7..99d9d92eb13 100644 --- a/build/wince/shunt/shunt.cpp +++ b/build/wince/shunt/shunt.cpp @@ -113,15 +113,15 @@ int errno = 0; // File System Stuff //////////////////////////////////////////////////////// -unsigned short * _wgetcwd(unsigned short * dir, unsigned long size) +wchar_t * _wgetcwd(wchar_t * dir, unsigned long size) { - unsigned short tmp[MAX_PATH] = {0}; + wchar_t tmp[MAX_PATH] = {0}; GetEnvironmentVariableW(L"CWD", tmp, size); if (tmp && tmp[0]) { if (wcslen(tmp) > size) return 0; if (!dir) { - dir = (unsigned short*)malloc(sizeof(unsigned short) * (wcslen(tmp) + 2)); + dir = (wchar_t*)malloc(sizeof(wchar_t) * (wcslen(tmp) + 2)); if (!dir) return 0; } @@ -129,7 +129,7 @@ unsigned short * _wgetcwd(unsigned short * dir, unsigned long size) } else { unsigned long i; if (!dir) { - dir = (unsigned short*)malloc(sizeof(unsigned short) * (MAX_PATH + 1)); + dir = (wchar_t*)malloc(sizeof(wchar_t) * (MAX_PATH + 1)); if (!dir) return 0; } @@ -147,12 +147,12 @@ unsigned short * _wgetcwd(unsigned short * dir, unsigned long size) return dir; } -unsigned short *_wfullpath( unsigned short *absPath, const unsigned short *relPath, unsigned long maxLength ) +wchar_t *_wfullpath( wchar_t *absPath, const wchar_t *relPath, unsigned long maxLength ) { if(absPath == NULL){ - absPath = (unsigned short *)malloc(maxLength*sizeof(unsigned short)); + absPath = (wchar_t *)malloc(maxLength*sizeof(wchar_t)); } - unsigned short cwd[MAX_PATH]; + wchar_t cwd[MAX_PATH]; if (NULL == _wgetcwd( cwd, MAX_PATH)) return NULL; @@ -181,7 +181,7 @@ int _wchdir(const WCHAR* path) { int _unlink(const char *filename) { - unsigned short wname[MAX_PATH]; + wchar_t wname[MAX_PATH]; MultiByteToWideChar(CP_ACP, 0, diff --git a/xpcom/glue/nsGREGlue.cpp b/xpcom/glue/nsGREGlue.cpp index ec677aaa451..814d7ed87e9 100644 --- a/xpcom/glue/nsGREGlue.cpp +++ b/xpcom/glue/nsGREGlue.cpp @@ -197,8 +197,8 @@ GRE_GetGREPathWithProperties(const GREVersionRange *versions, #elif WINCE if (p[0] != '\\') { - unsigned short dir[MAX_PATH]; - unsigned short path[MAX_PATH]; + WCHAR dir[MAX_PATH]; + WCHAR path[MAX_PATH]; MultiByteToWideChar(CP_ACP, 0, p, -1, path, MAX_PATH); _wfullpath(dir,path,MAX_PATH); WideCharToMultiByte(CP_ACP, 0, dir, -1, aBuffer, MAX_PATH, NULL, NULL);