本文整理汇总了C++中VOID函数的典型用法代码示例。如果您正苦于以下问题:C++ VOID函数的具体用法?C++ VOID怎么用?C++ VOID使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了VOID函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PrintConstants
static void PrintConstants(const Proto* f)
{
int i,n=f->sizek;
printf("constants (%d) for %p:\n",n,VOID(f));
for (i=0; i<n; i++)
{
printf("\t%d\t",i+1);
PrintConstant(f,i);
printf("\n");
}
}
示例2: w_search
static int w_search(register N_INFO *info, register N_KEYDEF *keyinfo,
uchar *key, ulong page, uchar *father_buff,
uchar *father_keypos, ulong father_page)
{
int error,flag;
uint comp_flag,nod_flag;
uchar *temp_buff,*keypos;
uchar keybuff[N_MAX_KEY_BUFF];
DBUG_ENTER("w_search");
DBUG_PRINT("enter",("page: %ld",page));
if (page == NI_POS_ERROR)
DBUG_RETURN(1); /* No key, make new */
if (keyinfo->base.flag & HA_SORT_ALLOWS_SAME)
comp_flag=SEARCH_BIGGER; /* Put after same key */
else if (keyinfo->base.flag & HA_NOSAME)
comp_flag=SEARCH_FIND; /* No dupplicates */
else
comp_flag=SEARCH_SAME; /* Keys in rec-pos order */
if (!(temp_buff= (uchar*) my_alloca((uint) keyinfo->base.block_length+
N_MAX_KEY_BUFF)))
DBUG_RETURN(-1);
if (!_nisam_fetch_keypage(info,keyinfo,page,temp_buff,0))
goto err;
flag=(*keyinfo->bin_search)(info,keyinfo,temp_buff,key,0,comp_flag,&keypos,
keybuff);
nod_flag=test_if_nod(temp_buff);
if (flag == 0)
{
my_errno=HA_ERR_FOUND_DUPP_KEY;
/* get position to record with dupplicated key */
VOID((*keyinfo->get_key)(keyinfo,nod_flag,&keypos,keybuff));
info->dupp_key_pos=_nisam_dpos(info,test_if_nod(temp_buff),keypos);
my_afree((byte*) temp_buff);
DBUG_RETURN(-1);
}
if ((error=w_search(info,keyinfo,key,_nisam_kpos(nod_flag,keypos),
temp_buff,keypos,page)) >0)
{
error=_nisam_insert(info,keyinfo,key,temp_buff,keypos,keybuff,father_buff,
father_keypos,father_page);
if (_nisam_write_keypage(info,keyinfo,page,temp_buff))
goto err;
}
my_afree((byte*) temp_buff);
DBUG_RETURN(error);
err:
my_afree((byte*) temp_buff);
DBUG_PRINT("exit",("Error: %d",my_errno));
DBUG_RETURN (-1);
} /* w_search */
示例3: _nisam_log_command
void _nisam_log_command(enum nisam_log_commands command, N_INFO *info, const byte *buffert, uint length, int result)
{
char buff[9];
int error,old_errno;
ulong pid=(ulong) GETPID();
old_errno=my_errno;
buff[0]=(char) command;
int2store(buff+1,info->dfile);
int4store(buff+3,pid);
int2store(buff+7,result);
pthread_mutex_lock(&THR_LOCK_isam);
error=my_lock(nisam_log_file,F_WRLCK,0L,F_TO_EOF,MYF(MY_SEEK_NOT_DONE));
VOID(my_write(nisam_log_file,buff,sizeof(buff),MYF(0)));
if (buffert)
VOID(my_write(nisam_log_file,buffert,length,MYF(0)));
if (!error)
error=my_lock(nisam_log_file,F_UNLCK,0L,F_TO_EOF,MYF(MY_SEEK_NOT_DONE));
pthread_mutex_unlock(&THR_LOCK_isam);
my_errno=old_errno;
}
示例4: _tcsncpy
//------------------------------------------------------------------------
VOID CEGTrayIcon::ShowCoolTip(TCHAR * pszTitle, TCHAR * pszText, UINT nTime)
{
if( !m_bRegistered )
return;
m_IconData.uFlags |= NIF_INFO;
_tcsncpy(m_IconData.szInfo, pszText, 256);
_tcsncpy(m_IconData.szInfoTitle, pszTitle, 64);
m_IconData.dwInfoFlags = NIIF_INFO;
m_IconData.uTimeout = nTime;
Shell_NotifyIcon( NIM_MODIFY, &m_IconData );
return VOID();
}
示例5: expand_eval_when
static SCM
expand_eval_when (SCM expr, SCM env)
{
ASSERT_SYNTAX (scm_ilength (expr) >= 3, s_bad_expression, expr);
ASSERT_SYNTAX (scm_ilength (CADR (expr)) > 0, s_bad_expression, expr);
if (scm_is_true (scm_memq (sym_eval, CADR (expr)))
|| scm_is_true (scm_memq (sym_load, CADR (expr))))
return expand_sequence (CDDR (expr), env);
else
return VOID (scm_source_properties (expr));
}
示例6: main
int main(int argc,char **argv)
{
int status,wait_ret;
uint i;
N_KEYDEF keyinfo[10];
N_RECINFO recinfo[10];
MY_INIT(argv[0]);
get_options(argc,argv);
keyinfo[0].seg[0].base.start=0;
keyinfo[0].seg[0].base.length=8;
keyinfo[0].seg[0].base.type=HA_KEYTYPE_TEXT;
keyinfo[0].seg[0].base.flag=HA_SPACE_PACK;
keyinfo[0].seg[1].base.type=0;
keyinfo[0].base.flag = (uint8) HA_PACK_KEY;
keyinfo[1].seg[0].base.start=8;
keyinfo[1].seg[0].base.length=sizeof(uint32);
keyinfo[1].seg[0].base.type=HA_KEYTYPE_LONG_INT;
keyinfo[1].seg[0].base.flag=0;
keyinfo[1].seg[1].base.type=0;
keyinfo[1].base.flag =HA_NOSAME;
recinfo[0].base.type=0;
recinfo[0].base.length=sizeof(record.id);
recinfo[1].base.type=0;
recinfo[1].base.length=sizeof(record.nr);
recinfo[2].base.type=0;
recinfo[2].base.length=sizeof(record.text);
recinfo[3].base.type=FIELD_LAST;
puts("- Creating isam-file");
my_delete(filename,MYF(0)); /* Remove old locks under gdb */
if (nisam_create(filename,2,&keyinfo[0],&recinfo[0],10000,0,0,0,0L))
exit(1);
rnd_init(0);
printf("- Starting %d processes\n",forks); fflush(stdout);
for (i=0 ; i < forks; i++)
{
if (!fork())
{
start_test(i+1);
sleep(1);
return 0;
}
VOID(rnd(1));
}
for (i=0 ; i < forks ; i++)
while ((wait_ret=wait(&status)) && wait_ret == -1);
return 0;
}
示例7: CTobject
void CTobject ( GPUbuffer * VO , GLuint vertices , glm::vec4 * points ,
glm::vec4 * colors ,
glm::vec2 * textures ) {
size_t offset = 0;
size_t size_points = sizeof(glm::vec4)*vertices;
size_t size_colors = sizeof(glm::vec4)*vertices;
size_t size_textures = sizeof(glm::vec2)*vertices;
currentShader(shaders[shader_texture]);
glGenBuffers(1,&VO->VBO);
glBindBuffer(GL_ARRAY_BUFFER,VO->VBO);
glBufferData(
GL_ARRAY_BUFFER,
size_points+size_colors+size_textures,
NULL,
GL_STATIC_DRAW
);
glBufferSubData(GL_ARRAY_BUFFER,offset,size_points ,VOID(points)); offset += size_points;
glBufferSubData(GL_ARRAY_BUFFER,offset,size_colors ,VOID(colors)); offset += size_colors;
glBufferSubData(GL_ARRAY_BUFFER,offset,size_textures,VOID(textures)); offset += size_textures;
offset = 0;
glGenVertexArrays(1,&VO->VAO);
glBindVertexArray(VO->VAO);
glEnableVertexAttribArray(shaderPositions[shader_texture]);
glEnableVertexAttribArray(shaderColors[shader_texture]);
glEnableVertexAttribArray(CTvTexture);
glVertexAttribPointer(shaderPositions[shader_texture],4,GL_FLOAT,GL_FALSE,0,VOID(offset)); offset += size_points;
glVertexAttribPointer(shaderColors[shader_texture] ,4,GL_FLOAT,GL_FALSE,0,VOID(offset)); offset += size_colors;
glVertexAttribPointer(CTvTexture ,2,GL_FLOAT,GL_FALSE,0,VOID(offset)); offset += size_textures;
}
示例8: nisam_is_changed
int nisam_is_changed(N_INFO *info)
{
int result;
DBUG_ENTER("nisam_is_changed");
#ifndef NO_LOCKING
if (_nisam_readinfo(info,F_RDLCK,1)) DBUG_RETURN(-1);
VOID(_nisam_writeinfo(info,0));
#endif
result=(int) info->data_changed;
info->data_changed=0;
DBUG_PRINT("exit",("result: %d",result));
DBUG_RETURN(result);
}
示例9: _nisam_log_record
void _nisam_log_record(enum nisam_log_commands command, N_INFO *info, const byte *record, ulong filepos, int result)
{
char buff[17],*pos;
int error,old_errno;
uint length;
ulong pid=(ulong) GETPID();
old_errno=my_errno;
if (!info->s->base.blobs)
length=info->s->base.reclength;
else
length=info->s->base.reclength+ _calc_total_blob_length(info,record);
buff[0]=(char) command;
int2store(buff+1,info->dfile);
int4store(buff+3,pid);
int2store(buff+7,result);
int4store(buff+9,filepos);
int4store(buff+13,length);
pthread_mutex_lock(&THR_LOCK_isam);
error=my_lock(nisam_log_file,F_WRLCK,0L,F_TO_EOF,MYF(MY_SEEK_NOT_DONE));
VOID(my_write(nisam_log_file,buff,sizeof(buff),MYF(0)));
VOID(my_write(nisam_log_file,(byte*) record,info->s->base.reclength,MYF(0)));
if (info->s->base.blobs)
{
N_BLOB *blob,*end;
for (end=info->blobs+info->s->base.blobs, blob= info->blobs;
blob != end ;
blob++)
{
bmove(&pos,record+blob->offset+blob->pack_length,sizeof(char*));
VOID(my_write(nisam_log_file,pos,blob->length,MYF(0)));
}
}
if (!error)
error=my_lock(nisam_log_file,F_UNLCK,0L,F_TO_EOF,MYF(MY_SEEK_NOT_DONE));
pthread_mutex_unlock(&THR_LOCK_isam);
my_errno=old_errno;
}
示例10: wait_for_free_space
void wait_for_free_space(const char *filename, int errors)
{
if (errors == 0)
my_error(EE_DISK_FULL,MYF(ME_BELL | ME_NOREFRESH),
filename,my_errno,MY_WAIT_FOR_USER_TO_FIX_PANIC);
if (!(errors % MY_WAIT_GIVE_USER_A_MESSAGE))
my_printf_error(EE_DISK_FULL,
"Retry in %d secs. Message reprinted in %d secs",
MYF(ME_BELL | ME_NOREFRESH),
MY_WAIT_FOR_USER_TO_FIX_PANIC,
MY_WAIT_GIVE_USER_A_MESSAGE * MY_WAIT_FOR_USER_TO_FIX_PANIC );
VOID(sleep(MY_WAIT_FOR_USER_TO_FIX_PANIC));
}
示例11: expand_if
static SCM
expand_if (SCM expr, SCM env SCM_UNUSED)
{
const SCM cdr_expr = CDR (expr);
const long length = scm_ilength (cdr_expr);
ASSERT_SYNTAX (length == 2 || length == 3, s_expression, expr);
return CONDITIONAL (scm_source_properties (expr),
expand (CADR (expr), env),
expand (CADDR (expr), env),
((length == 3)
? expand (CADDDR (expr), env)
: VOID (SCM_BOOL_F)));
}
示例12: my_path
my_string my_path(my_string to, const char *progname,
const char *own_pathname_part)
{
my_string start,end,prog;
DBUG_ENTER("my_path");
start=to; /* Return this */
if (progname && (dirname_part(to, progname) ||
find_file_in_path(to,progname) ||
((prog=getenv("_")) != 0 && dirname_part(to,prog))))
{
VOID(intern_filename(to,to));
if (!test_if_hard_path(to))
{
if (!my_getwd(curr_dir,FN_REFLEN,MYF(0)))
bchange(to,0,curr_dir, (uint) strlen(curr_dir), (uint) strlen(to)+1);
}
}
else
{
if ((end = getenv("MY_BASEDIR_VERSION")) == 0 &&
(end = getenv("MY_BASEDIR")) == 0)
{
#ifdef DEFAULT_BASEDIR
end= (char*) DEFAULT_BASEDIR;
#else
end= (char*) "/my/";
#endif
}
VOID(intern_filename(to,end));
to=strend(to);
if (to != start && to[-1] != FN_LIBCHAR)
*to++ = FN_LIBCHAR;
VOID(strmov(to,own_pathname_part));
}
DBUG_PRINT("exit",("to: '%s'",start));
DBUG_RETURN(start);
} /* my_path */
示例13: _nisam_delete_static_record
int _nisam_delete_static_record(N_INFO *info)
{
uchar temp[5]; /* 1+sizeof(uint32) */
info->s->state.del++;
info->s->state.empty+=info->s->base.reclength;
temp[0]= '\0'; /* Mark that record is deleted */
int4store(temp+1,info->s->state.dellink);
info->s->state.dellink = info->lastpos;
info->rec_cache.seek_not_done=1;
VOID(my_seek(info->dfile,info->lastpos,MY_SEEK_SET,MYF(0)));
return (my_write(info->dfile,(byte*) temp,(uint) sizeof(temp),
MYF(MY_NABP)) != 0);
}
示例14: myrg_close
int myrg_close(MYRG_INFO *info)
{
int error=0,new_error;
MYRG_TABLE *file;
DBUG_ENTER("myrg_close");
/*
Assume that info->children_attached means that this is called from
direct use of MERGE, not from a MySQL server. In this case the
children must be closed and info->rec_per_key_part is part of the
'info' multi_alloc.
If info->children_attached is false, this is called from a MySQL
server. Children are closed independently but info->rec_per_key_part
must be freed.
Just in case of a server panic (myrg_panic()) info->children_attached
might be true. We would close the children though they should be
closed independently and info->rec_per_key_part is not freed.
This should be acceptable for a panic.
In case of a MySQL server and no children, children_attached is
always true. In this case no rec_per_key_part has been allocated.
So it is correct to use the branch where an empty list of tables is
(not) closed.
*/
if (info->children_attached)
{
for (file= info->open_tables; file != info->end_table; file++)
{
/* purecov: begin inspected */
if ((new_error= mi_close(file->table)))
error= new_error;
else
file->table= NULL;
/* purecov: end */
}
}
else
my_free((uchar*) info->rec_per_key_part, MYF(MY_ALLOW_ZERO_PTR));
delete_queue(&info->by_key);
pthread_mutex_lock(&THR_LOCK_open);
myrg_open_list=list_delete(myrg_open_list,&info->open_list);
pthread_mutex_unlock(&THR_LOCK_open);
VOID(pthread_mutex_destroy(&info->mutex));
my_free((uchar*) info,MYF(0));
if (error)
{
DBUG_RETURN(my_errno=error);
}
DBUG_RETURN(0);
}
示例15: expand_cond_clauses
static SCM
expand_cond_clauses (SCM clause, SCM rest, int elp, int alp, SCM env)
{
SCM test;
const long length = scm_ilength (clause);
ASSERT_SYNTAX (length >= 1, s_bad_cond_clause, clause);
test = CAR (clause);
if (scm_is_eq (test, scm_sym_else) && elp)
{
const int last_clause_p = scm_is_null (rest);
ASSERT_SYNTAX (length >= 2, s_bad_cond_clause, clause);
ASSERT_SYNTAX (last_clause_p, s_misplaced_else_clause, clause);
return expand_sequence (CDR (clause), env);
}
if (scm_is_null (rest))
rest = VOID (SCM_BOOL_F);
else
rest = expand_cond_clauses (CAR (rest), CDR (rest), elp, alp, env);
if (length >= 2
&& scm_is_eq (CADR (clause), scm_sym_arrow)
&& alp)
{
SCM tmp = scm_gensym (scm_from_locale_string ("cond "));
SCM new_env = scm_acons (tmp, tmp, env);
ASSERT_SYNTAX (length > 2, s_missing_recipient, clause);
ASSERT_SYNTAX (length == 3, s_extra_expression, clause);
return LET (SCM_BOOL_F,
scm_list_1 (tmp),
scm_list_1 (tmp),
scm_list_1 (expand (test, env)),
CONDITIONAL (SCM_BOOL_F,
LEXICAL_REF (SCM_BOOL_F, tmp, tmp),
CALL (SCM_BOOL_F,
expand (CADDR (clause), new_env),
scm_list_1 (LEXICAL_REF (SCM_BOOL_F,
tmp, tmp))),
rest));
}
/* FIXME length == 1 case */
else
return CONDITIONAL (SCM_BOOL_F,
expand (test, env),
expand_sequence (CDR (clause), env),
rest);
}