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 |
|---|---|---|---|---|---|---|
deckFindDriverByName(char* name) {
int i;
deckdriversInit();
for (i=0; i<driversLen; i++) {
if (!strcmp(name, drivers[i]->name)) {
return drivers[i];
}
}
return NULL;
} | false | false | false | false | false | 0 |
seahorse_pgp_key_object_dispose (GObject *obj)
{
SeahorsePgpKey *self = SEAHORSE_PGP_KEY (obj);
GList *l;
/* Free all the attached UIDs */
for (l = self->pv->uids; l; l = g_list_next (l))
seahorse_object_set_parent (l->data, NULL);
seahorse_object_list_free (self->pv->uids);
self->pv->uids = NULL;
/* Free... | false | false | false | false | false | 0 |
setClearPassword(const QString &val)
{
if (val == d->m_ClearPassword)
return;
d->m_ClearPassword = val;
d->m_PasswordChanged = true;
// Sync cryptedPassword
if (Utils::cryptPassword(val) != cryptedPassword()) {
setCryptedPassword(Utils::cryptPassword(val));
}
} | false | false | false | false | false | 0 |
prepare_block_for_update (basic_block bb, bool insert_phi_p)
{
basic_block son;
gimple_stmt_iterator si;
edge e;
edge_iterator ei;
mark_block_for_update (bb);
/* Process PHI nodes marking interesting those that define or use
the symbols that we are interested in. */
for (si = gsi_start_phis (bb); ... | false | false | false | false | false | 0 |
file_read_stream_to_str_full(FILE *fp, gboolean recode)
{
GByteArray *array;
guchar buf[BUFSIZ];
gint n_read;
gchar *str;
cm_return_val_if_fail(fp != NULL, NULL);
array = g_byte_array_new();
while ((n_read = fread(buf, sizeof(gchar), sizeof(buf), fp)) > 0) {
if (n_read < sizeof(buf) && ferror(fp))
break;... | false | false | false | false | true | 1 |
Concat(char S1[], int Start, char S2[]) const {
// EFFECTS : Concatenates S1 with the values of S2 starting from index Start to 4 values after it
for (int i = 0; i < 4; i++)
S1[Start+i] = S2[i];
} | false | false | false | false | false | 0 |
RegReadInt(const char* appname, const char* valname, int def_value)
{
if (ConfigEntry* e = get_config()->Find(appname, valname))
{
if (e->type == ConfigEntry::Int)
return e->i;
if (e->type == ConfigEntry::Binary
&& (sscanf(e->value.c_str(), "%d", &e->i) == 1))
{
e->type = ConfigEntry::Int;
... | false | false | false | false | false | 0 |
move_by_pieces_1 (rtx (*genfun) (rtx, ...), enum machine_mode mode,
struct move_by_pieces_d *data)
{
unsigned int size = GET_MODE_SIZE (mode);
rtx to1 = NULL_RTX, from1;
while (data->len >= size)
{
if (data->reverse)
data->offset -= size;
if (data->to)
{
if (data->autinc_to)
to1 = ... | false | false | false | false | false | 0 |
hdf_fill_input_buffer(struct jpeg_decompress_struct *cinfo_ptr)
{
hdf_src_ptr src=(hdf_src_ptr)cinfo_ptr->src;
int32 num_read; /* number of bytes read */
if(src->old_jpeg_image==TRUE) /* reading old-style JPEG image */
{
if(src->old_header_read==TRUE) /* done with header just grab data n... | false | false | false | false | false | 0 |
delete_virtual_user(G_CONST_RETURN gchar *username)
{
FILE *fp;
long file_size = 0;
long i = 0, count = 0;
int match = 0;
char *line, *tmp, *part, *new_conf;
/* Locate the user and remove it */
if((fp=fopen(GP_PASSWD_BUF, "r"))==NULL)
{
printf("Error reading: %s\n", GP_PASSWD_BUF... | false | true | false | false | true | 1 |
c_stddev(DCELL * result, DCELL * values, int n, const void *closure)
{
DCELL var;
c_var(&var, values, n, closure);
if (G_is_d_null_value(&var))
G_set_d_null_value(result, 1);
else
*result = sqrt(var);
} | false | false | false | false | false | 0 |
eel_editable_label_select_region_index (EelEditableLabel *label,
gint anchor_index,
gint end_index)
{
GtkClipboard *clipboard;
g_assert (EEL_IS_EDITABLE_LABEL (label));
if (label->selection_anchor == anchor_index &&
label->selection_end == end_index)
return;
eel_editable_labe... | false | false | false | false | false | 0 |
TransferParameters( Shuttle & shuttle )
{
// Vaughan, 2013-06: Long lost to history, I don't see why m_dPercentChange was chosen to be shuttled.
// Only m_dSemitonesChange is used in Process().
shuttle.TransferDouble(wxT("Percentage"),m_dPercentChange,0.0);
m_dSemitonesChange = (12.0 * log((100.0 + m_dP... | false | false | false | false | false | 0 |
GetHeader() const{
Array<char> array_buf( m_length );
char* buf = array_buf.data;
gnSeqI readBytes = m_length;
m_source->Read(m_start, buf, readBytes);
string rval(buf, readBytes);
return rval;
}
} | false | false | false | false | false | 0 |
updateCheckerEnd(bool error)
{
Q_UNUSED(error)
delete statusBar();
} | false | false | false | false | false | 0 |
update_capslock_state (GtkDialog *dialog,
GdkEvent *event,
GtkWidget *label)
{
GdkModifierType mask = 0;
GdkWindow *window;
gchar *markup = NULL;
GdkDeviceManager *device_manager;
GdkDevice *device;
device_manager = gdk_display_get_device_manager (gtk_widget_get_disp... | false | false | false | false | false | 0 |
util_ldap_get_values(LDAP *ld, LDAPMessage *entry, const char *attrtype)
{
#if defined(USE_OPENLDAP)
struct berval **bvals = NULL;
char **vals = NULL;
int ii;
bvals = ldap_get_values_len(ld, entry, attrtype);
if (!bvals) {
return vals;
}
for (ii = 0; bvals[ii]; ++ii);
vals = (... | false | false | false | false | false | 0 |
LC_EgkCard_ReadInsuranceData(LC_CARD *card,
LC_HI_INSURANCE_DATA **pData) {
GWEN_BUFFER *dbuf;
LC_CLIENT_RESULT res;
dbuf=GWEN_Buffer_new(0, 256, 0, 1);
res=LC_EgkCard_ReadVd(card, dbuf);
if (res!=LC_Client_ResultOk) {
DBG_INFO(LC_LOGDOMAIN, "here (%d)", res);
GWEN_Buffer_free(dbuf);
r... | false | false | false | false | false | 0 |
cam_tl_connection_delete (CamTLConnection * connection)
{
CamReturn ret;
ret = cam_tl_connection_write_control_tpdu (connection, TAG_DELETE_T_C);
if (CAM_FAILED (ret))
return ret;
connection->state = CAM_TL_CONNECTION_STATE_IN_DELETION;
return CAM_RETURN_OK;
} | false | false | false | false | false | 0 |
remove_fd(SOCKET fd)
{
if(fd == INVALID_SOCKET)
{
ASSERT(0);
return;
}
if(global.fdmap[fd] == INVALID_SOCKET)
{
ASSERT(0);
return;
}
if(global.fdmap[fd] < global.poll_num - 1)
{
/* swap with the last client */
int i = global.poll[global.poll_num - 1].fd;
ASSERT(i != -1);
ASSERT(global.pol... | false | true | false | false | false | 1 |
Clear()
{
for (int i = memory.Len()-1; i>=0; i--)
delete memory(i);
} | false | false | false | false | false | 0 |
av_lfg_init(AVLFG *c, unsigned int seed){
uint8_t tmp[16]={0};
int i;
for(i=8; i<64; i+=4){
AV_WL32(tmp, seed); tmp[4]=i;
av_md5_sum(tmp, tmp, 16);
c->state[i ]= AV_RL32(tmp);
c->state[i+1]= AV_RL32(tmp+4);
c->state[i+2]= AV_RL32(tmp+8);
c->state[i+3]= AV_R... | false | false | false | false | false | 0 |
convert_nl_goto_reference (gimple_stmt_iterator *gsi, bool *handled_ops_p,
struct walk_stmt_info *wi)
{
struct nesting_info *const info = (struct nesting_info *) wi->info, *i;
tree label, new_label, target_context, x, field;
void **slot;
gimple call;
gimple stmt = gsi_stmt (*gsi);
if (gimple_code (st... | false | false | false | false | false | 0 |
initLayoutPrivate()
{
m_main = new QWidget( this );
setMainWidget( m_main );
connect( this, SIGNAL( user1Clicked() ), SLOT( newFolderButton() ) );
m_title = new KLineEdit( m_main );
m_title->setMinimumWidth(300);
m_titleLabel = new QLabel( i18nc("@label:textbox", "Name:" ), m_main );
m_titl... | false | false | false | false | false | 0 |
__cdsgroup_set_timeout(txn, timeout, flags)
DB_TXN *txn;
db_timeout_t timeout;
u_int32_t flags;
{
COMPQUIET(timeout, 0);
COMPQUIET(flags, 0);
return (__cdsgroup_notsup(txn->mgrp->env, "set_timeout"));
} | false | false | false | false | false | 0 |
openlogdir(char *logdir)
{
DIR *dp = NULL;
struct dirent *dirp = NULL;
int fdate, ffirst = 0, state = 0;
char fname[128];
char *current = NULL;
if ((dp = opendir(logdir)) == NULL) {
printf("Can't open %s dir\n", logdir);
exit(-1);
}
printf("Current %d-%d-%d\n", cur_year, cur_month, cur_day);
/* ... | false | false | false | false | true | 1 |
fore200e_monitor_getc(struct fore200e *fore200e)
{
struct cp_monitor __iomem * monitor = fore200e->cp_monitor;
unsigned long timeout = jiffies + msecs_to_jiffies(50);
int c;
while (time_before(jiffies, timeout)) {
c = (int) fore200e->bus->read(&monitor->soft_uart.recv);
if (c & ... | false | false | false | false | false | 0 |
c67x00_hcd_get_frame(struct usb_hcd *hcd)
{
struct c67x00_hcd *c67x00 = hcd_to_c67x00_hcd(hcd);
u16 temp_val;
dev_dbg(c67x00_hcd_dev(c67x00), "%s\n", __func__);
temp_val = c67x00_ll_husb_get_frame(c67x00->sie);
temp_val &= HOST_FRAME_MASK;
return temp_val ? (temp_val - 1) : HOST_FRAME_MASK;
} | false | false | false | false | false | 0 |
check_group(struct userlist *ul, char *name)
{
struct auth_groups *ag;
for (ag = ul->groups; ag; ag = ag->next)
if (strcmp(name, ag->name) == 0)
return 1;
return 0;
} | false | false | false | false | false | 0 |
processYUVImage(imageStruct &image)
{
int h,w,hlength;
long src,pixsize;
src = 0;
pixsize = image.xsize * image.ysize * image.csize;
if(m_savedImage.xsize!=image.xsize ||
m_savedImage.ysize!=image.ysize ||
m_savedImage.format!=image.format)m_reset=1;
m_savedImage.xsize=image.xsize;
m_savedIma... | false | false | false | false | false | 0 |
xg_build_to_stack (IStack *istack, TInsn *insn, BuildInstr *bi)
{
for (; bi != NULL; bi = bi->next)
{
TInsn *next_insn = istack_push_space (istack);
if (!xg_build_to_insn (next_insn, insn, bi))
return FALSE;
}
return TRUE;
} | false | false | false | false | false | 0 |
DoCallKeyed(HCallKeyed* instr) {
ASSERT(instr->key()->representation().IsTagged());
LOperand* key = UseFixed(instr->key(), rcx);
argument_count_ -= instr->argument_count();
LCallKeyed* result = new LCallKeyed(key);
return MarkAsCall(DefineFixed(result, rax), instr);
} | false | false | false | false | false | 0 |
fl_beep(int type) {
#ifdef WIN32
switch (type) {
case FL_BEEP_QUESTION :
case FL_BEEP_PASSWORD :
MessageBeep(MB_ICONQUESTION);
break;
case FL_BEEP_MESSAGE :
MessageBeep(MB_ICONASTERISK);
break;
case FL_BEEP_NOTIFICATION :
MessageBeep(MB_ICONASTERISK);
break;
cas... | false | false | false | false | false | 0 |
ast_cc_offer(struct ast_channel *caller_chan)
{
int core_id;
int res = -1;
struct ast_datastore *datastore;
struct dialed_cc_interfaces *cc_interfaces;
char cc_is_offerable;
ast_channel_lock(caller_chan);
if (!(datastore = ast_channel_datastore_find(caller_chan, &dialed_cc_interfaces_info, NULL))) {
ast_chann... | false | false | false | false | false | 0 |
make_fullaccess_paccess_du_lmad(Module_table *callee, Array_lmad *lmad_head, int entry, int hd_range)
{
Array_lmad *lmad;
for (lmad = lmad_head; lmad != NULL; lmad = lmad->next) {
if (lmad->entry == entry) {
if (check_contain_unknown_region(lmad)) {
free_all_array_region(lmad->region_head);
lmad-... | false | false | false | false | false | 0 |
__state_in_grace(struct net *net, bool open)
{
struct list_head *grace_list = net_generic(net, grace_net_id);
struct lock_manager *lm;
if (!open)
return !list_empty(grace_list);
list_for_each_entry(lm, grace_list, list) {
if (lm->block_opens)
return true;
}
return false;
} | false | false | false | false | false | 0 |
remove_char_from_intset(IntSet set, Var_table* var_head)
{
int min, max;
int i;
Var_table* vptr;
min = min_IntSet(set);
max = max_IntSet(set);
for (i = min; i <= max; i++) {
if (in_IntSet(set, i)) {
vptr = search_var_table(var_head, i);
if (vptr->type == TYPE_CHARACTER) {
remove1_... | false | false | false | false | false | 0 |
iscsit_dataout_post_crc_failed(
struct iscsi_cmd *cmd,
unsigned char *buf)
{
struct iscsi_conn *conn = cmd->conn;
struct iscsi_pdu *pdu;
struct iscsi_data *hdr = (struct iscsi_data *) buf;
u32 payload_length = ntoh24(hdr->dlength);
if (conn->sess->sess_ops->DataPDUInOrder)
goto recover;
/*
* The rest of th... | false | false | false | false | false | 0 |
smsdvb_module_init(void)
{
int rc;
INIT_LIST_HEAD(&g_smsdvb_clients);
kmutex_init(&g_smsdvb_clientslock);
smsdvb_debugfs_register();
rc = smscore_register_hotplug(smsdvb_hotplug);
pr_debug("\n");
return rc;
} | false | false | false | false | false | 0 |
kmod_elf_strip_section(struct kmod_elf *elf, const char *section)
{
uint64_t off, size;
const void *buf;
int idx = elf_find_section(elf, section);
uint64_t val;
if (idx < 0)
return idx;
buf = elf_get_section_header(elf, idx);
off = (const uint8_t *)buf - elf->memory;
if (elf->class & KMOD_ELF_32) {
off +... | false | false | false | false | false | 0 |
write_iso9660_data(struct archive_write *a, const void *buff, size_t s)
{
struct iso9660 *iso9660 = a->format_data;
size_t ws;
if (iso9660->temp_fd < 0) {
archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
"Couldn't create temporary file");
return (ARCHIVE_FATAL);
}
ws = s;
if (iso9660->need_multi_ext... | false | false | false | false | false | 0 |
zxid_sp_carml(zxid_conf* cf)
{
if (cf->log_level>0)
zxlog(cf, 0, 0, 0, 0, 0, 0, 0, "N", "W", "MYCARML", 0, 0);
/* *** Much work needed to study CARML spec and to convert need and want to comply */
return zx_strf(cf->ctx,
"<carml:ClientAttrReq"
" AppName=\"ZXID SP\""
" Description=\"ZXID SP Attribute Needs a... | false | false | false | false | false | 0 |
translate_bank (MonoRegState *rs, int bank, int hreg) {
return is_hreg_mirrored (rs, bank, hreg) ? get_mirrored_bank (bank) : bank;
} | false | false | false | false | false | 0 |
init_hmminfo(HTK_HMM_INFO *hmminfo, char *hmmfilename, char *namemapfile, Value *para)
{
FILE *fp;
boolean ok_p;
boolean binary;
ok_p = FALSE;
/* read hmmdef file */
jlog("Stat: init_phmm: Reading in HMM definition\n");
/* first, try ascii format */
if ((fp = fopen_readfile(hmmfilename)) == NULL) {
... | false | false | false | false | false | 0 |
Length()
{
std::vector<vtksys_stl::string>::size_type len = this->OriginalNames.size();
return ( len == this->Endings.size() ) ? len : 0;
} | false | false | false | false | false | 0 |
umtab(MENU *m)
{
if (m->cursor + 1 >= m->nitems)
m->cursor = 0;
else
++ m->cursor;
return 0;
} | false | false | false | false | false | 0 |
Create(const std::string& alg) {
#if SSL_USE_OPENSSL
MessageDigest* digest = new OpenSSLDigest(alg);
if (digest->Size() == 0) { // invalid algorithm
delete digest;
digest = NULL;
}
return digest;
#else
MessageDigest* digest = NULL;
if (alg == DIGEST_MD5) {
digest = new Md5Digest();
} else if ... | false | false | false | false | false | 0 |
doubleToHumanReadableString(double doubleNumber)
{
QString n = QString::number(doubleNumber, 'f', 5);
QStringList v = n.split('.');
int integer = v.at(0).toInt();
int decimal = v.at(1).toInt();
while ((decimal > 0) && (decimal % 10 == 0)) decimal = decimal / 10;
return doubleToHumanReadableStrin... | false | false | false | false | false | 0 |
gf_isom_text_set_scroll_delay(GF_TextSample *samp, u32 scroll_delay)
{
if (!samp) return GF_BAD_PARAM;
if (!samp->scroll_delay) {
samp->scroll_delay = (GF_TextScrollDelayBox*) gf_isom_box_new(GF_ISOM_BOX_TYPE_DLAY);
if (!samp->scroll_delay) return GF_OUT_OF_MEM;
}
samp->scroll_delay->scroll_delay = scroll_delay... | false | false | false | false | false | 0 |
__core_scsi3_free_registration(
struct se_device *dev,
struct t10_pr_registration *pr_reg,
struct list_head *preempt_and_abort_list,
int dec_holders)
__releases(&pr_tmpl->registration_lock)
__acquires(&pr_tmpl->registration_lock)
{
const struct target_core_fabric_ops *tfo =
pr_reg->pr_reg_nacl->se_tpg->se_tpg... | false | false | false | false | false | 0 |
GetCubeInfo(void)
{
CubeInfo
*cube_info;
/*
Initialize tree to describe color cube.
*/
cube_info=(CubeInfo *) AcquireMagickMemory(sizeof(*cube_info));
if (cube_info == (CubeInfo *) NULL)
return((CubeInfo *) NULL);
(void) ResetMagickMemory(cube_info,0,sizeof(*cube_info));
/*
Initialize roo... | false | false | false | false | false | 0 |
parseStatus(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur,
struct status_struct *status)
{
if(status == NULL){
return REG_FAILURE;
}
cur = cur->xmlChildrenNode;
while (cur != NULL) {
if( !xmlStrcmp(cur->name, (const xmlChar *) "Param") ){
if( !status->first_param ){
status->first_param... | false | false | false | false | false | 0 |
modem_connect(struct cpssp *cpssp, unsigned char arg)
{
switch (arg) {
case 0:
cpssp->NAME.connected = false;
modem_dialout_hangup(cpssp);
serial_modem_reset(cpssp);
return;
case 1:
modem_dialout_lift(cpssp);
return;
default:
serial_modem_reset(cpssp);
}
} | true | true | false | false | true | 1 |
pvr2_s_fmt_vid_cap(struct file *file, void *priv, struct v4l2_format *vf)
{
struct pvr2_v4l2_fh *fh = file->private_data;
struct pvr2_hdw *hdw = fh->channel.mc_head->hdw;
struct pvr2_ctrl *hcp, *vcp;
int ret = pvr2_try_fmt_vid_cap(file, fh, vf);
if (ret)
return ret;
hcp = pvr2_hdw_get_ctrl_by_id(hdw, PVR2_CID_... | false | false | false | false | false | 0 |
_kernel26_cpu_freq_setGovernor (Kernel26CpuFreq* self, const gchar* governor) {
FsoFrameworkLogger* _tmp0_ = NULL;
const gchar* _tmp1_ = NULL;
const gchar* _tmp2_ = NULL;
gchar* _tmp3_ = NULL;
gchar* _tmp4_ = NULL;
GList* _tmp5_ = NULL;
g_return_if_fail (self != NULL);
g_return_if_fail (governor != NULL);
_tmp... | false | false | false | false | false | 0 |
snd_pcm_ladspa_look_for_plugin(snd_pcm_ladspa_plugin_t * const plugin,
const char *path,
const char *label,
const long ladspa_id)
{
const char *c;
size_t l;
int err;
for (c = path; (l = strcspn(c, ": ")) > 0; ) {
char name[l + 1];
char *fullpath;
memcpy(name, c, l);
name[l] = 0;
err... | true | true | false | false | false | 1 |
frame_rect(int x, int y, int w, int h, const char *c, Fl_Color bc) {
uchar *g = fl_gray_ramp();
int b = strlen(c) / 4 + 1;
for (x += b, y += b, w -= 2 * b, h -= 2 * b; b > 1; b --)
{
// Draw lines around the perimeter of the button, 4 colors per
// circuit.
fl_color(shade_color(g[*c++], bc));
f... | false | false | false | false | false | 0 |
atmsw_free(void *data,void *arg)
{
atmsw_table_t *t = data;
atmsw_vp_conn_t *vp;
atmsw_vc_conn_t *vc;
int i;
/* Remove all VPs */
for(i=0;i<ATMSW_VP_HASH_SIZE;i++)
for(vp=t->vp_table[i];vp;vp=vp->next)
atmsw_release_vpc(vp);
/* Remove all VCs */
for(i=0;i<ATMSW_VC_HASH_SIZE;i++)... | false | false | false | false | false | 0 |
GEOSBufferParams_create_r(GEOSContextHandle_t extHandle)
{
if ( 0 == extHandle ) return NULL;
GEOSContextHandleInternal_t *handle = 0;
handle = reinterpret_cast<GEOSContextHandleInternal_t*>(extHandle);
if ( 0 == handle->initialized ) return NULL;
try
{
BufferParameters *p = new Buffer... | false | false | false | false | false | 0 |
OnText_SemitonesChange(wxCommandEvent & WXUNUSED(event))
{
if (m_bLoopDetect)
return;
if (m_pTextCtrl_SemitonesChange) {
wxString str = m_pTextCtrl_SemitonesChange->GetValue();
if (str.IsEmpty())
m_dSemitonesChange = 0.0;
else
{
double newValue = 0;
str.To... | false | false | false | false | false | 0 |
getAddressRanges(const DWARFUnit *U) const {
if (isNULL())
return DWARFAddressRangesVector();
// Single range specified by low/high PC.
uint64_t LowPC, HighPC;
if (getLowAndHighPC(U, LowPC, HighPC)) {
return DWARFAddressRangesVector(1, std::make_pair(LowPC, HighPC));
}
// Multiple ranges from .debug... | false | false | false | false | false | 0 |
apbps2_isr(int irq, void *dev_id)
{
struct apbps2_priv *priv = dev_id;
unsigned long status, data, rxflags;
irqreturn_t ret = IRQ_NONE;
while ((status = ioread32be(&priv->regs->status)) & APBPS2_STATUS_DR) {
data = ioread32be(&priv->regs->data);
rxflags = (status & APBPS2_STATUS_PE) ? SERIO_PARITY : 0;
rxfla... | false | false | false | false | false | 0 |
store_will_buy(struct store *store, const object_type *o_ptr)
{
/* Switch on the store */
switch (store->sidx)
{
/* General Store */
case STORE_GENERAL:
{
/* Accept lights (inc. oil), spikes and food */
if (o_ptr->tval == TV_LIGHT || o_ptr->tval == TV_FOOD ||
o_ptr->tval == TV_FLASK || o_ptr->tval =... | false | false | false | false | false | 0 |
emit_drag_end (ClutterDragAction *action,
ClutterActor *actor,
ClutterEvent *event)
{
ClutterDragActionPrivate *priv = action->priv;
/* ::drag-end may result in the destruction of the actor, which in turn
* will lead to the removal and finalization of the action, so we ne... | false | false | false | false | false | 0 |
traitementSCF (GtkComboBox *combobox, gpointer d)
{
GtkTreeIter iter;
gchar* data = NULL;
gchar* res = NULL;
gint i;
gboolean sm=FALSE;
/* gchar* s;*/
if (gtk_combo_box_get_active_iter (combobox, &iter))
{
GtkTreeModel* model = gtk_combo_box_get_model(combobox);
gtk_tree_model_get (model, &iter, 0, &data, -... | false | false | false | false | false | 0 |
get_card_slot_with_cardid(gint32 cardid) {
gint32 i;
for(i = 0 ; i < MAX_CARDS ; i++) {
if(game->card[i].cardid == cardid) {
return(i);
break;
}
}
return(-1);
} | false | false | false | false | false | 0 |
set_reg_attrs_from_value (rtx reg, rtx x)
{
int offset;
/* Hard registers can be reused for multiple purposes within the same
function, so setting REG_ATTRS, REG_POINTER and REG_POINTER_ALIGN
on them is wrong. */
if (HARD_REGISTER_P (reg))
return;
offset = byte_lowpart_offset (GET_MODE (reg), G... | false | false | false | false | false | 0 |
__ecereRegisterModule_ClipBoard(struct __ecereNameSpace__ecere__com__Instance * module)
{
struct __ecereNameSpace__ecere__com__Class * class;
class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "ecere::gui::ClipBoard", 0, sizeof(struct __ecereNameSpace__ecere__gui__ClipBoard), 0, 0, __ecereDestructor___ecer... | false | false | false | false | false | 0 |
ab3100_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
struct ab3100 *ab3100;
struct ab3100_platform_data *ab3100_plf_data =
dev_get_platdata(&client->dev);
int err;
int i;
ab3100 = devm_kzalloc(&client->dev, sizeof(struct ab3100), GFP_KERNEL);
if (!ab3100) {
dev_err(&client->dev, "c... | false | false | false | false | false | 0 |
date_compare (Timespec ta, Timespec tb, QofDateMatch options)
{
if (options == QOF_DATE_MATCH_DAY)
{
ta = timespecCanonicalDayTime (ta);
tb = timespecCanonicalDayTime (tb);
}
if (ta.tv_sec < tb.tv_sec)
return -1;
if (ta.tv_sec > tb.tv_sec)
return 1;
if (ta.tv_n... | false | false | false | false | false | 0 |
_mr_alloc_new(struct matchingRuleList **mrl)
{
if(!mrl) {
return(-1);
}
*mrl = NULL;
*mrl = (struct matchingRuleList *)
slapi_ch_calloc(1, sizeof(struct matchingRuleList));
(*mrl)->mr_entry = (Slapi_MatchingRuleEntry *)
slapi_ch_calloc(1, sizeof(Slapi_MatchingRuleEntry));... | false | false | false | false | false | 0 |
pgs_presentation_segment_set_object_count (PgsPresentationSegment * ps,
guint8 n_objects)
{
if (ps->objects == NULL) {
ps->objects =
g_array_sized_new (FALSE, TRUE, sizeof (PgsCompositionObject),
n_objects);
g_array_set_size (ps->objects, n_objects);
return;
}
/* Clear memory in a... | false | false | false | false | false | 0 |
get_aux_entry(char *key, char **auxinfo, int nr_auxinfo) {
int i;
for (i=0; i<nr_auxinfo; i++) {
if(strlen(auxinfo[i]) > strlen(key)
&&!strncmp(auxinfo[i], key, strlen(key))
&& auxinfo[i][strlen(key)] == '=') {
return strdup(auxinfo[i]+strlen(key)+1);
}
}
return NULL;
} | false | false | false | false | false | 0 |
gt_firstcodes_sample2full(const GtFirstcodestab *fct,
unsigned long idx)
{
gt_assert(idx <= fct->numofsamples);
if (idx < fct->numofsamples)
{
return idx << fct->sampleshift;
}
return fct->differentcodes - 1;
} | false | false | false | false | false | 0 |
parse_daemon1(const lnode *n, search_items *s)
{
char *ptr, *str, *term, saved, *mptr;
// Not all messages have a ')', use it if its there
mptr = strchr(n->message, ')');
if (mptr == NULL)
mptr = n->message;
// auid
str = strstr(mptr, "auid=");
if (str == NULL)
return 1;
ptr = str + 5;
term = strchr(ptr,... | false | false | false | false | false | 0 |
atusb_disconnect(struct usb_interface *interface)
{
struct atusb *atusb = usb_get_intfdata(interface);
dev_dbg(&atusb->usb_dev->dev, "atusb_disconnect\n");
atusb->shutdown = 1;
cancel_delayed_work_sync(&atusb->work);
usb_kill_anchored_urbs(&atusb->rx_urbs);
atusb_free_urbs(atusb);
usb_kill_urb(atusb->tx_urb);... | false | false | false | false | false | 0 |
Itk_DelOptionPart(optPart)
ArchOptionPart *optPart; /* option part data to be destroyed */
{
if (optPart->clientData && optPart->deleteProc) {
(*optPart->deleteProc)(optPart->clientData);
}
ckfree((char*)optPart);
} | false | false | false | false | false | 0 |
markPageObjects(Dict *pageDict, XRef *xRef, XRef *countRef, Guint numOffset)
{
pageDict->remove("Names");
pageDict->remove("OpenAction");
pageDict->remove("Outlines");
pageDict->remove("StructTreeRoot");
for (int n = 0; n < pageDict->getLength(); n++) {
const char *key = pageDict->getKey(n);
Object ... | false | false | false | false | false | 0 |
locate_delta_images (wfa_t *wfa)
/*
* Locate all WFA states that are part of a delta approximation.
* I.e., these states are assigned to ranges that have been predicted
* via MC or ND.
*
* Return value:
* TRUE at least one state is part of a delta approximation
* FALSE no delta approximations in this WFA
*
... | false | false | false | false | false | 0 |
crypto_random_hostname(int min_rand_len, int max_rand_len, const char *prefix,
const char *suffix)
{
char *result, *rand_bytes;
int randlen, rand_bytes_len;
size_t resultlen, prefixlen;
if (max_rand_len > MAX_DNS_LABEL_SIZE)
max_rand_len = MAX_DNS_LABEL_SIZE;
if (min_rand_len > max... | false | false | false | false | false | 0 |
ecore_evas_move(Ecore_Evas *ee, int x, int y)
{
if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
{
ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
"ecore_evas_move");
return;
}
if (ee->prop.fullscreen) return;
IFC(ee, fn_move) (ee, x, y);
IFE;
} | false | false | false | false | false | 0 |
CopyBlackCompositePixels(void *mutable_data, /* User provided mutable data */
const void *immutable_data, /* User provided immutable data */
const Image *source_image, /* Source image */
const PixelPacket *source_pi... | false | false | false | false | false | 0 |
gntalloc_mmap(struct file *filp, struct vm_area_struct *vma)
{
struct gntalloc_file_private_data *priv = filp->private_data;
struct gntalloc_vma_private_data *vm_priv;
struct gntalloc_gref *gref;
int count = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT;
int rv, i;
if (!(vma->vm_flags & VM_SHARED)) {
pr_err("%s:... | false | false | false | false | false | 0 |
board_run_next_end()
{
g_source_remove(next_board_callback_id);
next_board_callback_id = 0;
if (next_board &&
next_board->previous_board &&
next_board->previous_board->plugin->end_board)
next_board->previous_board->plugin->end_board();
/* reset the im context */
gc_im_reset();
/*run the b... | false | false | false | false | false | 0 |
AddMassMailTask(MailDraft* mailProto, const MailSender &sender, uint32 raceMask)
{
if (RACEMASK_ALL_PLAYABLE & ~raceMask) // have races not included in mask
{
std::ostringstream ss;
ss << "SELECT guid FROM characters WHERE (1 << (race - 1)) & " << raceMask << " AND deleteDate IS... | false | false | false | false | false | 0 |
jack_do_has_session_cb (jack_engine_t *engine, jack_request_t *req)
{
jack_client_internal_t *client;
int retval = -1;
client = jack_client_by_name (engine, req->x.name);
if (client == NULL)
goto out;
retval = client->control->session_cbset ? 1 : 0;
out:
return retval;
} | false | false | false | false | false | 0 |
roundf(float x)
{
float t;
uint32_t hx;
GET_FLOAT_WORD(hx, x);
if ((hx & 0x7fffffff) == 0x7f800000)
return (x + x);
if (!(hx & 0x80000000)) {
t = floorf(x);
if (t - x <= -0.5F)
t += 1;
return (t);
} else {
t = floorf(-x);
if (t + x <= -0.5F)
t += 1;
return (-t);
}
} | false | false | false | false | false | 0 |
score_donor_dinucleotide_revcomp (char dinucl1, char dinucl2) {
double score;
debug(printf("donor dinucleotide %c%c ",dinucl1,dinucl2));
switch (dinucl2) {
case 'T': case 't': score = 0.0040/BACKGROUND_A; break;
case 'G': case 'g': score = 0.0032/BACKGROUND_C; break;
case 'C': case 'c': score = 0.9896/BAC... | false | false | false | false | false | 0 |
isint_w(const wchar_t *start, const wchar_t *end, int *result)
{
int n = 0;
if (start >= end)
return (0);
while (start < end) {
if (*start < '0' || *start > '9')
return (0);
if (n > (INT_MAX / 10) ||
(n == INT_MAX / 10 && (*start - '0') > INT_MAX % 10)) {
n = INT_MAX;
} else {
n *= 10;
n +=... | false | false | false | false | false | 0 |
tspFreeLinkedList(tLinkedList *list)
{
if(list) {
if(list->next) {
tspFreeLinkedList(list->next);
free(list->next);
list->next = NULL;
}
if(list->Value) {
free(list->Value);
list->Value = NULL;
}
}
} | false | false | false | false | false | 0 |
camHoughCircleAccumulate(camHoughCircleInternal *hci, int xs, int ys, int accu)
{
// Draw two lines in the hough cube starting from (x,y) and following the gradient line
int rp;
int gx,gy,dx,dy;
int sh,sv,x,y,r,div;
unsigned char *ptr;
int val;
// Retrieve sobel information
... | false | false | false | false | false | 0 |
OnTimer(cb_unused wxTimerEvent& e)
{
switch(status)
{
case 0:
status = 1;
m_timer->Start(scroll_millis, false);
break;
case 1:
top -= 2;
Move(left, top);
if(top <= hMin)
{
status = 2;
m_timer->Start(m_delay, true);
}... | false | false | false | false | false | 0 |
generate_code()
{
char *counter = tsprintf("mu__counter_%d", new_int() );
char *while_expr = tsprintf("mu__while_expr_%d", new_int() );
// Uli: a "goto" to exit the while loop seemed to cause problems on some
// compilers when there were local variables
// set mu__while_expr<n> to the value of the expr... | false | false | false | false | false | 0 |
hitmsg(mtmp, mattk)
register struct monst *mtmp;
register struct attack *mattk;
{
int compat;
/* Note: if opposite gender, "seductively" */
/* If same gender, "engagingly" for nymph, normal msg for others */
if((compat = could_seduce(mtmp, &youmonst, mattk))
&& !mtmp->mcan && !mtmp->mspec_used) {
pline("%s %s... | false | false | false | false | false | 0 |
py_gcompris_animcanvas_swapanim(PyObject *self, PyObject *args)
{
py_GcomprisAnimCanvas *s = (py_GcomprisAnimCanvas*)self;
py_GcomprisAnimation *new_anim;
py_GcomprisAnimation *old_anim = (py_GcomprisAnimation*)s->anim;
GcomprisAnimCanvasItem *item = s->item;
if(!item) THROW_INACTIVE_ANIMATION;
if(!PyArg_... | false | false | false | false | false | 0 |
MayReduceRegPressure(SUnit *SU) const {
const SDNode *N = SU->getNode();
if (!N->isMachineOpcode() || !SU->NumSuccs)
return false;
unsigned NumDefs = TII->get(N->getMachineOpcode()).getNumDefs();
for (unsigned i = 0; i != NumDefs; ++i) {
MVT VT = N->getSimpleValueType(i);
if (!N->hasAnyUseOfValue(... | false | false | false | false | false | 0 |
keypad_open(struct inode *inode, struct file *file)
{
int ret;
ret = -EBUSY;
if (!atomic_dec_and_test(&keypad_available))
goto fail; /* open only once at a time */
ret = -EPERM;
if (file->f_mode & FMODE_WRITE) /* device is read-only */
goto fail;
keypad_buflen = 0; /* flush the buffer on opening */
return... | false | false | false | false | false | 0 |
GMT_ialbers_sph (double *lon, double *lat, double x, double y)
{
/* Convert Spherical Albers x/y to lon/lat */
double theta, A, dy;
theta = (project_info.a_n < 0.0) ? d_atan2 (-x, y - project_info.a_rho0) : d_atan2 (x, project_info.a_rho0 - y);
dy = project_info.a_rho0 - y;
A = (x * x + dy * dy) * project_info.a... | false | false | false | false | false | 0 |
vf50_ts_get_gpiod(struct device *dev, struct gpio_desc **gpio_d,
const char *con_id, enum gpiod_flags flags)
{
int error;
*gpio_d = devm_gpiod_get(dev, con_id, flags);
if (IS_ERR(*gpio_d)) {
error = PTR_ERR(*gpio_d);
dev_err(dev, "Could not get gpio_%s %d\n", con_id, error);
return error;
}
return ... | false | false | false | false | false | 0 |
getInteriorRing( int iRing ) const
{
if( iRing < 0 || iRing >= nRingCount-1 )
return NULL;
else
return papoRings[iRing+1];
} | 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.