Changeset 24774
- Timestamp:
- 11/25/08 02:27:04 (5 years ago)
- Location:
- lang/cplusplus/i3/trunk
- Files:
-
- 16 modified
-
src/Common.h (modified) (4 diffs)
-
src/Config.cpp (modified) (4 diffs)
-
src/Config.h (modified) (1 diff)
-
src/Mediator.cpp (modified) (2 diffs)
-
src/gui-windows/InputWindowCore.cpp (modified) (1 diff)
-
src/mol/include/mol/Thread.h (modified) (1 diff)
-
src/mol/src/DebugLogger.cpp (modified) (2 diffs)
-
src/mol/src/Test2.cpp (modified) (1 diff)
-
src/mol/src/windows/WindowProcedureTest.cpp (modified) (1 diff)
-
src/os-windows/CygwinPty.cpp (modified) (1 diff)
-
src/os-windows/Os.cpp (modified) (1 diff)
-
src/os-windows/OsTest1.cpp (modified) (1 diff)
-
src/os-windows/OsTest2.cpp (modified) (2 diffs)
-
src/os-windows/msvc/win_iconv.c (modified) (4 diffs)
-
windows/i3_test.vcproj (modified) (2 diffs)
-
windows/mol_test.vcproj (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/cplusplus/i3/trunk/src/Common.h
r24540 r24774 20 20 #include <iconv.h> 21 21 #include <libintl.h> 22 23 // disable POSIX/XSI format strings 24 #undef fprintf 25 #undef vfprintf 26 #undef printf 27 #undef vprintf 28 #undef sprintf 29 #undef vsprintf 30 #undef snprintf 31 #undef vsnprintf 32 22 33 //#include <argtable2.h> 23 34 #ifdef HAVE_POPT_H … … 94 105 #define UTF8_TO_UTF16LE_ALLOCA(data8, data16) \ 95 106 wchar_t* data16 = NULL; \ 96 do{ \107 for (;;) { \ 97 108 const char* check = data8; check; \ 98 109 unsigned int num_elements = MultiByteToWideChar(CP_UTF8, 0, data8, -1, NULL, 0); \ … … 116 127 break; \ 117 128 } \ 118 } while (0) 129 break; \ 130 } 119 131 120 132 #define UTF16LE_TO_UTF8_ALLOCA(data16, data8) \ 121 133 char* data8 = NULL; \ 122 do{ \134 for (;;) { \ 123 135 const wchar_t* check = data16; check; \ 124 136 unsigned int num_elements = WideCharToMultiByte( CP_UTF8, 0, data16, -1, NULL, 0, 0, 0); \ … … 137 149 break; \ 138 150 } \ 139 } while (0) 151 break; \ 152 } 140 153 141 154 -
lang/cplusplus/i3/trunk/src/Config.cpp
r24540 r24774 3 3 #include "Mediator.h" 4 4 #include "Config.h" 5 6 #include <vector> 7 #include <list> 5 8 6 9 namespace i3 … … 113 116 }; 114 117 */ 115 struct MyIniLoader : public grammar<MyIniLoader> 118 struct MyIniLoader : public grammar<MyIniLoader>, public boost::noncopyable 116 119 { 117 120 struct integer_value … … 299 302 } 300 303 301 void load_config(Config& destination,const TCHAR* str)304 i3::Config parse_config(const TCHAR* str) 302 305 { 303 306 using namespace i3::config; 304 307 using namespace boost::spirit; 305 i3::config::ConfigTemp c; 308 309 i3::config::ConfigTemp c = {}; 310 i3::Config destination; 306 311 307 312 MyIniLoader i(c); … … 358 363 abort(); 359 364 } 365 return destination; 360 366 } 361 367 -
lang/cplusplus/i3/trunk/src/Config.h
r24540 r24774 42 42 43 43 44 void copy_config(Config& destination, const Config& source); 45 void load_config(Config& destination, const TCHAR* str); 44 Config parse_config(const TCHAR* str); 46 45 47 46 } -
lang/cplusplus/i3/trunk/src/Mediator.cpp
r23069 r24774 21 21 exit_status Mediator::start() 22 22 { 23 if (true) 24 { 23 #if 1 25 24 // threaded 25 inputWindow.createUI(); 26 26 completionWindow.start(); 27 27 outputWindow.start(); 28 28 shellManager.start(); 29 29 inputWindow.run(); 30 } 31 else 32 { 30 #else 33 31 // no threaded gui 34 32 completionWindow.createUI(); … … 38 36 39 37 global_loop(); 40 } 41 38 #endif 42 39 return 0; 43 40 } -
lang/cplusplus/i3/trunk/src/gui-windows/InputWindowCore.cpp
r23153 r24774 29 29 void InputWindowCore<InputWindow>::createUI() 30 30 { 31 if (getWindow()) { 32 return; 33 } 34 31 35 LoadLibrary(_T("RICHED32.DLL")); 32 36 //LoadLibrary(_T("Riched20.dll")); // required? -
lang/cplusplus/i3/trunk/src/mol/include/mol/Thread.h
r23714 r24774 59 59 void start() 60 60 { 61 #if MOL_OS_WINDOWS 62 Sleep(100); 63 #else 64 #endif 61 65 core.start(); 62 66 } -
lang/cplusplus/i3/trunk/src/mol/src/DebugLogger.cpp
r23048 r24774 1 1 #include <mol/PrecompiledHeaders.h> 2 2 #include <mol/Mol.h> 3 #include <mol/Debug.h> 3 4 4 5 using namespace std; … … 9 10 void clear_mapped_file(HANDLE mapped_file) 10 11 { 11 12 12 int8_t (*const view)[sizeof(DebugMappedFile)] = (int8_t(*const)[sizeof(DebugMappedFile)])MapViewOfFile( 13 13 mapped_file, FILE_MAP_WRITE, 0, 0, sizeof(DebugMappedFile)); -
lang/cplusplus/i3/trunk/src/mol/src/Test2.cpp
r23153 r24774 3 3 #include <mol/MscCrt.h> 4 4 #include <boost/test/unit_test.hpp> 5 6 #if defined(_MSC_VER) && !defined(NDEBUG) 7 #pragma warning (disable: 4189) 8 #endif 5 9 6 10 template <typename T> -
lang/cplusplus/i3/trunk/src/mol/src/windows/WindowProcedureTest.cpp
r22570 r24774 79 79 MSG msg = {}; 80 80 unsigned int loop = 100; 81 while (true)81 for (;;) 82 82 { 83 83 Sleep(1); -
lang/cplusplus/i3/trunk/src/os-windows/CygwinPty.cpp
r23153 r24774 91 91 92 92 if (!DuplicateHandle(GetCurrentProcess(),hMyStdInput ,GetCurrentProcess(),NULL, 0, FALSE, DUPLICATE_SAME_ACCESS) || 93 !DuplicateHandle(GetCurrentProcess(),hMyStdOutput,GetCurrentProcess(),NULL, 0, FALSE, DUPLICATE_SAME_ACCESS) ||94 !DuplicateHandle(GetCurrentProcess(),hMyStdError ,GetCurrentProcess(),NULL, 0, FALSE, DUPLICATE_SAME_ACCESS))93 !DuplicateHandle(GetCurrentProcess(),hMyStdOutput,GetCurrentProcess(),NULL, 0, FALSE, DUPLICATE_SAME_ACCESS) || 94 !DuplicateHandle(GetCurrentProcess(),hMyStdError ,GetCurrentProcess(),NULL, 0, FALSE, DUPLICATE_SAME_ACCESS)) 95 95 { 96 96 -
lang/cplusplus/i3/trunk/src/os-windows/Os.cpp
r24540 r24774 67 67 } 68 68 69 TCHAR locale_dir[ 1000] = {};69 TCHAR locale_dir[3000] = {}; 70 70 DWORD result = GetModuleFileName( 71 71 GetModuleHandle(NULL), 72 72 locale_dir, 73 73 _countof(locale_dir)); 74 if (result == 0 || result == _countof(locale_dir)) // error 75 { 76 memset(locale_dir, 0, sizeof(locale_dir)); 77 return; 78 } 74 if (result == 0 || result == _countof(locale_dir)) 75 { 76 //memset(locale_dir, 0, sizeof(locale_dir)); 77 return; 78 } 79 79 80 if (PathRemoveFileSpec(locale_dir) == FALSE) 80 81 { 81 memset(locale_dir, 0, sizeof(locale_dir)); 82 return; 83 } 84 if (0 != _tcscat_s(locale_dir, _T("\\locale"))) 85 { 86 memset(locale_dir, 0, sizeof(locale_dir)); 82 //memset(locale_dir, 0, sizeof(locale_dir)); 83 return; 84 } 85 86 TCHAR more[] = _T("locale"); 87 if (_countof(locale_dir) <= _countof(more) + _tcslen(locale_dir) + 1) 88 { 89 //memset(locale_dir, 0, sizeof(locale_dir)); 90 return; 91 } 92 93 if (PathAppend(locale_dir, more) == FALSE) 94 { 95 //memset(locale_dir, 0, sizeof(locale_dir)); 87 96 return; 88 97 } -
lang/cplusplus/i3/trunk/src/os-windows/OsTest1.cpp
r23153 r24774 80 80 BOOST_CHECK(true); 81 81 } 82 83 84 #if defined(_MSC_VER) && !defined(NDEBUG) 85 #pragma warning (disable: 4309) 86 #endif 82 87 83 88 char testdata_utf8[] = -
lang/cplusplus/i3/trunk/src/os-windows/OsTest2.cpp
r23617 r24774 3 3 4 4 #include "Common.h" 5 #include "Config.h" 5 6 #include "Utf8ToUtf16Stream.h" 7 8 #include <iostream> 9 #include <fstream> 6 10 7 11 #define WINDOWS_PATH_MAX_ELEMENTS 4000 8 12 9 13 using namespace std; 14 15 BOOST_AUTO_TEST_CASE(bcooooiodefgffffh) 16 { 17 i3::Config config = i3::parse_config(_T("foo")); 18 const TCHAR* foo = config.string_key; 19 } 10 20 11 21 BOOST_AUTO_TEST_CASE(bcooooiodefgh) … … 15 25 cygwin1_cygwin_dll_init(); 16 26 17 FARPROC cygwin1_mkdir =GetProcAddress(cygwin1, "rmdir");18 int result = ((int (*)(const char *pathname))cygwin1_mkdir)("/test");27 int (*cygwin1_rmdir)(const char*) = (decltype(cygwin1_rmdir))GetProcAddress(cygwin1, "rmdir"); 28 int result = cygwin1_rmdir("/test"); 19 29 FreeLibrary(cygwin1); 20 30 } -
lang/cplusplus/i3/trunk/src/os-windows/msvc/win_iconv.c
r24539 r24774 26 26 27 27 #include <windows.h> 28 #include <errno.h>29 28 #include <string.h> 30 29 #include <stdlib.h> 30 31 #ifndef _WIN32_WCE 32 #include <errno.h> 33 #else 34 35 #ifdef _MSC_VER 36 __declspec (thread) int errno = 0; 37 #else 38 //_thread int errno = 0; 39 int errno = 0; 40 #endif 41 42 static int* _errno(void) 43 { 44 return &errno; 45 } 46 47 #define E2BIG 7 /* Arg list too long */ 48 #define ENOMEM 12 /* Not enough space */ 49 #define EINVAL 22 /* Invalid argument */ 50 #define EILSEQ 42 /* Illegal byte sequence */ 51 #undef GetProcAddress 52 #define GetProcAddress(hModule, lpProcName) GetProcAddressW(hModule, L##lpProcName) 53 #endif 31 54 32 55 #if 0 … … 1423 1446 hr = ConvertINetUnicodeToMultiByte(&cv->mode, cv->codepage, 1424 1447 (const wchar_t *)wbuf, &wbufsize, tmpbuf, &tmpsize); 1425 if (hr != S_OK || insize != wbufsize) {1448 if (hr != S_OK || insize != wbufsize) 1426 1449 return_error(EILSEQ); 1427 } else if (bufsize < tmpsize) {1450 else if (bufsize < tmpsize) 1428 1451 return_error(E2BIG); 1429 } else if (cv->mblen(cv, (uchar *)tmpbuf, tmpsize) != tmpsize) {1452 else if (cv->mblen(cv, (uchar *)tmpbuf, tmpsize) != tmpsize) 1430 1453 return_error(EILSEQ); 1431 }1432 1433 if (tmpsize >= sizeof(tmpbuf)) {1434 return_error(E2BIG);1435 }1436 1454 memcpy(buf, tmpbuf, tmpsize); 1437 1455 return tmpsize; … … 1503 1521 utf32_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize) 1504 1522 { 1505 uint wc = 0;1523 uint wc; 1506 1524 1507 1525 if (bufsize < 4) … … 1700 1718 { 1701 1719 iso2022_esc_t *iesc = iso2022jp_esc; 1702 char tmp[MB_CHAR_MAX] = {0};1720 char tmp[MB_CHAR_MAX]; 1703 1721 int tmpsize = MB_CHAR_MAX; 1704 1722 int insize = wbufsize; 1705 1723 HRESULT hr; 1706 1724 DWORD dummy = 0; 1707 int len = 0;1708 int esc_len = 0;1709 int cs = 0;1710 int shift = 0;1711 int i = 0;1725 int len; 1726 int esc_len; 1727 int cs; 1728 int shift; 1729 int i; 1712 1730 1713 1731 /* -
lang/cplusplus/i3/trunk/windows/i3_test.vcproj
r23849 r24774 136 136 EnableFiberSafeOptimizations="true" 137 137 AdditionalIncludeDirectories="..\src\;"..\src\gui-windows";"..\src\os-windows";"..\src\os-windows\msvc";..\src\mol\include;..\src\intl" 138 PreprocessorDefinitions="WIN32;NDEBUG "138 PreprocessorDefinitions="WIN32;NDEBUG;BOOST_NO_TYPEID" 139 139 StringPooling="true" 140 140 RuntimeLibrary="2" … … 399 399 </File> 400 400 <File 401 RelativePath="..\src\os-windows\ win_iconv.c"401 RelativePath="..\src\os-windows\msvc\win_iconv.c" 402 402 > 403 403 <FileConfiguration -
lang/cplusplus/i3/trunk/windows/mol_test.vcproj
r23823 r24774 138 138 EnableFiberSafeOptimizations="false" 139 139 AdditionalIncludeDirectories="..\src\mol\include" 140 PreprocessorDefinitions="WIN32;NDEBUG; _CONSOLE"140 PreprocessorDefinitions="WIN32;NDEBUG;BOOST_NO_TYPEID;_CONSOLE" 141 141 ExceptionHandling="2" 142 142 RuntimeLibrary="2" … … 295 295 </File> 296 296 <File 297 RelativePath="..\src\mol\src\DebugLogger.cpp"298 >299 </File>300 <File301 297 RelativePath="..\src\mol\include\mol\StaticData.cpp" 302 298 > … … 349 345 </File> 350 346 <File 347 RelativePath="..\src\mol\include\mol\Debug.h" 348 > 349 </File> 350 <File 351 351 RelativePath="..\src\mol\include\mol\os-windows\Debug.h" 352 >353 </File>354 <File355 RelativePath="..\src\mol\include\mol\Debug.h"356 352 > 357 353 </File>
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)