emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r108364: * src/fileio.c, src/characte


From: Stefan Monnier
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r108364: * src/fileio.c, src/character.h: Minor style tweaks.
Date: Fri, 25 May 2012 11:01:30 -0400
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 108364
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Fri 2012-05-25 11:01:30 -0400
message:
  * src/fileio.c, src/character.h: Minor style tweaks.
modified:
  src/ChangeLog
  src/character.h
  src/fileio.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-05-24 06:13:51 +0000
+++ b/src/ChangeLog     2012-05-25 15:01:30 +0000
@@ -1,3 +1,7 @@
+2012-05-25  Stefan Monnier  <address@hidden>
+
+       * fileio.c, character.h: Minor style tweaks.
+
 2012-05-24  Dmitry Antipov  <address@hidden>
 
        * window.h (clip_changed): Remove useless declaration.

=== modified file 'src/character.h'
--- a/src/character.h   2012-04-14 05:10:55 +0000
+++ b/src/character.h   2012-05-25 15:01:30 +0000
@@ -434,7 +434,7 @@
          unsigned char *chp = BYTE_POS_ADDR (BYTEIDX);         \
          int chlen;                                            \
                                                                \
-         OUTPUT= STRING_CHAR_AND_LENGTH (chp, chlen);          \
+         OUTPUT = STRING_CHAR_AND_LENGTH (chp, chlen);         \
          BYTEIDX += chlen;                                     \
        }                                                       \
       else                                                     \

=== modified file 'src/fileio.c'
--- a/src/fileio.c      2012-05-04 23:16:47 +0000
+++ b/src/fileio.c      2012-05-25 15:01:30 +0000
@@ -877,7 +877,7 @@
        }
     }
 
-  /* Make a local copy of nm[] to protect it from GC in DECODE_FILE below. */
+  /* Make a local copy of nm[] to protect it from GC in DECODE_FILE below.  */
   nm = (char *) alloca (SBYTES (name) + 1);
   memcpy (nm, SSDATA (name), SBYTES (name) + 1);
 
@@ -905,7 +905,7 @@
   if (drive && IS_DIRECTORY_SEP (nm[0]) && IS_DIRECTORY_SEP (nm[1]))
     nm++;
 
-  /* Discard any previous drive specifier if nm is now in UNC format. */
+  /* Discard any previous drive specifier if nm is now in UNC format.  */
   if (IS_DIRECTORY_SEP (nm[0]) && IS_DIRECTORY_SEP (nm[1]))
     {
       drive = 0;
@@ -970,7 +970,7 @@
            }
          else
 #endif
-         /* drive must be set, so this is okay */
+         /* Drive must be set, so this is okay.  */
          if (strcmp (nm - 2, SSDATA (name)) != 0)
            {
              char temp[] = " :";
@@ -1016,7 +1016,7 @@
          if (!(newdir = egetenv ("HOME")))
            newdir = "";
          nm++;
-         /* egetenv may return a unibyte string, which will bite us since
+         /* `egetenv' may return a unibyte string, which will bite us since
             we expect the directory to be multibyte.  */
          tem = build_string (newdir);
          if (!STRING_MULTIBYTE (tem))
@@ -1058,7 +1058,7 @@
      use the drive's current directory as the prefix if needed.  */
   if (!newdir && drive)
     {
-      /* Get default directory if needed to make nm absolute. */
+      /* Get default directory if needed to make nm absolute.  */
       char *adir = NULL;
       if (!IS_DIRECTORY_SEP (nm[0]))
        {
@@ -1068,7 +1068,7 @@
        }
       if (!adir)
        {
-         /* Either nm starts with /, or drive isn't mounted. */
+         /* Either nm starts with /, or drive isn't mounted.  */
          adir = alloca (4);
          adir[0] = DRIVE_LETTER (drive);
          adir[1] = ':';
@@ -1080,11 +1080,11 @@
 #endif /* DOS_NT */
 
   /* Finally, if no prefix has been specified and nm is not absolute,
-     then it must be expanded relative to default_directory. */
+     then it must be expanded relative to default_directory.  */
 
   if (1
 #ifndef DOS_NT
-      /* /... alone is not absolute on DOS and Windows. */
+      /* /... alone is not absolute on DOS and Windows.  */
       && !IS_DIRECTORY_SEP (nm[0])
 #endif
 #ifdef WINDOWSNT
@@ -1106,7 +1106,7 @@
 #ifdef DOS_NT
   if (newdir)
     {
-      /* First ensure newdir is an absolute name. */
+      /* First ensure newdir is an absolute name.  */
       if (
          /* Detect MSDOS file names with drive specifiers.  */
          ! (IS_DRIVE (newdir[0])
@@ -1121,7 +1121,7 @@
             Because of the admonition against calling expand-file-name
             when we have pointers into lisp strings, we accomplish this
             indirectly by prepending newdir to nm if necessary, and using
-            cwd (or the wd of newdir's drive) as the new newdir. */
+            cwd (or the wd of newdir's drive) as the new newdir.  */
          char *adir;
          if (IS_DRIVE (newdir[0]) && IS_DEVICE_SEP (newdir[1]))
            {
@@ -1146,7 +1146,7 @@
          newdir = adir;
        }
 
-      /* Strip off drive name from prefix, if present. */
+      /* Strip off drive name from prefix, if present.  */
       if (IS_DRIVE (newdir[0]) && IS_DEVICE_SEP (newdir[1]))
        {
          drive = newdir[0];
@@ -1196,7 +1196,7 @@
   else
     tlen = 0;
 
-  /* Now concatenate the directory and name to new space in the stack frame */
+  /* Now concatenate the directory and name to new space in the stack frame.  
*/
   tlen += strlen (nm) + 1;
 #ifdef DOS_NT
   /* Reserve space for drive specifier and escape prefix, since either
@@ -1292,7 +1292,7 @@
       }
 
 #ifdef DOS_NT
-    /* At last, set drive name. */
+    /* At last, set drive name.  */
 #ifdef WINDOWSNT
     /* Except for network file name.  */
     if (!(IS_DIRECTORY_SEP (target[0]) && IS_DIRECTORY_SEP (target[1])))
@@ -1320,7 +1320,7 @@
      and perhaps call the corresponding file handler.  This is needed
      for filenames such as "/foo/../address@hidden:/bar/../baz".  Expanding
      the ".." component gives us "/address@hidden:/bar/../baz" which needs
-     to be expanded again. */
+     to be expanded again.  */
   handler = Ffind_file_name_handler (result, Qexpand_file_name);
   if (!NILP (handler))
     {
@@ -1396,7 +1396,7 @@
        }
     }
 
-  /* Now determine directory to start with and put it in NEWDIR */
+  /* Now determine directory to start with and put it in NEWDIR.  */
 
   newdir = 0;
 
@@ -1409,17 +1409,17 @@
       }
     else  /* ~user/filename */
       {
-       /* Get past ~ to user */
+       /* Get past ~ to user.  */
        unsigned char *user = nm + 1;
-       /* Find end of name. */
+       /* Find end of name.  */
        unsigned char *ptr = (unsigned char *) strchr (user, '/');
        ptrdiff_t len = ptr ? ptr - user : strlen (user);
-       /* Copy the user name into temp storage. */
+       /* Copy the user name into temp storage.  */
        o = (unsigned char *) alloca (len + 1);
        memcpy (o, user, len);
        o[len] = 0;
 
-       /* Look up the user name. */
+       /* Look up the user name.  */
        BLOCK_INPUT;
        pw = (struct passwd *) getpwnam (o + 1);
        UNBLOCK_INPUT;
@@ -1440,7 +1440,7 @@
       newdir = SDATA (defalt);
     }
 
-  /* Now concatenate the directory and name to new space in the stack frame */
+  /* Now concatenate the directory and name to new space in the stack frame.  
*/
 
   tlen = (newdir ? strlen (newdir) + 1 : 0) + strlen (nm) + 1;
   target = (unsigned char *) alloca (tlen);
@@ -1456,7 +1456,7 @@
 
   strcat (target, nm);
 
-  /* Now canonicalize by removing /. and /foo/.. if they appear */
+  /* Now canonicalize by removing /. and /foo/.. if they appear.  */
 
   p = target;
   o = target;
@@ -1528,7 +1528,7 @@
              )
        {
          for (s = p; *s && (!IS_DIRECTORY_SEP (*s)); s++);
-         if (p[0] == '~' && s > p + 1) /* we've got "/~something/" */
+         if (p[0] == '~' && s > p + 1) /* We've got "/~something/".  */
            {
              char *o = alloca (s - p + 1);
              struct passwd *pw;
@@ -1612,7 +1612,7 @@
       (make_specified_string (p, -1, endp - p, multibyte));
 
   /* See if any variables are substituted into the string
-     and find the total length of their values in `total' */
+     and find the total length of their values in `total'.  */
 
   for (p = nm; p != endp;)
     if (*p != '$')
@@ -1624,7 +1624,7 @@
          goto badsubst;
        else if (*p == '$')
          {
-           /* "$$" means a single "$" */
+           /* "$$" means a single "$".  */
            p++;
            total -= 1;
            substituted = 1;
@@ -1644,7 +1644,7 @@
            s = p;
          }
 
-       /* Copy out the variable name */
+       /* Copy out the variable name.  */
        target = (char *) alloca (s - o + 1);
        strncpy (target, o, s - o);
        target[s - o] = 0;
@@ -1652,7 +1652,7 @@
        strupr (target); /* $home == $HOME etc.  */
 #endif /* DOS_NT */
 
-       /* Get variable value */
+       /* Get variable value.  */
        o = egetenv (target);
        if (o)
          {
@@ -1674,12 +1674,12 @@
   if (!substituted)
     return filename;
 
-  /* If substitution required, recopy the string and do it */
-  /* Make space in stack frame for the new copy */
+  /* If substitution required, recopy the string and do it.  */
+  /* Make space in stack frame for the new copy.  */
   xnm = (char *) alloca (SBYTES (filename) + total + 1);
   x = xnm;
 
-  /* Copy the rest of the name through, replacing $ constructs with values */
+  /* Copy the rest of the name through, replacing $ constructs with values.  */
   for (p = nm; *p;)
     if (*p != '$')
       *x++ = *p++;
@@ -1707,7 +1707,7 @@
            s = p;
          }
 
-       /* Copy out the variable name */
+       /* Copy out the variable name.  */
        target = (char *) alloca (s - o + 1);
        strncpy (target, o, s - o);
        target[s - o] = 0;
@@ -1715,7 +1715,7 @@
        strupr (target); /* $home == $HOME etc.  */
 #endif /* DOS_NT */
 
-       /* Get variable value */
+       /* Get variable value.  */
        o = egetenv (target);
        if (!o)
          {
@@ -1777,7 +1777,7 @@
      stat behaves differently depending!  */
   if (SCHARS (absname) > 1
       && IS_DIRECTORY_SEP (SREF (absname, SBYTES (absname) - 1))
-      && !IS_DEVICE_SEP (SREF (absname, SBYTES (absname)-2)))
+      && !IS_DEVICE_SEP (SREF (absname, SBYTES (absname) - 2)))
     /* We cannot take shortcuts; they might be wrong for magic file names.  */
     absname = Fdirectory_file_name (absname);
   return absname;
@@ -1805,7 +1805,7 @@
 
   encoded_filename = ENCODE_FILE (absname);
 
-  /* stat is a good way to tell whether the file exists,
+  /* `stat' is a good way to tell whether the file exists,
      regardless of what access permissions it has.  */
   if (lstat (SSDATA (encoded_filename), &statbuf) >= 0)
     {


reply via email to

[Prev in Thread] Current Thread [Next in Thread]