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 |
|---|---|---|---|---|---|---|
cmdline_parser_file_save(const char *filename, struct gengetopt_args_info *args_info)
{
FILE *outfile;
int i = 0;
outfile = fopen(filename, "w");
if (!outfile)
{
fprintf (stderr, "%s: cannot open file for writing: %s\n", CMDLINE_PARSER_PACKAGE, filename);
return EXIT_FAILURE;
}
if (args... | false | false | false | false | false | 0 |
slablist_is_empty(slabclass_t* psct, slablist_t* pslt) {
unsigned char* pcurrent = (unsigned char*)pslt->used_bitmap;
size_t need_byte = (size_t)ceil(psct->perslab / 8.0);
while (need_byte > 0) {
if (need_byte >= sizeof(unsigned int)) {
if (*((unsigned int*)pcurrent)) return false;
... | false | false | false | false | false | 0 |
arizona_thermal_warn(int irq, void *data)
{
struct arizona *arizona = data;
unsigned int val;
int ret;
ret = regmap_read(arizona->regmap, ARIZONA_INTERRUPT_RAW_STATUS_3,
&val);
if (ret != 0) {
dev_err(arizona->dev, "Failed to read thermal status: %d\n",
ret);
} else if (val & ARIZONA_SPK_OVERHEAT_WARN_... | false | false | false | false | false | 0 |
acpi_dev_resource_interrupt(struct acpi_resource *ares, int index,
struct resource *res)
{
struct acpi_resource_irq *irq;
struct acpi_resource_extended_irq *ext_irq;
switch (ares->type) {
case ACPI_RESOURCE_TYPE_IRQ:
/*
* Per spec, only one interrupt per descriptor is allowed in
* _CRS, but some firmw... | false | false | false | false | false | 0 |
log_keepalives(const ap_errorlog_info *info, const char *arg,
char *buf, int buflen)
{
if (!info->c)
return 0;
return apr_snprintf(buf, buflen, "%d", info->c->keepalives);
} | false | false | false | false | false | 0 |
sec_pkcs12_choose_cert_bag_type(void *src_or_dest, PRBool encoding)
{
const SEC_ASN1Template *theTemplate;
sec_PKCS12CertBag *certbag;
SECOidData *oiddata;
if (src_or_dest == NULL) {
return NULL;
}
certbag = (sec_PKCS12CertBag*)src_or_dest;
oiddata = SECOID_FindOID(&certbag->bagID);
... | false | false | false | false | false | 0 |
isPointLegal(PT_DocPosition pos) const
{
pf_Frag_Strux* prevSDH = NULL;
pf_Frag_Strux* nextSDH = NULL;
PT_DocPosition nextPos =0;
//
// Special cases which would otherwise fail..
//
if(m_pDoc->isEndFootnoteAtPos(pos))
{
return true;
}
if(m_pDoc->isFootnoteAtPos(pos))
{
return true;
}
fl_BlockLayout * pB... | false | false | false | false | false | 0 |
iwl_mvm_netdetect_config(struct iwl_mvm *mvm,
struct cfg80211_wowlan *wowlan,
struct cfg80211_sched_scan_request *nd_config,
struct ieee80211_vif *vif)
{
struct iwl_wowlan_config_cmd wowlan_config_cmd = {};
int ret;
ret = iwl_mvm_switch_to_d3(mvm);
if (ret)
return ret;
/* rfkill release can be eith... | false | false | false | false | false | 0 |
rk_seed(unsigned long seed, rk_state *state)
{
int pos;
seed &= 0xffffffffUL;
/* Knuth's PRNG as used in the Mersenne Twister reference implementation */
for (pos = 0; pos < RK_STATE_LEN; pos++) {
state->key[pos] = seed;
seed = (1812433253UL * (seed ^ (seed >> 30)) + pos + 1) & 0xffffff... | false | false | false | false | false | 0 |
get_string(Stream *htio, classfile *clazz, uint index)
{
return (index < clazz->cpool_count) ? clazz->cpool[index]->value.string : (char*)"?";
} | false | false | false | false | true | 1 |
add_wsp_get(Octstr *pdu) {
Octstr *urlbuf;
octstr_append_char(pdu, Get_PDU);
if (http_url) {
octstr_append_uintvar(pdu, octstr_len(http_url));
octstr_append(pdu, http_url);
} else {
urlbuf = octstr_format("http://localhost:%ld/hello.wml",
(long) http_port);
octstr_append_uintvar(pdu, octstr_... | false | false | false | false | false | 0 |
gres_plugin_job_state_pack(List gres_list, Buf buffer,
uint32_t job_id, bool details,
uint16_t protocol_version)
{
int i, rc = SLURM_SUCCESS;
uint32_t top_offset, tail_offset;
uint32_t magic = GRES_MAGIC;
uint16_t rec_cnt = 0;
ListIterator gres_iter;
gres_state_t *gres_ptr;
gres_job_state_t *... | false | false | false | false | false | 0 |
gst_locations_combo_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
GstLocationsComboPrivate *priv;
g_return_if_fail (GST_IS_LOCATIONS_COMBO (object));
priv = GST_LOCATIONS_COMBO_GET_PRIVATE (object);
switch (prop_id)
{
... | false | false | false | false | false | 0 |
bnet_stop_thread_server(pthread_t tid)
{
quit = true;
if (!pthread_equal(tid, pthread_self())) {
pthread_kill(tid, TIMEOUT_SIGNAL);
}
} | false | false | false | false | false | 0 |
find_symbol_in_section(const struct symsearch *syms,
struct module *owner,
void *data)
{
struct find_symbol_arg *fsa = data;
struct kernel_symbol *sym;
sym = bsearch(fsa->name, syms->start, syms->stop - syms->start,
sizeof(struct kernel_symbol), cmp_name);
if (sym != NULL && check_symbol(syms, ow... | false | false | false | false | false | 0 |
gee_tree_map_map_iterator_real_set_value (GeeMapIterator* base, gconstpointer value) {
GeeTreeMapMapIterator * self;
gint _tmp0_ = 0;
GeeTreeMap* _tmp1_ = NULL;
gint _tmp2_ = 0;
gboolean _tmp3_ = FALSE;
gboolean _tmp4_ = FALSE;
GeeTreeMapNode* _tmp5_ = NULL;
gconstpointer _tmp6_ = NULL;
gpointer _tmp7_ = NULL;... | false | false | false | false | false | 0 |
jmicron_remove_slot(struct sdhci_pci_slot *slot, int dead)
{
if (dead)
return;
if (slot->chip->pdev->device == PCI_DEVICE_ID_JMICRON_JMB38X_MMC ||
slot->chip->pdev->device == PCI_DEVICE_ID_JMICRON_JMB388_ESD)
jmicron_enable_mmc(slot->host, 0);
} | false | false | false | false | false | 0 |
controlsVisible() const
{
return d->controlsWidget != 0 && d->controlsWidget->isVisible();
} | false | false | false | false | false | 0 |
_ibar_go_focus(void)
{
E_Manager *man;
IBar *b;
if (_ibar_focus_win) return;
man = e_manager_current_get();
if (!man) return;
_ibar_focus_win = ecore_x_window_input_new(man->root, -10, -20, 1, 1);
ecore_x_window_show(_ibar_focus_win);
if (!e_grabinput_get(0, 0, _ibar_focus_win))
{
... | false | false | false | false | false | 0 |
GetLine()
{
clog << flush; cout << flush;
#ifdef HAVE_LIBREADLINE
int edit_input = SysVar::Edit_Input() && isatty(0);
#endif
string line;
do {
char *cline;
actualPrompt = SysVar::Prompt();
lineEdit = true;
#ifdef HAVE_LIBREADLINE
if( edit_input != 0)
cline = readline(const_cast<cha... | false | false | false | false | false | 0 |
invert_sqrt_vec(int n, float *vec)
{
int i;
double d;
float v;
for (i = 0; i < n; i++) {
if ((v = vec[i]) > 0.0) {
/* do this in two steps to avoid a bug in gcc-4.00 on AIX */
d = 1. / sqrt(v);
vec[i] = (float) d;
}
}
} | false | false | false | false | false | 0 |
libssh2_sftp_init(LIBSSH2_SESSION *session)
{
LIBSSH2_SFTP *ptr;
if(!session)
return NULL;
if(!(session->state & LIBSSH2_STATE_AUTHENTICATED)) {
_libssh2_error(session, LIBSSH2_ERROR_INVAL,
"session not authenticated yet");
return NULL;
}
BLOCK_ADJUS... | false | false | false | false | false | 0 |
new_axiom_op_list( void )
{
static int count;
char *name;
PlOperator *ret;
/* WARNING: count should not exceed 999
*/
count++;
if ( count == 10000 ) {
printf("\ntoo many axioms! look into memory.c, line 157\n\n");
exit( 1 );
}
name = new_Token(strlen(HIDDEN_STR)+strlen(AXIO... | false | false | false | false | false | 0 |
cogl_fixed_sqrt (CoglFixed x)
{
/* The idea for this comes from the Alegro library, exploiting the
* fact that,
* sqrt (x) = sqrt (x/d) * sqrt (d);
*
* For d == 2^(n):
*
* sqrt (x) = sqrt (x/2^(2n)) * 2^n
*
* By locating suitable n for given x... | false | false | false | false | false | 0 |
l2n_16(u16 *num) {
u16 tmp;
if(!endian) return;
tmp = *num;
*num = ((tmp & 0xff00) >> 8) |
((tmp & 0x00ff) << 8);
} | false | false | false | false | false | 0 |
extract_split_bit_field (rtx op0, unsigned HOST_WIDE_INT bitsize,
unsigned HOST_WIDE_INT bitpos, int unsignedp)
{
unsigned int unit;
unsigned int bitsdone = 0;
rtx result = NULL_RTX;
int first = 1;
/* Make sure UNIT isn't larger than BITS_PER_WORD, we can only handle that
much at a time. */
if (R... | false | false | false | false | false | 0 |
gnucash_sheet_redraw_block (GnucashSheet *sheet, VirtualCellLocation vcell_loc)
{
gint x, y, w, h;
GnomeCanvas *canvas;
SheetBlock *block;
g_return_if_fail (sheet != NULL);
g_return_if_fail (GNUCASH_IS_SHEET(sheet));
canvas = GNOME_CANVAS(sheet);
block = gnucash_sheet_get_block (sheet, vc... | false | false | false | false | false | 0 |
A_MStaffTrack(mobj_t * actor)
{
if ((actor->special1.m == NULL) && (P_Random() < 50))
{
actor->special1.m = P_RoughMonsterSearch(actor, 10);
}
P_SeekerMissile(actor, ANG1 * 2, ANG1 * 10);
} | false | false | false | false | false | 0 |
kmclipm_vector_cut_percentian(const kmclipm_vector *kv,
double percentage)
{
kmclipm_vector *ret_vec = NULL;
cpl_vector *vec = NULL,
*cut_vec = NULL;
int size = 0;
KMCLIPM_TRY
{
KMCLIPM_TR... | false | false | false | false | false | 0 |
SyfFsmUserSaveCode( FsmFigure, FileName )
fsmfig_list *FsmFigure;
char *FileName;
{
fsmfig_list *ScanFigure;
FILE *UserFile;
fsmstate_list *ScanState;
chain_list *ScanChain;
syfinfo *SyfInfo;
long Value;
long Bit;
char OneHot;
UserFile = m... | false | false | false | false | false | 0 |
lock_number(struct image_summary *summary_entry)
{
int number = 0;
struct image_summary *prev_entry,*last_entry;
if(summary_entry)
{
if(summary_entry->entry_lock)
number = summary_entry->entry_lock; /* don't change it */
else if((last_entry = last_summary_entry(summary_entr... | false | false | false | false | false | 0 |
vect_get_known_peeling_cost (loop_vec_info loop_vinfo, int peel_iters_prologue,
int *peel_iters_epilogue,
int scalar_single_iter_cost)
{
int peel_guard_costs = 0;
int vf = LOOP_VINFO_VECT_FACTOR (loop_vinfo);
if (!LOOP_VINFO_NITERS_KNOWN_P (loop_vinfo))
... | false | false | false | false | false | 0 |
aziminv(
double x, /* (O) X projection coordinate */
double y, /* (O) Y projection coordinate */
double *lon, /* (I) Longitude */
double *lat) /* (I) Latitude */
{
double rh; /* height above ellipsoid */
double z; /* angle */
double sinz,cosz; /* sin of z and cos of z */
double con;
/* Inverse ... | false | false | false | false | false | 0 |
crypto_register_ahash(struct ahash_alg *alg)
{
struct crypto_alg *base = &alg->halg.base;
int err;
err = ahash_prepare_alg(alg);
if (err)
return err;
return crypto_register_alg(base);
} | false | false | false | false | false | 0 |
RestorePosition (GraphicComp* comp, Command* cmd) {
VoidData* vd = (VoidData*) cmd->Recall(comp);
GraphicComp* pred = (GraphicComp*) vd->_void;
GraphicComp* parent = (GraphicComp*) comp->GetParent();
if (parent != nil) parent->Remove(comp);
if (pred == nil) {
Prepend(comp);
} else {
... | false | false | false | false | false | 0 |
chash_free(chash * hash) {
unsigned int indx;
chashiter * iter, * next;
/* browse the hash table */
for(indx = 0; indx < hash->size; indx++) {
iter = hash->cells[indx];
while (iter) {
next = iter->next;
if (hash->copykey)
free(iter->key.data);
if (hash->copyvalue)
free(iter->value.d... | false | false | false | false | false | 0 |
dead_debug_init (struct dead_debug *debug, bitmap used)
{
debug->head = NULL;
debug->used = used;
debug->to_rescan = NULL;
if (used)
bitmap_clear (used);
} | false | false | false | false | false | 0 |
__tgamma(double x)
{
int local_signgam;
double y = __ieee754_gamma_r(x,&local_signgam);
if(__glibc_unlikely (!__finite (y) || y == 0)
&& (__finite (x) || __isinf (x) < 0)
&& _LIB_VERSION != _IEEE_) {
if (x == 0.0)
return __kernel_standard(x,x,50); /* tgamma pole */
else if(__floor(x)==x&&x<0.0)
... | false | false | false | false | false | 0 |
add_stack_protection_conflicts (void)
{
size_t i, j, n = stack_vars_num;
unsigned char *phase;
phase = XNEWVEC (unsigned char, n);
for (i = 0; i < n; ++i)
phase[i] = stack_protect_decl_phase (stack_vars[i].decl);
for (i = 0; i < n; ++i)
{
unsigned char ph_i = phase[i];
for (j = i + 1; j ... | false | false | false | false | false | 0 |
initVM(InitArgs *args) {
int status;
/* Perform platform dependent initialisation */
initialisePlatform();
/* Initialise the VM modules -- ordering is important! */
status = initialiseHooks(args) &&
initialiseProperties(args) &&
initialiseAlloc(args) &&
init... | false | false | false | false | false | 0 |
ssh_channel_request_send_exit_signal(ssh_channel channel, const char *sig,
int core, const char *errmsg, const char *lang) {
ssh_buffer buffer = NULL;
ssh_string tmp = NULL;
int rc = SSH_ERROR;
if(channel == NULL) {
return rc;
}
if(sig == NULL || errmsg == NULL || lang == ... | false | false | false | false | false | 0 |
qromb_function(double x, void* params)
{
qromb_param *p = static_cast<qromb_param*>(params);
(*(p->arg))[0]=x;
BaseGDL* res;
// marc: is this ok? call_fun will be executed within the actual (callStack.back()) environment
res = p->envt->Interpreter()->call_fun(static_cast<DSubUD*>(p->nenvt->GetPro(... | false | false | false | false | false | 0 |
sq_release(HSQUIRRELVM v,HSQOBJECT *po)
{
if(!ISREFCOUNTED(type(*po))) return SQTrue;
#ifdef NO_GARBAGE_COLLECTOR
__Release(po->_type,po->_unVal);
return SQFalse; //the ret val doesn't work(and cannot be fixed)
#else
return _ss(v)->_refs_table.Release(*po);
#endif
} | false | false | false | false | false | 0 |
open_rw(const char* spec)
{
int fd = open(spec, O_RDWR);
#ifdef __linux__
int ro = 0;
/*
This ioctl is needed because after "blockdev --setro" kernel still
allows to open the device in read-write mode but fails writes.
*/
if (fd != -1 && ioctl(fd, BLKROGET, &ro) == 0 && ro)
{
close(fd);
return -1;
}... | false | false | false | false | true | 1 |
contextMenuEvent( QContextMenuEvent *event )
{
QMenu *popup = createStandardContextMenu(event->pos());
if (popup) {
KIconTheme::assignIconsToContextMenu( isReadOnly() ? KIconTheme::ReadOnlyText
: KIconTheme::TextEditor,
... | false | false | false | false | false | 0 |
cl_thread_wait_for_event(cl_thread_settings_t *thread_config, long sec, long micro_sec) {
int ret = CL_RETVAL_OK;
if (thread_config == NULL) {
return CL_RETVAL_PARAMS;
}
thread_config->thread_event_count = thread_config->thread_event_count + 1;
thread_config->thread_state = CL_THREAD_WAITING... | false | false | false | false | false | 0 |
p_tabw_new_clip_cb (GtkWidget *w
, GdkEventButton *bevent
, GapStbTabWidgets *tabw)
{
GapStoryBoard *stb_dst;
if (tabw == NULL) { return; }
if (tabw->sgpp == NULL) { return; }
stb_dst = p_tabw_get_stb_ptr(tabw);
if(stb_dst != NULL)
{
if(bevent)
{
... | false | false | false | false | false | 0 |
acpi_ut_repair_name(char *name)
{
u32 i;
u8 found_bad_char = FALSE;
u32 original_name;
ACPI_FUNCTION_NAME(ut_repair_name);
ACPI_MOVE_NAME(&original_name, name);
/* Check each character in the name */
for (i = 0; i < ACPI_NAME_SIZE; i++) {
if (acpi_ut_valid_acpi_char(name[i], i)) {
continue;
}
/*
... | false | false | false | false | false | 0 |
L29__M__evalmacros(base0)
register object *base0;
{ register object *base=vs_base;
register object *sup=base+VM38; VC38
vs_reserve(VM38);
{object V249;
object V250;
check_arg(2);
V249=(base[0]);
V250=(base[1]);
vs_top=sup;
goto TTL;
TTL:;
{object V251;
base[2]= (V249);
vs_top=(vs_base=base+2)+1;
L28__V__ev... | false | false | false | false | false | 0 |
mv88e1xxx_get_link_status(struct cphy *cphy, int *link_ok,
int *speed, int *duplex, int *fc)
{
u32 status;
int sp = -1, dplx = -1, pause = 0;
(void) simple_mdio_read(cphy,
MV88E1XXX_SPECIFIC_STATUS_REGISTER, &status);
if ((status & V_PSSR_STATUS_RESOLVED) != 0) {
if (status & V_PSSR_RX_PAUSE)
paus... | false | false | false | false | false | 0 |
ex_viminfo(eap)
exarg_T *eap;
{
char_u *save_viminfo;
save_viminfo = p_viminfo;
if (*p_viminfo == NUL)
p_viminfo = (char_u *)"'100";
if (eap->cmdidx == CMD_rviminfo)
{
if (read_viminfo(eap->arg, VIF_WANT_INFO | VIF_WANT_MARKS
| (eap->forceit ? VIF_FORCEIT : 0)) == FAIL)
EMSG(_("E19... | false | false | false | false | false | 0 |
_but_down(void *d1,
void *d2)
{
E_Config_Dialog *cfd = d1;
Evas_Object *il = d2;
Match_Config *m;
int n;
e_widget_ilist_freeze(il);
n = e_widget_ilist_selected_get(il);
if (n >= (e_widget_ilist_count(il) - 1)) return;
m = e_widget_ilist_nth_data_get(il, n);
if (!m)
{
e... | false | false | false | false | false | 0 |
mono_marshal_method_from_wrapper (MonoMethod *wrapper)
{
MonoMethod *m;
int wrapper_type = wrapper->wrapper_type;
WrapperInfo *info;
if (wrapper_type == MONO_WRAPPER_NONE || wrapper_type == MONO_WRAPPER_DYNAMIC_METHOD)
return wrapper;
info = mono_marshal_get_wrapper_info (wrapper);
switch (wrapper_type) {
c... | false | false | false | false | false | 0 |
ompi_coll_tuned_alltoallv_intra_pairwise(void *sbuf, int *scounts, int *sdisps,
struct ompi_datatype_t *sdtype,
void* rbuf, int *rcounts, int *rdisps,
struct ompi_datatype_t *rdtype,
... | false | false | false | false | false | 0 |
pack_exchange(int i, double *buf)
{
int m = 1;
buf[m++] = x[i][0];
buf[m++] = x[i][1];
buf[m++] = x[i][2];
buf[m++] = v[i][0];
buf[m++] = v[i][1];
buf[m++] = v[i][2];
buf[m++] = tag[i];
buf[m++] = type[i];
buf[m++] = mask[i];
buf[m] = 0.0; // for valgrind
*((tagint *) &buf[m++]) = image[i];... | false | false | false | false | false | 0 |
cas_post_config(apr_pool_t *pool, apr_pool_t *p1, apr_pool_t *p2, server_rec *s)
{
cas_cfg *c = ap_get_module_config(s->module_config, &auth_cas_module);
apr_uri_t nullURL;
apr_finfo_t f;
memset(&nullURL, '\0', sizeof(apr_uri_t));
if(apr_stat(&f, c->CASCookiePath, APR_FINFO_TYPE, pool) == APR_INCOMPLETE) {
ap_... | false | false | false | false | false | 0 |
gx_lookup_cached_char(const gs_font * pfont, const cached_fm_pair * pair,
gs_glyph glyph, int wmode, int depth,
gs_fixed_point *subpix_origin)
{
gs_font_dir *dir = pfont->dir;
uint chi = chars_head_index(glyph, pair);
register cached_char *cc;
while ((cc = di... | false | false | false | false | false | 0 |
switch_p_build_node_info(switch_node_info_t *switch_node)
{
sw_gen_node_info_t *gen_node_info = (sw_gen_node_info_t *) switch_node;
struct ifaddrs *if_array = NULL, *if_rec;
sw_gen_ifa_t *ifa_ptr;
void *addr_ptr = NULL;
char addr_str[INET6_ADDRSTRLEN], *ip_family;
char hostname[256], *tmp;
if (debug_flags & DEB... | false | false | false | false | false | 0 |
pp_cxx_delete_expression (cxx_pretty_printer *pp, tree t)
{
enum tree_code code = TREE_CODE (t);
switch (code)
{
case DELETE_EXPR:
case VEC_DELETE_EXPR:
if (DELETE_EXPR_USE_GLOBAL (t))
pp_cxx_colon_colon (pp);
pp_cxx_identifier (pp, "delete");
if (code == VEC_DELETE_EXPR)
... | false | false | false | false | false | 0 |
match_operator (buffer_t * buffer,
struct words *words)
{
struct rule **key;
uchar *string = buffer->value + buffer->curr;
int i;
int res;
/* First the words */
if (words->min[*string])
for (key = words->max[*string]
; words->min[*string] <= key
; key--)
{
if (ustrprefix ((*key)->word, str... | false | false | false | false | false | 0 |
ptaGetIPt(PTA *pta,
l_int32 index,
l_int32 *px,
l_int32 *py)
{
PROCNAME("ptaGetIPt");
if (px) *px = 0;
if (py) *py = 0;
if (!pta)
return ERROR_INT("pta not defined", procName, 1);
if (index < 0 || index >= pta->n)
return ERROR_INT("invalid inde... | false | false | false | false | false | 0 |
demod(float *buffer, int length)
{
float f;
unsigned char curbit;
if (state->l1.afsk12.subsamp) {
int numfill = SUBSAMP - state->l1.afsk12.subsamp;
if (length < numfill) {
state->l1.afsk12.subsamp += length;
return;
}
buffer += numfill;
length... | false | false | false | false | false | 0 |
r2cfII_4(R *R0, R *R1, R *Cr, R *Ci, stride rs, stride csr, stride csi, INT v, INT ivs, INT ovs)
{
DK(KP707106781, +0.707106781186547524400844362104849039284835938);
INT i;
for (i = v; i > 0; i = i - 1, R0 = R0 + ivs, R1 = R1 + ivs, Cr = Cr + ovs, Ci = Ci + ovs, MAKE_VOLATILE_STRIDE(rs), MAKE_VOLATILE_ST... | false | false | false | false | false | 0 |
alloc_l_mod_call_list(void)
{
l_mod_call_list_t *new;
new = malloc(sizeof(*new));
if ( new ) {
bzero(new, sizeof(*new));
pthread_mutex_init(&new->lock, NULL);
}
return(new);
} | false | false | false | false | false | 0 |
pelican_init(pelican_state *pelmac, const unsigned char *key, unsigned long keylen)
{
int err;
LTC_ARGCHK(pelmac != NULL);
LTC_ARGCHK(key != NULL);
#ifdef LTC_FAST
if (16 % sizeof(LTC_FAST_TYPE)) {
return CRYPT_INVALID_ARG;
}
#endif
if ((err = aes_setup(key, keylen, 0, &pelmac-... | false | false | false | true | false | 1 |
uvc_ioctl_enum_framesizes(struct file *file, void *fh,
struct v4l2_frmsizeenum *fsize)
{
struct uvc_fh *handle = fh;
struct uvc_streaming *stream = handle->stream;
struct uvc_format *format = NULL;
struct uvc_frame *frame;
int i;
/* Look for the given pixel format */
for (i = 0; i < stream->nformats; i... | false | false | false | false | false | 0 |
CloseReport( ReportHeader *agent, ReportStruct *packet ) {
if ( agent != NULL) {
/*
* Using PacketID of -1 ends reporting
*/
packet->packetID = -1;
packet->packetLen = 0;
ReportPacket( agent, packet );
packet->packetID = agent->report.cntDatagrams;
}
} | false | false | false | false | false | 0 |
compile(Expr_t * prog, char *src, char *input, int line,
char *lbl, char *sfx, int kind)
{
Exnode_t *e = 0;
Sfio_t *sf;
Sfio_t *prefix;
int rv;
/* create input stream */
if (sfx) {
sf = sfopen(0, sfx, "rs");
if (input) {
prefix = sfopen(0, input, "rs");
sfstack(sf, prefix);
}
... | false | false | false | false | false | 0 |
writePNMFile(FILE *f) {
SplashColorPtr row, p;
int x, y;
switch (mode) {
case splashModeMono1:
fprintf(f, "P4\n%d %d\n", width, height);
row = data;
for (y = 0; y < height; ++y) {
p = row;
for (x = 0; x < width; x += 8) {
fputc(*p ^ 0xff, f);
++p;
}
row += rowSize;
}
... | false | false | false | false | false | 0 |
e_border_tmp_input_hidden_push(E_Border *bd)
{
E_Border *tmp;
Eina_List *l;
E_OBJECT_CHECK(bd);
E_OBJECT_TYPE_CHECK(bd, E_BORDER_TYPE);
EINA_LIST_FOREACH(bd->client.e.state.video_child, l, tmp)
e_border_tmp_input_hidden_push(tmp);
bd->tmp_input_hidden++;
if (bd->tmp_input_hidden != 1) retur... | false | false | false | false | false | 0 |
max31790_attrs_visible(struct kobject *kobj,
struct attribute *a, int n)
{
struct device *dev = container_of(kobj, struct device, kobj);
struct max31790_data *data = dev_get_drvdata(dev);
struct device_attribute *devattr =
container_of(a, struct device_attribute, attr);
int index = to_sensor_dev_attr(de... | false | false | false | false | false | 0 |
brief_preload_icon_anim(brief_icon *bi)
{
generic_anim *ga;
int species = ship_get_species_by_type(bi->ship_class);
if(species < 0) {
return;
}
ga = &Species_info[species].icon_bitmaps[bi->type];
if ( !stricmp(NOX("none"), ga->filename) ) {
return;
}
// force read of data from disk, so we don't glitch on... | false | false | false | false | false | 0 |
parse_chan_type(DBusMessageIter *iter, gpointer data,
GError **err)
{
struct hdp_application *app = data;
DBusMessageIter *value;
char *chan_type;
int ctype;
ctype = dbus_message_iter_get_arg_type(iter);
value = iter;
if (ctype == DBUS_TYPE_VARIANT) {
DBusMessageIter variant;
/* Get value inside th... | false | false | false | false | false | 0 |
do_skip(long cnt)
{
extern void sl_dump(const skiplist *sptr);
skiplist *sl = sl_int_create();
long i;
printf("Writing...\n");
#if !SKIP_RANDOM && 1
for (i = 1; i <= cnt; i++)
sl_int_add(sl, i, i);
printf("Duplicates...\n");
for (i = 1; i <= cnt; i++)
{
int k = (rand()%cnt)+1;
sl_int_add(sl, k, k);
}... | false | false | false | false | false | 0 |
nand_flash_detect_ext_param_page(struct mtd_info *mtd,
struct nand_chip *chip, struct nand_onfi_params *p)
{
struct onfi_ext_param_page *ep;
struct onfi_ext_section *s;
struct onfi_ext_ecc_info *ecc;
uint8_t *cursor;
int ret = -EINVAL;
int len;
int i;
len = le16_to_cpu(p->ext_param_page_length) * 16;
ep = k... | false | false | false | false | false | 0 |
rb_ary_includes(ary, item)
VALUE ary;
VALUE item;
{
long i;
for (i=0; i<RARRAY(ary)->len; i++) {
if (rb_equal(RARRAY(ary)->ptr[i], item)) {
return Qtrue;
}
}
return Qfalse;
} | false | false | false | false | false | 0 |
tmpdosdupl(dir, dirp, single)
CONST char *dir;
char **dirp;
int single;
{
# ifdef DEP_DOSEMU
char tmp[MAXPATHLEN];
# endif
struct stat st;
char *cp, *tmpdir, path[MAXPATHLEN];
int i, drive;
# ifdef DEP_DOSDRIVE
if ((drive = dospath2(dir))) /*EMPTY*/;
else
# endif
# ifdef DEP_URLPATH
if (urlpath(dir, NULL, NULL,... | false | false | false | false | false | 0 |
mono_method_get_equivalent_method (MonoMethod *method, MonoClass *klass)
{
int offset = -1, i;
if (method->is_inflated && ((MonoMethodInflated*)method)->context.method_inst) {
MonoError error;
MonoMethod *result;
MonoMethodInflated *inflated = (MonoMethodInflated*)method;
//method is inflated, we should infla... | false | false | false | false | false | 0 |
snmp_agent_init(oid *myoid, int len, char *name, struct variable *variables,
int varsize, int varlen)
{
log_message(LOG_INFO, "Starting SNMP subagent");
netsnmp_enable_subagent();
snmp_disable_log();
snmp_enable_calllog();
snmp_register_callback(SNMP_CALLBACK_LIBRARY,
SNMP_CALLBACK_LOGGING,
s... | false | false | false | false | false | 0 |
readEntry( const char* key, const QVariantList& aDefault) const
{
Q_ASSERT_X(isValid(), "KConfigGroup::readEntry", "accessing an invalid group");
const QString data = readEntry(key, QString());
if (data.isNull())
return aDefault;
QVariantList value;
foreach(const QString& v, KConfigGroupPr... | false | false | false | false | false | 0 |
schedule_irq(struct vim2m_dev *dev, int msec_timeout)
{
dprintk(dev, "Scheduling a simulated irq\n");
mod_timer(&dev->timer, jiffies + msecs_to_jiffies(msec_timeout));
} | false | false | false | false | false | 0 |
ips_read_subsystem_parameters(ips_ha_t * ha, int intr)
{
ips_scb_t *scb;
int ret;
METHOD_TRACE("ips_read_subsystem_parameters", 1);
scb = &ha->scbs[ha->max_cmds - 1];
ips_init_scb(ha, scb);
scb->timeout = ips_cmd_timeout;
scb->cdb[0] = IPS_CMD_GET_SUBSYS;
scb->cmd.basic_io.op_code = IPS_CMD_GET_SUBSYS;
sc... | false | false | false | false | false | 0 |
cpia2_usb_stream_resume(struct camera_data *cam)
{
int ret = 0;
if(cam->streaming) {
cam->first_image_seen = 0;
ret = set_alternate(cam, cam->params.camera_state.stream_mode);
if(ret == 0) {
/* for some reason the user effects need to be set
again when starting streaming. */
cpia2_do_command(cam, CP... | false | false | false | false | false | 0 |
eventDelete(EVH * func, void *arg)
{
struct ev_entry **E;
struct ev_entry *event;
for (E = &tasks; (event = *E) != NULL; E = &(*E)->next) {
if (event->func != func)
continue;
if (arg && event->arg != arg)
continue;
*E = event->next;
if (NULL != event->arg)
cbdataUnlock(event->arg);
memFr... | false | false | false | false | false | 0 |
try_mark_partial_variable(ir_variable *var,
ir_rvalue *index)
{
const glsl_type *type = var->type;
if (this->shader_stage == MESA_SHADER_GEOMETRY &&
var->data.mode == ir_var_shader_in) {
/* The only geometry shader input that is not an array i... | false | false | false | false | false | 0 |
distmat_getSeq(const AjPSeqset seqset, ajint nseqs, ajint mlen,
ajint incr, ajint posn, ajint* len)
{
ajint i;
ajint j;
ajint count;
AjBool onetwo = ajFalse;
const char* pseqset;
char** pseq;
/* positions 1 & 2 used to score distances */
if(posn == 12)
{
onetwo = ajTrue;... | false | true | false | false | false | 1 |
gameEditComment(Output::CommentType type)
{
QString annotation;
int moves;
int comments;
int nags;
game().moveCount(&moves, &comments, &nags);
if((type == Output::Precomment) || (moves <= 0))
{
annotation = game().annotation(CURRENT_MOVE, Game::BeforeMove);
}
else
{
... | false | false | false | false | false | 0 |
newString8859_1(JNIEnv *env, const char *str)
{
int len = (int)strlen(str);
jchar buf[512];
jchar *str1;
jstring result;
int i;
if (len > 512) {
str1 = (jchar *)malloc(len * sizeof(jchar));
if (str1 == 0) {
JNU_ThrowOutOfMemoryError(env, 0);
return 0;
... | false | false | false | false | false | 0 |
model_draw_bay_paths(int model_num)
{
int idx, s_idx;
vec3d v1, v2;
vertex l1, l2;
polymodel *pm = model_get(model_num);
if(pm == NULL){
return;
}
// render docking bay normals
gr_set_color(0, 255, 0);
for(idx=0; idx<pm->n_docks; idx++){
for(s_idx=0; s_idx<pm->docking_bays[idx].num_slots; s_idx++){
v... | false | false | false | false | false | 0 |
filter_update_dir(void)
{
int i, save_curs_rel;
const char *save_curs_dir;
/* save cursor */
if (panel_dir.pd->cnt) {
save_curs_dir = panel_dir.dir[panel_dir.pd->curs].name;
save_curs_rel = (100 * panel_dir.pd->curs) / panel_dir.pd->cnt; /* % */
}
else {
save_curs_dir = 0;
save_curs_rel = 0;
}
/* appl... | false | false | false | false | false | 0 |
resolve(linked_list_t *hosts, int family, u_int16_t port)
{
enumerator_t *enumerator;
host_t *host = NULL;
bool tried = FALSE;
char *str;
enumerator = hosts->create_enumerator(hosts);
while (enumerator->enumerate(enumerator, &str))
{
host = host_create_from_dns(str, family, port);
if (host)
{
break;
... | false | false | false | false | false | 0 |
check_for_string_raw(const char *pstr)
{
if (!strnicmp(pstr, Mp, strlen(pstr)))
return 1;
return 0;
} | false | false | false | false | false | 0 |
setAllowedActions( unsigned long actions ) {
if( p->role != WindowManager )
return;
long data[50];
int count = 0;
p->allowed_actions = actions;
if (p->allowed_actions & ActionMove) data[count++] = net_wm_action_move;
if (p->allowed_actions & ActionResize) data[count++] = net_wm_action_r... | false | false | false | false | true | 1 |
selectionChanged()
{
m_selected_stats.clear();
if (m_text->textCursor().hasSelection()) {
BlockStats temp(0);
QStringList selection = m_text->textCursor().selectedText().split(QChar::ParagraphSeparator, QString::SkipEmptyParts);
foreach (const QString& string, selection) {
temp.update(string);
m_selected_... | false | false | false | false | false | 0 |
abraca_playlist_view_on_drag_data_receive (AbracaPlaylistView* self, GtkWidget* w, GdkDragContext* ctx, gint x, gint y, GtkSelectionData* sel, guint info, guint time) {
gboolean success;
guint _tmp0_;
GdkDragContext* _tmp25_;
gboolean _tmp26_;
guint _tmp27_;
g_return_if_fail (self != NULL);
g_return_if_fail (w !... | false | false | false | false | false | 0 |
ixgbe_fso(struct ixgbe_ring *tx_ring,
struct ixgbe_tx_buffer *first,
u8 *hdr_len)
{
struct sk_buff *skb = first->skb;
struct fc_frame_header *fh;
u32 vlan_macip_lens;
u32 fcoe_sof_eof = 0;
u32 mss_l4len_idx;
u32 type_tucmd = IXGBE_ADVTXT_TUCMD_FCOE;
u8 sof, eof;
if (skb_is_gso(skb) && (skb_shinfo... | false | false | false | false | false | 0 |
CopyItem(List *dest, List *source, int n)
{
Item *temp;
ConfigWinPacket cfgpkt;
for(temp=source->head;temp!=NULL && temp->count!=n;temp=temp->next);
if (temp==NULL) return;
memcpy(&cfgpkt.flags, &temp->flags, sizeof(cfgpkt.flags));
AddItem(dest, temp->id, &cfgpkt,temp->Desk,temp->count);
UpdateItemName(d... | false | false | false | false | false | 0 |
mload(int32_t order, int32_t awins, int32_t awinf, float speech[], float phi[], float psi[])
{
int32_t start;
int i;
int r;
start = awins + order;
for (r = 1; r <= order; r++)
{
phi[r - 1] = 0.0f;
for (i = start; i <= awinf; i++)
phi[r - 1] += speech[i - 2]*speec... | false | false | false | false | false | 0 |
can_units_do_activity(const struct unit_list *punits,
enum unit_activity activity)
{
/* Make sure nobody uses these old activities any more */
fc_assert_ret_val(activity != ACTIVITY_FORTRESS
&& activity != ACTIVITY_AIRBASE, FALSE);
unit_list_iterate(punits, punit) {
if (can_unit_do_... | false | false | false | false | false | 0 |
php_unescape_html_entities(unsigned char *old, size_t oldlen, size_t *newlen, int all, int flags, char *hint_charset TSRMLS_DC)
{
size_t retlen;
char *ret;
enum entity_charset charset;
const entity_ht *inverse_map = NULL;
size_t new_size = TRAVERSE_FOR_ENTITIES_EXPAND_SIZE(oldlen);
if (all) {
charset = determi... | 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.