Changeset 1970
- Timestamp:
- 03/21/08 06:48:15 (10 months ago)
- Files:
-
- trunk/libwzd-core/wzd_fs.c (modified) (10 diffs)
- trunk/libwzd-core/wzd_fs.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/libwzd-core/wzd_fs.c
r1928 r1970 92 92 #else 93 93 { 94 size_t sz;94 int sz; 95 95 wchar_t * dstname; 96 96 … … 98 98 return -1; 99 99 100 sz = MultiByteToWideChar(CP_UTF8, 0, pathname, strlen(pathname)+1, NULL, 0);100 sz = MultiByteToWideChar(CP_UTF8, 0, pathname, (int)strlen(pathname)+1, NULL, 0); 101 101 if (sz <= 0) return -1; 102 102 103 dstname = malloc( sz * sizeof(wchar_t) + 1);104 105 ret = MultiByteToWideChar(CP_UTF8, 0, pathname, strlen(pathname)+1, dstname, sz);103 dstname = malloc((size_t)sz * sizeof(wchar_t) + 1); 104 105 ret = MultiByteToWideChar(CP_UTF8, 0, pathname, (int)strlen(pathname)+1, dstname, sz); 106 106 107 107 if (ret <= 0) { free(dstname); return -1; } … … 123 123 int fs_dir_open(const char * pathname, fs_dir_t ** newdir) 124 124 { 125 int len;125 size_t len; 126 126 127 127 *newdir = wzd_malloc(sizeof(fs_dir_t)); … … 177 177 #ifdef WIN32 178 178 int ret; 179 size_t sz;179 int sz; 180 180 181 181 if (dir->handle == NULL) { 182 size_t sz;183 182 wchar_t * dstname, * eos; 184 183 185 sz = MultiByteToWideChar(CP_UTF8, 0, dir->dirname, strlen(dir->dirname)+1, NULL, 0);184 sz = MultiByteToWideChar(CP_UTF8, 0, dir->dirname, (int)strlen(dir->dirname)+1, NULL, 0); 186 185 if (sz <= 0) return -1; 187 186 188 dstname = malloc( sz * sizeof(wchar_t) + 3);189 190 ret = MultiByteToWideChar(CP_UTF8, 0, dir->dirname, strlen(dir->dirname)+1, dstname, sz);187 dstname = malloc((size_t)sz * sizeof(wchar_t) + 3); 188 189 ret = MultiByteToWideChar(CP_UTF8, 0, dir->dirname, (int)strlen(dir->dirname)+1, dstname, sz); 191 190 192 191 if (ret <= 0) { free(dstname); return -1; } … … 210 209 } 211 210 212 sz = WideCharToMultiByte(CP_UTF8, 0, dir->entry.cFileName, wcslen(dir->entry.cFileName)+1, NULL, 0, NULL, NULL);211 sz = WideCharToMultiByte(CP_UTF8, 0, dir->entry.cFileName, (int)wcslen(dir->entry.cFileName)+1, NULL, 0, NULL, NULL); 213 212 if (sz <= 0) return -1; 214 213 215 filename = wzd_malloc( sz + 2);216 217 ret = WideCharToMultiByte(CP_UTF8, 0, dir->entry.cFileName, wcslen(dir->entry.cFileName)+1, filename, sz, NULL, NULL);214 filename = wzd_malloc((size_t)sz + 2); 215 216 ret = WideCharToMultiByte(CP_UTF8, 0, dir->entry.cFileName, (int)wcslen(dir->entry.cFileName)+1, filename, sz, NULL, NULL); 218 217 219 218 dir->finfo.wname = dir->entry.cFileName; … … 273 272 struct _stati64 st; 274 273 wchar_t * wbuffer; 275 size_t sz;274 int sz; 276 275 int ret; 277 276 278 sz = MultiByteToWideChar(CP_UTF8, 0, pathname, strlen(pathname)+1, NULL, 0);277 sz = MultiByteToWideChar(CP_UTF8, 0, pathname, (int)strlen(pathname)+1, NULL, 0); 279 278 if (sz <= 0) return -1; 280 279 281 wbuffer = malloc( sz * sizeof(wchar_t) + 5);282 283 ret = MultiByteToWideChar(CP_UTF8, 0, pathname, strlen(pathname)+1, wbuffer, sz);280 wbuffer = malloc((size_t)sz * sizeof(wchar_t) + 5); 281 282 ret = MultiByteToWideChar(CP_UTF8, 0, pathname, (int)strlen(pathname)+1, wbuffer, sz); 284 283 if (ret <= 0) { free(wbuffer); return -1; } 285 284 … … 330 329 struct _stati64 st; 331 330 wchar_t * wbuffer; 332 size_t sz;331 int sz; 333 332 int ret; 334 333 335 sz = MultiByteToWideChar(CP_UTF8, 0, pathname, strlen(pathname)+1, NULL, 0);334 sz = MultiByteToWideChar(CP_UTF8, 0, pathname, (int)strlen(pathname)+1, NULL, 0); 336 335 if (sz <= 0) return -1; 337 336 338 wbuffer = malloc( sz * sizeof(wchar_t) + 5);339 340 ret = MultiByteToWideChar(CP_UTF8, 0, pathname, strlen(pathname)+1, wbuffer, sz);337 wbuffer = malloc((size_t)sz * sizeof(wchar_t) + 5); 338 339 ret = MultiByteToWideChar(CP_UTF8, 0, pathname, (int)strlen(pathname)+1, wbuffer, sz); 341 340 if (ret <= 0) { free(wbuffer); return -1; } 342 341 … … 362 361 /** \brief Get informations on file 363 362 */ 364 int fs_file_fstat( int fd, fs_filestat_t * s)363 int fs_file_fstat(fd_t file, fs_filestat_t * s) 365 364 { 366 365 #ifndef WIN32 … … 368 367 struct stat st; 369 368 370 if (!fstat(f d,&st)) {369 if (!fstat(file,&st)) { 371 370 if (s) { 372 371 s->size = (u64_t)st.st_size; … … 384 383 struct _stati64 st; 385 384 386 if (!_fstati64(f d,&st)) {385 if (!_fstati64(file,&st)) { 387 386 if (s) { 388 387 s->size = st.st_size; trunk/libwzd-core/wzd_fs.h
r1253 r1970 82 82 /** \brief Get informations on file 83 83 */ 84 int fs_file_fstat( int fd, fs_filestat_t * s);84 int fs_file_fstat(fd_t file, fs_filestat_t * s); 85 85 86 86
