本文整理汇总了C++中NOT_USED函数的典型用法代码示例。如果您正苦于以下问题:C++ NOT_USED函数的具体用法?C++ NOT_USED怎么用?C++ NOT_USED使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了NOT_USED函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: patricia__node_show_viz_rank
/* rank the nodes */
static error patricia__node_show_viz_rank(patricia__node_t *n, int level, void *opaque)
{
patricia__show_viz_args_t *args = opaque;
NOT_USED(level);
if (n->bit == args->rank)
(void) fprintf(args->f, "\t\t\"%p\"\n", (void *) n);
return error_OK;
}
开发者ID:Dinesh-Ramakrishnan,项目名称:Containers,代码行数:12,代码来源:show-viz.c
示例2: do_parse_widget
/**
* parse each widget
*
* @param w: pointer to widget
* @param m: no use
* @return: NULL
**/
static struct widget* do_parse_widget(struct widget* w, union message* m)
{
NOT_USED(m);
/**
* record focusable widget
**/
if(w->input_enable == 1)
{
list_push_back(&global_application.focus_list, &w, sizeof(w));
}
/**
* register window and update active window
**/
if(w->is_window)
{
struct window* parent = (struct window*)object_parent(OBJECT_POINTER(w));
struct window* window_ptr = WINDOW_POINTER(w);
si_t parent_descriptor = (parent == NULL ? 0 : parent->descriptor);
si_t window_descriptor = register_window(parent_descriptor, window_ptr->title,
window_ptr->area.x, window_ptr->area.y, window_ptr->area.width, window_ptr->area.height,
window_ptr->minimize_enable, window_ptr->maximize_enable, window_ptr->modal);
if(0 == window_descriptor)
{
EGUI_PRINT_ERROR("failed to register window %s", window_ptr->title);
return NULL;
}
window_ptr->descriptor = window_descriptor;
global_application.focus = window_ptr;
/**
* find icon for the application
**/
if((window_ptr->icon_path = (char*)malloc(256)) == NULL)
{
EGUI_PRINT_ERROR("failed to register window");
return NULL;
}
else
{
/**
* in C89 standard, snprintf() is NOT included in <stdio.h>
* so you have to use sprintf, which may be dangerous. be careful
**/
sprintf(window_ptr->icon_path, "%s/icons/%s.bmp", global_application.icon_root_path, global_application.name);
if(access(window_ptr->icon_path, R_OK) == -1)
{
sprintf(window_ptr->icon_path, "%s/icons/default.bmp", global_application.icon_root_path);
}
}
}
return NULL;
}
开发者ID:FangKuangKuang,项目名称:egui,代码行数:61,代码来源:exec.c
示例3: port
/*JSON{ "type":"method", "class": "Serial", "name" : "println",
"description" : "Print a line to the serial port (newline character sent are '\r\n')",
"generate" : "jswrap_serial_println",
"params" : [ [ "string", "JsVar", "A String to print"] ]
}*/
void _jswrap_serial_print(JsVar *parent, JsVar *str, bool newLine) {
NOT_USED(parent);
IOEventFlags device = jsiGetDeviceFromClass(parent);
str = jsvAsString(str, false);
jsiTransmitStringVar(device,str);
jsvUnLock(str);
if (newLine) {
jshTransmit(device, (unsigned char)'\r');
jshTransmit(device, (unsigned char)'\n');
}
}
开发者ID:AdrianHuang,项目名称:rt-thread-for-vmm,代码行数:16,代码来源:jswrap_serial.c
示例4: comm_ioctl
static
LONG
CDECL
comm_ioctl(FILEPTR * f,
WORD mode,
void * buf)
{
NOT_USED(f);
TRACE("srv_comm_device: ioctl");
return 0;
}
开发者ID:e8johan,项目名称:oaesis,代码行数:12,代码来源:srv_comm_device.c
示例5: ref_count_inc
direntry_t *direntry_copy (CALLER_DECL direntry_t *de)
{
unsigned refc = ref_count_inc( BASE_CLASS(de)->ref_count );
NOT_USED(refc);
direntry_trace("[direntry %p inode %lu] copy (" CALLER_FORMAT ") ref %u\n",
de, de->inode, CALLER_PASS refc);
return de;
}
开发者ID:mt-inside,项目名称:fsfuse,代码行数:12,代码来源:direntry.c
示例6: comm_unselect
static
LONG
CDECL
comm_unselect(FILEPTR * f,
LONG p,
WORD mode)
{
NOT_USED(f);
TRACE("srv_comm_device: unselect");
return 0;
}
开发者ID:e8johan,项目名称:oaesis,代码行数:12,代码来源:srv_comm_device.c
示例7: DHCP
/*JSON{
"type" : "method",
"class" : "ESPWifi",
"name" : "setIP",
"generate" : "jswrap_esp8266_setIP",
"params" : [
["options","JsVar","Object containing IP address options `{ ip : '1,2,3,4', subnet, gateway, dns }`, or do not supply an object in otder to force DHCP."]
],
"return" : ["bool","True on success"]
}
Set the current IP address for get an IP from DHCP (if no options object is specified)
*/
bool jswrap_esp8266_setIP(JsVar *wlanObj, JsVar *options) {
NOT_USED(wlanObj);
if (networkState != NETWORKSTATE_ONLINE) {
jsError("Not connected to the internet");
return false;
}
bool success = false;
return success;
}
开发者ID:ARMinARM,项目名称:Espruino,代码行数:24,代码来源:jswrap_esp8266.c
示例8: adjust_bobs
static error adjust_bobs(filerwin *fw,
int x,
int y,
int c,
unsigned int flags,
void *opaque)
{
os_box b;
NOT_USED(x);
NOT_USED(y);
NOT_USED(flags);
NOT_USED(opaque);
bitvec_toggle(fw->selection, c);
index_to_area(fw, c, &b);
wimp_force_redraw(fw->w, b.x0, b.y0, b.x1, b.y1);
return error_OK;
}
开发者ID:dpt,项目名称:PrivateEye,代码行数:21,代码来源:filerwin.c
示例9: get_dimensions_walk
static error get_dimensions_walk(treeview_t *tr,
int depth,
int x,
int y,
ntree_t *t,
connector_flags flags,
int index,
txtfmt_t *tx,
int height,
void *opaque)
{
treeview_get_dimensions_data *data = opaque;
int width;
NOT_USED(tr);
NOT_USED(y);
NOT_USED(t);
NOT_USED(flags);
NOT_USED(index);
NOT_USED(height);
width = x;
width += (depth + 1) * tr->line_height;
width += 16 * txtfmt_get_wrapped_width(tx);
width += 16; /* add another character's worth of space to allow for Wimp
text padding */
if (width > data->width)
data->width = width;
return error_OK;
}
开发者ID:dpt,项目名称:PrivateEye,代码行数:31,代码来源:treeview.c
示例10: click_walk
static error click_walk(treeview_t *tr,
int depth,
int x,
int y,
ntree_t *t,
connector_flags flags,
int index,
txtfmt_t *tx,
int height,
void *opaque)
{
treeview_click_data *data = opaque;
os_box box;
NOT_USED(tr);
NOT_USED(t);
NOT_USED(flags);
NOT_USED(index);
NOT_USED(tx);
NOT_USED(height);
/* hit detect */
box.x0 = x + depth * tr->line_height;
box.y0 = y;
box.x1 = box.x0 + tr->line_height;
box.y1 = box.y0 + tr->line_height;
if (box_contains_point(&box, data->x, data->y))
/* exiting here means that tr->walk.x and y are valid */
return error_TREEVIEW_FOUND;
else
return error_OK;
}
开发者ID:dpt,项目名称:PrivateEye,代码行数:34,代码来源:treeview.c
示例11: USBD_CDC_HID_Init
/**
* @brief USBD_CDC_HID_Init
* Initialize the CDC interface
* @param pdev: device instance
* @param cfgidx: Configuration index
* @retval status
*/
static uint8_t USBD_CDC_HID_Init (USBD_HandleTypeDef *pdev,
uint8_t cfgidx)
{
pdev->pClassData = &cdc_hid;
USBD_CDC_HID_HandleTypeDef *handle = (USBD_CDC_HID_HandleTypeDef*) pdev->pClassData;
NOT_USED(cfgidx);
uint8_t ret = 0;
/* Open EP IN */
USBD_LL_OpenEP(pdev,
CDC_IN_EP,
USBD_EP_TYPE_BULK,
CDC_DATA_FS_IN_PACKET_SIZE);
/* Open EP OUT */
USBD_LL_OpenEP(pdev,
CDC_OUT_EP,
USBD_EP_TYPE_BULK,
CDC_DATA_FS_OUT_PACKET_SIZE);
/* Open Command IN EP */
USBD_LL_OpenEP(pdev,
CDC_CMD_EP,
USBD_EP_TYPE_INTR,
CDC_CMD_PACKET_SIZE);
/* Init Xfer states */
handle->cdcState = CDC_IDLE;
/* Prepare Out endpoint to receive next packet */
USBD_LL_PrepareReceive(pdev,
CDC_OUT_EP,
handle->cdcRX,
CDC_DATA_FS_OUT_PACKET_SIZE);
#ifdef USE_USB_HID
unsigned int reportSize = 0;
handle->hidReportDesc = USB_GetHIDReportDesc(&reportSize);
handle->hidReportDescSize = (uint16_t)reportSize;
/* Open HID EP IN - even if we're not using it */
USBD_LL_OpenEP(pdev,
HID_IN_EP,
USBD_EP_TYPE_INTR,
HID_DATA_IN_PACKET_SIZE);
handle->hidState = HID_IDLE;
#endif
return ret;
}
开发者ID:8bitgeek,项目名称:Espruino,代码行数:59,代码来源:usbd_cdc_hid.c
示例12: afterwards
/*JSON{
"type" : "method",
"class" : "SPI",
"name" : "send4bit",
"generate" : "jswrap_spi_send4bit",
"params" : [
["data","JsVar","The data to send - either an integer, array, or string"],
["bit0","int32","The 4 bits to send for a 0 (MSB first)"],
["bit1","int32","The 4 bits to send for a 1 (MSB first)"],
["nss_pin","pin","An nSS pin - this will be lowered before SPI output and raised afterwards (optional). There will be a small delay between when this is lowered and when sending starts, and also between sending finishing and it being raised."]
]
}
Send data down SPI, using 4 bits for each 'real' bit (MSB first). This can be useful for faking one-wire style protocols
Sending multiple bytes in one call to send is preferable as they can then be transmitted end to end. Using multiple calls to send() will result in significantly slower transmission speeds.
*/
void jswrap_spi_send4bit(JsVar *parent, JsVar *srcdata, int bit0, int bit1, Pin nss_pin) {
NOT_USED(parent);
IOEventFlags device = jsiGetDeviceFromClass(parent);
if (!DEVICE_IS_SPI(device)) {
jsExceptionHere(JSET_ERROR, "SPI.send4bit only works on hardware SPI");
return;
}
jshSPISet16(device, true); // 16 bit output
if (bit0==0 && bit1==0) {
bit0 = 0x01;
bit1 = 0x03;
}
bit0 = bit0 & 0x0F;
bit1 = bit1 & 0x0F;
if (!jshIsDeviceInitialised(device)) {
JshSPIInfo inf;
jshSPIInitInfo(&inf);
jshSPISetup(device, &inf);
}
// we're just sending (no receive)
jshSPISetReceive(device, false);
// assert NSS
if (nss_pin!=PIN_UNDEFINED) jshPinOutput(nss_pin, false);
// send data
if (jsvIsNumeric(srcdata)) {
jsspiSend4bit(device, (unsigned char)jsvGetInteger(srcdata), bit0, bit1);
} else if (jsvIsIterable(srcdata)) {
jshInterruptOff();
JsvIterator it;
jsvIteratorNew(&it, srcdata);
while (jsvIteratorHasElement(&it)) {
unsigned char in = (unsigned char)jsvIteratorGetIntegerValue(&it);
jsspiSend4bit(device, in, bit0, bit1);
jsvIteratorNext(&it);
}
jsvIteratorFree(&it);
jshInterruptOn();
} else {
jsExceptionHere(JSET_ERROR, "Variable type %t not suited to transmit operation", srcdata);
}
jshSPIWait(device); // wait until SPI send finished and clear the RX buffer
// de-assert NSS
if (nss_pin!=PIN_UNDEFINED) jshPinOutput(nss_pin, true);
jshSPISet16(device, false); // back to 8 bit
}
开发者ID:RobinLin,项目名称:Espruino,代码行数:68,代码来源:jswrap_spi_i2c.c
示例13: _jswrap_serial_print
void _jswrap_serial_print(JsVar *parent, JsVar *arg, bool isPrint, bool newLine) {
NOT_USED(parent);
IOEventFlags device = jsiGetDeviceFromClass(parent);
if (!DEVICE_IS_USART(device)) return;
if (isPrint) arg = jsvAsString(arg, false);
jsvIterateCallback(arg, _jswrap_serial_print_cb, (void*)&device);
if (isPrint) jsvUnLock(arg);
if (newLine) {
_jswrap_serial_print_cb((unsigned char)'\r', (void*)&device);
_jswrap_serial_print_cb((unsigned char)'\n', (void*)&device);
}
}
开发者ID:RepRapThailand,项目名称:Espruino,代码行数:13,代码来源:jswrap_serial.c
示例14: do_dispatch_repaint_event_to_all
static struct widget* do_dispatch_repaint_event_to_all(struct widget* w, union message* msg)
{
NOT_USED(msg);
if(w->callback != NULL)
{
union message msg;
msg.widget_repaint.type = MESSAGE_TYPE_WIDGET_REPAINT;
msg.widget_repaint.area = w->area;
w->callback(w, &msg);
}
return NULL;
}
开发者ID:FangKuangKuang,项目名称:egui,代码行数:13,代码来源:exec.c
示例15: b_let
int b_let(int argc,char *argv[],void *extra)
{
register int r;
register char *arg;
NOT_USED(argc);
NOT_USED(extra);
while (r = optget(argv,sh_optlet)) switch (r)
{
case ':':
errormsg(SH_DICT,2, "%s", opt_info.arg);
break;
case '?':
errormsg(SH_DICT,ERROR_usage(2), "%s", opt_info.arg);
break;
}
argv += opt_info.index;
if(error_info.errors || !*argv)
errormsg(SH_DICT,ERROR_usage(2),"%s",optusage((char*)0));
while(arg= *argv++)
r = !sh_arith(arg);
return(r);
}
开发者ID:apprisi,项目名称:illumos-gate,代码行数:22,代码来源:misc.c
示例16: command_handler
/**
* 对标准输入的写操作将触发的回调函数
* 即event_listener_add_write_handler()中标准输入的通信句柄所对应的处理函数
*
* 读取命令,调用对应函数发送请求
* 1. $0 draw_line x1 y1 x2 y2
* 2. $0 register_window fd title
* 3. $0 window_manager_exit
**/
si_t command_handler(struct egui_uds* uds_ptr, addr_t arg)
{
char command_buf[1024];
struct egui_uds* server_uds_ptr = (struct egui_uds*)arg;
const char draw_line_command[] = "draw_line";
const char register_window_command[] = "register_window";
const char window_manager_exit_command[] = "window_manager_exit";
NOT_USED(uds_ptr);
EGUI_PRINT_INFO("callback command_handler() is called");
scanf("%s", command_buf);
if(0 == strncmp(command_buf, draw_line_command, sizeof(draw_line_command)))
{
si_t x1 = 0, y1 = 0, x2 = 0, y2 = 0;
EGUI_PRINT_INFO("get draw_line_command");
scanf("%d%d%d%d", (int*)&x1, (int*)&y1, (int*)&x2, (int*)&y2);
if(0 != fake_draw_line(server_uds_ptr, x1, y1, x2, y2))
{
EGUI_PRINT_ERROR("failed to execute draw line command");
}
}
else if(0 == strncmp(command_buf, register_window_command, sizeof(register_window_command)))
{
si_t fd = 0;
char title_buf[1024] = {0};
EGUI_PRINT_INFO("get register_window_command");
scanf("%d%s", (int*)&fd, title_buf);
if(0 != fake_register_window(server_uds_ptr, fd, title_buf))
{
EGUI_PRINT_ERROR("failed to execute register window command");
}
}
else if(0 == strncmp(command_buf, window_manager_exit_command, sizeof(window_manager_exit_command)))
{
EGUI_PRINT_INFO("get window_manager_exit_command");
if(0 != fake_window_manager_exit(server_uds_ptr))
{
EGUI_PRINT_ERROR("failed to execute window manager exit command");
}
/** 如果用户输入退出窗口管理器的命令,那么客户端的程序也应当退出 **/
return SELECTER_RETURN_TYPE_END;
}
else
{
EGUI_PRINT_ERROR("unknow command %s", command_buf);
EGUI_PRINT_INFO(help_str);
}
return SELECTER_RETURN_TYPE_CONTINUE;
}
开发者ID:FangKuangKuang,项目名称:egui,代码行数:60,代码来源:test_client.c
示例17: kzalloc
void *vpu_clock_init(struct vpu_platform_resources *res)
{
int i;
struct vpu_clock *cl;
struct vpu_clk_control *clk_ctrl;
if (!res)
return NULL;
clk_ctrl = (struct vpu_clk_control *)
kzalloc(sizeof(struct vpu_clk_control), GFP_KERNEL);
if (!clk_ctrl) {
pr_err("failed to allocate clock ctrl block\n");
return NULL;
}
for (i = 0; i < VPU_MAX_CLKS; i++)
clk_ctrl->clock[i] = &res->clock[i];
/* mask allowing to only enable clocks from certain groups of clocks */
clk_ctrl->mask = CLOCK_CORE;
/* setup the clock handles */
for (i = 0; i < VPU_MAX_CLKS; i++) {
if (NOT_USED(clk_ctrl, i))
continue;
cl = clk_ctrl->clock[i];
if (CLOCK_IS_SCALABLE(clk_ctrl, i) && !cl->pwr_frequencies) {
pr_err("%s pwr frequencies unknown\n", cl->name);
goto fail_init_clocks;
}
cl->clk = devm_clk_get(&res->pdev->dev, cl->name);
if (IS_ERR_OR_NULL(cl->clk)) {
pr_err("Failed to get clock: %s\n", cl->name);
cl->clk = NULL;
goto fail_init_clocks;
}
cl->status = 0;
}
return clk_ctrl;
fail_init_clocks:
vpu_clock_deinit((void *)clk_ctrl);
kfree(clk_ctrl);
return NULL;
}
开发者ID:AD5GB,项目名称:kernel_n5_3.10-experimental,代码行数:50,代码来源:vpu_bus_clock.c
示例18: my_walk_fn
static int my_walk_fn(const void *key, const void *value, void *opaque)
{
char kbuf[256];
char vbuf[256];
NOT_USED(opaque);
cheese_format_key(key, kbuf, sizeof(kbuf), NULL);
cheese_format_value(value, vbuf, sizeof(vbuf), NULL);
printf("walk '%s':'%s'...\n", kbuf, vbuf);
return 0;
}
开发者ID:dpt,项目名称:DPTLib,代码行数:14,代码来源:pickle-test.c
示例19: tags_search_event_mouse_click
static int tags_search_event_mouse_click(wimp_event_no event_no,
wimp_block *block,
void *handle)
{
wimp_pointer *pointer;
NOT_USED(event_no);
NOT_USED(handle);
pointer = &block->pointer;
if (pointer->buttons & (wimp_CLICK_SELECT | wimp_CLICK_ADJUST))
{
switch (pointer->i)
{
case TAGS_SEARCH_B_SEARCH:
tags_search_search();
break;
case TAGS_SEARCH_B_CANCEL:
break;
}
if (pointer->i == TAGS_SEARCH_B_SEARCH ||
pointer->i == TAGS_SEARCH_B_CANCEL)
{
#if 0
if (pointer->buttons & wimp_CLICK_SELECT)
tags_search_close_dialogue();
else
tags_search_update_dialogue();
#endif
}
}
return event_HANDLED;
}
开发者ID:dpt,项目名称:PrivateEye,代码行数:37,代码来源:tags-search.c
示例20: sse50etf_exec
static int sse50etf_exec(void *data, void *data2) {
RAII_VAR(struct msg *, msg, (struct msg *)data, msg_decr);
Quote *quote = (Quote *)msg->data;
struct wp *wp;
NOT_USED(data2);
if (isnan(cru) || isnan(ecc)) {
xcb_log(XCB_LOG_WARNING, "No valid value for CRU or ECC");
goto end;
}
table_lock(contracts);
if ((wp = table_get_value(contracts, quote->thyquote.m_cHYDM)) &&
(isnan(wp->price) || fabs(wp->price - quote->thyquote.m_dZXJ) > 0.000001)) {
table_iter_t iter;
table_node_t node;
double sum = 0.0;
time_t t = (time_t)quote->thyquote.m_nTime;
struct tm lt;
char datestr[64], res[512];
if (wp->type == 2) {
table_unlock(contracts);
goto end;
}
wp->price = quote->thyquote.m_dZXJ;
iter = table_iter_new(contracts);
while ((node = table_next(iter))) {
wp = table_node_value(node);
if (isnan(wp->price)) {
xcb_log(XCB_LOG_WARNING, "No price info for '%s'", table_node_key(node));
table_iter_free(&iter);
table_unlock(contracts);
goto end;
}
sum += wp->weight * wp->price;
}
table_iter_free(&iter);
strftime(datestr, sizeof datestr, "%F %T", localtime_r(&t, <));
snprintf(res, sizeof res, "SSE50ETF,%s.%03d|%f",
datestr,
quote->m_nMSec,
(sum + ecc) / cru);
out2rmp(res);
}
table_unlock(contracts);
end:
return 0;
}
开发者ID:wang-shun,项目名称:xcb-modules,代码行数:49,代码来源:app_sse50etf.c
注:本文中的NOT_USED函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论