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
a0ea61f5
Commit
a0ea61f5
authored
Jan 20, 2018
by
devsaurus
Browse files
remove inline declarations
parent
73c9700b
Changes
3
Hide whitespace changes
Inline
Side-by-side
app/coap/coap.c
View file @
a0ea61f5
...
@@ -549,7 +549,7 @@ void coap_setup(void)
...
@@ -549,7 +549,7 @@ void coap_setup(void)
message_id
=
(
unsigned
short
)
os_random
();
// calculate only once
message_id
=
(
unsigned
short
)
os_random
();
// calculate only once
}
}
inline
int
int
check_token
(
coap_packet_t
*
pkt
)
{
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
;
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 @
a0ea61f5
...
@@ -112,12 +112,12 @@ struct myvfs_dir {
...
@@ -112,12 +112,12 @@ struct myvfs_dir {
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
// exported helper functions for FatFS
// exported helper functions for FatFS
//
//
inline
void
*
ff_memalloc
(
UINT
size
)
void
*
ff_memalloc
(
UINT
size
)
{
{
return
c_malloc
(
size
);
return
c_malloc
(
size
);
}
}
inline
void
ff_memfree
(
void
*
mblock
)
void
ff_memfree
(
void
*
mblock
)
{
{
c_free
(
mblock
);
c_free
(
mblock
);
}
}
...
...
app/platform/vfs.h
View file @
a0ea61f5
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
// vfs_close - close file descriptor and free memory
// vfs_close - close file descriptor and free memory
// fd: file descriptor
// fd: file descriptor
// Returns: VFS_RES_OK or negative value in case of error
// 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
;
vfs_file
*
f
=
(
vfs_file
*
)
fd
;
return
f
?
f
->
fns
->
close
(
f
)
:
VFS_RES_ERR
;
return
f
?
f
->
fns
->
close
(
f
)
:
VFS_RES_ERR
;
}
}
...
@@ -25,7 +25,7 @@ inline sint32_t vfs_close( int fd ) {
...
@@ -25,7 +25,7 @@ inline sint32_t vfs_close( int fd ) {
// ptr: destination data buffer
// ptr: destination data buffer
// len: requested length
// len: requested length
// Returns: Number of bytes read, or VFS_RES_ERR in case of error
// 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
;
vfs_file
*
f
=
(
vfs_file
*
)
fd
;
return
f
?
f
->
fns
->
read
(
f
,
ptr
,
len
)
:
VFS_RES_ERR
;
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 ) {
...
@@ -35,7 +35,7 @@ inline sint32_t vfs_read( int fd, void *ptr, size_t len ) {
// ptr: source data buffer
// ptr: source data buffer
// len: requested length
// len: requested length
// Returns: Number of bytes written, or VFS_RES_ERR in case of error
// 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
;
vfs_file
*
f
=
(
vfs_file
*
)
fd
;
return
f
?
f
->
fns
->
write
(
f
,
ptr
,
len
)
:
VFS_RES_ERR
;
return
f
?
f
->
fns
->
write
(
f
,
ptr
,
len
)
:
VFS_RES_ERR
;
}
}
...
@@ -51,7 +51,7 @@ int vfs_ungetc( int c, int fd );
...
@@ -51,7 +51,7 @@ int vfs_ungetc( int c, int fd );
// VFS_SEEK_CUR - set pointer to current position + off
// VFS_SEEK_CUR - set pointer to current position + off
// VFS_SEEK_END - set pointer to end of file + off
// VFS_SEEK_END - set pointer to end of file + off
// Returns: New position, or VFS_RES_ERR in case of error
// 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
;
vfs_file
*
f
=
(
vfs_file
*
)
fd
;
return
f
?
f
->
fns
->
lseek
(
f
,
off
,
whence
)
:
VFS_RES_ERR
;
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 ) {
...
@@ -59,7 +59,7 @@ inline sint32_t vfs_lseek( int fd, sint32_t off, int whence ) {
// vfs_eof - test for end-of-file
// vfs_eof - test for end-of-file
// fd: file descriptor
// fd: file descriptor
// Returns: 0 if not at end, != 0 if end of file
// 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
;
vfs_file
*
f
=
(
vfs_file
*
)
fd
;
return
f
?
f
->
fns
->
eof
(
f
)
:
VFS_RES_ERR
;
return
f
?
f
->
fns
->
eof
(
f
)
:
VFS_RES_ERR
;
}
}
...
@@ -67,7 +67,7 @@ inline sint32_t vfs_eof( int fd ) {
...
@@ -67,7 +67,7 @@ inline sint32_t vfs_eof( int fd ) {
// vfs_tell - get read/write position
// vfs_tell - get read/write position
// fd: file descriptor
// fd: file descriptor
// Returns: Current position
// Returns: Current position
inline
sint32_t
vfs_tell
(
int
fd
)
{
static
sint32_t
vfs_tell
(
int
fd
)
{
vfs_file
*
f
=
(
vfs_file
*
)
fd
;
vfs_file
*
f
=
(
vfs_file
*
)
fd
;
return
f
?
f
->
fns
->
tell
(
f
)
:
VFS_RES_ERR
;
return
f
?
f
->
fns
->
tell
(
f
)
:
VFS_RES_ERR
;
}
}
...
@@ -75,7 +75,7 @@ inline sint32_t vfs_tell( int fd ) {
...
@@ -75,7 +75,7 @@ inline sint32_t vfs_tell( int fd ) {
// vfs_flush - flush write cache to file
// vfs_flush - flush write cache to file
// fd: file descriptor
// fd: file descriptor
// Returns: VFS_RES_OK, or VFS_RES_ERR in case of error
// 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
;
vfs_file
*
f
=
(
vfs_file
*
)
fd
;
return
f
?
f
->
fns
->
flush
(
f
)
:
VFS_RES_ERR
;
return
f
?
f
->
fns
->
flush
(
f
)
:
VFS_RES_ERR
;
}
}
...
@@ -83,7 +83,7 @@ inline sint32_t vfs_flush( int fd ) {
...
@@ -83,7 +83,7 @@ inline sint32_t vfs_flush( int fd ) {
// vfs_size - get current file size
// vfs_size - get current file size
// fd: file descriptor
// fd: file descriptor
// Returns: File size
// Returns: File size
inline
uint32_t
vfs_size
(
int
fd
)
{
static
uint32_t
vfs_size
(
int
fd
)
{
vfs_file
*
f
=
(
vfs_file
*
)
fd
;
vfs_file
*
f
=
(
vfs_file
*
)
fd
;
return
f
?
f
->
fns
->
size
(
f
)
:
0
;
return
f
?
f
->
fns
->
size
(
f
)
:
0
;
}
}
...
@@ -100,13 +100,13 @@ sint32_t vfs_ferrno( int fd );
...
@@ -100,13 +100,13 @@ sint32_t vfs_ferrno( int fd );
// vfs_closedir - close directory descriptor and free memory
// vfs_closedir - close directory descriptor and free memory
// dd: dir descriptor
// dd: dir descriptor
// Returns: VFS_RES_OK, or VFS_RES_ERR in case of error
// 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
// vfs_readdir - read next directory item
// dd: dir descriptor
// dd: dir descriptor
// buf: pre-allocated stat structure to be filled in
// buf: pre-allocated stat structure to be filled in
// Returns: VFS_RES_OK if next item found, otherwise VFS_RES_ERR
// 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
// volume functions
...
@@ -115,7 +115,7 @@ inline sint32_t vfs_readdir( vfs_dir *dd, struct vfs_stat *buf ) { return dd->fn
...
@@ -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
// vfs_umount - unmount logical drive and free memory
// vol: volume object
// vol: volume object
// Returns: VFS_RES_OK, or VFS_RES_ERR in case of error
// 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
// 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