summaryrefslogtreecommitdiff
path: root/nuttx/fs
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-02-20 23:16:24 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-02-20 23:16:24 +0000
commit5e160e6e0cdfae48ea120909e7febc62b6b56eb2 (patch)
treea8ac308120edfb2eacd53d89b343c878f9dc1a3d /nuttx/fs
parent630b4bdd3d2ca967f0e1d4f438f7f1761461dd31 (diff)
downloadpx4-nuttx-5e160e6e0cdfae48ea120909e7febc62b6b56eb2.tar.gz
px4-nuttx-5e160e6e0cdfae48ea120909e7febc62b6b56eb2.tar.bz2
px4-nuttx-5e160e6e0cdfae48ea120909e7febc62b6b56eb2.zip
Working toward compiler independence: Removed inline funcs
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@15 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/fs')
-rw-r--r--nuttx/fs/fs_dup.c21
-rw-r--r--nuttx/fs/fs_files.c5
-rw-r--r--nuttx/fs/fs_inode.c16
-rw-r--r--nuttx/fs/fs_internal.h4
4 files changed, 15 insertions, 31 deletions
diff --git a/nuttx/fs/fs_dup.c b/nuttx/fs/fs_dup.c
index 02a62daf6..114f4b951 100644
--- a/nuttx/fs/fs_dup.c
+++ b/nuttx/fs/fs_dup.c
@@ -55,23 +55,14 @@
* Definitions
************************************************************/
+#define DUP_ISOPEN(fd, list) \
+ ((unsigned int)fd < CONFIG_NFILE_DESCRIPTORS && \
+ list->fl_files[fd].f_inode != NULL)
+
/************************************************************
* Private Functions
************************************************************/
-static inline boolean dup_isopen(int fd, struct filelist *list)
-{
- if ((unsigned int)fd >= CONFIG_NFILE_DESCRIPTORS ||
- list->fl_files[fd].f_inode == NULL)
- {
- return FALSE;
- }
- else
- {
- return TRUE;
- }
-}
-
/************************************************************
* Global Functions
************************************************************/
@@ -92,7 +83,7 @@ int dup(int fildes)
/* Verify that fildes is a valid, open file descriptor */
- if (!dup_isopen(fildes, list))
+ if (!DUP_ISOPEN(fildes, list))
{
*get_errno_ptr() = EBADF;
return ERROR;
@@ -131,7 +122,7 @@ int dup2(int fildes1, int fildes2)
/* Verify that fildes is a valid, open file descriptor */
- if (!dup_isopen(fildes1, list))
+ if (!DUP_ISOPEN(fildes1, list))
{
*get_errno_ptr() = EBADF;
return ERROR;
diff --git a/nuttx/fs/fs_files.c b/nuttx/fs/fs_files.c
index 7ffede460..a280f9210 100644
--- a/nuttx/fs/fs_files.c
+++ b/nuttx/fs/fs_files.c
@@ -86,10 +86,7 @@ static void _files_semtake(struct filelist *list)
}
}
-static inline void _files_semgive(struct filelist *list)
-{
- sem_post(&list->fl_sem);
-}
+#define _files_semgive(list) sem_post(&list->fl_sem)
/************************************************************
* Pulblic Functions
diff --git a/nuttx/fs/fs_inode.c b/nuttx/fs/fs_inode.c
index b080a4e43..db7451d30 100644
--- a/nuttx/fs/fs_inode.c
+++ b/nuttx/fs/fs_inode.c
@@ -53,9 +53,12 @@
#include "fs_internal.h"
/************************************************************
- * Private types
+ * Definitions
************************************************************/
+#define INODE_SEMGIVE() \
+ sem_post(&tree_sem)
+
/************************************************************
* Private Variables
************************************************************/
@@ -86,10 +89,7 @@ static void _inode_semtake(void)
}
}
-static inline void _inode_semgive(void)
-{
- sem_post(&tree_sem);
-}
+#define _inode_semgive(void) sem_post(&tree_sem)
static int _inode_compare(const char *fname,
struct inode *node)
@@ -152,20 +152,20 @@ static int _inode_compare(const char *fname,
}
}
-static inline int _inode_namelen(const char *name)
+static int _inode_namelen(const char *name)
{
const char *tmp = name;
while(*tmp && *tmp != '/') tmp++;
return tmp - name;
}
-static inline void _inode_namecpy(char *dest, const char *src)
+static void _inode_namecpy(char *dest, const char *src)
{
while(*src && *src != '/') *dest++ = *src++;
*dest='\0';
}
-static inline const char *_inode_nextname(const char *name)
+static const char *_inode_nextname(const char *name)
{
while (*name && *name != '/') name++;
if (*name) name++;
diff --git a/nuttx/fs/fs_internal.h b/nuttx/fs/fs_internal.h
index 14265895f..e8e8a33c9 100644
--- a/nuttx/fs/fs_internal.h
+++ b/nuttx/fs/fs_internal.h
@@ -64,10 +64,6 @@ extern struct file files[CONFIG_NFILE_DESCRIPTORS];
extern struct inode *root_inode;
/************************************************************
- * Inline Functions
- ************************************************************/
-
-/************************************************************
* Pulblic Function Prototypes
************************************************************/