mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 23:03:27 +08:00
tools/nxstyle.c: Fix a rare false alarm that could occur if a variable or function name begins with the sub-string 'union' or 'struct'. misc fixes under fs/ and sched/ from application of current version of nxstyle.
This commit is contained in:
@@ -78,6 +78,7 @@ static uint16_t g_aio_count;
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Data
|
* Public Data
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/* This is a list of pending asynchronous I/O. The user must hold the
|
/* This is a list of pending asynchronous I/O. The user must hold the
|
||||||
* lock on this list in order to access the list.
|
* lock on this list in order to access the list.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1045,7 +1045,7 @@ static int cromfs_readdir(struct inode *mountpt, struct fs_dirent_s *dir)
|
|||||||
finfo("Entry %lu: %s\n", (unsigned long)offset, name);
|
finfo("Entry %lu: %s\n", (unsigned long)offset, name);
|
||||||
strncpy(dir->fd_dir.d_name, name, NAME_MAX + 1);
|
strncpy(dir->fd_dir.d_name, name, NAME_MAX + 1);
|
||||||
|
|
||||||
switch (node->cn_mode & s_IFTGT)
|
switch ((node->cn_mode & s_IFTGT) != 0)
|
||||||
{
|
{
|
||||||
case S_IFDIR: /* Directory */
|
case S_IFDIR: /* Directory */
|
||||||
dir->fd_dir.d_type = DTYPE_DIRECTORY;
|
dir->fd_dir.d_type = DTYPE_DIRECTORY;
|
||||||
|
|||||||
@@ -2772,6 +2772,7 @@ int fat_dirnamewrite(struct fat_mountpt_s *fs, struct fat_dirinfo_s *dirinfo)
|
|||||||
* cache. So we can just fall throught to write that directory entry, perhaps
|
* cache. So we can just fall throught to write that directory entry, perhaps
|
||||||
* using the short file name alias for the long file name.
|
* using the short file name alias for the long file name.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return fat_putsfname(fs, dirinfo);
|
return fat_putsfname(fs, dirinfo);
|
||||||
@@ -2816,6 +2817,7 @@ int fat_dirwrite(struct fat_mountpt_s *fs, struct fat_dirinfo_s *dirinfo,
|
|||||||
* cache. So we can just fall throught to write that directory entry, perhaps
|
* cache. So we can just fall throught to write that directory entry, perhaps
|
||||||
* using the short file name alias for the long file name.
|
* using the short file name alias for the long file name.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Put the short file name entry data */
|
/* Put the short file name entry data */
|
||||||
|
|||||||
@@ -158,6 +158,7 @@ static int foreach_inodelevel(FAR struct inode *node, struct inode_path_s *info)
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: foreach_inode
|
* Name: foreach_inode
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -60,6 +60,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/* Configuration ************************************************************
|
/* Configuration ************************************************************
|
||||||
*
|
*
|
||||||
* CONFIG_FS_AUTOMOUNTER - Enables AUTOMOUNT support
|
* CONFIG_FS_AUTOMOUNTER - Enables AUTOMOUNT support
|
||||||
|
|||||||
@@ -132,6 +132,7 @@ static ssize_t nxffs_rdseek(FAR struct nxffs_volume_s *volume,
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: nxffs_read
|
* Name: nxffs_read
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -65,6 +65,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/* Determines the size of an intermediate buffer that must be large enough
|
/* Determines the size of an intermediate buffer that must be large enough
|
||||||
* to handle the longest line generated by this logic.
|
* to handle the longest line generated by this logic.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -64,6 +64,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/* Determines the size of an intermediate buffer that must be large enough
|
/* Determines the size of an intermediate buffer that must be large enough
|
||||||
* to handle the longest line generated by this logic.
|
* to handle the longest line generated by this logic.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -64,6 +64,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/* Determines the size of an intermediate buffer that must be large enough
|
/* Determines the size of an intermediate buffer that must be large enough
|
||||||
* to handle the longest line generated by this logic.
|
* to handle the longest line generated by this logic.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -65,6 +65,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/* Determines the size of an intermediate buffer that must be large enough
|
/* Determines the size of an intermediate buffer that must be large enough
|
||||||
* to handle the longest line generated by this logic.
|
* to handle the longest line generated by this logic.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -95,7 +95,6 @@ struct skel_level1_s
|
|||||||
/* Add context specific data types here for managing the directory
|
/* Add context specific data types here for managing the directory
|
||||||
* open / read / stat, etc.
|
* open / read / stat, etc.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
@@ -74,6 +74,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Types
|
* Private Types
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/* This enumeration identifies all of the thread attributes that can be
|
/* This enumeration identifies all of the thread attributes that can be
|
||||||
* accessed via the procfs file system.
|
* accessed via the procfs file system.
|
||||||
*/
|
*/
|
||||||
|
|||||||
+2
-2
@@ -353,8 +353,8 @@ int inode_stat(FAR struct inode *inode, FAR struct stat *buf)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (inode->u.i_ops != NULL)
|
else if (inode->u.i_ops != NULL)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -76,6 +76,7 @@ int clock_getres(clockid_t clock_id, struct timespec *res)
|
|||||||
case CLOCK_MONOTONIC:
|
case CLOCK_MONOTONIC:
|
||||||
#endif
|
#endif
|
||||||
case CLOCK_REALTIME:
|
case CLOCK_REALTIME:
|
||||||
|
|
||||||
/* Form the timspec using clock resolution in nanoseconds */
|
/* Form the timspec using clock resolution in nanoseconds */
|
||||||
|
|
||||||
res->tv_sec = 0;
|
res->tv_sec = 0;
|
||||||
|
|||||||
@@ -279,7 +279,8 @@ static int modprocfs_dup(FAR const struct file *oldp, FAR struct file *newp)
|
|||||||
|
|
||||||
/* Allocate a new container to hold the task and attribute selection */
|
/* Allocate a new container to hold the task and attribute selection */
|
||||||
|
|
||||||
newpriv = (FAR struct modprocfs_file_s *)kmm_zalloc(sizeof(struct modprocfs_file_s));
|
newpriv = (FAR struct modprocfs_file_s *)
|
||||||
|
kmm_zalloc(sizeof(struct modprocfs_file_s));
|
||||||
if (!newpriv)
|
if (!newpriv)
|
||||||
{
|
{
|
||||||
ferr("ERROR: Failed to allocate file attributes\n");
|
ferr("ERROR: Failed to allocate file attributes\n");
|
||||||
|
|||||||
@@ -606,7 +606,8 @@ int pg_worker(int argc, char *argv[])
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
pgerr("ERROR: Timeout!\n");
|
pgerr("ERROR: Timeout!\n");
|
||||||
DEBUGASSERT(clock_systimer() - g_starttime < CONFIG_PAGING_TIMEOUT_TICKS);
|
DEBUGASSERT(clock_systimer() - g_starttime <
|
||||||
|
CONFIG_PAGING_TIMEOUT_TICKS);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-4
@@ -487,8 +487,8 @@ int main(int argc, char **argv, char **envp)
|
|||||||
strncmp(&line[indent], "CODE ", 5) == 0 ||
|
strncmp(&line[indent], "CODE ", 5) == 0 ||
|
||||||
strncmp(&line[indent], "const ", 6) == 0 ||
|
strncmp(&line[indent], "const ", 6) == 0 ||
|
||||||
strncmp(&line[indent], "double ", 7) == 0 ||
|
strncmp(&line[indent], "double ", 7) == 0 ||
|
||||||
// strncmp(&line[indent], "struct ", 7) == 0 ||
|
strncmp(&line[indent], "struct ", 7) == 0 ||
|
||||||
strncmp(&line[indent], "struct", 6) == 0 || /* May be unnamed */
|
strncmp(&line[indent], "struct\n", 7) == 0 || /* May be unnamed */
|
||||||
strncmp(&line[indent], "enum ", 5) == 0 ||
|
strncmp(&line[indent], "enum ", 5) == 0 ||
|
||||||
strncmp(&line[indent], "extern ", 7) == 0 ||
|
strncmp(&line[indent], "extern ", 7) == 0 ||
|
||||||
strncmp(&line[indent], "EXTERN ", 7) == 0 ||
|
strncmp(&line[indent], "EXTERN ", 7) == 0 ||
|
||||||
@@ -510,8 +510,8 @@ int main(int argc, char **argv, char **envp)
|
|||||||
strncmp(&line[indent], "uint8_t ", 8) == 0 ||
|
strncmp(&line[indent], "uint8_t ", 8) == 0 ||
|
||||||
strncmp(&line[indent], "uint16_t ", 9) == 0 ||
|
strncmp(&line[indent], "uint16_t ", 9) == 0 ||
|
||||||
strncmp(&line[indent], "uint32_t ", 9) == 0 ||
|
strncmp(&line[indent], "uint32_t ", 9) == 0 ||
|
||||||
// strncmp(&line[indent], "union ", 6) == 0 ||
|
strncmp(&line[indent], "union ", 6) == 0 ||
|
||||||
strncmp(&line[indent], "union", 5) == 0 || /* May be unnamed */
|
strncmp(&line[indent], "union\n", 6) == 0 || /* May be unnamed */
|
||||||
strncmp(&line[indent], "unsigned ", 9) == 0 ||
|
strncmp(&line[indent], "unsigned ", 9) == 0 ||
|
||||||
strncmp(&line[indent], "void ", 5) == 0 ||
|
strncmp(&line[indent], "void ", 5) == 0 ||
|
||||||
strncmp(&line[indent], "volatile ", 9) == 0)
|
strncmp(&line[indent], "volatile ", 9) == 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user