реклама на сайте
подробности

 
 
> Поясните конструкции С из segment_init
Dopler
сообщение Feb 3 2007, 10:28
Сообщение #1


Местный
***

Группа: Свой
Сообщений: 437
Регистрация: 23-04-05
Из: Таганрог
Пользователь №: 4 425



Господа, поясните, пожалуйста, что означает данная конструкция:

Код
typedef struct
{
  long   Size;                  /* Number of bytes to initialize */
  char*  Dst;                   /* Destination. If Dst==Src, then init to 0 */
  char*  Src;                   /* Source address. Usually in ROM. */
} InitBlock_Type;

...

_interwork void __segment_init(void)
{
  InitBlock_Type const * const initTableBegin = __sfb( "INITTAB" );
  InitBlock_Type const * const initTableEnd = __sfe( "INITTAB" );
  InitBlock_Type const * initTableP;

  /* Loop over all elements in the initialization table. */
  for (initTableP=initTableBegin; initTableP<initTableEnd; initTableP++)
  {
    /* If src=dest then we should clear a memory
     * block, otherwise it's a copy operation. */
    if (initTableP->Src == initTableP->Dst)
    {
      memset(initTableP->Dst, 0, initTableP->Size);
    }
    else
    {
      memcpy(initTableP->Dst, initTableP->Src, initTableP->Size);
    }
  }
}


InitBlock_Type const * const особо интересует, хотя все остальное мне тоже мало понятно.

Код взят из segment_init IAR и идет с директивой #pragma language=extended, что это значит?
Go to the top of the page
 
+Quote Post



Reply to this topicStart new topic
1 чел. читают эту тему (гостей: 1, скрытых пользователей: 0)
Пользователей: 0

 


RSS Текстовая версия Сейчас: 29th July 2025 - 18:21
Рейтинг@Mail.ru


Страница сгенерированна за 0.01346 секунд с 7
ELECTRONIX ©2004-2016