comparison src/sysdep.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 4542b72c005e
children 9c872f33ecbe
comparison
equal deleted inserted replaced
1725:7ff8f4d70aec 1726:a8d8f419b459
3001 3001
3002 if (ret) 3002 if (ret)
3003 { 3003 {
3004 Ibyte *retin; 3004 Ibyte *retin;
3005 TSTR_TO_C_STRING_MALLOC (ret, retin); 3005 TSTR_TO_C_STRING_MALLOC (ret, retin);
3006 xfree (cwd); 3006 xfree (cwd, Extbyte *);
3007 return retin; 3007 return retin;
3008 } 3008 }
3009 #else 3009 #else
3010 Extbyte *ret = getcwd (cwd, cwdsize); 3010 Extbyte *ret = getcwd (cwd, cwdsize);
3011 if (ret) 3011 if (ret)
3012 { 3012 {
3013 Ibyte *retin; 3013 Ibyte *retin;
3014 EXTERNAL_TO_C_STRING_MALLOC (ret, retin, Qfile_name); 3014 EXTERNAL_TO_C_STRING_MALLOC (ret, retin, Qfile_name);
3015 xfree (cwd); 3015 xfree (cwd, Extbyte *);
3016 return retin; 3016 return retin;
3017 } 3017 }
3018 #endif /* WIN32_NATIVE */ 3018 #endif /* WIN32_NATIVE */
3019 3019
3020 if (errno == ERANGE) 3020 if (errno == ERANGE)
3022 cwdsize *= 2; 3022 cwdsize *= 2;
3023 XREALLOC_ARRAY (cwd, Extbyte, cwdsize); 3023 XREALLOC_ARRAY (cwd, Extbyte, cwdsize);
3024 } 3024 }
3025 else 3025 else
3026 { 3026 {
3027 xfree (cwd); 3027 xfree (cwd, Extbyte *);
3028 return NULL; 3028 return NULL;
3029 } 3029 }
3030 } 3030 }
3031 #else 3031 #else
3032 Extbyte chingame_limitos_arbitrarios[PATH_MAX]; 3032 Extbyte chingame_limitos_arbitrarios[PATH_MAX];
3251 { 3251 {
3252 if (!pwd) 3252 if (!pwd)
3253 return NULL; 3253 return NULL;
3254 3254
3255 if (cached_pwd.pw_name) 3255 if (cached_pwd.pw_name)
3256 xfree (cached_pwd.pw_name); 3256 xfree (cached_pwd.pw_name, char *);
3257 if (cached_pwd.pw_passwd) 3257 if (cached_pwd.pw_passwd)
3258 xfree (cached_pwd.pw_passwd); 3258 xfree (cached_pwd.pw_passwd, char *);
3259 if (cached_pwd.pw_gecos) 3259 if (cached_pwd.pw_gecos)
3260 xfree (cached_pwd.pw_gecos); 3260 xfree (cached_pwd.pw_gecos, char *);
3261 if (cached_pwd.pw_dir) 3261 if (cached_pwd.pw_dir)
3262 xfree (cached_pwd.pw_dir); 3262 xfree (cached_pwd.pw_dir, char *);
3263 if (cached_pwd.pw_shell) 3263 if (cached_pwd.pw_shell)
3264 xfree (cached_pwd.pw_shell); 3264 xfree (cached_pwd.pw_shell, char *);
3265 3265
3266 cached_pwd = *pwd; 3266 cached_pwd = *pwd;
3267 if (cached_pwd.pw_name) 3267 if (cached_pwd.pw_name)
3268 TO_INTERNAL_FORMAT (C_STRING, cached_pwd.pw_name, 3268 TO_INTERNAL_FORMAT (C_STRING, cached_pwd.pw_name,
3269 C_STRING_MALLOC, cached_pwd.pw_name, Qnative); 3269 C_STRING_MALLOC, cached_pwd.pw_name, Qnative);
3327 { 3327 {
3328 Extbyte *str = (Extbyte *) ctime (t); 3328 Extbyte *str = (Extbyte *) ctime (t);
3329 if (!str) /* can happen on MS Windows */ 3329 if (!str) /* can happen on MS Windows */
3330 return (Ibyte *) "Sun Jan 01 00:00:00 1970"; 3330 return (Ibyte *) "Sun Jan 01 00:00:00 1970";
3331 if (ctime_static) 3331 if (ctime_static)
3332 xfree (ctime_static); 3332 xfree (ctime_static, Ibyte *);
3333 EXTERNAL_TO_C_STRING_MALLOC (str, ctime_static, Qnative); 3333 EXTERNAL_TO_C_STRING_MALLOC (str, ctime_static, Qnative);
3334 return ctime_static; 3334 return ctime_static;
3335 } 3335 }
3336 3336
3337 3337
3888 3888
3889 /* Some systems (like Solaris) allocate the buffer and the DIR all 3889 /* Some systems (like Solaris) allocate the buffer and the DIR all
3890 in one block. Why in the world are we freeing this ourselves 3890 in one block. Why in the world are we freeing this ourselves
3891 anyway? */ 3891 anyway? */
3892 #if ! (defined (sun) && defined (USG5_4)) 3892 #if ! (defined (sun) && defined (USG5_4))
3893 xfree ((char *) dirp->dd_buf); /* directory block defined in <dirent.h> */ 3893 xfree (dirp->dd_buf, char *); /* directory block defined in <dirent.h> */
3894 #endif 3894 #endif
3895 xfree ((char *) dirp); 3895 xfree (dirp, DIR *);
3896 return (rtnval); 3896 return (rtnval);
3897 } 3897 }
3898 #endif /* BROKEN_CLOSEDIR or not HAVE_CLOSEDIR */ 3898 #endif /* BROKEN_CLOSEDIR or not HAVE_CLOSEDIR */
3899 #endif /* SYSV_SYSTEM_DIR */ 3899 #endif /* SYSV_SYSTEM_DIR */
3900 3900
3927 3927
3928 void 3928 void
3929 closedir (DIR *dirp) /* stream from opendir */ 3929 closedir (DIR *dirp) /* stream from opendir */
3930 { 3930 {
3931 retry_close (dirp->dd_fd); 3931 retry_close (dirp->dd_fd);
3932 xfree (dirp); 3932 xfree (dirp, DIR *);
3933 } 3933 }
3934 3934
3935 3935
3936 #define DIRSIZ 14 3936 #define DIRSIZ 14
3937 struct olddir 3937 struct olddir