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 |
|---|---|---|---|---|---|---|
rt2x00leds_led_assoc(struct rt2x00_dev *rt2x00dev, bool enabled)
{
if (rt2x00dev->led_assoc.type == LED_TYPE_ASSOC)
rt2x00led_led_simple(&rt2x00dev->led_assoc, enabled);
} | false | false | false | false | false | 0 |
validate_data (guint8 * data, guint len, guint8 * payload, guint payload_len)
{
guint8 padding;
guint8 csrc_count;
guint header_len;
guint8 version;
g_return_val_if_fail (data != NULL, FALSE);
header_len = GST_RTP_HEADER_LEN;
if (G_UNLIKELY (len < header_len))
goto wrong_length;
/* check version ... | false | false | false | false | false | 0 |
enet_protocol_notify_disconnect (ENetHost * host, ENetPeer * peer, ENetEvent * event)
{
if (peer -> state >= ENET_PEER_STATE_CONNECTION_PENDING)
host -> recalculateBandwidthLimits = 1;
if (peer -> state < ENET_PEER_STATE_CONNECTED)
enet_peer_reset (peer);
else
if (event == NULL)
... | false | false | false | false | false | 0 |
gretl_R_function_add_matrix (const gretl_matrix *m)
{
int nr = gretl_matrix_rows(m);
int nc = gretl_matrix_cols(m);
SEXP res;
int i, j;
current_arg = R_CDR(current_arg);
res = R_allocMatrix(REALSXP, nr, nc);
if (res == NULL) {
return E_ALLOC;
}
for (i=0; i<nr; i++) {
for (j=0; j... | false | false | false | false | false | 0 |
fixupL(const int n, const int *perm_r, GlobalLU_t *Glu)
{
register int nsuper, fsupc, nextl, i, j, k, jstrt;
int *xsup, *lsub, *xlsub;
if ( n <= 1 ) return;
xsup = Glu->xsup;
lsub = Glu->lsub;
xlsub = Glu->xlsub;
nextl = 0;
nsuper = (Glu->supno)[n];
/*
* F... | false | false | false | false | false | 0 |
function_eval(struct ast_channel *chan, const char *cmd, char *data,
char *buf, size_t buflen)
{
if (ast_strlen_zero(data)) {
ast_log(LOG_WARNING, "EVAL requires an argument: EVAL(<string>)\n");
return -1;
}
pbx_substitute_variables_helper(chan, data, buf, buflen - 1);
return 0;
} | false | false | false | false | false | 0 |
mthca_free_mailbox(struct mthca_dev *dev, struct mthca_mailbox *mailbox)
{
if (!mailbox)
return;
pci_pool_free(dev->cmd.pool, mailbox->buf, mailbox->dma);
kfree(mailbox);
} | false | false | false | false | false | 0 |
gst_opengl_oop_to_ubyte_array (GLubyte *dest, OOP sourceOOP, int n)
{
enum gst_indexed_kind kind;
void *base;
int i, size;
size = vm_proxy->basicSize (sourceOOP);
if (size < n)
return NULL;
kind = vm_proxy->OOPIndexedKind (sourceOOP);
base = vm_proxy->OOPIndexedBase (sourceOOP);
switch (kind)
... | false | false | false | false | false | 0 |
dochat(void)
{
struct monst *mtmp;
int tx,ty;
struct obj *otmp;
if (is_silent(youmonst.data))
{
pline("As %s, you cannot speak.", an(youmonst.data->mname));
return 0;
}
if (Strangled)
{
You_cant("speak. You're choking!");
return 0;
}
if (u.uswall... | false | false | false | false | false | 0 |
avc_write(struct firedtv *fdtv)
{
int err, retry;
fdtv->avc_reply_received = false;
for (retry = 0; retry < 6; retry++) {
if (unlikely(avc_debug))
debug_fcp(fdtv->avc_data, fdtv->avc_data_length);
err = fdtv_write(fdtv, FCP_COMMAND_REGISTER,
fdtv->avc_data, fdtv->avc_data_length);
if (err) {
dev_... | false | false | false | false | false | 0 |
res_type_id_to_string (int id)
{
if (id == 241)
return "toolbar";
if (id > 0 && id <= RES_TYPE_COUNT)
return res_types[id-1];
return NULL;
} | false | false | false | false | false | 0 |
more_experienced(int exp, int rexp)
{
u.uexp += exp;
u.urexp += 4*exp + rexp;
if(exp
#ifdef SCORE_ON_BOTL
|| flags.showscore
#endif
) flags.botl = 1;
if (u.urexp >= (Role_if(PM_WIZARD) ? 1000 : 2000))
flags.beginner = 0;
} | false | false | false | false | false | 0 |
delete_key_names(char **key_names, uint32_t key_names_length)
{
uint32_t key_count = 0;
if (key_names != NULL) {
for (key_count = 0; key_count < key_names_length; key_count++) {
free(key_names[key_count]);
/* allocated by strdup -> free() */
}
delete[](key_names); /* allocated by new[] -> delete[] */
}
} | false | false | false | false | false | 0 |
Equals(JSContext *cx, JSXML *xml, jsval v, JSBool *bp)
{
JSObject *vobj;
JSXML *vxml;
if (JSVAL_IS_PRIMITIVE(v)) {
*bp = JS_FALSE;
if (xml->xml_class == JSXML_CLASS_LIST) {
if (xml->xml_kids.length == 1) {
vxml = XMLARRAY_MEMBER(&xml->xml_kids, 0, JSXML);
... | false | false | false | false | false | 0 |
dump_predicates (gimple usestmt, size_t num_preds,
VEC(use_pred_info_t, heap) **preds,
const char* msg)
{
size_t i, j;
VEC(use_pred_info_t, heap) *one_pred_chain;
fprintf (dump_file, msg);
print_gimple_stmt (dump_file, usestmt, 0, 0);
fprintf (dump_file, "is guarded by :\n");... | false | false | false | false | false | 0 |
_cpp_release_buff (cpp_reader *pfile, _cpp_buff *buff)
{
_cpp_buff *end = buff;
while (end->next)
end = end->next;
end->next = pfile->free_buffs;
pfile->free_buffs = buff;
} | false | false | false | false | false | 0 |
palmas_id_irq_handler(int irq, void *_palmas_usb)
{
unsigned int set, id_src;
struct palmas_usb *palmas_usb = _palmas_usb;
struct extcon_dev *edev = palmas_usb->edev;
palmas_read(palmas_usb->palmas, PALMAS_USB_OTG_BASE,
PALMAS_USB_ID_INT_LATCH_SET, &set);
palmas_read(palmas_usb->palmas, PALMAS_USB_OTG_BASE,
P... | false | false | false | false | false | 0 |
SetTitle(const char *t)
{
if (this->Title == NULL && t == NULL)
{
return;
}
if (this->Title && (!strcmp(this->Title, t)))
{
return;
}
if (this->Title)
{
delete [] this->Title;
}
if (t)
{
this->Title = new char[strlen(t)+1];
strcpy(this->Title, t);
}
else
... | false | false | false | false | false | 0 |
uart_type(struct uart_port *port)
{
const char *str = NULL;
if (port->ops->type)
str = port->ops->type(port);
if (!str)
str = "unknown";
return str;
} | false | false | false | false | false | 0 |
build_v2_protocol_initializer (tree type, tree protocol_name, tree protocol_list,
tree inst_methods, tree class_methods,
tree opt_ins_meth, tree opt_cls_meth,
tree property_list)
{
tree expr, ttyp;
location_t loc;
VEC(constructor_elt,gc) *inits = NULL;
/* TODO: find a better represen... | false | false | false | false | false | 0 |
main(int argc, char** argv)
{
if (argc < 3)
{
cout << "To execute, must include the image description file\n\t" << argv[0] << " <image description (must be .txt format)> <dimensions of output image>\n";
return -1;
}
cout << "Reading " << argv[1] << endl;
dimX = atoi(argv[2]);
dimY = atoi(argv[3]);
... | false | false | false | false | false | 0 |
load(LoadState &state) {
foreach (Node node, state.toAllocate) {
DEBUG << "load: calling allocate(" << node << ")" << endl;
try {
allocate(state, node);
} catch (UnknownTypeException &e) {
if (state.loadFlags & LoadState::IgnoreUnknownTypes) {
... | false | false | false | false | false | 0 |
SetCallAsFunctionHandler(InvocationCallback callback,
Handle<Value> data) {
i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
if (IsDeadCheck(isolate,
"v8::ObjectTemplate::SetCallAsFunctionHandler()")) {
return;
}
ENTER_V8(isolate);
... | false | false | false | false | false | 0 |
SolveTOIPositionConstraints(qreal baumgarte, const b2Body* toiBodyA, const b2Body* toiBodyB)
{
qreal minSeparation = 0.0f;
for (int32 i = 0; i < m_count; ++i)
{
b2ContactConstraint* c = m_constraints + i;
b2Body* bodyA = c->bodyA;
b2Body* bodyB = c->bodyB;
qreal massA = 0.0f;
if (bodyA == toiBodyA || bod... | false | false | false | false | false | 0 |
parse_SAMI(subtitles_t* l, subtitle_line_t* sl, char* s,
sami_state_t state, char* temp)
{
char* p = temp + strlen(temp);
do
{
char* q;
//printf("SAMI %d %s\n", state, s);
switch (state) {
case SAMI_START: /* find "START=" */
if ((s = strstr(s, "Start=")))
{
sl->start = (unsigne... | false | false | false | false | false | 0 |
gst_poll_fd_can_read_unlocked (const GstPoll * set, GstPollFD * fd)
{
gboolean res = FALSE;
gint idx;
GST_DEBUG ("%p: fd (fd:%d, idx:%d)", set, fd->fd, fd->idx);
idx = find_index (set->active_fds, fd);
if (idx >= 0) {
#ifndef G_OS_WIN32
struct pollfd *pfd = &g_array_index (set->active_fds, struct pollfd... | false | false | false | false | false | 0 |
refuseAssociation(OFBool isBadContext)
{
T_ASC_RejectParameters rej;
if (isBadContext)
{
rej.result = ASC_RESULT_REJECTEDTRANSIENT;
rej.source = ASC_SOURCE_SERVICEUSER;
rej.reason = ASC_REASON_SU_APPCONTEXTNAMENOTSUPPORTED;
} else {
rej.result = ASC_RESULT_REJECTEDPERMANENT;
rej.s... | false | false | false | false | false | 0 |
secu_InitSlotPassword(PK11SlotInfo *slot, PRBool retry, void *arg)
{
char *p0 = NULL;
char *p1 = NULL;
FILE *input, *output;
secuPWData *pwdata = arg;
if (pwdata->source == PW_FROMFILE) {
return SECU_FilePasswd(slot, retry, pwdata->data);
}
if (pwdata->source == PW_PLAINTEXT) {
return PL... | false | false | false | false | true | 1 |
igbvf_update_itr(struct igbvf_adapter *adapter,
enum latency_range itr_setting,
int packets, int bytes)
{
enum latency_range retval = itr_setting;
if (packets == 0)
goto update_itr_done;
switch (itr_setting) {
case lowest_latency:
/* handle TSO and jumbo frames */
if (bytes/packets > 8000)
... | false | false | false | false | false | 0 |
findMAX(const Key searchKey) const
{
int i;
SkipListElement* element;
SkipListElement* nextElement;
Key retKey;
element = myHeader;
for(i=myHeader->getLevel(); i>=0; i--) {
nextElement = element->getElement(i);
while( (nextElement != NIL) && (nextElement->getKey() < searchKey) )... | false | false | false | false | false | 0 |
GetLatLon(const char* pszStr, double& dfLat, double& dfLon)
{
if (pszStr[7] != ' ')
return FALSE;
if (pszStr[0] != 'N' && pszStr[0] != 'S')
return FALSE;
if (pszStr[8] != 'E' && pszStr[8] != 'W')
return FALSE;
char szDeg[4], szMin[3], szSec[3];
szDeg[0] = pszStr[1];
szDe... | false | false | false | false | false | 0 |
source_config_init_backends (ESourceConfig *config)
{
GList *list, *iter;
config->priv->backends = g_hash_table_new_full (
(GHashFunc) g_str_hash,
(GEqualFunc) g_str_equal,
(GDestroyNotify) g_free,
(GDestroyNotify) g_object_unref);
e_extensible_load_extensions (E_EXTENSIBLE (config));
list = e_extensible... | false | false | false | false | false | 0 |
createNameIndex(const AliasList& list,
int32_t& nameIndexCount) {
// Build name => enum map
// This is an n->1 map. There are typically multiple names
// mapping to one enum. The name index is sorted in order of the name,
// as defined by the uprv_compareAl... | false | false | false | false | false | 0 |
hostIpAddr (Host host)
{
int i ;
char *p ;
char **newIpAddrs = NULL;
struct in_addr ipAddr, *returnAddr ;
struct hostent *hostEnt ;
ASSERT(host->params != NULL);
/* check to see if need to look up the host name */
if (host->nextIpLookup <= theTime())
{
/* see if the ipName we're given is a d... | false | false | false | true | true | 1 |
__ecereMethod___ecereNameSpace__ecere__gui__Anchor_OnEdit(struct __ecereNameSpace__ecere__com__Class * class, struct __ecereNameSpace__ecere__gui__Anchor * this, struct __ecereNameSpace__ecere__com__Instance * listBox, struct __ecereNameSpace__ecere__com__Instance * master, int x, int y, int w, int h, struct __ecereNam... | false | false | false | false | false | 0 |
Cudd_addThreshold(
DdManager * dd,
DdNode ** f,
DdNode ** g)
{
DdNode *F, *G;
F = *f; G = *g;
if (F == G || F == DD_PLUS_INFINITY(dd)) return(F);
if (cuddIsConstant(F) && cuddIsConstant(G)) {
if (cuddV(F) >= cuddV(G)) {
return(F);
} else {
return(DD_ZERO(dd));
}
}
return(NULL... | false | false | false | false | false | 0 |
_equalCreateTrigStmt(CreateTrigStmt *a, CreateTrigStmt *b)
{
COMPARE_STRING_FIELD(trigname);
COMPARE_NODE_FIELD(relation);
COMPARE_NODE_FIELD(funcname);
COMPARE_NODE_FIELD(args);
COMPARE_SCALAR_FIELD(before);
COMPARE_SCALAR_FIELD(row);
COMPARE_SCALAR_FIELD(events);
COMPARE_SCALAR_FIELD(isconstraint);
COMPARE_S... | false | false | false | false | false | 0 |
wordsplit_process_list (struct wordsplit *wsp, size_t start)
{
if (wsp->ws_flags & WRDSF_NOSPLIT)
{
/* Treat entire input as a quoted argument */
if (wordsplit_add_segm (wsp, start, wsp->ws_len, _WSNF_QUOTE))
return wsp->ws_errno;
}
else
{
int rc;
while ((rc = scan_word (wsp, s... | false | false | false | false | false | 0 |
GetOption(Option opt, int* value) {
if (opt == OPT_NODELAY) {
*value = m_use_nagling ? 0 : 1;
} else if (opt == OPT_ACKDELAY) {
*value = m_ack_delay;
} else if (opt == OPT_SNDBUF) {
*value = m_sbuf_len;
} else if (opt == OPT_RCVBUF) {
*value = m_rbuf_len;
} else {
ASSERT(false);
}
} | false | false | false | false | false | 0 |
h263_attr_key_to_str(enum h263_attr_keys key, const struct ast_format_attr *format_attr)
{
switch (key) {
case H263_ATTR_KEY_SQCIF:
return format_attr->format_attr[key] ? "SQCIF" : NULL;
case H263_ATTR_KEY_QCIF:
return format_attr->format_attr[key] ? "QCIF" : NULL;
case H263_ATTR_KEY_CIF:
return format_attr->... | false | false | false | false | false | 0 |
store_temp_target(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{
struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
struct i2c_client *client = to_i2c_client(dev);
struct w83791d_data *data = i2c_get_clientdata(client);
int nr = sensor_attr->index;
long v... | false | false | false | false | false | 0 |
visit_move(PyObject *op, PyGC_Head *tolist)
{
if (PyObject_IS_GC(op)) {
if (IS_TENTATIVELY_UNREACHABLE(op)) {
PyGC_Head *gc = AS_GC(op);
gc_list_move(gc, tolist);
gc->gc.gc_refs = GC_REACHABLE;
}
}
return 0;
} | false | false | false | false | false | 0 |
respond_string(const char *p, struct tty_port *port)
{
while (*p) {
tty_insert_flip_char(port, *p, 0);
p++;
}
tty_schedule_flip(port);
} | false | false | false | false | false | 0 |
HTS_GStreamSet_clear(HTS_GStreamSet * gss)
{
size_t i, j;
if (gss->gstream) {
for (i = 0; i < gss->nstream; i++) {
if (gss->gstream[i].par != NULL) {
for (j = 0; j < gss->total_frame; j++)
HTS_free(gss->gstream[i].par[j]);
HTS_free(gss->gstream[i].par);
... | false | false | false | false | false | 0 |
dss_sign(void *key, char *data, int datalen, int *siglen)
{
/*
* The basic DSS signing algorithm is:
*
* - invent a random k between 1 and q-1 (exclusive).
* - Compute r = (g^k mod p) mod q.
* - Compute s = k^-1 * (hash + x*r) mod q.
*
* This has the dangerous properties that... | false | false | false | false | false | 0 |
notes_area_set_pane_sizes (NotesArea *na, int vp, int hp)
{
if (!na) return;
gtk_paned_set_position (na->vpane, vp);
gtk_paned_set_position (na->hpane, hp);
} | false | false | false | false | false | 0 |
loadRegFromStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
unsigned DestReg, int FI,
const TargetRegisterClass *RC,
const TargetRegisterInfo *TRI) const {
DebugLoc DL = MBB.findDebugLoc(I);
MachineFunction &MF = *MBB.getParent();
Mach... | false | false | false | false | false | 0 |
__Pyx_PyInt_AsUnsignedLong(PyObject* x) {
const unsigned long neg_one = (unsigned long)-1, const_zero = 0;
const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
if (likely(PyInt_Check(x))) {
long val = PyInt_AS_LONG(x);
if (is_unsigned && unlikely(val < 0)) {
PyE... | false | false | false | false | false | 0 |
nemo_toolbar_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec)
{
NemoToolbar *self = NEMO_TOOLBAR (object);
switch (property_id) {
case PROP_ACTION_GROUP:
self->priv->action_group = g_value_dup_object (value);
break;
case PROP_SHOW_LOCATION_... | false | false | false | false | false | 0 |
stringprep_4zi_1 (uint32_t * ucs4, size_t ucs4len, size_t maxucs4len,
Stringprep_profile_flags flags,
const Stringprep_profile * profile)
{
int rc;
rc = stringprep_4i (ucs4, &ucs4len, maxucs4len, flags, profile);
if (rc != STRINGPREP_OK)
return rc;
if (ucs4len >= maxucs4len)
return STRINGPREP_... | false | false | false | false | false | 0 |
print_mime_struct (GMimeObject *part, int depth)
{
const GMimeContentType *type;
GMimeMultipart *multipart;
GMimeObject *subpart;
int i, n;
print_depth (depth);
type = g_mime_object_get_content_type (part);
fprintf (stdout, "Content-Type: %s/%s\n", type->type, type->subtype);
if (GMIME_IS_MULTIPART (part))... | false | false | false | false | false | 0 |
op_is_new_cast (struct demangle_component *op)
{
const char *code = op->u.s_operator.op->code;
return (code[1] == 'c'
&& (code[0] == 's' || code[0] == 'd'
|| code[0] == 'c' || code[0] == 'r'));
} | false | false | false | false | false | 0 |
_process_each_front_end(GtkTreeModel *model, GtkTreePath *path,
GtkTreeIter*iter, gpointer user_data)
{
char *name = NULL;
front_end_user_data_t *fe_data = user_data;
gtk_tree_model_get(model, iter, SORTID_NAME, &name, -1);
if (fe_data->node_list)
xstrfmtcat(fe_data->node_list, ",%s", name);
else
fe_d... | false | false | false | false | false | 0 |
avc_bridgeco_get_plug_type(struct fw_unit *unit,
u8 addr[AVC_BRIDGECO_ADDR_BYTES],
enum avc_bridgeco_plug_type *type)
{
u8 *buf;
int err;
buf = kzalloc(12, GFP_KERNEL);
if (buf == NULL)
return -ENOMEM;
/* Info type is 'plug type'. */
avc_bridgeco_fill_plug_info_extension_command(buf, addr,... | false | false | false | false | false | 0 |
tpaw_irc_network_remove_server (TpawIrcNetwork *self,
TpawIrcServer *server)
{
GSList *l;
g_return_if_fail (TPAW_IS_IRC_NETWORK (self));
g_return_if_fail (server != NULL && TPAW_IS_IRC_SERVER (server));
l = g_slist_find (self->priv->servers, server);
if (l == NULL)
ret... | false | false | false | false | false | 0 |
cheese_thumb_view_row_deleted_cb (GtkTreeModel *tree_model,
GtkTreePath *path,
CheeseThumbView *thumb_view)
{
CheeseThumbViewPrivate *priv = CHEESE_THUMB_VIEW_GET_PRIVATE (thumb_view);
priv->n_items--;
if (priv->n_items == 0)
gtk_widg... | false | false | false | false | false | 0 |
update_object_subwindow(game_event_type type, game_event_data *data, void *user)
{
term *old = Term;
term *inv_term = user;
/* Activate */
Term_activate(inv_term);
if (p_ptr->object_idx)
display_object_idx_recall(p_ptr->object_idx);
else if(p_ptr->object_kind_idx)
display_object_kind_recall(p_ptr->object_... | false | false | false | false | false | 0 |
HandleTotemDestroyed(WorldPacket& recvPacket)
{
uint8 slotId;
recvPacket >> slotId;
// ignore for remote control state
if (!_player->IsSelfMover())
{ return; }
if (int(slotId) >= MAX_TOTEM_SLOT)
{ return; }
if (Totem* totem = GetPlayer()->GetTotem(TotemSlot(slotId)))
... | false | false | false | false | false | 0 |
git_config_foreach_match(
const git_config *cfg,
const char *regexp,
git_config_foreach_cb cb,
void *payload)
{
int error;
git_config_iterator *iter;
git_config_entry *entry;
if ((error = git_config_iterator_glob_new(&iter, cfg, regexp)) < 0)
return error;
while (!(error = git_config_next(&entry, iter))) {... | false | false | false | false | false | 0 |
removeMergedItem(const std::string &davLUID)
{
EventCache::iterator it = m_cache.find(davLUID);
if (it == m_cache.end()) {
// gone already, no need to do anything
SE_LOG_DEBUG(getDisplayName(), "%s: ignoring request to delete non-existent item",
davLUID.c_str());
ret... | false | false | false | false | false | 0 |
plugin_init (GstPlugin * plugin)
{
#ifdef ENABLE_NLS
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
#endif /* ENABLE_NLS */
if (!gst_element_register (plugin, "rtspsrc", GST_RANK_NONE,
GST_TYPE_RTSPSRC))
return FALSE;
if (!gst_element_register (pl... | false | false | false | false | false | 0 |
iwlagn_gain_computation(struct iwl_priv *priv,
u32 average_noise[NUM_RX_CHAINS],
u8 default_chain)
{
int i;
s32 delta_g;
struct iwl_chain_noise_data *data = &priv->chain_noise_data;
/*
* Find Gain Code for the chains based on "default chain"
*/
for (i = default_chain + 1; i < NUM_RX_CHAINS; i+... | false | false | false | false | false | 0 |
H5DSget_scale_name(hid_t did,
char *name,
size_t size)
{
hid_t aid; /* attribute ID */
hid_t tid = -1; /* attribute type ID */
hid_t sid; /* space ID */
H5I_type_t it; /* ID type */
size_t nbytes;
size_t ... | false | true | false | false | false | 1 |
fill_holes(unsigned char *bdata, const int iw, const int ih)
{
int ix, iy, iw2;
unsigned char *lptr, *mptr, *rptr, *tptr, *bptr, *sptr;
/* 1. Fill 1-pixel wide holes in horizontal runs first ... */
sptr = bdata + 1;
/* Foreach row in image ... */
for(iy = 0; iy < ih; iy++){
/* Initialize pointe... | false | false | false | false | false | 0 |
clear_mem (gpointer p,
gsize len)
{
gchar *s = p;
/* This also helps debug bad access memory errors */
while (len > 4) {
*s++ = 0xAB;
*s++ = 0xAD;
*s++ = 0xF0;
*s++ = 0x0D;
len -= 4;
}
memset (s, 0xbf, len);
} | false | false | false | false | false | 0 |
remove_stmt_from_eh_lp_fn (struct function *ifun, gimple t)
{
struct throw_stmt_node dummy;
void **slot;
if (!get_eh_throw_stmt_table (ifun))
return false;
dummy.stmt = t;
slot = htab_find_slot (get_eh_throw_stmt_table (ifun), &dummy,
NO_INSERT);
if (slot)
{
htab_clea... | false | false | false | false | false | 0 |
s5p_mfc_handle_error(struct s5p_mfc_dev *dev,
struct s5p_mfc_ctx *ctx, unsigned int reason, unsigned int err)
{
unsigned long flags;
mfc_err("Interrupt Error: %08x\n", err);
if (ctx != NULL) {
/* Error recovery is dependent on the state of context */
switch (ctx->state) {
case MFCINST_RES_CHANGE_INIT:
ca... | false | false | false | false | false | 0 |
swan_sfdisk(struct partition_desc *dev_desc, struct swan_emmc_partition_table *part_table)
{
u64 total_size;
int vfat_size, expand_size;
int ret;
ret = partition_test(dev_desc);
if (ret < 0)
{
return ret;
}
umount_device(dev_desc->path, MNT_DETACH);
ret = cavan_dd("/dev/zero", dev_desc->path, 0, 0, 512);
... | false | false | false | false | false | 0 |
flush()
{
for (size_t i = 0; i < m_Streams.size(); ++i)
{
while (m_Streams[i]->m_Packets.size())
{
m_Streams[i]->m_Packets.front()->Release();
m_Streams[i]->m_Packets.pop();
}
m_Streams[i]->m_uiPosition = 0;
}
} | false | false | false | false | false | 0 |
ath_tx_queue_tid(struct ath_softc *sc, struct ath_txq *txq,
struct ath_atx_tid *tid)
{
struct list_head *list;
struct ath_vif *avp = (struct ath_vif *) tid->an->vif->drv_priv;
struct ath_chanctx *ctx = avp->chanctx;
if (!ctx)
return;
list = &ctx->acq[TID_TO_WME_AC(tid->tidno)];
if (list_empty(&tid->li... | false | false | false | false | false | 0 |
_e_wid_fprev_preview_fm(E_Widget_Data *wd)
{
E_Fm2_Config fmc;
Evas_Object *o;
int mw;
if (!wd->is_dir) return;
if (!wd->path) return;
if (wd->o_preview_preview && (!wd->prev_is_fm))
{
evas_object_del(wd->o_preview_preview);
wd->o_preview_preview = NULL;
}
if (!wd->o_prev... | false | false | false | false | false | 0 |
AddQualifierNode ( XMP_Node * xmpParent, const XML_Node & attr )
{
if ( attr.ns.empty() ) {
XMP_Throw ( "XML namespace required for all elements and attributes", kXMPErr_BadRDF );
}
return AddQualifierNode ( xmpParent, attr.name, attr.value );
} | false | false | false | false | false | 0 |
registerFlatTestCaseMethod(const char* testCaseName, const char* functionName, svUnitTest::svutTestMethodPtr methodPtr,const svUnitTest::svutCodeLocation & location)
{
if (globalFlatTestRegistry == NULL)
initGlobalFlatTestRegistry();
svutFlatRegistryEntry entry;
entry.testCaseName = testCaseName;
entry.testName =... | false | false | false | false | false | 0 |
getT2Imm8s4OpValue(const MCInst &MI, unsigned OpIdx,
SmallVectorImpl<MCFixup> &Fixups,
const MCSubtargetInfo &STI) const {
// FIXME: The immediate operand should have already been encoded like this
// before ever getting here. The encoder method should just need to combine
//... | false | false | false | false | false | 0 |
drawShoot(Sea::Player player, const Coord& c, const HitInfo& info)
{
switch (info.type) {
case HitInfo::HIT:
m_seaview->hit(player, c);
// registerHit(player, c);
break;
case HitInfo::MISS:
m_seaview->miss(player, c);
// registerMiss(player, c);
break;
def... | false | false | false | false | false | 0 |
getCubeDecisionOrdering(int aiOrder[3],
float arDouble[4], float aarOutput[2][NUM_ROLLOUT_OUTPUTS], const cubeinfo * pci)
{
cubedecision cd;
/* Get cube decision */
cd = FindBestCubeDecision(arDouble, aarOutput, pci);
switch (cd) {
case DOUBLE_TAKE:
case DOUBLE_BEAVE... | false | false | false | false | false | 0 |
eap_method(DBusMessageIter *iter, void *user_data)
{
const char *str = NULL;
int i;
dbus_message_iter_get_basic(iter, &str);
if (str == NULL)
return;
for (i = 0; eap_method_map[i].str != NULL; i++)
if (strcmp(str, eap_method_map[i].str) == 0) {
eap_methods |= eap_method_map[i].val;
break;
}
} | false | false | false | false | false | 0 |
process_threshold_ce(struct mem_ctl_info *mci, u16 error,
int *error_found, int handle_error)
{
*error_found = 1;
if (handle_error)
e752x_mc_printk(mci, KERN_WARNING, "Memory threshold CE\n");
} | false | false | false | false | false | 0 |
Mask_mask0(int width, const unsigned char *s, unsigned char *d)
{
MASKMAKER((x+y)&1)
} | false | false | false | false | false | 0 |
wb_truncate (call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset)
{
wb_file_t *file = NULL;
fd_t *iter_fd = NULL;
wb_local_t *local = NULL;
uint64_t tmp_file = 0;
call_stub_t *stub = NULL;
wb_request_t *request = NULL;
int... | false | false | false | true | false | 1 |
simplex(Matrix &A, Matrix &b)
{
/* we assume that we're given this in a tableau form.
Matrix A contains all the variables, and
Matrib b contains all the values.
We also assume that the first row of the Matrices
contains the values for the objective function.
*/
... | false | false | false | false | false | 0 |
seahorse_object_get_nth_child (SeahorseObject *self, guint index)
{
g_return_val_if_fail (SEAHORSE_IS_OBJECT (self), NULL);
return SEAHORSE_OBJECT (g_list_nth_data (self->pv->children, index));
} | false | false | false | false | false | 0 |
pk_store_set_pointer (PkStore *store, const gchar *key, gpointer data)
{
gboolean ret;
g_return_val_if_fail (PK_IS_STORE (store), FALSE);
g_return_val_if_fail (key != NULL, FALSE);
g_return_val_if_fail (data != NULL, FALSE);
/* does already exist? */
ret = g_hash_table_remove (store->priv->hash_pointer, key);
... | false | false | false | false | false | 0 |
scsi_area_wait_ready (Mustek_Scanner * s)
{
struct timeval now, start;
SANE_Status status;
gettimeofday (&start, 0);
DBG (5, "scsi_area_wait_ready\n");
while (1)
{
status = area_and_windows (s);
switch (status)
{
default:
/* Ignore errors while waiting for scanner to become ready.
... | false | false | false | false | false | 0 |
allEmptyRootForms() const
{
QList<FormMain*> roots;
foreach(FormCollection *collection, _centralFormCollection)
roots << collection->emptyRootForms();
foreach(FormCollection *collection, _subFormCollection)
roots << collection->emptyRootForms();
return roots;
... | false | false | false | false | false | 0 |
addr_policy_covers(addr_policy_t *a, addr_policy_t *b)
{
/* We can ignore accept/reject, since "accept *:80, reject *:80" reduces
* to "accept *:80". */
if (a->maskbits > b->maskbits) {
/* a has more fixed bits than b; it can't possibly cover b. */
return 0;
}
if (tor_addr_compare_masked(&a->addr, &b... | false | false | false | false | false | 0 |
DumpInitializers(FILE* output, RuleEntry *r, char * pReturn)
#else
void DumpInitializers(output, r, pReturn)
FILE* output;
RuleEntry *r;
char * pReturn;
#endif
{
char *p = pReturn;
char *pDataType;
char *pSymbol;
char *pEqualSign;
char *pValue;
char *pSeparator;
int nest = 0;
char *q;
require(pReturn!=NULL... | false | false | false | true | false | 1 |
addrharvest_insert_cache(
AddressHarvester *harvester, HeaderEntry *entry,
AddressCache *cache, const gchar *name,
const gchar *address )
{
#ifndef USE_NEW_ADDRBOOK
ItemPerson *person;
ItemFolder *folder;
gchar *folderName;
gboolean newFolder;
gint cnt;
gchar *key, *value;
newFolder = FALSE;
folder = ent... | false | false | false | false | false | 0 |
format_time (guint64 duration, gboolean use_hours)
{
guint64 hour, min, sec;
gchar *time;
/* +500 for rounding */
sec = (duration+500) / 1000;
min = sec / 60;
sec = sec % 60;
if (use_hours) {
hour = min / 60;
min = min % 60;
time = g_strdup_printf ("%" G_GUINT64_FORMAT \
":%02" ... | false | false | false | false | false | 0 |
user_option_get (a2ps_job * job, char * shortcut)
{
char * res;
res = pair_get (job->user_options, shortcut);
if (!res)
error (1, 0, _("unknown user option `%s'"), quotearg (shortcut));
return res;
} | false | false | false | false | false | 0 |
SetOrigin(const signed short origin[2])
{
if( origin )
{
Internal->Origin[0] = origin[0];
Internal->Origin[1] = origin[1];
}
} | false | false | false | false | false | 0 |
smime_choose_cipher (CERTCertificate *scert, CERTCertificate **rcerts)
{
PLArenaPool *poolp;
long chosen_cipher;
int *cipher_abilities;
int *cipher_votes;
int strong_mapi;
int rcount, mapi, max;
if (smime_policy_bits == 0) {
PORT_SetError (SEC_ERROR_BAD_EXPORT_ALGORITHM);
return -1;
}... | false | false | false | false | false | 0 |
lexeme_compare(const void *key1, const void *key2)
{
const LexemeHashKey *d1 = (const LexemeHashKey *) key1;
const LexemeHashKey *d2 = (const LexemeHashKey *) key2;
/* First, compare by length */
if (d1->length > d2->length)
return 1;
else if (d1->length < d2->length)
return -1;
/* Lengths are equal, do a by... | false | false | false | false | false | 0 |
same_text(NOTICE& n1, NOTICE& n2) {
if (strcmp(n1.title, n2.title)) return false;
if (!string_equal_nodigits(n1.description, n2.description)) return false;
return true;
} | false | false | false | false | false | 0 |
qed_load_mcp_offsets(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt)
{
struct qed_mcp_info *p_info = p_hwfn->mcp_info;
u32 drv_mb_offsize, mfw_mb_offsize;
u32 mcp_pf_id = MCP_PF_ID(p_hwfn);
p_info->public_base = qed_rd(p_hwfn, p_ptt, MISC_REG_SHARED_MEM_ADDR);
if (!p_info->public_base)
return 0;
p_info->p... | false | false | false | false | false | 0 |
clutter_grid_layout_set_row_spacing (ClutterGridLayout *layout,
guint spacing)
{
ClutterGridLayoutPrivate *priv;
g_return_if_fail (CLUTTER_IS_GRID_LAYOUT (layout));
priv = layout->priv;
if (COLUMNS (priv)->spacing != spacing)
{
COLUMNS (priv)->spaci... | false | false | false | false | false | 0 |
GetSwitch( char const * option, char const * option_short )
{
if ( End() )
return false;
char * argument = argv[index];
tASSERT( argument );
if ( !strcmp(argument,option) || ( option_short && !strcmp(argument,option_short ) ) )
{
index++;
return true;
}
return false... | false | false | false | false | false | 0 |
free_client_goto(void)
{
if (NULL != goto_maps) {
goto_map_list_iterate(goto_maps, goto_map) {
goto_map_free(goto_map);
} goto_map_list_iterate_end;
goto_map_list_destroy(goto_maps);
goto_maps = NULL;
}
goto_destination = NULL;
goto_warned = FALSE;
} | false | false | false | false | false | 0 |
perl_text_buffer_fill_hash(HV *hv, TEXT_BUFFER_REC *buffer)
{
hv_store(hv, "first_line", 10, plain_bless(buffer->first_line, "Irssi::TextUI::Line"), 0);
hv_store(hv, "lines_count", 11, newSViv(buffer->lines_count), 0);
hv_store(hv, "cur_line", 8, plain_bless(buffer->cur_line, "Irssi::TextUI::Line"), 0);
hv_store(hv... | false | false | false | false | false | 0 |
cgraph_make_edge_direct (struct cgraph_edge *edge, struct cgraph_node *callee)
{
edge->indirect_unknown_callee = 0;
/* Get the edge out of the indirect edge list. */
if (edge->prev_callee)
edge->prev_callee->next_callee = edge->next_callee;
if (edge->next_callee)
edge->next_callee->prev_callee = edge->... | 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.