summaryrefslogtreecommitdiff
path: root/src/dired.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2012-08-27 10:23:48 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2012-08-27 10:23:48 -0700
commitde1339b0a8a5b6b8bf784c816b2b974f4610e3ac (patch)
tree2a77a2ce1b781f5cf30c734e9b0919a6ff3264ec /src/dired.c
parentf10fe38f772c29031a23ef7aa92d2de1b3675461 (diff)
downloademacs-de1339b0a8a5b6b8bf784c816b2b974f4610e3ac.tar.gz
* composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
* composite.c (find_composition, composition_gstring_p) (composition_reseat_it, find_automatic_composition): * data.c (let_shadows_buffer_binding_p) (let_shadows_global_binding_p, set_internal, make_blv) (Fmake_variable_buffer_local, Fmake_local_variable) (Fmake_variable_frame_local, arithcompare, cons_to_unsigned) (cons_to_signed, arith_driver): * dbusbind.c (xd_in_read_queued_messages): * dired.c (directory_files_internal, file_name_completion): Use bool for booleans. * dired.c (file_name_completion): * process.h (fd_callback): Omit int (actually boolean) argument. It wasn't being used. All uses changed. * composite.h, lisp.h: Reflect above API changes.
Diffstat (limited to 'src/dired.c')
-rw-r--r--src/dired.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/src/dired.c b/src/dired.c
index 771230717e3..206f370ed63 100644
--- a/src/dired.c
+++ b/src/dired.c
@@ -109,18 +109,20 @@ directory_files_internal_unwind (Lisp_Object dh)
}
/* Function shared by Fdirectory_files and Fdirectory_files_and_attributes.
- When ATTRS is zero, return a list of directory filenames; when
- non-zero, return a list of directory filenames and their attributes.
+ If not ATTRS, return a list of directory filenames;
+ if ATTRS, return a list of directory filenames and their attributes.
In the latter case, ID_FORMAT is passed to Ffile_attributes. */
Lisp_Object
-directory_files_internal (Lisp_Object directory, Lisp_Object full, Lisp_Object match, Lisp_Object nosort, int attrs, Lisp_Object id_format)
+directory_files_internal (Lisp_Object directory, Lisp_Object full,
+ Lisp_Object match, Lisp_Object nosort, bool attrs,
+ Lisp_Object id_format)
{
DIR *d;
ptrdiff_t directory_nbytes;
Lisp_Object list, dirfilename, encoded_directory;
struct re_pattern_buffer *bufp = NULL;
- int needsep = 0;
+ bool needsep = 0;
ptrdiff_t count = SPECPDL_INDEX ();
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
DIRENTRY *dp;
@@ -227,7 +229,7 @@ directory_files_internal (Lisp_Object directory, Lisp_Object full, Lisp_Object m
if (DIRENTRY_NONEMPTY (dp))
{
ptrdiff_t len;
- int wanted = 0;
+ bool wanted = 0;
Lisp_Object name, finalname;
struct gcpro gcpro1, gcpro2;
@@ -381,9 +383,8 @@ which see. */)
}
-static Lisp_Object file_name_completion
- (Lisp_Object file, Lisp_Object dirname, int all_flag, int ver_flag,
- Lisp_Object predicate);
+static Lisp_Object file_name_completion (Lisp_Object, Lisp_Object, bool,
+ Lisp_Object);
DEFUN ("file-name-completion", Ffile_name_completion, Sfile_name_completion,
2, 3, 0,
@@ -415,7 +416,7 @@ determined by the variable `completion-ignored-extensions', which see. */)
if (!NILP (handler))
return call4 (handler, Qfile_name_completion, file, directory, predicate);
- return file_name_completion (file, directory, 0, 0, predicate);
+ return file_name_completion (file, directory, 0, predicate);
}
DEFUN ("file-name-all-completions", Ffile_name_all_completions,
@@ -439,14 +440,15 @@ These are all file names in directory DIRECTORY which begin with FILE. */)
if (!NILP (handler))
return call3 (handler, Qfile_name_all_completions, file, directory);
- return file_name_completion (file, directory, 1, 0, Qnil);
+ return file_name_completion (file, directory, 1, Qnil);
}
static int file_name_completion_stat (Lisp_Object dirname, DIRENTRY *dp, struct stat *st_addr);
static Lisp_Object Qdefault_directory;
static Lisp_Object
-file_name_completion (Lisp_Object file, Lisp_Object dirname, int all_flag, int ver_flag, Lisp_Object predicate)
+file_name_completion (Lisp_Object file, Lisp_Object dirname, bool all_flag,
+ Lisp_Object predicate)
{
DIR *d;
ptrdiff_t bestmatchsize = 0;
@@ -459,10 +461,10 @@ file_name_completion (Lisp_Object file, Lisp_Object dirname, int all_flag, int v
Lisp_Object encoded_dir;
struct stat st;
int directoryp;
- /* If includeall is zero, exclude files in completion-ignored-extensions as
+ /* If not INCLUDEALL, exclude files in completion-ignored-extensions as
well as "." and "..". Until shown otherwise, assume we can't exclude
anything. */
- int includeall = 1;
+ bool includeall = 1;
ptrdiff_t count = SPECPDL_INDEX ();
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
@@ -500,7 +502,7 @@ file_name_completion (Lisp_Object file, Lisp_Object dirname, int all_flag, int v
{
DIRENTRY *dp;
ptrdiff_t len;
- int canexclude = 0;
+ bool canexclude = 0;
errno = 0;
dp = readdir (d);