Mercurial > hg > xemacs-beta
comparison src/nt.c @ 1726:a8d8f419b459
[xemacs-hg @ 2003-09-30 15:26:34 by james]
Add type information to xfree to avoid alias creation.
author | james |
---|---|
date | Tue, 30 Sep 2003 15:27:01 +0000 |
parents | f0af455e89d9 |
children | 04bc9d2f42c7 |
comparison
equal
deleted
inserted
replaced
1725:7ff8f4d70aec | 1726:a8d8f419b459 |
---|---|
336 if (p != NULL) | 336 if (p != NULL) |
337 { | 337 { |
338 *p++ = '\\'; | 338 *p++ = '\\'; |
339 eicat_ch (o, '\\'); | 339 eicat_ch (o, '\\'); |
340 } | 340 } |
341 xfree (component); | 341 xfree (component, Ibyte *); |
342 } | 342 } |
343 else | 343 else |
344 { | 344 { |
345 xfree (full); | 345 xfree (full, Ibyte *); |
346 return 0; | 346 return 0; |
347 } | 347 } |
348 } | 348 } |
349 | 349 |
350 xfree (full); | 350 xfree (full, Ibyte *); |
351 return eicpyout_malloc (o, 0); | 351 return eicpyout_malloc (o, 0); |
352 } | 352 } |
353 | 353 |
354 static int | 354 static int |
355 is_unc_volume (const Ibyte *filename) | 355 is_unc_volume (const Ibyte *filename) |
392 && (lpvalue = (LPBYTE) xmalloc (cbData)) != NULL | 392 && (lpvalue = (LPBYTE) xmalloc (cbData)) != NULL |
393 && qxeRegQueryValueEx (hrootkey, keyext, NULL, lpdwtype, lpvalue, | 393 && qxeRegQueryValueEx (hrootkey, keyext, NULL, lpdwtype, lpvalue, |
394 &cbData) == ERROR_SUCCESS) | 394 &cbData) == ERROR_SUCCESS) |
395 return (lpvalue); | 395 return (lpvalue); |
396 | 396 |
397 if (lpvalue) xfree (lpvalue); | 397 if (lpvalue) |
398 xfree (lpvalue, LPBYTE); | |
398 | 399 |
399 RegCloseKey (hrootkey); | 400 RegCloseKey (hrootkey); |
400 } | 401 } |
401 | 402 |
402 if (qxeRegOpenKeyEx (HKEY_LOCAL_MACHINE, XETEXT (REG_ROOT), 0, KEY_READ, | 403 if (qxeRegOpenKeyEx (HKEY_LOCAL_MACHINE, XETEXT (REG_ROOT), 0, KEY_READ, |
409 (lpvalue = (LPBYTE) xmalloc (cbData)) != NULL && | 410 (lpvalue = (LPBYTE) xmalloc (cbData)) != NULL && |
410 qxeRegQueryValueEx (hrootkey, keyext, NULL, lpdwtype, lpvalue, | 411 qxeRegQueryValueEx (hrootkey, keyext, NULL, lpdwtype, lpvalue, |
411 &cbData) == ERROR_SUCCESS) | 412 &cbData) == ERROR_SUCCESS) |
412 return (lpvalue); | 413 return (lpvalue); |
413 | 414 |
414 if (lpvalue) xfree (lpvalue); | 415 if (lpvalue) |
416 xfree (lpvalue, LPBYTE); | |
415 | 417 |
416 RegCloseKey (hrootkey); | 418 RegCloseKey (hrootkey); |
417 } | 419 } |
418 | 420 |
419 return (NULL); | 421 return (NULL); |
492 | 494 |
493 TSTR_TO_C_STRING (lpval, envval); | 495 TSTR_TO_C_STRING (lpval, envval); |
494 eputenv (env_vars[i], (CIbyte *) envval); | 496 eputenv (env_vars[i], (CIbyte *) envval); |
495 } | 497 } |
496 | 498 |
497 xfree (lpval); | 499 xfree (lpval, LPBYTE); |
498 } | 500 } |
499 } | 501 } |
500 } | 502 } |
501 | 503 |
502 /* Another special case: on NT, the PATH variable is actually named | 504 /* Another special case: on NT, the PATH variable is actually named |
701 info = (volume_info_data *) xmalloc (sizeof (volume_info_data)); | 703 info = (volume_info_data *) xmalloc (sizeof (volume_info_data)); |
702 add_volume_info (root_dir, info); | 704 add_volume_info (root_dir, info); |
703 } | 705 } |
704 else | 706 else |
705 { | 707 { |
706 xfree (info->name); | 708 xfree (info->name, Ibyte *); |
707 xfree (info->type); | 709 xfree (info->type, Ibyte *); |
708 } | 710 } |
709 | 711 |
710 TSTR_TO_C_STRING_MALLOC (name, info->name); | 712 TSTR_TO_C_STRING_MALLOC (name, info->name); |
711 info->serialnum = serialnum; | 713 info->serialnum = serialnum; |
712 info->maxcomp = maxcomp; | 714 info->maxcomp = maxcomp; |
824 | 826 |
825 if (!(dirp = xnew_and_zero (DIR))) | 827 if (!(dirp = xnew_and_zero (DIR))) |
826 return NULL; | 828 return NULL; |
827 | 829 |
828 if (dir_pathname) | 830 if (dir_pathname) |
829 xfree (dir_pathname); | 831 xfree (dir_pathname, Ibyte *); |
830 dir_pathname = qxestrdup (filename); | 832 dir_pathname = qxestrdup (filename); |
831 | 833 |
832 return dirp; | 834 return dirp; |
833 } | 835 } |
834 | 836 |
846 else if (wnet_enum_handle != INVALID_HANDLE_VALUE) | 848 else if (wnet_enum_handle != INVALID_HANDLE_VALUE) |
847 { | 849 { |
848 retval = close_unc_volume (wnet_enum_handle); | 850 retval = close_unc_volume (wnet_enum_handle); |
849 wnet_enum_handle = INVALID_HANDLE_VALUE; | 851 wnet_enum_handle = INVALID_HANDLE_VALUE; |
850 } | 852 } |
851 xfree (dirp); | 853 xfree (dirp, DIR *); |
852 | 854 |
853 return retval; | 855 return retval; |
854 } | 856 } |
855 | 857 |
856 struct direct * | 858 struct direct * |
903 DECLARE_EISTRING (found); | 905 DECLARE_EISTRING (found); |
904 Bytecount namlen; | 906 Bytecount namlen; |
905 | 907 |
906 eicpy_rawz (found, val); | 908 eicpy_rawz (found, val); |
907 if (need_to_free) | 909 if (need_to_free) |
908 xfree (val); | 910 xfree (val, Ibyte *); |
909 | 911 |
910 if (!NILP (Vmswindows_downcase_file_names)) | 912 if (!NILP (Vmswindows_downcase_file_names)) |
911 eilwr (found); | 913 eilwr (found); |
912 | 914 |
913 namlen = min (eilen (found), sizeof (dir_static.d_name) - 1); | 915 namlen = min (eilen (found), sizeof (dir_static.d_name) - 1); |
1748 if (XEUNICODE_P) | 1750 if (XEUNICODE_P) |
1749 cwdext = (Extbyte *) _wgetdcwd (drivelet, NULL, 0); | 1751 cwdext = (Extbyte *) _wgetdcwd (drivelet, NULL, 0); |
1750 else | 1752 else |
1751 cwdext = _getdcwd (drivelet, NULL, 0); | 1753 cwdext = _getdcwd (drivelet, NULL, 0); |
1752 TSTR_TO_C_STRING_MALLOC (cwdext, cwd); | 1754 TSTR_TO_C_STRING_MALLOC (cwdext, cwd); |
1753 xfree (cwdext); | 1755 xfree (cwdext, Extbyte *); |
1754 return cwd; | 1756 return cwd; |
1755 } | 1757 } |
1756 | 1758 |
1757 | 1759 |
1758 /*--------------------------------------------------------------------*/ | 1760 /*--------------------------------------------------------------------*/ |
2039 if (!(longname = mswindows_get_long_filename (XSTRING_DATA (filename)))) | 2041 if (!(longname = mswindows_get_long_filename (XSTRING_DATA (filename)))) |
2040 return Qnil; | 2042 return Qnil; |
2041 | 2043 |
2042 canon = mswindows_canonicalize_filename (longname); | 2044 canon = mswindows_canonicalize_filename (longname); |
2043 ret = build_intstring (canon); | 2045 ret = build_intstring (canon); |
2044 xfree (canon); | 2046 xfree (canon, Ibyte *); |
2045 xfree (longname); | 2047 xfree (longname, Ibyte *); |
2046 return ret; | 2048 return ret; |
2047 } | 2049 } |
2048 | 2050 |
2049 | 2051 |
2050 void | 2052 void |