Changeset 37967
- Timestamp:
- 07/19/10 18:20:53 (3 years ago)
- Location:
- lang/c/AutoUpdater/trunk
- Files:
-
- 3 modified
-
AutoUpdater.c (modified) (8 diffs)
-
UpdaterProcess.c (modified) (3 diffs)
-
configure.ac (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/c/AutoUpdater/trunk/AutoUpdater.c
r37965 r37967 2 2 #include "AutoUpdater.h" 3 3 4 #include <winuser.h> 4 5 #include <stdarg.h> 5 6 #include <stdio.h> … … 19 20 #pragma comment(lib, "shlwapi.lib") 20 21 #if defined(_CRT_NONSTDC_DEPRECATE) && !defined(_CRT_NONSTDC_NO_WARNINGS) && !defined(_POSIX_) 21 #define wcsdup _wcsdup 22 #endif 23 #endif 22 /* #define wcsdup _wcsdup */ 23 #endif 24 #endif 25 26 #ifdef strdup 27 #undef strdup 28 #endif 29 #ifdef _strdup 30 #undef _strdup 31 #endif 32 #ifdef wcsdup 33 #undef wcsdup 34 #endif 35 #ifdef _wcsdup 36 #undef _wcsdup 37 #endif 38 39 #define strdup AUI_strdup 40 #define wcsdup AUI_wcsdup 41 #define _strdup AUI_strdup 42 #define _wcsdup AUI_wcsdup 24 43 25 44 #ifdef __CYGWIN__ … … 28 47 # define GUID_NULL AUI_GUID_NULL 29 48 # define IID_IDispatch AUI_IID_IDispatch 30 # define strdup AUI_strdup31 # define wcsdup AUI_wcsdup32 49 33 50 const GUID AUI_GUID_NULL = {0, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0 }}; … … 102 119 va_start(ap,format); 103 120 #if defined(UNICODE) || defined(_UNICODE) 104 vswprintf(buffer, count, format, ap); 121 /* vswprintf(buffer, count, format, ap);*/ 122 vwsprintf(buffer, format, ap); 105 123 #elif __STDC_VERSION__ >= 199901L 106 124 vsnprintf(buffer, count, format, ap); … … 159 177 } AUI_Context; 160 178 161 const AU_Result AUI_SUCCESS = {1, 0, 0};162 const AU_Result AUI_IO_PENDING = {0, 1, 0};179 const AU_Result AUI_SUCCESS = {1, 0, AU_NO_ERROR}; 180 const AU_Result AUI_IO_PENDING = {0, 1, AU_NO_ERROR}; 163 181 164 182 AU_Result E(AU_Error error) { 165 AU_Result result = {0, 0, 0}; 183 AU_Result result; 184 result.success = 0; 185 result.pending = 0; 166 186 result.error = error; 167 187 return result; 168 188 } 189 169 190 170 191 int AUI_IsBadReadPointer(const void* pointer, size_t bytes) { … … 808 829 OLECHAR xpath[500]; 809 830 memset(xpath, 0, sizeof(xpath)); 810 swprintf(xpath, sizeof(xpath) / sizeof(xpath[0]) /* MSVCRT */ -1,831 wsprintf(xpath, /* TODO */ 811 832 OLESTR("/releases/release[not(@debug) or @debug <= %d][") 812 833 OLESTR("not(@revision <= preceding-sibling::release[not(@debug) or @debug <= %d]/@revision) and ") … … 901 922 } 902 923 924 extern const size_t AUI_UPDATER_BYTES; 925 extern const char AUI_UPDATER_DATA[]; 903 926 AU_Result AUI_ExtractBy7za(AUI_Context* context); 904 927 … … 933 956 934 957 { 935 extern const size_t AUI_UPDATER_BYTES;936 extern const char AUI_UPDATER_DATA[];937 958 AU_Result r; 938 959 FILE* f = NULL; -
lang/c/AutoUpdater/trunk/UpdaterProcess.c
r37966 r37967 2 2 3 3 #define _T(x) TEXT(x) 4 5 int AUI_Debug(const TCHAR* format, ...); 6 TCHAR* AUI_PathAppend(const TCHAR* base, const TCHAR* append); 4 7 5 8 int AUI_Debug(const TCHAR* format, ...) { … … 15 18 char* mb = 0; 16 19 size_t mb_bytes = 0; 17 mb_bytes = WideCharToMultiByte(CP_ACP, 0, output, -1, NULL, 0, NULL, NULL); 20 mb_bytes = (size_t)WideCharToMultiByte(CP_ACP, 0, output, -1, NULL, 0, NULL, NULL); 21 if (!mb_bytes) { 22 return -1; 23 } 18 24 mb = (char*)calloc(mb_bytes, 1); 19 WideCharToMultiByte(CP_ACP, 0, output, -1, mb, mb_bytes, NULL, NULL); 20 25 if (!WideCharToMultiByte(CP_ACP, 0, output, -1, mb, (int)mb_bytes, NULL, NULL)) { 26 return -1; 27 } 21 28 /* hStdOut = GetStdHandle(STD_OUTPUT_HANDLE); */ 22 29 hStdOut = CreateFile(_T("c:\\temp\\up.txt"), GENERIC_WRITE, … … 34 41 TCHAR* AUI_PathAppend(const TCHAR* base, const TCHAR* append) { 35 42 TCHAR* result = NULL; 36 size_t result_len = 0;43 int result_len = 0; 37 44 38 45 result_len = lstrlen(base) + 1 + lstrlen(append) + 1; -
lang/c/AutoUpdater/trunk/configure.ac
r37962 r37967 101 101 -Wc++-compat 102 102 -Wbad-function-cast -Wmissing-declarations 103 -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs 104 -Wold-style-declaration -Wold-style-definition 105 -Wstrict-prototypes -Wtraditional -Wtraditional-conversion 103 -Wmissing-parameter-type -Wnested-externs 104 -Wstrict-prototypes 106 105 -Wdeclaration-after-statement -Wpointer-sign 107 106 ]) 107 108 #-Wmissing-prototypes 109 #-Wtraditional -Wtraditional-conversion 110 #-Wold-style-declaration -Wold-style-definition 108 111 109 112 CXX_OPTIONS([ … … 126 129 COMMON_OPTIONS([ 127 130 -pedantic 128 -Waggregate-return129 131 -Wextra -Wall -Waddress -Warray-bounds 130 132 -Wcast-align -Wcast-qual … … 161 163 ]) 162 164 # -Wsystem-headers 165 # -Waggregate-return 163 166 164 167 AC_CONFIG_FILES([Makefile])
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)