X-Git-Url: https://oss.titaniummirror.com/gitweb?a=blobdiff_plain;f=src%2Fstdlib%2F_init_section__.c;fp=src%2Fstdlib%2F_init_section__.c;h=6493cc356c62867ef4c3a946a1111184ddd0d258;hb=6f720ff00773571c2fa2d35e67bff68547617639;hp=b72981128f33120c46ebeac0100f9cb667ab7178;hpb=807b2dd5b7365eb87b482197af3b4a3f520c14f7;p=msp430-libc.git diff --git a/src/stdlib/_init_section__.c b/src/stdlib/_init_section__.c index b729811..6493cc3 100644 --- a/src/stdlib/_init_section__.c +++ b/src/stdlib/_init_section__.c @@ -34,29 +34,29 @@ int _init_section__(int section) { uint16_t start, stop, size, stack, ret = 0; - void *from, *where; + char *from, *where; if(section == MSP430_SECTION_BSS) { - (uint16_t *)start = &__bss_start; - (uint16_t *)stop = &__bss_end; + start = (uint16_t)&__bss_start; + stop = (uint16_t)&__bss_end; bzero(&__bss_start,stop-start); return ret; } else if(section == MSP430_SECTION_DATA) { - (uint16_t *)start = &__data_start_rom; - (uint16_t *)stop = &_edata; - from = (void *)&_etext; - where = (void *)&__data_start; + start = (uint16_t)&__data_start_rom; + stop = (uint16_t)&_edata; + from = (char *)&_etext; + where = (char *)&__data_start; size = ret = stop - start; } else if(section == MSP430_SECTION_NOINIT) { - (uint16_t *)start = &__noinit_start_rom; - (uint16_t *)stop = &__noinit_end_rom; - from = (void *)&__noinit_start_rom; - where = (void *)&__bss_end; + start = (uint16_t)&__noinit_start_rom; + stop = (uint16_t)&__noinit_end_rom; + from = (char *)&__noinit_start_rom; + where = (char *)&__bss_end; size = ret = stop - start; } else @@ -69,7 +69,7 @@ int _init_section__(int section) while(size--) { - *((char *)where)++ = *((char *)from)++; + *(where)++ = *(from)++; } return ret;