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 |
|---|---|---|---|---|---|---|
NotifyPlugins(wxEventType type, const wxString& targetName, const wxString& oldTargetName)
{
CodeBlocksEvent event(type);
event.SetProject(this);
event.SetBuildTargetName(targetName);
event.SetOldBuildTargetName(oldTargetName);
Manager::Get()->ProcessEvent(event);
} | false | false | false | false | false | 0 |
on_permit_user_login (GObject *source,
GAsyncResult *result,
gpointer user_data)
{
UmAccountDialog *self = UM_ACCOUNT_DIALOG (user_data);
UmRealmCommon *common;
UmUserManager *manager;
GError *error = NULL;
gchar *login;
common... | false | false | false | false | false | 0 |
glyphsbyname_cmp(void const *a, void const *b) {
glyph ga = cmp_glyphsbyindex[*(unsigned short *)a];
glyph gb = cmp_glyphsbyindex[*(unsigned short *)b];
if (ga < gb) return -1;
if (ga > gb) return 1;
/* For de-duping, we'd prefer to have the first glyph stay first */
if (*(unsigned short *)a < *... | false | false | false | false | false | 0 |
ifile_read_db (char * data_file, ifile_db * idata)
{
int DATA;
long int folders;
long int words;
char *buf, *saved_buf;
struct stat st;
size_t bufsize;
ssize_t nread;
ssize_t rc;
ifile_verbosify(ifile_progress, "Reading %s from disk...\n", data_file);
DATA = open(data_file, O_RDONLY, 0);
if (DA... | false | false | false | false | false | 0 |
ga_clear_strings(gap)
garray_T *gap;
{
int i;
for (i = 0; i < gap->ga_len; ++i)
vim_free(((char_u **)(gap->ga_data))[i]);
ga_clear(gap);
} | false | false | false | false | false | 0 |
Fax3VSetField(TIFF* tif, ttag_t tag, va_list ap)
{
Fax3BaseState* sp = Fax3State(tif);
assert(sp != 0);
assert(sp->vsetparent != 0);
switch (tag) {
case TIFFTAG_FAXMODE:
sp->mode = va_arg(ap, int);
return (1); /* NB: pseudo ta... | false | false | false | false | false | 0 |
get_pnt_info(const skip_alloc_t *slot_p, pnt_info_t *info_p)
{
info_p->pi_fence_b = BIT_IS_SET(slot_p->sa_flags, ALLOC_FLAG_FENCE);
info_p->pi_blanked_b = BIT_IS_SET(slot_p->sa_flags, ALLOC_FLAG_BLANK);
info_p->pi_alloc_start = slot_p->sa_mem;
if (info_p->pi_fence_b) {
char * a_p;
a_p=align_to((ch... | true | true | false | false | false | 1 |
devkmsg_release(struct inode *inode, struct file *file)
{
struct devkmsg_user *user = file->private_data;
if (!user)
return 0;
mutex_destroy(&user->lock);
kfree(user);
return 0;
} | false | false | false | false | false | 0 |
hex_motion_cb(GtkWidget *w, GdkEventMotion *event, GtkHex *gh) {
GtkAllocation allocation;
GdkDeviceManager *device_manager;
GdkDevice *pointer;
gint x, y;
gtk_widget_get_allocation(w, &allocation);
device_manager = gdk_display_get_device_manager (gtk_widget_get_display (w));
pointer = gdk_device_manager_get_c... | false | false | false | false | false | 0 |
e1000_close ( struct net_device *netdev )
{
struct e1000_adapter *adapter = netdev_priv ( netdev );
struct e1000_hw *hw = &adapter->hw;
uint32_t rctl;
DBG ( "e1000_close\n" );
/* Disable and acknowledge interrupts */
e1000_irq_disable ( adapter );
E1000_READ_REG ( hw, E1000_ICR );
/* disable receives */
rct... | false | false | false | false | false | 0 |
gnutls_pkcs11_delete_url (const char *object_url, unsigned int flags)
{
int ret;
struct delete_data_st find_data;
memset (&find_data, 0, sizeof (find_data));
ret = pkcs11_url_to_info (object_url, &find_data.info);
if (ret < 0)
{
gnutls_assert ();
return ret;
}
ret =
_pkcs11_traver... | false | false | false | false | false | 0 |
___alloc_bootmem(unsigned long size, unsigned long align,
unsigned long goal, unsigned long limit)
{
void *mem = ___alloc_bootmem_nopanic(size, align, goal, limit);
if (mem)
return mem;
/*
* Whoops, we cannot satisfy the allocation request.
*/
printk(KERN_ALERT "bootmem alloc of %lu bytes failed!\n", si... | false | false | false | false | false | 0 |
load_plugin_info (PeasEngine *engine,
const gchar *filename,
const gchar *module_dir,
const gchar *data_dir)
{
PeasPluginInfo *info;
const gchar *module_name;
info = _peas_plugin_info_new (filename,
module_dir,
... | false | false | false | false | false | 0 |
Apply_Clients_Skin()
{
bool useSkins = Check_and_Init_Skin();
// Clear the client image list
m_imagelist.RemoveAll();
// Add the images to the image list
for (int i = 0; i < CLIENT_SKIN_SIZE; ++i) {
Add_Skin_Icon(wxT("Client_") + m_clientSkinNames[i],
clientImages(i), useSkins);
}
} | false | false | false | false | false | 0 |
bstr_newFromCStr(char *cstr)
{
bstr_t ret;
/* If cstr is NULL we return an empty string */
if (cstr == NULL) return _bstr_malloc(0);
/* Allocate the string, copy it and return the newly created bstr*/
ret = _bstr_malloc(strlen(cstr));
memcpy(ret, cstr, strlen(cstr)*sizeof(char));
return ret;
} | false | false | false | false | false | 0 |
log(const char *intro) const {
std::string introString;
if (!ArUtil::isStrEmpty(intro)) {
introString = intro;
introString += " ";
}
introString += "Cairn:";
ArLog::log(ArLog::Terse,
"%s%s",
introString.c_str(),
toString());
} | false | false | false | false | false | 0 |
scrub_filename(char* filename)
{
char* p;
#define STRANGE_CHARS "/:"
p = strpbrk(filename, STRANGE_CHARS);
while (p)
{
*p = '_';
p = strpbrk(filename, STRANGE_CHARS);
}
} | false | false | false | false | false | 0 |
mono_method_verify_with_current_settings (MonoMethod *method, gboolean skip_visibility, gboolean is_fulltrust)
{
return mono_method_verify (method,
(verifier_mode != MONO_VERIFIER_MODE_STRICT ? MONO_VERIFY_NON_STRICT: 0)
| (!is_fulltrust && !mono_verifier_is_method_full_trust (method) ? MONO_VERIFY_FAIL_FAST : ... | false | false | false | false | false | 0 |
_ecore_timer_del(Ecore_Timer *timer)
{
if (timer->frozen && !timer->references)
{
void *data = timer->data;
suspended = (Ecore_Timer *)eina_inlist_remove(EINA_INLIST_GET(suspended), EINA_INLIST_GET(timer));
if (timer->delete_me)
timers_delete_me--;
ecore_timer_mp_fre... | false | false | false | false | false | 0 |
sdhci_pci_remove(struct pci_dev *pdev)
{
int i;
struct sdhci_pci_chip *chip;
chip = pci_get_drvdata(pdev);
if (chip) {
if (chip->allow_runtime_pm)
sdhci_pci_runtime_pm_forbid(&pdev->dev);
for (i = 0; i < chip->num_slots; i++)
sdhci_pci_remove_slot(chip->slots[i]);
pci_set_drvdata(pdev, NULL);
kfre... | false | false | false | false | false | 0 |
_mv88e6xxx_phy_write(struct dsa_switch *ds, int addr, int regnum,
u16 val)
{
if (addr >= 0)
return _mv88e6xxx_reg_write(ds, addr, regnum, val);
return 0;
} | false | false | false | false | false | 0 |
zend_declare_class_constant_null(zend_class_entry *ce, const char *name, size_t name_length TSRMLS_DC) /* {{{ */
{
zval *constant;
if (ce->type & ZEND_INTERNAL_CLASS) {
ALLOC_PERMANENT_ZVAL(constant);
} else {
ALLOC_ZVAL(constant);
}
ZVAL_NULL(constant);
INIT_PZVAL(constant);
return zend_declare_class_const... | false | false | false | false | true | 1 |
cr_term_parse_expression_from_buf (const guchar * a_buf,
enum CREncoding a_encoding)
{
CRParser *parser = NULL;
CRTerm *result = NULL;
enum CRStatus status = CR_OK;
g_return_val_if_fail (a_buf, NULL);
parser = cr_parser_new_from_buf ((guchar*)... | false | false | false | false | false | 0 |
canRealignStack(const MachineFunction &MF) const {
const MachineRegisterInfo *MRI = &MF.getRegInfo();
const ARMFunctionInfo *AFI = MF.getInfo<ARMFunctionInfo>();
const ARMFrameLowering *TFI = getFrameLowering(MF);
// We can't realign the stack if:
// 1. Dynamic stack realignment is explicitly disabled,
// 2... | false | false | false | false | false | 0 |
copy(ExprManager* em, ExprIndex idx) const {
if (d_em != em) {
vector<Expr> children;
vector<Expr>::const_iterator
i = d_children.begin(), iend = d_children.end();
for (; i != iend; ++i)
children.push_back(rebuild(*i, em));
return new(em->getMM(getMMIndex())) ExprNode(em, d_kind, children,... | false | false | false | false | false | 0 |
sa_finish_dialog_event(zdialog *zd, cchar *event)
{
int zstat;
zstat = zd->zstat;
if (! zstat) return 0;
freeMouse(); // disconnect mouse
zdialog_free(safinzd); // kill dialog
if... | false | false | false | false | false | 0 |
st_end_input (SCM port, int offset)
{
scm_t_port *pt = SCM_PTAB_ENTRY (port);
if (pt->read_pos - pt->read_buf < offset)
scm_misc_error ("st_end_input", "negative position", SCM_EOL);
pt->write_pos = (unsigned char *) (pt->read_pos = pt->read_pos - offset);
pt->rw_active = SCM_PORT_NEITHER;
} | false | false | false | false | false | 0 |
wgt_enum_files(void *cbck, char *file_name, char *file_path)
{
WGTEnum *wgt = (WGTEnum *)cbck;
if (!strcmp(wgt->root_file, file_path)) return 0;
/*remove CVS stuff*/
if (strstr(file_path, ".#")) return 0;
gf_list_add(wgt->imports, gf_strdup(file_path) );
return 0;
} | false | false | false | false | false | 0 |
uart_flush_buffer(struct tty_struct *tty)
{
struct uart_state *state = tty->driver_data;
struct uart_port *port;
unsigned long flags;
/*
* This means you called this function _after_ the port was
* closed. No cookie for you.
*/
if (!state) {
WARN_ON(1);
return;
}
port = state->uart_port;
pr_debug("... | false | false | false | false | false | 0 |
killBuses(QVector<BusShared *> & buses) {
foreach (BusShared * bus, buses) {
delete bus;
}
buses.clear();
} | false | false | false | false | false | 0 |
jbig2_parse_segment (Jbig2Ctx *ctx, Jbig2Segment *segment,
const uint8_t *segment_data)
{
jbig2_error(ctx, JBIG2_SEVERITY_INFO, segment->number,
"Segment %d, flags=%x, type=%d, data_length=%d",
segment->number, segment->flags, segment->flags & 63,
segment->data_length);
switch (segment->fla... | false | false | false | false | false | 0 |
CDB___db_parse(dbenv, s)
DB_ENV *dbenv;
char *s;
{
int ret;
char *local_s, *name, *value, **p, *tp;
/*
* We need to strdup the argument in case the caller passed us
* static data.
*/
if ((ret = CDB___os_strdup(s, &local_s)) != 0)
return (ret);
/*
* Name/value pairs are parsed as two white-space separ... | false | false | false | false | false | 0 |
ET_Remove_File_From_File_List (ET_File *ETFile)
{
GList *ETFileList = NULL; // Item containing the ETFile to delete... (in ETCore->ETFileList)
GList *ETFileDisplayedList = NULL; // Item containing the ETFile to delete... (in ETCore->ETFileDisplayedList)
// Remove infos of the file
ETCore->ETFi... | false | false | false | false | false | 0 |
is_utf8(const char *lang)
{
if(lang == NULL) return 0;
/* Now, if the variable mentions UTF-8 anywhere, in some variation, the locale is UTF-8. */
if( strstr(lang, "UTF-8") || strstr(lang, "utf-8")
|| strstr(lang, "UTF8") || strstr(lang, "utf8") )
return 1;
else
return 0;
} | false | false | false | false | false | 0 |
bClear( void )
{
bool bRtn = TRUE;
// Clear all previously selected test points
m_oLbxNodes.Clear( );
m_oLbxCpnts.Clear( );
// Clear simulation object attributes
m_oSimnGcp.bClear( );
m_oSimnNgs.bClear( );
// Clear the simulation object and the analysis panels
if( m_poNbkSimEng != NULL )
if( !... | false | false | false | false | false | 0 |
AddOneMsg( char *szMsg, int used_len, int tot_len, const char *szAddMsg, const char *szDelim )
{
const char ellip[] = "...";
int len = strlen( szAddMsg );
int len_delim = (used_len && szDelim)? strlen(szDelim) : 0;
int len_to_copy;
if ( len + len_delim + used_len < tot_len ) {
if ( len_delim... | false | true | false | false | false | 1 |
_pulse_update(Pulse *d __UNUSED__, int type __UNUSED__, Pulse_Sink *ev __UNUSED__)
{
Pulse_Tag_Id id;
id = pulse_server_info_get(conn);
if (id)
pulse_cb_set(conn, id, (Pulse_Cb)_pulse_info_get);
if (update_timer) ecore_timer_reset(update_timer);
else update_timer = ecore_timer_add(0.2, _pulse_updat... | false | false | false | false | false | 0 |
ffd2f(double dval, /* I - value to be converted to a string */
int decim, /* I - number of decimal places to display */
char *cval, /* O - character string representation of the value */
int *status) /* IO - error status */
/*
convert double value to a null-terminated F format str... | false | false | false | false | false | 0 |
cquad(circle *c1, circle *c2, circle *c3, circle *c4)
{
int ea, eb, ec, ed;
int pa, pb, pc, pd;
int qa, qb, qc, qd;
int lopa, lopb, lopc, lopd;
int hipa, hipb, hipc, hipd;
int loqa, loqb, loqc, loqd;
int hiqa, hiqb, hiqc, hiqd;
ea = (int) c1->e;
eb = (int) c2->e;
ec = (int) c3->e;
ed = (int) c4->e;
if (ea ... | false | false | false | false | false | 0 |
execCommand() {
// Some variables...
Glib::TimeVal tBefore;
Glib::TimeVal tAfter;
char **list;
int pid;
list = (char **)malloc (sizeof(char *) * (arglist.size() +1));
for (int i = 0;i < arglist.size();i++)
list[i] = (char *)arglist[i].c_str();
list[arglist.size()] = NULL;
for (int i=0; i<numberO... | false | false | false | false | false | 0 |
mwifiex_11n_delete_tx_ba_stream_tbl_entry(struct mwifiex_private *priv,
struct mwifiex_tx_ba_stream_tbl *tx_ba_tsr_tbl)
{
if (!tx_ba_tsr_tbl &&
mwifiex_is_tx_ba_stream_ptr_valid(priv, tx_ba_tsr_tbl))
return;
mwifiex_dbg(priv->adapter, INFO,
"info: tx_ba_tsr_tbl %p\n", tx_ba_tsr_tbl);
list_del(&tx_... | false | false | false | false | false | 0 |
reverseChars(char* str, int slen) {
if (slen==0) slen=strlen(str);
int l=0;
int r=slen-1;
char c;
while (l<r) {
c=str[l];str[l]=str[r];
str[r]=c;
l++;r--;
}
return str;
} | false | false | false | false | false | 0 |
need_reloc_mappable(struct i915_vma *vma)
{
struct drm_i915_gem_exec_object2 *entry = vma->exec_entry;
if (entry->relocation_count == 0)
return false;
if (!i915_is_ggtt(vma->vm))
return false;
/* See also use_cpu_reloc() */
if (HAS_LLC(vma->obj->base.dev))
return false;
if (vma->obj->base.write_domain =... | false | false | false | false | false | 0 |
gnc_main_window_cmd_file_revert (GtkAction *action, GncMainWindowActionData *data)
{
g_return_if_fail (data != NULL);
if (!gnc_main_window_all_finish_pending())
return;
gnc_window_set_progressbar_window (GNC_WINDOW(data->window));
{
gchar *filename = gnc_history_get_last();
//... | false | false | false | false | false | 0 |
acl_init( void )
{
int i, rc;
for ( i = 0; acl_init_func[ i ] != NULL; i++ ) {
rc = (*(acl_init_func[ i ]))();
if ( rc != 0 ) {
return rc;
}
}
return 0;
} | false | false | false | false | true | 1 |
alignQuality(char slave, char master)
{
awtc_assert(slave);
awtc_assert(master);
char result = '#';
if (slave==master) result = '-'; // equal
else if (slave==GAP_CHAR) result = '+'; // inserted gap
else if (master==GAP_CHAR) result = '+'; // no gap in master... | false | false | false | false | false | 0 |
stripe_fsetxattr_everyone_cbk (call_frame_t *frame, void *cookie,
xlator_t *this, int32_t op_ret, int32_t op_errno,
dict_t *xdata)
{
int call_count = 0;
stripe_local_t *local = NULL;
local = frame->local;
LO... | false | false | false | false | false | 0 |
ReadDateField(int nWidth, int *nYear, int *nMonth, int *nDay)
{
// If current record has been deleted, then return an acceptable
// default value.
if (m_bCurRecordDeletedFlag)
return -1;
if (m_poRecordBlock == NULL)
{
CPLError(CE_Failure, CPLE_AssertionFailed,
"Can... | false | false | false | false | false | 0 |
safe_to_load (void)
{
struct mem_range *mem_range = state.mem_range;
while (mem_range)
{
if (cpunum_read_byte (mem_range->cpu, mem_range->addr) !=
mem_range->start_value)
{
return 0;
}
if (cpunum_read_byte (mem_range->cpu, mem_range->addr + mem_range->num_bytes - 1) !=
mem_range->end_valu... | false | false | false | false | false | 0 |
updateData(JT_XRegister* jt)
{
if (d->xdata) {
QDomElement iq = jt->xdataElement();
if (!iq.isNull()) {
XData form;
form.fromXml(iq);
d->xdata->setFields(form.fields());
}
}
} | false | false | false | false | false | 0 |
__lambda17_ (AlmPrivacyWidget* self) {
gboolean recording = FALSE;
AlmBlacklist* _tmp0_ = NULL;
gboolean _tmp1_ = FALSE;
GtkSwitch* _tmp2_ = NULL;
gboolean _tmp3_ = FALSE;
gboolean _tmp4_ = FALSE;
gboolean _tmp5_ = FALSE;
_tmp0_ = self->priv->blacklist;
_tmp1_ = alm_blacklist_get_incognito (_tmp0_);
recording... | false | false | false | false | false | 0 |
abraca_cover_art_dialog_set_image (AbracaCoverArtDialog* self, GdkPixbuf* value) {
GdkPixbuf* _tmp0_;
GdkPixbuf* _tmp1_ = NULL;
GdkPixbuf* scaled;
GtkImage* _tmp2_;
g_return_if_fail (self != NULL);
_tmp0_ = value;
_tmp1_ = gdk_pixbuf_scale_simple (_tmp0_, 120, 120, GDK_INTERP_BILINEAR);
scaled = _tmp1_;
_tmp2_... | false | false | false | false | false | 0 |
dc1394_get_color_coding_data_depth(dc1394color_coding_t color_coding, uint32_t * bits)
{
switch(color_coding) {
case DC1394_COLOR_CODING_MONO8:
case DC1394_COLOR_CODING_YUV411:
case DC1394_COLOR_CODING_YUV422:
case DC1394_COLOR_CODING_YUV444:
case DC1394_COLOR_CODING_RGB8:
case DC1394_COLOR_... | false | false | false | false | false | 0 |
xmlSecTmplKeyInfoAddEncryptedKey(xmlNodePtr keyInfoNode, xmlSecTransformId encMethodId,
const xmlChar* id, const xmlChar* type, const xmlChar* recipient) {
xmlNodePtr encKeyNode;
xmlSecAssert2(keyInfoNode != NULL, NULL);
/* we allow multiple encrypted key elements */
encKeyNod... | false | false | false | false | false | 0 |
gt_countingsort_unit_test(GtError *err)
{
unsigned int numbers[] = { 1, 2, 1, 2, 0 }, numbers_out[5],
sorted_numbers[] = { 0, 1, 1, 2, 2 };
int had_err = 0;
gt_error_check(err);
gt_countingsort(numbers_out, numbers, sizeof (unsigned int), 5,
gt_countingsort_get_max(number... | false | false | false | false | false | 0 |
replaceVariable(char **sql, char *param, int len, char *value)
{
int valueln = strlen(value);
if (valueln > len)
{
size_t offset = param - *sql;
*sql = pg_realloc(*sql, strlen(*sql) - len + valueln + 1);
param = *sql + offset;
}
if (valueln != len)
memmove(param + valueln, param + len, strlen(param +... | false | false | false | false | false | 0 |
cssstat(const char *filename) {
struct _hash_drv_map map;
hash_drv_header_t header;
hash_drv_spam_record_t rec;
unsigned long filepos = sizeof(struct _hash_drv_header);
unsigned long nfree = 0, nused = 0;
unsigned long efree, eused;
unsigned long extents = 0;
unsigned long i;
unsigned long max_seek ... | false | false | false | false | false | 0 |
node_copy (n)
Node *n;
{
Node *n2;
int i;
n2 = node_alloc (n->type);
n2->linenum = n->linenum;
n2->filename = n->filename;
switch (n->type)
{
case nVOID:
/* All done. */
break;
case nSTRING:
n2->u.str.len = n->u.str.len;
/* +1 to avoid zero allocation. */
n2... | false | false | false | false | false | 0 |
pfunc (void) {
int fi, di, si, ifi, ifn, ldi, i, li1, li2;
int owncbufi, ownflvi, ownllvi, flvn, ifnum;
owncbufi = Cgetindex ();
ownflvi = flvi, ownllvi = llvi;
flvi = llvi;
flvn = 0;
fi = Cnew (C_FUNCTION);
GTOKIFEQ (L_LP);
li1 = Cinteger (0);
Csetfp (fi, li1);
li2 = Cinte... | false | false | false | false | false | 0 |
ai_hunter_juiciness(struct player *pplayer, struct unit *punit,
struct unit *target, int *stackthreat,
int *stackcost)
{
*stackthreat = 0;
*stackcost = 0;
unit_list_iterate(unit_tile(target)->units, sucker) {
*stackthreat += ATTACK_POWER(sucker)... | false | false | false | false | false | 0 |
convertSeconds( unsigned int seconds )
{
unsigned int days = seconds / 86400;
unsigned int hours = (seconds - (days * 86400)) / 3600;
unsigned int mins = (seconds - (days * 86400) - (hours * 3600)) / 60;
seconds = (seconds - (days * 86400) - (hours * 3600) - (mins * 60));
const QTime time(hours,... | false | false | false | false | false | 0 |
flmGetTmpDir(
char * pszOutputTmpDir)
{
RCODE rc = FERR_OK;
f_mutexLock( gv_FlmSysData.hShareMutex);
// Return an error if the temp directory has not been set.
if( !gv_FlmSysData.bTempDirSet)
{
rc = RC_SET( FERR_IO_PATH_NOT_FOUND );
// Set the output to nulls on failure.
*pszOutputTmpDir = 0;
}
el... | false | false | false | false | false | 0 |
unicodedata_normalize(PyObject *self, PyObject *args)
{
char *form;
PyObject *input;
if(!PyArg_ParseTuple(args, "sO!:normalize",
&form, &PyUnicode_Type, &input))
return NULL;
if (PyUnicode_READY(input) == -1)
return NULL;
if (PyUnicode_GET_LENGTH(input) ==... | false | false | false | false | false | 0 |
getMeshElementId(int index)
{
if ( meshData == NULL || index < 0 || index >= meshData->nofMeshElements)
return NO_INDEX;
return meshData->meshElementIds[index];
} | false | false | false | false | false | 0 |
wasp_req_integer( wasp_value x ){
if( wasp_is_imm( x ) ){
return wasp_imm_fv( x );
}else if( wasp_is_number( x ) ){
return wasp_integer_fn( (wasp_number)wasp_obj_fv( x ) );
}else{
wasp_errf( wasp_es_vm, "sx", "expected integer", x );
}
} | false | false | false | false | false | 0 |
resize(int rw, int rh)
{
ht_view::resize(rw, rh);
if ((int)cursorx > size.w-1) {
xofs += (int)cursorx-(size.w-1);
cursorx = size.w-1;
}
if ((int)cursory > size.h-1) {
top_line += (int)cursory-(size.h-1);
cursory = size.h-1;
}
} | false | false | false | false | false | 0 |
releasesock (TrapContext *context, SB, int sd)
{
if ((unsigned int) (sd - 1) < (unsigned int) sb->dtablesize) {
sb->dtable[sd - 1] = -1;
callfdcallback (context, sb, sd - 1, FDCB_FREE);
}
} | false | false | false | false | false | 0 |
onScriptExecute(GtkButton *widget _U_, gpointer user_data)
{
gchar *file;
file = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(user_data));
g_return_if_fail(file);
g_idle_add_full(G_PRIORITY_DEFAULT_IDLE, loadScript, (gpointer)file, g_free);
} | false | false | false | false | false | 0 |
gtk_multiview_remove(GtkContainer * container, GtkWidget * child)
{
GtkMultiview *multiview;
GList *list;
g_return_if_fail(container != NULL);
g_return_if_fail(GTK_IS_MULTIVIEW(container));
g_return_if_fail(child != NULL);
multiview = GTK_MULTIVIEW(container);
list = g_list_find(multiview... | false | false | false | false | false | 0 |
_load(Request& r, MethodParams& params) {
VXdoc& vdoc=GET_SELF(r, VXdoc);
// filespec
const String* uri=¶ms.as_string(0, "URI must be string");
const char* uri_cstr;
if(uri->pos("://")==STRING_NOT_FOUND) // disk path
uri_cstr=r.absolute(*uri).taint_cstr(String::L_FILE_SPEC);
else // xxx://
uri_cstr=uri-... | false | false | false | false | false | 0 |
_ds_set_signature (DSPAM_CTX * CTX, struct _ds_spam_signature *SIG,
const char *signature)
{
struct _pgsql_drv_storage *s = (struct _pgsql_drv_storage *) CTX->storage;
size_t length;
unsigned char *mem;
char scratch[1024];
buffer *query;
PGresult *result;
struct passwd *p;
char *name;... | true | true | false | false | false | 1 |
ShowLines(const char *what, int num, char **l)
{
if (num < 1) return;
if (!l) return;
cout << what << endl;
for (int i=0; i<num; i++)
{
if (l[i]) cout << " " << l[i] << endl;
}
} | false | false | false | false | false | 0 |
ircncmp(const char *s1, const char *s2, int n)
{
const unsigned char *str1 = (const unsigned char *)s1;
const unsigned char *str2 = (const unsigned char *)s2;
int res;
s_assert(s1 != NULL);
s_assert(s2 != NULL);
while ((res = ToUpper(*str1) - ToUpper(*str2)) == 0)
{
str1++;
str2++;
n--;
if (n == 0 || (*... | false | false | false | false | false | 0 |
sm_client_xsmp_end_session (EggSMClient *client,
EggSMClientEndStyle style,
gboolean request_confirmation)
{
EggSMClientXSMP *xsmp = (EggSMClientXSMP *)client;
int save_type;
/* To end the session via XSMP, we have to send a
* SaveYourselfRequest. We aren't allowed to do tha... | false | false | false | false | false | 0 |
PS_finalize(ParaSparse *M)
{
if(M->length > M->Ne)
{
M->length = M->Ne;
M->i = (int *) realloc(M->i, M->length * sizeof(int));
M->j = (int *) realloc(M->j, M->length * sizeof(int));
M->Mij = (double *) realloc(M->Mij, M->length * sizeof(double));
}
M->finalized = 1;
} | false | false | false | false | false | 0 |
solo_p2m_exit(struct solo_dev *solo_dev)
{
int i;
for (i = 0; i < SOLO_NR_P2M; i++)
solo_irq_off(solo_dev, SOLO_IRQ_P2M(i));
} | false | false | false | false | false | 0 |
_gnutls_cert_get_issuer_dn (gnutls_cert * cert, gnutls_datum_t * odn)
{
ASN1_TYPE dn;
int len, result;
int start, end;
if ((result = asn1_create_element
(_gnutls_get_pkix (), "PKIX1.Certificate", &dn)) != ASN1_SUCCESS)
{
gnutls_assert ();
return _gnutls_asn2err (result);
}
result ... | false | false | false | false | false | 0 |
gretl_rand_normal_full (double *a, int t1, int t2,
double mean, double sd)
{
int t;
if (na(mean) && na(sd)) {
mean = 0.0;
sd = 1.0;
} else if (na(mean) || na(sd) || sd <= 0.0) {
return E_INVARG;
}
gretl_rand_normal(a, t1, t2);
if (mean != 0.0 || sd != 1.0) {
for (t=t1; t<=t2; t++)... | false | false | false | false | false | 0 |
print_detector_list( tdetector *head, size_t depth ) {
int j,k;
if ( !head ) {
jprintf( depth, "EMPTY\n" );
return;
}
while ( head ) {
jprintf( depth, "Detector Pre-Filter:\n" );
print_tiirdef_list( head->detfilt, depth + 1 );
jprintf( depth, "Detector Parameter... | false | false | false | false | false | 0 |
mud_preferences_window_update_encoding_combo(MudPreferencesWindow *window, MudPrefs *preferences)
{
GtkTreeModel *encodings = gtk_combo_box_get_model(GTK_COMBO_BOX(window->priv->encoding_combo));
GtkTreeIter iter;
gboolean valid;
gint count = 0;
valid = gtk_tree_model_get_iter_first(encodings, &ite... | false | false | false | false | false | 0 |
createInstance(const QString& identifier, QGraphicsItem* parent, b2World* world) const
{
QList<Entry>::const_iterator it1 = m_entries.begin(), it2 = m_entries.end();
for (; it1 != it2; ++it1)
if (it1->first.identifier == identifier)
return (it1->second)(parent, world);
return 0;
} | false | false | false | false | false | 0 |
sg_load_map_tiles(struct loaddata *loading)
{
/* Check status and return if not OK (sg_success != TRUE). */
sg_check_ret();
/* With a FALSE parameter [xy]size are not changed by this call. */
map_init_topology(FALSE);
/* Allocate map. */
map_allocate();
/* get the terrain type */
LOAD_MAP_CHAR(ch, pt... | false | false | false | false | false | 0 |
connman_provider_set_state(struct connman_provider *provider,
enum connman_provider_state state)
{
if (provider == NULL || provider->vpn_service == NULL)
return -EINVAL;
switch (state) {
case CONNMAN_PROVIDER_STATE_UNKNOWN:
return -EINVAL;
case CONNMAN_PROVIDER_STATE_IDLE:
return set_connected(provider,... | false | false | false | false | false | 0 |
__ecereMethod_FindInFilesDialog_OnKeyHit(struct __ecereNameSpace__ecere__com__Instance * this, unsigned int key, unsigned int ch)
{
struct FindInFilesDialog * __ecerePointer_FindInFilesDialog = (struct FindInFilesDialog *)(this ? (((char *)this) + __ecereClass_FindInFilesDialog->offset) : 0);
if(ch && !((unsigned int)... | false | false | false | true | false | 1 |
cgraph_materialize_all_clones (void)
{
struct cgraph_node *node;
bool stabilized = false;
if (cgraph_dump_file)
fprintf (cgraph_dump_file, "Materializing clones\n");
#ifdef ENABLE_CHECKING
verify_cgraph ();
#endif
/* We can also do topological order, but number of iterations should be
bounded by nu... | false | false | false | false | false | 0 |
RequestSettingPhysicalAddress(void)
{
#ifdef CEC_DEBUGGING
LIB_CEC->AddLog(CEC_LOG_DEBUG, "requesting physical address setting");
#endif
cec_datapacket response = RequestSetting(MSGCODE_GET_PHYSICAL_ADDRESS);
if (response.size == 2)
{
m_persistedConfiguration.iPhysicalAddress = ((uint16_t)response[0] << 8)... | false | false | false | false | false | 0 |
tnode( int tok )
#else
tnode( tok )
int tok;
#endif
{
Tree *p, *newblk;
static int n=0;
if ( FreeList == NULL )
{
/*fprintf(stderr, "tnode: %d more nodes\n", TreeBlockAllocSize);*/
if ( TreeResourceLimit > 0 )
{
if ( (n+TreeBlockAllocSize) >= TreeResourceLimit )
{
fprintf(stderr, ErrHdr, FileStr[C... | false | false | false | false | false | 0 |
__insert_vm_struct(struct mm_struct *mm, struct vm_area_struct *vma)
{
struct vm_area_struct *prev;
struct rb_node **rb_link, *rb_parent;
if (find_vma_links(mm, vma->vm_start, vma->vm_end,
&prev, &rb_link, &rb_parent))
BUG();
__vma_link(mm, vma, prev, rb_link, rb_parent);
mm->map_count++;
} | false | false | false | false | false | 0 |
helper_cairo_destroy_context (cairo_t *cr)
{
finalize_closure_t *closure = (finalize_closure_t *)
cairo_surface_get_user_data (cairo_get_target (cr),
&finalize_closure_key);
if (closure)
closure->callback (closure);
cairo_status_t status = cairo_status (cr);
if (status != CAIRO_STATUS_SUCCE... | false | false | false | false | false | 0 |
count_busy_processes(request_rec *r, fcgid_command *command)
{
int result = 0;
fcgid_procnode *previous_node, *current_node, *next_node;
fcgid_procnode *proc_table = proctable_get_table_array();
fcgid_procnode *busy_list_header = proctable_get_busy_list();
proctable_lock(r);
previous_node = bu... | false | false | false | false | false | 0 |
gf_dom_event_fire_ex(GF_Node *node, GF_DOM_Event *event, GF_List *use_stack)
{
GF_SceneGraph *sg;
GF_List *prev_use_stack;
Bool prev_bub;
GF_DOMEventTarget cur_target;
u32 cur_par_idx;
if (!node || !event) return 0;
GF_LOG(GF_LOG_DEBUG, GF_LOG_INTERACT, ("[DOM Events ] Graph %p Time %f - Firing event %s.%s\n... | false | false | false | false | false | 0 |
selectDumpableType(TypeInfo *tyinfo)
{
/* skip complex types, except for standalone composite types */
if (OidIsValid(tyinfo->typrelid) &&
tyinfo->typrelkind != RELKIND_COMPOSITE_TYPE)
{
TableInfo *tytable = findTableByOid(tyinfo->typrelid);
tyinfo->dobj.objType = DO_DUMMY_TYPE;
if (tytable != NULL)
tyi... | false | false | false | false | false | 0 |
tolua_bnd_cast (lua_State* L)
{
/* // old code
void* v = tolua_tousertype(L,1,NULL);
const char* s = tolua_tostring(L,2,NULL);
if (v && s)
tolua_pushusertype(L,v,s);
else
lua_pushnil(L);
return 1;
*/
void* v;
const char* s;
if (lua_islightuserdata(L, 1)) {
... | false | false | false | false | false | 0 |
main(int argc, // I - Number of command-line arguments
char *argv[]) // I - Command-line arguments
{
Fl_Double_Window *window;// Main window
Fl_Button *button;// Buttons
Fl_File_Icon *icon; // New file icon
// Make the file chooser...
Fl::scheme(NULL);
Fl_File_Icon::load_system_icons();
fc = n... | false | false | false | false | false | 0 |
ns_server_rekey(ns_server_t *server, char *args, isc_buffer_t *text) {
isc_result_t result;
dns_zone_t *zone = NULL;
dns_zonetype_t type;
isc_uint16_t keyopts;
isc_boolean_t fullsign = ISC_FALSE;
if (strncasecmp(args, NS_COMMAND_SIGN, strlen(NS_COMMAND_SIGN)) == 0)
fullsign = ISC_TRUE;
result = zone_from_... | false | false | false | false | false | 0 |
__ecereMethod___ecereNameSpace__ecere__sys__File_GetDouble(struct __ecereNameSpace__ecere__com__Instance * this)
{
struct __ecereNameSpace__ecere__sys__File * __ecerePointer___ecereNameSpace__ecere__sys__File = (struct __ecereNameSpace__ecere__sys__File *)(this ? (((char *)this) + __ecereClass___ecereNameSpace__ecere__... | true | true | false | false | false | 1 |
rc_run_compiler(struct radeon_compiler *c, struct radeon_compiler_pass *list)
{
struct rc_program_stats s;
rc_get_stats(c, &s);
c->initial_num_insts = s.num_insts;
if (c->Debug & RC_DBG_LOG) {
fprintf(stderr, "%s: before compilation\n", shader_name[c->type]);
rc_print_program(&c->Program);
}
rc_run_compile... | false | false | false | false | false | 0 |
pq_setkeepalivescount(int count, Port *port)
{
if (port == NULL || IS_AF_UNIX(port->laddr.addr.ss_family))
return STATUS_OK;
#ifdef TCP_KEEPCNT
if (count == port->keepalives_count)
return STATUS_OK;
if (port->default_keepalives_count <= 0)
{
if (pq_getkeepalivescount(port) < 0)
{
if (count == 0)
re... | false | false | false | false | false | 0 |
cardToChar (int rank)
{
char *ret = (char *) malloc(sizeof(char)*2);
if ((rank>0)&&(rank < 10)) sprintf(ret, "%d", rank);
else if (rank == 10) return 'T';
else if (rank == 11) return 'J';
else if (rank == 12) return 'Q';
else if (rank == 13) return 'K';
else if (rank == 14) return 'A';
return ret[0];
} | false | true | false | false | true | 1 |
setMaxPasswordLength(int newLength)
{
if (newLength >= PassLen) newLength = PassLen - 1; // belt and braces
if (newLength < 0) newLength = 0;
int* t = ourMaxLength(this);
*t = newLength;
while (m_Length > newLength) {
m_Password[m_Length] = '\000';
--m_Length;
}
showPass();
... | 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.