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 |
|---|---|---|---|---|---|---|
write_file(const char *name, uint8_t *buf, uint32_t len,
const struct fw_header *hdr, uint32_t flags)
{
FILE *f;
char nbuf[4096];
const char *dir;
int r;
if (flags & FW_FLAG_V4)
dir = V4_FW_DIRNAME;
else
dir = V3_FW_DIRNAME;
r = snprintf(nbuf, sizeof(nbuf),
"%s/%s", cmdargs.target_dir, dir)... | false | false | false | false | true | 1 |
had_download_failure(int& failnum) {
unsigned int i;
for (i=0; i<app_files.size();i++) {
if (app_files[i].file_info->had_failure(failnum)) {
return true;
}
}
return false;
} | false | false | false | false | false | 0 |
get_sky(struct ccd_frame *fr, double x, double y, struct ap_params *p,
double *err, struct stats *stats, struct psf **apert,
double *allpixels)
{
struct psf *psf;
int ret;
double so, th;
double s = 0.0, e = BIG_ERR;
double ap;
g_return_val_if_fail(stats != NULL, 0.0);
psf = psf_new((int) (2 + ... | false | false | false | false | false | 0 |
CheckLogs(time_t unixtime)
{
char tmplog[MAXLINE + 1];
char LogFileName[MAXLINE + 1];
char olddate[MAXLINE + 1];
char *currdate;
struct tm *log_tm;
time_t oldts;
DIR *dp;
struct dirent *dirp;
int lmatches, len, ret;
/* infinite logging means we won't rotate logs at all because of user
* safety: think of g... | false | false | false | false | false | 0 |
roundAndPackFloatx80(int roundingPrecision,
int zSign, Bit32s zExp, Bit64u zSig0, Bit64u zSig1, float_status_t &status)
{
float_status_t round_status = status;
floatx80 result = SoftFloatRoundAndPackFloatx80(roundingPrecision, zSign, zExp, zSig0, zSig1, status);
// bias unmasked undeflow
if (st... | false | false | false | false | false | 0 |
plugin_exit_dbus(void)
{
int i;
//remove all known signals
for (i = registered_sig_count - 1; i >= 0; i--) {
lcd_unregister_signal(lcd_registered_signals[i]);
}
if (sysconn != NULL) {
dbus_connection_unref(sysconn);
}
if (sessconn != NULL) {
dbus_connection_unref(sessconn);
}
//re... | false | false | false | false | false | 0 |
skl_ipc_set_large_config(struct sst_generic_ipc *ipc,
struct skl_ipc_large_config_msg *msg, u32 *param)
{
struct skl_ipc_header header = {0};
u64 *ipc_header = (u64 *)(&header);
int ret = 0;
size_t sz_remaining, tx_size, data_offset;
header.primary = IPC_MSG_TARGET(IPC_MOD_MSG);
header.primary |= IPC_MSG_DIR(I... | false | false | false | false | false | 0 |
tw68_risc_buffer(struct pci_dev *pci,
struct tw68_buf *buf,
struct scatterlist *sglist,
unsigned int top_offset,
unsigned int bottom_offset,
unsigned int bpl,
unsigned int padding,
unsigned int lines)
{
u32 instructions, fields;
__le32 *rp;
fields = 0;
if (UNSET != top_offset)
fields++;
if ... | false | false | false | false | false | 0 |
coord(FXint i) const {
register FXint rr=width-border-padright;
register FXint ll=border+padleft;
register FXint mm=(ll+rr)/2;
register FXint pos;
FXASSERT(0<=i && i<=contents.length());
if(options&JUSTIFY_RIGHT){
if(options&TEXTFIELD_PASSWD){
pos=rr-font->getTextWidth("*",1)*(contents.count()-con... | false | false | false | false | false | 0 |
download_check_status(struct download *d, header_t *header, int code)
{
download_check(d);
if (code < 0) {
g_message("weird HTTP acknowledgment status line from %s",
download_host_info(d));
if (GNET_PROPERTY(download_debug)) {
dump_hex(stderr, "Status Line", getline_str(d->socket->getline),
MIN(getlin... | false | false | false | false | false | 0 |
set_dap_version(double d)
{
int major = floor(d);
int minor = (d-major)*10;
DBG(cerr << "Major: " << major << ", Minor: " << minor << endl);
ostringstream oss;
oss << major << "." << minor;
set_dap_version(oss.str());
} | false | false | false | false | false | 0 |
k_unload (unsigned long kexec_flags)
{
int result;
long native_arch;
/* set the arch */
native_arch = physical_arch();
if (native_arch < 0) {
return -1;
}
kexec_flags |= native_arch;
if (xen_present())
result = xen_kexec_unload(kexec_flags);
else
result = kexec_load(NULL, 0, NULL, kexec_flags);
if (re... | false | false | false | false | false | 0 |
major_finish_copy_or_mark (CopyOrMarkFromRootsMode mode)
{
if (mode == COPY_OR_MARK_FROM_ROOTS_START_CONCURRENT) {
/*
* Prepare the pin queue for the next collection. Since pinning runs on the worker
* threads we must wait for the jobs to finish before we can reset it.
*/
sgen_workers_wait_for_jobs_finis... | false | false | false | false | false | 0 |
has_queued(private_task_manager_t *this, task_type_t type)
{
enumerator_t *enumerator;
bool found = FALSE;
task_t *task;
enumerator = array_create_enumerator(this->queued_tasks);
while (enumerator->enumerate(enumerator, &task))
{
if (task->get_type(task) == type)
{
found = TRUE;
break;
}
}
enumerat... | false | false | false | false | false | 0 |
PyObject_SetAttrString(PyObject *v, const char *name, PyObject *w)
{
PyObject *s;
int res;
if (Py_TYPE(v)->tp_setattr != NULL)
return (*Py_TYPE(v)->tp_setattr)(v, (char*)name, w);
s = PyUnicode_InternFromString(name);
if (s == NULL)
return -1;
res = PyObject_SetAttr(v, s, w);
... | false | false | false | false | false | 0 |
gnc_date_edit_set_time (GNCDateEdit *gde, time64 the_time)
{
g_return_if_fail (gde != NULL);
g_return_if_fail (GNC_IS_DATE_EDIT (gde));
/* If the_time is invalid, use the last valid time
* seen (or as a last resort, the current date). */
gde->initial_time = the_time;
g_object_set (G_OBJECT (g... | false | false | false | false | false | 0 |
snprint_def_failback (char * buff, int len, void * data)
{
if (!conf->pgfailback)
return 0;
if (conf->pgfailback == DEFAULT_FAILBACK)
return 0;
switch(conf->pgfailback) {
case FAILBACK_UNDEF:
break;
case -FAILBACK_MANUAL:
return snprintf(buff, len, "manual");
case -FAILBACK_IMMEDIATE:
return snprintf(... | false | false | false | false | false | 0 |
e_table_thaw_state_change (ETable *table)
{
g_return_if_fail (table != NULL);
g_return_if_fail (table->state_change_freeze != 0);
table->state_change_freeze--;
if (table->state_change_freeze == 0 && table->state_changed) {
table->state_changed = FALSE;
e_table_state_change (table);
}
} | false | false | false | false | false | 0 |
max63xx_mmap_init(struct platform_device *p, struct max63xx_wdt *wdt)
{
struct resource *mem = platform_get_resource(p, IORESOURCE_MEM, 0);
wdt->base = devm_ioremap_resource(&p->dev, mem);
if (IS_ERR(wdt->base))
return PTR_ERR(wdt->base);
spin_lock_init(&wdt->lock);
wdt->ping = max63xx_mmap_ping;
wdt->set = ... | false | false | false | false | false | 0 |
onFocusUp(FXObject*,FXSelector,void*){
if(isEnabled()){
FXint index=getCurrentItem();
if(index<0) index=getNumItems()-1;
else if(0<index) index--;
if(0<=index && index<getNumItems()){
setCurrentItem(index,TRUE);
}
return 1;
}
return 0;
} | false | false | false | false | false | 0 |
static_equal (double *position_i, double *position_j)
{
double r[3], s[3];
double x, y, z;
gamgi_math_cell_range_positive (position_i, r);
gamgi_math_cell_range_positive (position_j, s);
x = fabs (r[0] - s[0]);
y = fabs (r[1] - s[1]);
z = fabs (r[2] - s[2]);
/*********************************************************... | false | false | false | false | false | 0 |
au_cpup_attr_nlink(struct inode *inode, int force)
{
struct inode *h_inode;
struct super_block *sb;
aufs_bindex_t bindex, bend;
sb = inode->i_sb;
bindex = au_ibstart(inode);
h_inode = au_h_iptr(inode, bindex);
if (!force
&& !S_ISDIR(h_inode->i_mode)
&& au_opt_test(au_mntflags(sb), PLINK)
&& au_pl... | false | false | false | false | false | 0 |
infix_gprint_loc(int frame, offset thisPC)
{
infix_location boo;
offset loc;
BOOL found_frame;
unsigned numlocals;
unsigned n;
if(!thisPC) {
loc = frame_get_PC(frame);
numlocals = stack_get_numlocals(frame);
} else {
loc = thisPC;
numlocals = 0;
}
found_frame = infix_decode_PC(&boo, ... | false | false | false | false | false | 0 |
jbd2_journal_flush(journal_t *journal)
{
int err = 0;
transaction_t *transaction = NULL;
write_lock(&journal->j_state_lock);
/* Force everything buffered to the log... */
if (journal->j_running_transaction) {
transaction = journal->j_running_transaction;
__jbd2_log_start_commit(journal, transaction->t_tid);
... | false | false | false | false | false | 0 |
do_scan()
{
if (!active() || !needs_scan() || (dir_bits() & SCANNING))
return false;
become_user();
bool stat_changed = do_stat();
if (stat_changed && !isdir()) // Seems like a bug to send Changed after
post_event(Event::Changed); // Deleted, but what would fixing it break?
bool scan_entries = ... | false | false | false | false | false | 0 |
GetDefaultRAT()
{
if( !SupportsInstr(INSTR_Band_GetDefaultRAT) )
return GDALPamRasterBand::GetDefaultRAT();
CLIENT_ENTER();
if( !WriteInstr(INSTR_Band_GetDefaultRAT) )
return NULL;
if( !GDALSkipUntilEndOfJunkMarker(p) )
return NULL;
GDALRasterAttributeTable* poNewRAT = NULL... | false | false | false | false | false | 0 |
jffs2_build_remove_unlinked_inode(struct jffs2_sb_info *c,
struct jffs2_inode_cache *ic,
struct jffs2_full_dirent **dead_fds)
{
struct jffs2_raw_node_ref *raw;
struct jffs2_full_dirent *fd;
dbg_fsbuild("removing ino #%u with nlink == zero.\n", ic->ino);
raw = ic->nodes;
while (raw != (void *)ic) {
st... | false | false | false | false | false | 0 |
tp_account_manager_dup (void)
{
TpDBusDaemon *dbus;
GError *error = NULL;
if (starter_account_manager_proxy != NULL)
return g_object_ref (starter_account_manager_proxy);
dbus = tp_dbus_daemon_dup (&error);
if (dbus == NULL)
{
WARNING ("Error getting default TpDBusDaemon: %s", error->message);
... | false | false | false | false | false | 0 |
zend_do_early_binding(TSRMLS_D) /* {{{ */
{
zend_op *opline = &CG(active_op_array)->opcodes[CG(active_op_array)->last-1];
HashTable *table;
while (opline->opcode == ZEND_TICKS && opline > CG(active_op_array)->opcodes) {
opline--;
}
switch (opline->opcode) {
case ZEND_DECLARE_FUNCTION:
if (do_bind_function... | false | false | false | false | false | 0 |
get_pindicator_str(char *buf, int max_len)
{
FileOfs o;
if (get_current_offset(&o)) {
FileOfs sel_start, sel_end;
pselect_get(&sel_start, &sel_end);
char ttemp[1024];
if (sel_end-sel_start > 0) {
ht_snprintf(ttemp, sizeof ttemp, "selection %qxh-%qxh (%qd byte%s) ", sel_start, sel_end-1, sel_end-sel_start, ... | false | false | false | false | false | 0 |
acpi_bus_power_manageable(acpi_handle handle)
{
struct acpi_device *device;
int result;
result = acpi_bus_get_device(handle, &device);
return result ? false : device->flags.power_manageable;
} | false | false | false | false | false | 0 |
wm8988_probe(struct snd_soc_codec *codec)
{
int ret = 0;
ret = wm8988_reset(codec);
if (ret < 0) {
dev_err(codec->dev, "Failed to issue reset\n");
return ret;
}
/* set the update bits (we always update left then right) */
snd_soc_update_bits(codec, WM8988_RADC, 0x0100, 0x0100);
snd_soc_update_bits(codec, W... | false | false | false | false | false | 0 |
radeon_init_dma(radeonContextPtr rmesa)
{
make_empty_list(&rmesa->dma.free);
make_empty_list(&rmesa->dma.wait);
make_empty_list(&rmesa->dma.reserved);
rmesa->dma.minimum_size = MAX_DMA_BUF_SZ;
} | false | false | false | false | false | 0 |
parse_args(int argc, char **argv) {
isc_boolean_t have_lookup = ISC_FALSE;
usesearch = ISC_TRUE;
for (argc--, argv++; argc > 0; argc--, argv++) {
debug("main parsing %s", argv[0]);
if (argv[0][0] == '-') {
if (strncasecmp(argv[0], "-ver", 4) == 0) {
version();
exit(0);
} else if (argv[0][1] != 0) ... | false | false | false | false | false | 0 |
parse_htpl_ldap_init(stack, untag)
int untag;
STR stack; {
TOKEN token;
static done = 0;
STR buff;
int code;
static int nesting = 0;
static int refcount = 0;
refcount++;
makepersist(stack);
if (numtokens < 1) RETURN(croak("%sLDAP INIT called with %d arguments, minimum neede... | false | false | false | false | false | 0 |
convert_from_fxsr(struct user_i387_ia32_struct *env, struct task_struct *tsk)
{
struct fxregs_state *fxsave = &tsk->thread.fpu.state.fxsave;
struct _fpreg *to = (struct _fpreg *) &env->st_space[0];
struct _fpxreg *from = (struct _fpxreg *) &fxsave->st_space[0];
int i;
env->cwd = fxsave->cwd | 0xffff0000u;
env->s... | false | false | false | false | false | 0 |
response2string(char *str, serv_response *res) {
if (sprintf(str, "%s %d %s %s %s%s",
res->ip,
res->port,
PROTYPE2STR(res->protocol),
S_PORTSTATE[res->state],
S_REPLY[res->status],
DELIM) < 1)
return FALSE;
return TRUE;
} | false | false | false | false | false | 0 |
bg_rcollapse(parsenode *p) {
if(p->type == NODE_REGION)
return bg_rcollapse((regionnode *)p);
list<term *> s;
s.push_back(bg_mknode(p));
return s;
} | false | false | false | false | false | 0 |
lan78xx_set_eee(struct net_device *net, struct ethtool_eee *edata)
{
struct lan78xx_net *dev = netdev_priv(net);
int ret;
u32 buf;
ret = usb_autopm_get_interface(dev->intf);
if (ret < 0)
return ret;
if (edata->eee_enabled) {
ret = lan78xx_read_reg(dev, MAC_CR, &buf);
buf |= MAC_CR_EEE_EN_;
ret = lan78xx... | false | false | false | false | false | 0 |
jit_end (MonoProfiler *prof, MonoMethod *method, MonoJitInfo *jinfo, int result)
{
/*
* We emit type load events when the first method of the type is JITted,
* since the class load profiler callbacks might be called with the
* loader lock held. They could also occur in the debugger thread.
* Same for assembly ... | false | false | false | false | false | 0 |
v_slash(const VEC *x1, const VEC *x2, VEC *out)
#endif
{
int i;
Real tmp;
if ( ! x1 || ! x2 )
error(E_NULL,"v_slash");
if ( x1->dim != x2->dim )
error(E_SIZES,"v_slash");
out = v_resize(out,x1->dim);
for ( i = 0; i < x1->dim; i++ )
{
tmp = x1->ve[i];
if ( tmp == 0.0 )
error(E_SIN... | false | false | false | true | false | 1 |
wlc_phy_txpwrctrl_config_nphy(struct brcms_phy *pi)
{
if (NREV_GE(pi->pubpi.phy_rev, 3)) {
pi->nphy_txpwrctrl = PHY_TPC_HW_ON;
pi->phy_5g_pwrgain = true;
return;
}
pi->nphy_txpwrctrl = PHY_TPC_HW_OFF;
pi->phy_5g_pwrgain = false;
if ((pi->sh->boardflags2 & BFL2_TXPWRCTRL_EN) &&
NREV_GE(pi->pubpi.phy_r... | false | false | false | false | false | 0 |
sge_add_manop(
sge_gdi_ctx_class_t *ctx,
lListElem *ep,
lList **alpp,
char *ruser,
char *rhost,
u_long32 target /* may be SGE_UM_LIST or SGE_UO_LIST */
) {
const char *manop_name;
const char *object_name;
lList **lpp = NULL;
lListElem *added;
int pos;
int key;
lDescr *descr = NULL;
ev_event eve... | false | false | false | false | false | 0 |
notify_remove_font(void *proc_data, void *event_data)
{ /* gs_font_finalize passes event_data == NULL, so check it here. */
if (event_data == NULL) {
gs_font_base *pbfont = proc_data;
gs_fapi_server *I = pbfont->FAPI;
if (pbfont->FAPI_font_data != 0) {
... | false | false | false | false | false | 0 |
pk_authority_changed_cb (GObject *object, gpointer unused)
{
GSList *iter;
for (iter = funcs; iter; iter = g_slist_next (iter)) {
PkChangedInfo *info = iter->data;
info->changed_callback (info->changed_data);
}
} | false | false | false | false | false | 0 |
warrior_process_packet(struct warrior *warrior)
{
struct input_dev *dev = warrior->dev;
unsigned char *data = warrior->data;
if (!warrior->idx) return;
switch ((data[0] >> 4) & 7) {
case 1: /* Button data */
input_report_key(dev, BTN_TRIGGER, data[3] & 1);
input_report_key(dev, BTN_THUMB, (da... | false | false | false | false | false | 0 |
EOLcode(u_long& w)
{
if ((w & 0x00f00f) == 0) {
EOLcheck(w, 0x00f0ff, 0x000080);
EOLcheck(w, 0x00f87f, 0x000040);
EOLcheck(w, 0x00fc3f, 0x000020);
EOLcheck(w, 0x00fe1f, 0x000010);
}
if ((w & 0x00ff00) == 0) {
EOLcheck(w, 0x00ff0f, 0x000008);
EOLcheck(w, 0x80ff07, 0x000004);
EOLcheck(w, 0xc0ff03, 0x00... | false | false | false | false | false | 0 |
sisfb_set_TVxposoffset(struct sis_video_info *ivideo, int val)
{
if(val > 32) val = 32;
if(val < -32) val = -32;
ivideo->tvxpos = val;
if(ivideo->sisfblocked) return;
if(!ivideo->modechanged) return;
if(ivideo->currentvbflags & CRT2_TV) {
if(ivideo->vbflags2 & VB2_CHRONTEL) {
int x = ivideo->tvx;
swi... | false | false | false | false | false | 0 |
remove_all_listeners(void)
{
alistener *l, *l_next;
for (l = listener_list.next; l != &listener_list; l = l_next) {
l_next = l->next;
// Never remove smart sockets.
if (l->connect_to[0] == '*')
continue;
listener_disconnect(l, l->transport);
}
} | false | false | false | false | false | 0 |
classifiers_program(RouterT *r, const Vector<ElementT *> &classifiers)
{
RouterT *nr = new RouterT;
ElementT *idle = nr->add_anon_element(ElementClassT::base_type("Idle"));
const Vector<String> &old_requirements = r->requirements();
for (int i = 0; i < old_requirements.size(); i++)
nr->add_require... | false | false | false | false | false | 0 |
read(hsStream* S, plResManager* mgr) {
plObjInterface::read(S, mgr);
fAmbient.read(S);
fDiffuse.read(S);
fSpecular.read(S);
fLightToLocal.read(S);
fLocalToLight.read(S);
fLightToWorld.read(S);
fWorldToLight.read(S);
//fLocalToWorld = fLightToWorld * fLocalToLight;
//fWorldToLoca... | false | false | false | false | false | 0 |
SS_finalize_plan(Plan *plan, List *rtable)
{
Bitmapset *valid_params,
*initExtParam,
*initSetParam;
Cost initplan_cost;
int paramid;
ListCell *l;
/*
* First, scan the param list to discover the sets of params that are
* available from outer query levels and my own query level. We do this
*... | false | false | false | false | false | 0 |
Insert_action(Widget w _is_unused, XEvent *event, String *params, Cardinal *num_params)
{
action_debug(Insert_action, event, params, num_params);
if (check_usage(Insert_action, *num_params, 0, 0) < 0)
return;
reset_idle_timer();
if (kybdlock) {
enq_ta(Insert_action, CN, CN);
return;
}
#if defined(X3270_ANSI)... | false | false | false | false | false | 0 |
format0_charset_proc(const cff_data_t *data, unsigned p, unsigned pe, unsigned int i)
{
int code;
unsigned u;
if ((code = card16(&u, data, p + 2*i, pe)) < 0)
return code;
return (int)u;
} | false | false | false | false | false | 0 |
ntty_ioctl(struct tty_struct *tty,
unsigned int cmd, unsigned long arg)
{
struct port *port = tty->driver_data;
int rval = -ENOIOCTLCMD;
DBG1("******** IOCTL, cmd: %d", cmd);
switch (cmd) {
case TIOCMIWAIT: {
struct async_icount cprev = port->tty_icount;
rval = wait_event_interruptible(port->tty_wai... | false | false | false | false | false | 0 |
Bg()
{
if(output && input != output)
output->Bg();
if(input)
input->Bg();
super::Bg();
} | false | false | false | false | false | 0 |
token_parse(PLPA_NAME(cpu_set_t) *cpu_set)
{
int ret;
PLPA_CPU_ZERO(cpu_set);
return_value = cpu_set;
ret = yyparse();
if (0 != ret) {
return ret;
}
return 0;
} | false | false | false | false | false | 0 |
inflate_mono_method (MonoClass *klass, MonoMethod *method, MonoObject *obj)
{
MonoMethodInflated *imethod;
MonoGenericContext *context;
int i;
/*
* With generic code sharing the klass might not be inflated.
* This can happen because classes inflated with their own
* type arguments are "normalized" to the uni... | false | false | false | false | false | 0 |
conditionally_insert_canonical_decomposition (GucharmapCharmap *charmap,
GtkTextBuffer *buffer,
GtkTextIter *iter,
gunichar uc)
{
gunichar *decomposition;
gsize result_len;
gu... | false | false | false | false | false | 0 |
recalc()
{
int targeth = this->get_h(); // The available space
int naturalh= calc_minimum_height();
int excessh = targeth - naturalh;
int num_expand = std::count (m_expansionmodes.begin(),
m_expansionmodes.end(),
List::EXPAND);
Widg... | false | false | false | false | false | 0 |
set_script_file(VMG_ uint argc)
{
char fname[OSFNMAX];
int flags;
/* check arguments */
check_argc_range(vmg_ argc, 1, 2);
/*
* If the filename is nil, close the current script file. If the
* "filename" is a number, it's a special request. Otherwise, the
* filena... | false | false | false | false | false | 0 |
isqrt(unsigned int i)
{
unsigned int min = 0;
unsigned int max ;
for (max=1; max*max<i; max<<=1);
while (min < max-1)
{
unsigned int try = (min+max)/2;
unsigned int prod = try*try;
#if 0
printf("isqrt(%u): %u < %u (=%u) < %u\n", i, min, try, prod, max);
#endif
if (prod < i)
min = tr... | false | false | false | false | false | 0 |
view_char(struct view *view, position_t offset, position_t *next)
{
position_t next0;
Unicode_t ch = view_unicode(view, offset, &next0);
if (!next)
return ch;
*next = next0;
if (IS_FOLDED(ch)) {
size_t fbytes = FOLDED_BYTES(ch);
position_t next2;
if (view_unicode(view, next0 + fbytes, &next2) ==
FOL... | false | false | false | false | false | 0 |
folderview_select_row(PyObject *self, PyObject *args)
{
MainWindow *mainwin;
gboolean ok;
ok = TRUE;
mainwin = mainwindow_get_mainwindow();
if(mainwin && mainwin->folderview) {
PyObject *arg;
arg = PyTuple_GetItem(args, 0);
if(!arg)
return NULL;
Py_INCREF(arg);
if(clawsmail_folder... | false | false | false | false | false | 0 |
write_SInt16Number(int d, char *p) {
if (d > 32767)
return 1;
else if (d < -32768)
return 1;
((INR8 *)p)[0] = (INR8)(d >> 8);
((ORD8 *)p)[1] = (ORD8)(d);
return 0;
} | false | false | false | false | false | 0 |
pg_decode_palette_update(BITBUFFER *bb, BD_PG_PALETTE *p)
{
p->id = bb_read(bb, 8);
p->version = bb_read(bb, 8);
while (!bb_eof(bb)) {
pg_decode_palette_entry(bb, p->entry);
}
return 1;
} | false | false | false | false | false | 0 |
eb_character_code(EB_Book *book, EB_Character_Code *character_code)
{
EB_Error_Code error_code;
eb_lock(&book->lock);
LOG(("in: eb_character_code(book=%d)", (int)book->code));
/*
* Check for the current status.
*/
if (book->path == NULL) {
error_code = EB_ERR_UNBOUND_BOOK;
goto failed;... | false | false | false | false | false | 0 |
e_rule_context_free_uri_list (ERuleContext *context,
GList *uris)
{
g_return_if_fail (E_IS_RULE_CONTEXT (context));
/* TODO: should be virtual */
g_list_foreach (uris, (GFunc) g_free, NULL);
g_list_free (uris);
} | false | false | false | false | false | 0 |
symbol_image(char *item)
{
register struct hash_type *q;
for (q = hash_table[hash(item)]; q != NULL; q = q -> link)
{
if (EQUAL_STRING(item, q))
return ABS(q -> number);
}
return(OMEGA);
} | false | false | false | false | false | 0 |
lx_framebuffer_size(void)
{
unsigned int val;
if (!cs5535_has_vsa2()) {
uint32_t hi, lo;
/* The number of pages is (PMAX - PMIN)+1 */
rdmsr(MSR_GLIU_P2D_RO0, lo, hi);
/* PMAX */
val = ((hi & 0xff) << 12) | ((lo & 0xfff00000) >> 20);
/* PMIN */
val -= (lo & 0x000fffff);
val += 1;
/* The page size... | false | false | false | false | false | 0 |
slab_memory_callback(struct notifier_block *self,
unsigned long action, void *arg)
{
int ret = 0;
switch (action) {
case MEM_GOING_ONLINE:
ret = slab_mem_going_online_callback(arg);
break;
case MEM_GOING_OFFLINE:
ret = slab_mem_going_offline_callback(arg);
break;
case MEM_OFFLINE:
case MEM_CANCEL_ONL... | false | false | false | false | false | 0 |
ConstWeightToGuave(char *inputfile, char *outputfile) {
char bit;
int i, j, M, n, res, el;
OpenFiles(inputfile, outputfile);
res = ReadUntil(in, '\n', 2);
res = ReadUntil(in, ',', 1);
res = fscanf(in, "%i,%i", &M, &n);
res = ReadUntil(in, '\n', 1);
fprintf(out, "GUAVA_TEMP_VAR := [\n");
for (i = 0; i ... | false | false | false | false | true | 1 |
jack_update_power(struct hda_codec *codec,
struct hda_jack_callback *jack)
{
struct sigmatel_spec *spec = codec->spec;
int i;
if (!spec->num_pwrs)
return;
if (jack && jack->nid) {
stac_toggle_power_map(codec, jack->nid,
snd_hda_jack_detect(codec, jack->nid),
true);
return;
}
... | false | false | false | false | false | 0 |
abs2greg( long theDate )
{
int day, year, month, mlen;
date_t d;
long int d0, n400, d1, n100, d2, n4, d3, n1;
d0 = theDate - 1L;
n400 = d0 / 146097L;
d1 = d0 % 146097L;
n100 = d1 / 36524L;
d2 = d1 % 36524L;
n4 = d2 / 1461L;
d3 = d2 % 1461L;
n1 = d3 / 365L;
day = (int) ((d3 % 365L) + 1L);
yea... | false | false | false | false | false | 0 |
_cmsSubAllocDup(_cmsSubAllocator* s, const void *ptr, cmsUInt32Number size)
{
void *NewPtr;
// Dup of null pointer is also NULL
if (ptr == NULL)
return NULL;
NewPtr = _cmsSubAlloc(s, size);
if (ptr != NULL && NewPtr != NULL) {
memcpy(NewPtr, ptr, size);
}
return NewPt... | false | true | false | false | false | 1 |
transform_disable(PNG_CONST char *name)
{
image_transform *list = image_transform_first;
while (list != &image_transform_end)
{
if (strcmp(list->name, name) == 0)
{
list->enable = 0;
return;
}
list = list->list;
}
fprintf(stderr, "pngvalid: --transform-disable... | false | false | false | false | false | 0 |
z_primitive_root(unsigned long p)
{
FLINT_ASSERT(p > 2);
FLINT_ASSERT(z_isprime(p) == 1);
unsigned long res;
factor_t factors;
z_factor(&factors, (p - 1), 1);
res = 2;
int i = 0;
do {
if(z_powmod(res, (p-1) / factors.p[i], p) == 1) {
res++;
i = 0;
} ... | false | false | false | false | false | 0 |
user_read(const struct key *key, char __user *buffer, size_t buflen)
{
const struct user_key_payload *upayload;
long ret;
upayload = user_key_payload(key);
ret = upayload->datalen;
/* we can return the data as is */
if (buffer && buflen > 0) {
if (buflen > upayload->datalen)
buflen = upayload->datalen;
... | false | false | false | false | false | 0 |
H5T_upgrade_version_cb(H5T_t *dt, void *op_value)
{
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Sanity check */
HDassert(dt);
HDassert(op_value);
/* Special behavior for each type of datatype */
switch(dt->shared->type) {
case H5T_COMPOUND:
case H5T_ARRAY:
case H5T_ENUM:
... | false | false | false | false | false | 0 |
fmt_nonillion(int s, int i, bool b, bool o, int t)
{
int j;
for (; i > 3; i -= j) {
b = fmt_thousand(s, j = (i+2)%3+1, b, FALSE, t);
if (j != 3 || fmt_tempstr(s) != '0' ||
fmt_tempstr(s+1) != '0' || fmt_tempstr(s+2) != '0') {
writec_stream(' ', fmt_stream);
writestr_stream(fmt_big_numeral[(i - 1)/3... | false | false | false | false | false | 0 |
panel_util_set_tooltip_text (GtkWidget *widget,
const char *text)
{
g_signal_handlers_disconnect_matched (widget,
G_SIGNAL_MATCH_FUNC,
0, 0, NULL,
panel_util_query_tooltip_cb,
NULL);
if (PANEL_GLIB_STR_EMPTY (text)) {
g_object_set (widget, "has-tooltip", ... | false | false | false | false | false | 0 |
folder_info_get_msg_by_uid(struct folder_ref_info * ref_info,
char * uid)
{
chashdatum key;
chashdatum data;
mailmessage * msg;
int r;
key.data = uid;
key.len = strlen(uid);
r = chash_get(ref_info->uid_hash, &key, &data);
if (r < 0)
return NULL;
msg = data.data;
return msg;
} | false | false | false | false | false | 0 |
GPS_Protocol_Table_Set(US id)
{
int32 i;
US v;
char s[GPS_ARB_LEN];
i=0;
while ((v=GPS_MP[i].id)) {
if (v==id) {
gps_link_type = GPS_MP[i].link;
gps_device_command = GPS_MP[i].command-10;
gps_waypt_transfer = GPS_MP[i].wayptt;
gps_waypt_type = GPS_MP[i].w... | false | false | false | false | false | 0 |
PinBuffer_Locked(volatile BufferDesc *buf)
{
Buffer b;
PrivateRefCountEntry *ref;
/*
* As explained, We don't expect any preexisting pins. That allows us to
* manipulate the PrivateRefCount after releasing the spinlock
*/
Assert(GetPrivateRefCountEntry(BufferDescriptorGetBuffer(buf), false) == NULL);
buf-... | false | false | false | false | false | 0 |
ext_header_for_num(uint8_t num)
{
unsigned int i;
for (i = 0; i < NUM_HEADER_TYPES; ++i) {
if (ext_header_types[i]->num == num) {
return ext_header_types[i];
}
}
return NULL;
} | false | false | false | false | false | 0 |
collect_progress(
const char *path,
size_t completed_steps,
size_t total_steps,
void *payload)
{
git_vector *paths = payload;
GIT_UNUSED(completed_steps);
GIT_UNUSED(total_steps);
if (path == NULL)
return;
git_vector_insert(paths, strdup(path));
} | false | false | false | false | false | 0 |
mpn_fft_fft_radix4Rec (mp_ptr *Ap, mp_size_t ind_start, mp_size_t k,
mp_size_t omega, mp_size_t n, mp_ptr *rotbuf)
{
mp_size_t i, stride, stride2;
stride2 = 1<<(k-2);
stride = 1<<(k-1);
if (k == 1) {
mpn_fft_butterfly_rotbuf0(Ap, ind_start, ind_start+1, rotbuf, n);
return;
}
mpn_fft_butterf... | false | false | false | false | false | 0 |
__jbd2_journal_force_commit(journal_t *journal)
{
transaction_t *transaction = NULL;
tid_t tid;
int need_to_start = 0, ret = 0;
read_lock(&journal->j_state_lock);
if (journal->j_running_transaction && !current->journal_info) {
transaction = journal->j_running_transaction;
if (!tid_geq(journal->j_commit_reques... | false | false | false | false | false | 0 |
makeop(struct opcode * op, struct mode *m, int add)
{
register unsigned int newop;
if( m == NULL ) {
if(pass2) genbyte(op->bytes[0+add]);
return(1);
}
if( pass2 ) {
newop = op->bytes[ get_md(*m)+add ] | get_ov(*m);
genbyte(newop);
if( get_sz(*m) > 0 ) genbyte( get_b1(*m) );
if( get_sz(*m) > 1 ) genbyt... | false | false | false | false | false | 0 |
inf_session_handle_user_status_change(InfSession* session,
InfXmlConnection* connection,
xmlNodePtr xml,
GError** error)
{
InfSessionPrivate* priv;
InfUser* user;
guint id;
xmlChar* status_attr;
g... | false | false | false | false | false | 0 |
gkrellm_log_unregister(GkrellmLogFunc log)
{
gint i;
GkrellmLogFacility *f;
if (!s_log_facility_ptr_array)
return FALSE; // gkrellm_log_init() not called yet
for (i = 0; i < s_log_facility_ptr_array->len; i++)
{
f = (g_ptr_array_index(s_log_facility_ptr_array, i));
if (f->log == log)
{
if (f->clean... | false | false | false | false | false | 0 |
ipv6_probe ( struct net_device *netdev ) {
struct ipv6_miniroute *miniroute;
struct in6_addr address;
int prefix_len;
int rc;
/* Construct link-local address from EUI-64 as per RFC 2464 */
memset ( &address, 0, sizeof ( address ) );
prefix_len = ipv6_link_local ( &address, netdev );
if ( prefix_len < 0 ) {
r... | false | false | false | false | false | 0 |
analyze_faults(const wsdl__definitions &definitions, Service *service, Operation *op, vector<wsdl__ext_operation>::const_iterator& operation)
{ for (vector<wsdl__ext_fault>::const_iterator fault = (*operation).fault.begin(); fault != (*operation).fault.end(); ++fault)
{ Message *f = analyze_fault(definitions, service... | false | false | false | false | false | 0 |
file_character(BCPPARAMDATA * pdata, DBPROCESS * dbproc, DBINT dir)
{
DBINT li_rowsread = 0;
int i;
int li_numcols = 0;
RETCODE ret_code = 0;
if (dir == DB_QUERYOUT) {
if (dbfcmd(dbproc, "SET FMTONLY ON %s SET FMTONLY OFF", pdata->dbobject) == FAIL) {
printf("dbfcmd failed\n");
return FALSE;
}
} else {... | false | false | false | false | false | 0 |
Cns_srv_getpath(magic, req_data, clienthost, thip)
int magic;
char *req_data;
const char *clienthost;
struct Cns_srv_thread_info *thip;
{
int c;
u_signed64 cur_fileid;
char func[16];
gid_t gid;
gid_t *gids;
char groups[256];
int nbgids;
char *p;
char path[CA_MAXPATHLEN+1];
char *rbp;
char repbuf[CA_MAXPATHLE... | false | false | false | false | false | 0 |
pkix_pl_Socket_Accept(
PKIX_PL_Socket *serverSocket,
PKIX_PL_Socket **pRendezvousSocket,
void *plContext)
{
PRErrorCode errorcode = 0;
PRFileDesc *rendezvousSock = NULL;
PRNetAddr *clientAddr = NULL;
PKIX_PL_Socket *newSocket = NULL;
PKIX_ENTER(SOCKET, "p... | false | false | false | false | false | 0 |
URIEscape(const std::string& data) {
xmlChar* out = xmlURIEscapeStr((xmlChar*)(data.c_str()), NULL);
std::string ret;
ret.append((char*)out);
xmlFree(out);
return ret;
} | false | false | false | false | false | 0 |
getMachOFatMemoryBuffers(StringRef Filename, MemoryBuffer &Mem,
object::MachOUniversalBinary &Fat) {
std::vector<MemoryBufferRef> Buffers;
StringRef FatData = Fat.getData();
for (auto It = Fat.begin_objects(), End = Fat.end_objects(); It != End;
++It) {
StringRef ObjData = FatD... | false | false | false | false | false | 0 |
ct_is_terminator(char car)
{
short termind,msk,aux;
if (debug == 2) { printf(" Entered static short ct_is_terminator...\n");}
/*printf(" Htype = %d",htype); ed*/
if (( htype == 12 ) && (car > 97) && (car < 123) ) { car = car - 32;}
if (debug == 1) {printf(" car = %d\n",car);} /*ed*/
te... | false | false | false | false | false | 0 |
o_picture_end(GSCHEM_TOPLEVEL *w_current, int w_x, int w_y)
{
TOPLEVEL *toplevel = w_current->toplevel;
OBJECT *new_obj;
int picture_width, picture_height;
int picture_left, picture_top;
g_assert( w_current->inside_action != 0 );
/* erase the temporary picture */
/* o_picture_draw_rubber(w_current); */
... | 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.