mirror of
https://github.com/apache/nuttx.git
synced 2026-06-02 01:21:26 +08:00
Fixes for correct compilation with ZDS-II
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1556 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* examples/nsh/nsh_ddcmd.c
|
* examples/nsh/nsh_ddcmd.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2008, 2009 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -224,7 +224,8 @@ static int dd_writeblk(struct dd_s *dd)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
nsh_output(dd->vtbl, g_fmtcmdfailed, g_dd, "bshlib_write", NSH_ERRNO_OF(-nbytes));
|
FAR struct nsh_vtbl_s *vtbl = dd->vtbl;
|
||||||
|
nsh_output(vtbl, g_fmtcmdfailed, g_dd, "bshlib_write", NSH_ERRNO_OF(-nbytes));
|
||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -251,7 +252,8 @@ static int dd_writech(struct dd_s *dd)
|
|||||||
nbytes = write(DD_OUTFD, buffer, dd->sectsize - written);
|
nbytes = write(DD_OUTFD, buffer, dd->sectsize - written);
|
||||||
if (nbytes < 0)
|
if (nbytes < 0)
|
||||||
{
|
{
|
||||||
nsh_output(dd->vtbl, g_fmtcmdfailed, g_dd, "write", NSH_ERRNO_OF(-nbytes));
|
FAR struct nsh_vtbl_s *vtbl = dd->vtbl;
|
||||||
|
nsh_output(vtbl, g_fmtcmdfailed, g_dd, "write", NSH_ERRNO_OF(-nbytes));
|
||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -276,7 +278,8 @@ static int dd_readblk(struct dd_s *dd)
|
|||||||
nbytes = bchlib_read(DD_INHANDLE, (char*)dd->buffer, offset, dd->sectsize);
|
nbytes = bchlib_read(DD_INHANDLE, (char*)dd->buffer, offset, dd->sectsize);
|
||||||
if (nbytes < 0)
|
if (nbytes < 0)
|
||||||
{
|
{
|
||||||
nsh_output(dd->vtbl, g_fmtcmdfailed, g_dd, "bshlib_read", NSH_ERRNO_OF(-nbytes));
|
FAR struct nsh_vtbl_s *vtbl = dd->vtbl;
|
||||||
|
nsh_output(vtbl, g_fmtcmdfailed, g_dd, "bshlib_read", NSH_ERRNO_OF(-nbytes));
|
||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -303,7 +306,8 @@ static int dd_readch(struct dd_s *dd)
|
|||||||
nbytes = read(DD_INFD, buffer, dd->sectsize - dd->nbytes);
|
nbytes = read(DD_INFD, buffer, dd->sectsize - dd->nbytes);
|
||||||
if (nbytes < 0)
|
if (nbytes < 0)
|
||||||
{
|
{
|
||||||
nsh_output(dd->vtbl, g_fmtcmdfailed, g_dd, "read", NSH_ERRNO_OF(-nbytes));
|
FAR struct nsh_vtbl_s *vtbl = dd->vtbl;
|
||||||
|
nsh_output(vtbl, g_fmtcmdfailed, g_dd, "read", NSH_ERRNO_OF(-nbytes));
|
||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -345,6 +349,7 @@ static int dd_filetype(const char *filename)
|
|||||||
#ifndef CONFIG_DISABLE_MOUNTPOINT
|
#ifndef CONFIG_DISABLE_MOUNTPOINT
|
||||||
static inline int dd_infopen(const char *name, struct dd_s *dd)
|
static inline int dd_infopen(const char *name, struct dd_s *dd)
|
||||||
{
|
{
|
||||||
|
FAR struct nsh_vtbl_s *vtbl = dd->vtbl;
|
||||||
int ret;
|
int ret;
|
||||||
int type;
|
int type;
|
||||||
|
|
||||||
@@ -353,7 +358,7 @@ static inline int dd_infopen(const char *name, struct dd_s *dd)
|
|||||||
type = dd_filetype(name);
|
type = dd_filetype(name);
|
||||||
if (type < 0)
|
if (type < 0)
|
||||||
{
|
{
|
||||||
nsh_output(dd->vtbl, g_fmtcmdfailed, g_dd, "stat", NSH_ERRNO_OF(-type));
|
nsh_output(vtbl, g_fmtcmdfailed, g_dd, "stat", NSH_ERRNO_OF(-type));
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -364,7 +369,7 @@ static inline int dd_infopen(const char *name, struct dd_s *dd)
|
|||||||
DD_INFD = open(name, O_RDONLY);
|
DD_INFD = open(name, O_RDONLY);
|
||||||
if (DD_INFD < 0)
|
if (DD_INFD < 0)
|
||||||
{
|
{
|
||||||
nsh_output(dd->vtbl, g_fmtcmdfailed, g_dd, "open", NSH_ERRNO);
|
nsh_output(vtbl, g_fmtcmdfailed, g_dd, "open", NSH_ERRNO);
|
||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -390,7 +395,8 @@ static inline int dd_infopen(const char *name, struct dd_s *dd)
|
|||||||
DD_INFD = open(name, O_RDONLY);
|
DD_INFD = open(name, O_RDONLY);
|
||||||
if (DD_INFD < 0)
|
if (DD_INFD < 0)
|
||||||
{
|
{
|
||||||
nsh_output(dd->vtbl, g_fmtcmdfailed, g_dd, "open", NSH_ERRNO);
|
FAR struct nsh_vtbl_s *vtbl = dd->vtbl;
|
||||||
|
nsh_output(vtbl, g_fmtcmdfailed, g_dd, "open", NSH_ERRNO);
|
||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
return OK;
|
return OK;
|
||||||
@@ -432,7 +438,8 @@ static inline int dd_outfopen(const char *name, struct dd_s *dd)
|
|||||||
DD_OUTFD = open(name, O_WRONLY|O_CREAT|O_TRUNC, 0644);
|
DD_OUTFD = open(name, O_WRONLY|O_CREAT|O_TRUNC, 0644);
|
||||||
if (DD_OUTFD < 0)
|
if (DD_OUTFD < 0)
|
||||||
{
|
{
|
||||||
nsh_output(dd->vtbl, g_fmtcmdfailed, g_dd, "open", NSH_ERRNO);
|
FAR struct nsh_vtbl_s *vtbl = dd->vtbl;
|
||||||
|
nsh_output(vtbl, g_fmtcmdfailed, g_dd, "open", NSH_ERRNO);
|
||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -447,6 +454,7 @@ static inline int dd_outfopen(const char *name, struct dd_s *dd)
|
|||||||
DD_OUTFD = open(name, O_WRONLY|O_CREAT|O_TRUNC, 0644);
|
DD_OUTFD = open(name, O_WRONLY|O_CREAT|O_TRUNC, 0644);
|
||||||
if (DD_OUTFD < 0)
|
if (DD_OUTFD < 0)
|
||||||
{
|
{
|
||||||
|
FAR struct nsh_vtbl_s *vtbl = dd->vtbl;
|
||||||
nsh_output(dd->vtbl, g_fmtcmdfailed, g_dd, "open", NSH_ERRNO);
|
nsh_output(dd->vtbl, g_fmtcmdfailed, g_dd, "open", NSH_ERRNO);
|
||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* examples/nsh/nsh_netcmds.c
|
* examples/nsh/nsh_netcmds.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2007, 2008, 2009 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
|||||||
+7
-3
@@ -218,7 +218,7 @@ static int fat_open(FAR struct file *filep, const char *relpath,
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_FILE_MODE
|
#ifdef CONFIG_FILE_MODE
|
||||||
# warning "Missing check for privileges based on inode->i_mode"
|
# warning "Missing check for privileges based on inode->i_mode"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Check if the caller has sufficient privileges to open the file */
|
/* Check if the caller has sufficient privileges to open the file */
|
||||||
@@ -1672,7 +1672,9 @@ static int fat_unlink(struct inode *mountpt, const char *relpath)
|
|||||||
* open reference to the file is closed.
|
* open reference to the file is closed.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#warning "Need to defer deleting cluster chain if the file is open"
|
#ifdef CONFIG_CPP_HAVE_WARNING
|
||||||
|
# warning "Need to defer deleting cluster chain if the file is open"
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Remove the file */
|
/* Remove the file */
|
||||||
|
|
||||||
@@ -1925,7 +1927,9 @@ int fat_rmdir(struct inode *mountpt, const char *relpath)
|
|||||||
* open reference to the directory is closed.
|
* open reference to the directory is closed.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#warning "Need to defer deleting cluster chain if the directory is open"
|
#ifdef CONFIG_CPP_HAVE_WARNING
|
||||||
|
# warning "Need to defer deleting cluster chain if the directory is open"
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Remove the directory */
|
/* Remove the directory */
|
||||||
|
|
||||||
|
|||||||
+18
-18
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* fs/fat/fs_fat32.h
|
* fs/fat/fs_fat32.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2007, 200, 2009 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -319,10 +319,10 @@
|
|||||||
#define MBR_PUTVOLID16(p,v) fat_putuint32(UBYTE_PTR(p,BS16_VOLID),v)
|
#define MBR_PUTVOLID16(p,v) fat_putuint32(UBYTE_PTR(p,BS16_VOLID),v)
|
||||||
#define MBR_PUTVOLID32(p,v) fat_putuint32(UBYTE_PTR(p,BS32_VOLID),v)
|
#define MBR_PUTVOLID32(p,v) fat_putuint32(UBYTE_PTR(p,BS32_VOLID),v)
|
||||||
|
|
||||||
#define PART1_PUTSTARTSECTOR(p,v) fat_putuint32(UBYTE_PTR(p,PART_ENTRY1+PART_STARTSECTOR,v))
|
#define PART1_PUTSTARTSECTOR(p,v) fat_putuint32(UBYTE_PTR(p,PART_ENTRY1+PART_STARTSECTOR),v)
|
||||||
#define PART1_PUTSIZE(p,v) fat_putuint32(UBYTE_PTR(p,PART_ENTRY1+PART_SIZE,v))
|
#define PART1_PUTSIZE(p,v) fat_putuint32(UBYTE_PTR(p,PART_ENTRY1+PART_SIZE),v)
|
||||||
#define PART2_PUTSTARTSECTOR(p,v) fat_putuint32(UBYTE_PTR(p,PART_ENTRY2+PART_STARTSECTOR,v))
|
#define PART2_PUTSTARTSECTOR(p,v) fat_putuint32(UBYTE_PTR(p,PART_ENTRY2+PART_STARTSECTOR),v)
|
||||||
#define PART2_PUTSIZE(p,v) fat_putuint32(UBYTE_PTR(p,PART_ENTRY2+PART_SIZE,v))
|
#define PART2_PUTSIZE(p,v) fat_putuint32(UBYTE_PTR(p,PART_ENTRY2+PART_SIZE),v)
|
||||||
|
|
||||||
/* But for multi-byte values, the endian-ness of the target vs. the little
|
/* But for multi-byte values, the endian-ness of the target vs. the little
|
||||||
* endian order of the byte stream or alignment of the data within the byte
|
* endian order of the byte stream or alignment of the data within the byte
|
||||||
@@ -373,19 +373,19 @@
|
|||||||
# define FAT_GETFAT16(p,i) fat_getuint16(UBYTE_PTR(p,i))
|
# define FAT_GETFAT16(p,i) fat_getuint16(UBYTE_PTR(p,i))
|
||||||
# define FAT_GETFAT32(p,i) fat_getuint32(UBYTE_PTR(p,i))
|
# define FAT_GETFAT32(p,i) fat_getuint32(UBYTE_PTR(p,i))
|
||||||
|
|
||||||
# define MBR_PUTRESVDSECCOUNT(p,v) fat_putuint16(UBYTE_PTR(p,BS_RESVDSECCOUNT,v))
|
# define MBR_PUTRESVDSECCOUNT(p,v) fat_putuint16(UBYTE_PTR(p,BS_RESVDSECCOUNT),v)
|
||||||
# define MBR_PUTFATSZ16(p,v) fat_putuint16(UBYTE_PTR(p,BS_FATSZ16,v))
|
# define MBR_PUTFATSZ16(p,v) fat_putuint16(UBYTE_PTR(p,BS_FATSZ16),v)
|
||||||
# define MBR_PUTSECPERTRK(p,v) fat_putuint16(UBYTE_PTR(p,BS_SECPERTRK,v))
|
# define MBR_PUTSECPERTRK(p,v) fat_putuint16(UBYTE_PTR(p,BS_SECPERTRK),v)
|
||||||
# define MBR_PUTNUMHEADS(p,v) fat_putuint16(UBYTE_PTR(p,BS_NUMHEADS,v))
|
# define MBR_PUTNUMHEADS(p,v) fat_putuint16(UBYTE_PTR(p,BS_NUMHEADS),v)
|
||||||
# define MBR_PUTHIDSEC(p,v) fat_putuint32(UBYTE_PTR(p,BS_HIDSEC,v))
|
# define MBR_PUTHIDSEC(p,v) fat_putuint32(UBYTE_PTR(p,BS_HIDSEC),v)
|
||||||
# define MBR_PUTTOTSEC32(p,v) fat_putuint32(UBYTE_PTR(p,BS_TOTSEC32,v))
|
# define MBR_PUTTOTSEC32(p,v) fat_putuint32(UBYTE_PTR(p,BS_TOTSEC32),v)
|
||||||
# define MBR_PUTFATSZ32(p,v) fat_putuint32(UBYTE_PTR(p,BS32_FATSZ32,v))
|
# define MBR_PUTFATSZ32(p,v) fat_putuint32(UBYTE_PTR(p,BS32_FATSZ32),v)
|
||||||
# define MBR_PUTEXTFLAGS(p,v) fat_putuint16(UBYTE_PTR(p,BS32_EXTFLAGS,v))
|
# define MBR_PUTEXTFLAGS(p,v) fat_putuint16(UBYTE_PTR(p,BS32_EXTFLAGS),v)
|
||||||
# define MBR_PUTFSVER(p,v) fat_putuint16(UBYTE_PTR(p,BS32_FSVER,v))
|
# define MBR_PUTFSVER(p,v) fat_putuint16(UBYTE_PTR(p,BS32_FSVER),v)
|
||||||
# define MBR_PUTROOTCLUS(p,v) fat_putuint32(UBYTE_PTR(p,BS32_ROOTCLUS,v))
|
# define MBR_PUTROOTCLUS(p,v) fat_putuint32(UBYTE_PTR(p,BS32_ROOTCLUS),v)
|
||||||
# define MBR_PUTFSINFO(p,v) fat_putuint16(UBYTE_PTR(p,BS32_FSINFO,v))
|
# define MBR_PUTFSINFO(p,v) fat_putuint16(UBYTE_PTR(p,BS32_FSINFO),v)
|
||||||
# define MBR_PUTBKBOOTSEC(p,v) fat_putuint16(UBYTE_PTR(p,BS32_BKBOOTSEC,v))
|
# define MBR_PUTBKBOOTSEC(p,v) fat_putuint16(UBYTE_PTR(p,BS32_BKBOOTSEC),v)
|
||||||
# define MBR_PUTSIGNATURE(p,v) fat_getuint16(UBYTE_PTR(p,BS_SIGNATURE),v)
|
# define MBR_PUTSIGNATURE(p,v) fat_putuint16(UBYTE_PTR(p,BS_SIGNATURE),v)
|
||||||
|
|
||||||
# define FSI_PUTLEADSIG(p,v) fat_putuint32(UBYTE_PTR(p,FSI_LEADSIG),v)
|
# define FSI_PUTLEADSIG(p,v) fat_putuint32(UBYTE_PTR(p,FSI_LEADSIG),v)
|
||||||
# define FSI_PUTSTRUCTSIG(p,v) fat_putuint32(UBYTE_PTR(p,FSI_STRUCTSIG),v)
|
# define FSI_PUTSTRUCTSIG(p,v) fat_putuint32(UBYTE_PTR(p,FSI_STRUCTSIG),v)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* fs_fat32util.c
|
* fs_fat32util.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2007, 2008, 2009 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
*
|
*
|
||||||
* References:
|
* References:
|
||||||
@@ -549,7 +549,9 @@ void fat_semgive(struct fat_mountpt_s *fs)
|
|||||||
|
|
||||||
uint32 fat_systime2fattime(void)
|
uint32 fat_systime2fattime(void)
|
||||||
{
|
{
|
||||||
#warning "Time not implemented"
|
#ifdef CONFIG_CPP_HAVE_WARNING
|
||||||
|
# warning "Time not implemented"
|
||||||
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -571,7 +573,9 @@ uint32 fat_systime2fattime(void)
|
|||||||
|
|
||||||
time_t fat_fattime2systime(uint16 fattime, uint16 fatdate)
|
time_t fat_fattime2systime(uint16 fattime, uint16 fatdate)
|
||||||
{
|
{
|
||||||
#warning "Time not implemented"
|
#ifdef CONFIG_CPP_HAVE_WARNING
|
||||||
|
# warning "Time not implemented"
|
||||||
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* fs/fat/fs_writefat.c
|
* fs/fat/fs_writefat.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2008, 2009 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
|||||||
+4
-2
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* fs_open.c
|
* fs_open.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2007, 2008, 2009 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -90,7 +90,9 @@ int open(const char *path, int oflags, ...)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_FILE_MODE
|
#ifdef CONFIG_FILE_MODE
|
||||||
# warning "File creation not implemented"
|
# ifdef CONFIG_CPP_HAVE_WARNING
|
||||||
|
# warning "File creation not implemented"
|
||||||
|
# endif
|
||||||
|
|
||||||
/* If the file is opened for creation, then get the mode bits */
|
/* If the file is opened for creation, then get the mode bits */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user