本文整理汇总了C++中STACK_INIT函数的典型用法代码示例。如果您正苦于以下问题:C++ STACK_INIT函数的具体用法?C++ STACK_INIT怎么用?C++ STACK_INIT使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了STACK_INIT函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: yaml_emitter_initialize
yaml_emitter_initialize(yaml_emitter_t *emitter)
{
assert(emitter); /* Non-NULL emitter object expected. */
memset(emitter, 0, sizeof(yaml_emitter_t));
if (!BUFFER_INIT(emitter, emitter->buffer, OUTPUT_BUFFER_SIZE))
goto error;
if (!BUFFER_INIT(emitter, emitter->raw_buffer, OUTPUT_RAW_BUFFER_SIZE))
goto error;
if (!STACK_INIT(emitter, emitter->states, INITIAL_STACK_SIZE))
goto error;
if (!QUEUE_INIT(emitter, emitter->events, INITIAL_QUEUE_SIZE))
goto error;
if (!STACK_INIT(emitter, emitter->indents, INITIAL_STACK_SIZE))
goto error;
if (!STACK_INIT(emitter, emitter->tag_directives, INITIAL_STACK_SIZE))
goto error;
return 1;
error:
BUFFER_DEL(emitter, emitter->buffer);
BUFFER_DEL(emitter, emitter->raw_buffer);
STACK_DEL(emitter, emitter->states);
QUEUE_DEL(emitter, emitter->events);
STACK_DEL(emitter, emitter->indents);
STACK_DEL(emitter, emitter->tag_directives);
return 0;
}
示例2: jsp_early_error_init
void
jsp_early_error_init (void)
{
jsp_early_error_type = JSP_EARLY_ERROR__NO_ERROR;
STACK_INIT (props);
STACK_INIT (size_t_stack);
}
示例3: initSystem
static void initSystem(LaplacianDeformModifierData *lmd, Object *ob, DerivedMesh *dm,
float (*vertexCos)[3], int numVerts)
{
int i;
int defgrp_index;
int total_anchors;
float wpaint;
MDeformVert *dvert = NULL;
MDeformVert *dv = NULL;
LaplacianSystem *sys;
if (isValidVertexGroup(lmd, ob, dm)) {
int *index_anchors = MEM_mallocN(sizeof(int) * numVerts, __func__); /* over-alloc */
const MLoopTri *mlooptri;
const MLoop *mloop;
STACK_DECLARE(index_anchors);
STACK_INIT(index_anchors, numVerts);
modifier_get_vgroup(ob, dm, lmd->anchor_grp_name, &dvert, &defgrp_index);
BLI_assert(dvert != NULL);
dv = dvert;
for (i = 0; i < numVerts; i++) {
wpaint = defvert_find_weight(dv, defgrp_index);
dv++;
if (wpaint > 0.0f) {
STACK_PUSH(index_anchors, i);
}
}
DM_ensure_looptri(dm);
total_anchors = STACK_SIZE(index_anchors);
lmd->cache_system = initLaplacianSystem(numVerts, dm->getNumEdges(dm), dm->getNumLoopTri(dm),
total_anchors, lmd->anchor_grp_name, lmd->repeat);
sys = (LaplacianSystem *)lmd->cache_system;
memcpy(sys->index_anchors, index_anchors, sizeof(int) * total_anchors);
memcpy(sys->co, vertexCos, sizeof(float[3]) * numVerts);
MEM_freeN(index_anchors);
lmd->vertexco = MEM_mallocN(sizeof(float[3]) * numVerts, "ModDeformCoordinates");
memcpy(lmd->vertexco, vertexCos, sizeof(float[3]) * numVerts);
lmd->total_verts = numVerts;
createFaceRingMap(
dm->getNumVerts(dm), dm->getLoopTriArray(dm), dm->getNumLoopTri(dm),
dm->getLoopArray(dm), &sys->ringf_map, &sys->ringf_indices);
createVertRingMap(
dm->getNumVerts(dm), dm->getEdgeArray(dm), dm->getNumEdges(dm),
&sys->ringv_map, &sys->ringv_indices);
mlooptri = dm->getLoopTriArray(dm);
mloop = dm->getLoopArray(dm);
for (i = 0; i < sys->total_tris; i++) {
sys->tris[i][0] = mloop[mlooptri[i].tri[0]].v;
sys->tris[i][1] = mloop[mlooptri[i].tri[1]].v;
sys->tris[i][2] = mloop[mlooptri[i].tri[2]].v;
}
}
}
示例4: _c_int00
extern void __interrupt _c_int00()
{
int preInitStatus;
STACK_INIT();
/*------------------------------------------------------------------------*/
/* Call hook configured into Startup_resetFxn */
/*------------------------------------------------------------------------*/
if (&xdc_runtime_Startup__RESETFXN__C == (int*)1) {
xdc_runtime_Startup_reset__I();
}
/*------------------------------------------------------------------------*/
/* Allow for any application-specific low level initialization prior to */
/* initializing the C/C++ environment (global variable initialization, */
/* constructers). If _system_pre_init() returns 0, then bypass C/C++ */
/* initialization. NOTE: BYPASSING THE CALL TO THE C/C++ INITIALIZATION */
/* ROUTINE MAY RESULT IN PROGRAM FAILURE. */
/*------------------------------------------------------------------------*/
preInitStatus = _system_pre_init(); /* moved here to allow clear of .bss */
INIT_EXIT_PTRS();
INIT_LOCKS();
if (preInitStatus != 0) _auto_init();
/*------------------------------------------------------------------------*/
/* Handle any argc/argv arguments if supported by an MSP430 loader. */
/*------------------------------------------------------------------------*/
_args_main();
exit(1);
}
示例5: yaml_parser_load
yaml_parser_load(yaml_parser_t *parser, yaml_document_t *document)
{
yaml_event_t event;
assert(parser); /* Non-NULL parser object is expected. */
assert(document); /* Non-NULL document object is expected. */
memset(document, 0, sizeof(yaml_document_t));
if (!STACK_INIT(parser, document->nodes, INITIAL_STACK_SIZE))
goto error;
if (!parser->stream_start_produced) {
if (!yaml_parser_parse(parser, &event)) goto error;
assert(event.type == YAML_STREAM_START_EVENT);
/* STREAM-START is expected. */
}
if (parser->stream_end_produced) {
return 1;
}
if (!yaml_parser_parse(parser, &event)) goto error;
if (event.type == YAML_STREAM_END_EVENT) {
return 1;
}
if (!STACK_INIT(parser, parser->aliases, INITIAL_STACK_SIZE))
goto error;
parser->document = document;
if (!yaml_parser_load_document(parser, &event)) goto error;
yaml_parser_delete_aliases(parser);
parser->document = NULL;
return 1;
error:
yaml_parser_delete_aliases(parser);
yaml_document_delete(document);
parser->document = NULL;
return 0;
}
示例6: yaml_parser_load_sequence
static int
yaml_parser_load_sequence(yaml_parser_t *parser, yaml_event_t *first_event)
{
yaml_event_t event;
yaml_node_t node;
struct {
yaml_node_item_t *start;
yaml_node_item_t *end;
yaml_node_item_t *top;
} items = { NULL, NULL, NULL };
int index, item_index;
yaml_char_t *tag = first_event->data.sequence_start.tag;
if (!STACK_LIMIT(parser, parser->document->nodes, INT_MAX-1)) goto error;
if (!tag || strcmp((char *)tag, "!") == 0) {
yaml_free(tag);
tag = yaml_strdup((yaml_char_t *)YAML_DEFAULT_SEQUENCE_TAG);
if (!tag) goto error;
}
if (!STACK_INIT(parser, items, INITIAL_STACK_SIZE)) goto error;
SEQUENCE_NODE_INIT(node, tag, items.start, items.end,
first_event->data.sequence_start.style,
first_event->start_mark, first_event->end_mark);
if (!PUSH(parser, parser->document->nodes, node)) goto error;
index = (int)(parser->document->nodes.top - parser->document->nodes.start);
if (!yaml_parser_register_anchor(parser, index,
first_event->data.sequence_start.anchor)) return 0;
if (!yaml_parser_parse(parser, &event)) return 0;
while (event.type != YAML_SEQUENCE_END_EVENT) {
if (!STACK_LIMIT(parser,
parser->document->nodes.start[index-1].data.sequence.items,
INT_MAX-1)) return 0;
item_index = yaml_parser_load_node(parser, &event);
if (!item_index) return 0;
if (!PUSH(parser,
parser->document->nodes.start[index-1].data.sequence.items,
item_index)) return 0;
if (!yaml_parser_parse(parser, &event)) return 0;
}
parser->document->nodes.start[index-1].end_mark = event.end_mark;
return index;
error:
yaml_free(tag);
yaml_free(first_event->data.sequence_start.anchor);
return 0;
}
示例7: yaml_parser_load_mapping
static int
yaml_parser_load_mapping(yaml_parser_t *parser, yaml_event_t *first_event)
{
yaml_event_t event;
yaml_node_t node;
struct {
yaml_node_pair_t *start;
yaml_node_pair_t *end;
yaml_node_pair_t *top;
} pairs = { NULL, NULL, NULL };
int index;
yaml_node_pair_t pair;
yaml_char_t *tag = first_event->data.mapping_start.tag;
if (!tag || strcmp((char *)tag, "!") == 0) {
yaml_free(tag);
tag = yaml_strdup((yaml_char_t *)YAML_DEFAULT_MAPPING_TAG);
if (!tag) goto error;
}
if (!STACK_INIT(parser, pairs, INITIAL_STACK_SIZE)) goto error;
MAPPING_NODE_INIT(node, tag, pairs.start, pairs.end,
first_event->data.mapping_start.style,
first_event->start_mark, first_event->end_mark);
if (!PUSH(parser, parser->document->nodes, node)) goto error;
index = (int) (parser->document->nodes.top - parser->document->nodes.start);
if (!yaml_parser_register_anchor(parser, index,
first_event->data.mapping_start.anchor)) return 0;
if (!yaml_parser_parse(parser, &event)) return 0;
while (event.type != YAML_MAPPING_END_EVENT) {
pair.key = yaml_parser_load_node(parser, &event);
if (!pair.key) return 0;
if (!yaml_parser_parse(parser, &event)) return 0;
pair.value = yaml_parser_load_node(parser, &event);
if (!pair.value) return 0;
if (!PUSH(parser,
parser->document->nodes.start[index-1].data.mapping.pairs,
pair)) return 0;
if (!yaml_parser_parse(parser, &event)) return 0;
}
parser->document->nodes.start[index-1].end_mark = event.end_mark;
return index;
error:
yaml_free(tag);
yaml_free(first_event->data.mapping_start.anchor);
return 0;
}
示例8: Api_WMIInitFinish
/* Api_WMIInitFinish - implements common code for sending default wmi commands
* to target.
* This should be called after Api_InitFinish().
* A_VOID *pCxt - the driver context.
*****************************************************************************/
A_VOID
Api_WMIInitFinish(A_VOID *pCxt)
{
A_DRIVER_CONTEXT *pDCxt = GET_DRIVER_COMMON(pCxt);
A_STATUS status;
WMI_ALLOW_AGGR_CMD allow_aggr_cmd;
if(pDCxt->wmiReady == A_TRUE)
{
do{
status = STACK_INIT(pCxt);
if(status == A_OK){
CUSTOM_WAIT_FOR_WMI_RESPONSE(pCxt);
break;
}else if(status == A_NO_MEMORY){
pDCxt->tx_complete_pend = A_TRUE;
if(A_OK != CUSTOM_DRIVER_WAIT_FOR_CONDITION(pCxt, &(pDCxt->tx_complete_pend), A_FALSE, 5000)){
A_ASSERT(0);
}
}else{
A_ASSERT(0);
}
}while(1);
/* issue some default WMI commands appropriate for most systems */
#if WLAN_CONFIG_IGNORE_POWER_SAVE_FAIL_EVENT_DURING_SCAN
wmi_cmd_process(pCxt, WMI_SET_POWER_PARAMS_CMDID, &default_power_param, sizeof(WMI_POWER_PARAMS_CMD));
#endif
wmi_cmd_process(pCxt, WMI_SET_SCAN_PARAMS_CMDID, &default_scan_param, sizeof(WMI_SCAN_PARAMS_CMD));
wmi_cmd_process(pCxt, WMI_STORERECALL_CONFIGURE_CMDID,
&default_strrcl_config_cmd, sizeof(WMI_STORERECALL_CONFIGURE_CMD));
pDCxt->strrclState = STRRCL_ST_INIT;
/* technically this call to wmi_allow_aggr_cmd is not necessary if both
* masks are 0 as the firmware has 0,0 as the default. */
allow_aggr_cmd.tx_allow_aggr = A_CPU2LE16(pDCxt->txAggrTidMask);
allow_aggr_cmd.rx_allow_aggr = A_CPU2LE16(pDCxt->rxAggrTidMask);
wmi_cmd_process(pCxt, WMI_ALLOW_AGGR_CMDID, &allow_aggr_cmd, sizeof(WMI_ALLOW_AGGR_CMD));
#if ENABLE_P2P_MODE
if(WLAN_NUM_OF_DEVICES == 2) {
/* Device-0 is P2P Device and Device-1 is Legacy STA.\
Set Default P2P Params
*/
wmi_cmd_process(pCxt,WMI_P2P_SET_CONFIG_CMDID,&default_p2p_config,sizeof(WMI_P2P_FW_SET_CONFIG_CMD));
}
#endif
/* Set the BSS Filter to None. If this is not set, by default the firmware
sets to forward the beacons to host. This causes unnecessary BSSINFO events in
the host even after connecting to the AP */
wmi_bssfilter_cmd(pDCxt->pWmiCxt, NONE_BSS_FILTER, 0);
}
}
示例9: gc_start
static void gc_start(void) {
scm_val v = NIL, *p ;
STACK_INIT() ;
for (p = stack_start; p != (scm_val *)&p; p += stack_dir)
if (IN_RANGE(*p)) GRAY(*p) ;
FOREACH(v, roots) {
scm_val r = *(scm_val *)(CAR(v).p) ;
v.c->flags = FL_GC_BLACK ;
if (PTR_AND_NO_FLAG(r, FL_GC_GRAY)) GRAY(r) ;
}
示例10: yaml_parser_initialize
yaml_parser_initialize(yaml_parser_t *parser)
{
assert(parser); /* Non-NULL parser object expected. */
memset(parser, 0, sizeof(yaml_parser_t));
if (!BUFFER_INIT(parser, parser->raw_buffer, INPUT_RAW_BUFFER_SIZE))
goto error;
if (!BUFFER_INIT(parser, parser->buffer, INPUT_BUFFER_SIZE))
goto error;
if (!QUEUE_INIT(parser, parser->tokens, INITIAL_QUEUE_SIZE))
goto error;
if (!STACK_INIT(parser, parser->indents, INITIAL_STACK_SIZE))
goto error;
if (!STACK_INIT(parser, parser->simple_keys, INITIAL_STACK_SIZE))
goto error;
if (!STACK_INIT(parser, parser->states, INITIAL_STACK_SIZE))
goto error;
if (!STACK_INIT(parser, parser->marks, INITIAL_STACK_SIZE))
goto error;
if (!STACK_INIT(parser, parser->tag_directives, INITIAL_STACK_SIZE))
goto error;
return 1;
error:
BUFFER_DEL(parser, parser->raw_buffer);
BUFFER_DEL(parser, parser->buffer);
QUEUE_DEL(parser, parser->tokens);
STACK_DEL(parser, parser->indents);
STACK_DEL(parser, parser->simple_keys);
STACK_DEL(parser, parser->states);
STACK_DEL(parser, parser->marks);
STACK_DEL(parser, parser->tag_directives);
return 0;
}
示例11: _c_int00_noinit_noexit
extern void __interrupt _c_int00_noinit_noexit()
{
STACK_INIT();
/*------------------------------------------------------------------------*/
/* Call hook configured into Startup_resetFxn */
/*------------------------------------------------------------------------*/
if (&xdc_runtime_Startup__RESETFXN__C == (int*)1) {
xdc_runtime_Startup_reset__I();
}
_system_pre_init(); /* moved here to allow clear of .bss */
INIT_LOCKS();
main(0);
abort();
}
示例12: _c_int00_noinit_mpu_init
extern void __interrupt _c_int00_noinit_mpu_init()
{
MPU_INIT();
STACK_INIT();
/*------------------------------------------------------------------------*/
/* Call hook configured into Startup_resetFxn */
/*------------------------------------------------------------------------*/
if (&xdc_runtime_Startup__RESETFXN__C == (int*)1) {
xdc_runtime_Startup_reset__I();
}
_system_pre_init(); /* moved here to allow clear of .bss */
INIT_EXIT_PTRS();
INIT_LOCKS();
_args_main();
exit(1);
}
示例13: _c_int00_noexit_mpu_init
extern void __interrupt _c_int00_noexit_mpu_init()
{
int preInitStatus;
MPU_INIT();
STACK_INIT();
/*------------------------------------------------------------------------*/
/* Call hook configured into Startup_resetFxn */
/*------------------------------------------------------------------------*/
if (&xdc_runtime_Startup__RESETFXN__C == (int*)1) {
xdc_runtime_Startup_reset__I();
}
preInitStatus = _system_pre_init(); /* moved here to allow clear of .bss */
INIT_LOCKS();
if (preInitStatus != 0) _auto_init();
main(0);
abort();
}
示例14: yaml_document_add_mapping
yaml_document_add_mapping(yaml_document_t *document,
yaml_char_t *tag, yaml_mapping_style_t style)
{
struct {
yaml_error_type_t error;
} context;
yaml_mark_t mark = { 0, 0, 0 };
yaml_char_t *tag_copy = NULL;
struct {
yaml_node_pair_t *start;
yaml_node_pair_t *end;
yaml_node_pair_t *top;
} pairs = { NULL, NULL, NULL };
yaml_node_t node;
assert(document); /* Non-NULL document object is expected. */
if (!tag) {
tag = (yaml_char_t *)YAML_DEFAULT_MAPPING_TAG;
}
if (!yaml_check_utf8(tag, strlen((char *)tag))) goto error;
tag_copy = yaml_strdup(tag);
if (!tag_copy) goto error;
if (!STACK_INIT(&context, pairs, INITIAL_STACK_SIZE)) goto error;
MAPPING_NODE_INIT(node, tag_copy, pairs.start, pairs.end,
style, mark, mark);
if (!PUSH(&context, document->nodes, node)) goto error;
return document->nodes.top - document->nodes.start;
error:
STACK_DEL(&context, pairs);
yaml_free(tag_copy);
return 0;
}
示例15: _c_int00
extern void __interrupt _c_int00()
{
STACK_INIT();
// INIT_EXIT_PTRS();
// INIT_LOCKS();
/*------------------------------------------------------------------------*/
/* Allow for any application-specific low level initialization prior to */
/* initializing the C/C++ environment (global variable initialization, */
/* constructers). If _system_pre_init() returns 0, then bypass C/C++ */
/* initialization. NOTE: BYPASSING THE CALL TO THE C/C++ INITIALIZATION */
/* ROUTINE MAY RESULT IN PROGRAM FAILURE. */
/*------------------------------------------------------------------------*/
// if(_system_pre_init() != 0) _auto_init();
/*------------------------------------------------------------------------*/
/* Handle any argc/argv arguments if supported by an MSP430 loader. */
/*------------------------------------------------------------------------*/
main_boot();
}