forked from Imagelibrary/rtems
2005-05-06 Joel Sherrill <joel@OARcorp.com>
* libblock/src/blkdev.c, libfs/src/dosfs/fat_file.c, libfs/src/dosfs/fat_file.h, libfs/src/dosfs/msdos.h, libfs/src/dosfs/msdos_create.c, libfs/src/dosfs/msdos_dir.c, libfs/src/dosfs/msdos_initsupp.c, libfs/src/dosfs/msdos_misc.c: Removed warnings.
This commit is contained in:
@@ -1,3 +1,11 @@
|
|||||||
|
2005-05-06 Joel Sherrill <joel@OARcorp.com>
|
||||||
|
|
||||||
|
* libblock/src/blkdev.c, libfs/src/dosfs/fat_file.c,
|
||||||
|
libfs/src/dosfs/fat_file.h, libfs/src/dosfs/msdos.h,
|
||||||
|
libfs/src/dosfs/msdos_create.c, libfs/src/dosfs/msdos_dir.c,
|
||||||
|
libfs/src/dosfs/msdos_initsupp.c, libfs/src/dosfs/msdos_misc.c:
|
||||||
|
Removed warnings.
|
||||||
|
|
||||||
2005-05-04 Jennifer Averett <jennifer.averett@oarcorp.com>
|
2005-05-04 Jennifer Averett <jennifer.averett@oarcorp.com>
|
||||||
|
|
||||||
* include/rtems/pci.h: Name change to support common PCI interface
|
* include/rtems/pci.h: Name change to support common PCI interface
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ rtems_blkdev_generic_read(
|
|||||||
rtems_libio_rw_args_t *args = arg;
|
rtems_libio_rw_args_t *args = arg;
|
||||||
int block_size_log2;
|
int block_size_log2;
|
||||||
int block_size;
|
int block_size;
|
||||||
unsigned char *buf;
|
char *buf;
|
||||||
unsigned int count;
|
unsigned int count;
|
||||||
unsigned int block;
|
unsigned int block;
|
||||||
unsigned int blkofs;
|
unsigned int blkofs;
|
||||||
@@ -93,7 +93,7 @@ rtems_blkdev_generic_write(
|
|||||||
rtems_libio_rw_args_t *args = arg;
|
rtems_libio_rw_args_t *args = arg;
|
||||||
int block_size_log2;
|
int block_size_log2;
|
||||||
int block_size;
|
int block_size;
|
||||||
unsigned char *buf;
|
char *buf;
|
||||||
unsigned int count;
|
unsigned int count;
|
||||||
unsigned int block;
|
unsigned int block;
|
||||||
unsigned int blkofs;
|
unsigned int blkofs;
|
||||||
|
|||||||
@@ -258,8 +258,8 @@ fat_file_read(
|
|||||||
fat_file_fd_t *fat_fd,
|
fat_file_fd_t *fat_fd,
|
||||||
uint32_t start,
|
uint32_t start,
|
||||||
uint32_t count,
|
uint32_t count,
|
||||||
char *buf
|
uint8_t *buf
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
int rc = RC_OK;
|
int rc = RC_OK;
|
||||||
ssize_t ret = 0;
|
ssize_t ret = 0;
|
||||||
@@ -363,7 +363,7 @@ fat_file_write(
|
|||||||
fat_file_fd_t *fat_fd,
|
fat_file_fd_t *fat_fd,
|
||||||
uint32_t start,
|
uint32_t start,
|
||||||
uint32_t count,
|
uint32_t count,
|
||||||
const char *buf
|
const uint8_t *buf
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
|
|||||||
@@ -149,14 +149,14 @@ fat_file_read(rtems_filesystem_mount_table_entry_t *mt_entry,
|
|||||||
fat_file_fd_t *fat_fd,
|
fat_file_fd_t *fat_fd,
|
||||||
uint32_t start,
|
uint32_t start,
|
||||||
uint32_t count,
|
uint32_t count,
|
||||||
char *buf);
|
uint8_t *buf);
|
||||||
|
|
||||||
ssize_t
|
ssize_t
|
||||||
fat_file_write(rtems_filesystem_mount_table_entry_t *mt_entry,
|
fat_file_write(rtems_filesystem_mount_table_entry_t *mt_entry,
|
||||||
fat_file_fd_t *fat_fd,
|
fat_file_fd_t *fat_fd,
|
||||||
uint32_t start,
|
uint32_t start,
|
||||||
uint32_t count,
|
uint32_t count,
|
||||||
const char *buf);
|
const uint8_t *buf);
|
||||||
|
|
||||||
int
|
int
|
||||||
fat_file_extend(rtems_filesystem_mount_table_entry_t *mt_entry,
|
fat_file_extend(rtems_filesystem_mount_table_entry_t *mt_entry,
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ typedef rtems_filesystem_node_types_t msdos_node_type_t;
|
|||||||
*/
|
*/
|
||||||
#define MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE 32 /* 32 bytes */
|
#define MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE 32 /* 32 bytes */
|
||||||
|
|
||||||
#define MSDOS_DIR_NAME(x) (uint8_t *)((x) + 0)
|
#define MSDOS_DIR_NAME(x) (char *)((x) + 0)
|
||||||
#define MSDOS_DIR_ATTR(x) (uint8_t *)((x) + 11)
|
#define MSDOS_DIR_ATTR(x) (uint8_t *)((x) + 11)
|
||||||
#define MSDOS_DIR_NT_RES(x) (uint8_t *)((x) + 12)
|
#define MSDOS_DIR_NT_RES(x) (uint8_t *)((x) + 12)
|
||||||
#define MSDOS_DIR_CRT_TIME_TENTH(x) (uint8_t *)((x) + 13)
|
#define MSDOS_DIR_CRT_TIME_TENTH(x) (uint8_t *)((x) + 13)
|
||||||
|
|||||||
@@ -214,7 +214,7 @@ msdos_creat_node(
|
|||||||
*/
|
*/
|
||||||
ret = fat_file_write(parent_loc->mt_entry, fat_fd, 0,
|
ret = fat_file_write(parent_loc->mt_entry, fat_fd, 0,
|
||||||
MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE * 2,
|
MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE * 2,
|
||||||
dot_dotdot);
|
(uint8_t *)dot_dotdot);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
rc = -1;
|
rc = -1;
|
||||||
@@ -233,7 +233,7 @@ msdos_creat_node(
|
|||||||
/* rewrite dot entry */
|
/* rewrite dot entry */
|
||||||
ret = fat_file_write(parent_loc->mt_entry, fat_fd, 0,
|
ret = fat_file_write(parent_loc->mt_entry, fat_fd, 0,
|
||||||
MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE,
|
MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE,
|
||||||
DOT_NODE_P(dot_dotdot));
|
(uint8_t *)DOT_NODE_P(dot_dotdot));
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
rc = -1;
|
rc = -1;
|
||||||
|
|||||||
@@ -260,7 +260,8 @@ msdos_dir_read(rtems_libio_t *iop, void *buffer, uint32_t count)
|
|||||||
return cmpltd;
|
return cmpltd;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((*MSDOS_DIR_NAME(fs_info->cl_buf + i)) ==
|
/* have to look at the DIR_NAME as "raw" 8-bit data */
|
||||||
|
if ((*(uint8_t *)MSDOS_DIR_NAME(fs_info->cl_buf + i)) ==
|
||||||
MSDOS_THIS_DIR_ENTRY_EMPTY)
|
MSDOS_THIS_DIR_ENTRY_EMPTY)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@@ -309,9 +310,9 @@ msdos_dir_read(rtems_libio_t *iop, void *buffer, uint32_t count)
|
|||||||
* convert dir entry from fixed 8+3 format (without dot)
|
* convert dir entry from fixed 8+3 format (without dot)
|
||||||
* to 0..8 + 1dot + 0..3 format
|
* to 0..8 + 1dot + 0..3 format
|
||||||
*/
|
*/
|
||||||
tmp_dirent.d_namlen =
|
tmp_dirent.d_namlen = msdos_format_dirent_with_dot(
|
||||||
msdos_format_dirent_with_dot(tmp_dirent.d_name,
|
tmp_dirent.d_name,
|
||||||
fs_info->cl_buf + i); /* src text */
|
(char *) fs_info->cl_buf + i); /* src text */
|
||||||
memcpy(buffer + cmpltd, &tmp_dirent, sizeof(struct dirent));
|
memcpy(buffer + cmpltd, &tmp_dirent, sizeof(struct dirent));
|
||||||
|
|
||||||
iop->offset = iop->offset + sizeof(struct dirent);
|
iop->offset = iop->offset + sizeof(struct dirent);
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ msdos_initialize_support(
|
|||||||
cl_buf_size = fs_info->fat.vol.bpc;
|
cl_buf_size = fs_info->fat.vol.bpc;
|
||||||
}
|
}
|
||||||
|
|
||||||
fs_info->cl_buf = (char *)calloc(cl_buf_size, sizeof(char));
|
fs_info->cl_buf = (uint8_t *)calloc(cl_buf_size, sizeof(char));
|
||||||
if (fs_info->cl_buf == NULL)
|
if (fs_info->cl_buf == NULL)
|
||||||
{
|
{
|
||||||
fat_file_close(temp_mt_entry, fat_fd);
|
fat_file_close(temp_mt_entry, fat_fd);
|
||||||
|
|||||||
@@ -285,7 +285,7 @@ msdos_get_name_node(
|
|||||||
ret = fat_file_write(parent_loc->mt_entry, fat_fd,
|
ret = fat_file_write(parent_loc->mt_entry, fat_fd,
|
||||||
fat_fd->fat_file_size,
|
fat_fd->fat_file_size,
|
||||||
MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE,
|
MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE,
|
||||||
name_dir_entry);
|
(uint8_t *)name_dir_entry);
|
||||||
if (ret == -1)
|
if (ret == -1)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
@@ -706,11 +706,12 @@ msdos_dir_is_empty(
|
|||||||
|
|
||||||
assert(ret == fs_info->fat.vol.bps);
|
assert(ret == fs_info->fat.vol.bps);
|
||||||
|
|
||||||
|
/* have to look at the DIR_NAME as "raw" 8-bit data */
|
||||||
for (i = 0;
|
for (i = 0;
|
||||||
i < fs_info->fat.vol.bps;
|
i < fs_info->fat.vol.bps;
|
||||||
i += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
|
i += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
|
||||||
{
|
{
|
||||||
if (((*MSDOS_DIR_NAME(fs_info->cl_buf + i)) ==
|
if (((*(uint8_t *)MSDOS_DIR_NAME(fs_info->cl_buf + i)) ==
|
||||||
MSDOS_THIS_DIR_ENTRY_EMPTY) ||
|
MSDOS_THIS_DIR_ENTRY_EMPTY) ||
|
||||||
(strncmp(MSDOS_DIR_NAME((fs_info->cl_buf + i)), MSDOS_DOT_NAME,
|
(strncmp(MSDOS_DIR_NAME((fs_info->cl_buf + i)), MSDOS_DOT_NAME,
|
||||||
MSDOS_SHORT_NAME_LEN) == 0) ||
|
MSDOS_SHORT_NAME_LEN) == 0) ||
|
||||||
@@ -790,12 +791,13 @@ msdos_find_name_in_fat_file(
|
|||||||
|
|
||||||
assert(ret == bts2rd);
|
assert(ret == bts2rd);
|
||||||
|
|
||||||
|
/* have to look at the DIR_NAME as "raw" 8-bit data */
|
||||||
for (i = 0; i < bts2rd; i += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
|
for (i = 0; i < bts2rd; i += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
|
||||||
{
|
{
|
||||||
/* is the entry empty ? */
|
/* is the entry empty ? */
|
||||||
if (((*MSDOS_DIR_NAME(fs_info->cl_buf + i)) ==
|
if (((*(uint8_t *)MSDOS_DIR_NAME(fs_info->cl_buf + i)) ==
|
||||||
MSDOS_THIS_DIR_ENTRY_AND_REST_EMPTY) ||
|
MSDOS_THIS_DIR_ENTRY_AND_REST_EMPTY) ||
|
||||||
((*MSDOS_DIR_NAME(fs_info->cl_buf + i)) ==
|
((*(uint8_t *)MSDOS_DIR_NAME(fs_info->cl_buf + i)) ==
|
||||||
MSDOS_THIS_DIR_ENTRY_EMPTY))
|
MSDOS_THIS_DIR_ENTRY_EMPTY))
|
||||||
{
|
{
|
||||||
/* whether we are looking for an empty entry */
|
/* whether we are looking for an empty entry */
|
||||||
@@ -813,7 +815,7 @@ msdos_find_name_in_fat_file(
|
|||||||
/* write new node entry */
|
/* write new node entry */
|
||||||
ret = fat_file_write(mt_entry, fat_fd, j * bts2rd + i,
|
ret = fat_file_write(mt_entry, fat_fd, j * bts2rd + i,
|
||||||
MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE,
|
MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE,
|
||||||
name_dir_entry);
|
(uint8_t *)name_dir_entry);
|
||||||
if (ret != MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
|
if (ret != MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
@@ -914,8 +916,9 @@ msdos_find_node_by_cluster_num_in_fat_file(
|
|||||||
MSDOS_THIS_DIR_ENTRY_AND_REST_EMPTY)
|
MSDOS_THIS_DIR_ENTRY_AND_REST_EMPTY)
|
||||||
return MSDOS_NAME_NOT_FOUND_ERR;
|
return MSDOS_NAME_NOT_FOUND_ERR;
|
||||||
|
|
||||||
|
/* have to look at the DIR_NAME as "raw" 8-bit data */
|
||||||
/* if this entry is empty - skip it */
|
/* if this entry is empty - skip it */
|
||||||
if ((*MSDOS_DIR_NAME(fs_info->cl_buf + i)) ==
|
if ((*(uint8_t *)MSDOS_DIR_NAME(fs_info->cl_buf + i)) ==
|
||||||
MSDOS_THIS_DIR_ENTRY_EMPTY)
|
MSDOS_THIS_DIR_ENTRY_EMPTY)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user