本文整理汇总了C++中clear_cache函数的典型用法代码示例。如果您正苦于以下问题:C++ clear_cache函数的具体用法?C++ clear_cache怎么用?C++ clear_cache使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了clear_cache函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: _gtk_widget_free_cached_sizes
void
_gtk_widget_free_cached_sizes (GtkWidget *widget)
{
SizeRequestCache *cache;
cache = _gtk_widget_peek_request_cache (widget);
clear_cache (cache, GTK_SIZE_GROUP_HORIZONTAL);
clear_cache (cache, GTK_SIZE_GROUP_VERTICAL);
}
开发者ID:shawnl,项目名称:gtk,代码行数:10,代码来源:gtksizerequest.c
示例2: init_cache
/* This function checks if 'request_needed' flag is present
* and resets the cache state if a request is needed for
* a given orientation.
*/
static SizeRequestCache *
init_cache (GtkWidget *widget)
{
SizeRequestCache *cache;
cache = _gtk_widget_peek_request_cache (widget);
if (_gtk_widget_get_width_request_needed (widget))
clear_cache (cache, GTK_SIZE_GROUP_HORIZONTAL);
if (_gtk_widget_get_height_request_needed (widget))
clear_cache (cache, GTK_SIZE_GROUP_VERTICAL);
return cache;
}
开发者ID:shawnl,项目名称:gtk,代码行数:19,代码来源:gtksizerequest.c
示例3: display_err_msg
int display_err_msg(int err, char *msg)
{
struct simple_frame frame;
memset(&frame, 0, sizeof(frame));
frame.item_num = 2;
frame.items[0].pos.row = 1;
frame.items[0].pos.col = 1;
strcpy(frame.items[0].title, msg);
frame.items[1].pos.row = 4;
frame.items[1].pos.col = 1;
sprintf(frame.items[1].title, "错误代码:%d", err);
/* for debug */
printf("err_num:%d", err);
show_simple_frame(&frame);
sleep(1);
clear_cache();
get_keycode();
return SUCCESS;
}
开发者ID:LeonardoPhysh,项目名称:YB_IV,代码行数:25,代码来源:ui_api.c
示例4: gssdp_resource_browser_dispose
static void
gssdp_resource_browser_dispose (GObject *object)
{
GSSDPResourceBrowser *resource_browser;
GSSDPResourceBrowserPrivate *priv;
resource_browser = GSSDP_RESOURCE_BROWSER (object);
priv = gssdp_resource_browser_get_instance_private (resource_browser);
if (priv->client) {
if (g_signal_handler_is_connected
(priv->client,
priv->message_received_id)) {
g_signal_handler_disconnect
(priv->client,
priv->message_received_id);
}
stop_discovery (resource_browser);
g_object_unref (priv->client);
priv->client = NULL;
}
clear_cache (resource_browser);
G_OBJECT_CLASS (gssdp_resource_browser_parent_class)->dispose (object);
}
开发者ID:GNOME,项目名称:gssdp,代码行数:28,代码来源:gssdp-resource-browser.c
示例5: ui_get_keycode
/*
* ui_get_keycode - get ui keycode
* @key : receive buffer
* @return : status
*/
int ui_get_keycode(int *key)
{
int keycode, ime_state;
ime_state = get_ime_status();
set_ime_status(INPUT_LOW_CASE);
clear_cache();
while (1) {
keycode = get_keycode();
if (!(keycode >= '1' && keycode <= '6') && keycode != BACK && keycode != 'z')
continue;
else
break;
}
if (keycode == BACK)
*key = BACK;
else if (keycode == 'z')
*key = HANG;
else
*key = keycode - '0';
set_ime_status(ime_state);
return SUCCESS;
}
开发者ID:LeonardoPhysh,项目名称:YB_IV,代码行数:32,代码来源:ui_api.c
示例6: imp_implementationWithBlock
IMP imp_implementationWithBlock(void *block)
{
struct Block_layout *b = block;
void *start;
void *end;
if ((b->flags & BLOCK_USE_SRET) == BLOCK_USE_SRET)
{
start = &__objc_block_trampoline_sret;
end = &__objc_block_trampoline_end_sret;
}
else
{
start = &__objc_block_trampoline;
end = &__objc_block_trampoline_end;
}
size_t trampolineSize = end - start;
// If we don't have a trampoline intrinsic for this architecture, return a
// null IMP.
if (0 >= trampolineSize) { return 0; }
struct wx_buffer buf = alloc_buffer(trampolineSize + 2*sizeof(void*));
void **out = buf.w;
out[0] = (void*)b->invoke;
out[1] = Block_copy(b);
memcpy(&out[2], start, trampolineSize);
out = buf.x;
char *newIMP = (char*)&out[2];
clear_cache(newIMP, newIMP+trampolineSize);
return (IMP)newIMP;
}
开发者ID:waneck,项目名称:cctools-port,代码行数:32,代码来源:block_to_imp.c
示例7: abs
/**
* Merges the given config over the existing costs.
* @param[in] new_values The new values.
* @param[in] overwrite If true, the new values overwrite the old.
* If false, the new values are added to the old.
* @param[in] cascade Cache clearing will be cascaded into this terrain_info.
*/
void movetype::terrain_info::data::merge(const config & new_values, bool overwrite,
const terrain_info * cascade)
{
if ( overwrite )
// We do not support child tags here, so do not copy any that might
// be in the input. (If in the future we need to support child tags,
// change "merge_attributes" to "merge_with".)
cfg_.merge_attributes(new_values);
else {
for (const config::attribute & a : new_values.attribute_range()) {
config::attribute_value & dest = cfg_[a.first];
int old = dest.to_int(params_.max_value);
// The new value is the absolute value of the old plus the
// provided value, capped between minimum and maximum, then
// given the sign of the old value.
// (Think defenses for why we might have negative values.)
int value = abs(old) + a.second.to_int(0);
value = std::max(params_.min_value, std::min(value, params_.max_value));
if ( old < 0 )
value = -value;
dest = value;
}
}
// The new data has invalidated the cache.
clear_cache(cascade);
}
开发者ID:ArtBears,项目名称:wesnoth,代码行数:36,代码来源:movetype.cpp
示例8: clear_cache
void
TimeLog::load()
{
if (!m_is_loaded)
{
clear_cache();
if (file_exists_at(m_filepath))
{
ifstream infile(m_filepath.c_str());
enable_exceptions(infile);
string line;
size_t line_number = 1;
while (infile.peek() != EOF)
{
getline(infile, line);
load_entry(line, line_number);
++line_number;
}
if (!m_entries.empty() && (m_entries.back().time_point > now()))
{
throw runtime_error
( "The final entry in the time log is future-dated. "
"Future dated entries are not supported."
);
}
}
m_is_loaded = true;
}
return;
}
开发者ID:jahrsg,项目名称:swx,代码行数:30,代码来源:time_log.cpp
示例9: sub_00000588
int sub_00000588(void)
{
int intr;
void (*ptr)(u32) = (void*)g_func_1200;
(*ptr)(0);
open_iso();
intr = sceKernelCpuSuspendIntr();
/* sceUmdManGetUmdDiscInfo patch */
_sw(0xE0000800, g_sceNp9660_driver_text_addr + g_offs->Data1);
_sw(0x00000009, g_sceNp9660_driver_text_addr + g_offs->Data2);
_sw(g_total_blocks, g_sceNp9660_driver_text_addr + g_offs->Data3);
_sw(g_total_blocks, g_sceNp9660_driver_text_addr + g_offs->Data4);
_sw(0x00000000, g_sceNp9660_driver_text_addr + g_offs->Data5);
sceKernelCpuResumeIntr(intr);
if(g_data_1204 == 0) {
g_data_1204 = 1;
sceKernelDelayThread(800000);
}
clear_cache();
sceKernelSetQTGP3(g_umddata);
return 0;
}
开发者ID:cedricwaltercson,项目名称:cedricwaltercson-pro-c,代码行数:28,代码来源:main.c
示例10: clear_cache
void DataFile::close_all()
{
size_t left = clear_cache();
if (left > 0)
throw GenericException(__FILE__, __LINE__,
"%zu data files are still ref'ed in close_all",
left);
}
开发者ID:epicsdeb,项目名称:channelarchiver,代码行数:8,代码来源:DataFile.cpp
示例11: time_P_cold
/* $begin time_p_cold */
double time_P_cold()
{
P(); /* Warm up instruction cache */
clear_cache(); /* Clear data cache */
start_counter();
P();
return get_counter();
}
开发者ID:09zwcbupt,项目名称:csapp,代码行数:9,代码来源:time_p.c
示例12: intel_batchbuffer_free
void
intel_batchbuffer_free(struct intel_context *intel)
{
drm_intel_bo_unreference(intel->batch.last_bo);
drm_intel_bo_unreference(intel->batch.bo);
drm_intel_bo_unreference(intel->batch.workaround_bo);
clear_cache(intel);
}
开发者ID:altf4,项目名称:mesa,代码行数:8,代码来源:intel_batchbuffer.c
示例13: display_warn
int display_warn(char *msg)
{
display_info(msg);
clear_cache();
get_keycode();
return SUCCESS;
}
开发者ID:LeonardoPhysh,项目名称:YB_IV,代码行数:9,代码来源:ui_api.c
示例14: load_shared_library
static int load_shared_library(int id, void **base, unsigned long current_build_date) {
FILE* fp = NULL;
info("Trying to load library ID %d", id);
if (id < 0 || id > 0xfe) error_goto_error("Attempted to load library with invalid ID");
if (id > MAX_SHARED_LIB_ID) error_goto_error("Library ID too high");
char filename[128];
sprintf(filename,"%s/lib%d.so.tns",LIB_SEARCH_DIR,id);
fp = fopen(filename, "rb");
if (!fp) {
error_user_goto_error("Could not open shared library %s", filename);
}
/* get build date */
struct flat_hdr header;
if (read_header(fp,&header) != 0) error_goto_error("Could not read library header");
/* check cache */
if (lib_cache[id-1].base != NULL && /* check if library is already loaded */
lib_cache[id-1].build_date == header.build_date && /* check cached library is same version as file */
lib_cache[id-1].build_date <= current_build_date /* check build dates */
) {
info("Linking library from cache");
*base = lib_cache[id-1].base;
goto success;
}
if (header.build_date > current_build_date) error_user_goto_error("Library ID %d build date is newer than current executable. Refusing to load.", id);
int (*entry_point)(int,char*[]);
size_t dummy;
/* load into memory - nts: potential circular dependancy problem */
if (bflt_fload(fp, base, &dummy, &entry_point) != 0) error_goto_error("Could not load library");
/* initialize the library */
clear_cache();
if (entry_point(0,NULL) != 0) info("Warning: Library (ID:%d) init routine returned nonzero",id);
/* add to lib_cache */
/* if there's a stale library loaded, replace it */
if (lib_cache[id-1].base) free(lib_cache[id-1].base);
lib_cache[id-1].base = *base;
lib_cache[id-1].build_date = header.build_date;
/* successfully loaded library */
success:
info("Library ID %d loaded successfully", id);
fclose(fp);
return 0;
error:
*base = NULL;
if (fp) fclose(fp);
return -1;
}
开发者ID:tangrs,项目名称:ndless-bflt-loader,代码行数:57,代码来源:bflt.c
示例15: get_chn_str
int get_chn_str(int row, int col, char *name)
{
int ret, len = 0;
char chn[2];
set_ime_status(INPUT_PINYIN);
clear_cache();
while (1) {
show_str(row, col, name);
len = strlen(name);
chn[0] = chn[1] = '\0';
ret = ui_pinyin(chn);
switch (ret) {
case ENTER:
/*
if (len != 0)
return SUCCESS;
*/
/* we don't check string is null or not,
* let up-layer do that
*/
return SUCCESS;
break;
case -EUI_BACK:
if (len > 0) {
if ((uchar)name[len - 1] < 127) {
name[len - 1] = '\0';
} else {
name[len - 1] = '\0';
name[len - 2] = '\0';
}
} else
return -EUI_BACK;
break;
case -EUI_ESC:
return -EUI_ESC;
break;
case SUCCESS:
if ((uchar)chn[0] > 127) {
name[len] = chn[0];
name[len + 1] = chn[1];
} else {
name[len] = chn[0];
}
break;
default:
break;
}
}
}
开发者ID:LeonardoPhysh,项目名称:YB_IV,代码行数:57,代码来源:input.c
示例16: node_invalidated
static void
node_invalidated (GeglNode *node,
const GeglRectangle *rect,
GeglOperation *operation)
{
/* if the node is invalidated, clear all cached data. in particular, redraw
* the entire stroke upon the next call to process().
*/
clear_cache (GEGL_PROPERTIES (operation));
}
开发者ID:elEnemigo,项目名称:GEGL-OpenCL,代码行数:10,代码来源:warp.c
示例17: refetch_mregs
void
refetch_mregs( void )
{
mol_dgram_t *dg;
clear_cache();
send_dgram( sv.fd, kMDG_mregs );
if( (dg=dgram_wait( kMDG_mregs )) )
free( dg );
}
开发者ID:threader,项目名称:Mac-On-Linux,代码行数:10,代码来源:deb.c
示例18: get_passwd
/*
* get_passwd - get string with "*" local echo
*
* @return : status
*/
int get_passwd(int row, int col, char *password)
{
int ret;
int key, offset = 0;
char ascii_no[USER_PASSWD_LEN + 1] = {0};
char pass_wd[USER_PASSWD_LEN + 1] = {0};
if (password[0] != '\0') {
offset = snprintf(ascii_no, USER_PASSWD_LEN + 1, "%s", password);
}
ret = SUCCESS;
set_ime_status(INPUT_LOW_CASE);
clear_cache();
while (1) {
show_str(row, col, ascii_no);
key = get_keycode();
if (key >= '0' && key <= '9') {
if (offset < USER_PASSWD_LEN) {
sprintf(ascii_no + offset, "%c", '*');
pass_wd[offset] = key;
offset ++;
}
} else {
switch (key) {
case ESC:
return -EUI_ESC;
case BACK:
if (offset > 0) {
ascii_no[offset - 1] = '\0';
pass_wd[offset - 1] = '\0';
offset --;
}
break;
case ENTER:
if (offset > 0) {
ret = SUCCESS;
goto handled;
}
break;
default:
break;
}
}
}
handled:
strcpy(password, pass_wd);
return ret;
}
开发者ID:LeonardoPhysh,项目名称:YB_IV,代码行数:60,代码来源:input.c
示例19: intel_batchbuffer_reset_to_saved
void
intel_batchbuffer_reset_to_saved(struct intel_context *intel)
{
drm_intel_gem_bo_clear_relocs(intel->batch.bo, intel->batch.saved.reloc_count);
intel->batch.used = intel->batch.saved.used;
/* Cached batch state is dead, since we just cleared some unknown part of the
* batchbuffer. Assume that the caller resets any other state necessary.
*/
clear_cache(intel);
}
开发者ID:altf4,项目名称:mesa,代码行数:12,代码来源:intel_batchbuffer.c
示例20: get_string
/*
* get_string - get a string(letter&number) with local echo
*
* @return : status
*/
int get_string(int row, int col, char *str)
{
int ret;
int key, offset = 0;
char ascii_no[MAX_STR_LEN + 1] = {0};
if (strlen(str) > 0) {
offset = snprintf(ascii_no, MAX_STR_LEN + 1, "%s", str);
}
ret = SUCCESS;
set_ime_status(INPUT_LOW_CASE);
clear_cache();
while (1) {
show_str(row, col, ascii_no);
key = get_keycode();
if (islower(key) || (key >= '0' && key <= '9')) {
if (offset < MAX_STR_LEN) {
sprintf(ascii_no + offset, "%c", (char)key);
offset ++;
}
} else {
switch (key) {
case ESC:
return -EUI_ESC;
case BACK:
if (offset > 0) {
ascii_no[offset - 1] = '\0';
offset --;
}
break;
case ENTER:
if (offset > 0) {
ret = SUCCESS;
goto handled;
}
break;
default:
break;
}
}
}
handled:
strcpy(str, ascii_no);
return ret;
}
开发者ID:LeonardoPhysh,项目名称:YB_IV,代码行数:57,代码来源:input.c
注:本文中的clear_cache函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论