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 |
|---|---|---|---|---|---|---|
get_input_bytes(RECSTREAM *rstrm, caddr_t addr,
int len, bool_t do_align)
{
int current;
if (rstrm->in_nonblock) {
/*
* Data should already be in the rstrm buffer, so we just
* need to copy it to 'addr'.
*/
current = (int)(rstrm->in_boundry - rstrm->in_finger);
if (len > current)
return (FALSE);
... | false | true | false | false | false | 1 |
ho_objmap_new (const int width, const int height)
{
ho_objmap *m_new = NULL;
/*
* allocate memory for pixbuf
*/
m_new = (ho_objmap *) malloc (sizeof (ho_objmap));
if (!m_new)
{
return NULL;
}
/* read header */
m_new->x = 0;
m_new->y = 0;
m_new->width = width;
m_new->height = height;
... | false | false | false | false | false | 0 |
slotJobFinished(Plasma::ServiceJob *job)
{
kDebug() << "engine ready!";
QString engineName = job->parameters()["EngineName"].toString();
QString location = job->destination();
QPair<QString, QString> pair(location, engineName);
kDebug() << "pair = " << pair;
if (!m_consumer->m_remoteEngines.cont... | false | false | false | false | false | 0 |
setWorkspace(int n) {
unsigned int old_wkspc = m_workspace_number;
m_workspace_number = n;
// notify workspace change
if (m_initialized && old_wkspc != m_workspace_number) {
fbdbg<<this<<" emit workspace signal"<<endl;
m_workspacesig.emit(*this);
}
} | false | false | false | false | false | 0 |
insert_into_list (drmaa_job_template_t *jt)
{
int count = 0;
drmaa_job_template_t **tmp_list = NULL;
int tmp_length = 0;
pthread_mutex_lock(&list_mutex);
/* If we haven't initialized the template list yet, do so. */
if (job_templates == NULL) {
list_length = TEMPLATE_LIST_LENGTH;
job_... | false | false | false | false | false | 0 |
cbf_make_compressdata (cbf_compress_data **data, cbf_file *file)
{
/* Does the file exist? */
if (!file)
return CBF_ARGUMENT;
if (!file->stream)
return CBF_ARGUMENT;
/* Allocate memory */
cbf_failnez (cbf_alloc ((void **) data, NULL, sizeof ... | false | false | false | false | false | 0 |
histogram_cb(gpointer data, guint action, GtkWidget *menu_item)
{
GtkWidget *window = data;
GtkWidget *dialog, *close, *darea;
void *ret;
GtkWidget* create_imadj_dialog (void);
struct image_channel *i_channel;
ret = gtk_object_get_data(GTK_OBJECT(window), "i_channel");
if (ret == NULL) /* no channel */
return... | false | false | false | false | false | 0 |
read_pack_length(uint version, const uchar *buf, ulong *length)
{
if (buf[0] < 254)
{
*length= buf[0];
return 1;
}
else if (buf[0] == 254)
{
*length= uint2korr(buf + 1);
return 3;
}
if (version == 1) /* old format */
{
*length= uint3korr(buf + 1);
return 4;
}
else
{
*le... | false | false | false | false | false | 0 |
set_GATE(Bit8u cnum, bx_bool data)
{
if (cnum>MAX_COUNTER) {
BX_ERROR(("Counter number incorrect in 82C54 set_GATE"));
} else {
counter_type &thisctr = counter[cnum];
if (!((thisctr.GATE&&data) || (!(thisctr.GATE||data)))) {
BX_INFO(("Changing GATE %d to: %d",cnum,data));
thisctr.GATE=data;
... | false | false | false | false | false | 0 |
glade_accel_read (GladeXmlNode * node, gboolean require_signal)
{
GladeAccelInfo *ainfo;
gchar *key, *modifiers, *signal;
g_return_val_if_fail (node != NULL, NULL);
if (!glade_xml_node_verify (node, GLADE_TAG_ACCEL))
return NULL;
/* Get from xml... */
key = glade_xml_get_property_string_required
... | false | false | false | false | false | 0 |
getPICJumpTableRelocBase(SDValue Table,
SelectionDAG &DAG) const {
// If our PIC model is GP relative, use the global offset table as the base.
unsigned JTEncoding = getJumpTableEncoding();
if ((JTEncoding == MachineJumpTableInfo::EK_GPRel64BlockAddress) ||
... | false | false | false | false | false | 0 |
isci_request_stp_request_construct(struct isci_request *ireq)
{
struct sas_task *task = isci_request_access_task(ireq);
struct host_to_dev_fis *fis = &ireq->stp.cmd;
struct ata_queued_cmd *qc = task->uldd_task;
enum sci_status status;
dev_dbg(&ireq->isci_host->pdev->dev,
"%s: ireq = %p\n",
__func__,
ireq);
... | false | false | false | false | false | 0 |
DSDPEventLogRegister(const char *ename, int *eventid){
int id;
id=eventlog.nevents;
if (id<0 || id>=DSDP_MAX_EVENTS){ *eventid=DSDP_MAX_EVENTS-1;return 0;}
eventlog.event[id].begintime=0;
eventlog.event[id].totaltime=0;
eventlog.event[id].counter=0;
strncpy(eventlog.event[id].ename,ename,DSDP_MAX_EVENT_NA... | false | true | false | false | false | 1 |
heapup(node_t * v)
{
int i, par;
node_t *u;
for (i = ND_heapindex(v); i > 0; i = par) {
par = (i - 1) / 2;
u = Heap[par];
if (ND_dist(u) <= ND_dist(v))
break;
Heap[par] = v;
ND_heapindex(v) = par;
Heap[i] = u;
ND_heapindex(u) = i;
}
} | false | false | false | false | false | 0 |
DROUND(double d)
{
return d >= 0.0 ? (int)(d + 0.5) : (int)( d - ((int)d-1) + 0.5 ) + ((int)d-1);
} | false | false | false | false | false | 0 |
SWIG_AsCharPtrAndSize(SV *obj, char** cptr, size_t* psize, int *alloc)
{
if (SvMAGICAL(obj)) {
SV *tmp = sv_newmortal();
SvSetSV(tmp, obj);
obj = tmp;
}
if (SvPOK(obj)) {
STRLEN len = 0;
char *cstr = SvPV(obj, len);
size_t size = len + 1;
if (cptr) {
if (alloc) {
if (*alloc... | false | true | false | false | false | 1 |
configstrpair2list(void *opt, char *cmd, char *arg1, char *arg2, int rc) {
/* comma-separated list in arg2 instead of arg1 */
char *t;
if (arg2 == NULL) {
configstrpair(opt, cmd, arg1, arg2, rc); /* will warn about args if nec. */
return;
}
if ((t = strtok(arg2, ",")) == NULL) {
badwarn(cmd, TRUE... | false | false | false | false | false | 0 |
mono_escape_uri_string (const gchar *string)
{
GString *str = g_string_new ("");
char *ret;
int c;
while ((c = (guchar) *string) != 0){
if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '-' && c <= ':') || (c >= '&' && c <= '*'))
g_string_append_c (str, c);
else if (c == '!' || c == '=' || c == ... | false | false | false | false | false | 0 |
removeCallback(const MSSymbol& name_,void *pIdentifier_)
{
if (_pCallbackVector!=0)
{
unsigned n=_pCallbackVector->length();
for (unsigned i=0;i<n;i++)
{
CallbackNode *node=_pCallbackVector->node(i);
if (node!=0&&node->_name==name_&&node->_pIdentifier==pIdentifier_)
{
delete node;
_pCal... | false | false | false | false | false | 0 |
triangulate(__isl_keep isl_cell *cell, __isl_keep isl_vec *v,
int *simplex_ids, int n_simplex, int *other_ids, int n_other,
int (*fn)(__isl_take isl_cell *simplex, void *user), void *user)
{
int i, j, k;
int d, nparam;
int *ids;
isl_ctx *ctx;
isl_basic_set *vertex;
isl_basic_set *bset;
ctx = isl_cell_get_ctx(... | false | false | false | false | false | 0 |
QueryColorSpace(
opvp_int_t *pnum, opvp_cspace_t *pcspace)
{
int r;
int i;
if (!supportQueryColorSpace) {
*opvpErrorNo_0_2 = OPVP_NOTSUPPORTED_0_2;
return -1;
}
if ((r = procs_0_2->QueryColorSpace(printerContext_0_2,
(OPVP_ColorSpace *)pcspace,pnum)) != OPVP_OK) {
/* error */
return (opvp_r... | false | false | false | false | false | 0 |
previewbutton_cb(Fl_Button *b, printspect *panel)
{
dbgprintf("preview Button pressed on print spect panel\n");
if (b->value()) panel->doThePreview();
else panel->closePreview();
return;
} | false | false | false | false | false | 0 |
handleMoveMouse(const XMotionEvent &motion, int &newX, int &newY) {
int mouseX = motion.x_root;
int mouseY = motion.y_root;
//constrainMouseToWorkspace(mouseX, mouseY);
newX = mouseX - buttonDownX;
newY = mouseY - buttonDownY;
constrainPositionByModifier(newX, newY, motion);
newX += bord... | false | false | false | false | false | 0 |
wusb_crypto_init(void)
{
int result;
if (debug_crypto_verify) {
result = wusb_key_derive_verify();
if (result < 0)
return result;
return wusb_oob_mic_verify();
}
return 0;
} | false | false | false | false | false | 0 |
removeObject(QObject *obj)
{
if (obj == 0) {
qWarning() << "PluginManagerPrivate::removeObject(): trying to remove null object";
return;
}
if (!allObjects.contains(obj)) {
qWarning() << "PluginManagerPrivate::removeObject(): object not in list:"
<< obj << obj->objectName... | false | false | false | false | false | 0 |
fopen64(const char* s, const char* t)
{
FILE *f;
if(initialize_functions())
{
errno=ENOMEM;
return NULL;
}
if(!getenv("COWDANCER_IGNORE")&&
likely_fopen_write(t))
{
debug_cowdancer_2 ("fopen64", s);
if(check_inode_and_copy(s,1))
{
errno=ENOMEM;
return NULL;
}
}... | false | false | false | false | true | 1 |
fillRejectionReasons()
{
if (rejections_.size() == 0)
{
rejections_.resize(DummyEnd) ;
rejections_[NoneAccepted] = "Cut was accepted";
rejections_[SmallViolation] = "Violation of the cut is too small ";
rejections_[SmallCoefficient] = "There is a small coefficient we can not get ... | false | false | false | false | false | 0 |
convert_data(void)
{
struct vpwentry vpw;
int status = 1;
memset(&vpw, 0, sizeof vpw);
if (!vpwentry_import(&vpw, &virtuser, &data))
return 0;
status = str_copyb(&vpw.pass, "$0$", 3)
&& str_cat(&vpw.pass, &cvm_module_credentials[CVM_CRED_PASSWORD])
&& vpwentry_export(&vpw, &data);
vpwentry_free(... | false | false | false | false | false | 0 |
xorline(int x1,
int y1,
int x2,
int y2,
char actcol)
{
collategraphicoperations cgs ( x1, y1, x2, y2 );
float m, b;
int w;
float yy1, yy2, xx1, xx2;
if ( x1 == x2) {
for (w=y1;w<=y2 ;w++ ) {
putpixel( x1, w, getpixel ( x1, w ) ^ actcol);
... | false | false | false | false | false | 0 |
get_default_realm_options(realm_options_t* ro)
{
if(ro) {
ur_string_map_lock(realms);
ns_bcopy(&(default_realm_params_ptr->options),ro,sizeof(realm_options_t));
ur_string_map_unlock(realms);
}
} | false | false | false | false | false | 0 |
enqueue(int data)
{
struct Node *newNode;
newNode = (struct Node *)malloc(sizeof(struct Node)); // allocate a new memory for newNode.
if(newNode)
{
if(front == NULL)
{
newNode->Data=data;
newNode->next=front;
front=newNode;
... | false | false | false | false | false | 0 |
callvotepacket (int cn, voteinfo *v = curvote)
{ // FIXME, it would be far smart if the msg buffer from SV_CALLVOTE was simply saved
int n_yes = 0, n_no = 0;
loopv(clients) if(clients[i]->type!=ST_EMPTY)
{
if ( clients[i]->vote == VOTE_YES ) n_yes++;
else if ( clients[i]->vote == VOTE_NO ) n... | false | false | false | false | false | 0 |
ds278x_bat_update(struct ds278x_info *info)
{
int old_status = info->status;
int old_capacity = info->capacity;
ds278x_get_status(info, &info->status);
if ((old_status != info->status) || (old_capacity != info->capacity))
power_supply_changed(info->battery);
} | false | false | false | false | false | 0 |
evd_connection_starttls_finish (EvdConnection *self,
GAsyncResult *result,
GError **error)
{
gboolean res;
g_return_val_if_fail (EVD_IS_CONNECTION (self), FALSE);
g_return_val_if_fail (g_simple_async_result_is_valid (result,
... | false | false | false | false | false | 0 |
invoke_main_func (void *body_data)
{
struct main_func_closure *closure = (struct main_func_closure *) body_data;
scm_set_program_arguments (closure->argc, closure->argv, 0);
(*closure->main_func) (closure->closure, closure->argc, closure->argv);
scm_restore_signals ();
/* This tick gives any pending
* a... | false | false | false | false | false | 0 |
operator+ (const String& lhs, const char* rhs)
{
#if defined(TARGET_WIN32) || defined(TARGET_POSIX)
return lhs.Str() + rhs;
#else
#warning "Not implemented for this toolchain."
UNUSED(lhs), UNUSED(rhs);
return String();
#endif
... | false | false | false | false | false | 0 |
dict_list(argvars, rettv, what)
typval_T *argvars;
typval_T *rettv;
int what;
{
list_T *l2;
dictitem_T *di;
hashitem_T *hi;
listitem_T *li;
listitem_T *li2;
dict_T *d;
int todo;
rettv->vval.v_number = 0;
if (argvars[0].v_type != VAR_DICT)
{
EMSG(_(e_dictreq));
re... | false | false | false | false | false | 0 |
xlsx_cell_expr_end (GsfXMLIn *xin, G_GNUC_UNUSED GsfXMLBlob *blob)
{
XLSXReadState *state = (XLSXReadState *)xin->user_state;
GnmParsePos pp;
if (NULL == state->texpr) {
parse_pos_init (&pp, NULL, state->sheet,
state->pos.col, state->pos.row);
state->texpr = xlsx_parse_expr (xin, xin->content->str, &pp);
i... | false | false | false | false | false | 0 |
visu_box_getGlobalSize(VisuBox *box, gboolean withExt)
{
g_return_val_if_fail(VISU_IS_BOX(box), G_MAXFLOAT);
if (withExt)
return box->priv->extens[1] + box->priv->margin;
else
return box->priv->extens[0];
} | false | false | false | false | false | 0 |
create_in_stream(apr_socket_t *socket, apr_file_t *in,
apr_thread_t **thread) {
apr_status_t status;
apr_threadattr_t *tattr;
stream_t *stream;
apr_pool_t *pool;
apr_pool_create(&pool, NULL);
if ((status = apr_threadattr_create(&tattr, pool)) != APR_SUCCESS) {
ret... | false | false | false | false | false | 0 |
save_subexpr(bp)
regbehind_T *bp;
{
int i;
/* When "need_clear_subexpr" is set we don't need to save the values, only
* remember that this flag needs to be set again when restoring. */
bp->save_need_clear_subexpr = need_clear_subexpr;
if (!need_clear_subexpr)
{
for (i = 0; i < NSUBEXP; ++... | false | false | false | false | false | 0 |
get_commit_files_foreach(GtkTreeModel * model, G_GNUC_UNUSED GtkTreePath * path, GtkTreeIter * iter,
gpointer data)
{
GSList **files = (GSList **) data;
gboolean commit;
gchar *filename;
gtk_tree_model_get(model, iter, COLUMN_COMMIT, &commit, -1);
if (!commit)
return FALSE;
gtk_tree_model_get(model, iter,... | false | false | false | false | false | 0 |
mozldap_ldap_getnextfilter( LDAPFiltDesc *lfdp )
{
LDAPFiltInfo *fip;
if ( lfdp == NULL || ( fip = lfdp->lfd_curfip ) == NULL ) {
return( NULL );
}
lfdp->lfd_curfip = fip->lfi_next;
mozldap_ldap_create_filter( lfdp->lfd_filter, LDAP_FILT_MAXSIZ,
fip->lfi_filter, lfdp->lfd_filtprefix, lfdp-... | false | false | false | false | false | 0 |
test_write_file(struct pci_slot *pci_slot, const char *buf,
size_t count)
{
struct hotplug_slot *slot = pci_slot->hotplug;
unsigned long ltest;
u32 test;
int retval = 0;
ltest = simple_strtoul (buf, NULL, 10);
test = (u32)(ltest & 0xffffffff);
dbg("test = %d\n", test);
if (!try_module_get(slot->ops-... | false | false | false | false | false | 0 |
fromhex ( char digit ) {
char d = toupper(digit);
if (!isxdigit(digit)) return 0;
if (isdigit(d)) {
return d - '0';
} else {
return (int) ( d - 'A' ) + 10;
}
} | false | false | false | false | false | 0 |
dw_dma_cyclic_stop(struct dma_chan *chan)
{
struct dw_dma_chan *dwc = to_dw_dma_chan(chan);
struct dw_dma *dw = to_dw_dma(dwc->chan.device);
unsigned long flags;
spin_lock_irqsave(&dwc->lock, flags);
dwc_chan_disable(dw, dwc);
spin_unlock_irqrestore(&dwc->lock, flags);
} | false | false | false | false | false | 0 |
__read(int fd, void *buf, size_t count)
{
ssize_t len, pos = 0;
while (count > 0) {
len = read(fd, buf + pos, count);
if (len <= 0)
return len;
count -= len;
pos += len;
}
return pos;
} | false | false | false | false | false | 0 |
zListHasPrev(zList* l){
if((l->current != l->head) &&
(l->current->prev != l->head)){
return true;
}
else{
return false;
}
} | false | false | false | false | false | 0 |
sendSASRelayPacket(uint8_t* sh, std::string render) {
uint8_t confMac[MAX_DIGEST_LENGTH];
uint32_t macLen;
uint8_t* hkey, *ekey;
// If we are responder then the PBX used it's Initiator keys
if (myRole == Responder) {
hkey = hmacKeyR;
ekey = zrtpKeyR;
// TODO: check signatur... | false | false | false | false | false | 0 |
bu21013_read_block_data(struct bu21013_ts_data *data, u8 *buf)
{
int ret, i;
for (i = 0; i < I2C_RETRY_COUNT; i++) {
ret = i2c_smbus_read_i2c_block_data
(data->client, BU21013_SENSORS_BTN_0_7_REG,
LENGTH_OF_BUFFER, buf);
if (ret == LENGTH_OF_BUFFER)
return 0;
}
return -EINVAL;
} | false | false | false | false | false | 0 |
check_gss_err(OM_uint32 major_status, OM_uint32 minor_status, const char *function)
{
if (GSS_ERROR(major_status)) {
OM_uint32 maj_stat, min_stat;
OM_uint32 msg_ctx = 0;
gss_buffer_desc status_string;
char buf[1024];
size_t len;
len = 0;
msg_ctx = 0;
while (!msg_ctx) {
/* convert major status code (GS... | false | false | false | false | false | 0 |
print_lo_result(const char *fmt,...)
{
va_list ap;
if (!pset.quiet)
{
if (pset.popt.topt.format == PRINT_HTML)
fputs("<p>", pset.queryFout);
va_start(ap, fmt);
vfprintf(pset.queryFout, fmt, ap);
va_end(ap);
if (pset.popt.topt.format == PRINT_HTML)
fputs("</p>\n", pset.queryFout);
else
fputs(... | false | false | false | false | true | 1 |
AddChild(int childIdx)
{
if (childIdx < 0)
return false;
m_Children.insert(childIdx);
return true;
} | false | false | false | false | false | 0 |
iwl_pcie_free_fw_monitor(struct iwl_trans *trans)
{
struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
if (!trans_pcie->fw_mon_page)
return;
dma_unmap_page(trans->dev, trans_pcie->fw_mon_phys,
trans_pcie->fw_mon_size, DMA_FROM_DEVICE);
__free_pages(trans_pcie->fw_mon_page,
get_... | false | false | false | false | false | 0 |
DragDataGet(GtkWidget *widget, GdkDragContext *context,
GtkSelectionData *selection_data, guint info, guint) {
ScintillaGTK *sciThis = ScintillaFromWidget(widget);
try {
sciThis->dragWasDropped = true;
if (!sciThis->sel.Empty()) {
sciThis->GetSelection(selection_data, info, &sciT... | false | false | false | false | false | 0 |
list_print(PyListObject *op, FILE *fp, int flags)
{
int rc;
Py_ssize_t i;
PyObject *item;
rc = Py_ReprEnter((PyObject*)op);
if (rc != 0) {
if (rc < 0)
return rc;
Py_BEGIN_ALLOW_THREADS
fprintf(fp, "[...]");
Py_END_ALLOW_THREADS
return 0;
}
... | false | false | false | false | false | 0 |
strchr_stop(char *str, char c, char stop) {
for(; *str != 0 && *str != stop && *str != c; str++) ;
if (*str == c)
return str;
return NULL;
} | false | false | false | false | false | 0 |
rebuild_table (DBusHashTable *table)
{
int old_size;
int new_buckets;
DBusHashEntry **old_buckets;
DBusHashEntry **old_chain;
DBusHashEntry *entry;
dbus_bool_t growing;
/*
* Allocate and initialize the new bucket array, and set up
* hashing constants for new array size.
*/
growing = table->... | false | false | false | false | false | 0 |
bpf_patch_insn_single(struct bpf_prog *prog, u32 off,
const struct bpf_insn *patch, u32 len)
{
u32 insn_adj_cnt, insn_rest, insn_delta = len - 1;
struct bpf_prog *prog_adj;
/* Since our patchlet doesn't expand the image, we're done. */
if (insn_delta == 0) {
memcpy(prog->insnsi + off, patch, sizeof(*p... | false | false | false | false | false | 0 |
caml_string_set(value str, value index, value newval)
{
intnat idx = Long_val(index);
if (idx < 0 || idx >= caml_string_length(str)) caml_array_bound_error();
Byte_u(str, idx) = Int_val(newval);
return Val_unit;
} | false | false | false | false | false | 0 |
setValue(int value) {
if(baked && this->value == value) return;
this->value = value;
modified = true;
initialized = true;
} | false | false | false | false | false | 0 |
setDynamicAttribute( ActivationType type, Attribute::Ptr attribute )
{
if (type < 0 || type > ActivateCaretIn)
return;
d->dynamicAttributes[type] = attribute;
} | false | false | false | false | false | 0 |
packspaces(zchar *src, zchar *dst)
{
int killing = 0;
while (*src)
{
if (*src == 0x20202020)
*src = ' ';
if (*src == ' ')
killing++;
else
killing = 0;
if (killing > 2)
src++;
else
*dst++ = *src++;
}
*dst = 0;
} | false | false | false | false | false | 0 |
process_one(struct fuse_opt_context *ctx, const char *arg)
{
if (ctx->nonopt || arg[0] != '-')
return call_proc(ctx, arg, FUSE_OPT_KEY_NONOPT, 0);
else if (arg[1] == 'o') {
if (arg[2])
return process_option_group(ctx, arg + 2);
else {
if (next_arg(ctx, arg) == -1)... | false | false | false | false | false | 0 |
orte_iof_hnp_stdin_check(int fd)
{
#if defined(HAVE_TCGETPGRP)
if( isatty(fd) && (getpgrp() != tcgetpgrp(fd)) ) {
return false;
}
#endif
return true;
} | false | false | false | false | false | 0 |
task_hide_callback ( GtkAction *act )
{
TaskData *td;
int i, st;
st = get_selected_task ();
if ( st < 0 || ! num_visible_tasks ) {
create_confirm_window ( CONFIRM_ERROR,
gettext("Error"),
gettext("You have not selected\na task to hide."),
gettext("Ok"), NULL, NULL,
NULL, NULL, NULL,... | false | false | false | false | false | 0 |
snd_ak4117_rx_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct ak4117 *chip = snd_kcontrol_chip(kcontrol);
int change;
u8 old_val;
spin_lock_irq(&chip->lock);
old_val = chip->regmap[AK4117_REG_IO];
change = !!ucontrol->value.integer.value[0] != ((old_val & AK4117_IPS) ? 1... | false | false | false | false | false | 0 |
gst_ebml_read_utf8 (GstEbmlRead * ebml, guint32 * id, gchar ** str)
{
GstFlowReturn ret;
#ifndef GST_DISABLE_GST_DEBUG
guint64 oldoff = gst_ebml_read_get_pos (ebml);
#endif
ret = gst_ebml_read_string (ebml, id, str);
if (ret != GST_FLOW_OK)
return ret;
if (str != NULL && *str != NULL && **str != '\0' &... | false | false | false | false | false | 0 |
create_cmd(UAContext *ua, const char *cmd)
{
POOL *pool;
if (!open_client_db(ua)) {
return 1;
}
pool = get_pool_resource(ua);
if (!pool) {
return 1;
}
switch (create_pool(ua->jcr, ua->db, pool, POOL_OP_CREATE)) {
case 0:
ua->error_msg(_("Error: Pool %s already exists.\n"
... | false | false | false | false | false | 0 |
sd_config_write_same(struct scsi_disk *sdkp)
{
struct request_queue *q = sdkp->disk->queue;
unsigned int logical_block_size = sdkp->device->sector_size;
if (sdkp->device->no_write_same) {
sdkp->max_ws_blocks = 0;
goto out;
}
/* Some devices can not handle block counts above 0xffff despite
* supporting WRIT... | false | false | false | false | false | 0 |
noise_codebook_quant(
spx_word16_t target[], /* target vector */
spx_coef_t ak[], /* LPCs for this subframe */
spx_coef_t awk1[], /* Weighted LPCs for this subframe */
spx_coef_t awk2[], /* Weighted LPCs for this subframe */
const void *par, /* Codebook/search parameters*/
int p, ... | false | false | false | false | false | 0 |
efx_ptp_deliver_rx_queue(struct sk_buff_head *q)
{
struct sk_buff *skb;
while ((skb = skb_dequeue(q))) {
local_bh_disable();
netif_receive_skb(skb);
local_bh_enable();
}
} | false | false | false | false | false | 0 |
get_page_count( GtkPrintContext *psContext, PrintData *psData ) {
gdouble fWidth, fHeight;
gint nLayoutH;
gint nLayoutV;
if ( psData == NULL ) {
return -1;
}
fWidth = gtk_print_context_get_width( psContext );
fHeight = gtk_print_context_get_height( psContext );
pango_layout_set_width( psData -> psLayout, f... | false | false | false | false | false | 0 |
uninitialized_error_msg (const _cl_ring_element& obj_x, const _cl_ring_element& obj_y)
{
std::ostringstream buf;
fprint(buf, "Uninitialized ring elements @0x");
fprinthexadecimal(buf, (unsigned long)(void*)&obj_x);
fprint(buf, ": 0x");
fprinthexadecimal(buf, (unsigned long)obj_x.rep.word);
fprint(buf, ", @... | false | false | false | false | false | 0 |
buferror(int errnum, char *buf, size_t buflen)
{
#ifdef _GNU_SOURCE
char *b = strerror_r(errno, buf, buflen);
if (b != buf) {
strncpy(buf, b, buflen);
buf[buflen-1] = '\0';
}
return (0);
#else
return (strerror_r(errno, buf, buflen));
#endif
} | false | true | false | false | false | 1 |
replaceSuccessorsPhiUsesWith(BasicBlock *New) {
TerminatorInst *TI = getTerminator();
if (!TI)
// Cope with being called on a BasicBlock that doesn't have a terminator
// yet. Clang's CodeGenFunction::EmitReturnBlock() likes to do this.
return;
for (BasicBlock *Succ : TI->successors()) {
// N.B. S... | false | false | false | false | false | 0 |
tp_g_key_file_get_uint64 (GKeyFile *key_file,
const gchar *group_name,
const gchar *key,
GError **error)
{
gchar *s, *end;
guint64 v;
g_return_val_if_fail (key_file != NULL, -1);
g_return_val_if_fail (group_name != NULL, -1);
g_ret... | false | false | false | false | false | 0 |
Sequence_get_substr(Sequence *s, gint start, gint length){
register gchar *str = g_new(gchar, length+1);
Sequence_strncpy(s, start, length, str);
str[length] = '\0';
return str;
} | false | false | false | false | false | 0 |
VarParseShort(VarParser *vp, Boolean *freeResult)
{
char vname[2];
Var *v;
char *value;
vname[0] = vp->ptr[0];
vname[1] = '\0';
vp->ptr++; /* consume single letter */
v = VarFindAny(vname, vp->ctxt);
if (v != NULL) {
value = VarExpand(v, vp);
*freeResult = TRUE;
return (value);
}
/*
* If substitut... | false | false | false | false | false | 0 |
ReadVolume(void *buffer)
{
const int width = m_InternalImage->m_Width;
const int height = m_InternalImage->m_Height;
for ( unsigned int page = 0; page < m_InternalImage->m_NumberOfPages; page++ )
{
if ( m_InternalImage->m_IgnoredSubFiles > 0 )
{
int32 subfiletype = 6;
if ( TIFFGetField... | false | false | false | false | false | 0 |
Display_layerbar(void)
{
word x_off=0;
word button_width = LAYER_SPRITE_WIDTH;
word button_number = Main_backups->Pages->Nb_layers;
word horiz_space;
word current_button;
word repeats=1;
if (! Menu_bars[MENUBAR_LAYERS].Visible)
return;
// Available space in pixels
horiz_space = Screen_width ... | false | false | false | false | false | 0 |
threshold_update_style(AmitkThreshold * threshold) {
AmitkThresholdStyle i_style;
if (threshold->minimal) return; /* no style in minimal configuration */
switch(AMITK_DATA_SET_THRESHOLD_STYLE(threshold->data_set)) {
case AMITK_THRESHOLD_STYLE_CENTER_WIDTH:
gtk_label_set_text(GTK_LABEL(threshold->min_max_l... | false | false | false | false | false | 0 |
operator==(const BulkRound::Descriptor &lhs,
const BulkRound::Descriptor &rhs)
{
return (lhs.Length() == rhs.Length()) &&
(lhs.PublicDh() == rhs.PublicDh()) &&
(lhs.XorMessageHashes() == rhs.XorMessageHashes()) &&
(lhs.CleartextHash() == rhs.CleartextHash());
} | false | false | false | false | false | 0 |
GetActiveConfig()
{
DebuggerManager::RegisteredPlugins &allPlugins = Manager::Get()->GetDebuggerManager()->GetAllDebuggers();
DebuggerManager::RegisteredPlugins::iterator it = allPlugins.find(this);
if (it == allPlugins.end())
cbAssert(false);
cbDebuggerConfiguration *config = it->second.GetCon... | false | false | false | false | false | 0 |
lj_alloc_f(void *msp, void *ptr, size_t osize, size_t nsize)
{
(void)osize;
if (nsize == 0) {
return lj_alloc_free(msp, ptr);
} else if (ptr == NULL) {
return lj_alloc_malloc(msp, nsize);
} else {
return lj_alloc_realloc(msp, ptr, nsize);
}
} | false | false | false | false | false | 0 |
socketMsg()
{
ialogV( "SO_MSG" );
int cla2 = _socket->getCla2();
QString msg;
uchar len = _socket->readChar();
for( uint i = 0; i < len; i++ ) {
msg[i] = _socket->readChar();
}
} | false | false | false | false | false | 0 |
paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * /*widget*/)
{
// TODO: real HQ rendering, skipping the pixmap (better result)!
// generate Reflection pixmap, if needed
if (m_dirty || m_pixmap.isNull() || RenderOpts::HQRendering) {
// change pixmap size to match the bou... | false | false | false | false | false | 0 |
_release_pad (GstElement * element, GstPad * pad)
{
GST_DEBUG_OBJECT (element, "Releasing pad %" GST_PTR_FORMAT, pad);
LOCK (element);
g_hash_table_remove (GES_SMART_ADDER (element)->pads_infos, pad);
UNLOCK (element);
} | false | false | false | false | false | 0 |
setDelay(FXuint ms){
delay=ms;
if(shown()){
if(options&SPLASH_DESTROY){
getApp()->addTimeout(this,ID_DELETE,delay);
}
else{
getApp()->addTimeout(this,ID_HIDE,delay);
}
}
} | false | false | false | false | false | 0 |
print_open_flags(const char *val)
{
size_t i;
unsigned int flags;
int cnt = 0;
char *out, buf[160];
errno = 0;
flags = strtoul(val, NULL, 16);
if (errno) {
asprintf(&out, "conversion error(%s)", val);
return out;
}
buf[0] = 0;
if ((flags & O_ACCMODE) == 0) {
// Handl... | false | false | false | false | false | 0 |
root_entry_lctp(struct root_entry *re)
{
if (!(re->lo & 1))
return 0;
return re->lo & VTD_PAGE_MASK;
} | false | false | false | false | false | 0 |
alloc_ai(void)
{
struct ubi_attach_info *ai;
ai = kzalloc(sizeof(struct ubi_attach_info), GFP_KERNEL);
if (!ai)
return ai;
INIT_LIST_HEAD(&ai->corr);
INIT_LIST_HEAD(&ai->free);
INIT_LIST_HEAD(&ai->erase);
INIT_LIST_HEAD(&ai->alien);
ai->volumes = RB_ROOT;
ai->aeb_slab_cache = kmem_cache_create("ubi_aeb_sla... | false | false | false | false | false | 0 |
vbo_exec_init( struct gl_context *ctx )
{
struct vbo_exec_context *exec = &vbo_context(ctx)->exec;
exec->ctx = ctx;
/* Initialize the arrayelt helper
*/
if (!ctx->aelt_context &&
!_ae_create_context( ctx ))
return;
vbo_exec_vtx_init( exec );
ctx->Driver.NeedFlush = 0;
ctx->Dri... | false | false | false | false | false | 0 |
gethandleathead(struct curl_llist *pipeline)
{
struct curl_llist_element *curr = pipeline->head;
if(curr) {
return (struct SessionHandle *) curr->ptr;
}
return NULL;
} | false | false | false | false | false | 0 |
unregister_wide_hw_breakpoint(struct perf_event * __percpu *cpu_events)
{
int cpu;
for_each_possible_cpu(cpu)
unregister_hw_breakpoint(per_cpu(*cpu_events, cpu));
free_percpu(cpu_events);
} | false | false | false | false | false | 0 |
X509_EXTENSION_create_by_OBJ(X509_EXTENSION **ex,
ASN1_OBJECT *obj, int crit, ASN1_OCTET_STRING *data)
{
X509_EXTENSION *ret;
if ((ex == NULL) || (*ex == NULL))
{
if ((ret=X509_EXTENSION_new()) == NULL)
{
X509err(X509_F_X509_EXTENSION_CREATE_BY_OBJ,ERR_R_MALLOC_FAILURE);
return(NULL);
}
}
e... | false | false | false | false | false | 0 |
move_bullet(object *op) {
sint16 new_x, new_y;
int mflags;
mapstruct *m;
/* Reached the end of its life - remove it */
if (--op->range <= 0) {
if (op->other_arch) {
explode_bullet(op);
} else {
object_remove(op);
object_free_drop_inventory(op);
... | false | false | false | false | false | 0 |
atk_text_get_range_extents (AtkText *text,
gint start_offset,
gint end_offset,
AtkCoordType coord_type,
AtkTextRectangle *rect)
{
AtkTextIface *iface;
g_return_if_fai... | false | false | false | false | false | 0 |
OnImportPNG( wxCommandEvent &WXUNUSED(event) )
{
wxString wildcard( wxT("PNG (*.png)|*.png") );
wxFileDialog *fd = new wxFileDialog( this, wxT("Choose a PNG file"), wxT(""), wxT(""),
wildcard,
wxFD_OPEN|wxFD_FILE_MUST_EXIST|wxFD_CHANGE_DI... | false | false | false | false | false | 0 |
EstimateObjectsCount() {
HeapIterator iterator(HeapIterator::kFilterUnreachable);
int objects_count = 0;
for (HeapObject* obj = iterator.next();
obj != NULL;
obj = iterator.next(), ++objects_count) {}
return objects_count;
} | 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.