当前位置: 首页>>代码示例>>C++>>正文


C++ ERR_FATAL函数代码示例

本文整理汇总了C++中ERR_FATAL函数的典型用法代码示例。如果您正苦于以下问题:C++ ERR_FATAL函数的具体用法?C++ ERR_FATAL怎么用?C++ ERR_FATAL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了ERR_FATAL函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ERR_FATAL

//
// DTrack::RegisterDestruction
//
// Register the destruction of the item 'info'
//
void DTrack::RegisterDestruction(Info &info)
{
  // Never registered, or has died - perhaps deleting twice?
  if (!info.IsSetup())
  {
    ERR_FATAL(("Invalid destruction : Item is NOT setup! (Tracker %s)", name.str));
  }
  
  // Different id, something bad has happened - perhaps bad memory?
  if (*info.trackPos != info.id)
  {
    ERR_FATAL(("Invalid destruction : Different Id (Tracker %s, %d, %d)", name.str, *info.trackPos, info.id));
  }

  // Set item as empty
  *info.trackPos = DTRACK_EMPTY;

  // Add to cache
  CacheAdd(info.trackPos);

  // Info is no longer setup
  info.Clear();

  ASSERT(stateInfo.items);

  // Decrease number of items
  stateInfo.items--;
}
开发者ID:grasmanek94,项目名称:darkreign2,代码行数:33,代码来源:dtrack.cpp

示例2: GetFreeIndex

  //
  // GetFreeIndex
  //
  // Returns a free instance index
  //
  static U32 GetFreeIndex()
  {
    ASSERT(initialized);

    // Fatal if limit exceeded
    if (instanceCount >= MAX_INSTANCES)
    {
      ERR_FATAL(("Maximum footprint instances exceeded!! (%d)", MAX_INSTANCES));
    }

    // Find next available slot
    for (U32 count = 0, index = nextIndex; count < MAX_INSTANCES; count++)
    {
      ASSERT(ValidInstanceIndex(index));

      // Is this space available
      if (!instances[index])
      {
        nextIndex = index;
        IncrementIndex(nextIndex);
        return (index);
      }

      // Wrap index around
      IncrementIndex(index);
    }

    // This should never happen, but paranoia has set in...
    ERR_FATAL(("Instance scan found no available index! (%d)", instanceCount));
  }
开发者ID:grasmanek94,项目名称:darkreign2,代码行数:35,代码来源:footprint.cpp

示例3: bootstrap_exception_handler

void bootstrap_exception_handler(void)
{
   const unsigned long wlStackSize = 4096;   // minimal (KB)
   static DALSYSEventHandle hEventStart;     // context for the error exception handler
   static DALSYSWorkLoopHandle hWorkLoop;    // context for the error exception handler

   char err_task_name[13];

   if ( sizeof(err_task_name) <= tms_utils_fmt(err_task_name, 12, "err_pd_ex_%d", qurt_getpid()) )
   {
     MSG(MSG_SSID_TMS, MSG_LEGACY_ERROR,"Failed to copy task name in err_task_name ");
   }

   if (DAL_SUCCESS != DALSYS_EventCreate(DALSYS_EVENT_ATTR_WORKLOOP_EVENT, &hEventStart, NULL))
   {
      ERR_FATAL("Exception Handler initialization failure",0,0,0);
   }
   if (DAL_SUCCESS != DALSYS_RegisterWorkLoopEx(err_task_name, wlStackSize, wlPriority, dwMaxNumEvents, &hWorkLoop, NULL))
   {
      ERR_FATAL("Exception Handler initialization failure",0,0,0);
   }
   if (DAL_SUCCESS != DALSYS_AddEventToWorkLoop(hWorkLoop, err_exception_task, NULL, hEventStart, NULL))
   {
      ERR_FATAL("Exception Handler initialization failure",0,0,0);
   }
   if (DAL_SUCCESS != DALSYS_EventCtrl(hEventStart, DALSYS_EVENT_CTRL_TRIGGER))
   {
      ERR_FATAL("Exception Handler initialization failure",0,0,0);
   }

}
开发者ID:robcore,项目名称:flybirdlaboratory_adsp_proc,代码行数:31,代码来源:err_pd_exception_task.c

示例4: CreateFile

//
// FileMap::FileMap
//
// Constructor
//
FileMap::FileMap(const char *name, U32 flags, U32 offset, U32 length)
{
  // Build flags from flags
  U32 f = 0;
  if (flags & READ)
  {
    f |= GENERIC_READ;
  }
  if (flags & WRITE)
  {
    f |= GENERIC_WRITE;
  }

  // Open the file
  fileHandle = CreateFile(name, f, 0, NULL, OPEN_EXISTING, 0, NULL);

  if (fileHandle == NULL)
  {
    ERR_FATAL(("Could not open file '%s' for mapping", name))
  }

  // Get the size of the file (assume that its is less than 4GB)
  size = GetFileSize(fileHandle, NULL);

  // Create the file mapping
  f = 0;
  if (flags & WRITE)
  {
    f = PAGE_READWRITE;
  }
  else
  {
    f = PAGE_READONLY;
  }
  mapHandle = CreateFileMapping(fileHandle, NULL, f, 0, size, NULL);

  // Could the file be mapped
  if (mapHandle == NULL)
  {
    ERR_FATAL(("Could not create file mapping for '%s'", name))
  }

  // Get a pointer to the mapping
  f = 0;
  if (flags & WRITE)
  {
    f = FILE_MAP_WRITE;
  }
  else
  {
    f = FILE_MAP_READ;
  }
  ptr = (U8 *) MapViewOfFile(mapHandle, f, 0, offset, length);

  // Could we get a view of the mapping ?
  if (ptr == NULL)
  {
    ERR_FATAL(("Could not create a view of the mapping '%s'", name))
  }
}
开发者ID:ZhouWeikuan,项目名称:darkreign2,代码行数:65,代码来源:filemap.cpp

示例5: s_TEST_WinSystemDll

static void s_TEST_WinSystemDll(void)
{
#if defined NCBI_OS_MSWIN

    CDll dll_user32("USER32", CDll::eLoadLater);
    CDll dll_userenv("userenv.dll", CDll::eLoadNow, CDll::eAutoUnload);

    // Load DLL
    dll_user32.Load();

    // DLL functions definition    
    BOOL (STDMETHODCALLTYPE FAR * dllMessageBeep) 
            (UINT type) = NULL;
    BOOL (STDMETHODCALLTYPE FAR * dllGetProfilesDirectory) 
            (LPTSTR  lpProfilesDir, LPDWORD lpcchSize) = NULL;

    // This is other variant of functions definition
    //
    // typedef BOOL (STDMETHODCALLTYPE FAR * LPFNMESSAGEBEEP) (
    //     UINT uType
    // );
    // LPFNMESSAGEBEEP  dllMessageBeep = NULL;
    //
    // typedef BOOL (STDMETHODCALLTYPE FAR * LPFNGETPROFILESDIR) (
    //     LPTSTR  lpProfilesDir,
    //     LPDWORD lpcchSize
    // );
    // LPFNGETUSERPROFILESDIR  dllGetProfilesDirectory = NULL;

    dllMessageBeep = dll_user32.GetEntryPoint_Func("MessageBeep", &dllMessageBeep );
    if ( !dllMessageBeep ) {
        ERR_FATAL("Error get address of function MessageBeep().");
    }
    // Call loaded function
    dllMessageBeep(-1);

    #ifdef UNICODE
    dll_userenv.GetEntryPoint_Func("GetProfilesDirectoryW", &dllGetProfilesDirectory);
    #else
    dll_userenv.GetEntryPoint_Func("GetProfilesDirectoryA", &dllGetProfilesDirectory);
    #endif
    if ( !dllGetProfilesDirectory ) {
        ERR_FATAL("Error get address of function GetUserProfileDirectory().");
    }
    // Call loaded function
    TCHAR szProfilePath[1024];
    DWORD cchPath = 1024;
    if ( dllGetProfilesDirectory(szProfilePath, &cchPath) ) {
        cout << "Profile dir: " << szProfilePath << endl;
    } else {
        ERR_FATAL("GetProfilesDirectory() failed");
    }

    // Unload USER32.DLL (our work copy)
    dll_user32.Unload();
    // USERENV.DLL will be unloaded in the destructor
    // dll_userenv.Unload();
#endif
}
开发者ID:svn2github,项目名称:ncbi_tk,代码行数:59,代码来源:test_ncbidll.cpp

示例6: ERR_FATAL

void sdm_menu_init
(
  void
)
{
  uint8 i; 

#ifdef FEATURE_DS_UI_BAUD
  /*-------------------------------------------------------------------------
    SDM DS BAUD rate UI MENU initialization
  -------------------------------------------------------------------------*/
  
  sdm_ds_baud_ui_menu.heading =   " DS BAUD    ";    /* */
  sdm_ds_baud_ui_menu.current_index = SDM_UNKNOWN_INDEX;
  
  /* Copy the menu entries */
  
  for( i=0; i < SDM_MAX_UI_ITEMS; i++) {
    sdm_ds_baud_ui_menu.items[i] = & (sdm_ui_ds_items_struct[i]);
    if ( *(sdm_ui_ds_items_struct[i].item_string) == '\0' ) {
      break; /* no more valid entries */
    }
  }
 
  if( i >= SDM_MAX_UI_ITEMS ) {
    ERR_FATAL( "ds baud menu init failure",0,0,0);
  }

  sdm_ds_baud_ui_menu.num_items = i;
#endif /* FEATURE_DS_UI_BAUD */

#ifdef FEATURE_DIAG_UI_BAUD 
  /*-------------------------------------------------------------------------
    SDM DIAG BAUD rate UI MENU initialization
  -------------------------------------------------------------------------*/

  sdm_diag_baud_ui_menu.heading =   " DIAG BAUD: ";    /* */
  sdm_diag_baud_ui_menu.current_index = SDM_UNKNOWN_INDEX;
  
  /* Copy the menu entries */
  
  for( i=0; i < SDM_MAX_UI_ITEMS; i++) {
    sdm_diag_baud_ui_menu.items[i] = & (sdm_ui_diag_items_struct[i]);
    if ( *(sdm_ui_diag_items_struct[i].item_string) == '\0' ) {
      break; /* no more valid entries */
    }
  }
 
  if( i >= SDM_MAX_UI_ITEMS ) {
    ERR_FATAL( "diag baud menu init failure",0,0,0);
  }

  sdm_diag_baud_ui_menu.num_items = i;
#endif /* FEATURE_DIAG_UI_BAUD */

} /* sdm_menu_init */
开发者ID:bgtwoigu,项目名称:1110,代码行数:56,代码来源:sdevmap.c

示例7: s_TEST_SimpleDll

static void s_TEST_SimpleDll(void)
{
    CDll dll("./","test_dll", CDll::eLoadLater);

    // Load DLL
    dll.Load();

    // DLL variable definition
    int*    DllVar_Counter;
    // DLL functions definition    
    int     (* Dll_Inc) (int) = NULL;
    int     (* Dll_Add) (int, int) = NULL;
    string* (* Dll_StrRepeat) (const string&, unsigned int) = NULL;

    // Get addresses from DLL
    DllVar_Counter = dll.GetEntryPoint_Data("DllVar_Counter", &DllVar_Counter);
    if ( !DllVar_Counter ) {
        ERR_FATAL("Error get address of variable DllVar_Counter.");
    }
    Dll_Inc = dll.GetEntryPoint_Func("Dll_Inc", &Dll_Inc );
    if ( !Dll_Inc ) {
        ERR_FATAL("Error get address of function Dll_Inc().");
    }
    Dll_Add = dll.GetEntryPoint_Func("Dll_Add", &Dll_Add );
    if ( !Dll_Add ) {
        ERR_FATAL("Error get address of function Dll_Add().");
    }
    Dll_StrRepeat = dll.GetEntryPoint_Func("Dll_StrRepeat", &Dll_StrRepeat );
    if ( !Dll_StrRepeat ) {
        ERR_FATAL("Error get address of function Dll_StrRepeat().");
    }

    // Call loaded function

    assert( *DllVar_Counter == 0  );
    assert( Dll_Inc(3)      == 3  );
    assert( *DllVar_Counter == 3  );
    assert( Dll_Inc(100)    == 103);
    assert( *DllVar_Counter == 103);
    *DllVar_Counter = 1;
    assert( Dll_Inc(0)      == 1  );

    assert( Dll_Add(3,4)    == 7  );
    assert( Dll_Add(-2,-1)  == -3 );
    
    string* str = Dll_StrRepeat("ab",2);
    assert( *str == "abab");
    delete str;

    str = Dll_StrRepeat("a",4);  
    assert( *str == "aaaa");
    delete str;

    // Unload used dll
    dll.Unload();
}
开发者ID:svn2github,项目名称:ncbi_tk,代码行数:56,代码来源:test_ncbidll.cpp

示例8: rce_nfy_term_posix

void rce_nfy_term_posix(rce_nfy_p nfy_p)
{
   if (RCE_NULL != nfy_p)
   {
      ERR_FATAL("no implementation", 0, 0, 0);
   }
   else
   {
      ERR_FATAL("null handle use", 0, 0, 0);
   }
}
开发者ID:robcore,项目名称:flybirdlaboratory_adsp_proc,代码行数:11,代码来源:rcevt_posix_void.c

示例9: rce_nfy_init_posix

void rce_nfy_init_posix(rce_nfy_p nfy_p, RCEVT_SIGEX sigex)
{
   if (RCE_NULL != nfy_p)
   {
      ERR_FATAL("no implementation", 0, 0, 0);
   }
   else
   {
      ERR_FATAL("null handle use", 0, 0, 0);
   }
   sigex = sigex;                                                                // unused
}
开发者ID:robcore,项目名称:flybirdlaboratory_adsp_proc,代码行数:12,代码来源:rcevt_posix_void.c

示例10: rce_nfy_eq_posix

RCEVT_BOOL rce_nfy_eq_posix(rce_nfy_p nfy_p, RCEVT_SIGEX sigex)
{
   if (RCE_NULL != nfy_p)
   {
      ERR_FATAL("no implementation", 0, 0, 0);
      return RCEVT_FALSE;
   }
   else
   {
      ERR_FATAL("null handle use", 0, 0, 0);
      return RCEVT_FALSE;
   }
}
开发者ID:robcore,项目名称:flybirdlaboratory_adsp_proc,代码行数:13,代码来源:rcevt_posix_void.c

示例11: rcinit_init

/*===========================================================================

 FUNCTION rcinit_init

 DESCRIPTION
 prepare internal data storage setup

 DEPENDENCIES
 none

 RETURN VALUE
 none

 SIDE EFFECTS
 none

 ===========================================================================*/
void rcinit_init(void)
{
   rcinit_internal.policy_curr = rcinit_lookup_policy(RCINIT_POLICY_NAME_DEFAULT);

   if (RCINIT_POLICY_NONE != rcinit_internal.policy_curr)
   {
      int group;

      rcinit_internal_devcfg_check_load();                                       // load devcfg configs first, potentially allows a runtime override later

      rcevt_init();                                                              // rcevt events service

      rcinit_internal_hs_list_init();

      rcxh_init();

      // internal events

      for (group = 0; group < RCINIT_GROUP_MAX; group++)
      {
         // rcinit_internal.rcevt_handle.init_event[group] = (rce_nde_p)rcevt_create_name(rcinit_init_rcevt[group]);
         rcinit_internal.rcevt_handle.term_event[group] = (rce_nde_p)rcevt_create_name(rcinit_term_rcevt[group]);
      }

      rcinit_internal.define = (rce_nde_p)rcevt_create_name(RCINIT_RCEVT_DEFINE); // handle to define event, internal, ok to observe
      rcinit_internal.defineack = (rce_nde_p)rcevt_create_name(RCINIT_RCEVT_DEFINEACK); // handle to defineack event, internal, ok to observe

      if (RCINIT_NULL == rcinit_internal.define ||                               // must have rcevt allocated
          RCINIT_NULL == rcinit_internal.defineack)                              // must have rcevt allocated
      {
         ERR_FATAL("initialization", 0, 0, 0);
      }

      rcinit_internal.policy_base = rcinit_internal_groups[rcinit_internal.policy_curr];

      rcinit_internal.group_curr = RCINIT_GROUP_0;

      rcinit_internal.group_base = rcinit_internal.policy_base[rcinit_internal.group_curr];

      rcinit_internal_tls_create_key(&rcinit_internal.tls_key, RCINIT_NULL);

      rcinit_dal_loop_worker_create();                                           // internal worker thread

      rcinit_internal_process_groups();                                          // sequence groups
   }

   else
   {
      ERR_FATAL("default policy not available", 0, 0, 0);
   }
}
开发者ID:robcore,项目名称:flybirdlaboratory_adsp_proc,代码行数:68,代码来源:rcinit_init.c

示例12: rce_nfy_wait_posix

rce_nde_p rce_nfy_wait_posix(rce_nde_p nde_p, rce_nfy_p nfy_p)
{
   if (RCE_NULL != nfy_p)
   {
      nde_p = nde_p;
      ERR_FATAL("no implementation", 0, 0, 0);
      return RCE_NULL;
   }
   else
   {
      ERR_FATAL("null handle use", 0, 0, 0);
      return RCE_NULL;
   }
}
开发者ID:robcore,项目名称:flybirdlaboratory_adsp_proc,代码行数:14,代码来源:rcevt_posix_void.c

示例13: cmif_register_cb_func

/*===========================================================================

FUNCTION  CMIF_REGISTER_CB_FUNC

DESCRIPTION
  Registers the callback functions.with other tasks.
  
DEPENDENCIES
  None

RETURN VALUE
  None

SIDE EFFECTS
  None

===========================================================================*/
LOCAL void cmif_register_cb_func ( void )
{
  cm_client_status_e_type cm_status = CM_CLIENT_OK;

  /* Register the CM call event callback function */
  cm_status = cm_mm_client_call_reg (
                                   dsatcm_client_id,
                                   cmif_call_event_cb_func,
                                   CM_CLIENT_EVENT_REG,
                                   CM_CALL_EVENT_INCOM,
                                   CM_CALL_EVENT_CONNECT,  
                                   NULL
                                  );

  cm_status |= cm_mm_client_call_reg(dsatcm_client_id,
                                  cmif_call_event_cb_func,
                                  CM_CLIENT_EVENT_REG,
                                  CM_CALL_EVENT_END,
                                  CM_CALL_EVENT_END,
                                  NULL );

#if defined(FEATURE_WCDMA) || defined(FEATURE_GSM)
#error code not present
#endif
  
  /* This should not happen, raise an error */
  if (cm_status!= CM_CLIENT_OK)
  {
    ERR_FATAL( "ATCOP unable to register CALL events: %d",
               cm_status, 0,0 );
  }

  
#if defined(FEATURE_WCDMA) || defined(FEATURE_GSM)
#error code not present
#endif /* defined(FEATURE_WCDMA) || defined(FEATURE_GSM) */

  /*-----------------------------------------------------------------------
    Activate the registered callback functions.
  -----------------------------------------------------------------------*/
  cm_status = cm_client_act( dsatcm_client_id );
  
  if (cm_status!= CM_CLIENT_OK)
  {
    ERR_FATAL( "ATCOP unable to activate client: %d",
               cm_status, 0,0 );
  }

  return;
}/* cmif_register_cb_func */ 
开发者ID:bgtwoigu,项目名称:1110,代码行数:67,代码来源:dsatcmif.c

示例14: LoadCreateObject

  //
  // LoadCreateObject
  //
  // Load a CreateObject function
  //
  static void LoadCreateObject(FScope *fScope, Bool doSafeLoad)
  {
    ASSERT(fScope);

    // Get type name
    const char *typeName = fScope->NextArgString();

    // Get claimed id
    U32 id = fScope->NextArgInteger();

    // The id can not be zero
    if (!id)
    {
      ERR_FATAL(("Caught zero id in CreateObject"));
    }

    // Get a pointer to the type
    GameObjType *type = GameObjCtrl::FindType<GameObjType>(typeName);

    // Make sure we found it
    if (!type)
    {
      LOG_WARN(("Ignoring unknown type in world file '%s'", typeName));
      return;
    }

    // Do we need to do a safe load
    if (doSafeLoad)
    {
      /*
      // Filter out certain types
      if 
      (
        Promote::Type<WeaponObjType>(type) // ||
      )
      {
        LOG_DIAG(("Safe Load : Filtering %s (%u)", type->typeId.str, id));
        return;
      }
      */

      // Is this a map object
      MapObjType *mapType = Promote::Type<MapObjType>(type);

      // If so, do special safe load
      if (mapType)
      {
        SafeLoadMapObject(mapType, fScope, id);
        return;
      }
    }

    // Create the object using the type
    GameObj *obj = type->NewInstance(id);

    ASSERT(obj);

    // Load full state info
    obj->LoadState(fScope);
  }
开发者ID:ZhouWeikuan,项目名称:darkreign2,代码行数:65,代码来源:worldload.cpp

示例15: ERR_FATAL

//
// VarSys::VarItem::SetFloat
//
// FPOINT type - sets floating point value
//
void VarSys::VarItem::SetFloat(F32 newVal)
{
  if (type != VI_FPOINT)
  {
    ERR_FATAL(("Expected '%s' to be a floating point var (%d)", itemId.str, type))
  }

  // Set the new value
  fpoint.val = newVal;

  if (flags & CLAMP)
  {
    if (fpoint.val < fpoint.lo)
    {
      fpoint.val = fpoint.lo;
    }
    else if (fpoint.val > fpoint.hi)
    {
      fpoint.val = fpoint.hi;
    }
  }

  // Value may have changed, trigger call back
  TriggerCallBack();
}
开发者ID:ZhouWeikuan,项目名称:darkreign2,代码行数:30,代码来源:varitem.cpp


注:本文中的ERR_FATAL函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。