Fixed #1139.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@13965 27425a3e-05d8-49a3-a47f-9c15f0e5edd8
This commit is contained in:
parent
c7c89b1682
commit
ce263870a7
|
@ -83,6 +83,17 @@ objects_factory_t ch_factory;
|
||||||
/* Module local functions. */
|
/* Module local functions. */
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
|
|
||||||
|
static void copy_name(const char *sp, char *dp) {
|
||||||
|
unsigned i;
|
||||||
|
|
||||||
|
i = 0U;
|
||||||
|
while ((*sp != (char)0) && (i < CH_CFG_FACTORY_MAX_NAMES_LENGTH)) {
|
||||||
|
*dp = *sp;
|
||||||
|
sp++;
|
||||||
|
dp++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static inline void dyn_list_init(dyn_list_t *dlp) {
|
static inline void dyn_list_init(dyn_list_t *dlp) {
|
||||||
|
|
||||||
dlp->next = (dyn_element_t *)dlp;
|
dlp->next = (dyn_element_t *)dlp;
|
||||||
|
@ -135,16 +146,13 @@ static dyn_element_t *dyn_create_object_heap(const char *name,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Allocating space for the new buffer object.*/
|
/* Allocating space for the new buffer object.*/
|
||||||
/*lint -save -e668 [] Lint is confused by the above chDbgCheck() and
|
|
||||||
incorrectly assumes that strncpy() could receive a NULL pointer.*/
|
|
||||||
dep = (dyn_element_t *)chHeapAlloc(NULL, size);
|
dep = (dyn_element_t *)chHeapAlloc(NULL, size);
|
||||||
if (dep == NULL) {
|
if (dep == NULL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Initializing object list element.*/
|
/* Initializing object list element.*/
|
||||||
strncpy(dep->name, name, CH_CFG_FACTORY_MAX_NAMES_LENGTH);
|
copy_name(name, dep->name);
|
||||||
/*lint -restore*/
|
|
||||||
dep->refs = (ucnt_t)1;
|
dep->refs = (ucnt_t)1;
|
||||||
dep->next = dlp->next;
|
dep->next = dlp->next;
|
||||||
|
|
||||||
|
@ -189,10 +197,7 @@ static dyn_element_t *dyn_create_object_pool(const char *name,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Initializing object list element.*/
|
/* Initializing object list element.*/
|
||||||
/*lint -save -e668 [] Lint is confused by the above chDbgCheck() and
|
copy_name(name, dep->name);
|
||||||
incorrectly assumes that strncpy() could receive a NULL pointer.*/
|
|
||||||
strncpy(dep->name, name, CH_CFG_FACTORY_MAX_NAMES_LENGTH);
|
|
||||||
/*lint -restore*/
|
|
||||||
dep->refs = (ucnt_t)1;
|
dep->refs = (ucnt_t)1;
|
||||||
dep->next = dlp->next;
|
dep->next = dlp->next;
|
||||||
|
|
||||||
|
|
|
@ -126,6 +126,8 @@
|
||||||
MEMS Accelerometers.
|
MEMS Accelerometers.
|
||||||
- NEW: Safer messages mechanism for sandboxes (to be backported to 20.3.1).
|
- NEW: Safer messages mechanism for sandboxes (to be backported to 20.3.1).
|
||||||
- NEW: Added latency measurement test application.
|
- NEW: Added latency measurement test application.
|
||||||
|
- FIX: Fixed GCC 10 causes warning in factory module (bug #1139)
|
||||||
|
(backported to 20.3.3)(backported to 19.1.5).
|
||||||
- FIX: Fixed STM32H7xx Missing CRC RCC macros (bug #1137)
|
- FIX: Fixed STM32H7xx Missing CRC RCC macros (bug #1137)
|
||||||
(backported to 20.3.3).
|
(backported to 20.3.3).
|
||||||
- FIX: Fixed STM32L0x wrong ISR names for USART 4 and 5 (bug #1136)
|
- FIX: Fixed STM32L0x wrong ISR names for USART 4 and 5 (bug #1136)
|
||||||
|
|
Loading…
Reference in New Issue