本文整理汇总了C++中UNUSED_PARAMETER函数的典型用法代码示例。如果您正苦于以下问题:C++ UNUSED_PARAMETER函数的具体用法?C++ UNUSED_PARAMETER怎么用?C++ UNUSED_PARAMETER使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了UNUSED_PARAMETER函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UNUSED_PARAMETER
double
PHEMCEP::GetMaxAccel(double v, double a, double gradient) const {
UNUSED_PARAMETER(a);
const double pMaxForAcc = GetPMaxNorm(v) * _ratedPower - PHEMCEP::CalcPower(v, 0, gradient);
return (pMaxForAcc * 1000) / ((_massVehicle * GetRotationalCoeffecient(v) + _massRot + _vehicleLoading) * v);
}
示例2: UNUSED_PARAMETER
static const char *obs_qsv_getname(void *type_data)
{
UNUSED_PARAMETER(type_data);
return "QuickSync H.264";
}
示例3: xshm_server_changed
/**
* The x server was changed
*/
static bool xshm_server_changed(obs_properties_t *props,
obs_property_t *p, obs_data_t *settings)
{
UNUSED_PARAMETER(p);
bool advanced = obs_data_get_bool(settings, "advanced");
int_fast32_t old_screen = obs_data_get_int(settings, "screen");
const char *server = obs_data_get_string(settings, "server");
obs_property_t *screens = obs_properties_get(props, "screen");
/* we want a real NULL here in case there is no string here */
server = (advanced && *server) ? server : NULL;
obs_property_list_clear(screens);
xcb_connection_t *xcb = xcb_connect(server, NULL);
if (!xcb || xcb_connection_has_error(xcb)) {
obs_property_set_enabled(screens, false);
return true;
}
struct dstr screen_info;
dstr_init(&screen_info);
bool xinerama = xinerama_is_active(xcb);
int_fast32_t count = (xinerama) ?
xinerama_screen_count(xcb) :
xcb_setup_roots_length(xcb_get_setup(xcb));
for (int_fast32_t i = 0; i < count; ++i) {
int_fast32_t x, y, w, h;
x = y = w = h = 0;
if (xinerama)
xinerama_screen_geo(xcb, i, &x, &y, &w, &h);
else
x11_screen_geo(xcb, i, &w, &h);
dstr_printf(&screen_info, "Screen %"PRIuFAST32" (%"PRIuFAST32
"x%"PRIuFAST32" @ %"PRIuFAST32
",%"PRIuFAST32")", i, w, h, x, y);
obs_property_list_add_int(screens, screen_info.array, i);
}
/* handle missing screen */
if (old_screen + 1 > count) {
dstr_printf(&screen_info, "Screen %"PRIuFAST32" (not found)",
old_screen);
size_t index = obs_property_list_add_int(screens,
screen_info.array, old_screen);
obs_property_list_item_disable(screens, index, true);
}
dstr_free(&screen_info);
xcb_disconnect(xcb);
obs_property_set_enabled(screens, true);
return true;
}
示例4: getWindowPid
int getWindowPid(Window win)
{
UNUSED_PARAMETER(win);
return 1234; //TODO
}
示例5: UNUSED_PARAMETER
static obs_properties_t *ffmpeg_source_getproperties(void *data)
{
struct ffmpeg_source *s = data;
struct dstr filter = {0};
struct dstr path = {0};
UNUSED_PARAMETER(data);
obs_properties_t *props = obs_properties_create();
obs_properties_set_flags(props, OBS_PROPERTIES_DEFER_UPDATE);
obs_property_t *prop;
// use this when obs allows non-readonly paths
prop = obs_properties_add_bool(props, "is_local_file",
obs_module_text("LocalFile"));
obs_property_set_modified_callback(prop, is_local_file_modified);
dstr_copy(&filter, obs_module_text("MediaFileFilter.AllMediaFiles"));
dstr_cat(&filter, media_filter);
dstr_cat(&filter, obs_module_text("MediaFileFilter.VideoFiles"));
dstr_cat(&filter, video_filter);
dstr_cat(&filter, obs_module_text("MediaFileFilter.AudioFiles"));
dstr_cat(&filter, audio_filter);
dstr_cat(&filter, obs_module_text("MediaFileFilter.AllFiles"));
dstr_cat(&filter, " (*.*)");
if (s && s->input && *s->input) {
const char *slash;
dstr_copy(&path, s->input);
dstr_replace(&path, "\\", "/");
slash = strrchr(path.array, '/');
if (slash)
dstr_resize(&path, slash - path.array + 1);
}
obs_properties_add_path(props, "local_file",
obs_module_text("LocalFile"), OBS_PATH_FILE,
filter.array, path.array);
dstr_free(&filter);
dstr_free(&path);
obs_properties_add_bool(props, "looping", obs_module_text("Looping"));
obs_properties_add_bool(props, "restart_on_activate",
obs_module_text("RestartWhenActivated"));
obs_properties_add_text(props, "input",
obs_module_text("Input"), OBS_TEXT_DEFAULT);
obs_properties_add_text(props, "input_format",
obs_module_text("InputFormat"), OBS_TEXT_DEFAULT);
obs_properties_add_bool(props, "hw_decode",
obs_module_text("HardwareDecode"));
obs_properties_add_bool(props, "clear_on_media_end",
obs_module_text("ClearOnMediaEnd"));
prop = obs_properties_add_bool(props, "advanced",
obs_module_text("Advanced"));
obs_property_set_modified_callback(prop, is_advanced_modified);
obs_properties_add_bool(props, "force_scale",
obs_module_text("ForceFormat"));
prop = obs_properties_add_int(props, "audio_buffer_size",
obs_module_text("AudioBufferSize"), 1, 9999, 1);
obs_property_set_visible(prop, false);
prop = obs_properties_add_int(props, "video_buffer_size",
obs_module_text("VideoBufferSize"), 1, 9999, 1);
obs_property_set_visible(prop, false);
prop = obs_properties_add_list(props, "frame_drop",
obs_module_text("FrameDropping"), OBS_COMBO_TYPE_LIST,
OBS_COMBO_FORMAT_INT);
obs_property_list_add_int(prop, obs_module_text("DiscardNone"),
AVDISCARD_NONE);
obs_property_list_add_int(prop, obs_module_text("DiscardDefault"),
AVDISCARD_DEFAULT);
obs_property_list_add_int(prop, obs_module_text("DiscardNonRef"),
AVDISCARD_NONREF);
obs_property_list_add_int(prop, obs_module_text("DiscardBiDir"),
AVDISCARD_BIDIR);
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55, 67, 100)
obs_property_list_add_int(prop, obs_module_text("DiscardNonIntra"),
AVDISCARD_NONINTRA);
#endif
obs_property_list_add_int(prop, obs_module_text("DiscardNonKey"),
AVDISCARD_NONKEY);
obs_property_list_add_int(prop, obs_module_text("DiscardAll"),
AVDISCARD_ALL);
obs_property_set_visible(prop, false);
//.........这里部分代码省略.........
示例6: rwl_open_serial
static int
rwl_open_serial(int remote_type, char *port)
{
struct termios tio;
int fCom, speed;
long BAUD, DATABITS, STOPBITS, PARITYON;
speed_t baud_rate;
DPRINT_DBG(OUTPUT, "\n rwl_open_serial:%s\n", port);
if (remote_type == REMOTE_DONGLE)
fCom = open(port, O_RDWR | O_NOCTTY | O_NDELAY);
else
fCom = open(port, O_RDWR | O_NOCTTY | O_NDELAY | O_SYNC);
if (fCom < 0) {
DPRINT_ERR(ERR, "open COM failed with error %d.\n", errno);
return fCom;
} else {
/* To make the read as a blocking operation */
fcntl(fCom, F_SETFL, 0);
}
bzero(&tio, sizeof(tio));
/* Get the current option for the port... */
tcgetattr(fCom, &tio);
/* Set the baud rate */
cfsetispeed(&tio, B115200);
cfsetospeed(&tio, B115200);
if (remote_type == REMOTE_DONGLE) {
if (tcsetattr(fCom, TCSANOW, &tio) < 0) {
perror("tcsetattr:setspeed");
return FAIL;
}
baud_rate = cfgetospeed(&tio);
if (baud_rate == B115200)
speed = BAUD_RATE_115200;
DPRINT_DBG(OUTPUT, "Baud_rate set is:%d\n", speed);
BAUD = B115200;
DATABITS = CS8;
STOPBITS = 1;
PARITYON = 0;
tio.c_cflag = BAUD | DATABITS | STOPBITS | PARITYON | CLOCAL | CREAD;
tio.c_iflag = IGNPAR;
tio.c_oflag = 0;
tio.c_lflag = 0;
tio.c_cc[VMIN] = VMIN_VAL;
tio.c_cc[VTIME] = VTIME_VAL;
tcflush(fCom, TCIOFLUSH);
if (tcsetattr(fCom, TCSANOW, &tio) < 0) {
perror("tcsetattr:");
return FAIL;
}
if (tcgetattr(fCom, &tio) < 0) {
perror("tcgetattr:");
return FAIL;
}
DPRINT_DBG(OUTPUT, "tcgetattr:VMIN is:%d\n", tio.c_cc[VMIN]);
DPRINT_DBG(OUTPUT, "tcgetattr:VTIME is:%d\n", tio.c_cc[VTIME]);
tcflush(fCom, TCIOFLUSH);
}
else {
UNUSED_PARAMETER(PARITYON);
UNUSED_PARAMETER(STOPBITS);
UNUSED_PARAMETER(DATABITS);
UNUSED_PARAMETER(BAUD);
UNUSED_PARAMETER(baud_rate);
UNUSED_PARAMETER(speed);
/* Enable the receiver and set local mode */
tio.c_cflag |= (CLOCAL | CREAD);
tio.c_cflag &= ~PARENB;
tio.c_cflag &= ~CSTOPB;
tio.c_cflag &= ~CSIZE;
tio.c_cflag |= CS8;
tio.c_cc[VTIME] = 255;
tio.c_cc[VMIN] = 1;
tio.c_iflag = 0;
tio.c_iflag |= IGNBRK;
tio.c_oflag &= ~OPOST;
tio.c_oflag &= ~OLCUC;
tio.c_oflag &= ~ONLCR;
tio.c_oflag &= ~OCRNL;
tio.c_oflag &= ~ONOCR;
tio.c_oflag &= ~ONLRET;
tio.c_oflag &= ~OFILL;
tio.c_lflag &= ~ICANON;
tio.c_lflag &= ~ISIG;
tio.c_lflag &= ~XCASE;
tio.c_lflag &= ~ECHO;
tio.c_lflag &= ~FLUSHO;
tio.c_lflag &= ~IEXTEN;
//.........这里部分代码省略.........
示例7: UNUSED_PARAMETER
static const char *opus_getname(void *unused)
{
UNUSED_PARAMETER(unused);
return obs_module_text("FFmpegOpus");
}
示例8: obstudio_infowriter_get_height
uint32_t obstudio_infowriter_get_height(void *data)
{
UNUSED_PARAMETER(data);
return 0;
}
示例9: UNUSED_PARAMETER
const char *obstudio_infowriter_get_name(void *type_data)
{
UNUSED_PARAMETER(type_data);
return infowriter_idname;
}
示例10: xshm_getname
/**
* Returns the name of the plugin
*/
static const char* xshm_getname(void *unused)
{
UNUSED_PARAMETER(unused);
return obs_module_text("X11SharedMemoryScreenInput");
}
示例11: renameTriggerFunc
/* This function is used by SQL generated to implement the
** ALTER TABLE command. The first argument is the text of a CREATE TRIGGER
** statement. The second is a table name. The table name in the CREATE
** TRIGGER statement is replaced with the third argument and the result
** returned. This is analagous to renameTableFunc() above, except for CREATE
** TRIGGER, not CREATE INDEX and CREATE TABLE.
*/
static void renameTriggerFunc(
sqlite3_context *context,
int NotUsed,
sqlite3_value **argv
){
unsigned char const *zSql = sqlite3_value_text(argv[0]);
unsigned char const *zTableName = sqlite3_value_text(argv[1]);
int token;
Token tname;
int dist = 3;
unsigned char const *zCsr = zSql;
int len = 0;
char *zRet;
sqlite3 *db = sqlite3_context_db_handle(context);
UNUSED_PARAMETER(NotUsed);
/* The principle used to locate the table name in the CREATE TRIGGER
** statement is that the table name is the first token that is immediatedly
** preceded by either TK_ON or TK_DOT and immediatedly followed by one
** of TK_WHEN, TK_BEGIN or TK_FOR.
*/
if( zSql ){
do {
if( !*zCsr ){
/* Ran out of input before finding the table name. Return NULL. */
return;
}
/* Store the token that zCsr points to in tname. */
tname.z = zCsr;
tname.n = len;
/* Advance zCsr to the next token. Store that token type in 'token',
** and its length in 'len' (to be used next iteration of this loop).
*/
do {
zCsr += len;
len = sqlite3GetToken(zCsr, &token);
}while( token==TK_SPACE );
assert( len>0 );
/* Variable 'dist' stores the number of tokens read since the most
** recent TK_DOT or TK_ON. This means that when a WHEN, FOR or BEGIN
** token is read and 'dist' equals 2, the condition stated above
** to be met.
**
** Note that ON cannot be a database, table or column name, so
** there is no need to worry about syntax like
** "CREATE TRIGGER ... ON ON.ON BEGIN ..." etc.
*/
dist++;
if( token==TK_DOT || token==TK_ON ){
dist = 0;
}
} while( dist!=2 || (token!=TK_WHEN && token!=TK_FOR && token!=TK_BEGIN) );
/* Variable tname now contains the token that is the old table-name
** in the CREATE TRIGGER statement.
*/
zRet = sqlite3MPrintf(db, "%.*s\"%w\"%s", tname.z - zSql, zSql,
zTableName, tname.z+tname.n);
sqlite3_result_text(context, zRet, -1, SQLITE_DYNAMIC);
}
}
示例12: on_disconnect
static void on_disconnect(ble_rcmon_t * p_rcmon, ble_evt_t * p_ble_evt) {
UNUSED_PARAMETER(p_ble_evt);
p_rcmon->conn_handle = BLE_CONN_HANDLE_INVALID;
app_trace_log("on_disconnect\r\n");
}
示例13: sqlite3MemShutdown
/*
** Deinitialize this module.
*/
static void sqlite3MemShutdown(void *NotUsed){
UNUSED_PARAMETER(NotUsed);
return;
}
示例14: sqlite3MemInit
/*
** Initialize this module.
*/
static int sqlite3MemInit(void *NotUsed){
UNUSED_PARAMETER(NotUsed);
return SQLITE_OK;
}
示例15: main
int
main(int argc, char **argv)
{
struct ifreq ifr;
cmd_t *cmd = NULL;
int err = 0;
char *ifname = NULL;
int help = 0;
int status = CMD_DHD;
UNUSED_PARAMETER(argc);
dhdu_av0 = argv[0];
memset(&ifr, 0, sizeof(ifr));
for (++argv; *argv;) {
/* command option */
if ((status = dhd_option(&argv, &ifname, &help)) == CMD_OPT) {
if (help)
break;
if (ifname) {
if (strlen(ifname) > IFNAMSIZ) {
fprintf(stderr, "%s: interface name too long\n", dhdu_av0);
break;
}
strncpy(ifr.ifr_name, ifname, IFNAMSIZ);
}
continue;
}
/* parse error */
else if (status == CMD_ERR)
break;
/* use default if no interface specified */
if (!*ifr.ifr_name)
dhd_find(&ifr);
/* validate the interface */
if (!*ifr.ifr_name || dhd_check((void *)&ifr)) {
fprintf(stderr, "%s: dhd driver adapter not found\n", dhdu_av0);
exit(1);
}
/* search for command */
for (cmd = dhd_cmds; cmd->name && strcmp(cmd->name, *argv); cmd++);
/* defaults to using the set_var and get_var commands */
if (cmd->name == NULL)
cmd = &dhd_varcmd;
/* do command */
if (cmd->name)
err = (*cmd->func)((void *)&ifr, cmd, argv);
break;
}
/* In case of COMMAND_ERROR, command has already printed an error message */
if (!cmd)
dhd_usage(NULL);
else if (err == USAGE_ERROR)
dhd_cmd_usage(cmd);
else if (err == IOCTL_ERROR)
dhd_printlasterror((void *)&ifr);
return err;
}