本文整理汇总了C++中UNUSED函数的典型用法代码示例。如果您正苦于以下问题:C++ UNUSED函数的具体用法?C++ UNUSED怎么用?C++ UNUSED使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了UNUSED函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: timer_callback
void timer_callback(registers_t* regs) {
UNUSED(regs);
current_tick++;
}
示例2: HMI_SetContrast
/**
* \fn void HMI_SetContrast(UINT8 contrast)
* \brief Sets the contrast of the display
* \param contrast contrast a value between 0 and 63
*/
void HMI_SetContrast(UINT8 contrast)
{
UNUSED(LCD_SetContrast(contrast));
}
示例3: ArgCheckCount
Bool ArgCheckCount(Arg arg) {
UNUSED(arg); /* TODO: Add and call CountCheck */
return TRUE;
}
示例4: ATF_TC_BODY
ATF_TC_BODY(symtab_grow, tc) {
isc_result_t result;
isc_symtab_t *st = NULL;
isc_symvalue_t value;
isc_symexists_t policy = isc_symexists_reject;
int i;
UNUSED(tc);
result = isc_test_begin(NULL, ISC_TRUE);
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
result = isc_symtab_create(mctx, 3, undefine, NULL, ISC_FALSE, &st);
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
ATF_REQUIRE(st != NULL);
/* Nothing should be in the table yet */
/*
* Put 1024 entries in the table (this should necessate
* regrowing the hash table several times
*/
for (i = 0; i < 1024; i++) {
char str[16], *key;
snprintf(str, sizeof(str), "%04x", i);
key = isc_mem_strdup(mctx, str);
ATF_REQUIRE(key != NULL);
value.as_pointer = isc_mem_strdup(mctx, str);
ATF_REQUIRE(value.as_pointer != NULL);
result = isc_symtab_define(st, key, 1, value, policy);
ATF_CHECK_EQ(result, ISC_R_SUCCESS);
if (result != ISC_R_SUCCESS)
undefine(key, 1, value, NULL);
}
/*
* Try to put them in again; this should fail
*/
for (i = 0; i < 1024; i++) {
char str[16], *key;
snprintf(str, sizeof(str), "%04x", i);
key = isc_mem_strdup(mctx, str);
ATF_REQUIRE(key != NULL);
value.as_pointer = isc_mem_strdup(mctx, str);
ATF_REQUIRE(value.as_pointer != NULL);
result = isc_symtab_define(st, key, 1, value, policy);
ATF_CHECK_EQ(result, ISC_R_EXISTS);
undefine(key, 1, value, NULL);
}
/*
* Retrieve them; this should succeed
*/
for (i = 0; i < 1024; i++) {
char str[16];
snprintf(str, sizeof(str), "%04x", i);
result = isc_symtab_lookup(st, str, 0, &value);
ATF_CHECK_EQ(result, ISC_R_SUCCESS);
ATF_CHECK_STREQ(str, (char *)value.as_pointer);
}
/*
* Undefine them
*/
for (i = 0; i < 1024; i++) {
char str[16];
snprintf(str, sizeof(str), "%04x", i);
result = isc_symtab_undefine(st, str, 1);
ATF_CHECK_EQ(result, ISC_R_SUCCESS);
}
/*
* Retrieve them again; this should fail
*/
for (i = 0; i < 1024; i++) {
char str[16];
snprintf(str, sizeof(str), "%04x", i);
result = isc_symtab_lookup(st, str, 0, &value);
ATF_CHECK_EQ(result, ISC_R_NOTFOUND);
}
isc_symtab_destroy(&st);
isc_test_end();
}
示例5: __lseek
/*! \brief This routine is required by IAR DLIB library since EWAVR V6.10
* the implementation is empty to be compatible with old IAR version.
*/
long __lseek(int handle, long val, int val2)
{
UNUSED(handle);
UNUSED(val2);
return val;
}
示例6: flush
static isc_result_t
flush(dns_zone_t *zone, void *uap) {
UNUSED(uap);
return (dns_zone_flush(zone));
}
示例7: __close
/*! \brief This routine is required by IAR DLIB library since EWAVR V6.10
* the implementation is empty to be compatible with old IAR version.
*/
int __close(int handle)
{
UNUSED(handle);
return 0;
}
示例8: remove
/*! \brief This routine is required by IAR DLIB library since EWAVR V6.10
* the implementation is empty to be compatible with old IAR version.
*/
int remove(const char* val)
{
UNUSED(val);
return 0;
}
示例9: main
int main(int argc, char **argv) {
UNUSED(argv);
// dox_hooks_install();
struct rlimit memlim;
memlim.rlim_cur = 4 * GB;
memlim.rlim_max = memlim.rlim_cur;
setrlimit(RLIMIT_AS, &memlim);
ppk_print_init();
dox_texts_init(&texts);
dox_store_t *store = dox_store_new("/home/dirk/tmp/dox");
assert (store != NULL);
dox_store_scan(store, iter_callback, NULL);
if (texts.count == 0)
goto unstore;
// dox_mindex_t *mindex = dox_mindex_new_flags(DOX_MINDEX_DELTA);
dox_mindex_t *mindex = dox_mindex_new_flags(DOX_MINDEX_ABSOLUTE);
// dox_mindex_t *mindex = dox_mindex_new_flags(DOX_MINDEX_ABSOLUTE | DOX_MINDEX_DELTA);
// dox_mindex_t *mindex = dox_mindex_new_flags(0);
assert (mindex != NULL);
uint32_t total_bit_widths = 0;
int64_t time0 = ppk_time_get_ns();
for (int i = 0; i < texts.count; i++) {
const dox_text_t *text = texts.items + i;
total_bit_widths += dox_text_bit_width(text);
int ret = dox_mindex_add(mindex, text);
if (ret != 0) {
printf("Mindex now full\n\n");
break;
}
}
int64_t time1 = ppk_time_get_ns();
printf("Indexed %lu MiB in %ld ms (%ld us per text)\n\n",
(total_size * sizeof(dox_word_t)) / PPK_MiB,
(long) ((time1 - time0) / PPK_MILLION),
(long) ((time1 - time0) / (PPK_THOUSAND * texts.count)));
printf("Average of %d bits per word\n",
(int) (total_bit_widths / texts.count));
dox_mindex_make_skip(mindex);
dox_mindex_print_memory(mindex);
dox_copies_t copies;
dox_copies_init(&copies);
unsigned long total_copies = 0;
time0 = ppk_time_get_ns();
for (int i = 0; i < texts.count; i++) {
copies.count = 0;
dox_mindex_get(mindex, &copies, texts.items + i, DOX_INDEX_SMART);
total_copies += copies.count;
if (total_copies < (unsigned long) copies.count)
printf("\nCopy count wrapped after text %d\n", i);
uint32_t done = i + 1;
if ((texts.count - done) % 100 == 0) {
time1 = ppk_time_get_ns();
int64_t timed = time1 - time0;
int64_t pertext = timed / (done * PPK_MILLION);
printf("\r%d/%d (%d%%), %lu ms per text",
done, texts.count, ppk_percent(done, texts.count),
(unsigned long) pertext);
fflush(stdout);
}
}
printf("\n");
time1 = ppk_time_get_ns();
printf("\nSearched %d texts in %lu ms, %lu copies\n",
texts.count,
(unsigned long) ((time1 - time0) / PPK_MILLION),
total_copies);
printf(" (%lu ms per text, %lu us per word, %lu us per copy)\n",
//.........这里部分代码省略.........
示例10: mock_chdir
int
mock_chdir( char *path ) {
UNUSED( path );
return ( int ) mock();
}
示例11: mock_warn
void
mock_warn( const char *format, ... ) {
UNUSED( format );
}
示例12: ArgCheckSize
Bool ArgCheckSize(Arg arg) {
UNUSED(arg); /* TODO: Add and call SizeCheck */
return TRUE;
}
示例13: dothecall
static void dothecall (lua_State *L, void *ud) {
UNUSED(ud);
luaD_callnoyield(L, L->top - 2, 0);
}
示例14: ArgCheckAddr
Bool ArgCheckAddr(Arg arg) {
UNUSED(arg); /* TODO: Add and call AddrCheck */
return TRUE;
}
示例15: error_pipe_cb
static void error_pipe_cb(liEventBase *watcher, int events) {
liErrorPipe *epipe = LI_CONTAINER_OF(li_event_io_from(watcher), liErrorPipe, fd_watcher);
UNUSED(events);
read_pipe(epipe->srv, epipe, FALSE);
}