CC_CONST_FUNCTION replaces some const keywords in order to workaround a sdcc bug, which cannot handle function pointers as const.

This commit is contained in:
matsutsuka 2008-07-02 15:02:33 +00:00
parent b8820a7d89
commit d194d54e8e
6 changed files with 26 additions and 25 deletions

View file

@ -28,7 +28,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: shell-netfile.c,v 1.1 2008/02/04 23:42:17 adamdunkels Exp $
* $Id: shell-netfile.c,v 1.2 2008/07/02 15:02:33 matsutsuka Exp $
*/
/**
@ -111,7 +111,7 @@ read_chunk(struct rudolph0_conn *c, int offset, uint8_t *to, int maxsize)
cfs_close(fd);
return ret;
}
const static struct rudolph0_callbacks rudolph0_callbacks =
CC_CONST_FUNCTION static struct rudolph0_callbacks rudolph0_callbacks =
{(void (*)(struct rudolph0_conn *, int, int, uint8_t *, int))write_chunk,
read_chunk};
/*---------------------------------------------------------------------------*/

View file

@ -28,7 +28,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: shell-rime-ping.c,v 1.2 2008/02/24 20:33:38 adamdunkels Exp $
* $Id: shell-rime-ping.c,v 1.3 2008/07/02 15:02:33 matsutsuka Exp $
*/
/**
@ -151,7 +151,7 @@ recv_mesh(struct mesh_conn *c, rimeaddr_t *from, u8_t hops)
process_post(&shell_ping_process, PROCESS_EVENT_CONTINUE, NULL);
}
}
const static struct mesh_callbacks mesh_callbacks = { recv_mesh,
CC_CONST_FUNCTION static struct mesh_callbacks mesh_callbacks = { recv_mesh,
NULL,
timedout_mesh };
/*---------------------------------------------------------------------------*/

View file

@ -28,7 +28,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: chameleon-raw.c,v 1.1 2008/02/25 02:14:34 adamdunkels Exp $
* $Id: chameleon-raw.c,v 1.2 2008/07/02 15:02:33 matsutsuka Exp $
*/
/**
@ -183,4 +183,4 @@ hdrsize(const struct rimebuf_attrlist *a)
return size / 8;
}
/*---------------------------------------------------------------------------*/
const struct chameleon_module chameleon_raw = { input, output, hdrsize, NULL };
CC_CONST_FUNCTION struct chameleon_module chameleon_raw = { input, output, hdrsize, NULL };

View file

@ -28,7 +28,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: chameleon-raw.h,v 1.1 2008/02/25 02:14:34 adamdunkels Exp $
* $Id: chameleon-raw.h,v 1.2 2008/07/02 15:02:33 matsutsuka Exp $
*/
/**
@ -41,6 +41,6 @@
#ifndef __CHAMELEON_RAW_H__
#define __CHAMELEON_RAW_H__
extern const struct chameleon_module chameleon_raw;
extern CC_CONST_FUNCTION struct chameleon_module chameleon_raw;
#endif /* __CHAMELEON_RAW_H__ */

View file

@ -33,7 +33,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: neighbor-discovery.c,v 1.6 2008/06/26 11:19:22 adamdunkels Exp $
* $Id: neighbor-discovery.c,v 1.7 2008/07/02 15:02:33 matsutsuka Exp $
*/
/**
@ -136,7 +136,7 @@ send_timer(void *ptr)
/*---------------------------------------------------------------------------*/
/*static const struct ibc_callbacks ibc_callbacks =
{adv_packet_received};*/
static const struct ipolite_callbacks ipolite_callbacks =
CC_CONST_FUNCTION static struct ipolite_callbacks ipolite_callbacks =
{adv_packet_received};
/*---------------------------------------------------------------------------*/
void

View file

@ -27,7 +27,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: z80def.h,v 1.5 2008/07/02 07:13:22 matsutsuka Exp $
* $Id: z80def.h,v 1.6 2008/07/02 15:02:33 matsutsuka Exp $
*
*/
@ -69,6 +69,7 @@ typedef unsigned int size_t;
/* Compiler configurations */
#define CCIF
#define CLIF
#define CC_CONF_CONST_FUNCTION_BUG
/*
* Enable architecture-depend checksum calculation