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 |
|---|---|---|---|---|---|---|
bh1780_store_power_state(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{
struct platform_device *pdev = to_platform_device(dev);
struct bh1780_data *ddata = platform_get_drvdata(pdev);
unsigned long val;
int error;
error = kstrtoul(buf, 0, &val);
if (error)
return ... | false | false | false | false | false | 0 |
esas2r_log_request_failure(struct esas2r_adapter *a,
struct esas2r_request *rq)
{
u8 reqstatus = rq->req_stat;
if (reqstatus == RS_SUCCESS)
return;
if (rq->vrq->scsi.function == VDA_FUNC_SCSI) {
if (reqstatus == RS_SCSI_ERROR) {
if (rq->func_rsp.scsi_rsp.sense_len >= 13) {
esas2r_log(ESAS2R_LOG_WARN... | false | false | false | false | false | 0 |
openIn(const std::string& fileName, std::ifstream& ifs) {
if (fileName == "-") return std::cin;
ifs.open(fileName.c_str());
if (!ifs) err("can't open file: " + fileName);
return ifs;
} | false | false | false | false | false | 0 |
isLast( const QModelIndex &index ) const
{
if(!hasParent(index))
return false; // what should be returned here?
if(index.row() >= (index.model()->rowCount(index.parent())-1))
return true;
else
return false;
} | false | false | false | false | false | 0 |
output_func(const char *p, size_t n)
{
origSink << std::string(p, p+n);
} | false | false | false | false | false | 0 |
find_unlocked_1_reply (GkrOperation *op, DBusMessage *reply, gpointer data)
{
char **unlocked, **locked;
int n_unlocked, n_locked;
DBusMessage *req;
/* At this point SearchItems has returned two lists of locked/unlocked items */
if (gkr_operation_handle_errors (op, reply))
return;
if (!dbus_message_get_args ... | false | false | false | false | false | 0 |
mxl111sf_i2c_stop(struct mxl111sf_state *state)
{
int ret;
mxl_i2c("()");
ret = mxl111sf_write_reg(state, SW_I2C_ADDR,
0x10 | SW_I2C_EN); /* stop */
if (mxl_fail(ret))
goto fail;
ret = mxl111sf_write_reg(state, SW_I2C_ADDR,
0x10 | SW_I2C_EN | SW_SCL_OUT);
if (mxl_fail(ret))
goto fail;
ret = mxl... | false | false | false | false | false | 0 |
ReadBytes() {
uint8_t recv_bytes[1024];
int ret;
// Don't read while we're in connect stage
if (connect_complete == 0)
return 0;
if ((ret = read(cli_fd, recv_bytes, 1024)) < 0) {
if (errno == EINTR || errno == EAGAIN)
return 0;
snprintf(errstr, 1024, "TCP client fd %d read() error: %s", ... | false | false | false | false | false | 0 |
jpc_sop_putparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *out)
{
jpc_sop_t *sop = &ms->parms.sop;
/* Eliminate compiler warning about unused variable. */
cstate = 0;
if (jpc_putuint16(out, sop->seqno)) {
return -1;
}
return 0;
} | false | false | false | false | false | 0 |
useContextMenu(bool state)
{
if (state)
ui->widget->treeView()->setContextMenuPolicy(Qt::CustomContextMenu);
else
ui->widget->treeView()->setContextMenuPolicy(Qt::NoContextMenu);
} | false | false | false | false | false | 0 |
parseBody(struct toc** cur, bool empty, int endtype){
W("parseBody");
// zacatek tela -> spustit prikazy
// ukladat je doleva za sebe do typu AST_CMDparseBody
struct astNode* body = makeNewAST();
body->type = AST_CMD;
*cur = getToc(); // prvni token tela!!!
if((int)(*cur)->type == endtype){
D("Empty body"... | false | false | false | false | false | 0 |
gda_xslt_getnodeset_function (xmlXPathParserContextPtr ctxt, int nargs)
{
GdaXsltIntCont *data;
xsltTransformContextPtr tctxt;
xmlXPathObjectPtr setname, nodeset;
GdaXsltExCont *execc;
if (nargs != 1) {
xsltGenericError (xsltGenericErrorContext,
"gda_xslt_getnodeset_function: invalid number of arguments\n"... | false | false | false | false | false | 0 |
sign_undefine(sp, sp_prev)
sign_T *sp;
sign_T *sp_prev;
{
vim_free(sp->sn_name);
vim_free(sp->sn_icon);
#ifdef FEAT_SIGN_ICONS
if (sp->sn_image != NULL)
{
out_flush();
gui_mch_destroy_sign(sp->sn_image);
}
#endif
vim_free(sp->sn_text);
if (sp_prev == NULL)
first_sign = sp->sn_next... | false | false | false | false | false | 0 |
oppositeBorderPositionWithPoints(const int borderPosition, QList<int> &points) {
// 1. Conversion "border position -> (Absolute) position"
int position[DIM_MAX];
borderPositionToAbsolutePosition(borderPosition, position);
// 2. Get start direction
int direction[DIM_MAX];
if (borderPosition < m_columns) {
dire... | false | false | false | false | false | 0 |
e_table_subset_variable_decrement (ETableSubsetVariable *etssv,
gint position,
gint amount)
{
gint i;
ETableSubset *etss = E_TABLE_SUBSET (etssv);
for (i = 0; i < etss->n_map; i++) {
if (etss->map_table[i] >= position)
etss->map_table[i] -= a... | false | false | false | false | false | 0 |
get_tablet_button_class_name (GsdWacomTabletButton *tablet_button,
GtkDirectionType dir)
{
gchar *id;
gchar c;
id = tablet_button->id;
switch (tablet_button->type) {
case WACOM_TABLET_BUTTON_TYPE_RING:
if (id[0] == 'l') /* left-ring */
return g_strdup_printf ("Ring%s", (di... | false | false | false | false | false | 0 |
process_eprint( fields *bibin, fields *info, int level )
{
int neprint, netype;
char *eprint = NULL, *etype = NULL;
neprint = fields_find( bibin, "eprint", -1 );
netype = fields_find( bibin, "eprinttype", -1 );
if ( neprint!=-1 ) eprint = bibin->data[neprint].data;
if ( netype!=-1 ) etype = bibin->data[netype].d... | false | false | false | false | false | 0 |
bfa_timer_begin(struct bfa_timer_mod_s *mod, struct bfa_timer_s *timer,
void (*timercb) (void *), void *arg, unsigned int timeout)
{
WARN_ON(timercb == NULL);
WARN_ON(bfa_q_is_on_q(&mod->timer_q, timer));
timer->timeout = timeout;
timer->timercb = timercb;
timer->arg = arg;
list_add_tail(&timer->qe, &mod... | false | false | false | false | false | 0 |
gst_ring_buffer_delay (GstRingBuffer * buf)
{
GstRingBufferClass *rclass;
guint res;
g_return_val_if_fail (GST_IS_RING_BUFFER (buf), 0);
/* buffer must be acquired */
if (G_UNLIKELY (!gst_ring_buffer_is_acquired (buf)))
goto not_acquired;
rclass = GST_RING_BUFFER_GET_CLASS (buf);
if (G_LIKELY (rcla... | false | false | false | true | false | 1 |
ProcessPhpRequest(const char *filename, CSession *sess, long &size)
{
FILE *f = fopen(filename, "r");
if ( !f ) {
return Get_404_Page(size);
}
CWriteStrBuffer buffer;
CPhpFilter(this, sess, filename, &buffer);
size = buffer.Length();
char *buf = new char [size+1];
buffer.CopyAll(buf);
fclose(f);
retu... | false | false | false | false | false | 0 |
bUuDecodeEx (const_bstring src, int * badlines) {
struct tagbstring t;
struct bStream * s;
struct bStream * d;
bstring b;
if (!src) return NULL;
t = *src; /* Short lifetime alias to header of src */
s = bsFromBstrRef (&t); /* t is undefined after this */
if (!s) return NULL;
d = bsUuDecode (s, badlines)... | false | false | false | false | false | 0 |
writeToStream(mrpt::utils::CStream &out,int *version) const
{
if (version)
*version = 0;
else
{
writeToStreamRender(out);
out << m_radiusIn << m_radiusOut;
out << m_nSlices << m_nLoops;
}
} | false | false | false | false | false | 0 |
process_set_of_keys(int key, int count, int *list)
{
int i;
for (i=0; i<count; i++)
if (check_control(list[i], key))
button_info_set(&Player->bi, list[i]);
} | false | false | false | false | false | 0 |
fm_config_load_from_file(FmConfig* cfg, const char* name)
{
const gchar * const *dirs, * const *dir;
char *path;
GKeyFile* kf = g_key_file_new();
g_strfreev(cfg->modules_blacklist);
g_strfreev(cfg->system_modules_blacklist);
cfg->modules_blacklist = NULL;
cfg->system_modules_blacklist = NUL... | false | false | false | false | false | 0 |
esc_encode(const char *src, unsigned srclen, char *dst)
{
const char *end = src + srclen;
char *rp = dst;
int len = 0;
while (src < end)
{
unsigned char c = (unsigned char) *src;
if (c == '\0' || IS_HIGHBIT_SET(c))
{
rp[0] = '\\';
rp[1] = DIG(c >> 6);
rp[2] = DIG((c >> 3) & 7);
rp[3] = DIG... | false | false | false | false | false | 0 |
sftk_newPinCheck(CK_CHAR_PTR pPin, CK_ULONG ulPinLen) {
unsigned int i;
int nchar = 0; /* number of characters */
int ntrail = 0; /* number of trailing bytes to follow */
int ndigit = 0; /* number of decimal digits */
int nlower = 0; /* number of ASCII lowercase letters */
int n... | false | false | false | false | false | 0 |
xeon_init_dev(struct intel_ntb_dev *ndev)
{
struct pci_dev *pdev;
u8 ppd;
int rc, mem;
pdev = ndev_pdev(ndev);
switch (pdev->device) {
/* There is a Xeon hardware errata related to writes to SDOORBELL or
* B2BDOORBELL in conjunction with inbound access to NTB MMIO Space,
* which may hang the system. To wor... | false | false | false | false | false | 0 |
fli_rgbmask_to_shifts( unsigned long mask,
unsigned int * shift,
unsigned int * bits )
{
unsigned int val;
if ( mask == 0 )
{
*shift = *bits = 0;
return;
}
*shift = 0;
while ( ! ( ( 1 << *shift ) & mask ) )
( *shift )++;... | false | false | false | false | false | 0 |
setnplayers (int n)
{
nrockets = n;
maxnplayers = MAXROCKETS - nrockets;
if (minim[0].number == &nplayers)
{
minim[0].max = maxnplayers;
if (nplayers > maxnplayers)
nplayers = maxnplayers;
}
nplayerchange ();
} | false | false | false | false | false | 0 |
glade_eprop_model_data_delete_selected (GladeEditorProperty *eprop)
{
GtkTreeIter iter;
GladeEPropModelData *eprop_data = GLADE_EPROP_MODEL_DATA (eprop);
GNode *data_tree = NULL, *row;
gint rownum = -1;
/* NOTE: This will trigger row-deleted below... */
if (!gtk_tree_selection_get_selected (eprop_data->selection... | false | false | false | false | false | 0 |
unlink2 (PARAM_UNUSED void * dummy, const char * filename)
{
message (msg_tool | msg_file, (stderr, "Unlinking file `%s'\n", filename));
/* Don't complain if you can't unlink. Who cares of a tmp file? */
unlink (filename);
} | false | false | false | false | false | 0 |
twl_request(struct gpio_chip *chip, unsigned offset)
{
struct gpio_twl4030_priv *priv = to_gpio_twl4030(chip);
int status = 0;
mutex_lock(&priv->mutex);
/* Support the two LED outputs as output-only GPIOs. */
if (offset >= TWL4030_GPIO_MAX) {
u8 ledclr_mask = LEDEN_LEDAON | LEDEN_LEDAEXT
| LEDEN_LEDAPWM | ... | false | false | false | false | false | 0 |
SaveDefmethodsForDefgeneric(
void *theEnv,
struct constructHeader *theDefgeneric,
void *userBuffer)
{
DEFGENERIC *gfunc = (DEFGENERIC *) theDefgeneric;
char *logName = (char *) userBuffer;
register unsigned i;
for (i = 0 ; i < gfunc->mcnt ; i++)
{
if (gfunc->methods[i].ppForm != NULL)
... | false | false | false | false | false | 0 |
parse_hints_parse(struct parse_hints *ph, const char **v_in_out)
{
const char *v = *v_in_out;
char *nv;
int base;
int repeats = 0;
int repeat_fixup = ph->result_len;
if (ph->repeat) {
if (!parse_hints_add_result_octet(ph, 0)) {
return 0;
}
}
do {
base = 0;
switch (ph->forma... | false | false | false | false | false | 0 |
record_init_root(record* r, btree* tree)
{
// Position to first leaf node ...
UInt32 leaf_head = tree->head.leaf_head;
node_buf* buf = btree_node_by_index(tree, leaf_head, NODE_CLEAN);
if (!buf)
return -1;
return record_init(r, tree, buf, 0);
} | false | false | false | false | false | 0 |
nvkm_fifo_chan_ntfy(struct nvkm_object *object, u32 type,
struct nvkm_event **pevent)
{
struct nvkm_fifo_chan *chan = nvkm_fifo_chan(object);
if (chan->func->ntfy)
return chan->func->ntfy(chan, type, pevent);
return -ENODEV;
} | false | false | false | false | false | 0 |
diff_flush_stat(struct diff_filepair *p, struct diff_options *o,
struct diffstat_t *diffstat)
{
if (diff_unmodified_pair(p))
return;
if ((DIFF_FILE_VALID(p->one) && S_ISDIR(p->one->mode)) ||
(DIFF_FILE_VALID(p->two) && S_ISDIR(p->two->mode)))
return; /* no tree diffs in patch format */
run_diffstat... | false | false | false | false | false | 0 |
printing_is_pango_gdk_color_equal(PangoColor *p, GdkColor *g)
{
return ((p->red == g->red) && (p->green == g->green) && (p->blue == g->blue));
} | false | false | false | false | false | 0 |
gnumeric_background_set (GnmStyle const *mstyle, cairo_t *cr,
gboolean const is_selected, GtkStyleContext *ctxt)
{
int pattern;
g_return_val_if_fail (!is_selected || ctxt != NULL, FALSE);
/*
* Draw the background if the PATTERN is non 0
* Draw a stipple too if the pattern is > 1
*/
pattern = gnm_style_g... | false | false | false | false | false | 0 |
ath5k_hw_channel(struct ath5k_hw *ah, struct net80211_channel *channel)
{
int ret;
/*
* Check bounds supported by the PHY (we don't care about regultory
* restrictions at this point). Note: hw_value already has the band
* (CHANNEL_2GHZ, or CHANNEL_5GHZ) so we inform ath5k_channel_ok()
* of the band by that */... | false | false | false | false | false | 0 |
getRoadTypeByBinary( char binary )
{
int index = -1;
for( int i = 0; i < 16; i++ ) {
if ( binary == binaryTable[ i ] )
{
index = i;
break;
}
}
if( index == -1 ) {
return -1;
}
return roadTypeTable[ index ];
} | false | false | false | false | false | 0 |
__drbg_seed(struct drbg_state *drbg, struct list_head *seed,
int reseed)
{
int ret = drbg->d_ops->update(drbg, seed, reseed);
if (ret)
return ret;
drbg->seeded = true;
/* 10.1.1.2 / 10.1.1.3 step 5 */
drbg->reseed_ctr = 1;
return ret;
} | false | false | false | false | false | 0 |
worker_on_saved_session_name_read (GdmDBusWorker *worker,
const char *session_name,
GdmSessionConversation *conversation)
{
GdmSession *self = conversation->session;
if (! get_session_command_for_name (session_na... | false | false | false | false | false | 0 |
verify_pack_index(struct packed_git *p)
{
off_t index_size;
const unsigned char *index_base;
git_SHA_CTX ctx;
unsigned char sha1[20];
int err = 0;
if (open_pack_index(p))
return error("packfile %s index not opened", p->pack_name);
index_size = p->index_size;
index_base = p->index_data;
/* Verify SHA1 sum o... | false | false | false | false | false | 0 |
entry_register (struct web_entry *entry, struct ref *ref, char *used,
char *use_addressof)
{
struct web_entry *root;
rtx reg, newreg;
/* Find the corresponding web and see if it has been visited. */
root = unionfind_root (entry);
if (root->reg)
return root->reg;
/* We are seeing this... | false | false | false | false | false | 0 |
appendMemTesterOutput(cmCTestTestResult& res,
int test)
{
cmStdString ofile = testOutputFileName(test);
if ( ofile.empty() )
{
return;
}
std::ifstream ifs(ofile.c_str());
if ( !ifs )
{
std::string log = "Cannot read memory tester output file: " ... | false | false | false | false | false | 0 |
Send_NR(char *reason)
{
char buffer[257];
int length;
if ((length = strlen(reason)) > 255)
length = 255;
buffer[0] = NAK;
buffer[1] = length;
memcpy(buffer + 2, reason, length);
write(fd, buffer, length + 2);
} | false | false | false | false | false | 0 |
load_dict (const gchar *file)
{
g_return_val_if_fail (file != NULL, GKAMUS_DIC_STATUS_NOT_FOUND);
GIOChannel *read;
gchar *temp;
gboolean test;
#ifdef PACKAGE_DATA_DIR
temp = g_build_filename (PACKAGE_DATA_DIR, file, NULL);
#else
gchar *current_dir = get_get_current_dir ();
temp = g_build_filename (curr... | false | false | false | false | false | 0 |
register_stat2( char *module, char *name, stat_var **pvar,
unsigned short flags, void *ctx)
{
module_stats* mods;
stat_var *stat;
stat_var *it;
str smodule;
int hash;
if (module==0 || name==0 || pvar==0) {
LM_ERR("invalid parameters module=%p, name=%p, pvar=%p \n",
module, name, pvar);
goto e... | false | false | false | true | false | 1 |
add(ParmString w, ParmString s) {
RET_ON_ERR(check_if_valid(*lang(),w));
SensitiveCompare c(lang());
WordEntry we;
if (WritableDict::lookup(w,&c,we)) return no_err;
byte * w2;
w2 = (byte *)buffer.alloc(w.size() + 3);
*w2++ = lang()->get_word_info(w);
*w2++ = w.size();
memcpy(w2, w.str(), w.size() + 1)... | false | false | false | false | false | 0 |
create(KLocale::CalendarSystem calendarSystem,
KSharedConfig::Ptr config,
const KLocale *locale)
{
switch (calendarSystem) {
case KLocale::QDateCalendar:
return new KCalendarSystemQDate(config, locale);
case KLocale::C... | false | false | false | false | false | 0 |
ClassTagText(const AString &tag, const AString &cls,
const AString &text)
{
AString temp = tag;
temp += " class=\"";
temp += cls;
temp += "\"";
Enclose(1, temp);
PutStr(text);
Enclose(0, tag);
} | false | false | false | false | false | 0 |
f_pumvisible(argvars, rettv)
typval_T *argvars UNUSED;
typval_T *rettv UNUSED;
{
#ifdef FEAT_INS_EXPAND
if (pum_visible())
rettv->vval.v_number = 1;
#endif
} | false | false | false | false | false | 0 |
xfs_bmbt_set_state(
xfs_bmbt_rec_host_t *r,
xfs_exntst_t v)
{
ASSERT(v == XFS_EXT_NORM || v == XFS_EXT_UNWRITTEN);
if (v == XFS_EXT_NORM)
r->l0 &= xfs_mask64lo(64 - BMBT_EXNTFLAG_BITLEN);
else
r->l0 |= xfs_mask64hi(BMBT_EXNTFLAG_BITLEN);
} | false | false | false | false | false | 0 |
get_ratio(GdkPixbuf *pixmap, gdouble size)
{
gdouble ratio = 1.0;
gint pixmap_h, pixmap_w;
pixmap_w = gdk_pixbuf_get_width(pixmap);
pixmap_h = gdk_pixbuf_get_height(pixmap);
if (pixmap_h <= pixmap_w){
if (pixmap_w > size)
ratio = size / pixmap_w;
}
else {
if (pixmap_h > size)
ratio = si... | false | false | false | false | false | 0 |
nxt_psp_get_buttons(nxt_t *nxt,int port,struct nxt_psp_buttons *buttons) {
uint16_t buf;
int ret = nxt_i2c_read(nxt,port,nxt_psp_i2c_addr,NXT_PSP_REG_BUTTONS,2,&buf);
if (ret==2) {
buf = ~buf;
if (buttons!=NULL) {
buttons->left = buf&NXT_PSP_BTN_LEFT;
buttons->down = buf&NXT_PSP_BTN_DOWN;
... | false | false | false | false | false | 0 |
LC_ZkaCard__ParsePseudoOids(const uint8_t *p, uint32_t bs, GWEN_BUFFER *mbuf) {
GWEN_BUFFER *xbuf;
xbuf=GWEN_Buffer_new(0, 256, 0, 1);
while(p && bs) {
uint8_t x;
x=*p;
GWEN_Buffer_AppendByte(xbuf, (x>>4) & 0xf);
GWEN_Buffer_AppendByte(xbuf, x & 0xf);
p++;
bs--;
}
p=(const uint8_t*... | false | false | false | false | false | 0 |
OpenCurrentFile()
{
int result = 0;
if ( this->CurrentGeometryFP == NULL)
{
int len = static_cast<int>(strlen(this->BaseName));
char *buf = new char [len+64];
sprintf(buf, "%s.coords", this->BaseName);
this->CurrentGeometryFP = fopen(buf, "r");
if (this->CurrentGeometryFP == NULL)
{... | false | false | false | false | true | 1 |
NPP_URLNotify(NPP instance,
const char* url,
NPReason reason,
void* notifyData)
{
if (!instance)
return;
QtNPInstance* This = (QtNPInstance*) instance->pdata;
if (!This->bindable)
return;
QtNPBindable::Reason r;
switch (reason) {
case NPRES_DONE:
r = QtNPBi... | false | false | false | false | false | 0 |
get_tag(f_id)
facet_id f_id;
{ if ( F_TAG_ATTR == 0 ) return 0;
if ( EXTRAS(FACET)[F_TAG_ATTR].array_spec.datacount > 0 )
return (*FINT(f_id,F_TAG_ATTR));
else return 0;
} | false | false | false | false | false | 0 |
app_change_pin (app_t app, ctrl_t ctrl, const char *chvnostr, int reset_mode,
gpg_error_t (*pincb)(void*, const char *, char **),
void *pincb_arg)
{
gpg_error_t err;
if (!app || !chvnostr || !*chvnostr || !pincb)
return gpg_error (GPG_ERR_INV_VALUE);
if (!app->ref_count)
r... | false | false | false | false | false | 0 |
mgmt_remove_uuid(int index, uuid_t *uuid)
{
char buf[MGMT_HDR_SIZE + sizeof(struct mgmt_cp_remove_uuid)];
struct mgmt_hdr *hdr = (void *) buf;
struct mgmt_cp_remove_uuid *cp = (void *) &buf[sizeof(*hdr)];
uuid_t uuid128;
uint128_t uint128;
DBG("index %d", index);
uuid_to_uuid128(&uuid128, uuid);
memset(buf, ... | false | false | false | false | false | 0 |
set_new_fixed_colormap(const char *name)
{
int i;
if (name && strcmp(name, "web") == 0) {
Gif_Colormap *cm = Gif_NewFullColormap(216, 256);
Gif_Color *col = cm->col;
for (i = 0; i < 216; i++) {
col[i].gfc_red = (i / 36) * 0x33;
col[i].gfc_green = ((i / 6) % 6) * 0x33;
col[i].gfc_blue =... | false | false | false | false | false | 0 |
SegmentsOverlap(real b1, real o1, real b2, real o2) {
real t;
if (b1 > o1) {
t = o1;
o1 = b1;
b1 = t;
}
if (b2 > o2) {
t = o2;
o2 = b2;
b2 = t;
}
return !((b2 > o1) || (o2 < b1));
} | false | false | false | false | false | 0 |
classifyFoldPointMetapost(const char* s,WordList *keywordlists[]) {
WordList& keywordsStart=*keywordlists[3];
WordList& keywordsStop1=*keywordlists[4];
if (keywordsStart.InList(s)) {return 1;}
else if (keywordsStop1.InList(s)) {return -1;}
return 0;
} | false | false | false | false | false | 0 |
pad_added_cb (GstElement * element,
GstPad * pad,
GstElement *convert)
{
/* Link remaining pad after decodebin2 does its magic. */
GstPad *conv_pad;
conv_pad = gst_element_get_static_pad (convert, "sink");
g_assert (conv_pad != NULL);
if (pads_compatible (pad, conv_pad)) {
g_assert ... | false | false | false | false | false | 0 |
operator=(const std::string &Val) {
// Create a regexp object to match pass names for emitOptimizationRemark.
if (!Val.empty()) {
Pattern = std::make_shared<Regex>(Val);
std::string RegexError;
if (!Pattern->isValid(RegexError))
report_fatal_error("Invalid regular expression '" + Val +... | false | false | false | false | false | 0 |
b43legacy_generate_probe_resp(struct b43legacy_wldev *dev,
u16 *dest_size,
struct ieee80211_rate *rate)
{
const u8 *src_data;
u8 *dest_data;
u16 src_size, elem_size, src_pos, dest_pos;
__le16 dur;
struct ieee80211_hdr *hdr;
size_t ie_start;
src_size = dev->wl->current_beacon->len;
src_d... | false | false | false | false | false | 0 |
items() const
{
QList<PopupDropperItem*> list;
foreach( PopupDropperItem *item, d->pdiItems )
list.append( item );
return list;
} | false | false | false | false | false | 0 |
setInstanceUpdatesBlocked(bool blockUpdates)
{
if (blockUpdates) {
if (!gElementsWithInstanceUpdatesBlocked)
gElementsWithInstanceUpdatesBlocked = new HashSet<const SVGStyledElement*>;
gElementsWithInstanceUpdatesBlocked->add(this);
} else {
ASSERT(gElementsWithInstanceUpdate... | false | false | false | false | false | 0 |
cleartext()
{
text_start = 0;
text_length = 0;
for (GPosition i=children; i; ++i)
children[i].cleartext();
} | false | false | false | false | false | 0 |
utf8_cmp (const unsigned char *str, int length, const char *name)
{
const unsigned char *limit = str + length;
int i;
for (i = 0; name[i]; ++i)
{
int ch = UTF8_GET (str, limit);
if (ch != name[i])
return ch - name[i];
}
return str == limit ? 0 : 1;
} | false | false | false | false | false | 0 |
get_popstate_boxsize(struct popstate_t *p)
{
int size = 0, i = 0;
if (p == NULL)
ERROR_ABORT("popstate is NULL\n");
if( p->size > 0 )
return p->size;
for(i = 0 ; i < p->num_msgs ; i++)
size += get_mailmessage_size(get_popstate_mailmessage(p,i));
return size;
} | false | false | false | false | false | 0 |
keyspan_port_remove(struct usb_serial_port *port)
{
struct keyspan_port_private *p_priv;
int i;
p_priv = usb_get_serial_port_data(port);
stop_urb(p_priv->inack_urb);
stop_urb(p_priv->outcont_urb);
for (i = 0; i < 2; i++) {
stop_urb(p_priv->in_urbs[i]);
stop_urb(p_priv->out_urbs[i]);
}
usb_free_urb(p_priv... | false | false | false | false | false | 0 |
fgetsetversion(const char *name, unsigned long *get_version, unsigned long set_version)
{
#if HAVE_EXT2_IOCTLS
int fd, r;
IF_LONG_IS_WIDER(int ver;)
fd = open(name, O_RDONLY | O_NONBLOCK);
if (fd == -1)
return -1;
if (!get_version) {
IF_LONG_IS_WIDER(
ver = (int) set_version;
r = ioctl(fd, EXT2_IOC_SETV... | false | false | false | false | true | 1 |
tdb_unlock_record(struct tdb_context *tdb, tdb_off_t off)
{
struct tdb_traverse_lock *i;
uint32_t count = 0;
if (tdb->allrecord_lock.count) {
return 0;
}
if (off == 0)
return 0;
for (i = &tdb->travlocks; i; i = i->next)
if (i->off == off)
count++;
return (count == 1 ? tdb_brunlock(tdb, F_RDLCK, off, 1... | false | false | false | false | false | 0 |
addIsotopeToAtom(gchar* symbol, gint atomicNumber, gint iMass, gdouble rMass, gdouble abundance)
{
gint i = (gint)atomicNumber-1;
gint j = 0;
if(i>=NATOMS) return;
if(i<0) return;
if(strcmp(symbol,"Xx")==0) return;
if(strcmp(symbol,"X")==0) return;
if(i>=109) return;
if(AtomsProp[i].nIsotopes>= MAXISOTOP) retur... | false | false | false | false | false | 0 |
set(const UnicodeString& pattern, FormatParser* fp, PtnSkeleton& skeletonResult) {
int32_t i;
for (i=0; i<UDATPG_FIELD_COUNT; ++i) {
skeletonResult.type[i]=NONE;
}
fp->set(pattern);
for (i=0; i < fp->itemNumber; i++) {
UnicodeString field = fp->items[i];
if ( field.charAt(0) ... | false | false | false | false | false | 0 |
vpip_get_global(int property)
{
switch (property) {
case vpiTimeUnit:
case vpiTimePrecision:
return vpip_get_time_precision();
default:
fprintf(stderr, "vpi error: bad global property: %d\n", property);
assert(0);
return vpiUndefined;
}
} | false | false | false | false | false | 0 |
isinxt (xfs_fileoff_t key, xfs_fileoff_t offset, xfs_filblks_t len)
{
return (key >= offset) ? (key < offset + len ? 1 : 0) : 0;
} | false | false | false | false | false | 0 |
buildPullDown(MSMenuBarItem *menuHead_, A data_, S *syms_,
int numSyms_)
{
if (isSlotFiller(data_)==MSTrue)
{
MSPulldownMenu *pd = new MSPulldownMenu(menuHead_);
pd->font(menuHead_->font());
buildCascades(pd, data_, syms_, numSyms_);
}
} | false | false | false | false | false | 0 |
try_read_udp(conn *c) {
int res;
assert(c != NULL);
c->request_addr_size = sizeof(c->request_addr);
res = recvfrom(c->sfd, c->rbuf, c->rsize,
0, &c->request_addr, &c->request_addr_size);
if (res > 8) {
unsigned char *buf = (unsigned char *)c->rbuf;
STATS_LOCK();
... | false | false | false | false | false | 0 |
__remove_dirty_segment(struct f2fs_sb_info *sbi, unsigned int segno,
enum dirty_type dirty_type)
{
struct dirty_seglist_info *dirty_i = DIRTY_I(sbi);
if (test_and_clear_bit(segno, dirty_i->dirty_segmap[dirty_type]))
dirty_i->nr_dirty[dirty_type]--;
if (dirty_type == DIRTY) {
struct seg_entry *sentry = get_se... | false | false | false | false | false | 0 |
btrfs_alloc_from_cluster(struct btrfs_block_group_cache *block_group,
struct btrfs_free_cluster *cluster, u64 bytes,
u64 min_start, u64 *max_extent_size)
{
struct btrfs_free_space_ctl *ctl = block_group->free_space_ctl;
struct btrfs_free_space *entry = NULL;
struct rb_node *node;
u64 ret = 0;
spin... | false | false | false | false | false | 0 |
ath_rx_edma_buf_link(struct ath_softc *sc,
enum ath9k_rx_qtype qtype)
{
struct ath_hw *ah = sc->sc_ah;
struct ath_rx_edma *rx_edma;
struct sk_buff *skb;
struct ath_rxbuf *bf;
rx_edma = &sc->rx.rx_edma[qtype];
if (skb_queue_len(&rx_edma->rx_fifo) >= rx_edma->rx_fifo_hwsize)
return false;
bf = list_first_... | false | false | false | false | false | 0 |
GetOutputWidth(COLORTYPE color)
// since we return 1-for-1, just return result first call
{
if (myplane == color)
{
return compressedsize;
}
else
{
return raster.rastersize[color];
}
} | false | false | false | false | false | 0 |
gfork_i_state_next(
gfork_i_state_t current_state,
gfork_i_events_t event)
{
gfork_i_state_t new_state;
new_state = gfork_l_state_tansitions[current_state][event];
GlobusGForkDebugState(
gfork_l_state_names[current_state],
gfork_l_state... | false | false | false | false | false | 0 |
set_view()
{
int i;
TBOOLEAN was_comma = TRUE;
static const char errmsg1[] = "rot_%c must be in [0:%d] degrees range; view unchanged";
static const char errmsg2[] = "%sscale must be > 0; view unchanged";
double local_vals[4];
c_token++;
if (equals(c_token,"map")) {
splot_map = TRUE;
... | false | false | false | false | false | 0 |
dSScpy(String *dest, const conString *src, const char *file, int line)
{
if (dest->charattrs && !src->charattrs) {
Sfree(dest, dest->charattrs);
dest->charattrs = NULL;
}
dest->len = src->len;
lcheck(dest, file, line);
memcpy(dest->data, src->data ? src->data : "", src->len+1);
i... | false | false | false | false | false | 0 |
extensionsInitialized()
{
if (Utils::Log::warnPluginsCreation())
qWarning() << "XmlIOPlugin::extensionsInitialized";
// no user -> end
if (!user())
return;
if (user()->uuid().isEmpty())
return;
// initialize database
Internal::XmlIOBase::instance()->initialize();
/... | false | false | false | false | false | 0 |
decode(const std::string& input, unsigned char *output, size_t& sz)
{
size_t i = 0;
size_t l = input.size();
size_t j = 0;
while (i < l)
{
while (i < l && (input[i] == 13 || input[i] == 10))
i++;
if (i < l)
{
unsigned char b1 = (unsigned char)((rstr[(... | false | false | false | false | false | 0 |
parse(UTimeZoneFormatStyle style, const UnicodeString& text, ParsePosition& pos,
UTimeZoneTimeType* timeType /*= NULL*/) const {
UnicodeString tzID;
parse(style, text, pos, tzID, timeType);
if (pos.getErrorIndex() < 0) {
return TimeZone::createTimeZone(tzID);
}
return NULL;
} | false | false | false | false | false | 0 |
OnContextMenuEntry(wxCommandEvent& event)
{
// we have a single event handler for all popup menu entries
// This was ported from cbEditor and used for the basic operations:
// Switch to, close, save, etc.
const int id = event.GetId();
m_pData->m_CloseMe = false;
if (id == idCloseMe)
{
... | false | false | false | false | false | 0 |
handleVectorSadIntrinsic(IntrinsicInst &I) {
const unsigned SignificantBitsPerResultElement = 16;
bool isX86_MMX = I.getOperand(0)->getType()->isX86_MMXTy();
Type *ResTy = isX86_MMX ? IntegerType::get(*MS.C, 64) : I.getType();
unsigned ZeroBitsPerResultElement =
ResTy->getScalarSizeInBits() - Si... | false | false | false | false | false | 0 |
trigger_processing(ViewHelper *self, GeglRectangle roi)
{
//GeglRectangle roi;
// PERFORMANCE: determine the area that the view widget is interested in,
// and calculate the intersection with the invalidated rect
// and only pass this value as the ROI
// Would then also have to follow changes in... | false | false | false | false | false | 0 |
collect_if(if_stat *s)
{
ullong data[4];
int i;
if (rdval(get_file(&proc_net_dev), s->device_colon, data, 1, 3, 9, 11)) {
put_question_marks(10);
return;
}
for (i=0; i<4; i++) {
ullong old = s->old[i];
if (data[i] < old) old = data[i]; //sanitize
s->old[i] = data[i];
data[i] -= old;
}
put_c(data[1... | false | false | false | false | false | 0 |
empathy_account_selector_dialog_dispose (GObject *obj)
{
EmpathyAccountSelectorDialog *self = (EmpathyAccountSelectorDialog *) obj;
g_list_free_full (self->priv->accounts, g_object_unref);
self->priv->accounts = NULL;
tp_clear_object (&self->priv->model);
G_OBJECT_CLASS (empathy_account_selector_dialog_par... | false | false | false | false | false | 0 |
g3d_stream_open_zip(const gchar *filename, const gchar *subfile)
{
GsfInput *input;
GError *error = NULL;
input = gsf_input_stdio_new(filename, &error);
if(error != NULL) {
g_warning("error opening container file '%s': %s", filename,
error->message);
g_error_free(error);
return NULL;
}
return g3d_strea... | false | false | false | false | false | 0 |
wrap_help (const char *help,
const char *item,
unsigned int item_width,
unsigned int columns)
{
unsigned int col_width = LEFT_COLUMN;
unsigned int remaining, room, len;
remaining = strlen (help);
do
{
room = columns - 3 - MAX (col_width, item_width);
if (room > columns)
room = 0;
... | false | false | false | false | false | 0 |
seek_object(state * state) {
int i;
for (i = state->seen; i < state->len; i++) {
if (state->counter++ >= state->block_size)
break;
switch(state->str[i]) {
/* ignore spaces */
CASESPACE
state->seen = i + 1;
break;
/* usually quotting */
case '"' :
case '\'':
state->marker = i;
... | 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.