Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Nodemcu Firmware
Commits
6ef6db90
Unverified
Commit
6ef6db90
authored
Jan 21, 2018
by
Terry Ellison
Committed by
GitHub
Jan 21, 2018
Browse files
Merge pull request #2233 from devsaurus/remove_inline
Remove inline declarations
parents
73c9700b
a0ea61f5
Changes
3
Hide whitespace changes
Inline
Side-by-side
app/coap/coap.c
View file @
6ef6db90
...
...
@@ -549,7 +549,7 @@ void coap_setup(void)
message_id
=
(
unsigned
short
)
os_random
();
// calculate only once
}
inline
int
int
check_token
(
coap_packet_t
*
pkt
)
{
return
pkt
->
tok
.
len
==
the_token
.
len
&&
c_memcmp
(
pkt
->
tok
.
p
,
the_token
.
p
,
the_token
.
len
)
==
0
;
}
app/fatfs/myfatfs.c
View file @
6ef6db90
...
...
@@ -112,12 +112,12 @@ struct myvfs_dir {
// ---------------------------------------------------------------------------
// exported helper functions for FatFS
//
inline
void
*
ff_memalloc
(
UINT
size
)
void
*
ff_memalloc
(
UINT
size
)
{
return
c_malloc
(
size
);
}
inline
void
ff_memfree
(
void
*
mblock
)
void
ff_memfree
(
void
*
mblock
)
{
c_free
(
mblock
);
}
...
...
app/platform/vfs.h
View file @
6ef6db90
...
...
@@ -15,7 +15,7 @@
// vfs_close - close file descriptor and free memory
// fd: file descriptor
// Returns: VFS_RES_OK or negative value in case of error
inline
sint32_t
vfs_close
(
int
fd
)
{
static
sint32_t
vfs_close
(
int
fd
)
{
vfs_file
*
f
=
(
vfs_file
*
)
fd
;
return
f
?
f
->
fns
->
close
(
f
)
:
VFS_RES_ERR
;
}
...
...
@@ -25,7 +25,7 @@ inline sint32_t vfs_close( int fd ) {
// ptr: destination data buffer
// len: requested length
// Returns: Number of bytes read, or VFS_RES_ERR in case of error
inline
sint32_t
vfs_read
(
int
fd
,
void
*
ptr
,
size_t
len
)
{
static
sint32_t
vfs_read
(
int
fd
,
void
*
ptr
,
size_t
len
)
{
vfs_file
*
f
=
(
vfs_file
*
)
fd
;
return
f
?
f
->
fns
->
read
(
f
,
ptr
,
len
)
:
VFS_RES_ERR
;
}
...
...
@@ -35,7 +35,7 @@ inline sint32_t vfs_read( int fd, void *ptr, size_t len ) {
// ptr: source data buffer
// len: requested length
// Returns: Number of bytes written, or VFS_RES_ERR in case of error
inline
sint32_t
vfs_write
(
int
fd
,
const
void
*
ptr
,
size_t
len
)
{
static
sint32_t
vfs_write
(
int
fd
,
const
void
*
ptr
,
size_t
len
)
{
vfs_file
*
f
=
(
vfs_file
*
)
fd
;
return
f
?
f
->
fns
->
write
(
f
,
ptr
,
len
)
:
VFS_RES_ERR
;
}
...
...
@@ -51,7 +51,7 @@ int vfs_ungetc( int c, int fd );
// VFS_SEEK_CUR - set pointer to current position + off
// VFS_SEEK_END - set pointer to end of file + off
// Returns: New position, or VFS_RES_ERR in case of error
inline
sint32_t
vfs_lseek
(
int
fd
,
sint32_t
off
,
int
whence
)
{
static
sint32_t
vfs_lseek
(
int
fd
,
sint32_t
off
,
int
whence
)
{
vfs_file
*
f
=
(
vfs_file
*
)
fd
;
return
f
?
f
->
fns
->
lseek
(
f
,
off
,
whence
)
:
VFS_RES_ERR
;
}
...
...
@@ -59,7 +59,7 @@ inline sint32_t vfs_lseek( int fd, sint32_t off, int whence ) {
// vfs_eof - test for end-of-file
// fd: file descriptor
// Returns: 0 if not at end, != 0 if end of file
inline
sint32_t
vfs_eof
(
int
fd
)
{
static
sint32_t
vfs_eof
(
int
fd
)
{
vfs_file
*
f
=
(
vfs_file
*
)
fd
;
return
f
?
f
->
fns
->
eof
(
f
)
:
VFS_RES_ERR
;
}
...
...
@@ -67,7 +67,7 @@ inline sint32_t vfs_eof( int fd ) {
// vfs_tell - get read/write position
// fd: file descriptor
// Returns: Current position
inline
sint32_t
vfs_tell
(
int
fd
)
{
static
sint32_t
vfs_tell
(
int
fd
)
{
vfs_file
*
f
=
(
vfs_file
*
)
fd
;
return
f
?
f
->
fns
->
tell
(
f
)
:
VFS_RES_ERR
;
}
...
...
@@ -75,7 +75,7 @@ inline sint32_t vfs_tell( int fd ) {
// vfs_flush - flush write cache to file
// fd: file descriptor
// Returns: VFS_RES_OK, or VFS_RES_ERR in case of error
inline
sint32_t
vfs_flush
(
int
fd
)
{
static
sint32_t
vfs_flush
(
int
fd
)
{
vfs_file
*
f
=
(
vfs_file
*
)
fd
;
return
f
?
f
->
fns
->
flush
(
f
)
:
VFS_RES_ERR
;
}
...
...
@@ -83,7 +83,7 @@ inline sint32_t vfs_flush( int fd ) {
// vfs_size - get current file size
// fd: file descriptor
// Returns: File size
inline
uint32_t
vfs_size
(
int
fd
)
{
static
uint32_t
vfs_size
(
int
fd
)
{
vfs_file
*
f
=
(
vfs_file
*
)
fd
;
return
f
?
f
->
fns
->
size
(
f
)
:
0
;
}
...
...
@@ -100,13 +100,13 @@ sint32_t vfs_ferrno( int fd );
// vfs_closedir - close directory descriptor and free memory
// dd: dir descriptor
// Returns: VFS_RES_OK, or VFS_RES_ERR in case of error
inline
sint32_t
vfs_closedir
(
vfs_dir
*
dd
)
{
return
dd
->
fns
->
close
(
dd
);
}
static
sint32_t
vfs_closedir
(
vfs_dir
*
dd
)
{
return
dd
->
fns
->
close
(
dd
);
}
// vfs_readdir - read next directory item
// dd: dir descriptor
// buf: pre-allocated stat structure to be filled in
// Returns: VFS_RES_OK if next item found, otherwise VFS_RES_ERR
inline
sint32_t
vfs_readdir
(
vfs_dir
*
dd
,
struct
vfs_stat
*
buf
)
{
return
dd
->
fns
->
readdir
(
dd
,
buf
);
}
static
sint32_t
vfs_readdir
(
vfs_dir
*
dd
,
struct
vfs_stat
*
buf
)
{
return
dd
->
fns
->
readdir
(
dd
,
buf
);
}
// ---------------------------------------------------------------------------
// volume functions
...
...
@@ -115,7 +115,7 @@ inline sint32_t vfs_readdir( vfs_dir *dd, struct vfs_stat *buf ) { return dd->fn
// vfs_umount - unmount logical drive and free memory
// vol: volume object
// Returns: VFS_RES_OK, or VFS_RES_ERR in case of error
inline
sint32_t
vfs_umount
(
vfs_vol
*
vol
)
{
return
vol
->
fns
->
umount
(
vol
);
}
static
sint32_t
vfs_umount
(
vfs_vol
*
vol
)
{
return
vol
->
fns
->
umount
(
vol
);
}
// ---------------------------------------------------------------------------
// file system functions
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment