changeset 69960:b4cb58f90f13

(init_process): Remove undef. (select) [MAC_OSX]: Undefine before including sysselect.h. (posix_pathname_to_fsspec, fsspec_to_posix_pathname) [MAC_OSX]: Remove functions and prototypes. (parse_value): Add parentheses around + inside shift. (path_from_vol_dir_name): Make static. (get_temp_dir_name): Remove unused variables `cpb' and `dir_name'. [!MAC_OSX] (get_path_to_system_folder): Likewise. (Fmac_get_file_creator, Fmac_get_file_type): Remove unused variable `cCode'. (Fmac_coerce_ae_data): Remove unused variables `fref' and `fs'. (Fmac_get_preference): Add explicit braces to avoid ambiguous `else'.
author YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
date Wed, 12 Apr 2006 08:06:59 +0000
parents d1856dc3952f
children c1bacedf1ab0
files src/mac.c
diffstat 1 files changed, 25 insertions(+), 29 deletions(-) [+]
line wrap: on
line diff
--- a/src/mac.c	Wed Apr 12 08:06:25 2006 +0000
+++ b/src/mac.c	Wed Apr 12 08:06:59 2006 +0000
@@ -28,7 +28,9 @@
 
 #include "lisp.h"
 #include "process.h"
-#undef init_process
+#ifdef MAC_OSX
+#undef select
+#endif
 #include "systime.h"
 #include "sysselect.h"
 #include "blockinput.h"
@@ -79,8 +81,10 @@
 /* The single script context used for all script executions.  */
 static OSAID as_script_context;
 
+#ifndef MAC_OSX
 static OSErr posix_pathname_to_fsspec P_ ((const char *, FSSpec *));
 static OSErr fsspec_to_posix_pathname P_ ((const FSSpec *, char *, int));
+#endif
 
 /* When converting from Mac to Unix pathnames, /'s in folder names are
    converted to :'s.  This function, used in copying folder names,
@@ -1222,7 +1226,7 @@
 		       && '0' <= P[1] && P[1] <= '7'
 		       && '0' <= P[2] && P[2] <= '7')
 		{
-		  *q++ = (P[0] - '0' << 6) + (P[1] - '0' << 3) + (P[2] - '0');
+		  *q++ = ((P[0] - '0') << 6) + ((P[1] - '0') << 3) + (P[2] - '0');
 		  P += 3;
 		}
 	      else
@@ -2789,7 +2793,7 @@
 /* Determine the path name of the file specified by VREFNUM, DIRID,
    and NAME and place that in the buffer PATH of length
    MAXPATHLEN.  */
-int
+static int
 path_from_vol_dir_name (char *path, int man_path_len, short vol_ref_num,
 			long dir_id, ConstStr255Param name)
 {
@@ -2834,6 +2838,8 @@
 }
 
 
+#ifndef MAC_OSX
+
 static OSErr
 posix_pathname_to_fsspec (ufn, fs)
      const char *ufn;
@@ -2866,8 +2872,6 @@
     return fnfErr;
 }
 
-#ifndef MAC_OSX
-
 int
 readlink (const char *path, char *buf, int bufsiz)
 {
@@ -3124,8 +3128,7 @@
   short vol_ref_num;
   long dir_id;
   OSErr err;
-  Str255 dir_name, full_path;
-  CInfoPBRec cpb;
+  Str255 full_path;
   char unix_dir_name[MAXPATHLEN+1];
   DIR *dir;
 
@@ -3217,8 +3220,7 @@
   short vol_ref_num;
   long dir_id;
   OSErr err;
-  Str255 dir_name, full_path;
-  CInfoPBRec cpb;
+  Str255 full_path;
   static char system_folder_unix_name[MAXPATHLEN+1];
   DIR *dir;
 
@@ -3947,7 +3949,6 @@
 #else
   FSSpec fss;
 #endif
-  OSType cCode;
   Lisp_Object result = Qnil;
   CHECK_STRING (filename);
 
@@ -4002,7 +4003,6 @@
 #else
   FSSpec fss;
 #endif
-  OSType cCode;
   Lisp_Object result = Qnil;
   CHECK_STRING (filename);
 
@@ -4296,11 +4296,6 @@
   Lisp_Object result = Qnil;
   DescType src_desc_type, dst_desc_type;
   AEDesc dst_desc;
-#ifdef MAC_OSX
-  FSRef fref;
-#else
-  FSSpec fs;
-#endif
 
   CHECK_STRING (src_data);
   if (EQ (src_type, Qundecoded_file_name))
@@ -4422,18 +4417,20 @@
     }
 
   if (NILP (key))
-    if (EQ (format, Qxml))
-      {
-	CFDataRef data = CFPropertyListCreateXMLData (NULL, plist);
-	if (data == NULL)
-	  goto out;
-	result = cfdata_to_lisp (data);
-	CFRelease (data);
-      }
-    else
-      result =
-	cfproperty_list_to_lisp (plist, EQ (format, Qt),
-				 NILP (hash_bound) ? -1 : XINT (hash_bound));
+    {
+      if (EQ (format, Qxml))
+	{
+	  CFDataRef data = CFPropertyListCreateXMLData (NULL, plist);
+	  if (data == NULL)
+	    goto out;
+	  result = cfdata_to_lisp (data);
+	  CFRelease (data);
+	}
+      else
+	result =
+	  cfproperty_list_to_lisp (plist, EQ (format, Qt),
+				   NILP (hash_bound) ? -1 : XINT (hash_bound));
+    }
 
  out:
   if (app_plist)
@@ -4701,7 +4698,6 @@
 
 
 #ifdef MAC_OSX
-#undef select
 
 extern int inhibit_window_system;
 extern int noninteractive;