functionSource stringlengths 20 97.4k | CWE-119 bool 2
classes | CWE-120 bool 2
classes | CWE-469 bool 2
classes | CWE-476 bool 2
classes | CWE-other bool 2
classes | combine int64 0 1 |
|---|---|---|---|---|---|---|
OnRelease(bool /*appShutDown*/)
{
// do de-initialization for your plugin
// if appShutDown is false, the plugin is unloaded because Code::Blocks is being shut down,
// which means you must not use any of the SDK Managers
// NOTE: after this function, the inherited member variable
// IsAttached() wi... | false | false | false | false | false | 0 |
sca3000_query_free_fall_mode(struct device *dev,
struct device_attribute *attr,
char *buf)
{
int ret;
struct iio_dev *indio_dev = dev_to_iio_dev(dev);
struct sca3000_state *st = iio_priv(indio_dev);
int val;
mutex_lock(&st->lock);
ret = sca3000_read_data_short(st, SCA3000_REG_ADDR_MODE, 1);
va... | false | false | false | false | false | 0 |
dhcp_exec ( int argc, char **argv ) {
static struct option longopts[] = {
{ "help", 0, NULL, 'h' },
{ NULL, 0, NULL, 0 },
};
const char *netdev_txt;
struct net_device *netdev;
int c;
int rc;
/* Parse options */
while ( ( c = getopt_long ( argc, argv, "h", longopts, NULL ) ) >= 0 ){
switch ( c ) {
case ... | false | false | false | false | false | 0 |
WriteLogicalField(const char *pszValue,
TABINDFile *poINDFile, int nIndexNo)
{
GByte bValue;
if (m_poRecordBlock == NULL)
{
CPLError(CE_Failure, CPLE_AssertionFailed,
"Can't write field value: GetRecordBlock() has not been called.");
return -1;
... | false | false | false | false | false | 0 |
P_SPMAngle(mobj_t * source, mobjtype_t type, angle_t angle)
{
mobj_t *th;
angle_t an;
fixed_t x, y, z, slope;
//
// see which target is to be aimed at
//
an = angle;
slope = P_AimLineAttack(source, an, 16 * 64 * FRACUNIT);
if (!linetarget)
{
an += 1 << 26;
slope = P_AimLineA... | false | false | false | false | false | 0 |
I_PCS_InitSound(boolean _use_sfx_prefix)
{
use_sfx_prefix = _use_sfx_prefix;
// Use the sample rate from the configuration file
PCSound_SetSampleRate(snd_samplerate);
// Initialize the PC speaker subsystem.
pcs_initialized = PCSound_Init(PCSCallbackFunc);
if (pcs_initialized)
{
... | false | false | false | false | false | 0 |
misreal (header *hd)
{ header *st=hd,*result;
hd=getvalue(hd); if (error) return;
if (hd->type==s_real || hd->type==s_matrix)
result=new_real(1.0,"");
else result=new_real(0.0,"");
if (error) return;
moveresult(st,result);
} | false | false | false | false | false | 0 |
close()
{
if ( !isOpen() )
return false; // already closed (return false or true? arguable...)
// moved by holger to allow kzip to write the zip central dir
// to the file in closeArchive()
// DF: added d->dev so that we skip closeArchive if saving aborted.
bool closeSucceeded = true;
i... | false | false | false | false | false | 0 |
_find_arg(struct command *com, int opt)
{
struct arg_props *a;
int i, arg;
for (i = 0; i < com->num_args; i++) {
arg = com->valid_args[i];
a = _cmdline.arg_props + arg;
/*
* opt should equal either the
* short arg, or the index into
* the_args.
*/
if ((a->short_arg && (opt == a->short_arg)) ||
... | false | false | false | false | false | 0 |
updateState(QAbstractAnimation::State newState, QAbstractAnimation::State oldState)
{
QGraphicsWidget *w = targetWidget();
if (!w) {
return;
}
if (m_startGeometry == QRectF(-1, -1, -1, -1)) {
m_startGeometry = w->geometry();
}
if (oldState == Stopped && newState == Running) {
... | false | false | false | false | false | 0 |
gtp_restricted_genmove(char *s)
{
int move;
int i, j;
int color;
int n;
unsigned int saved_random_seed = get_random_seed();
int allowed_moves[BOARDMAX];
int number_allowed_moves = 0;
memset(allowed_moves, 0, sizeof(allowed_moves));
n = gtp_decode_color(s, &color);
if (!n)
return gtp_failure("in... | false | false | false | false | false | 0 |
puse16()
{
defsize = 2;
#ifdef iscpu
if( sym != EOLSYM )
{
absexpres();
if (lastexp.data & UNDBIT)
return;
if( lastexp.offset > 8000 )
setcpu((int) lastexp.offset / 100 % 10);
else if( lastexp.offset > 15 )
setcpu((int) lastexp.offset / 100);
else
setcpu((int) lastexp.off... | false | false | false | false | false | 0 |
gst_dfb_buffer_pool_finalize (GObject * object)
{
GstDfbBufferPool *pool = GST_DFB_BUFFER_POOL_CAST (object);
if (pool->caps)
gst_caps_unref (pool->caps);
gst_object_unref (pool->dfbvideosink);
G_OBJECT_CLASS (gst_dfb_buffer_pool_parent_class)->finalize (object);
} | false | false | false | false | false | 0 |
set_pixmap_property(Pixmap p)
{
Atom prop_root, prop_esetroot, type;
int format;
unsigned long length, after;
unsigned char *data_root, *data_esetroot;
prop_root = XInternAtom(Xdisplay, "_XROOTPMAP_ID", True);
prop_esetroot = XInternAtom(Xdisplay, "ESETROOT_PMAP_ID", True);
if (debug) {
... | false | false | false | false | false | 0 |
handle_local_job( Client *client, Msg *msg )
{
client->status = Client::LINKJOB;
client->outfile = dynamic_cast<JobLocalBeginMsg*>( msg )->outfile;
return true;
} | false | false | false | false | false | 0 |
port100_listen(struct nfc_digital_dev *ddev, u16 timeout,
nfc_digital_cmd_complete_t cb, void *arg)
{
struct port100 *dev = nfc_digital_get_drvdata(ddev);
struct sk_buff *skb;
skb = port100_alloc_skb(dev, 0);
if (!skb)
return -ENOMEM;
return port100_tg_send_cmd(ddev, skb, timeout, cb, arg);
} | false | false | false | false | false | 0 |
merge_cat_star_list(GList *addsl,
struct gui_star_list *gsl, struct wcs *wcs)
{
GList *al;
int n = 0;
struct gui_star *gs;
struct cat_star *cats;
struct cat_star *acats;
GSList *newsl = NULL, *sl;
for (al = addsl; al != NULL; al = al->next) {
n++;
acats = CAT_STAR(al->data);
gs = find_gs_by_cats_na... | false | false | false | false | false | 0 |
extract_ctrl_seq(char* buf, int len)
{
static const char prefix[] = "\033_";
static const char suffix[] = "\033\\";
char* bufend = buf + len;
char* start = buf;
char* command;
char* end;
for (;;) {
start = find_str(start, bufend-start, prefix);
if (!start) break;
command = start + ... | false | false | false | false | false | 0 |
dove_get_temp(struct thermal_zone_device *thermal,
int *temp)
{
unsigned long reg;
struct dove_thermal_priv *priv = thermal->devdata;
/* Valid check */
reg = readl_relaxed(priv->control + PMU_TEMP_DIOD_CTRL1_REG);
if ((reg & PMU_TDC1_TEMP_VALID_MASK) == 0x0) {
dev_err(&thermal->device,
"Temperature sens... | false | false | false | false | false | 0 |
rem_check_dir(struct remfs *fs, struct remnode *nod)
{
int res;
avtime_t now = av_time();
if(now < nod->dir.valid)
res = 0;
else
res = rem_get_dir(fs, nod);
return res;
} | false | false | false | false | false | 0 |
fitsInFPType(ConstantFP *CFP, const fltSemantics &Sem) {
bool losesInfo;
APFloat F = CFP->getValueAPF();
(void)F.convert(Sem, APFloat::rmNearestTiesToEven, &losesInfo);
if (!losesInfo)
return ConstantFP::get(CFP->getContext(), F);
return nullptr;
} | false | false | false | false | false | 0 |
UnbuildEncodedOid PARAMS( (eoid, result),
AsnOid* eoid _AND_
OID** result)
{
OID** nextOid;
OID* headOid;
int arcNum;
int i;
int firstArcNum;
int secondArcNum;
for (arcNum = 0, i=0; (i < eoid->octetLen) && (eoid->octs[i] & 0x80);i++)
arcNum = (arcNum << 7) + (eoid->octs[i] & 0x7... | false | false | false | false | false | 0 |
blorb_get_resource(void *blorb_file, int32 extent, char *rid, int32 nnumber, uint32 *begin, uint32 *output_extent)
{
uint32 ridx_len;
uint32 i,j;
uint32 number=(uint32) nnumber;
void *ridx;
if (blorb_get_chunk(blorb_file, extent,"RIdx",&i,&ridx_len)==NO_REPLY_RV)
return NO_REPLY_RV;
ridx=(char *)blorb... | false | false | false | false | false | 0 |
mwifiex_insert_cmd_to_free_q(struct mwifiex_adapter *adapter,
struct cmd_ctrl_node *cmd_node)
{
unsigned long flags;
if (!cmd_node)
return;
if (cmd_node->wait_q_enabled)
mwifiex_complete_cmd(adapter, cmd_node);
/* Clean the node */
mwifiex_clean_cmd_node(adapter, cmd_node);
/* Insert node into cmd_... | false | false | false | false | false | 0 |
client_mechanism (Gsasl * ctx)
{
static char mech[GSASL_MAX_MECHANISM_SIZE + 1] = "";
char mechlist[BUFSIZ] = "";
const char *suggestion;
char *p;
printf ("Enter list of server supported mechanisms, separate by SPC:\n");
p = fgets (mechlist, sizeof (mechlist) - 1, stdin);
if (p == NULL)
{
perro... | false | false | false | false | false | 0 |
SP_func_rotating (edict_t *ent)
{
ent->solid = SOLID_BSP;
if (ent->spawnflags & 32)
ent->movetype = MOVETYPE_STOP;
else
ent->movetype = MOVETYPE_PUSH;
// set the axis of rotation
VectorClear(ent->movedir);
if (ent->spawnflags & 4)
ent->movedir[2] = 1.0;
else if (ent->spawnflags & 8)
ent->movedir[0] = 1.... | false | false | false | false | false | 0 |
report_errors_at_current_line(void)
{ ErrorReport.line_number = CurrentLB->source_line;
ErrorReport.file_number = CurrentLB->file_no;
if (ErrorReport.file_number == 255)
ErrorReport.file_number = -1;
ErrorReport.source = CurrentLB->filename;
ErrorReport.main_flag = CurrentLB->main_flag;... | false | false | false | false | false | 0 |
ipmi_isol_activate(struct ipmi_intf * intf)
{
struct ipmi_rs * rsp;
struct ipmi_rq req;
uint8_t data[6];
struct isol_config_parameters params;
if (ipmi_get_isol_info(intf, ¶ms))
return -1;
if (!(params.enabled & 0x1)) {
lprintf(LOG_ERR, "ISOL is not enabled!");
return -1;
}
/*
* Setup a ca... | false | false | false | false | false | 0 |
protocol_sort_func (TpawProtocol *proto_a,
TpawProtocol *proto_b)
{
const gchar *name_a = tpaw_protocol_get_protocol_name (proto_a);
const gchar *name_b = tpaw_protocol_get_protocol_name (proto_b);
gint cmp = 0;
cmp = sort_protocol_value (name_a);
cmp -= sort_protocol_value (name_b);
if (cmp == 0)
... | false | false | false | false | false | 0 |
sort_task_by_today ( td1, td2 )
TaskData **td1;
TaskData **td2;
{
TaskData *tda = *td1;
TaskData *tdb = *td2;
int ret = 0;
if ( tda->last_today_int > tdb->last_today_int )
ret = 1;
else if ( tda->last_today_int < tdb->last_today_int )
ret = -1;
else if ( tda->last_today_int == tdb->last_today_int )... | false | false | false | false | false | 0 |
syslinux_shuffle_boot_pm(struct syslinux_movelist *fraglist,
struct syslinux_memmap *memmap,
uint16_t bootflags, struct syslinux_pm_regs *regs)
{
uint8_t handoff_code[9 * 5], *p;
const uint32_t *rp;
int i, rv;
struct syslinux_memmap *tmap;
addr_t regstub, stublen;
tmap = syslinu... | false | false | false | false | false | 0 |
show_position(struct position *pos)
{
static const char *msg[] = { "(first axes) ", "(second axes) ",
"(graph units) ", "(screen units) ",
"(character units) "};
assert(first_axes == 0 && second_axes == 1 && graph == 2 && screen == 3 &&
character == 4);
fprintf(stderr, "(%s%g, %s%g, %s%g)",... | false | false | false | false | false | 0 |
GetMemoryFallback(const size_t size, const int align) {
if (size == 0)
return NULL; // stl/stl_alloc.h says this is okay
assert(align > 0 && 0 == (align & (align - 1))); // must be power of 2
// If the object is more than a quarter of the block size, allocate
// it separately to avoid wasting... | false | false | false | false | false | 0 |
rigiddisk_correct(void)
{
/* Correct checksums of all Blocks */
int i,ts;
struct DosEnvec *de;
rdb->rdb_HighRDSKBlock=ntohl(lastblock);
/* Historical overhead from the very old days. The DosEnvec is a
dynamically growing table, and some fields are only present in newer
versions of AmigaDos. So if we deci... | false | false | false | false | false | 0 |
start_send(struct ssif_info *ssif_info,
unsigned char *data,
unsigned int len)
{
if (len > IPMI_MAX_MSG_LENGTH)
return -E2BIG;
if (len > ssif_info->max_xmit_msg_size)
return -E2BIG;
ssif_info->retries_left = SSIF_SEND_RETRIES;
memcpy(ssif_info->data + 1, data, len);
ssif_info->data_len = ... | false | false | false | false | false | 0 |
supplicant_interface_release (NMDeviceWifi *self)
{
NMDeviceWifiPrivate *priv;
guint i;
g_return_if_fail (self != NULL);
priv = NM_DEVICE_WIFI_GET_PRIVATE (self);
cancel_pending_scan (self);
/* Reset the scan interval to be pretty frequent when disconnected */
priv->scan_interval = SCAN_INTERVAL_MIN + SCAN_I... | false | false | false | false | false | 0 |
H5LTopen_file_image(void *buf_ptr, size_t buf_size, unsigned flags)
{
hid_t fapl, file_id; /* HDF5 identifiers */
unsigned file_open_flags;/* Flags for image open */
char file_name[64]; /* Filename buffer */
size_t alloc_incr; /* Buffer allocation increment */... | true | true | false | false | true | 1 |
stop_vsib(ttp_session_t *session)
{
int timeout = 0;
struct timespec ts;
ts.tv_sec = 0;
ts.tv_nsec = 100000000L;
/* Stop the board, first DMA, and when the last descriptor */
/* has been transferred, then write stop to board command register. */
vsib_ioctl(VSIB_DELAYED_STOP_DMA, 0);
{
unsigned long... | false | false | false | false | false | 0 |
fso_gsm_state_based_at_parser_inline (FsoGsmStateBasedAtParser* self, gchar c) {
FsoGsmStateBasedAtParserState result = 0;
gchar _tmp0_ = '\0';
g_return_val_if_fail (self != NULL, 0);
_tmp0_ = c;
switch (_tmp0_) {
case '>':
{
result = FSO_GSM_STATE_BASED_AT_PARSER_STATE_CONTINUATION;
return result;
}
... | false | false | false | false | false | 0 |
updateVar(ProtocolVar pv) {
char z[256];
switch(pv) {
case PV_premove:
snprintf(z,256,"iset premove %d\n",global.Premove ? 1 : 0);
global.network->writeLine(z);
break;
default:
break;
}
} | false | false | false | false | false | 0 |
_e_border_menu_cb_skip_taskbar(void *data, E_Menu *m __UNUSED__, E_Menu_Item *mi)
{
E_Border *bd;
if (!(bd = data)) return;
if ((bd->client.icccm.accepts_focus) || (bd->client.icccm.take_focus))
bd->client.netwm.state.skip_taskbar = e_menu_item_toggle_get(mi);
else
bd->client.netwm.state.skip_ta... | false | false | false | false | false | 0 |
case5(char *path, char *string)
{
int ret = -1, dirlen = string - path;
struct dirent *inode;
char newpath[MAX_PATH];
DIR *wd;
// reconstruct wd
memcpy(newpath, "./", 2);
// copy everything sans last token
if(dirlen > 0)
memcpy(newpath + 2, path, dirlen - 1);
// open directory
wd = opendir(ne... | false | false | false | false | false | 0 |
Remove(Node* node)
{
if (node)
{
char* key = NULL;
plist_dict_get_item_key(node->GetPlist(), &key);
plist_dict_remove_item(_node, key);
std::string skey = key;
free(key);
_map.erase(skey);
delete node;
}
} | false | false | false | false | false | 0 |
__ecereNameSpace__ecere__sys__FloatFromString(char * string)
{
int c, dig;
float dec = (float)0, res = (float)0;
int neg = 1;
char ch;
for(c = 0; string[c]; c++)
{
ch = string[c];
if(ch == ' ')
continue;
if(ch == '-')
{
if(neg == -1)
break;
neg = -1;
}
else if((ch == '.') && !dec)
dec = (float)10;
else if(isdigit(ch))... | false | false | false | false | false | 0 |
__scif_pollfd(struct file *f, poll_table *wait, struct scif_endpt *ep)
{
unsigned int mask = 0;
dev_dbg(scif_info.mdev.this_device,
"SCIFAPI pollfd: ep %p %s\n", ep, scif_ep_states[ep->state]);
spin_lock(&ep->lock);
/* Endpoint is waiting for a non-blocking connect to complete */
if (ep->conn_async_state == A... | false | false | false | false | false | 0 |
parseproctime(Logfile *lf, void *arg, char c) {
/* parse processing time in decimal seconds, converting to milliseconds */
unsigned long *x = (unsigned long *)arg;
register char *p = pos;
*block_end = '\0';
if (!ISDIGIT(*p)) /* NB Decimals must begin "0." not just "." */
return(FALSE);
if (ISDIGIT(*(... | false | false | false | false | false | 0 |
crtmgr_verify_crt(crtmgr *m, cli_crt *x509) {
cli_crt *i = m->crts, *best = NULL;
int score = 0;
for (i = m->crts; i; i = i->next) {
if (!memcmp(i->subject, x509->subject, sizeof(i->subject)) &&
!memcmp(i->serial, x509->serial, sizeof(i->serial))) {
if (i->isBlacklisted)
... | false | false | false | false | false | 0 |
cpl_column_unset_null_segment(cpl_column *column,
cpl_size start, cpl_size count)
{
cpl_size length = cpl_column_get_size(column);
if (start == 0 && count == length) {
if (column->null)
cpl_free(column->null);
column->null = NULL;
... | false | false | false | false | false | 0 |
gst_tag_list_fields_equal (const GValue * value1, const GValue * value2)
{
gdouble d1, d2;
if (gst_value_compare (value1, value2) == GST_VALUE_EQUAL)
return TRUE;
/* fields not equal: add some tolerance for doubles, otherwise bail out */
if (!G_VALUE_HOLDS_DOUBLE (value1) || !G_VALUE_HOLDS_DOUBLE (value2)... | false | false | false | false | false | 0 |
cl_log_is_logd_fd(int fd)
{
return logging_daemon_chan && (
fd == logging_daemon_chan->ops->get_send_select_fd(logging_daemon_chan)
||
fd == logging_daemon_chan->ops->get_recv_select_fd(logging_daemon_chan)
);
} | false | false | false | false | false | 0 |
__findVertex(const Vertex * const p) {
for(Triangles::iterator i = __triangles.begin(); i != __triangles.end(); ++i) {
for(unsigned j=0;j<3;++j)
if (i->base()[j] == p)
return &*i;
}
ASSERT(false);
return NULL;
} | false | false | false | false | false | 0 |
finalizeConverter(log4cplus::tchar c)
{
PatternConverter* pc = 0;
switch (c) {
case LOG4CPLUS_TEXT('c'):
pc = new LoggerPatternConverter(formattingInfo,
extractPrecisionOption());
getLogLog().debug( LOG4CPLUS_TEXT("LOGGER converter.") )... | false | false | false | false | false | 0 |
dbxout_block (tree block, int depth, tree args)
{
const char *begin_label;
if (current_function_func_begin_label != NULL_TREE)
begin_label = IDENTIFIER_POINTER (current_function_func_begin_label);
else
begin_label = XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0);
while (block)
{
/* Igno... | false | false | false | false | false | 0 |
gst_cmml_enc_parse_tag_clip (GstCmmlEnc * enc, GstCmmlTagClip * clip)
{
GstCmmlTagClip *prev_clip;
GstClockTime prev_clip_time = GST_CLOCK_TIME_NONE;
/* this can happen if there's a programming error (eg user forgets to set
* the start-time property) or if one of the gst_cmml_clock_time_from_*
* overflows ... | false | false | false | false | false | 0 |
domain_range_reduce (GfsDomain * domain, GtsRange * s)
{
if (domain->pid >= 0) {
double in[5];
double out[5] = { G_MAXDOUBLE, - G_MAXDOUBLE, 0., 0., 0. };
MPI_Op op;
MPI_Op_create (range_reduce, TRUE, &op);
in[0] = s->min; in[1] = s->max; in[2] = s->sum; in[3] = s->sum2;
in[4] = s->n;
... | false | false | false | false | false | 0 |
init() {
ok = gTrue;
errCode = errNone;
entries = NULL;
capacity = 0;
size = 0;
streamEnds = NULL;
streamEndsLen = 0;
objStrs = new PopplerCache(5);
mainXRefEntriesOffset = 0;
xRefStream = gFalse;
} | false | false | false | false | false | 0 |
fl_call_object_callback( FL_OBJECT * obj )
{
if ( ! obj )
{
M_err( "fl_call_object_callback", "NULL object" );
return;
}
if ( obj->object_callback )
obj->object_callback( obj, obj->argument );
} | false | false | false | false | false | 0 |
ParseEventItemsElem(const XmlElement* stanza,
std::vector<PubSubItem>* items) {
const XmlElement* event_elem = stanza->FirstNamed(QN_PUBSUB_EVENT);
if (event_elem != NULL) {
const XmlElement* items_elem =
event_elem->FirstNamed(QN_PUBSUB_EVENT_ITEMS);
if (items_elem != NULL)... | false | false | false | false | false | 0 |
c_shift(COMPLEX *c, long n)
{
COMPLEX *r;
if (ciszero(c) || (n == 0))
return clink(c);
r = comalloc();
qfree(r->real);
qfree(r->imag);
r->real = qshift(c->real, n);
r->imag = qshift(c->imag, n);
return r;
} | false | false | false | false | false | 0 |
_updateRenderQueue(RenderQueue* queue)
{
if (mVisible)
{
OverlayElement::_updateRenderQueue(queue);
// Also add children
ChildIterator it = getChildIterator();
while (it.hasMoreElements())
{
// Give children Z-order 1 high... | false | false | false | false | false | 0 |
dac7512_store_val(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{
struct spi_device *spi = to_spi_device(dev);
unsigned char tmp[2];
unsigned long val;
int ret;
ret = kstrtoul(buf, 10, &val);
if (ret)
return ret;
tmp[0] = val >> 8;
tmp[1] = val & 0xff;
spi_writ... | true | true | false | false | false | 1 |
digicolor_uart_console_putchar(struct uart_port *port, int ch)
{
while (digicolor_uart_tx_full(port))
cpu_relax();
writeb_relaxed(ch, port->membase + UA_EMI_REC);
} | false | false | false | false | false | 0 |
find_imported_account_by_name ( gchar * name )
{
GSList * liste_tmp;
if ( ! name )
return NULL;
liste_tmp = gnucash_accounts;
while ( liste_tmp )
{
struct struct_compte_importation * account = liste_tmp -> data;
if ( !strcmp ( account -> nom_de_compte, name ))
{
return account;
}
... | false | false | false | false | false | 0 |
markchanged(struct PCPdir *pd)
{
char *p=changedname(pd);
int n;
if (!p) return;
n=open(p, O_RDWR|O_CREAT, 0600);
if (n >= 0)
close(n);
} | false | false | false | false | true | 1 |
highlight_field(MatchVector *mv,
LazyDocField *lazy_df,
TermVector *tv,
const char *pre_tag,
const char *post_tag)
{
const int pre_len = (int)strlen(pre_tag);
const int post_len = (int)strlen(pos... | false | false | false | false | false | 0 |
mainLoad() {
QString path = m_defaultSaveFolder;
QString fileName = FolderUtils::getOpenFileName(
this,
tr("Select a Fritzing File to Open"),
path,
tr("Fritzing Files (*%1 *%2 *%3);;Fritzing Part (*%1);;Fritzing Bin (*%2);;Fritzing Shareable Bin (*%3)")
.arg(FritzingBundledPartExtension)
... | false | false | false | false | false | 0 |
kill()
{
// enter the mutex here to avoid concurrency problems
#ifndef ASSIMP_BUILD_SINGLETHREADED
boost::mutex::scoped_lock lock(loggerMutex);
#endif
if (m_pLogger == &s_pNullLogger)return;
delete m_pLogger;
m_pLogger = &s_pNullLogger;
} | false | false | false | false | false | 0 |
c_size (state_t * s)
{
int res = get_resource_number (cmd_params[0].str);
if (res == -1)
sciprintf ("Resource type '%s' is not valid\n", cmd_params[0].str);
else
{
resource_t *resource = scir_find_resource(s->resmgr, res, cmd_params[1].val, 0);
if (resource)
{
sciprintf ("Size: %d\n", reso... | false | false | false | false | false | 0 |
do_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
TpawAccountWidget *self = TPAW_ACCOUNT_WIDGET (object);
switch (prop_id)
{
case PROP_SETTINGS:
self->priv->settings = g_value_dup_object (value);
break;
case PROP_SIMPLE:
self->priv-... | false | false | false | false | false | 0 |
sata_sff_hardreset(struct ata_link *link, unsigned int *class,
unsigned long deadline)
{
struct ata_eh_context *ehc = &link->eh_context;
const unsigned long *timing = sata_ehc_deb_timing(ehc);
bool online;
int rc;
rc = sata_link_hardreset(link, timing, deadline, &online,
ata_sff_check_ready);
if (o... | false | false | false | false | false | 0 |
assemble_name (file, name)
FILE *file;
const char *name;
{
const char *real_name;
tree id;
real_name = (* targetm.strip_name_encoding) (name);
id = maybe_get_identifier (real_name);
if (id)
TREE_SYMBOL_REFERENCED (id) = 1;
if (name[0] == '*')
fputs (&name[1], file);
else
ASM_OUTPU... | false | false | false | false | false | 0 |
toStr() const
{
std::string out;
out.reserve(m_data.size());
for(size_t i = 0; i < m_data.size(); ++i)
out.append(1, m_data[i].base);
return out;
} | false | false | false | false | false | 0 |
GetCorpusIndex(const vuint_t* phrase, vuint_t* indices)
{
pair<vuint_t::iterator,vuint_t::iterator> bounds;
indices->clear();
size_t phrasesize = phrase->size();
// find lower and upper bounds on phrase[0]
bounds = std::equal_range(m_F->begin(), m_F->end(), phrase->at(0));
// bounds holds first and (last + ... | false | false | false | false | false | 0 |
chclose (a)
char **a;
{
int *handle;
handle = (int *)a[0];
d_destroy_window (*handle);
if (!strcmp (channel[*handle].type, "alpha"))
/* If it exists alphanumerical window it is destroyed as well */
d_destroy_window_write (*handle);
} | false | false | false | false | false | 0 |
toCtype (void)
{
if (!ctype)
{
if (!isNaked())
{
ctype = castMod(0)->toCtype();
ctype = insert_type_modifiers (ctype, mod);
}
else
{
int nunits = ((TypeSArray *) basetype)->dim->toUInteger();
tree inner = elementType()->toCtype();
if (inner == void_type_node)
inner = Type::tuns... | false | false | false | false | false | 0 |
elm_map_name_add(const Evas_Object *obj,
const char *address,
double lon,
double lat,
Elm_Map_Name_Cb name_cb,
void *data)
{
#ifdef HAVE_ELEMENTARY_ECORE_CON
ELM_MAP_CHECK(obj) NULL;
if (address)
return _name_request(obj, E... | false | false | false | false | false | 0 |
megasas_decode_evt(struct megasas_instance *instance)
{
struct megasas_evt_detail *evt_detail = instance->evt_detail;
union megasas_evt_class_locale class_locale;
class_locale.word = le32_to_cpu(evt_detail->cl.word);
if (class_locale.members.class >= MFI_EVT_CLASS_CRITICAL)
dev_info(&instance->pdev->dev, "%d (%s... | false | false | false | false | false | 0 |
ixgbe_dbg_adapter_init(struct ixgbe_adapter *adapter)
{
const char *name = pci_name(adapter->pdev);
struct dentry *pfile;
adapter->ixgbe_dbg_adapter = debugfs_create_dir(name, ixgbe_dbg_root);
if (adapter->ixgbe_dbg_adapter) {
pfile = debugfs_create_file("reg_ops", 0600,
adapter->ixgbe_dbg_adapter, adapt... | false | false | false | false | false | 0 |
DrawCommonBar(void)
{
int healthPos;
V_DrawPatch(0, 134, PatchH2TOP);
if (oldhealth != HealthMarker)
{
oldhealth = HealthMarker;
healthPos = HealthMarker;
if (healthPos < 0)
{
healthPos = 0;
}
if (healthPos > 100)
{
health... | false | false | false | false | false | 0 |
ml_image_dline_native(value gdw, value x1, value y1, value x2, value y2,
value c, value pc) {
int pcval;
pcval = Int_val(pc);
if (pcval >= 0)
gdImageDashedLine(IM_VAL(gdw), Int_val(x1), Int_val(y1), Int_val(x2),
Int_val(y2), pseudoColors[pcval]);
else
g... | false | false | false | false | false | 0 |
_rename(CMD_ARGS)
{
const char *name = (argc == 3) ? argv[1] : NULL;
return _switches[SETUUID_ARG] ? _do_rename(name, NULL, argv[argc - 1]) :
_do_rename(name, argv[argc - 1], NULL);
} | false | false | false | false | false | 0 |
e_module_all_load(void)
{
Eina_List *l;
E_Config_Module *em;
char buf[128];
_e_modules_initting = EINA_TRUE;
e_config->modules =
eina_list_sort(e_config->modules, 0, _e_module_sort_priority);
EINA_LIST_FOREACH(e_config->modules, l, em)
{
if (!em) continue;
if ((em->dela... | true | true | false | false | false | 1 |
init_mount_tree(void)
{
struct vfsmount *mnt;
struct mnt_namespace *ns;
struct path root;
struct file_system_type *type;
type = get_fs_type("rootfs");
if (!type)
panic("Can't find rootfs type");
mnt = vfs_kern_mount(type, 0, "rootfs", NULL);
put_filesystem(type);
if (IS_ERR(mnt))
panic("Can't create rootf... | false | false | false | false | false | 0 |
up_backend_finalize (GObject *object)
{
UpBackend *backend;
g_return_if_fail (UP_IS_BACKEND (object));
backend = UP_BACKEND (object);
if (backend->priv->daemon != NULL)
g_object_unref (backend->priv->daemon);
if (backend->priv->device_list != NULL)
g_object_unref (backend->priv->device_list);
#ifdef EGG_TE... | false | false | false | false | false | 0 |
M_ADDC(UINT8 dat)
{
UINT16 temp;
CLR(A_FLAG);
if ((R.A & 0xf) + (dat & 0xf) + M_Cy > 0xf) SET(A_FLAG);
temp = R.A + dat + M_Cy;
CLR(C_FLAG);
if (temp > 0xff) SET(C_FLAG);
R.A = temp & 0xff;
} | false | false | false | false | false | 0 |
set(const SbXfBox3f & boundingbox,
SbBool centerset,
const SbVec3f & centerpoint)
{
PRIVATE(this)->bbox = boundingbox;
PRIVATE(this)->localbbox = boundingbox.project();
PRIVATE(this)->centerset = centerset ? 1 : 0;
if (centerset) { PRIVATE(this)->centerpoint = cen... | false | false | false | false | false | 0 |
kvaser_usb_read_bulk_callback(struct urb *urb)
{
struct kvaser_usb *dev = urb->context;
struct kvaser_msg *msg;
int pos = 0;
int err, i;
switch (urb->status) {
case 0:
break;
case -ENOENT:
case -EPIPE:
case -EPROTO:
case -ESHUTDOWN:
return;
default:
dev_info(dev->udev->dev.parent, "Rx URB aborted (%d)... | false | false | false | false | false | 0 |
calcSpillCost(unsigned PhysReg) const {
if (UsedInInstr.test(PhysReg))
return spillImpossible;
switch (unsigned VirtReg = PhysRegState[PhysReg]) {
case regDisabled:
break;
case regFree:
return 0;
case regReserved:
return spillImpossible;
default:
return LiveVirtRegs.lookup(VirtReg).Dirty... | false | false | false | false | false | 0 |
level_to_string(ECA_LOGGER::Msg_level_t arg)
{
switch(arg)
{
case ECA_LOGGER::errors: return level_descs[0];
case ECA_LOGGER::info: return level_descs[1];
case ECA_LOGGER::subsystems: return level_descs[2];
case ECA_LOGGER::module_names: return level_descs[3];
case ECA_LOGGER::user_objects: ret... | false | false | false | false | false | 0 |
cp932ext3_to_cp51932(int c)
{
int idx;
idx = sjistoidx(c >> 8, c & 0xff);
if (idx >= sjistoidx(0xfa, 0x5c))
idx -= sjistoidx(0xfa, 0x5c) - sjistoidx(0xed, 0x40);
else if (idx >= sjistoidx(0xfa, 0x55))
idx -= sjistoidx(0xfa, 0x55) - sjistoidx(0xee, 0xfa);
else if (idx >= sjistoidx(0xfa, 0x40))
idx -= sjis... | false | false | false | false | false | 0 |
tp_tests_room_list_chan_constructed (GObject *object)
{
TpTestsRoomListChan *self = TP_TESTS_ROOM_LIST_CHAN (object);
void (*chain_up) (GObject *) =
((GObjectClass *) tp_tests_room_list_chan_parent_class)->constructed;
if (chain_up != NULL)
chain_up (object);
tp_base_channel_register (TP_BASE_CHANNE... | false | false | false | false | false | 0 |
getOutputFileName(GooString *fileName, GooString *outputName)
{
GooString *name;
char *s;
char *p;
if (outputName) {
if (outputName->cmp("-") == 0) {
if (!printing && !singleFile) {
fprintf(stderr, "Error: stdout may only be used with the ps, eps, pdf, svg output options or if -singlefile is used.\n... | false | false | false | false | false | 0 |
pkix_pl_socket_tracePartialLine(char *ptr, PKIX_UInt32 nBytes) {
PKIX_UInt32 i = 0;
if (nBytes > 0) {
pkix_pl_socket_linePrefix((PKIX_UInt32)ptr);
}
for (i = 0; i < nBytes; i++) {
printf(" ");
pkix_pl_socket_hexDigit(ptr[i]);
... | false | false | false | false | false | 0 |
PQescapeByteaInternal(PGconn *conn,
const unsigned char *from, size_t from_length,
size_t *to_length, bool std_strings)
{
const unsigned char *vp;
unsigned char *rp;
unsigned char *result;
size_t i;
size_t len;
size_t bslash_len = (std_strings ? 1 : 2);
/*
* empty string has 1 char ('\0')
*... | false | false | false | false | false | 0 |
_libssh2_wait_socket(LIBSSH2_SESSION *session, time_t start_time)
{
int rc;
int seconds_to_next;
int dir;
int has_timeout;
long ms_to_next = 0;
long elapsed_ms;
/* since libssh2 often sets EAGAIN internally before this function is
called, we can decrease some amount of confusion in u... | false | false | false | false | false | 0 |
qmonShareTreeClearUsage(Widget w, XtPointer cld, XtPointer cad)
{
lList *alp = NULL;
lList *alp2 = NULL;
lList *ul = NULL;
lList *pl = NULL;
lListElem *ep = NULL;
Boolean status, answer;
DENTER(GUI_LAYER, "qmonShareTreeClearUsage");
status = XmtAskForBoolean(w, "xmtBooleanDialog",
... | false | false | false | false | false | 0 |
mongamma_event(zdialog *zd, cchar *event)
{
int err;
double gamma;
if (strEqu(event,"gamma")) {
zdialog_fetch(zd,"gamma",gamma);
sprintf(command,"xgamma -quiet -gamma %.2f",gamma);
err = system(command);
if (err) zmessageACK(mWin,"error: %s",wstrerror(err));
}
return 0... | false | false | false | false | false | 0 |
get_fan(struct device *dev,
struct device_attribute *devattr, char *buf)
{
struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
struct max31790_data *data = max31790_update_device(dev);
int sr, rpm;
if (IS_ERR(data))
return PTR_ERR(data);
sr = get_tach_period(data->fan_dynamics[attr->in... | false | true | false | false | false | 1 |
feature_extraction_test_SIFT( int N, int h )
{
CTicTac tictac;
// Generate a random image
CImage img;
getTestImage(0,img);
CFeatureExtraction fExt;
CFeatureList featsSIFT;
fExt.options.featsType = featSIFT;
fExt.options.SIFTOptions.implementation = CFeatureExtraction::Hess;
tictac.Tic();
for (int i=0;i... | false | false | false | false | false | 0 |
gspca_resume(struct usb_interface *intf)
{
struct gspca_dev *gspca_dev = usb_get_intfdata(intf);
int streaming, ret = 0;
mutex_lock(&gspca_dev->usb_lock);
gspca_dev->frozen = 0;
gspca_dev->usb_err = 0;
gspca_dev->sd_desc->init(gspca_dev);
/*
* Most subdrivers send all ctrl values on sd_start and thus
* only... | false | false | false | false | false | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.