这篇教程C++ ARRAYLEN函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中ARRAYLEN函数的典型用法代码示例。如果您正苦于以下问题:C++ ARRAYLEN函数的具体用法?C++ ARRAYLEN怎么用?C++ ARRAYLEN使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了ARRAYLEN函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: plugin_startenum plugin_status plugin_start(const void* parameter){ int action, i; struct jackpot game; (void)parameter; rb->srand(*rb->current_tick);#ifdef HAVE_LCD_CHARCELLS patterns_init(rb->screens[SCREEN_MAIN]);#endif /* HAVE_LCD_CHARCELLS */ jackpot_init(&game); FOR_NB_SCREENS(i){ rb->screens[i]->clear_display(); jackpot_display_slot_machine(&game, rb->screens[i]); } /*Empty the event queue*/ rb->button_clear_queue(); while (true) { action = pluginlib_getaction(TIMEOUT_BLOCK, plugin_contexts, ARRAYLEN(plugin_contexts)); switch ( action ) { case PLA_CANCEL: return PLUGIN_OK; case PLA_SELECT: jackpot_play_turn(&game); break; default: if (rb->default_event_handler_ex(action, jackpot_exit, NULL) == SYS_USB_CONNECTED) return PLUGIN_USB_CONNECTED; break; } } jackpot_exit(NULL); return PLUGIN_OK;}
开发者ID:eisnerd,项目名称:rockbox,代码行数:39,
示例2: TESTTEST(Utf8Utils, utf8IsValid) { static const struct { bool expected; const char* text; size_t textLen; } kData[] = { DATA(true, ""), DATA(true, "Hello World!"), DATA(true, "T/xC3/xA9l/xC3/xA9vision"), DATA(false, "/x80/x80"), DATA(true, "/xC1/xB6"), DATA(false, "/xC0/x7f"), DATA(true, "foo/xE0/x80/x80"), DATA(false, "foo/xE0/x80"), }; const size_t kDataSize = ARRAYLEN(kData); for (size_t n = 0; n < kDataSize; ++n) { EXPECT_EQ(kData[n].expected, utf8IsValid(kData[n].text, kData[n].textLen)) << "#" << n; }}
开发者ID:Dorahe,项目名称:platform_external_qemu,代码行数:22,
示例3: popPagemxArray* popPage(){ size_t M,N,maxMN; double retVal; mxArray* tmp; biEntry* cmdStruct = lookupEntry("PageList", vars, ARRAYLEN(vars)); if (cmdStruct->var == NULL) { return cmdStruct->getter(cmdStruct); } else { retVal = mxGetScalar(cmdStruct->var); M = mxGetM(cmdStruct->var); N = mxGetN(cmdStruct->var); maxMN = M > N ? M : N; tmp = mxCreateDoubleMatrix(1, maxMN - 1, mxREAL); memcpy(mxGetPr(tmp), mxGetPr(cmdStruct->var) + 1, (maxMN - 1)*sizeof(double)); cmdStruct->setter(cmdStruct, tmp); return mxCreateDoubleScalar(retVal); }}
开发者ID:Steve3nto,项目名称:NoiseReductionProject,代码行数:22,
示例4: settings_apply_skinsvoid settings_apply_skins(void){ char buf[MAX_PATH]; /* re-initialize the skin buffer before we start reloading skins */ skin_buffer_init(); enum screen_type screen = SCREEN_MAIN; unsigned int i;#ifdef HAVE_LCD_BITMAP skin_backdrop_init(); skin_font_init();#endif#if CONFIG_TUNER fms_skin_init();#endif for (i=0; i<ARRAYLEN(skins); i++) {#ifdef HAVE_REMOTE_LCD screen = skins[i].suffix[0] == 'r' ? SCREEN_REMOTE : SCREEN_MAIN;#endif CHART2(">skin load ", skins[i].suffix); if (skins[i].setting[0] && skins[i].setting[0] != '-') { snprintf(buf, sizeof buf, WPS_DIR "/%s.%s", skins[i].setting, skins[i].suffix); skins[i].loadfunc(screen, buf, true); } else { skins[i].loadfunc(screen, NULL, true); } CHART2("<skin load ", skins[i].suffix); } viewportmanager_theme_changed(THEME_STATUSBAR);#if LCD_DEPTH > 1 || defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1 FOR_NB_SCREENS(i) screens[i].backdrop_show(sb_get_backdrop(i));#endif}
开发者ID:eisnerd,项目名称:rockbox,代码行数:38,
示例5: mspClientProcessvoid mspClientProcess(void){ static uint8_t index = 0; bool busy = mspPorts[1].commandSenderFn != NULL; if (busy) { return; } commandToSend = commandsToSend[index]; mspPorts[1].commandSenderFn = mspRequestFCSimpleCommandSender; index++; if (index >= ARRAYLEN(commandsToSend)) { index = 0; } // // handle timeout of received data. // uint32_t now = micros(); mspClientStatus.timeoutOccured = (cmp32(now, mspClientStatus.lastReplyAt) >= MSP_CLIENT_TIMEOUT_INTERVAL);}
开发者ID:180jacob,项目名称:cleanflight,代码行数:23,
示例6: ASSERT/* Buffer a block of sound data for the given sound. Return the number of * frames buffered, or a RageSoundReader return code. */int RageSoundDriver::GetDataForSound( Sound &s ){ sound_block *p[2]; unsigned psize[2]; s.m_Buffer.get_write_pointers( p, psize ); /* If we have no open buffer slot, we have a buffer overflow. */ ASSERT( psize[0] > 0 ); sound_block *pBlock = p[0]; int size = ARRAYLEN(pBlock->m_Buffer)/channels; int iRet = s.m_pSound->GetDataToPlay( pBlock->m_Buffer, size, pBlock->m_iPosition, pBlock->m_FramesInBuffer ); if( iRet > 0 ) { pBlock->m_BufferNext = pBlock->m_Buffer; s.m_Buffer.advance_write_pointer( 1 ); }// LOG->Trace( "incr fr wr %i (state %i) (%p)",// (int) pBlock->m_FramesInBuffer, s.m_State, s.m_pSound ); return iRet;}
开发者ID:AratnitY,项目名称:stepmania,代码行数:25,
示例7: dbg_hw_info_dmabool dbg_hw_info_dma(void){ lcd_setfont(FONT_SYSFIXED); while(1) { int button = get_action(CONTEXT_STD, HZ / 25); switch(button) { case ACTION_STD_NEXT: case ACTION_STD_PREV: case ACTION_STD_OK: case ACTION_STD_MENU: lcd_setfont(FONT_UI); return true; case ACTION_STD_CANCEL: lcd_setfont(FONT_UI); return false; } lcd_clear_display(); lcd_putsf(0, 0, "S C name bar apb ahb una"); for(unsigned i = 0; i < ARRAYLEN(dbg_channels); i++) { struct imx233_dma_info_t info = imx233_dma_get_info(dbg_channels[i].chan, DMA_INFO_ALL); lcd_putsf(0, i + 1, "%c %c %4s %8x %3x %3x %3x", info.gated ? 'g' : info.freezed ? 'f' : ' ', !info.int_enabled ? '-' : info.int_error ? 'e' : info.int_cmdcomplt ? 'c' : ' ', dbg_channels[i].name, info.bar, info.apb_bytes, info.ahb_bytes, info.nr_unaligned); } lcd_update(); yield(); }}
开发者ID:4nykey,项目名称:rockbox,代码行数:37,
|