Added const to constant arguments

This commit is contained in:
adamdunkels 2008-01-24 13:08:35 +00:00
parent bf8b5c093d
commit af73a358f4
5 changed files with 10 additions and 10 deletions

View file

@ -30,7 +30,7 @@
* *
* Author: Adam Dunkels <adam@sics.se> * Author: Adam Dunkels <adam@sics.se>
* *
* $Id: cfs-eeprom.c,v 1.6 2008/01/09 08:12:52 adamdunkels Exp $ * $Id: cfs-eeprom.c,v 1.7 2008/01/24 13:08:35 adamdunkels Exp $
*/ */
#include "cfs/cfs.h" #include "cfs/cfs.h"
@ -94,7 +94,7 @@ cfs_read(int f, void *buf, unsigned int len)
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
int int
cfs_write(int f, void *buf, unsigned int len) cfs_write(int f, const void *buf, unsigned int len)
{ {
if(f == 1) { if(f == 1) {
eeprom_write(CFS_EEPROM_OFFSET + file.fileptr, buf, len); eeprom_write(CFS_EEPROM_OFFSET + file.fileptr, buf, len);

View file

@ -30,7 +30,7 @@
* *
* Author: Adam Dunkels <adam@sics.se> * Author: Adam Dunkels <adam@sics.se>
* *
* $Id: cfs-posix.c,v 1.9 2008/01/08 14:27:06 adamdunkels Exp $ * $Id: cfs-posix.c,v 1.10 2008/01/24 13:08:35 adamdunkels Exp $
*/ */
#include <stdio.h> #include <stdio.h>
@ -75,7 +75,7 @@ cfs_read(int f, void *b, unsigned int l)
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
int int
cfs_write(int f, void *b, unsigned int l) cfs_write(int f, const void *b, unsigned int l)
{ {
return write(f, b, l); return write(f, b, l);
} }

View file

@ -30,7 +30,7 @@
* *
* Author: Adam Dunkels <adam@sics.se> * Author: Adam Dunkels <adam@sics.se>
* *
* $Id: cfs-ram.c,v 1.6 2008/01/08 14:27:06 adamdunkels Exp $ * $Id: cfs-ram.c,v 1.7 2008/01/24 13:08:35 adamdunkels Exp $
*/ */
#include <string.h> #include <string.h>
@ -106,7 +106,7 @@ cfs_read(int f, void *buf, unsigned int len)
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
int int
cfs_write(int f, void *buf, unsigned int len) cfs_write(int f, const void *buf, unsigned int len)
{ {
printf("write file.fileptr %d len %d filesize %d\n", printf("write file.fileptr %d len %d filesize %d\n",
file.fileptr, len, file.filesize); file.fileptr, len, file.filesize);

View file

@ -30,7 +30,7 @@
* *
* Author: Adam Dunkels <adam@sics.se> * Author: Adam Dunkels <adam@sics.se>
* *
* $Id: cfs-xmem.c,v 1.7 2008/01/08 14:27:06 adamdunkels Exp $ * $Id: cfs-xmem.c,v 1.8 2008/01/24 13:08:35 adamdunkels Exp $
*/ */
#include "cfs/cfs.h" #include "cfs/cfs.h"
@ -110,7 +110,7 @@ cfs_read(int f, void *buf, unsigned int len)
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
int int
cfs_write(int f, void *buf, unsigned int len) cfs_write(int f, const void *buf, unsigned int len)
{ {
if(file.fileptr >= CFS_XMEM_SIZE) { if(file.fileptr >= CFS_XMEM_SIZE) {
return 0; return 0;

View file

@ -54,7 +54,7 @@
* *
* Author: Adam Dunkels <adam@sics.se> * Author: Adam Dunkels <adam@sics.se>
* *
* $Id: cfs.h,v 1.10 2008/01/08 14:27:06 adamdunkels Exp $ * $Id: cfs.h,v 1.11 2008/01/24 13:08:35 adamdunkels Exp $
*/ */
#ifndef __CFS_H__ #ifndef __CFS_H__
#define __CFS_H__ #define __CFS_H__
@ -172,7 +172,7 @@ CCIF int cfs_read(int fd, void *buf, unsigned int len);
* cfs_open() and the CFS_WRITE flag. * cfs_open() and the CFS_WRITE flag.
*/ */
#ifndef cfs_write #ifndef cfs_write
CCIF int cfs_write(int fd, void *buf, unsigned int len); CCIF int cfs_write(int fd, const void *buf, unsigned int len);
#endif #endif
/** /**