diff options
author | Andy Wingo <wingo@pobox.com> | 2009-12-08 21:31:42 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2009-12-08 23:13:07 +0100 |
commit | b9ef8e66eec1da83e0587c2d454c04ca5532817d (patch) | |
tree | 706bc9111da301d28fa1d8159ac67fc242d4cbb3 /libguile/filesys.c | |
parent | 4dc2165b356d6f360f8d82fc04c916b7240eec19 (diff) | |
download | guile-b9ef8e66eec1da83e0587c2d454c04ca5532817d.tar.gz |
SCM_CELL in filesys.[ch]
* libguile/filesys.h (SCM_DIR_FLAG_OPEN, SCM_DIR_OPEN_P)
* libguile/filesys.c (scm_readdir, scm_rewinddir, scm_closedir)
(scm_dir_print, scm_dir_free): Fix SCM_CELL macro usage.
Diffstat (limited to 'libguile/filesys.c')
-rw-r--r-- | libguile/filesys.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/libguile/filesys.c b/libguile/filesys.c index e60efddcf..02f2da632 100644 --- a/libguile/filesys.c +++ b/libguile/filesys.c @@ -852,7 +852,7 @@ SCM_DEFINE (scm_opendir, "opendir", 1, 0, 0, STRING_SYSCALL (dirname, c_dirname, ds = opendir (c_dirname)); if (ds == NULL) SCM_SYSERROR; - SCM_RETURN_NEWSMOB (scm_tc16_dir | SCM_DIR_FLAG_OPEN, ds); + SCM_RETURN_NEWSMOB (scm_tc16_dir | (SCM_DIR_FLAG_OPEN<<16), ds); } #undef FUNC_NAME @@ -893,7 +893,7 @@ SCM_DEFINE (scm_readdir, "readdir", 1, 0, 0, somewhere in the smob, or just the dirent size calculated once. */ { struct dirent_or_dirent64 de; /* just for sizeof */ - DIR *ds = (DIR *) SCM_CELL_WORD_1 (port); + DIR *ds = (DIR *) SCM_SMOB_DATA_1 (port); size_t namlen; #ifdef NAME_MAX char buf [SCM_MAX (sizeof (de), @@ -926,7 +926,7 @@ SCM_DEFINE (scm_readdir, "readdir", 1, 0, 0, scm_i_dynwind_pthread_mutex_lock (&scm_i_misc_mutex); errno = 0; - SCM_SYSCALL (rdent = readdir_or_readdir64 ((DIR *) SCM_CELL_WORD_1 (port))); + SCM_SYSCALL (rdent = readdir_or_readdir64 ((DIR *) SCM_SMOB_DATA_1 (port))); if (errno != 0) SCM_SYSERROR; @@ -951,7 +951,7 @@ SCM_DEFINE (scm_rewinddir, "rewinddir", 1, 0, 0, if (!SCM_DIR_OPEN_P (port)) SCM_MISC_ERROR ("Directory ~S is not open.", scm_list_1 (port)); - rewinddir ((DIR *) SCM_CELL_WORD_1 (port)); + rewinddir ((DIR *) SCM_SMOB_DATA_1 (port)); return SCM_UNSPECIFIED; } @@ -970,11 +970,11 @@ SCM_DEFINE (scm_closedir, "closedir", 1, 0, 0, { int sts; - SCM_SYSCALL (sts = closedir ((DIR *) SCM_CELL_WORD_1 (port))); + SCM_SYSCALL (sts = closedir ((DIR *) SCM_SMOB_DATA_1 (port))); if (sts != 0) SCM_SYSERROR; - SCM_SET_CELL_WORD_0 (port, scm_tc16_dir); + SCM_SET_SMOB_DATA_0 (port, scm_tc16_dir); } return SCM_UNSPECIFIED; @@ -989,7 +989,7 @@ scm_dir_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED) if (!SCM_DIR_OPEN_P (exp)) scm_puts ("closed: ", port); scm_puts ("directory stream ", port); - scm_uintprint (SCM_CELL_WORD_1 (exp), 16, port); + scm_uintprint (SCM_SMOB_DATA_1 (exp), 16, port); scm_putc ('>', port); return 1; } @@ -999,7 +999,7 @@ static size_t scm_dir_free (SCM p) { if (SCM_DIR_OPEN_P (p)) - closedir ((DIR *) SCM_CELL_WORD_1 (p)); + closedir ((DIR *) SCM_SMOB_DATA_1 (p)); return 0; } |