emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r103158: Merge: * dired.c: conform to


From: Paul Eggert
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r103158: Merge: * dired.c: conform to C89 pointer rules
Date: Sun, 06 Feb 2011 17:19:18 -0800
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 103158 [merge]
committer: Paul Eggert <address@hidden>
branch nick: trunk
timestamp: Sun 2011-02-06 17:19:18 -0800
message:
  Merge: * dired.c: conform to C89 pointer rules
modified:
  src/ChangeLog
  src/dired.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2011-02-06 22:02:50 +0000
+++ b/src/ChangeLog     2011-02-07 01:18:31 +0000
@@ -1,3 +1,11 @@
+2011-02-07  Paul Eggert  <address@hidden>
+
+       conform to C89 pointer rules
+
+       * dired.c (scmp, file_name_completion):
+       Change types between char * and unsigned char *, to satisfy C89
+       rules about pointer type compatibility.
+
 2011-02-06  Paul Eggert  <address@hidden>
 
        * xterm.c (x_alloc_nearest_color_1): Avoid unportable int assumption.

=== modified file 'src/dired.c'
--- a/src/dired.c       2011-01-30 22:17:44 +0000
+++ b/src/dired.c       2011-02-07 01:18:31 +0000
@@ -99,7 +99,7 @@
 Lisp_Object Qfile_attributes;
 Lisp_Object Qfile_attributes_lessp;
 
-static int scmp (const unsigned char *, const unsigned char *, int);
+static int scmp (const char *, const char *, int);
 
 #ifdef WINDOWSNT
 Lisp_Object
@@ -533,7 +533,7 @@
       QUIT;
       if (! DIRENTRY_NONEMPTY (dp)
          || len < SCHARS (encoded_file)
-         || 0 <= scmp (dp->d_name, SDATA (encoded_file),
+         || 0 <= scmp (dp->d_name, SSDATA (encoded_file),
                        SCHARS (encoded_file)))
        continue;
 
@@ -558,7 +558,7 @@
              && matchcount > 1
              && !includeall /* This match may allow includeall to 0.  */
              && len >= bestmatchsize
-             && 0 > scmp (dp->d_name, SDATA (bestmatch), bestmatchsize))
+             && 0 > scmp (dp->d_name, SSDATA (bestmatch), bestmatchsize))
            continue;
 #endif
 
@@ -578,7 +578,7 @@
                     CONSP (tem); tem = XCDR (tem))
                  {
                    int elt_len;
-                   unsigned char *p1;
+                   char *p1;
 
                    elt = XCAR (tem);
                    if (!STRINGP (elt))
@@ -589,7 +589,7 @@
                    elt_len = SCHARS (elt) - 1; /* -1 for trailing / */
                    if (elt_len <= 0)
                      continue;
-                   p1 = SDATA (elt);
+                   p1 = SSDATA (elt);
                    if (p1[elt_len] != '/')
                      continue;
                    skip = len - elt_len;
@@ -619,7 +619,7 @@
                    if (skip < 0) continue;
 
                    if (0 <= scmp (dp->d_name + skip,
-                                  SDATA (elt),
+                                  SSDATA (elt),
                                   SCHARS (elt)))
                      continue;
                    break;
@@ -796,13 +796,15 @@
    else number of chars that match at the beginning.  */
 
 static int
-scmp (const unsigned char *s1, const unsigned char *s2, int len)
+scmp (const char *s1, const char *s2, int len)
 {
   register int l = len;
 
   if (completion_ignore_case)
     {
-      while (l && DOWNCASE (*s1++) == DOWNCASE (*s2++))
+      while (l
+            && (DOWNCASE ((unsigned char) *s1++)
+                == DOWNCASE ((unsigned char) *s2++)))
        l--;
     }
   else


reply via email to

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