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 |
|---|---|---|---|---|---|---|
flickcurl_people_getPhotos(flickcurl* fc, const char* user_id,
int safe_search,
const char* min_upload_date,
const char* max_upload_date,
const char* min_taken_date,
const char* max_tak... | false | false | false | false | false | 0 |
mono_test_byvalstr_check_unicode (ByValStrStruct_Unicode *ref, int test)
{
if (ref->flag != 0x1234abcd){
printf ("overwritten data");
return 1;
}
if (test == 1 || test == 3){
if (ref->a [0] != '1' ||
ref->a [1] != '2' ||
ref->a [2] != '3')
return 1;
return 0;
}
if (test == 2){
if (... | false | false | false | false | false | 0 |
replica_cleanallruv_find_maxcsn(Replica *replica, ReplicaId rid, char *basedn)
{
Object *agmt_obj;
Repl_Agmt *agmt;
CSN *maxcsn = NULL, *topcsn = NULL;
char *rid_text = slapi_ch_smprintf("%d", rid);
char *csnstr = NULL;
/* start with the local maxcsn */
csnstr = replica_cleanallruv_get_loca... | false | false | false | false | false | 0 |
port_speed_string(struct ocrdma_dev *dev)
{
char *str = "";
u16 speeds_supported;
speeds_supported = dev->phy.fixed_speeds_supported |
dev->phy.auto_speeds_supported;
if (speeds_supported & OCRDMA_PHY_SPEED_40GBPS)
str = "40Gbps ";
else if (speeds_supported & OCRDMA_PHY_SPEED_10GBPS)
str = "10Gbps ";
els... | false | false | false | false | false | 0 |
logMessage( const String& message, LogMessageLevel lml, bool maskDebug )
{
OGRE_LOCK_AUTO_MUTEX;
if ((mLogLevel + lml) >= OGRE_LOG_THRESHOLD)
{
bool skipThisMessage = false;
for( mtLogListener::iterator i = mListeners.begin(); i != mListeners.end(); ++i )
... | false | false | false | false | false | 0 |
eb_exact_pre_match_word_latin(const char *word, const char *pattern,
size_t length)
{
int i = 0;
unsigned char *word_p = (unsigned char *)word;
unsigned char *pattern_p = (unsigned char *)pattern;
int result;
LOG(("in: eb_exact_pre_match_word_latin(word=%s, pattern=%s)",
eb_quoted_stream(word,... | false | false | false | false | false | 0 |
initdmap(FILE *dev_ptr, int64_t blkno, int64_t nblocks,
int8_t * treemax, int64_t start)
{
int rc = 0;
/*
* Determine if the dmap already exists
*/
if (block_map_array[cur_dmap_index] == NULL) {
if (nblocks == BPERDMAP) {
/*
* alloc/init a template empty full page buffer
*/
if (empty_page ... | false | false | false | false | false | 0 |
emi_fill_ucp60_login(char *buf, char *OAdC, char *passwd) {
int max_ia5passwd_len;
char *ia5passwd;
max_ia5passwd_len = strlen(passwd) * 2 + 1;
ia5passwd = gw_malloc(max_ia5passwd_len);
if (parse_binary_to_emi(passwd, ia5passwd, strlen(passwd)) < 0) {
error(0, "parse_binary_to_emi failed")... | false | false | false | false | false | 0 |
score_4_of_a_kind_kismet(int field) {
if (find_n_of_a_kind (4, 0))
return 25 + add_dice ();
return 0;
} | false | false | false | false | false | 0 |
modem_raw_read(char *line, int len)
{
#ifdef USE_NEW_MODEM_READER
int use = 0;
int i;
#ifdef DBG_NEW_MODEM_READER
log(L_JUNK, "[READ] Function request %d byte(s) (now pos %d; len %d).\n", len, modem_input_pos, modem_input_len);
#endif
if (len > MODEM_INPUT_LEN)
{
log(L_FATAL, "Internal modem buffer overflow (... | false | true | true | false | true | 1 |
do_nonmember_using_decl (tree scope, tree name, tree oldval, tree oldtype,
tree *newval, tree *newtype)
{
cxx_binding decls;
*newval = *newtype = NULL_TREE;
cxx_binding_clear (&decls);
if (!qualified_lookup_using_namespace (name, scope, &decls, 0))
/* Lookup error */
return;
... | false | false | false | false | false | 0 |
mca_scoll_mpi_module_destruct(mca_scoll_mpi_module_t *mpi_module)
{
OBJ_RELEASE(mpi_module->previous_barrier_module);
OBJ_RELEASE(mpi_module->previous_broadcast_module);
OBJ_RELEASE(mpi_module->previous_reduce_module);
OBJ_RELEASE(mpi_module->previous_collect_module);
mca_scoll_mpi_module_clear(mp... | false | false | false | false | false | 0 |
gt_strcmp(const char *s1, const char *s2)
{
gt_assert(s1 && s2);
if (s1 == s2)
return 0;
return strcmp(s1, s2);
} | false | false | false | false | false | 0 |
lrc_renamepfn_bulk(CONNECTION *c, DBH *dbh, char **arglist)
{
int rc;
char oldname[BUFLEN];
char newname[BUFLEN];
if (loglevel > 1)
logit(LOG_DEBUG, "lrc_renamepfn_bulk:");
while (1) {
if ((rc = rrpc_readstr(c, oldname, BUFLEN)) != GLOBUS_RLS_SUCCESS) {
rrpc_error(c, rc, "%s", c->errmsg);
... | false | false | false | false | false | 0 |
write_dsa(unsigned char **out, DSA *dsa, int ispub)
{
int nbyte;
nbyte = BN_num_bytes(dsa->p);
write_lebn(out, dsa->p, nbyte);
write_lebn(out, dsa->q, 20);
write_lebn(out, dsa->g, nbyte);
if (ispub)
write_lebn(out, dsa->pub_key, nbyte);
else
write_lebn(out, dsa->priv_key, 20);
/* Set "invalid" for seed str... | false | false | false | false | false | 0 |
bootstrap_template1(char *short_version)
{
PG_CMD_DECL;
char **line;
char *talkargs = "";
char **bki_lines;
char headerline[MAXPGPATH];
char buf[64];
printf(_("creating template1 database in %s/base/1 ... "), pg_data);
fflush(stdout);
if (debug)
talkargs = "-d 5";
bki_lines = readfile(bki_file);... | true | true | false | false | false | 1 |
bnx2x_dcbx_fw_struct(struct bnx2x *bp,
struct bnx2x_func_tx_start_params *pfc_fw_cfg)
{
u16 pri_bit = 0;
u8 cos = 0, pri = 0;
struct priority_cos *tt2cos;
u32 *ttp = bp->dcbx_port_params.app.traffic_type_priority;
int mfw_configured = SHMEM2_HAS(bp, drv_flags) &&
GET_FLAGS(SHMEM2_RD(bp, drv_flags),
... | false | false | false | false | false | 0 |
FindDevice(int nVendor, int nProduct) const
{
for(struct usb_bus *bus = usb_get_busses(); bus; bus = bus->next)
{
for(struct usb_device *dev = bus->devices; dev; dev = dev->next)
{
if(dev->descriptor.idVendor == nVendor && dev->descriptor.idProduct == nProduct)
{
return dev;
}
}
}
return NULL;
} | false | false | false | false | false | 0 |
is_prime(int n) {
static char cache[CACHE_SIZE] = {0};
int cachen;
int i, max;
if ((n&(~3)) == 0) { // if n is 1,2 or 3
return (n != 1); // return false for 1, and true for 2 or 3
}
if ((n&1) == 0) { // if n is an even number
return false;
}
// lookup value in cache
cachen = n>>1;
... | false | false | false | false | false | 0 |
mtip_init_cmd(void *data, struct request *rq, unsigned int hctx_idx,
unsigned int request_idx, unsigned int numa_node)
{
struct driver_data *dd = data;
struct mtip_cmd *cmd = blk_mq_rq_to_pdu(rq);
u32 host_cap_64 = readl(dd->mmio + HOST_CAP) & HOST_CAP_64;
/*
* For flush requests, request_idx starts at the e... | false | false | false | false | false | 0 |
BeforeObjectPatternsToCode(
void *theEnv)
{
long whichPattern;
OBJECT_PATTERN_NODE *intermediateNode;
OBJECT_ALPHA_NODE *alphaNode;
whichPattern = 0L;
intermediateNode = ObjectNetworkPointer(theEnv);
while (intermediateNode != NULL)
{
intermediateNode->bsaveID = whichPattern++;
i... | false | false | false | false | false | 0 |
guess_device_type(int fd)
{
struct stat bootstat;
if (fstat (fd, &bootstat) < 0) {
scsi_disk = 0;
floppy = 0;
} else if (S_ISBLK(bootstat.st_mode)
&& (major(bootstat.st_rdev) == IDE0_MAJOR ||
major(bootstat.st_rdev) == IDE1_MAJOR)) {
scsi_disk = 0;
... | false | false | false | false | false | 0 |
findPage(fp_Page * pPage) const
{
UT_sint32 count = m_vecPages.getItemCount();
if(count < 1)
{
return -1;
}
return m_vecPages.findItem(pPage);
} | false | false | false | false | false | 0 |
ecore_file_monitor_inotify_add(const char *path,
void (*func) (void *data, Ecore_File_Monitor *em,
Ecore_File_Event event,
const char *path),
void *data)
{
Ecore_Fil... | false | false | false | false | true | 1 |
init(int argc, char *argv[], opts_t* opts) {
char* cmd = argv[0];
unsigned int c;
int v;
opts->maxcluster = 0;
opts->outfp = stdout;
Verbose = 0;
opts->clustering_method = CLUSTERING_MODULARITY;
while ((c = getopt(argc, argv, ":vC:c:o:")) != -1) {
switch (c) {
case 'c':
if ((sscanf(opta... | false | false | false | false | true | 1 |
performMultipleDeletions(const ObjectAddresses *objects,
DropBehavior behavior)
{
ObjectAddresses *implicit;
ObjectAddresses *alreadyDeleted;
Relation depRel;
int i;
implicit = new_object_addresses();
alreadyDeleted = new_object_addresses();
depRel = heap_open(DependRelationId, RowExclusiveLock);
/*... | false | false | false | false | false | 0 |
_pv_mda_set_ignored_one(struct metadata_area *mda, void *baton)
{
struct _pv_mda_set_ignored_baton *b = baton;
struct metadata_area *vg_mda, *tmda;
if (mda_is_ignored(mda) && !b->mda_ignored) {
/* Changing an ignored mda to one in_use requires moving it */
dm_list_iterate_items_safe(vg_mda, tmda, b->mdas_ignore... | false | false | false | false | false | 0 |
mg_tagappearance(void)
{
struct mgastk *astk = _mgc->astk;
astk->flags |= MGASTK_TAGGED;
RefIncr((Ref *)astk);
/* update excluded sequence region */
if ((unsigned)_mgc->ap_min_tag > (unsigned)astk->ap_seq) {
_mgc->ap_min_tag = astk->ap_seq;
}
if (_mgc->ap_max_tag < astk->ap_seq) {
_mgc->ap_max_t... | false | false | false | false | false | 0 |
_e2_filetype_dialog_response_cb (GtkDialog *dialog, gint response,
E2_FileTypeDlg2Runtime *rt)
{
printd (DEBUG, "response_cb (dialog:_,response:%d,rt:_)", response);
gtk_widget_destroy (GTK_WIDGET (dialog));
gchar *action;
//remember this when rt is cleared at end of dialog func, and handle any whitespace
gchar *... | false | false | false | false | false | 0 |
gwh_settings_save_to_file (GwhSettings *self,
const gchar *filename,
GError **error)
{
GParamSpec **pspecs;
guint n_props;
guint i;
gboolean success = TRUE;
GKeyFile *key_file;
g_return_val_if_fail (GWH_IS_SETTINGS (self)... | false | false | false | false | false | 0 |
getEntry(const char *title_) const
{
MSNodeItem *hp=(MSNodeItem *)childListHead();
MSNodeItem *np=hp;
NotebookEntry *entry;
MSString title(title_);
while ((np=np->next())!=hp)
{
entry=(NotebookEntry *) np->data();
if (entry->title()==MSStringVector(title)) return entry;
}
return 0;
} | false | false | false | false | false | 0 |
fini ( void )
{
int rc = SLURM_SUCCESS;
pthread_mutex_lock(&thread_flag_mutex);
if (script_thread) {
verbose("Script Job Completion plugin shutting down");
agent_exit = 1;
rc = _wait_for_thread(script_thread);
script_thread = 0;
}
pthread_mutex_unlock(&thread_flag_mutex);
xfree(script);
if (rc == SLURM... | false | false | false | false | false | 0 |
usb_cdc_wdm_register(struct usb_interface *intf,
struct usb_endpoint_descriptor *ep,
int bufsize,
int (*manage_power)(struct usb_interface *, int))
{
int rv = -EINVAL;
rv = wdm_create(intf, ep, bufsize, manage_power);
if (rv < 0)
goto err;
return &wdm_driver;
err:
return ERR_PTR(rv);
} | false | false | false | false | false | 0 |
CheckSize(const Data &packet, size_t requiredsize)
{
const Packet *p = (const Packet *) packet.GetData();
// when packets are larger than 0xFFFF bytes, packet->size is no
// longer reliable, so we go with the Data class size
if( (packet.GetSize() >= 4 && btohs(p->size) != packet.GetSize() && packet.GetSize() <= 0x... | false | false | false | false | false | 0 |
create_publickey_store(char** storefile)
{
int store_length, home_length;
struct stat buf;
FILE* store_file;
assert(storefile != NULL);
assert((*storefile) != NULL);
/* check in local directory first */
if (stat(*storefile, &buf) == 0) {
return 0;
}
/* check in home_dir */
store_length = strlen(... | false | true | false | false | true | 1 |
mapDashStyle(GR_Graphics::LineStyle in, double width, double *dashes, int *n_dashes)
{
switch (in) {
case GR_Graphics::LINE_ON_OFF_DASH:
case GR_Graphics::LINE_DOUBLE_DASH: // see GDK_LINE_DOUBLE_DASH, but it was never used
UT_ASSERT(*n_dashes > 0);
dashes[0] = 4 * width;
*n_dashes = 1;
break;
case GR_Gr... | false | false | false | false | false | 0 |
__ecereMethod_IDEWorkSpace_OnDestroy(struct __ecereNameSpace__ecere__com__Instance * this)
{
struct IDEWorkSpace * __ecerePointer_IDEWorkSpace = (struct IDEWorkSpace *)(this ? (((char *)this) + __ecereClass_IDEWorkSpace->offset) : 0);
if(__ecerePointer_IDEWorkSpace->projectView)
{
__ecereProp___ecereNameSpace__ecere__... | false | false | false | true | false | 1 |
cb_export_category(GtkWidget *item, int selection)
{
if ((GTK_CHECK_MENU_ITEM(item))->active) {
export_category = selection;
jp_logf(JP_LOG_DEBUG, "cb_export_category() cat=%d\n", export_category);
if (glob_cb_export_menu) {
glob_cb_export_menu(export_clist, export_category);
}
... | false | false | false | false | false | 0 |
KTKey_set_name ( KTKey *key,
const char *name )
/*
Input:
name - The new name of the key
Output:
key - The key containing the new name
Description:
This function copies 'name' to the name element of 'key'.
*/
{
free (key->name);
key->name = strdup(name);
if (key->name == NULL)
{
KTError (_("Could not alloc... | false | false | false | false | false | 0 |
lagrange_edge_tension_value(e_info)
struct qinfo *e_info;
{
REAL value = 0.0;
int m,i,j;
REAL det;
REAL **tang;
int dim = (web.representation==STRING) ? 1 : web.dimension-1;
struct gauss_lag *gl = &gauss_lagrange[dim][web.gauss1D_order];
MAT2D(mat,MAXCOORD,MAXCOORD);
for ( m = 0 ; m < gl->gnumpts ... | false | false | false | false | false | 0 |
qset_free_std(struct whc *whc, struct whc_std *std)
{
list_del(&std->list_node);
if (std->bounce_buf) {
bool is_out = usb_pipeout(std->urb->pipe);
dma_addr_t dma_addr;
if (std->num_pointers)
dma_addr = le64_to_cpu(std->pl_virt[0].buf_ptr);
else
dma_addr = std->dma_addr;
dma_unmap_single(whc->wusbhc.... | false | false | false | false | false | 0 |
editor_remove_desktop_file_cb(gpointer key, gpointer value, gpointer user_data)
{
EditorDescription *editor = value;
return editor->hidden || editor->ignored;
} | false | false | false | false | false | 0 |
out_size(struct formatter *f, uint64_t size, const char *fmt, ...)
{
char buffer[64];
va_list ap;
int r;
if (!_sectors_to_units(size, buffer, sizeof(buffer)))
return 0;
_out_with_comment(f, buffer, fmt, ap);
return r;
} | true | true | false | false | false | 1 |
_pty_pipe_open(int *a, int *b)
{
int p[2], ret = -1;
#ifdef PF_UNIX
#ifdef SOCK_STREAM
ret = socketpair(PF_UNIX, SOCK_STREAM, 0, p);
#else
#ifdef SOCK_DGRAM
ret = socketpair(PF_UNIX, SOCK_DGRAM, 0, p);
#endif
#endif
if (ret == 0) {
*a = p[0];
*b = p[1];
return 0;
}
#endif
return ret;
} | false | false | false | false | false | 0 |
path_is_within (std::string const & haystack, std::string needle)
{
while (1) {
if (equivalent_paths (haystack, needle)) {
return true;
}
needle = Glib::path_get_dirname (needle);
if (needle == "." || needle == "/") {
break;
}
}
return false;
} | false | false | false | false | false | 0 |
gt_fprintfencseq(FILE *fpout,
const GtEncseq *encseq,
unsigned long start,
unsigned long wlen)
{
unsigned long idx;
GtUchar currentchar;
const GtAlphabet *alpha;
alpha = gt_encseq_alphabet(encseq);
for (idx = start; idx < start + wlen; idx++)
... | false | false | false | false | false | 0 |
dln2_spi_resume(struct device *dev)
{
int ret;
struct spi_master *master = dev_get_drvdata(dev);
struct dln2_spi *dln2 = spi_master_get_devdata(master);
if (!pm_runtime_suspended(dev)) {
ret = dln2_spi_cs_enable_all(dln2, true);
if (ret < 0)
return ret;
ret = dln2_spi_enable(dln2, true);
if (ret < 0)
... | false | false | false | false | false | 0 |
check_logged_in(struct hub_info* hub, struct hub_user* user, struct adc_message* cmd)
{
struct hub_user* lookup1 = uman_get_user_by_nick(hub->users, user->id.nick);
struct hub_user* lookup2 = uman_get_user_by_cid(hub->users, user->id.cid);
if (lookup1 == user)
{
return 0;
}
if (lookup1 || lookup2)
{
if (lo... | false | false | false | false | false | 0 |
SetItemStateAll(long state, long stateMask)
{
if ( IsEmpty() )
return;
// first deal with selection
if ( stateMask & wxLIST_STATE_SELECTED )
{
// set/clear select state
if ( IsVirtual() )
{
// optimized version for virtual listctrl.
m_selStore.Sel... | false | false | false | false | false | 0 |
internalDocument() const
{
if(!d->m_docIsLoaded)
{
parse();
d->m_toolbarDoc.clear();
}
return d->m_doc;
} | false | false | false | false | false | 0 |
prev_realkey(PAGE16 * pagep, indx_t n)
#else
prev_realkey(pagep, n)
PAGE16 *pagep;
u_int32_t n;
#endif
{
int32_t i;
/* Need a signed value to do the compare properly. */
for (i = n - 1; i > -1; i--)
if (KEY_OFF(pagep, i) != BIGPAIR)
return (i);
return (n);
} | false | false | false | false | false | 0 |
if_convertible_stmt_p (gimple stmt, VEC (data_reference_p, heap) *refs)
{
switch (gimple_code (stmt))
{
case GIMPLE_LABEL:
case GIMPLE_DEBUG:
case GIMPLE_COND:
return true;
case GIMPLE_ASSIGN:
return if_convertible_gimple_assign_stmt_p (stmt, refs);
case GIMPLE_CALL:
{
tre... | false | false | false | false | false | 0 |
rescale_z_values (struct SURFACE_INFO *C)
{
GMT_LONG i;
double ssz = 0.0;
for (i = 0; i < C->npoints; i++) ssz += (C->data[i].z * C->data[i].z);
/* Set z_scale = rms(z): */
C->z_scale = sqrt (ssz / C->npoints);
if (C->z_scale < GMT_CONV_LIMIT) {
fprintf (stderr, "%s: WARNING: Input data lie exactly on a pl... | false | false | false | false | false | 0 |
gerr(const int num)
{
char **result = helpvec(num, 'E');
if (*result == (char *) 0) {
free((char *) result);
disp_arg[0] = num;
result = helpvec(10002, 'E'); /* {Missing error code} */
}
return result;
} | false | false | false | false | false | 0 |
find_action(crm_graph_t * graph, int id)
{
GListPtr sIter = NULL;
if (graph == NULL) {
return NULL;
}
for (sIter = graph->synapses; sIter != NULL; sIter = sIter->next) {
GListPtr aIter = NULL;
synapse_t *synapse = (synapse_t *) sIter->data;
for (aIter = synapse->action... | false | false | false | false | false | 0 |
dwSetDelay(dwDevice_t* dev, const dwTime_t* delay) {
if(dev->deviceMode == TX_MODE) {
setBit(dev->sysctrl, LEN_SYS_CTRL, TXDLYS_BIT, true);
} else if(dev->deviceMode == RX_MODE) {
setBit(dev->sysctrl, LEN_SYS_CTRL, RXDLYS_BIT, true);
} else {
// in idle, ignore
dwTime_t zero = {.full = 0};
return zero;
... | false | false | false | false | false | 0 |
calculateWeights(int sizeOfAlphabet)
{
const double factor = unique.count() /
static_cast<double>(sizeOfAlphabet);
QList<QChar> characters = QList<QChar>::fromSet(unique);
qSort(characters);
double weight;
foreach (const QChar &c, characters) {
if ... | false | false | false | false | false | 0 |
make_upper(char *buf)
{
for (; *buf; buf++)
*buf= my_toupper(system_charset_info, *buf);
} | false | false | false | false | false | 0 |
bf_is_clear_prop(Var arglist, Byte next, void *vdata, Objid progr)
{ /* (object, prop-name) */
Objid oid = arglist.v.list[1].v.obj;
const char *pname = arglist.v.list[2].v.str;
Var r;
db_prop_handle h;
enum error e;
if (!valid(oid))
e = E_INVARG;
else {
h = db_find_property(oid, pname,... | false | false | false | false | false | 0 |
gconf_engine_dir_exists (GConfEngine *conf, const gchar *dir, GError** err)
{
const gchar *db;
dbus_bool_t exists;
DBusMessage *message, *reply;
DBusError error;
g_return_val_if_fail(conf != NULL, FALSE);
g_return_val_if_fail(dir != NULL, FALSE);
g_return_val_if_fail(err == NULL || *err == NULL, FALSE)... | false | false | false | false | false | 0 |
setFunction(FXFunction func){
if(!surface){ fxerror("FXDCWindow::setFunction: DC not connected to drawable.\n"); }
XSetFunction(DISPLAY(getApp()),(GC)ctx,func);
flags|=GCFunction;
rop=func;
} | false | false | false | false | false | 0 |
latch_dominating_def (rtx reg, df_ref *def)
{
df_ref single_rd = NULL, adef;
unsigned regno = REGNO (reg);
struct df_rd_bb_info *bb_info = DF_RD_BB_INFO (current_loop->latch);
for (adef = DF_REG_DEF_CHAIN (regno); adef; adef = DF_REF_NEXT_REG (adef))
{
if (!bitmap_bit_p (df->blocks_to_analyze, DF_REF... | false | false | false | false | false | 0 |
free_buffer(struct videobuf_queue *vq, struct cx231xx_buffer *buf)
{
struct cx231xx_fh *fh = vq->priv_data;
struct cx231xx *dev = fh->dev;
unsigned long flags = 0;
BUG_ON(in_interrupt());
/* We used to wait for the buffer to finish here, but this didn't work
because, as we were keeping the state as VIDEOBUF_... | false | false | false | false | false | 0 |
write(DcmItem &dataset) const
{
OFCondition result = EC_Normal;
/* fill string with values from list */
OFString tmpString;
char buffer[32];
const OFListConstIterator(Float64) endPos = ItemList.end();
OFListConstIterator(Float64) iterator = ItemList.begin();
while (iterator != endPos)
{
... | false | false | false | false | false | 0 |
gfarm_id_shrink_head(struct gfarm_id_table *idtab)
{
while (idtab->hole_start > 0) {
if (idtab->index[idtab->hole_start - 1].data != NULL)
break;
--idtab->hole_start;
--idtab->head_free;
}
} | false | false | false | false | false | 0 |
EncodeFrame(const CImage* src, void* dest, int* is_keyframe, size_t* size, int* lpckid)
{
// FIXME - add check for proper orded!!!
//printf("FMT from -> to\n"); src->GetFmt()->Print(); chead.Print();
CImage ci(&chead, (uint8_t*)dest, false);
ci.Convert(src);
if (size)
*size = head.biSizeImage;
... | false | false | false | false | false | 0 |
ditagfeatureadaptorListDitagfeatureMove(void **Pkey,
void **Pvalue,
void *cl)
{
EnsPDitag dt = NULL;
EnsPDitagfeature dtf = NULL;
if (!Pkey)
return;
if (!*Pkey)
return;
if (!Pv... | false | false | false | false | false | 0 |
lzo_crc32(lzo_uint32 c, const lzo_bytep buf, lzo_uint len)
{
lzo_uint32 crc;
#undef table
#if 1
# define table lzo_crc32_table
#else
const lzo_uint32 * table = lzo_crc32_table;
#endif
if (buf == NULL)
return 0;
crc = (c & LZO_UINT32_C(0xffffffff)) ^ LZO_UINT32_C(0xffffffff);
if (len >= 16)... | false | false | false | false | false | 0 |
sdv_gpio_pub_set_type(struct irq_data *d, unsigned int type)
{
struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
struct sdv_gpio_chip_data *sd = gc->private;
void __iomem *type_reg;
u32 reg;
if (d->hwirq < 8)
type_reg = sd->gpio_pub_base + GPIT1R0;
else
type_reg = sd->gpio_pub_base + GPIT1R1;
re... | false | false | false | false | false | 0 |
do_mp_test(tst_case *tc, MemoryPool *mp)
{
int i, j;
int max_necessary;
int total_bytes = 0;
struct MemChecker *mem_checkers[NUM_ALLOCS];
for (i = 0; i < NUM_ALLOCS; i++) {
int size = rand() % MAX_SIZE;
total_bytes += size + sizeof(int);
mem_checkers[i] = mp_alloc(mp, size +... | false | false | false | false | false | 0 |
AdpDebug(NsInterp *itPtr, char *ptr, int len, int nscript)
{
int code, fd;
Tcl_Interp *interp = itPtr->interp;
int level = itPtr->adp.debugLevel;
char *file = Tcl_GetString(itPtr->adp.framePtr->objv[0]);
char buf[10], debugfile[255];
Ns_DString ds;
code = TCL_ERROR;
Ns_DStringInit(&ds);... | true | true | false | false | true | 1 |
Sequence_translate(Sequence *s, Translate *translate, gint frame){
register Alphabet *protein_alphabet
= Alphabet_create(Alphabet_Type_PROTEIN, FALSE);
register Sequence *ts = Sequence_create(s->id, s->def, NULL, 0,
Sequence_Strand_UNKNOWN,
... | false | false | false | false | false | 0 |
jupe_resend(struct Client *cptr, struct Jupe *jupe)
{
if (JupeIsLocal(jupe)) /* don't propagate local jupes */
return 0;
sendcmdto_one(&me, CMD_JUPE, cptr, "* %c%s %Tu %Tu :%s",
JupeIsRemActive(jupe) ? '+' : '-', jupe->ju_server,
jupe->ju_expire - CurrentTime, jupe->ju_lastmod,
jupe->ju_reason);
retur... | false | false | false | false | false | 0 |
nungetc(int c)
{
if (c != 'C' - '@' && c != 'M' - '@') {
chmac();
ungot = 1;
ungotc = c;
}
} | false | false | false | false | false | 0 |
PlaceCursor(void)
{
/*
* The different attributes are to avoid ncurses optimizations. Let's hope ncurses doesn't optimize this away on terminals that can't underline.
*/
attrset(COLOR_PAIR(MENU_COLOR) | A_NORMAL);
mvaddch(0, 4, 'x');
refresh();
attrset(COLOR_PAIR(MENU_COLOR) | A_UNDERLINE);
mvaddch(0, 4, 'x')... | false | false | false | false | false | 0 |
qlcnic_check_rx_tagging(struct qlcnic_adapter *adapter,
struct sk_buff *skb, u16 *vlan_tag)
{
struct ethhdr *eth_hdr;
if (!__vlan_get_tag(skb, vlan_tag)) {
eth_hdr = (struct ethhdr *)skb->data;
memmove(skb->data + VLAN_HLEN, eth_hdr, ETH_ALEN * 2);
skb_pull(skb, VLAN_HLEN);
}
if (!adapter->rx_pvid)
... | false | false | false | false | false | 0 |
test_secrets_sync (Test *test,
gconstpointer used)
{
const gchar *path_item_one = "/org/freedesktop/secrets/collection/english/1";
const gchar *path_item_two = "/org/freedesktop/secrets/collection/english/2";
const gchar *path_item_three = "/org/freedesktop/secrets/collection/spanish/10";
Secret... | false | false | false | false | false | 0 |
count_addrs(struct mail_address *adrlist)
{
int cnt = 0;
while(adrlist){
if(adrlist->mailbox && adrlist->mailbox[0])
cnt++;
adrlist = adrlist->next;
}
return(cnt);
} | false | false | false | false | false | 0 |
parse_keyusage_flags (const unsigned char *der, size_t derlen,
keyusage_flags_t *usageflags)
{
unsigned int bits, mask;
int i, unused, full;
memset (usageflags, 0, sizeof *usageflags);
if (!derlen)
return gpg_error (GPG_ERR_INV_OBJ);
unused = *der++; derlen--;
if ((!der... | false | false | false | false | false | 0 |
ConfigMsg(const char *name, const char *type, const char *range,
const char *value, const char *short_desc, const char *long_desc)
{
static char *message = (char *)0;
if( !message ){
message = new char[CTCS_BUFSIZE];
if( !message ){
CONSOLE.Warning(1, "error, failed to allocate memory for CTCS mess... | false | false | false | false | false | 0 |
CreateControl(wxWindow* parent)
{
panel = new wxPanel(parent);
TextCtrlLogger::CreateControl(panel);
control->SetId(ID_LOG_DOXYBLOCKS);
sizer = new wxBoxSizer(wxVERTICAL);
sizer->Add(control, 1, wxEXPAND, 0);
panel->SetSizer(sizer);
return panel;
} | false | false | false | false | false | 0 |
cx18_read_pos(struct cx18_stream *s, char __user *ubuf,
size_t count, loff_t *pos, int non_block)
{
ssize_t rc = count ? cx18_read(s, ubuf, count, non_block) : 0;
struct cx18 *cx = s->cx;
CX18_DEBUG_HI_FILE("read %zd from %s, got %zd\n", count, s->name, rc);
if (rc > 0)
pos += rc;
return rc;
} | false | false | false | false | false | 0 |
_step_state_dup2(void *gres_data, int node_index)
{
gres_step_state_t *gres_ptr = (gres_step_state_t *) gres_data;
gres_step_state_t *new_gres_ptr;
xassert(gres_ptr);
new_gres_ptr = xmalloc(sizeof(gres_step_state_t));
new_gres_ptr->gres_cnt_alloc = gres_ptr->gres_cnt_alloc;
new_gres_ptr->node_cnt = 1;
if (gr... | false | false | false | false | false | 0 |
pcxhr_prepair_pipe_start(struct pcxhr_mgr *mgr,
int audio_mask, int *retry)
{
struct pcxhr_rmh rmh;
int err;
int audio = 0;
*retry = 0;
while (audio_mask) {
if (audio_mask & 1) {
pcxhr_init_rmh(&rmh, CMD_CAN_START_PIPE);
if (audio < PCXHR_PIPE_STATE_CAPTURE_OFFSET) {
/* can start playback pipe... | false | false | false | false | false | 0 |
_gss_spnego_internal_delete_sec_context
(OM_uint32 *minor_status,
gss_ctx_id_t *context_handle,
gss_buffer_t output_token
)
{
gssspnego_ctx ctx;
OM_uint32 ret, minor;
*minor_status = 0;
if (context_handle == NULL) {
return GSS_S_NO_CONTEXT;
}
if ... | false | false | false | false | false | 0 |
intersect(line2d p_a, line2d p_b){
if (p_a.B != 0 && p_b.B != 0){
double r = -p_a.B / p_b.B;
p_b.A *= r; p_b.A += p_a.A;
p_b.B *= r; p_b.B += p_a.B;
p_b.C *= r; p_b.C += p_a.C;
if (p_b.A != 0){
double x = -p_b.C / p_b.A;
return point2d(x, p_a.y(x));
}
else
throw std::runtime_error("No... | false | false | false | false | false | 0 |
load_options(void)
{
const char *home = getenv("HOME");
const char *tigrc_user = getenv("TIGRC_USER");
const char *tigrc_system = getenv("TIGRC_SYSTEM");
char buf[SIZEOF_STR];
add_builtin_run_requests();
if (!tigrc_system) {
if (!string_format(buf, "%s/tigrc", SYSCONFDIR))
return ERR;
tigrc_system = buf;... | false | false | false | false | false | 0 |
gst_caps_steal_structure (GstCaps * caps, guint index)
{
g_return_val_if_fail (caps != NULL, NULL);
g_return_val_if_fail (IS_WRITABLE (caps), NULL);
if (G_UNLIKELY (index >= GST_CAPS_LEN (caps)))
return NULL;
return gst_caps_remove_and_get_structure (caps, index);
} | false | false | false | false | false | 0 |
change_branch_review_pass_undo_notify_command_get(change::pointer cp)
{
cstate_ty *cstate_data;
cstate_branch_ty *bp;
cstate_data = cp->cstate_get();
bp = cstate_data->branch;
assert(bp);
if
(
bp->review_pass_undo_notify_command
&&
!bp->review_pass_undo_notify_command->str_lengt... | false | false | false | false | false | 0 |
brf_send_command_socket(int fd, struct bts_action_send* send_action)
{
char response[1024] = {0};
hci_command_hdr *cmd = (hci_command_hdr *) send_action->data;
uint16_t opcode = cmd->opcode;
struct hci_request rq;
memset(&rq, 0, sizeof(rq));
rq.ogf = cmd_opcode_ogf(opcode);
rq.ocf = cmd_opcode_ocf(opcode)... | false | false | false | false | false | 0 |
push(UScriptRun *scriptRun, int32_t pairIndex, UScriptCode scriptCode)
{
scriptRun->pushCount = LIMIT_INC(scriptRun->pushCount);
scriptRun->fixupCount = LIMIT_INC(scriptRun->fixupCount);
scriptRun->parenSP = INC1(scriptRun->parenSP);
scriptRun->parenStack[scriptRun->parenSP].pairIndex = pairIndex... | false | false | false | false | false | 0 |
hermon_poll_cq ( struct ib_device *ibdev,
struct ib_completion_queue *cq ) {
struct hermon *hermon = ib_get_drvdata ( ibdev );
struct hermon_completion_queue *hermon_cq = ib_cq_get_drvdata ( cq );
union hermonprm_completion_entry *cqe;
unsigned int cqe_idx_mask;
int rc;
while ( 1 ) {
/* Look for comple... | false | false | false | false | false | 0 |
Read( void * pBuffer, size_t nSize, size_t nCount )
{
size_t nRet;
if (nSubregionSize == 0)
nRet = VSIFReadL( pBuffer, nSize, nCount, fp );
else
{
if (nSize == 0)
return 0;
vsi_l_offset nCurOffset = VSIFTellL(fp);
if (nCurOffset >= nSubregionOffset + nSubreg... | false | false | false | false | false | 0 |
test_bit_string_encode_decode_zero (void)
{
GBytes *data;
GNode *asn;
asn = egg_asn1x_create (test_asn1_tab, "TestBitString");
g_assert (asn);
egg_asn1x_take_bits_as_raw (asn, g_bytes_new_static ("", 0), 0);
data = egg_asn1x_encode (asn, NULL);
g_assert (data);
egg_assert_cmpmem (g_bytes_get_data (data, NUL... | false | false | false | false | false | 0 |
qlafx00_iospace_config(struct qla_hw_data *ha)
{
if (pci_request_selected_regions(ha->pdev, ha->bars,
QLA2XXX_DRIVER_NAME)) {
ql_log_pci(ql_log_fatal, ha->pdev, 0x014e,
"Failed to reserve PIO/MMIO regions (%s), aborting.\n",
pci_name(ha->pdev));
goto iospace_error_exit;
}
/* Use MMIO operations... | false | false | false | false | false | 0 |
cavan_ext4_read_gdt(struct cavan_ext4_fs *fs)
{
void *gdt;
size_t size;
ssize_t rdlen;
size = fs->super.s_desc_size * fs->group_count;
gdt = malloc(size);
if (gdt == NULL)
{
pr_error_info("malloc");
return NULL;
}
rdlen = fs->bdev->read_byte(fs->bdev, cavan_ext4_get_block_hw_addr(fs, fs->first_data_block... | false | false | false | false | false | 0 |
_set_uri (CcBackgroundItem *item,
const char *value)
{
g_free (item->priv->uri);
if (value && *value == '\0') {
item->priv->uri = NULL;
} else {
if (value && strstr (value, "://") == NULL)
g_warning ("URI '%s' is invalid", value);
item->priv->uri = g_strdup (value);
}
} | false | false | false | false | false | 0 |
sanitize_values32(spx_word32_t *vec, spx_word32_t min_val, spx_word32_t max_val, int len)
{
int i;
for (i=0;i<len;i++)
{
/* It's important we do the test that way so we can catch NaNs, which are neither greater nor smaller */
if (!(vec[i]>=min_val && vec[i] <= max_val))
{
if (vec[i] ... | false | false | false | false | false | 0 |
calc_pitch(struct snd_emux_voice *vp)
{
struct snd_midi_channel *chan = vp->chan;
int offset;
/* calculate offset */
if (vp->reg.fixkey >= 0) {
offset = (vp->reg.fixkey - vp->reg.root) * 4096 / 12;
} else {
offset = (vp->note - vp->reg.root) * 4096 / 12;
}
offset = (offset * vp->reg.scaleTuning) / 100;
off... | false | false | false | false | false | 0 |
ndmis_data_connect (struct ndm_session *sess,
ndmp9_addr *addr, char *reason)
{
struct ndm_image_stream *is = &sess->plumb.image_stream;
struct ndmis_end_point *mine_ep = &is->data_ep;
struct ndmis_end_point *peer_ep = &is->tape_ep;
ndmp9_error error;
error = ndmis_ep_connect (sess, addr, reason, mine_ep, pee... | 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.