Removed open arrays instances because C++ incompatibility.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@13151 27425a3e-05d8-49a3-a47f-9c15f0e5edd8
This commit is contained in:
parent
a74d761ffe
commit
1d31853ee7
|
@ -215,13 +215,6 @@ typedef struct ch_dyn_object {
|
||||||
* @brief List element of the dynamic buffer object.
|
* @brief List element of the dynamic buffer object.
|
||||||
*/
|
*/
|
||||||
dyn_element_t element;
|
dyn_element_t element;
|
||||||
/*lint -save -e9038 [18.7] Required by design.*/
|
|
||||||
/**
|
|
||||||
* @brief The buffer.
|
|
||||||
* @note This requires C99.
|
|
||||||
*/
|
|
||||||
uint8_t buffer[];
|
|
||||||
/*lint restore*/
|
|
||||||
} dyn_buffer_t;
|
} dyn_buffer_t;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -254,13 +247,6 @@ typedef struct ch_dyn_mailbox {
|
||||||
* @brief The mailbox.
|
* @brief The mailbox.
|
||||||
*/
|
*/
|
||||||
mailbox_t mbx;
|
mailbox_t mbx;
|
||||||
/*lint -save -e9038 [18.7] Required by design.*/
|
|
||||||
/**
|
|
||||||
* @brief Messages buffer.
|
|
||||||
* @note This requires C99.
|
|
||||||
*/
|
|
||||||
msg_t msgbuf[];
|
|
||||||
/*lint restore*/
|
|
||||||
} dyn_mailbox_t;
|
} dyn_mailbox_t;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -277,15 +263,6 @@ typedef struct ch_dyn_objects_fifo {
|
||||||
* @brief The objects FIFO.
|
* @brief The objects FIFO.
|
||||||
*/
|
*/
|
||||||
objects_fifo_t fifo;
|
objects_fifo_t fifo;
|
||||||
/*lint -save -e9038 [18.7] Required by design.*/
|
|
||||||
/**
|
|
||||||
* @brief Messages buffer.
|
|
||||||
* @note This open array is followed by another area containing the
|
|
||||||
* objects, this area is not represented in this structure.
|
|
||||||
* @note This requires C99.
|
|
||||||
*/
|
|
||||||
msg_t msgbuf[];
|
|
||||||
/*lint restore*/
|
|
||||||
} dyn_objects_fifo_t;
|
} dyn_objects_fifo_t;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -302,13 +279,6 @@ typedef struct ch_dyn_pipe {
|
||||||
* @brief The pipe.
|
* @brief The pipe.
|
||||||
*/
|
*/
|
||||||
pipe_t pipe;
|
pipe_t pipe;
|
||||||
/*lint -save -e9038 [18.7] Required by design.*/
|
|
||||||
/**
|
|
||||||
* @brief Messages buffer.
|
|
||||||
* @note This requires C99.
|
|
||||||
*/
|
|
||||||
uint8_t buffer[];
|
|
||||||
/*lint restore*/
|
|
||||||
} dyn_pipe_t;
|
} dyn_pipe_t;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -482,7 +452,7 @@ static inline size_t chFactoryGetBufferSize(dyn_buffer_t *dbp) {
|
||||||
*/
|
*/
|
||||||
static inline uint8_t *chFactoryGetBuffer(dyn_buffer_t *dbp) {
|
static inline uint8_t *chFactoryGetBuffer(dyn_buffer_t *dbp) {
|
||||||
|
|
||||||
return dbp->buffer;
|
return (uint8_t *)(dbp + 1);
|
||||||
}
|
}
|
||||||
#endif /* CH_CFG_FACTORY_GENERIC_BUFFERS == TRUE */
|
#endif /* CH_CFG_FACTORY_GENERIC_BUFFERS == TRUE */
|
||||||
|
|
||||||
|
|
|
@ -418,7 +418,7 @@ dyn_buffer_t *chFactoryCreateBuffer(const char *name, size_t size) {
|
||||||
size);
|
size);
|
||||||
if (dbp != NULL) {
|
if (dbp != NULL) {
|
||||||
/* Initializing buffer object data.*/
|
/* Initializing buffer object data.*/
|
||||||
memset((void *)dbp->buffer, 0, size);
|
memset((void *)(dbp + 1), 0, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
F_UNLOCK();
|
F_UNLOCK();
|
||||||
|
@ -579,7 +579,7 @@ dyn_mailbox_t *chFactoryCreateMailbox(const char *name, size_t n) {
|
||||||
(n * sizeof (msg_t)));
|
(n * sizeof (msg_t)));
|
||||||
if (dmp != NULL) {
|
if (dmp != NULL) {
|
||||||
/* Initializing mailbox object data.*/
|
/* Initializing mailbox object data.*/
|
||||||
chMBObjectInit(&dmp->mbx, dmp->msgbuf, n);
|
chMBObjectInit(&dmp->mbx, (msg_t *)(dmp + 1), n);
|
||||||
}
|
}
|
||||||
|
|
||||||
F_UNLOCK();
|
F_UNLOCK();
|
||||||
|
@ -666,9 +666,11 @@ dyn_objects_fifo_t *chFactoryCreateObjectsFIFO(const char *name,
|
||||||
(objn * sizeof (msg_t)) +
|
(objn * sizeof (msg_t)) +
|
||||||
(objn * objsize));
|
(objn * objsize));
|
||||||
if (dofp != NULL) {
|
if (dofp != NULL) {
|
||||||
|
msg_t *msgbuf = (msg_t *)(dofp + 1);
|
||||||
|
|
||||||
/* Initializing mailbox object data.*/
|
/* Initializing mailbox object data.*/
|
||||||
chFifoObjectInitAligned(&dofp->fifo, objsize, objn, objalign,
|
chFifoObjectInitAligned(&dofp->fifo, objsize, objn, objalign,
|
||||||
(void *)&dofp->msgbuf[objn], dofp->msgbuf);
|
(void *)&msgbuf[objn], msgbuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
F_UNLOCK();
|
F_UNLOCK();
|
||||||
|
@ -750,7 +752,7 @@ dyn_pipe_t *chFactoryCreatePipe(const char *name, size_t size) {
|
||||||
sizeof (dyn_pipe_t) + size);
|
sizeof (dyn_pipe_t) + size);
|
||||||
if (dpp != NULL) {
|
if (dpp != NULL) {
|
||||||
/* Initializing mailbox object data.*/
|
/* Initializing mailbox object data.*/
|
||||||
chPipeObjectInit(&dpp->pipe, dpp->buffer, size);
|
chPipeObjectInit(&dpp->pipe, (uint8_t *)(dpp + 1), size);
|
||||||
}
|
}
|
||||||
|
|
||||||
F_UNLOCK();
|
F_UNLOCK();
|
||||||
|
|
Loading…
Reference in New Issue