diff options
| author | Paul Eggert | 2011-02-06 17:18:31 -0800 |
|---|---|---|
| committer | Paul Eggert | 2011-02-06 17:18:31 -0800 |
| commit | 4f043d0f4de7cdb0c1f49bd99779ba8edeaab166 (patch) | |
| tree | 853adfacbc5fc814ba832353ed3e544964f97a4a | |
| parent | ef0069e9b590d75537221e7a95655d03d1b98348 (diff) | |
| download | emacs-4f043d0f4de7cdb0c1f49bd99779ba8edeaab166.tar.gz emacs-4f043d0f4de7cdb0c1f49bd99779ba8edeaab166.zip | |
* dired.c: conform to C89 pointer rules
| -rw-r--r-- | src/ChangeLog | 8 | ||||
| -rw-r--r-- | src/dired.c | 18 |
2 files changed, 18 insertions, 8 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 883753d52e1..0c83fb37961 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2011-02-07 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | conform to C89 pointer rules | ||
| 4 | |||
| 5 | * dired.c (scmp, file_name_completion): | ||
| 6 | Change types between char * and unsigned char *, to satisfy C89 | ||
| 7 | rules about pointer type compatibility. | ||
| 8 | |||
| 1 | 2011-02-06 Paul Eggert <eggert@cs.ucla.edu> | 9 | 2011-02-06 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 10 | ||
| 3 | * xterm.c (x_alloc_nearest_color_1): Avoid unportable int assumption. | 11 | * xterm.c (x_alloc_nearest_color_1): Avoid unportable int assumption. |
diff --git a/src/dired.c b/src/dired.c index 08aa230f65f..e37055258d6 100644 --- a/src/dired.c +++ b/src/dired.c | |||
| @@ -99,7 +99,7 @@ Lisp_Object Qfile_name_all_completions; | |||
| 99 | Lisp_Object Qfile_attributes; | 99 | Lisp_Object Qfile_attributes; |
| 100 | Lisp_Object Qfile_attributes_lessp; | 100 | Lisp_Object Qfile_attributes_lessp; |
| 101 | 101 | ||
| 102 | static int scmp (const unsigned char *, const unsigned char *, int); | 102 | static int scmp (const char *, const char *, int); |
| 103 | 103 | ||
| 104 | #ifdef WINDOWSNT | 104 | #ifdef WINDOWSNT |
| 105 | Lisp_Object | 105 | Lisp_Object |
| @@ -533,7 +533,7 @@ file_name_completion (Lisp_Object file, Lisp_Object dirname, int all_flag, int v | |||
| 533 | QUIT; | 533 | QUIT; |
| 534 | if (! DIRENTRY_NONEMPTY (dp) | 534 | if (! DIRENTRY_NONEMPTY (dp) |
| 535 | || len < SCHARS (encoded_file) | 535 | || len < SCHARS (encoded_file) |
| 536 | || 0 <= scmp (dp->d_name, SDATA (encoded_file), | 536 | || 0 <= scmp (dp->d_name, SSDATA (encoded_file), |
| 537 | SCHARS (encoded_file))) | 537 | SCHARS (encoded_file))) |
| 538 | continue; | 538 | continue; |
| 539 | 539 | ||
| @@ -558,7 +558,7 @@ file_name_completion (Lisp_Object file, Lisp_Object dirname, int all_flag, int v | |||
| 558 | && matchcount > 1 | 558 | && matchcount > 1 |
| 559 | && !includeall /* This match may allow includeall to 0. */ | 559 | && !includeall /* This match may allow includeall to 0. */ |
| 560 | && len >= bestmatchsize | 560 | && len >= bestmatchsize |
| 561 | && 0 > scmp (dp->d_name, SDATA (bestmatch), bestmatchsize)) | 561 | && 0 > scmp (dp->d_name, SSDATA (bestmatch), bestmatchsize)) |
| 562 | continue; | 562 | continue; |
| 563 | #endif | 563 | #endif |
| 564 | 564 | ||
| @@ -578,7 +578,7 @@ file_name_completion (Lisp_Object file, Lisp_Object dirname, int all_flag, int v | |||
| 578 | CONSP (tem); tem = XCDR (tem)) | 578 | CONSP (tem); tem = XCDR (tem)) |
| 579 | { | 579 | { |
| 580 | int elt_len; | 580 | int elt_len; |
| 581 | unsigned char *p1; | 581 | char *p1; |
| 582 | 582 | ||
| 583 | elt = XCAR (tem); | 583 | elt = XCAR (tem); |
| 584 | if (!STRINGP (elt)) | 584 | if (!STRINGP (elt)) |
| @@ -589,7 +589,7 @@ file_name_completion (Lisp_Object file, Lisp_Object dirname, int all_flag, int v | |||
| 589 | elt_len = SCHARS (elt) - 1; /* -1 for trailing / */ | 589 | elt_len = SCHARS (elt) - 1; /* -1 for trailing / */ |
| 590 | if (elt_len <= 0) | 590 | if (elt_len <= 0) |
| 591 | continue; | 591 | continue; |
| 592 | p1 = SDATA (elt); | 592 | p1 = SSDATA (elt); |
| 593 | if (p1[elt_len] != '/') | 593 | if (p1[elt_len] != '/') |
| 594 | continue; | 594 | continue; |
| 595 | skip = len - elt_len; | 595 | skip = len - elt_len; |
| @@ -619,7 +619,7 @@ file_name_completion (Lisp_Object file, Lisp_Object dirname, int all_flag, int v | |||
| 619 | if (skip < 0) continue; | 619 | if (skip < 0) continue; |
| 620 | 620 | ||
| 621 | if (0 <= scmp (dp->d_name + skip, | 621 | if (0 <= scmp (dp->d_name + skip, |
| 622 | SDATA (elt), | 622 | SSDATA (elt), |
| 623 | SCHARS (elt))) | 623 | SCHARS (elt))) |
| 624 | continue; | 624 | continue; |
| 625 | break; | 625 | break; |
| @@ -796,13 +796,15 @@ file_name_completion (Lisp_Object file, Lisp_Object dirname, int all_flag, int v | |||
| 796 | else number of chars that match at the beginning. */ | 796 | else number of chars that match at the beginning. */ |
| 797 | 797 | ||
| 798 | static int | 798 | static int |
| 799 | scmp (const unsigned char *s1, const unsigned char *s2, int len) | 799 | scmp (const char *s1, const char *s2, int len) |
| 800 | { | 800 | { |
| 801 | register int l = len; | 801 | register int l = len; |
| 802 | 802 | ||
| 803 | if (completion_ignore_case) | 803 | if (completion_ignore_case) |
| 804 | { | 804 | { |
| 805 | while (l && DOWNCASE (*s1++) == DOWNCASE (*s2++)) | 805 | while (l |
| 806 | && (DOWNCASE ((unsigned char) *s1++) | ||
| 807 | == DOWNCASE ((unsigned char) *s2++))) | ||
| 806 | l--; | 808 | l--; |
| 807 | } | 809 | } |
| 808 | else | 810 | else |