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 |
|---|---|---|---|---|---|---|
getLoopPhiForCounter(Value *IncV, Loop *L, DominatorTree *DT) {
Instruction *IncI = dyn_cast<Instruction>(IncV);
if (!IncI)
return nullptr;
switch (IncI->getOpcode()) {
case Instruction::Add:
case Instruction::Sub:
break;
case Instruction::GetElementPtr:
// An IV counter must preserve its type.... | false | false | false | false | false | 0 |
__message(METHOD M, LEVEL L, const char *fmt, va_list ap)
{
char buf[BUFSIZE];
char msg[BUFSIZE+1024];
LEVEL level = WARNING;
char pmode[64];
char lmode[64];
memset(lmode, '\0', 64);
memset(pmode, '\0', 64);
vsprintf(buf, fmt, ap);
if (errno == 0 || errno == ENOSYS || L == DEBUG) {
snpri... | false | false | false | false | false | 0 |
valid_memory_range(struct kexec_info *info,
unsigned long sstart, unsigned long send)
{
int i;
if (sstart > send) {
return 0;
}
if ((send > mem_max) || (sstart < mem_min)) {
return 0;
}
for (i = 0; i < info->memory_ranges; i++) {
unsigned long mstart, mend;
/* Only consider memory ranges */
if ... | false | false | false | false | false | 0 |
DeclClass(int symbolID, char * name)
{
if(strchr(name, ':'))
return _DeclClass(symbolID, name);
else
return DeclClassAddNameSpace(symbolID, name);
} | false | false | false | false | false | 0 |
getSemaphore()
{
#ifndef __amigaos4__
// Struct for semctl
union semun {
int val;
struct semid_ds* buf;
unsigned short* array;
};
#endif
semun s;
// We employ the textbook solution to the race condition during creation
// and initialization of the semaphore: Create the ... | false | false | false | false | false | 0 |
on_actionInfo_triggered()
{
QMessageBox::about(this, tr("About AFSK1200 Decoder"),
tr("<p>Gqrx AFSK1200 Decoder %1</p>"
"<p>The Gqrx AFSK1200 decoder taps directly into the SDR signal path "
"eliminating the need to mess with virtual or real... | false | false | false | false | false | 0 |
HandleSwitches(int argc, char *argv[])
{
int s;
while ((s = xgetopt(argc,argv,"V:v:xXH:h:8k:K:BbO:o:T:t:D:d:C:c:n:N:f:F:lLy:Y:r:R:")) != EOF) {
switch (s) {
case 'V':
case 'v':
Verbose = atoi(xoptarg);
if (Verbose < 0 || Verbose > 3) {
FatalError("Unknow... | false | false | false | false | true | 1 |
pprint_equation(struct cloogoptions *i, FILE *dst, struct clast_equation *eq)
{
pprint_expr(i, dst, eq->LHS);
if (eq->sign == 0)
fprintf(dst, " == ");
else if (eq->sign > 0)
fprintf(dst, " >= ");
else
fprintf(dst, " <= ");
pprint_expr(i, dst, eq->RHS);
} | false | false | false | false | false | 0 |
namSvrSetAttrStrC(const AjPTable svrtable, const char* attrib,
AjPStr* qrystr)
{
const void* svrval = NULL;
const AjPStr strval = NULL;
const NamPAttr attr = NULL;
const AjPList fdlist = NULL;
AjIList iter = NULL;
AjPStrTok handle = NULL;
AjPStr word = NULL;
... | false | false | false | true | false | 1 |
kdbCloseBackend(KDB *handle)
{
int rc=0;
if (handle->kdbClose)
rc=handle->kdbClose(handle);
if (rc == 0) {
kdbLibClose(handle->dlHandle);
capDel (handle->capability);
keyDel(handle->mountpoint);
if (handle->config) ksDel(handle->config);
free(handle);
}
return rc;
} | false | false | false | false | false | 0 |
vlsi_reg_debug(unsigned iobase, const char *s)
{
int i;
printk(KERN_DEBUG "%s: ", s);
for (i = 0; i < 0x20; i++)
printk("%02x", (unsigned)inb((iobase+i)));
printk("\n");
} | false | false | false | false | false | 0 |
click_callback(Widget w,
XtPointer client_data,
XtPointer call_data)
{
VIEWER *v = (VIEWER *)client_data;
int *button = (int *)call_data;
char *cmd;
pid_t pid;
if (!button || *button <= 0) {
viewer_destroy(v);
return;
}
if (!v->view_cmd || *button == 3) {
Widget w;
... | false | false | false | false | false | 0 |
rech_sampletag(const char *adr, const char *s) {
int p;
if ((*(adr - 1) == '<') || (is_space(*(adr - 1)))) { // <tag < tag etc
p = strfield(adr, s);
if (p) {
if (!isalnum((unsigned char) adr[p])) { // <srcbis n'est pas <src
return 1;
}
return 0;
}
}
return 0;
} | false | false | false | false | false | 0 |
setup_folderitem_node(GNode *item_node, GNode *item_parent, PyObject **pyparent)
{
PyObject *pynode, *children;
int retval, n_children, i_child;
PyObject *folder;
/* create a python node for the folderitem node */
pynode = clawsmail_node_new(cm_module);
if(!pynode)
return FALSE;
/* store Folder in p... | false | false | false | false | false | 0 |
GetFeatureCount( int bForce )
{
if (nFeatureCount >= 0 &&
m_poFilterGeom == NULL && m_poAttrQuery == NULL)
{
return nFeatureCount;
}
if( !GetAttrFilterPassThroughValue() )
return OGRLayer::GetFeatureCount(bForce);
int nRet = 0;
for(int i = 0; i < nSrcLayers; i++)
{
... | false | false | false | false | false | 0 |
ensDitagfeatureTrace(const EnsPDitagfeature dtf, ajuint level)
{
AjPStr indent = NULL;
if (!dtf)
return ajFalse;
indent = ajStrNew();
ajStrAppendCountK(&indent, ' ', level * 2);
ajDebug("%SensDitagfeatureTrace %p\n"
"%S Use %u\n"
"%S Identifier %u\n"
... | false | false | false | false | false | 0 |
applyLambda(const Expr& e) {
if(CHECK_PROOFS) {
CHECK_SOUND(e.isApply() && e.getOpKind() == LAMBDA,
"applyLambda("+e.toString()
+"):\n\n expression is not an APPLY");
}
Expr lambda(e.getOpExpr());
if (CHECK_PROOFS) {
CHECK_SOUND(lambda.isLambda(),
"applyLambda:\n"
"Operator is not LAMBDA: " + ... | false | false | false | false | false | 0 |
threshold_already_triggered(struct threshold *t)
{
return t->value_set && below_threshold(t, t->current_value);
} | false | false | false | false | false | 0 |
FlushFileStream(int sd,int toget)
{ int i;
char buffer[2];
CfOut(cf_inform,"","Flushing rest of file...%d bytes\n",toget);
for (i = 0; i < toget; i++)
{
recv(sd,buffer,1,0); /* flush to end of current file */
}
} | false | false | false | false | false | 0 |
is_prefix(const char *as1, const char *as2)
{
const char *s1, *s2;
s1 = as1;
s2 = as2;
while (*s1++ == *s2)
if (*s2++ == '\0')
return(1);
return(*--s1 == '\0');
} | false | false | false | false | false | 0 |
i_stutter_or_gap(int16_t *A, int16_t *B,long offA, long offB, long int gap)
{
long a1=offA;
long b1=offB;
/* If the rift was so big that there aren't enough samples in the other
* vector to compare against the full gap, then just compare what we
* have available. E.g.:
*
* (5678)|(newly... | false | false | false | false | false | 0 |
sidebar_openfiles_add(GeanyDocument *doc)
{
GtkTreeIter *iter = &doc->priv->iter;
GtkTreeIter *parent = get_doc_parent(doc);
gchar *basename;
const GdkColor *color = document_get_status_color(doc);
static GdkPixbuf *file_icon = NULL;
gtk_tree_store_append(store_openfiles, iter, parent);
/* check if new parent ... | false | false | false | false | false | 0 |
GPS_Course_Lap_New(void)
{
GPS_PCourse_Lap ret;
if (!(ret=(GPS_PCourse_Lap)calloc(1,sizeof(GPS_OCourse_Lap)))) {
perror("malloc");
fprintf(stderr,"GPS_Course_Lap_New: Insufficient memory");
fflush(stderr);
return NULL;
}
return ret;
} | false | false | false | false | false | 0 |
err_delError(struct _errmsg * err) {
int idx ;
if (!err) return ;
idx = err->code/100 ;
if (err->next) {
err->next->prev = err->prev ;
}
if (err->prev)
err->prev->next = err->next ;
else
errtable[idx].errlist = err->next ;
free(err->msg) ;
free(err) ;
errtable[idx].count-- ;
} | false | false | false | false | false | 0 |
Calendar_static_getAvailableLocales(JNIEnv *env , jobject** result, int* len, lList **alpp) {
jgdi_result_t ret = JGDI_SUCCESS;
static jmethodID mid = NULL;
static jclass clazz = NULL;
jobject temp = NULL;
DENTER(BASIS_LAYER, "Calendar_static_getAvailableLocales");
if (result == NULL... | false | false | false | false | false | 0 |
raw_ioctl(struct net_device *dev, struct ifreq *ifr)
{
raw_hdlc_proto __user *raw_s = ifr->ifr_settings.ifs_ifsu.raw_hdlc;
const size_t size = sizeof(raw_hdlc_proto);
raw_hdlc_proto new_settings;
hdlc_device *hdlc = dev_to_hdlc(dev);
int result;
switch (ifr->ifr_settings.type) {
case IF_GET_PROTO:
if (dev_to_... | false | true | false | false | false | 1 |
_PR_getset(PR_fd_set *pr_set, fd_set *set)
{
PRUint32 index;
PRInt32 max = 0;
if (!pr_set)
return 0;
FD_ZERO(set);
/* First set the pr file handle osfds */
for (index=0; index<pr_set->hsize; index++) {
FD_SET(pr_set->harray[index]->secret->md.osfd, set);
if (pr_set-... | false | false | false | false | false | 0 |
ql_free_small_buffers(struct ql3_adapter *qdev)
{
if (!test_bit(QL_ALLOC_SMALL_BUF_DONE, &qdev->flags)) {
netdev_info(qdev->ndev, "Already done\n");
return;
}
if (qdev->small_buf_virt_addr != NULL) {
pci_free_consistent(qdev->pdev,
qdev->small_buf_total_size,
qdev->small_buf_virt_addr,
... | false | false | false | false | false | 0 |
load_superblock(journal_t *journal)
{
int err;
journal_superblock_t *sb;
err = journal_get_superblock(journal);
if (err)
return err;
sb = journal->j_superblock;
journal->j_tail_sequence = be32_to_cpu(sb->s_sequence);
journal->j_tail = be32_to_cpu(sb->s_start);
journal->j_first = be32_to_cpu(sb->s_first);
... | false | false | false | false | false | 0 |
OnOptions2(int event_id)
{//==========================
wxString string;
int value;
switch(event_id)
{
case MENU_OPT_SPEED:
value = wxGetNumberFromUser(_T(""),_T(""),_T("Speed"),option_speed,80,500);
if(value > 0)
{
option_speed = value;
SetParameter(espeakRATE,option_speed,0);
SetSpeed(3);
}
br... | false | false | false | false | false | 0 |
find_absolute_long (uae_u8* start_addr, uae_u8* end_addr, uae_u32 search_value)
{
uae_u8* addr;
for (addr = start_addr; addr < end_addr;) {
if (do_get_mem_long ((uae_u32*)addr) == search_value) {
/* write_log_debug("Found %p at offset %p.\n", search_value, addr - start_addr);*/
return addr;
}
addr +=... | false | false | false | false | false | 0 |
th1_page(void){
const char *zQ = P("q");
int go = P("go")!=0;
login_check_credentials();
if( !g.perm.Setup ){
login_needed();
}
db_begin_transaction();
style_header("Raw TH1 Commands");
cgi_printf("<p><b>Caution:</b> There are no restrictions on the TH1 that can be\n"
"run by this page. If... | false | false | false | false | false | 0 |
ciconvert(wxString& path)
{
// Nothing to simulate if the filesystem is already case-insensitive
if (!wxFileName::IsCaseSensitive())
return;
wxString path_tmp_copy(path);
path_tmp_copy.Append(wxT("/")); // simulate a directory for GetDirs()
wxFileName filename(path_tmp_copy);
wxArrayString path_element... | false | false | false | false | false | 0 |
key_changed (DBusGProxy *proxy, const char *key, CryptUIKeyset *keyset)
{
gpointer closure;
gchar *k = NULL;
if (!keyset->priv->expand_keys)
key = k = cryptui_key_get_base (key);
/* Remove all cached properties for this key */
g_hash_table_remove (keyset->priv->key_props, key);
... | false | false | false | false | false | 0 |
update_file_is_binary_by_attr(git_repository *repo, git_diff_file *file)
{
const char *value;
if (git_attr_get(&value, repo, 0, file->path, "diff") < 0)
return -1;
if (GIT_ATTR_FALSE(value))
file->flags |= GIT_DIFF_FILE_BINARY;
else if (GIT_ATTR_TRUE(value))
file->flags |= GIT_DIFF_FILE_NOT_BINARY;
/* other... | false | false | false | false | false | 0 |
gkm_manager_find_handles (GkmManager *self, GkmSession *session,
gboolean also_private, CK_ATTRIBUTE_PTR attrs,
CK_ULONG n_attrs, GArray *found)
{
Finder finder = { 0, };
g_return_val_if_fail (GKM_IS_MANAGER (self), CKR_GENERAL_ERROR);
g_return_val_if_fail (attrs ... | false | false | false | false | false | 0 |
close_dir_keep_errno(DIR* dp) {
int save = errno;
if (dp)
closedir (dp);
errno=save;
} | false | false | false | false | false | 0 |
init_audio_stream(bgav_demuxer_context_t * ctx,
strh_t * strh, chunk_header_t * ch)
{
uint8_t * buf, * pos;
bgav_WAVEFORMAT_t wf;
int keep_going;
bgav_stream_t * bg_as;
audio_priv_t * avi_as;
keep_going = 1;
bg_as = bgav_track_add_audio_stream(ctx->tt->cur, ctx->opt);
avi... | false | false | false | false | false | 0 |
GetDefaultForName(char *name)
{
default_t *result;
// Try the main list and the extras
result = SearchCollection(&doom_defaults, name);
if (result == NULL)
{
result = SearchCollection(&extra_defaults, name);
}
// Not found? Internal error.
if (result == NULL)
{
I... | false | false | false | false | false | 0 |
onquest()
{
if(u.uevent.qcompleted || Not_firsttime) return;
if(!Is_special(&u.uz)) return;
if(Is_qstart(&u.uz)) on_start();
else if(Is_qlocate(&u.uz) && u.uz.dlevel > u.uz0.dlevel) on_locate();
else if(Is_nemesis(&u.uz)) on_goal();
return;
} | false | false | false | false | false | 0 |
L83()
{register object *base=vs_base;
register object *sup=base+VM71; VC71
vs_check;
vs_top=sup;
goto TTL;
TTL:;
{object V545;
object V546;
object V547;
object V548;
object V549;
vs_base=vs_top;
(void) (*Lnk355)();
vs_top=sup;
V545= vs_base[0];
base[0]= (V545);
vs_top=(vs_base=base+0)+1;
(void) (*Lnk372... | false | false | false | false | false | 0 |
operator()(SUnit *left, SUnit *right) const {
if (int res = checkSpecialNodes(left, right))
return res > 0;
unsigned LOrder = SPQ->getNodeOrdering(left);
unsigned ROrder = SPQ->getNodeOrdering(right);
// Prefer an ordering where the lower the non-zero order number, the higher
// the preference.
if ((L... | false | false | false | false | false | 0 |
csv_stringtrim(const char* string, const char* enclosure, int strip_max)
#endif
{
static const char* p1 = NULL;
char* p2 = NULL;
char* tmp = xxstrdup(string,file,line);
size_t elen;
int stripped = 0;
if (!strlen(string)) {
return (tmp);
}
if (!enclosure) {
elen = 0;
} else {
elen = strle... | false | false | false | false | false | 0 |
Encode(const uint8_t* rgba, int width, int height, int stride,
Importer import, float quality_factor, int lossless,
uint8_t** output) {
WebPPicture pic;
WebPConfig config;
WebPMemoryWriter wrt;
int ok;
if (!WebPConfigPreset(&config, WEBP_PRESET_DEFAULT, quality_facto... | false | false | false | false | false | 0 |
CreateSharedProcArray(void)
{
bool found;
/* Create or attach to the ProcArray shared structure */
procArray = (ProcArrayStruct *)
ShmemInitStruct("Proc Array",
add_size(offsetof(ProcArrayStruct, procs),
mul_size(sizeof(PGPROC *),
PROCARRAY_MAXPROCS)),
&found);
if (!found)
{
... | false | false | false | false | false | 0 |
usbat_read_blocks(struct us_data *us,
void* buffer,
int len,
int use_sg)
{
int result;
unsigned char *command = us->iobuf;
command[0] = 0xC0;
command[1] = USBAT_ATA | USBAT_CMD_COND_READ_BLOCK;
command[2] = USBAT_ATA_DATA;
command[3] = USBAT_ATA_STATUS;
command[4] = 0xFD; /* Timeout (ms)... | false | false | false | false | false | 0 |
multi_pxo_ban_init()
{
// zero the active banner bitmap
Multi_pxo_banner.ban_bitmap = -1;
// are we doing banners at all?
if ( os_config_read_uint(NULL, "PXOBanners", 1) ) {
// if we're already in idle mode, we're done downloading for this instance of freespace. pick a random image we already have
if(Multi_px... | false | false | false | false | false | 0 |
add_attributes(PyTypeObject* type, char**attrs, int num_fields)
{
int i, result;
_Py_IDENTIFIER(_attributes);
PyObject *s, *l = PyTuple_New(num_fields);
if (!l)
return 0;
for (i = 0; i < num_fields; i++) {
s = PyUnicode_FromString(attrs[i]);
if (!s) {
Py_DECREF(l)... | false | false | false | false | true | 1 |
fso_gsm_modem_factory_validateModemType (const gchar* modemtype) {
gboolean result = FALSE;
const gchar* _tmp0_ = NULL;
GType _tmp1_ = 0UL;
g_return_val_if_fail (modemtype != NULL, FALSE);
_tmp0_ = modemtype;
_tmp1_ = fso_gsm_modem_factory_typeNameToClassType (_tmp0_);
result = _tmp1_ != G_TYPE_INVALID;
return ... | false | false | false | false | false | 0 |
any_dependent_template_arguments_p (const_tree args)
{
int i;
int j;
if (!args)
return false;
if (args == error_mark_node)
return true;
for (i = 0; i < TMPL_ARGS_DEPTH (args); ++i)
{
const_tree level = TMPL_ARGS_LEVEL (args, i + 1);
for (j = 0; j < TREE_VEC_LENGTH (level); ++j)
if (... | false | false | false | false | true | 1 |
m5632_recover(struct usbnet *dev)
{
struct usb_device *udev = dev->udev;
struct usb_interface *intf = dev->intf;
int r;
r = usb_lock_device_for_reset(udev, intf);
if (r < 0)
return;
usb_reset_device(udev);
usb_unlock_device(udev);
} | false | false | false | false | false | 0 |
hsw_write_infoframe(struct drm_encoder *encoder,
enum hdmi_infoframe_type type,
const void *frame, ssize_t len)
{
const uint32_t *data = frame;
struct drm_device *dev = encoder->dev;
struct drm_i915_private *dev_priv = dev->dev_private;
struct intel_crtc *intel_crtc = to_intel_crtc(encoder->crtc);
enum tra... | false | false | false | false | false | 0 |
lg216x_get_prc(struct lg216x_state *state, u8 *prc)
{
u8 val;
int ret;
*prc = 0xff; /* invalid value */
ret = lg216x_read_reg(state, 0x0125, &val);
if (lg_fail(ret))
goto fail;
*prc = ((val >> 5) & 0x07) + 1;
fail:
return ret;
} | false | false | false | false | false | 0 |
setup()
{
m_box_find.signal_find_criteria.connect(sigc::mem_fun(*this, &Dialog_ChooseID::on_box_find_criteria));
m_box_select.signal_user_requested_details().connect(sigc::mem_fun(*this, &Dialog_ChooseID::on_box_select_selected));
m_box_select.set_read_only();
//Fill composite view:
add_view(&m_box_find);
... | false | false | false | false | false | 0 |
pic_get_zone_update(gint32 frame_id, gint32 pic_id, gint * x1, gint * y1, gint * x2, gint * y2) {
gint32 x1_old, x1_new, y1_old, y1_new, x2_old, x2_new, y2_old, y2_new;
/* get new coord */
x1_new = frame[frame_id]->obj[pic_id]->x;
y1_new = frame[frame_id]->obj[pic_id]->y;
x2_new = x1_new + frame[frame_id]->obj[... | false | false | false | false | false | 0 |
sd_sdr_tuning_tx_cmd(struct rtsx_chip *chip, u8 sample_point)
{
struct sd_info *sd_card = &(chip->sd_card);
int retval;
retval = sd_change_phase(chip, sample_point, TUNE_TX);
if (retval != STATUS_SUCCESS) {
rtsx_trace(chip);
return STATUS_FAIL;
}
retval = rtsx_write_register(chip, SD_CFG3, SD_RSP_80CLK_TIME... | false | false | false | false | false | 0 |
convert_string_directly (iconv_t cd, const char *string,
const struct conversion_context* context)
{
size_t len = strlen (string) + 1;
char *result = NULL;
size_t resultlen = 0;
if (xmem_cd_iconv (string, len, cd, &result, &resultlen) == 0)
/* Verify the result has exactly one NUL ... | false | false | false | false | false | 0 |
get_scredentials(Cookie *cookies, Scredentials **sp)
{
unsigned int decrypted_cookie_len, encrypted_cookie_len;
unsigned char *decrypted_cookie, *encrypted_cookie;
char *name;
Cookie *c;
Crypt_keys *ck;
*sp = NULL;
name = make_selected_cookie_name();
for (c = cookies; c != NULL; c = c->next) {
if (str... | false | false | false | false | false | 0 |
stun_attr_get_first_addr_str(const u08bits *buf, size_t len, u16bits attr_type, ioa_addr* ca, const ioa_addr *default_addr) {
stun_attr_ref attr=stun_attr_get_first_str(buf,len);
while(attr) {
if(stun_attr_is_addr(attr) && (attr_type == stun_attr_get_type(attr))) {
if(stun_attr_get_addr_str(buf,len,attr... | false | false | false | false | false | 0 |
regulator_userspace_consumer_probe(struct platform_device *pdev)
{
struct regulator_userspace_consumer_data *pdata;
struct userspace_consumer_data *drvdata;
int ret;
pdata = dev_get_platdata(&pdev->dev);
if (!pdata)
return -EINVAL;
drvdata = devm_kzalloc(&pdev->dev,
sizeof(struct userspace_consumer_... | false | false | false | false | false | 0 |
stopWpsRun(bool success)
{
if (wpsRunning)
wpsStatusText->setText(success ? tr("Connected to the network") :
tr("Stopped"));
else
wpsStatusText->setText("");
wpsPinEdit->setEnabled(false);
wpsInstructions->setText("");
wpsRunning = false;
bssFromScan = "";
wpsApPinEdit->setEnabled(false);
wpsApPi... | false | false | false | false | false | 0 |
udl_gem_vunmap(struct udl_gem_object *obj)
{
if (obj->base.import_attach) {
dma_buf_vunmap(obj->base.import_attach->dmabuf, obj->vmapping);
return;
}
vunmap(obj->vmapping);
udl_gem_put_pages(obj);
} | false | false | false | false | false | 0 |
chunk_allocate(int bytes, const char *initial, int initial_len)
{
if (initial_len >= bytes)
{
cerr<<"initialiser too long\n";
abort();
}
EST_Chunk *cp = new(bytes) EST_Chunk;
memcpy(cp->memory, initial, initial_len);
cp->memory[initial_len] = '\0';
return (EST_ChunkPtr)cp;
} | false | false | false | false | true | 1 |
upscrecv(char *buf)
{
int res;
/* NOTE: the serial port is set to use Canonical Mode Input Processing,
which means ser_get_buf() either returns one line terminated with
ENDCHAR, an error or times out. */
while (1) {
res = ser_get_buf(upsfd, buf, UPSC_BUFLEN, input_timeout_sec, 0);
if (res != 1) {
br... | false | false | false | false | false | 0 |
on_dialog_remove_fave_clicked(GtkWidget *const tree_view) {
const unsigned int filter = get_current_filter();
gtk_widget_hide(relabel_hbox);
gtk_widget_hide(fave_delete_button);
if (filter) {
char filename[1024] = { 0 };
cimg_snprintf(filename,sizeof(filename),"%s%c%sgmic_faves",
get_c... | false | false | false | false | false | 0 |
RespawnFlag(Team team, bool captured)
{
if (team == ALLIANCE)
{
DEBUG_LOG("Respawn Alliance flag");
m_FlagState[BG_TEAM_ALLIANCE] = BG_WS_FLAG_STATE_ON_BASE;
SpawnEvent(WS_EVENT_FLAG_A, 0, true);
}
else
{
DEBUG_LOG("Respawn Horde flag");
m_FlagState[BG_TEAM_HO... | false | false | false | false | false | 0 |
object_export_object_died (gpointer user_data, GObject *dead)
{
ObjectExport *oe = user_data;
g_assert (dead == oe->object);
/* this prevents the weak unref from taking place, which would cause an
* assertion failure since the object has already gone... */
oe->object = NULL;
/* ... while this results in... | false | false | false | false | false | 0 |
ajSeqBamWrite(AjPSeqBamBgzf fp, const AjPSeqBam b)
{
const AjPSeqBamCore c;
int data_len;
unsigned char *data = NULL;
ajuint x[8];
ajuint block_len;
ajuint y;
int i;
c = &b->core;
data_len = b->data_len;
data = b->data;
block_len = data_len + BAM_CORE_SIZE;
... | false | false | false | false | false | 0 |
ColorClosest(int r, int g, int b, int tolerance)
{
int i;
long rd, gd, bd;
int ct = (-1);
long mindist = 0;
for (i=0; (i<(colorsTotal)); i++) {
long dist;
if (open[i]) {
continue;
}
rd = (red[i] - r);
gd = (green[i] - g);
bd = (blue[i] - b);
dist = rd * rd + gd * gd + bd * bd;
if ((i == 0) || (... | false | false | false | false | false | 0 |
isOptionError(const string &arg, const string &errorInfo)
{
if (optionErrors.str().length() == 0)
optionErrors << errorInfo << endl; // need main error message
optionErrors << arg << endl;
} | false | false | false | false | false | 0 |
set_segment_type(ikptr base, unsigned long int size, unsigned int type, ikpcb* pcb){
assert(base >= pcb->memory_base);
assert((base+size) <= pcb->memory_end);
assert(size == align_to_next_page(size));
unsigned int* p = pcb->segment_vector + page_index(base);
unsigned int* q = p + page_index(size);
while(p <... | false | false | false | false | false | 0 |
sc_load(char *filename, service_credentials ** creds, int *ncredentials)
{
FILE *gpg;
char *fmt = "gpg --decrypt '%s'";
char line[128], *cp;
int ch;
int ccr = 0, mcr = 8;
service_credentials *cr = getpw_xmalloc(sizeo... | true | true | false | false | true | 1 |
currentDateTime(const Spec &spec)
{
switch (spec.type())
{
case UTC:
return currentUtcDateTime();
case TimeZone:
if (spec.timeZone() != KSystemTimeZones::local())
break;
// fall through to LocalZone
case LocalZone:
return cu... | false | false | false | false | false | 0 |
C_i_not_pair_p_2(C_word x)
{
return C_mk_bool(C_immediatep(x) || C_block_header(x) != C_PAIR_TAG);
} | false | false | false | false | false | 0 |
alert_handler(char ch)
{
switch (ch) {
case '!': /* clear OL, set OB */
upsdebugx(4, "alert_handler: OB");
ups_status &= ~APC_STAT_OL;
ups_status |= APC_STAT_OB;
break;
case '$': /* clear OB, set OL */
upsdebugx(4, "alert_handler: OL");
ups_status &= ~APC_STAT_OB;
ups_status |= APC_STAT_OL;... | false | false | false | false | false | 0 |
L50()
{register object *base=vs_base;
register object *sup=base+VM50; VC50
vs_check;
{register object V177;
object V178;
V177=(base[0]);
V178=(base[1]);
vs_top=sup;
goto TTL;
TTL:;
{register object V179;
register object V180;
V179= Cnil;
V180= Cnil;
V179= (V178);
V180= Cnil;
goto T563;
T563:;
if(((V179)... | false | false | false | false | false | 0 |
subdir_new(struct fuse_args *args,
struct fuse_fs *next[])
{
struct fuse_fs *fs;
struct subdir *d;
d = calloc(1, sizeof(struct subdir));
if (d == NULL) {
fprintf(stderr, "fuse-subdir: memory allocation failed\n");
return NULL;
}
if (fuse_opt_parse(args, d, subdir_opts, subdir_opt_proc) == -1)
goto o... | false | false | false | false | false | 0 |
PyException_SetCause(PyObject *self, PyObject *cause) {
PyObject *old_cause = ((PyBaseExceptionObject *)self)->cause;
((PyBaseExceptionObject *)self)->cause = cause;
((PyBaseExceptionObject *)self)->suppress_context = 1;
Py_XDECREF(old_cause);
} | false | false | false | false | false | 0 |
gretl_is_xml_file (const char *fname)
{
gzFile fz;
char test[6];
int ret = 0;
fz = gretl_try_gzopen(fname, "rb");
if (fz != Z_NULL) {
if (gzread(fz, test, 5)) {
test[5] = '\0';
if (!strcmp(test, "<?xml")) ret = 1;
}
gzclose(fz);
}
return ret;
} | true | true | true | false | false | 1 |
root_filter (GdkXEvent *xevent,
GdkEvent *event2, gpointer user_data)
{
XEvent *event = (XEvent *)xevent;
Window target_win = None;
Window target_win_xmu = None;
win_struct *win= (win_struct*) user_data;
switch (event->type) {
case ButtonPress:
target_win= event->xbutton.subwindow;
... | false | false | false | false | false | 0 |
httpClientRequestDelayed(TimeEventHandlerPtr event)
{
HTTPRequestPtr request = *(HTTPRequestPtr*)event->data;
AtomPtr url;
url = internAtomN(request->object->key, request->object->key_size);
if(url == NULL) {
do_log(L_ERROR, "Couldn't allocate url.\n");
abortObject(request->object, 503, ... | false | false | false | false | false | 0 |
read_mounttable()
{
struct mntentchn *mc0 = &mounttable, *mc = mc0;
struct libmnt_table *tb = mnt_new_table();
struct libmnt_iter *itr = mnt_new_iter(MNT_ITER_FORWARD);
struct libmnt_fs *fs;
got_mtab = 1;
mc->nxt = mc->prev = NULL;
if (!tb || !itr)
goto err;
if (mnt_table_parse_mtab(tb, NULL))
goto err;
... | false | false | false | false | false | 0 |
py_GnumericFunc_object_dealloc (py_GnumericFunc_object *self)
{
g_return_if_fail (self != NULL);
gnm_func_unref (self->fn_def);
g_free (self->eval_pos);
PyObject_Del (self);
} | false | false | false | false | false | 0 |
x11Event(XEvent *ev)
{
switch(ev->type)
{
case ReparentNotify:
show();
}
return false;
} | false | false | false | false | false | 0 |
sockaddr_size(union fc_sockaddr *addr)
{
#ifdef IPV6_SUPPORT
if (addr->saddr.sa_family == AF_INET6) {
return sizeof(addr->saddr_in6);
} else
#endif /* IPV6_SUPPORT */
if (addr->saddr.sa_family == AF_INET) {
return sizeof(addr->saddr_in4);
} else {
fc_assert(FALSE);
log_error("Unsupported addres... | false | false | false | false | false | 0 |
mdc_truncate_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int32_t op_ret, int32_t op_errno,
struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata)
{
mdc_local_t *local = NULL;
local = frame->local;
if (op_ret != 0)
goto out;
... | false | false | false | false | false | 0 |
refresh_unit_city_dialogs(struct unit *punit)
{
struct city *pcity_sup, *pcity_pre;
struct city_dialog *pdialog;
pcity_sup = player_city_by_number(client_player(), punit->homecity);
pcity_pre=tile_city(unit_tile(punit));
if(pcity_sup && (pdialog=get_city_dialog(pcity_sup)))
city_dialog_update_supporte... | false | false | false | false | false | 0 |
dc_fflush(FILE *fp)
{
struct vsp_node *node;
if(fp == NULL ) {
return system_fflush(fp);
}
node = get_vsp_node(FILE_NO(fp));
if( node == NULL ) {
return system_fflush(fp);
}
m_unlock(&node->mux);
return 0;
} | false | false | false | false | false | 0 |
vxge_hw_rts_rth_data0_data1_get(u32 j, u64 *data0, u64 *data1,
u16 flag, u8 *itable)
{
switch (flag) {
case 1:
*data0 = VXGE_HW_RTS_ACCESS_STEER_DATA0_RTH_ITEM0_BUCKET_NUM(j)|
VXGE_HW_RTS_ACCESS_STEER_DATA0_RTH_ITEM0_ENTRY_EN |
VXGE_HW_RTS_ACCESS_STEER_DATA0_RTH_ITEM0_BUCKET_DATA(
itable[j]);
case 2:
... | false | false | false | false | false | 0 |
Evaluate(const std::vector<std::string> ¶meters,
cmGeneratorExpressionContext *,
const GeneratorExpressionContent *,
cmGeneratorExpressionDAGChecker *dagChecker) const
{
if(!dagChecker->GetTransitivePropertiesOnly())
{
return par... | false | false | false | false | false | 0 |
AddRequestForAnotherFile(CPartFile* file)
{
if ( m_A4AF_list.find( file ) == m_A4AF_list.end() ) {
// When we access a non-existing entry entry, it will be zeroed by default,
// so we have to set NeededParts. All in one go.
m_A4AF_list[file].NeededParts = true;
file->AddA4AFSource( this );
return true;
} e... | false | false | false | false | false | 0 |
find_signature(f, signature)
FILE *f;
ZCONST char *signature;
{
int i;
char sig[4];
/*
zoff_t here = zftello(f);
*/
for (i = 0; i < 4; i++)
sig[i] = signature[i];
/* for EBCDIC */
if (sig[0] == 'P')
sig[0] = 0x50;
if (sig[1] == 'K')
sig[1] = 0x4b;
while (!feof(f)) {
if (!find_... | false | false | false | false | false | 0 |
NoteLValue(JSContext *cx, JSParseNode *pn, JSTreeContext *tc, uintN dflag = PND_ASSIGNED)
{
if (pn->pn_used) {
JSDefinition *dn = pn->pn_lexdef;
/*
* Save the win of PND_INITIALIZED if we can prove 'var x;' and 'x = y'
* occur as direct kids of the same block with no forward refs ... | false | false | false | false | false | 0 |
skip_uninteresting(struct tree_desc *t, const char *base, int baselen, struct diff_options *opt, int *all_interesting)
{
while (t->size) {
int show = tree_entry_interesting(t, base, baselen, opt);
if (show == 2)
*all_interesting = 1;
if (!show) {
update_tree_entry(t);
continue;
}
/* Skip it all? */
... | false | false | false | false | false | 0 |
mxt_show_instance(char *buf, int count,
struct mxt_object *object, int instance,
const u8 *val)
{
int i;
if (mxt_obj_instances(object) > 1)
count += scnprintf(buf + count, PAGE_SIZE - count,
"Instance %u\n", instance);
for (i = 0; i < mxt_obj_size(object); i++)
count += scnprintf(buf + count, ... | false | false | false | false | false | 0 |
get_query_def(Query *query, StringInfo buf, List *parentnamespace,
TupleDesc resultDesc, int prettyFlags, int startIndent)
{
deparse_context context;
deparse_namespace dpns;
/*
* Before we begin to examine the query, acquire locks on referenced
* relations, and fix up deleted columns in JOIN RTEs. This ens... | false | false | false | false | false | 0 |
py_field_get_str(struct format_field *f, struct pevent_record *r)
{
if (!strncmp(f->type, "__data_loc ", 11)) {
unsigned long long val;
int offset;
if (pevent_read_number_field(f, r->data, &val)) {
PyErr_SetString(PyExc_TypeError,
"Field is not a valid number");
return NULL;
}
/*
* The actual... | false | false | false | false | false | 0 |
ReadRealVector(Real *vector,int first,int last,char *filename)
/* Reads a Real vector from an ascii-file with a given name. */
{
int i;
FILE *in;
Real num;
if ((in = fopen(filename,"r")) == NULL) {
printf("The opening of the real vector file '%s' wasn't succesfull !\n",filename);
return(1);
}
for(i... | false | false | false | false | false | 0 |
get_qkdata(const gnet_host_t *host)
{
struct qkdata *qk;
if G_UNLIKELY(NULL == db_qkdata)
return NULL;
qk = dbmw_read(db_qkdata, host, NULL);
if (NULL == qk) {
if (dbmw_has_ioerr(db_qkdata)) {
g_warning("DBMW \"%s\" I/O error, bad things could happen...",
dbmw_name(db_qkdata));
}
}
return qk;
} | false | false | false | false | false | 0 |
_sinks_find_sink_by_caps (ClutterGstAutoVideoSink * bin, GstCaps * caps)
{
GstElement *element = NULL;
GSList *walk = bin->sinks;
while (walk) {
SinkElement *se = (SinkElement *) walk->data;
if (se) {
GstCaps *intersect = NULL;
intersect = gst_caps_intersect (caps, se->caps);
if (!gst_... | 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.