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 |
|---|---|---|---|---|---|---|
volume_id_set_label_string(struct volume_id *id, const uint8_t *buf, size_t count)
{
unsigned i;
memcpy(id->label, buf, count);
/* remove trailing whitespace */
i = strnlen(id->label, count);
while (i--) {
if (!isspace(id->label[i]))
break;
}
id->label[i+1] = '\0';
} | false | true | false | false | false | 1 |
set_activate_slack(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{
struct hid_device *hdev = container_of(dev, struct hid_device, dev);
struct ntrig_data *nd = hid_get_drvdata(hdev);
unsigned long val;
if (kstrtoul(buf, 0, &val))
return -EINVAL;
if (val > 0x7f)
... | false | false | false | false | false | 0 |
Open(const char *password = 0)
{
// open our device
m_desk.Open(password);
// add all databases as directories
DatabaseDatabase::DatabaseArrayType::const_iterator
dbi = m_desk.GetDBDB().Databases.begin(),
dbe = m_desk.GetDBDB().Databases.end();
for( ; dbi != dbe; ++dbi ) {
DatabasePtr db = Database... | false | false | false | false | false | 0 |
on_gettext_po_xerror (gint severity,
po_message_t message,
const gchar * filename, size_t lineno, size_t column,
gint multiline_p, const gchar * message_text)
{
if (message_text)
message_error = g_strdup (message_text);
else
message_error = N... | false | false | false | false | false | 0 |
ssl_certificate_find (const gchar *host, gushort port, const gchar *fingerprint)
{
gchar *file = NULL;
gchar *buf;
SSLCertificate *cert = NULL;
gnutls_x509_crt_t tmp_x509;
FILE *fp = NULL;
gboolean must_rename = FALSE;
buf = g_strdup_printf("%d", port);
if (fingerprint != NULL) {
file = get_certificate_pat... | false | false | false | false | false | 0 |
accessx_status_applet_fill (PanelApplet *applet)
{
AccessxStatusApplet *sapplet;
AtkObject *atk_object;
GtkActionGroup *action_group;
gchar *ui_path;
gboolean was_realized = FALSE;
sapplet = create_applet (applet);
if (!gtk_widget_get_realized (sapplet->box)) {
g_signal_connect_a... | false | false | false | false | false | 0 |
ubi_volume_notify(struct ubi_device *ubi, struct ubi_volume *vol, int ntype)
{
int ret;
struct ubi_notification nt;
ubi_do_get_device_info(ubi, &nt.di);
ubi_do_get_volume_info(ubi, vol, &nt.vi);
switch (ntype) {
case UBI_VOLUME_ADDED:
case UBI_VOLUME_REMOVED:
case UBI_VOLUME_RESIZED:
case UBI_VOLUME_RENAMED:... | false | false | false | false | false | 0 |
zforce_scan_frequency(struct zforce_ts *ts, u16 idle, u16 finger,
u16 stylus)
{
struct i2c_client *client = ts->client;
char buf[9] = { FRAME_START, 7, COMMAND_SCANFREQ,
(idle & 0xff), ((idle >> 8) & 0xff),
(finger & 0xff), ((finger >> 8) & 0xff),
(stylus & 0xff), ((stylus >> 8) & 0xff) };
dev_dbg(&cl... | false | false | false | false | false | 0 |
dictbytype(PyObject *src, int scope_type, int flag, int offset)
{
Py_ssize_t pos = 0, i = offset, scope;
PyObject *k, *v, *dest = PyDict_New();
assert(offset >= 0);
if (dest == NULL)
return NULL;
while (PyDict_Next(src, &pos, &k, &v)) {
/* XXX this should probably be a macro in sym... | false | false | false | false | false | 0 |
lookDown(int xLoc,int yLoc,Intersect *output){
double zLoc = (k - normal->x * xLoc - normal->y * yLoc) / normal->z;
if(zLoc==0)
output->intersect=false;
else
output->reIntersect(color,zLoc,true);
} | false | false | false | false | false | 0 |
XML_ParserCreate_MM(const XML_Char *encodingName,
const XML_Memory_Handling_Suite *memsuite,
const XML_Char *nameSep)
{
XML_Parser parser = parserCreate(encodingName, memsuite, nameSep, NULL);
if (parser != NULL && ns) {
/* implicit context only set for root parser, since... | false | false | false | false | false | 0 |
update_port_addr(char *port, char *addr)
{
char line[BIG_LINE];
char *val = read_conf("console.conf", "Listen");
char *ptr = NULL;
int err;
if (val) {
ptr = strchr(val, ':');
}
if (ptr) {
*ptr = '\0';
++ptr; /* ptr points to the start of the port number in host:port... | true | true | false | false | false | 1 |
format_raw_header(MAILSTREAM *stream, long int msgno, char *section, gf_io_t pc)
{
char *h = mail_fetch_header(stream, msgno, section, NULL, NULL, FT_PEEK);
unsigned char c;
if(h){
while(*h){
if(ISRFCEOL(h)){
h += 2;
if(!gf_puts(NEWLINE, pc))
return(FHT_WRTERR);
if(ISRFCEOL(h)) /* all don... | false | false | false | false | false | 0 |
FindEdge(vtkIdType endpoint1, vtkIdType endpoint2) {
if (endpoint1 > endpoint2) std::swap(endpoint1, endpoint2);
MapType::iterator iter = Map.find(std::make_pair(endpoint1, endpoint2));
if (iter != Map.end())
{
return iter->second;
}
else
{
return -1;
}
} | false | false | false | false | false | 0 |
width () { return _none ? 0 : Brush::width(); } | false | false | false | false | false | 0 |
i915_irq_handler(int irq, void *arg)
{
struct drm_device *dev = arg;
struct drm_i915_private *dev_priv = dev->dev_private;
u32 iir, new_iir, pipe_stats[I915_MAX_PIPES];
u32 flip_mask =
I915_DISPLAY_PLANE_A_FLIP_PENDING_INTERRUPT |
I915_DISPLAY_PLANE_B_FLIP_PENDING_INTERRUPT;
int pipe, ret = IRQ_NONE;
if (!in... | false | false | false | false | false | 0 |
set_frame_wxxx(unsigned char *frame, FrameDataNode const *node)
{
size_t const n = sizeOfWxxxNode(node);
if (n > 10) {
frame = set_4_byte_value(frame, node->fid);
frame = set_4_byte_value(frame, (unsigned long) (n - 10));
/* clear 2-byte header flags */
*frame++ = 0;
*fra... | false | false | false | false | false | 0 |
gst_qt_mux_parse_classification_string (GstQTMux * qtmux, const gchar * input,
guint32 * p_fourcc, guint16 * p_table, gchar ** p_content)
{
guint32 fourcc;
gint table;
gint size;
const gchar *data;
data = input;
size = strlen (input);
if (size < 4 + 3 + 1 + 1 + 1) {
/* at least the minimum xxxx:... | false | false | false | false | false | 0 |
amd8111e_link_change(struct net_device *dev)
{
struct amd8111e_priv *lp = netdev_priv(dev);
int status0,speed;
/* read the link change */
status0 = readl(lp->mmio + STAT0);
if(status0 & LINK_STATS){
if(status0 & AUTONEG_COMPLETE)
lp->link_config.autoneg = AUTONEG_ENABLE;
else
lp->link_config.auton... | false | false | false | false | false | 0 |
isOfEntry(Key *key, char *entry)
{
const char *s;
int len;
int entrylen;
s=keyName(key);
len=strlen(s);
entrylen=strlen(entry);
if (len<=KDB_KEY_MOUNTPOINTS_LEN) return 0;
if (strncmp(s,KDB_KEY_MOUNTPOINTS "/",KDB_KEY_MOUNTPOINTS_LEN)) return 0;
if (strncmp(s+KDB_KEY_MOUNTPOINTS_LEN, entry, entrylen)) return... | false | false | false | false | false | 0 |
decNumberSetBCD(decNumber *dn, const uByte *bcd, uInt n) {
Unit *up=dn->lsu+D2U(dn->digits)-1; /* -> msu [target pointer] */
const uByte *ub=bcd; /* -> source msd */
#if DECDPUN==1 /* trivial simple copy */
for (; ub<bcd+n; ub++, up--) *up=*ub;
#else /* some assembly needed */
/* calculate how ... | false | false | false | false | false | 0 |
month_num(char *s)
{
int month = -1, year;
int i;
if(F_ON(F_PRUNE_USES_ISO,ps_global)){
char save, *p;
char digmon[3];
if(s && strlen(s) > 4 && s[4] == '-'){
save = s[4];
s[4] = '\0';
year = atoi(s);
s[4] = save;
if(year == 0)
return(-1);
p = s + 5;
for(i... | false | false | false | false | false | 0 |
kmo_debug_frameset(const cpl_frameset *frameset)
{
const cpl_frame *frame = NULL; /* must not be deleted at the end */
cpl_error_code ret_error = CPL_ERROR_NONE;
KMO_TRY
{
cpl_msg_debug("", "====== START FRAMESET ======");
if (frameset == NULL) {
cpl_msg_warning(""... | false | false | false | false | false | 0 |
sapi_fcgi_read_post(char *buffer, uint count_bytes TSRMLS_DC)
{
uint read_bytes = 0;
int tmp_read_bytes;
fcgi_request *request = (fcgi_request*) SG(server_context);
count_bytes = MIN(count_bytes, (uint) SG(request_info).content_length - SG(read_post_bytes));
while (read_bytes < count_bytes) {
tmp_read_bytes = f... | false | false | false | false | false | 0 |
this_is_a_backspace(gchar *st)
{
gint i;
for(i=0;i<(gint)strlen(st);i++)
if(st[i] != ' ' && st[i] !='\n' && st[i] !='\r')
return FALSE;
return TRUE;
} | false | false | false | false | false | 0 |
genericize_if_stmt (tree *stmt_p)
{
tree stmt, cond, then_, else_;
location_t locus = EXPR_LOCATION (*stmt_p);
stmt = *stmt_p;
cond = IF_COND (stmt);
then_ = THEN_CLAUSE (stmt);
else_ = ELSE_CLAUSE (stmt);
if (!then_)
then_ = build_empty_stmt (locus);
if (!else_)
else_ = build_empty_stmt (locu... | false | false | false | false | false | 0 |
t6963_string(Driver *drvthis, int x, int y, const char string[])
{
PrivateData *p = drvthis->private_data;
int len;
debug(RPT_DEBUG, "String out");
/* Don't accept start coordinates outside the screen at all */
if ((y < 1) || (y > p->height) || (x < 1) || (x > p->width))
return;
x--; /* Convert 1-based coo... | false | false | false | false | false | 0 |
server_mknod (rpcsvc_request_t *req)
{
server_state_t *state = NULL;
call_frame_t *frame = NULL;
dict_t *params = NULL;
char *buf = NULL;
gfs3_mknod_req args ... | false | true | false | false | false | 1 |
GC_malloc_atomic(size_t lb)
#endif
{
void *op;
size_t lg;
DCL_LOCK_STATE;
if(SMALL_OBJ(lb)) {
GC_DBG_COLLECT_AT_MALLOC(lb);
lg = GC_size_map[lb];
LOCK();
op = GC_aobjfreelist[lg];
if (EXPECT(0 == op, FALSE)) {
UNLOCK();
return(GENERAL_MALL... | false | false | false | false | false | 0 |
failed_tandem_relay(int idx)
{
int uidx = -1, i;
for (i = 0; i < dcc_total; i++)
if ((dcc[i].type == &DCC_PRE_RELAY) &&
(dcc[i].u.relay->sock == dcc[idx].sock))
uidx = i;
if (uidx < 0) {
putlog(LOG_MISC, "*", "%s %d -> %d", BOT_CANTFINDRELAYUSER,
dcc[idx].sock, dcc[idx].u.relay-... | false | false | false | false | false | 0 |
main(int argc, char **argv)
{
ESL_ALPHABET *abc = NULL;
ESL_RANDOMNESS *r = NULL;
P7_HMM *hmm = NULL;
P7_BG *bg = NULL;
int M = 10000;
if ((abc = esl_alphabet_Create(eslAMINO)) == NULL) esl_fatal("failed to create amino alphabet");
if ((r = esl_ra... | true | true | false | false | true | 1 |
list_queue_get_tail_data(struct list_queue *queue)
{
if (list_queue_empty(queue))
{
return NULL;
}
return queue->buffer[(queue->tail + 1) % queue->max_count];
} | false | false | false | false | false | 0 |
drbd_csum_ee(struct crypto_hash *tfm, struct drbd_peer_request *peer_req, void *digest)
{
struct hash_desc desc;
struct scatterlist sg;
struct page *page = peer_req->pages;
struct page *tmp;
unsigned len;
desc.tfm = tfm;
desc.flags = 0;
sg_init_table(&sg, 1);
crypto_hash_init(&desc);
while ((tmp = page_cha... | false | false | false | false | false | 0 |
read(dap_connection &c)
{
if (!ctlfunc.read(c)) return false;
if (!ctlmenu.read(c)) return false;
if (ctlmenu.get_bit(0) && !rac.read(c)) return false;
if (ctlmenu.get_bit(1) && !key.read(c)) return false;
if (ctlmenu.get_bit(2) && !krf.read(c)) return false;
if (ctlmenu.get_bit(3) && !rop.r... | false | false | false | false | false | 0 |
recover_inline_xattr(struct inode *inode, struct page *page)
{
void *src_addr, *dst_addr;
size_t inline_size;
struct page *ipage;
struct f2fs_inode *ri;
ipage = get_node_page(F2FS_I_SB(inode), inode->i_ino);
f2fs_bug_on(F2FS_I_SB(inode), IS_ERR(ipage));
ri = F2FS_INODE(page);
if (!(ri->i_inline & F2FS_INLINE_... | false | false | false | false | false | 0 |
check_file(char *file)
{
char *buf;
Parse_xml_error err;
if (verbose_level)
log_msg((LOG_INFO_LEVEL, "Checking: %s ...", file));
if (load_file(file, &buf, NULL) == -1) {
log_msg((LOG_ERROR_LEVEL, "Could not get \"%s\"", file));
return(-1);
}
nchecks++;
if (check_acl(buf, &err) == -1) {
log_msg((LOG... | false | false | false | false | false | 0 |
module_parsedel(char **cols)
{
size_t n;
const char *cp;
static struct moduledel msginfo;
for (n=1; cols[n]; n++)
cols[n][-1]=0;
cp=cols[0];
msginfo.inum=0;
while (*cp >= '0' && *cp <= '9')
msginfo.inum = msginfo.inum*10 + (*cp++ - '0');
msginfo.msgid=cols[1];
msginfo.sender=cols[2];
msginfo.delid=cols[3]... | false | false | false | false | true | 1 |
rocker_cmd_set_port_learning_prep(const struct rocker_port *rocker_port,
struct rocker_desc_info *desc_info,
void *priv)
{
struct rocker_tlv *cmd_info;
if (rocker_tlv_put_u16(desc_info, ROCKER_TLV_CMD_TYPE,
ROCKER_TLV_CMD_TYPE_SET_PORT_SETTINGS))
return -EMSGSIZE;
cmd_info = rocker_tlv_nest_... | false | false | false | false | false | 0 |
GetCPUDescription()
{
kwsys_ios::ostringstream oss;
oss
<< this->GetNumberOfPhysicalCPU()
<< " core ";
if (this->GetModelName().empty())
{
oss
<< this->GetProcessorClockFrequency()
<< " MHz "
<< this->GetVendorString()
<< " "
<< this->GetExtendedProcessorName();
}... | false | false | false | false | false | 0 |
mbr_join(double *a, const double *b, int n_dim)
{
double *end = a + n_dim * 2;
do
{
if (a[0] > b[0])
a[0] = b[0];
if (a[1] < b[1])
a[1] = b[1];
a += 2;
b += 2;
}while (a != end);
} | false | false | false | false | false | 0 |
print_element_signals (GstElement * element, gint pfx)
{
guint *signals;
guint nsignals;
gint i, k;
GSignalQuery *query;
signals = g_signal_list_ids (G_OBJECT_TYPE (element), &nsignals);
for (k = 0; k < 2; k++) {
gint counted = 0;
if (k == 0)
PUT_START_TAG (pfx, "element-signals");
else
... | false | false | false | false | false | 0 |
JustDied(Unit* /*pKiller*/) override
{
if (m_pInstance)
{
m_pInstance->SetData(TYPE_THERMAPLUGG, DONE);
}
m_lSummonedBombGUIDs.clear();
} | false | false | false | false | false | 0 |
in(word_t addr)
{
DBG(2, form("KCemu/CTC/DIO/in",
"CTC_DIO::in(): addr = %04x\n",
addr));
switch (addr & 3)
{
case 0:
return c_in(0);
case 1:
return c_in(1);
case 2:
return c_in(2);
case 3:
return c_in(3);
}
return 0; // shouldn't be re... | false | false | false | false | false | 0 |
exchange_run(struct message *msg)
{
struct exchange *exchange = msg->exchange;
struct doi *doi = exchange->doi;
int (*handler)(struct message *) = exchange->initiator ?
doi->initiator : doi->responder;
int done = 0;
while (!done) {
/*
* It's our turn if we're either the i... | false | false | false | false | false | 0 |
uwb_beca_e_init(struct uwb_beca_e *bce)
{
mutex_init(&bce->mutex);
kref_init(&bce->refcnt);
stats_init(&bce->lqe_stats);
stats_init(&bce->rssi_stats);
} | false | false | false | false | false | 0 |
do_capture(const char *device)
{
int fd;
char *filename;
if (!device) {
fprintf(stderr, "No device specified, trying to scan all of %s/%s*\n",
DEV_INPUT_EVENT, EVENT_DEV_NAME);
if (getuid() != 0)
fprintf(stderr, "Not running as root, no devices may be available.\n");
filename = scan_devices();
if (!... | false | false | false | false | false | 0 |
TidNext(TidScanState *node)
{
EState *estate;
ScanDirection direction;
Snapshot snapshot;
Relation heapRelation;
HeapTuple tuple;
TupleTableSlot *slot;
Buffer buffer = InvalidBuffer;
ItemPointerData *tidList;
int numTids;
bool bBackward;
/*
* extract necessary information from tid scan node
*/
e... | false | false | false | false | false | 0 |
jinit_c_master_control (j_compress_ptr cinfo, boolean transcode_only)
{
my_master_ptr master;
master = (my_master_ptr)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
SIZEOF(my_comp_master));
cinfo->master = (struct jpeg_comp_master *) master;
master->pub.prepare_for_pass = prepare_f... | false | false | false | false | false | 0 |
addConfigWord(unsigned int addr, ConfigWord *pConfigWord)
{
if (addr < m_nConfigWords) {
if (m_ConfigWords[addr])
m_pCpu->deleteSymbol(m_ConfigWords[addr]);
m_ConfigWords[addr] = pConfigWord;
m_pCpu->addSymbol(pConfigWord);
return 1;
}
delete pConfigWord;
return 0;
} | false | false | false | false | false | 0 |
fs_ptable_pair_exists(fs_ptable *pt, fs_row_id b, fs_rid pair[2])
{
if (b == 0) {
fs_error(LOG_CRIT, "tried to read row 0\n");
return 0;
}
if (b > pt->header->length) {
fs_error(LOG_CRIT, "tried to read off end of ptable\n");
return 0;
}
row *r = &(pt->data[b]);
... | false | false | false | false | false | 0 |
lame_encode_flush_nogap(lame_global_flags * gfp, unsigned char *mp3buffer, int mp3buffer_size)
{
int rc = -3;
if (is_lame_global_flags_valid(gfp)) {
lame_internal_flags *const gfc = gfp->internal_flags;
if (is_lame_internal_flags_valid(gfc)) {
flush_bitstream(gfc);
rc... | false | false | false | false | false | 0 |
debug_tree_chain (tree t)
{
struct pointer_set_t *seen = pointer_set_create ();
while (t)
{
print_generic_expr (stderr, t, TDF_VOPS|TDF_MEMSYMS|TDF_UID);
fprintf (stderr, " ");
t = TREE_CHAIN (t);
if (pointer_set_insert (seen, t))
{
fprintf (stderr, "... [cycled back to ");
print... | false | false | false | false | false | 0 |
cp_int_param(int *dest, const char *name, struct ofw_dev *dev,
enum obp_param item)
{
if (dev->param[item])
*dest = strtol(dev->param[item]->val, NULL, 10);
} | false | false | false | false | false | 0 |
read_double(FILE *inptr,unsigned short byteorder,unsigned long offset)
{
unsigned char rbuf[sizeof(double)];
unsigned long curoffset;
double value = 0.0;
int chpr = 0;
if(inptr)
{
clearerr(inptr);
curoffset = ftell(inptr);
if((offset != HERE) && (fseek(inptr,offset,0) ==... | false | false | false | false | false | 0 |
rfbssl_write(rfbClientPtr cl, const char *buf, int bufsize)
{
struct rfbssl_ctx *ctx = (struct rfbssl_ctx *)cl->sslctx;
int ret;
while ((ret = gnutls_record_send(ctx->session, buf, bufsize)) < 0) {
if (ret == GNUTLS_E_AGAIN) {
/* continue */
} else if (ret == GNUTLS_E_INTERRUPTED) {
/* continue... | false | false | false | false | false | 0 |
gen6_emit_3dstate_multisample(struct brw_context *brw,
unsigned num_samples)
{
uint32_t number_of_multisamples = 0;
uint32_t sample_positions_3210 = 0;
uint32_t sample_positions_7654 = 0;
assert(brw->gen < 8);
switch (num_samples) {
case 0:
case 1:
number_of_mu... | false | false | false | false | false | 0 |
uvc_v4l2_read(struct file *file, char __user *data,
size_t count, loff_t *ppos)
{
uvc_trace(UVC_TRACE_CALLS, "uvc_v4l2_read: not implemented.\n");
return -EINVAL;
} | false | false | false | false | false | 0 |
wmi_evaluate_method(const char *guid_string, u8 instance,
u32 method_id, const struct acpi_buffer *in, struct acpi_buffer *out)
{
struct guid_block *block = NULL;
struct wmi_block *wblock = NULL;
acpi_handle handle;
acpi_status status;
struct acpi_object_list input;
union acpi_object params[3];
char method[5] = ... | true | true | false | false | false | 1 |
frCombMedian(VimosImage **ima_list, int num, int flag)
{
VimosImage *ima_med;
float *zvalue, value;
int i, j, n, xlen, ylen, rej;
char modName[] = "frCombMedian";
if (ima_list == NULL) {
cpl_msg_error(modName, "NULL input list");
return(NULL);
}
/* Check d... | false | false | false | false | false | 0 |
Java_ncsa_hdf_hdf5lib_H5_H5Fget_1obj_1ids
(JNIEnv *env, jclass clss, jint file_id, jint types, jint obj_count, jintArray obj_id_list)
{
ssize_t status=-1;
jint *obj_id_listP;
jboolean isCopy;
if ( obj_id_list == NULL ) {
h5nullArgument( env, "H5Fget_obj_ids: obj_id_list is NULL");
re... | false | false | false | false | false | 0 |
diva_pri_cleanup_adapter(diva_os_xdi_adapter_t *a)
{
int bar = 0;
/*
Stop Adapter if adapter is running
*/
if (a->xdi_adapter.Initialized) {
diva_pri_stop_adapter(a);
}
/*
Remove ISR Handler
*/
if (a->xdi_adapter.irq_info.registered) {
diva_os_remove_irq(a, a->xdi_adapter.irq_info.irq_nr);
}
a->xd... | false | false | false | false | false | 0 |
iwpm_free_nlmsg_request(struct kref *kref)
{
struct iwpm_nlmsg_request *nlmsg_request;
unsigned long flags;
nlmsg_request = container_of(kref, struct iwpm_nlmsg_request, kref);
spin_lock_irqsave(&iwpm_nlmsg_req_lock, flags);
list_del_init(&nlmsg_request->inprocess_list);
spin_unlock_irqrestore(&iwpm_nlmsg_req_l... | false | false | false | false | false | 0 |
chunk_free_all(gs_memory_t * mem, uint free_mask, client_name_t cname)
{
gs_memory_chunk_t * const cmem = (gs_memory_chunk_t *)mem;
gs_memory_t * const target = cmem->target;
#ifdef DEBUG
if (cmem->in_use != 0)
dmprintf1(target, "*** chunk_free_all: this memory allocator is not idle, used for: %s\n... | false | false | false | false | false | 0 |
tg3_rx_data_free(struct tg3 *tp, struct ring_info *ri, u32 map_sz)
{
unsigned int skb_size = SKB_DATA_ALIGN(map_sz + TG3_RX_OFFSET(tp)) +
SKB_DATA_ALIGN(sizeof(struct skb_shared_info));
if (!ri->data)
return;
pci_unmap_single(tp->pdev, dma_unmap_addr(ri, mapping),
map_sz, PCI_DMA_FROMDEVICE);
tg3_frag_... | false | false | false | false | false | 0 |
security_event_get_transport(const struct sip_pvt *p)
{
int res = 0;
switch (p->socket.type) {
case SIP_TRANSPORT_UDP:
return AST_SECURITY_EVENT_TRANSPORT_UDP;
case SIP_TRANSPORT_TCP:
case SIP_TRANSPORT_WS:
return AST_SECURITY_EVENT_TRANSPORT_TCP;
case SIP_TRANSPORT_TLS:
case SIP_TRANSPORT_WSS:
return AST... | false | false | false | false | false | 0 |
gnutls_priority_set_direct (gnutls_session_t session,
const char *priorities, const char **err_pos)
{
gnutls_priority_t prio;
int ret;
ret = gnutls_priority_init (&prio, priorities, err_pos);
if (ret < 0)
{
gnutls_assert ();
return ret;
}
ret = gnutls_priority... | false | false | false | false | false | 0 |
ft_conic_to(const FT_Vector * control, const FT_Vector *to, void *user)
{
ft_outliner *ftol = (ft_outliner *)user;
gf_path_add_quadratic_to(ftol->path, INT2FIX(control->x), INT2FIX(control->y), INT2FIX(to->x), INT2FIX(to->y) );
if ( (ftol->last_x == to->x) && (ftol->last_y == to->y)) gf_path_close(ftol->path);
retu... | false | false | false | false | false | 0 |
ediReadOneWhere(Edi *edi, cchar *tableName, cchar *fieldName, cchar *operation, cchar *value)
{
EdiGrid *grid;
if ((grid = ediReadWhere(edi, tableName, fieldName, operation, value)) == 0) {
return 0;
}
if (grid->nrecords > 0) {
return grid->records[0];
}
return 0;
} | false | false | false | false | false | 0 |
contacts_menu_button_finalize (GObject* obj) {
ContactsMenuButton * self;
self = G_TYPE_CHECK_INSTANCE_CAST (obj, CONTACTS_TYPE_MENU_BUTTON, ContactsMenuButton);
contacts_menu_button_set_menu (self, NULL);
_g_object_unref0 (self->priv->menu);
G_OBJECT_CLASS (contacts_menu_button_parent_class)->finalize (obj);
} | false | false | false | false | false | 0 |
ath_tx_complete_poll_work(struct work_struct *work)
{
struct ath_softc *sc = container_of(work, struct ath_softc,
tx_complete_work.work);
struct ath_txq *txq;
int i;
bool needreset = false;
if (sc->tx99_state) {
ath_dbg(ath9k_hw_common(sc->sc_ah), RESET,
"skip tx hung detection on tx99\n");
retur... | false | false | false | false | false | 0 |
url_destroy(Url *u)
{
if( u ) {
safe_free(u->full_url);
safe_free(u->username);
safe_free(u->password);
safe_free(u->host);
safe_free(u->path);
safe_free(u->file);
memset(u, 0, sizeof(Url));
safe_free(u);
}
} | false | false | false | false | false | 0 |
read_genTime(struct berval*from)
{
struct tm t;
time_t retTime;
time_t diffsec = 0;
int i, gflag = 0, havesec = 0;
memset (&t, 0, sizeof(t));
t.tm_isdst = -1;
t.tm_year = strntoul (from->bv_val , 4, 10) - 1900L;
t.tm_mon = strntoul (from->bv_val + 4, 2, 10) - 1;
t.tm_mday = strntoul (fro... | false | false | false | false | false | 0 |
writeConstants(void)
{
unsigned int i;
unsigned long int clen = 2;
writeByte(SWFACTION_CONSTANTPOOL);
/* length */
writeShort(0);
writeShort(nConstants);
for (i = 0; i < nConstants; ++i)
clen += writeString(constants[i]);
if (clen < 65533)
patchLength((unsigned int) clen, (unsigned int) cle... | false | false | false | false | false | 0 |
move_to_can(int move, const board_t * board, char string[], int size) {
int from, to;
ASSERT(move_is_ok(move));
ASSERT(board_is_ok(board));
ASSERT(string!=NULL);
ASSERT(size>=6);
ASSERT(move_is_legal(move,board));
if (size < 6) return false;
// init
from = move_from(move);
to = move_... | false | false | false | false | false | 0 |
select(uint c, size_t j) const
{
size_t count = 0;
for(size_t k=0;k<length;k++) {
if(access(k)==c) {
count++;
if(count==j) return k;
}
}
return length;
} | false | false | false | false | false | 0 |
bt_ctf_get_char_array(const struct bt_definition *field)
{
char *ret = NULL;
GString *char_array;
if (field && bt_ctf_field_type(bt_ctf_get_decl_from_def(field)) == CTF_TYPE_ARRAY) {
char_array = bt_get_char_array(field);
if (char_array) {
ret = char_array->str;
goto end;
}
}
bt_ctf_field_set_error(-E... | false | false | false | false | false | 0 |
bmg160_resume(struct device *dev)
{
struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct bmg160_data *data = iio_priv(indio_dev);
mutex_lock(&data->mutex);
if (data->dready_trigger_on || data->motion_trigger_on ||
data->ev_enable_state)
bmg160_set_mode(data, BMG160_MODE_NORMAL);
mutex_unlock(&data->m... | false | false | false | false | false | 0 |
_dbus_hash_table_free_preallocated_entry (DBusHashTable *table,
DBusPreallocatedHash *preallocated)
{
DBusHashEntry *entry;
_dbus_assert (preallocated != NULL);
entry = (DBusHashEntry*) preallocated;
/* Don't use free_entry(), since this entry has no key/d... | false | false | false | false | false | 0 |
SV_CalcGunOffset (edict_t * ent)
{
int i;
float delta;
// gun angles from bobbing
ent->client->ps.gunangles[ROLL] = xyspeed * bobfracsin * 0.005;
ent->client->ps.gunangles[YAW] = xyspeed * bobfracsin * 0.01;
if (bobcycle & 1)
{
ent->client->ps.gunangles[ROLL] = -ent->client->ps.gunangles[ROLL];
ent->client-... | false | false | false | false | false | 0 |
dfu_detach( struct usb_dev_handle *device,
const unsigned short interface,
const unsigned short timeout )
{
if( 0 != dfu_verify_init(__FUNCTION__) )
return -1;
return usb_control_msg( device,
/* bmRequestType */ USB_ENDPOINT_OUT | USB_TYPE_CLASS | USB_RECIP_INTER... | false | false | false | false | false | 0 |
__set_open_fd(unsigned int fd, struct fdtable *fdt)
{
__set_bit(fd, fdt->open_fds);
fd /= BITS_PER_LONG;
if (!~fdt->open_fds[fd])
__set_bit(fd, fdt->full_fds_bits);
} | false | false | false | false | false | 0 |
killHero()
{
if (! playback) {
// Record that KILL_HERO is how the level ended.
record (1, ACTION_CODE + KILL_HERO);
emit endLevel (DEAD);
kDebug() << "END OF LEVEL";
}
} | false | false | false | false | false | 0 |
p_capture_image_name_and_assign_pesistent_id(GapFmacContext *fmacContext, gint32 drawable_id)
{
gint32 persistent_drawable_id;
gint32 image_id;
GapDrawableVideoRef *dvref;
GapLibAinfoType ainfo_type;
gint32 frame_nr;
gint32 stackposition;
gint32 track;
char *filename;
if(gap_debug)
{
pri... | false | false | false | false | false | 0 |
length_OCSPTBSRequest(const OCSPTBSRequest *data)
{
size_t ret = 0;
if((data)->version){
size_t Top_tag_oldret = ret;
ret = 0;
ret += length_OCSPVersion((data)->version);
ret += 1 + der_length_len (ret);
ret += Top_tag_oldret;
}
if((data)->requestorName){
size_t Top_tag_oldret = ret;
ret = 0;
ret += length_GeneralName(... | false | false | false | false | false | 0 |
reallyTrash( CollectionLocation *loc, const Meta::TrackList &tracks ) const
{
QStringList files = trackList( tracks );
const QString text( i18ncp( "@info",
"Do you really want to move this track to the trash? It will be removed from %2.",
"Do you really want to move these %1 tracks to the trash?... | false | false | false | false | false | 0 |
aio_pwrite(int fd, void *buf, size_t nbytes, off_t offset)
{
aio_cb.aio_lio_opcode = IOCB_CMD_PWRITE;
aio_cb.aio_fildes = fd;
aio_cb.aio_buf = (unsigned long) buf;
aio_cb.aio_nbytes = nbytes;
aio_cb.aio_offset = offset;
if (io_submit(aio_ctx, 1, &aio_cbp) != 1)
err(1, "aio submit failed");
if (io_getevents(a... | false | false | false | false | false | 0 |
mac_drv_tx_complete(struct s_smc *smc, volatile struct s_smt_fp_txd *txd)
{
struct sk_buff *skb;
pr_debug("entering mac_drv_tx_complete\n");
// Check if this TxD points to a skb
if (!(skb = txd->txd_os.skb)) {
pr_debug("TXD with no skb assigned.\n");
return;
}
txd->txd_os.skb = NULL;
// release the DMA ma... | false | false | false | false | false | 0 |
print_bg_opt(int bg_flags, int mask,
const char *str, int *first)
{
if (bg_flags & mask) {
if (*first) {
fputs(" [", stdout);
*first = 0;
} else
fputs(", ", stdout);
fputs(str, stdout);
}
} | false | false | false | false | false | 0 |
printFillArcs(GC gc_,XArc *arcs_,int n_)
{
updateGC(gc_);
setBackground(printMode()!=Color?1:0);
for (int i=0; i<n_; i++)
{
printArc(x_org()+(int)arcs_[i].x,owner()->height()-y_org()-(int)arcs_[i].y,(int)arcs_[i].width,
(int)arcs_[i].height,(int)arcs_[i].angle1,(int)arcs_[i].angle2,gcValues().arc_m... | false | false | false | false | false | 0 |
fluid_synth_update_gain_LOCAL(fluid_synth_t* synth)
{
fluid_voice_t *voice;
float gain;
int i;
gain = synth->gain;
for (i = 0; i < synth->polyphony; i++) {
voice = synth->voice[i];
if (_PLAYING (voice)) fluid_voice_set_gain (voice, gain);
}
} | false | false | false | false | false | 0 |
getsplit(void)
{
size_t x;
if (C == '=')
{
x = pa_the_ptr++;
} else
{
while (C && (issplit(C)))
pa_the_ptr++;
x = pa_the_ptr;
while (C && !issplit(C) && C != '=')
pa_the_ptr++;
}
if (x == pa_the_ptr && C == '=')
pa_the_ptr++;
/... | false | false | false | false | false | 0 |
new_array(uint8_t type)
{
int array_length_reg;
// ref = heap + 4
// heap = heap + sizeof(array) + 4 (to hold the length of the array)
get_values_from_stack(&array_length_reg);
// store length @ heap
fprintf(out, " move.l d%d, (a5)\n", array_length_reg);
if (type == TYPE_INT)
{
// int is 4 bytes
... | false | false | false | false | false | 0 |
get_return_operand(Module_table *mpt)
{
Operand *ret_op = NULL;
Var_table *vtbl = get_return_var(mpt);
if (vtbl != NULL) {
Operand *t = get_new_op_var(vtbl);
ret_op = copy_register_operand(t);
free_operand(t);
}
return ret_op;
} | false | false | false | false | false | 0 |
_wrap_nextnode(int nargs, VALUE *args, VALUE self) {
int argc;
VALUE argv[2];
int ii;
argc = nargs;
if (argc > 2) SWIG_fail;
for (ii = 0; (ii < argc); ++ii) {
argv[ii] = args[ii];
}
if (argc == 2) {
int _v;
void *vptr = 0;
int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Agraph_t,... | false | false | false | false | false | 0 |
column_is_being_renamed(
/*====================*/
TABLE* table, /*!< in: MySQL table */
uint n_cols, /*!< in: number of columns */
const char** col_names) /*!< in: names of the columns */
{
uint j;
for (j = 0; j < n_cols; j++) {
if (check_column_being_renamed(table, col_names[j])) {
return(true);
}
}... | false | false | false | false | false | 0 |
__Pyx__PyObject_AsDouble(PyObject* obj) {
PyObject* float_value;
if (Py_TYPE(obj)->tp_as_number && Py_TYPE(obj)->tp_as_number->nb_float) {
return PyFloat_AsDouble(obj);
} else if (PyUnicode_CheckExact(obj) || PyBytes_CheckExact(obj)) {
#if PY_MAJOR_VERSION >= 3
float_value = PyFloat_FromStri... | false | false | false | false | false | 0 |
rtw_hal_notch_filter(struct adapter *adapter, bool enable)
{
if (adapter->HalFunc.hal_notch_filter)
adapter->HalFunc.hal_notch_filter(adapter, enable);
} | false | false | false | false | false | 0 |
store_min_perf_pct(struct kobject *a, struct attribute *b,
const char *buf, size_t count)
{
unsigned int input;
int ret;
ret = sscanf(buf, "%u", &input);
if (ret != 1)
return -EINVAL;
limits->min_sysfs_pct = clamp_t(int, input, 0 , 100);
limits->min_perf_pct = max(limits->min_policy_pct,
limits->... | false | false | false | false | false | 0 |
avc1394_vcr_previous_index(raw1394handle_t handle, nodeid_t node)
{
quadlet_t request[2];
if (avc1394_vcr_is_playing(handle, node)) {
request[0] = CTLVCR0 | AVC1394_VCR_COMMAND_BACKWARD |
AVC1394_VCR_MEASUREMENT_INDEX;
request[1] = 0x01FFFFFF;
avc1394_send_command_block(handle, node, request,... | false | false | false | false | false | 0 |
StdIoRead(StdIoStream *st, ulonglong pos, void *buffer, int count) {
size_t rd;
if (fseeko(st->fp, pos, SEEK_SET)) {
st->error = errno;
return -1;
}
rd = fread(buffer, 1, count, st->fp);
if (rd == 0) {
if (feof(st->fp))
return 0;
st->error = errno;
return -1;
}
return rd;
} | 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.