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 |
|---|---|---|---|---|---|---|
free_colormod(colormod_t *cmod)
{
ASSERT(cmod != NULL);
if (cmod->imlib_mod) {
imlib_context_set_color_modifier(cmod->imlib_mod);
imlib_free_color_modifier();
}
FREE(cmod);
} | false | false | false | true | false | 1 |
addLanguageDirDirective(MaState *state, cchar *key, cchar *value)
{
HttpRoute *route;
char *lang, *path;
route = state->route;
if (!maTokenize(state, value, "%S %S", &lang, &path)) {
return MPR_ERR_BAD_SYNTAX;
}
if ((path = stemplate(path, route->pathTokens)) == 0) {
re... | false | false | false | false | false | 0 |
lto_section_with_id (const char *name, unsigned HOST_WIDE_INT *id)
{
const char *s;
if (strncmp (name, LTO_SECTION_NAME_PREFIX, strlen (LTO_SECTION_NAME_PREFIX)))
return 0;
s = strrchr (name, '.');
return s && sscanf (s, "." HOST_WIDE_INT_PRINT_HEX_PURE, id) == 1;
} | false | true | false | false | true | 1 |
dbappend(db, spec)
struct db *db;
struct conf *spec;
{
if(db->db_size>=db->db_alloc) {
struct conf **conf;
unsigned alloc;
if(db->db_alloc) alloc=db->db_alloc*2U;
else alloc=16U;
if(alloc<db->db_alloc) return 0;
conf=(struct conf**)realloc((char*)db->db_conf, alloc*sizeof(struct db));
... | false | false | false | false | false | 0 |
interface_create_property(const char *key, DBusMessageIter *iter,
void *user_data)
{
struct interface_create_data *data = user_data;
struct supplicant_interface *interface = data->interface;
if (key == NULL) {
if (data->callback != NULL)
data->callback(0, data->interface, data->user_data);
dbus_free(... | false | false | false | false | false | 0 |
ml_gdome_cd_insertData(value self, value p_offset, value p_arg)
{
CAMLparam3(self, p_offset, p_arg);
GdomeException exc_;
GdomeDOMString* p_arg_ = DOMString_val(p_arg);gdome_cd_insertData(CharacterData_val(self), Int_val(p_offset), p_arg_, &exc_);
if (exc_ != 0) throw_exception(exc_, "CharacterData.ins... | false | false | false | false | false | 0 |
fill(char sep, size_t width) {
string res;
res.resize(width - 1, sep);
return res;
} | false | false | false | false | false | 0 |
sda_in(struct ipath_devdata *dd, int wait)
{
enum i2c_state bit;
if (i2c_gpio_get(dd, i2c_line_sda, &bit))
ipath_dbg("get bit failed!\n");
if (wait)
i2c_wait_for_writes(dd);
return bit == i2c_line_high ? 1U : 0;
} | false | false | false | false | false | 0 |
PrintPartialMatch(
void *theEnv,
char *logicalName,
struct partialMatch *list)
{
struct patternEntity *matchingItem;
short int i;
for (i = 0; i < (int) list->bcount;)
{
if (get_nth_pm_match(list,i)->matchingItem != NULL)
{
matchingItem = get_nth_pm_match(list,i)->matchingIt... | false | false | false | false | false | 0 |
psb_user_framebuffer_create
(struct drm_device *dev, struct drm_file *filp,
struct drm_mode_fb_cmd2 *cmd)
{
struct gtt_range *r;
struct drm_gem_object *obj;
/*
* Find the GEM object and thus the gtt range object that is
* to back this space
*/
obj = drm_gem_object_lookup(dev, filp, cmd->handles[0]);
... | false | false | false | false | false | 0 |
GRSTgaclAclAddEntry(GRSTgaclAcl *acl, GRSTgaclEntry *entry)
/*
GRSTgaclAclAddEntry - add a new entry to an existing acl, returning 1
on success or 0 on error
*/
{
if (acl == NULL) return 0;
if (acl->firstentry == NULL)
{
acl->firstentry = entry;
return 1;
}
else return GRSTgaclE... | false | false | false | false | false | 0 |
GDALDatasetAdviseRead( GDALDatasetH hDS,
int nXOff, int nYOff, int nXSize, int nYSize,
int nBufXSize, int nBufYSize, GDALDataType eDT,
int nBandCount, int *panBandMap,char **papszOptions )
{
VALIDATE_POINTER1( hDS, "GDALDatasetAdviseRead", ... | false | false | false | false | false | 0 |
create_profile (GUPnPDLNAProfileLoader *loader,
GUPnPDLNAProfile *base,
const gchar *name,
const gchar *mime,
gboolean extended)
{
GUPnPDLNAProfileLoaderPrivate *priv = loader->priv;
GUPnPDLNAProfi... | false | false | false | false | false | 0 |
DisplayErrorFile(const char *fname)
{//=====================================
int len;
FILE *f;
char *msg;
wxString msg_string;
len = GetFileLength(fname);
if(len > 0)
{
if(len > 1500)
len = 1500; // restrict length to pppppevent crash in wxLogMessage()
msg = (char *)malloc(len+1);
if(msg != NULL)
{... | false | false | false | false | true | 1 |
globus_gridftp_server_register_write(
globus_gfs_operation_t op,
globus_byte_t * buffer,
globus_size_t length,
globus_off_t offset,
int stripe_ndx,
globus_gridftp_server_write_cb_t callback,
... | false | false | false | false | false | 0 |
usb_serial_generic_unthrottle(struct tty_struct *tty)
{
struct usb_serial_port *port = tty->driver_data;
int was_throttled;
spin_lock_irq(&port->lock);
was_throttled = port->throttled;
port->throttled = port->throttle_req = 0;
spin_unlock_irq(&port->lock);
if (was_throttled)
usb_serial_generic_submit_read_ur... | false | false | false | false | false | 0 |
next_token()
{
for (;;) {
switch (state)
{
case 1: // command arguments
if (line[actual][head] == ' ') state = 2;
break;
case 0: // dot in begin of line
if (line[actual][0] == '.') {
state = 1;
break;
} else {
state = 2;
}
// no break
case 2: // non word chars
if (is_wordch... | false | false | false | false | false | 0 |
playerselall( int *playerbitmap)
{ tplayerselall sc;
sc.playerbit = *playerbitmap;
sc.init();
sc.run();
sc.done();
*playerbitmap = sc.playerbit;
} | false | false | false | false | false | 0 |
emit_fcode(u16 tok)
{
if ((tok>>8))
emit_byte(tok>>8);
emit_byte(tok&0xff);
fcode_written = TRUE;
} | false | false | false | false | false | 0 |
cpunum_reset(int cpunum, void *param, int (*irqack)(int))
{
VERIFY_CPUNUM_VOID(cpunum_reset);
cpuintrf_push_context(cpunum);
(*cpu[cpunum].intf.set_op_base)(0);
(*cpu[cpunum].intf.reset)(param);
if (irqack)
(*cpu[cpunum].intf.set_irq_callback)(irqack);
cpuintrf_pop_context();
} | false | false | false | false | false | 0 |
squashfs_put_super(struct super_block *sb)
{
if (sb->s_fs_info) {
struct squashfs_sb_info *sbi = sb->s_fs_info;
squashfs_cache_delete(sbi->block_cache);
squashfs_cache_delete(sbi->fragment_cache);
squashfs_cache_delete(sbi->read_page);
squashfs_decompressor_destroy(sbi);
kfree(sbi->id_table);
kfree(sbi->... | false | false | false | false | false | 0 |
dh_make_key(prng_state *prng, int wprng, int keysize, dh_key *key)
{
unsigned char *buf;
unsigned long x;
void *p, *g;
int err;
LTC_ARGCHK(key != NULL);
/* good prng? */
if ((err = prng_is_valid(wprng)) != CRYPT_OK) {
return err;
}
/* find key size */
for (x = 0; (keysize > sets[... | false | false | false | true | false | 1 |
mspi_apply_cpu_mode_quirks(struct spi_mpc8xxx_cs *cs,
struct spi_device *spi,
struct mpc8xxx_spi *mpc8xxx_spi,
int bits_per_word)
{
cs->rx_shift = 0;
cs->tx_shift = 0;
if (bits_per_word <= 8) {
cs->get_rx = mpc8xxx_spi_rx_buf_u8;
cs->get_tx = mpc8xxx_spi_tx_buf_u8;
} else if (bits_per_word <= 16) {
... | false | false | false | false | false | 0 |
gtr_history_entry_load_history (GtrHistoryEntry * entry)
{
gchar **items;
gsize i;
items = g_settings_get_strv (entry->priv->settings,
entry->priv->history_id);
i = 0;
gtk_combo_box_text_remove_all (GTK_COMBO_BOX_TEXT (entry));
/* Now the default value is an empty string so... | false | false | false | false | false | 0 |
SetBit(unsigned char *pc, unsigned int bitPos, int test, unsigned int iBit)
{
const unsigned int k = bitPos / 8;
const unsigned char rbit = (unsigned char) (0x1 << (bitPos % 8));
unsigned char c;
if (test & (0x1 << iBit))
c = rbit;
else
c = 0;
pc[k] = (pc[k] & (0xFF ^ rbit)) |... | false | false | false | false | false | 0 |
setAllColliders (int i, dColliderFn *fn)
{
for (int j=0; j<dGeomNumClasses; j++) setCollider (i,j,fn);
} | false | false | false | false | false | 0 |
dict_init(void)
{
const char *opt;
opt = conf_get_opt("l2tp", "dictionary");
if (!opt)
opt = DICTIONARY;
if (l2tp_dict_load(opt))
_exit(EXIT_FAILURE);
} | false | false | false | false | false | 0 |
dict_copy (dict_t *dict,
dict_t *new)
{
if (!dict) {
gf_log_callingfn ("dict", GF_LOG_WARNING, "dict is NULL");
return NULL;
}
if (!new)
new = get_new_dict_full (dict->hash_size);
dict_foreach (dict, _copy, new);
retur... | false | false | false | false | false | 0 |
encode(fxStackBuffer& buf) const
{
buf.put(devID, devID.length()+1);
buf.put(number, number.length()+1);
buf.put(commid, commid.length()+1);
switch (state) {
case DOWN: buf.put('D'); break;
case BUSY: buf.put('B'); break;
case READY: buf.put('R'); break;
}
buf.put(canpoll ? 'P' : '... | false | false | false | false | false | 0 |
setModelObjectNameById(int oid, char*name)
{
ModelObject* obj = getModelObjectById(oid);
if (obj == NULL ) return false;
obj->setName(name);
return true;
} | false | false | false | false | false | 0 |
OnUndo ()
{
if (m_UndoList.empty ()) {
if (m_pView->GetDoc()->CanUndo())
{
if (!m_RedoList.empty())
{
if (m_CurNode) {
xmlUnlinkNode (m_CurNode);
xmlFreeNode (m_CurNode);
}
m_CurNode = m_RedoList.back();
m_RedoList.pop_back();
}
m_bUndo = false;
Unselect();
}
return fal... | false | false | false | false | false | 0 |
qr_forget (xlator_t *this, inode_t *inode)
{
qr_inode_t *qr_inode = NULL;
qr_inode = qr_inode_ctx_get (this, inode);
if (!qr_inode)
return 0;
qr_inode_prune (this, inode);
GF_FREE (qr_inode);
return 0;
} | false | false | false | false | false | 0 |
_foreach(Request& r, MethodParams& params) {
InCycle temp(r);
const String& key_var_name=params.as_string(0, "key-var name must be string");
const String& value_var_name=params.as_string(1, "value-var name must be string");
Foreach_info info={
&r,
key_var_name.is_empty()? 0 : &key_var_name,
value_var_name.i... | false | false | false | false | false | 0 |
GetStyleFirstWord(int szLine, Accessor &styler)
{
int startPos = styler.LineStart(szLine);
int endPos = styler.LineStart(szLine + 1) - 1;
char ch = styler.SafeGetCharAt(startPos);
while (ch > 0 && isspacechar(ch) && startPos < endPos)
{
startPos++; // skip to next char
ch = styler.SafeGetCharAt(startPos);
}
... | false | false | false | false | false | 0 |
read_config(const char *path)
{
FILE *fp;
/* Make sure we have them sorted for bsearch */
qsort(keywords, NKEYWORDS, sizeof(keywords[0]), cmp_kw);
if(path)
{
if((fp = fopen(path, "r")) != NULL)
input_file = path;
}
else
{
if((fp = fopen("./" CONFFILENAME, "r")) == NULL)
{
if((fp = fopen(ETCDIR "/"... | false | false | false | false | true | 1 |
merge_exception_specifiers (tree list, tree add)
{
if (!list || !add)
return NULL_TREE;
else if (!TREE_VALUE (list))
return add;
else if (!TREE_VALUE (add))
return list;
else
{
tree orig_list = list;
for (; add; add = TREE_CHAIN (add))
{
tree spec = TREE_VALU... | false | false | false | false | false | 0 |
tracker_file_system_get_property (TrackerFileSystem *file_system,
GFile *file,
GQuark prop)
{
FileNodeData *data;
FileNodeProperty property, *match;
GNode *node;
g_return_val_if_fail (TRACKER_IS_FILE_SYSTEM (file_system), N... | false | false | false | false | false | 0 |
daemonize(void)
{
#ifndef WIN32
pid_t pid, sid;
int rc;
/* Fork off the parent process */
pid = fork();
if (pid < 0) {
return false;
}
/* If we got a good PID, then we are the parent and can exit */
if (pid > 0) {
exit(EXIT_SUCCESS);
}
/* now in forked chil... | false | false | false | false | true | 1 |
btr_def_live_range (btr_def def, HARD_REG_SET *btrs_live_in_range)
{
if (!def->live_range)
{
btr_user user;
def->live_range = BITMAP_XMALLOC ();
bitmap_set_bit (def->live_range, def->bb->index);
COPY_HARD_REG_SET (*btrs_live_in_range, btrs_live[def->bb->index]);
for (user = def->u... | false | false | false | false | false | 0 |
VObjectNeedsOrdering(VObject * obj)
{
VPolygon **p;
VColor *c;
int i;
if (obj->order || obj->numPolys == 0) {
return 0;
}
c = obj->polygon[0]->color;
for (i = 0, p = obj->polygon; i < obj->numPolys; ++i) {
#ifdef notdef
if (p[i]->color != c) {
return 1;
}
#endif
if (p[i]->backColor) {
re... | false | false | false | false | false | 0 |
PTRANS_lmul(int *K, int *J, int *I) {
static int ipow30 = ( 1 << 30 );
int kt, lt;
kt = K[0] * J[0]; if( kt < 0 ) kt = ( kt + ipow30 ) + ipow30;
I[0] = kt - ( ( kt >> 16 ) << 16 );
lt = K[0] * J[1] + K[1] * J[0];
if( lt < 0 ) lt = ( lt + ipow30 ) + ipow30;
kt = ( kt >> 16 ) + lt;
if( kt < 0 ) kt = (... | false | false | false | false | false | 0 |
frCombMinMaxReject(VimosImage **ima_list, int minrej,
int maxrej, int num)
{
char modName[] = "frCombMinMaxReject";
VimosImage *ima_out;
float *zvalue;
float average = 0;
int i, j, n, xlen, ylen, minn, maxn;
/* Errors handling */... | false | false | false | false | false | 0 |
ajSeqNewRefseq(const AjPRefseq refseq)
{
AjPSeq pthis;
AJNEW0(pthis);
if(refseq->Id)
ajStrAssignS(&pthis->Name, refseq->Id);
if(refseq->Db)
ajStrAssignS(&pthis->Db, refseq->Db);
if(refseq->Desc)
ajStrAssignS(&pthis->Desc, refseq->Desc);
if(refseq->Qry)
ajStrAs... | false | false | false | false | false | 0 |
utils_mkdir(const gchar *path, gboolean create_parent_dirs)
{
gint mode = 0700;
gint result;
if (path == NULL || strlen(path) == 0)
return EFAULT;
result = (create_parent_dirs) ? g_mkdir_with_parents(path, mode) : g_mkdir(path, mode);
if (result != 0)
return errno;
return 0;
} | false | false | false | false | false | 0 |
init_startup_params(ray_dev_t *local)
{
int i;
if (country > JAPAN_TEST)
country = USA;
else if (country < USA)
country = USA;
/* structure for hop time and beacon period is defined here using
* New 802.11D6.1 format. Card firmware is still using old format
* until version 6.
* Before ... | false | true | false | false | false | 1 |
metadata_menuitem_should_collapse (MetadataMenuitem* self, gboolean collapse) {
gboolean _tmp0_ = FALSE;
g_return_if_fail (self != NULL);
_tmp0_ = collapse;
dbusmenu_menuitem_property_set_bool ((DbusmenuMenuitem*) self, DBUSMENU_METADATA_MENUITEM_HIDE_TRACK_DETAILS, _tmp0_);
} | false | false | false | false | false | 0 |
gwy_data_field_get_elliptic_area_size(gint width,
gint height)
{
gint i, from, to, count;
gdouble a, b, s;
if (width <= 0 || height <= 0)
return 0;
a = width/2.0;
b = height/2.0;
count = 0;
for (i = 0; i < height; i++) {
s = (i + 0.5)/... | false | false | false | false | false | 0 |
saiz_Size(GF_Box *s)
{
GF_Err e;
GF_SampleAuxiliaryInfoSizeBox *ptr = (GF_SampleAuxiliaryInfoSizeBox*)s;
if (ptr->aux_info_type || ptr->aux_info_type_parameter) {
ptr->flags |= 1;
}
e = gf_isom_full_box_get_size(s);
if (e) return e;
if (ptr->flags & 1) ptr->size += 8;
ptr->size += 5;
if (ptr->default_sampl... | false | false | false | false | false | 0 |
GenericMultiLineNotesDlg_Ctor(HSQUIRRELVM v)
{
// (wxWindow* parent,
// const wxString& caption = _("Notes"),
// const wxString& notes = wxEmptyString,
// bool readOnly = true);
StackHandler sa(v);
GenericMultiLineNotesDlg* dlg = nullptr;
if (sa.G... | false | false | false | false | false | 0 |
TIFFReadDirEntryData(TIFF* tif, uint64 offset, tmsize_t size, void* dest)
{
assert(size>0);
if (!isMapped(tif)) {
if (!SeekOK(tif,offset))
return(TIFFReadDirEntryErrIo);
if (!ReadOK(tif,dest,size))
return(TIFFReadDirEntryErrIo);
} else {
tmsize_t ma,mb;
ma=(tmsize_t)offset;
mb=ma+size;
if (((uint64... | false | false | false | false | false | 0 |
addElement (double elapsed) {
if (count == 0) {
min = elapsed;
max = elapsed;
} else {
if (elapsed < min)
min = elapsed;
if (elapsed > max)
max = elapsed;
}
total += elapsed;
count ++;
} | false | false | false | false | false | 0 |
igb_update_mc_addr_list_generic(struct e1000_hw *hw,
u8 *mc_addr_list, u32 mc_addr_count)
{
u32 hash_value, hash_bit, hash_reg;
int i;
DEBUGFUNC("igb_update_mc_addr_list_generic");
/* clear mta_shadow */
memset(&hw->mac.mta_shadow, 0, sizeof(hw->mac.mta_shadow));
/* updat... | false | false | false | false | false | 0 |
nv3CalcArbitration
(
nv3_fifo_info * res_info,
nv3_sim_state * state
)
{
nv3_fifo_info save_info;
nv3_arb_info ainfo;
char res_gr, res_vid;
ainfo.gr_en = 1;
ainfo.vid_en = state->enable_video;
ainfo.vid_only_once = 0;
ainfo.gr_only_once = 0;
ainfo.gdrain_rate = (int) state->p... | false | false | false | false | false | 0 |
polynomialRingIntersection(PolynomialRing const &newRing, list<int> const *chosenVariables)const
{
PolynomialSet ret(newRing);
if(chosenVariables==0)
{
for(PolynomialSet::const_iterator i=begin();i!=end();i++)
if(i->maximalIndexOfVariableInSupport()<newRing.getNumberOfVariables())
{
ret.push_back... | false | false | false | false | false | 0 |
cfgfile_subst_path (const TCHAR *path, const TCHAR *subst, const TCHAR *file)
{
TCHAR *s = cfgfile_subst_path2 (path, subst, file);
if (s)
return s;
s = target_expand_environment (file);
if (s) {
TCHAR tmp[MAX_DPATH];
_tcscpy (tmp, s);
xfree (s);
fullpath (tmp, sizeof tmp / sizeof (TCHAR));
s = my_strdu... | false | false | false | false | false | 0 |
__gconv_compare_alias (const char *name1, const char *name2)
{
int result;
/* Ensure that the configuration data is read. */
__libc_once (once, __gconv_read_conf);
if (__gconv_compare_alias_cache (name1, name2, &result) != 0)
result = strcmp (do_lookup_alias (name1) ?: name1,
do_lookup_alias (name... | false | false | false | false | false | 0 |
rcar_usb_phy_shutdown(struct usb_phy *phy)
{
struct rcar_usb_phy_priv *priv = usb_phy_to_priv(phy);
void __iomem *reg0 = priv->reg0;
unsigned long flags;
spin_lock_irqsave(&priv->lock, flags);
if (priv->counter-- == 1) /* last user */
iowrite32(0x00000000, (reg0 + USBPCTRL1));
spin_unlock_irqrestore(&priv->l... | false | false | false | false | false | 0 |
wait(Home home, FloatVar x, void (*c)(Space& home)) {
if (home.failed()) return;
GECODE_ES_FAIL(Kernel::UnaryWait<Float::FloatView>::post(home,x,c));
} | false | false | false | false | false | 0 |
my_calloc(int32 size, int32 howmany, char *whatfor)
{ void *c;
if (size*howmany==0) return(NULL);
c=calloc(howmany,(size_t) size); malloced_bytes+=size*howmany;
if (c==0) memory_out_error(size, howmany, whatfor);
if (memout_switch)
printf("Allocating %ld bytes: array (%ld entries size %ld) \
f... | false | false | false | false | false | 0 |
send_enquire_link(SMPP *smpp, Connection *conn, long *last_sent)
{
SMPP_PDU *pdu;
Octstr *os;
if (date_universal_now() - *last_sent < smpp->enquire_link_interval)
return;
*last_sent = date_universal_now();
pdu = smpp_pdu_create(enquire_link, counter_increase(smpp->message_id_counter));
... | false | false | false | false | false | 0 |
fileio_seek(fileio *self, PyObject *args)
{
PyObject *posobj;
int whence = 0;
if (self->fd < 0)
return err_closed();
if (!PyArg_ParseTuple(args, "O|i", &posobj, &whence))
return NULL;
return portable_lseek(self->fd, posobj, whence);
} | false | false | false | false | false | 0 |
popup_action_notify_cb (GtkAction *action,
GParamSpec *pspec,
GtkActivatable *activatable)
{
GtkActivatableIface *iface;
iface = GTK_ACTIVATABLE_GET_IFACE (activatable);
g_return_if_fail (iface->update != NULL);
iface->update (activatable, action, pspec->name);
} | false | false | false | false | false | 0 |
GTextInfoGetMaxHeight(GWindow base,GTextInfo **ti,FontInstance *font,int *allsame) {
int height=0, temp, same=1;
int i;
for ( i=0; ti[i]->text!=NULL || ti[i]->image!=NULL; ++i ) {
temp= GTextInfoGetHeight(base,ti[i],font);
if ( height!=0 && height!=temp )
same = 0;
if ( height<temp )
height = ... | false | false | false | false | false | 0 |
main(void) {
int i;
for (i=CL_RETVAL_START_ID; i < CL_RETVAL_LAST_ID; i++) {
printf("%s\n", cl_get_error_text(i));
if (strcmp(cl_get_error_text(i), CL_RETVAL_UNDEFINED_STR) == 0) {
printf("%d is undefined!\n",i);
exit(1);
}
}
printf("main done\n");
return 0;
} | false | false | false | false | false | 0 |
chunk_record(void *chunk, size_t size)
{
extent_node_t *xnode, *node, *prev, key;
pages_purge(chunk, size);
/*
* Allocate a node before acquiring chunks_mtx even though it might not
* be needed, because base_node_alloc() may cause a new base chunk to
* be allocated, which could cause deadlock if chunks_mtx w... | false | false | false | false | false | 0 |
mark_dump_arg(void *ptr)
{
struct dump_arg *p = ptr;
if (!p->symbols)
return;
rb_mark_set(p->data);
rb_mark_hash(p->compat_tbl);
rb_gc_mark(p->str);
} | false | false | false | false | false | 0 |
gvvariationadaptorRetrieveAllFaileddescriptions(
EnsPGvvariationadaptor gvva,
ajuint identifier,
const AjPStr constraint,
AjPTable fvs)
{
ajuint gvvidentifier = 0U;
ajuint subsnpid = 0U;
ajuint *Pgvvidentifier = NULL;
ajuint *Psubsnpid = NULL;
AjPSqlstatement sqls = NULL;... | false | false | false | false | false | 0 |
gnm_go_data_get_sheet (GOData const *dat)
{
GnmDependent *dep = gnm_go_data_get_dep (dat);
g_return_val_if_fail (dep != NULL, NULL);
return dep->sheet;
} | false | false | false | false | false | 0 |
MakeMap(InvalidComponentHandle handle, int nIn, int *nNew)
{
int *map;
int i, j;
map = (int *)DXAllocate(nIn * sizeof(int));
if (! map)
return NULL;
for (i = 0, j = 0; i < nIn; i++)
if (DXIsElementInvalidSequential(handle, i))
map[i] = -1;
else
map[i] = j++;
*nNew = j;
r... | false | false | false | false | false | 0 |
print_desc(const char *pre, const char *text)
{
const char *p, *q;
for (p = text, q = strchr(p, '\n'); q; p = q+1, q = strchr(p, '\n'))
printf("%s%.*s\n", pre, (int)(q-p), p);
if (*p != '\0')
printf("%s%s\n", pre, p);
} | false | false | false | false | false | 0 |
model_set_subsys_path_nums(polymodel *pm, int n_subsystems, model_subsystem *subsystems)
{
int i, j;
for (i = 0; i < n_subsystems; i++)
subsystems[i].path_num = -1;
for (i = 0; i < n_subsystems; i++)
{
for (j = 0; j < pm->n_paths; j++)
{
if ( ((subsystems[i].subobj_num != -1) && (subsystems[i].subobj_num... | false | false | false | false | false | 0 |
GetGlobalSRSName()
{
if (poReader->CanUseGlobalSRSName() || bIsWFS)
return poReader->GetGlobalSRSName();
else
return NULL;
} | false | false | false | false | false | 0 |
w1_reply_len(struct w1_cb_block *block)
{
if (!block->cn)
return 0;
return (u8 *)block->cn - (u8 *)block->first_cn + block->cn->len;
} | false | false | false | false | false | 0 |
mtdpe_next(TermDocEnum *tde)
{
TermDocEnum *sub_tde;
int pos = 0, freq = 0;
int doc;
MultipleTermDocPosEnum *mtdpe = MTDPE(tde);
if (0 == mtdpe->pq->size) {
return false;
}
sub_tde = (TermDocEnum *)pq_top(mtdpe->pq);
doc = sub_tde->doc_num(sub_tde);
do {
freq += su... | false | false | false | false | false | 0 |
ProcessMemCheckOutput(const std::string& str,
std::string& log, int* results)
{
std::string::size_type cc;
for ( cc = 0; cc < cmCTestMemCheckHandler::NO_MEMORY_FAULT; cc ++ )
{
results[cc] = 0;
}
if ( this->MemoryTesterStyle == cmCTestMemCheckHandler::VA... | false | false | false | false | false | 0 |
bufseek (const char *buf, long int offset)
{
readbuf *rbuf = matching_buffer(buf);
if (rbuf != NULL) {
rbuf->point = rbuf->start + offset;
return 0;
}
return 1;
} | false | false | false | false | false | 0 |
s_claws_mailmbox_fetch_msg(Folder *folder, FolderItem *item, gint num)
{
gchar *path;
gchar *file;
int r;
struct claws_mailmbox_folder * mbox;
const char * data;
size_t len;
FILE * f;
mode_t old_mask;
g_return_val_if_fail(item != NULL, NULL);
g_return_val_if_fail(num... | false | false | false | false | false | 0 |
gvalue_util_set_value_from_string (GValue *value,
const char *str)
{
GValue tmp_value = {0, };
int i;
long l;
double d;
g_return_val_if_fail (str != NULL, FALSE);
switch (G_VALUE_TYPE (value)) {
case G_TYPE_STRING:
... | false | false | false | false | false | 0 |
seaudit_model_destroy(seaudit_model_t ** model)
{
size_t i;
if (model == NULL || *model == NULL) {
return;
}
for (i = 0; i < apol_vector_get_size((*model)->logs); i++) {
seaudit_log_t *l = apol_vector_get_element((*model)->logs, i);
log_remove_model(l, *model);
}
free((*model)->name);
apol_vector_destroy(&... | false | false | false | false | false | 0 |
git_pager(int stdout_is_tty)
{
const char *pager;
if (!stdout_is_tty)
return NULL;
pager = getenv("GIT_PAGER");
if (!pager) {
if (!pager_program)
git_config(git_default_config, NULL);
pager = pager_program;
}
if (!pager)
pager = getenv("PAGER");
if (!pager)
pager = DEFAULT_PAGER;
else if (!*pager... | false | false | false | false | false | 0 |
ReportCompileError( GDLException& e, const string& file)
{
cout << flush;
cerr << SysVar::MsgPrefix() << e.toString() << endl;
if( file != "")
{
cerr << " At: " << file;
SizeT line = e.getLine();
if( line != 0)
{
cerr << ", Line " << line;
SizeT col = e.getColumn();
if( co... | false | false | false | false | false | 0 |
pprint_term(struct cloogoptions *i, FILE *dst, struct clast_term *t)
{
if (t->var) {
int group = t->var->type == clast_expr_red &&
((struct clast_reduction*) t->var)->n > 1;
if (cloog_int_is_one(t->val))
;
else if (cloog_int_is_neg_one(t->val))
fprintf(dst, "-");
else {
cloog_int_pri... | false | false | false | false | false | 0 |
radeonfb_prim_copyarea(struct radeonfb_info *rinfo,
const struct fb_copyarea *area)
{
int xdir, ydir;
u32 sx, sy, dx, dy, w, h;
w = area->width; h = area->height;
dx = area->dx; dy = area->dy;
sx = area->sx; sy = area->sy;
xdir = sx - dx;
ydir = sy - dy;
if ( xdir < 0 ) { sx += w-1; dx += w-1; }
if (... | false | false | false | false | false | 0 |
gnumeric_negbinomdist (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
{
gnm_float x = gnm_fake_floor (value_get_as_float (argv[0]));
gnm_float r = gnm_fake_floor (value_get_as_float (argv[1]));
gnm_float p = value_get_as_float (argv[2]);
if ((x + r - 1) <= 0 || p < 0 || p > 1)
return value_new_error_NUM (ei-... | false | false | false | false | false | 0 |
PyErr_NoMemory(void)
{
if (PyErr_ExceptionMatches(PyExc_MemoryError))
/* already current */
return NULL;
/* raise the pre-allocated instance if it still exists */
if (PyExc_MemoryErrorInst)
PyErr_SetObject(PyExc_MemoryError, PyExc_MemoryErrorInst);
else
/* this will prob... | false | false | false | false | false | 0 |
s32ton(__s32 value, unsigned n)
{
s32 a = value >> (n - 1);
if (a && a != -1)
return value < 0 ? 1 << (n - 1) : (1 << (n - 1)) - 1;
return value & ((1 << n) - 1);
} | false | false | false | false | false | 0 |
setViewRect(const QRectF &rect)
{
if (mWidget)
mWidget->setPos(rect.x(), rect.y());
if (mContactUI)
mContactUI->setPos(rect.x(), rect.y());
} | false | false | false | false | false | 0 |
process(int32_t count, float *input, float *output)
{
inp_count = count;
int32_t olen = out_count = get_max_out_size(count);
inp_data = input;
out_data = output;
if (Resampler::process() != 0)
{
return 0;
}
assert(inp_count == 0);
return olen - out_count;
} | false | false | false | false | false | 0 |
cross_validate_front_and_back_color(struct gl_shader_program *prog,
const ir_variable *input,
const ir_variable *front_color,
const ir_variable *back_color,
gl_shader_stage con... | false | false | false | false | false | 0 |
get_program_headers (FILE * file)
{
Elf_Internal_Phdr * phdrs;
/* Check cache of prior read. */
if (program_headers != NULL)
return 1;
phdrs = (Elf_Internal_Phdr *) cmalloc (elf_header.e_phnum,
sizeof (Elf_Internal_Phdr));
if (phdrs == NULL)
{
error (... | false | false | false | false | false | 0 |
ktest_empty_ticket(krb5_ticket *tkt)
{
if (tkt->server)
ktest_destroy_principal(&tkt->server);
ktest_destroy_enc_data(&tkt->enc_part);
if (tkt->enc_part2)
ktest_destroy_enc_tkt_part(&tkt->enc_part2);
} | false | false | false | false | false | 0 |
touchFile(const char* name) {
RAMFile* file = NULL;
{
SCOPED_LOCK_MUTEX(files_mutex);
file = files->get((char*)name);
}
const uint64_t ts1 = file->getLastModified();
uint64_t ts2 = Misc::currentTimeMillis();
//make sure that the time has actually changed
while ( ts1==ts2 ) {
_... | false | false | false | false | false | 0 |
ixgbe_negotiate_vf_api(struct ixgbe_adapter *adapter,
u32 *msgbuf, u32 vf)
{
int api = msgbuf[1];
switch (api) {
case ixgbe_mbox_api_10:
case ixgbe_mbox_api_11:
case ixgbe_mbox_api_12:
adapter->vfinfo[vf].vf_api = api;
return 0;
default:
break;
}
e_info(drv, "VF %d requested invalid api version %u... | false | false | false | false | false | 0 |
get_unique_recent_modules (const char *current_module)
{
char **recent_games, **new_recent;
gsize i;
gsize n_recent = 0;
gsize n_new_recent = 0;
recent_games = ar_conf_get_string_list (NULL, aisleriot_conf_get_key (CONF_RECENT_GAMES), &n_recent, NULL);
if (recent_games == NULL) {
new_recent = g_new (c... | false | false | false | false | false | 0 |
stack_protect_prologue (void)
{
tree guard_decl = targetm.stack_protect_guard ();
rtx x, y;
x = expand_normal (crtl->stack_protect_guard);
y = expand_normal (guard_decl);
/* Allow the target to copy from Y to X without leaking Y into a
register. */
if (HAVE_stack_protect_set)
{
rtx insn = ... | false | false | false | false | false | 0 |
parseArgumentParser(ArArgumentParser *parser,
bool continueOnError,
char *errorBuffer,
size_t errorBufferLen)
{
std::list<ArConfigSection *>::iterator sectionIt;
std::list<ArConfigArg>::iterator paramIt;
ArConfigSection *section = NULL;
ArConfigArg *param = NULL;
std::list<ArConfigA... | false | false | false | false | false | 0 |
debug_menu_extra_state(void)
{
GeanyDocument *doc = document_get_current();
return ((thread_state >= THREAD_AT_SOURCE) << DS_INDEX_1) |
((doc && utils_source_document(doc)) << DS_INDEX_2) |
((thread_state == THREAD_AT_ASSEMBLER) << DS_INDEX_3) |
(recent_menu_items() << DS_INDEX_4);
} | false | false | false | false | false | 0 |
CCsend(char *av[])
{
SITE *sp;
if ((sp = SITEfind(av[0])) == NULL)
return CCnosite;
if (sp->Type != FTexploder)
return CCwrongtype;
SITEwrite(sp, av[1]);
return NULL;
} | false | false | false | false | false | 0 |
ARTreadheader(files)
char *files;
{
register char *p;
register char *head;
if ((head = ARTreadarticle(files)) == NULL)
return NULL;
/* Find \n\n which means the end of the header. */
for (p = head; (p = strchr(p, '\n')) != NULL; p++)
if (p[1] == '\n') {
p[1] = '\0';
return head;
... | false | false | false | false | false | 0 |
NewPILInterfaceType(PILInterfaceUniv*univ, const char * typename
, void* ifeports, void* user_data)
{
PILInterfaceType* ifmgr_types;
PILInterface* ifmgr_ref;
PILInterfaceType* ret = NEW(PILInterfaceType);
STATNEW(interfacetype);
ret->MagicNum = PIL_MAGIC_INTERFACETYPE;
ret->typename = g_strdup(typename);
ret->... | 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.