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
test_mount(void *user_data, void *reply_data, DBusError *error) { E_Ukit_Get_Property_Return *ret = reply_data; if (!ret || dbus_error_is_set(error)) { free(user_data); dbus_error_free(error); return; } if (ret->val.b) { printf("[%s] is mounted!\n\tGrabbing more...
false
false
false
false
false
0
glp_set_sjj(glp_prob *lp, int j, double sjj) { if (!(1 <= j && j <= lp->n)) xerror("glp_set_sjj: j = %d; column number out of range\n", j); if (sjj <= 0.0) xerror("glp_set_sjj: j = %d; sjj = %g; invalid scale factor\n", j, sjj); if (lp->valid && lp->col[j]->sjj != sjj && lp...
false
false
false
false
false
0
GMT_dist_to_point (double lon, double lat, struct GMT_TABLE *T, GMT_LONG *id) { GMT_LONG i, j; double d, d_min; d_min = DBL_MAX; for (i = 0; i < T->n_segments; i++) { for (j = 0; j < T->segment[i]->n_rows; j++) { d = (*GMT_distance_func) (lon, lat, T->segment[i]->coord[GMT_X][j], T->segment[i]->coord[GMT_Y][j...
false
false
false
false
false
0
test_object_tag_write__overwrite(void) { // Attempt to write a tag bearing the same name than an already existing tag git_oid target_id, tag_id; git_signature *tagger; git_object *target; git_oid_fromstr(&target_id, tagged_commit); cl_git_pass(git_object_lookup(&target, g_repo, &target_id, GIT_OBJ_COMMIT)); ...
false
false
false
false
false
0
JpegLsVerifyEncode(const void* uncompressedData, size_t uncompressedLength, const void* compressedData, size_t compressedLength) { JlsParameters info = JlsParameters(); JLS_ERROR error = JpegLsReadHeader(compressedData, compressedLength, &info); if (error != OK) return error; error = CheckInput(compressedData, ...
false
false
false
false
false
0
movingOnArtefact( GenericLord * movingLord, GenericCell * destCell ) { TRACE("Engine::movingOnArtefact"); GenericEvent * event = destCell->getEvent(); movingLord->getArtefactManager()->addArtefact( event->getArtefact()->getType() ); destCell->setEvent( 0 ); _server->delEvent( _players, event ); _server->ownArtef...
false
false
false
false
false
0
TI_detachAssociation(OFBool abortFlag) { OFCondition cond = EC_Normal; DIC_NODENAME presentationAddress; DIC_AE peerTitle; OFString temp_str; if (assoc == NULL) { return OFTrue; /* nothing to do */ } ASC_getPresentationAddresses(assoc->params, NULL, presentationAddress); ...
false
false
false
false
false
0
APar_Print_APuuid_atoms(const char *path, char* output_path, uint8_t target_information) { AtomicInfo* thisAtom = NULL; printBOM(); AtomicInfo* metaAtom = APar_FindAtom("moov.udta.meta", false, VERSIONED_ATOM, 0); if (metaAtom == NULL) return; for (int i=metaAtom->NextAtomNumber; i < atom_number; i++) { th...
false
false
false
false
false
0
static_initialize() { using namespace IPSummaryDump; for (size_t i = 0; i < sizeof(anno_writers) / sizeof(anno_writers[0]); ++i) FieldWriter::add(&anno_writers[i]); for (size_t i = 0; i < sizeof(anno_readers) / sizeof(anno_readers[0]); ++i) FieldReader::add(&anno_readers[i]); for (size_t i = 0; i < si...
false
false
false
false
false
0
init_port_mtus(struct adapter *adapter) { unsigned int mtus = adapter->port[0]->mtu; if (adapter->port[1]) mtus |= adapter->port[1]->mtu << 16; t3_write_reg(adapter, A_TP_MTU_PORT_TABLE, mtus); }
false
false
false
false
false
0
knh_NameSpace_newObject(CTX ctx, kNameSpace *ns, kString *path, kclass_t tcid) { if(tcid == CLASS_String) return UPCAST(path); const knh_ClassTBL_t *ct = knh_NameSpace_getLinkClassTBLNULL(ctx, ns, S_tobytes(path), tcid); Object *value = NULL; if(ct == NULL) { if(tcid == CLASS_Boolean) return KNH_FALSE; LANG_LOG...
false
false
false
false
false
0
getNofBoundaries(int layer, elementType type) { if (!checkLayerIndex(layer)) return 0; switch (type) { case INNER_ELEMENT: return nofInnerBoundaries[layer]; break; case OUTER_ELEMENT: return nofOuterBoundaries[layer]; break; default: return nofInnerBoundaries[layer] + nofOuterBoundaries[l...
false
false
false
false
false
0
range(string_ty *line, int *b1, int *b2, int *a1, int *a2) { const char *cp; // // The lines are of the form // @@ -N[,N] +N[,N] @@ // // The first pair of numbers is a start line and a line count // (the count defaults to 1 if not given) of the first file, // the second pair of nu...
false
false
false
false
true
1
__lambda13_ (Block7Data* _data7_) { Profile * self; GVariant* _tmp0_ = NULL; GVariant* _tmp1_ = NULL; gboolean _tmp2_ = FALSE; GVariant* _tmp3_ = NULL; GVariant* _tmp4_ = NULL; self = _data7_->self; _tmp0_ = g_action_get_state ((GAction*) _data7_->action); _tmp1_ = _tmp0_; _tmp2_ = g_variant_get_boolean (_tmp...
false
false
false
false
false
0
reglist_check_for_const (int *list, const DATASET *dset) { int cpos = gretl_list_const_pos(list, 2, dset); int ret = 0; if (cpos > 1) { ret = 1; } if (cpos > 2) { reglist_move_const(list, cpos); } return ret; }
false
false
false
false
false
0
e_map_world_to_window (EMap *map, gdouble world_longitude, gdouble world_latitude, gdouble *win_x, gdouble *win_y) { g_return_if_fail (E_IS_MAP (map)); g_return_if_fail (gtk_widget_get_realized (GTK_WIDGET (map))); g_return_i...
false
false
false
false
false
0
add_space(struct ntb_buffer *buffer) { if (buffer->length == 0 || buffer->data[buffer->length - 1] != ' ') ntb_buffer_append_c(buffer, ' '); }
false
false
false
false
false
0
GDALRegenerateCascadingOverviews( GDALRasterBand *poSrcBand, int nOverviews, GDALRasterBand **papoOvrBands, const char * pszResampling, GDALProgressFunc pfnProgress, void * pProgressData ) { /* -------------------------------------------------------------------- */ /* First, we must put the overvie...
false
false
false
false
false
0
obj_migdata_get_src_digest(TSS_HMIGDATA hMigData, UINT32 *digestSize, BYTE **digest) { struct tsp_object *obj; struct tr_migdata_obj *migdata; TSS_RESULT result = TSS_SUCCESS; if ((obj = obj_list_get_obj(&migdata_list, hMigData)) == NULL) return TSPERR(TSS_E_INVALID_HANDLE); migdata = (struct tr_migdata_obj *)...
false
false
false
false
false
0
fuse_resolve_entry_simple (fuse_state_t *state) { fuse_resolve_t *resolve = NULL; inode_t *parent = NULL; inode_t *inode = NULL; int ret = 0; resolve = state->resolve_now; parent = inode_find (state->itable, resolve->pargfid); ...
false
false
false
false
false
0
child_main(struct crut_pipes *pipes) { pid_t child; int rc; (void)cr_init(); (void)cr_register_callback(my_signal_callback, NULL, CR_SIGNAL_CONTEXT); (void)cr_register_callback(my_thread_callback, NULL, CR_THREAD_CONTEXT); printf("000 First process started with pid %d\n", getpid()); pr...
false
false
false
false
false
0
queue_stats_show(int fd) { struct queue *this; int size = 0; char buf[512]; size += snprintf(buf+size, sizeof(buf), "allocated queue nodes:\t\t%12u\n\n", qobjects_num); list_for_each_entry(this, &queue_list, list) { size += snprintf(buf+size, sizeof(buf), "queue %s:\n" "current elements:\t\t%...
false
false
false
false
false
0
string_list_add(StringList* list, const char* new_string, int flag) { struct string_node* node; struct string_node* prev; struct string_node* next; if(new_string == NULL) return 0; next = list->head; prev = NULL; while(next != NULL && strcmp(next->string, new_string) < 0) { prev = next; next = next-...
false
false
false
false
false
0
ttm_bo_wait(struct ttm_buffer_object *bo, bool lazy, bool interruptible, bool no_wait) { struct reservation_object_list *fobj; struct reservation_object *resv; struct fence *excl; long timeout = 15 * HZ; int i; resv = bo->resv; fobj = reservation_object_get_list(resv); excl = reservation_object_get_excl(resv...
false
false
false
false
false
0
print_comma(json_formatter_stack_entry_d& entry) { if (entry.size) { if (m_pretty) { m_ss << ",\n"; for (unsigned i=1; i < m_stack.size(); i++) m_ss << " "; } else { m_ss << ","; } } else if (entry.is_array && m_pretty) { m_ss << "\n"; for (unsigned i=1; i < m_stack.size();...
false
false
false
false
false
0
rgbaImageFree(RgbaImageT *self) { if(self->ri != NULL) { FREE(self->ri); self->ri = NULL; self->gi = NULL; self->bi = NULL; self->ai = NULL; self->nrows = 0; self->ncols = 0; } }
false
false
false
false
false
0
go_combo_box_dispose (GObject *obj) { GOComboBox *combo_box = GO_COMBO_BOX (obj); if (combo_box->priv->toplevel) { gtk_widget_destroy (combo_box->priv->toplevel); g_object_unref (combo_box->priv->toplevel); combo_box->priv->toplevel = NULL; } if (combo_box->priv->tearoff_window) { gtk_widget_destroy (comb...
false
false
false
false
false
0
repo_init_structure(repo_init *results) { const int mode = 0755; /* or 0777 ? */ int error; char temp_path[GIT_PATH_MAX]; char *git_dir = results->path_repository; if (gitfo_mkdir_recurs(git_dir, mode)) return GIT_ERROR; /* Creates the '/objects/info/' directory */ git__joinpath(temp_path, git_dir, GIT_OBJE...
false
false
false
false
false
0
xmlSecNssSymKeyDataGenerate(xmlSecKeyDataPtr data, xmlSecSize sizeBits, xmlSecKeyDataType type ATTRIBUTE_UNUSED) { PK11SymKey* symkey ; PK11SlotInfo* slot ; xmlSecNssSymKeyDataCtxPtr ctx; int ret; xmlSecAssert2(xmlSecNssSymKeyDataCheckId(data), -1); xmlSecAssert2(sizeBits > 0, -1); ctx = x...
false
false
false
false
false
0
GrowRaces(ARegionArray *pArr) { Awrite("Growing Races"); RaceAnchors(pArr); int a, x, y; for(a = 0; a < 25; a++) { for(x = 0; x < pArr->x; x++) { for(y = 0; y < pArr->y; y++) { ARegion *reg = pArr->GetRegion(x, y); if((!reg) || (reg->race == -1)) continue; for(int dir = 0; dir < NDIRS; dir++) { ...
false
false
false
false
false
0
isUnresolvedLepton() { // Require record to consist of lepton with full energy plus a photon. if (!isLeptonBeam || resolved.size() > 2 || resolved[1].id() != 22 || resolved[0].x() < XMINUNRESOLVED) return false; return true; }
false
false
false
false
false
0
url_check_line (char *buf, int len) { GRegex *re(void); GMatchInfo *gmi; char *po = buf; int i; /* Skip over message prefix */ if (*po == ':') { po = strchr (po, ' '); if (!po) return; po++; } /* Allow only commands from the above list */ for (i = 0; i < ARRAY_SIZE (commands); i++) { char *cmd = ...
false
false
false
false
false
0
test_config_stress__initialize(void) { git_filebuf file = GIT_FILEBUF_INIT; cl_git_pass(git_filebuf_open(&file, "git-test-config", 0)); git_filebuf_printf(&file, "[color]\n\tui = auto\n"); git_filebuf_printf(&file, "[core]\n\teditor = \n"); cl_git_pass(git_filebuf_commit(&file, 0666)); }
false
false
false
false
false
0
python_populate_vptuple(PyObject *pPair, VALUE_PAIR *vp) { PyObject *pStr = NULL; char buf[1024]; /* Look at the vp_print_name? */ if (vp->flags.has_tag) pStr = PyString_FromFormat("%s:%d", vp->name, vp->flags.tag); else pStr = PyString_FromString(vp->name); if (pStr == NULL) goto failed; PyTuple_S...
true
true
false
false
true
1
UnsummonMajordomoAdds() { for (GuidList::const_iterator itr = m_luiMajordomoAddsGUIDs.begin(); itr != m_luiMajordomoAddsGUIDs.end(); ++itr) { if (Creature* pAdd = m_creature->GetMap()->GetCreature(*itr)) if (pAdd->IsTemporarySummon()) { ...
false
false
false
false
false
0
rb_cvar_set(klass, id, val, warn) VALUE klass; ID id; VALUE val; int warn; { VALUE tmp; tmp = klass; while (tmp) { if (RCLASS(tmp)->iv_tbl && st_lookup(RCLASS(tmp)->iv_tbl,id,0)) { if (OBJ_FROZEN(tmp)) rb_error_frozen("class/module"); if (!OBJ_TAINTED(tmp) && rb_safe_level() >= 4...
false
false
false
false
false
0
icalcomponent_get_span(icalcomponent* comp) { icalcomponent *inner; icalcomponent_kind kind; icaltime_span span; struct icaltimetype start, end; span.start = 0; span.end = 0; span.is_busy= 1; /* initial Error checking */ if (comp == NULL) { return span; } /* FIXME this mi...
false
false
false
false
false
0
H5MF_alloc_start(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type) { herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. */ HDassert(f); HDassert(f->shared); HDassert(type != H5FD_MEM_NOLIST); /* Check if the free space manager exists alr...
false
false
false
false
false
0
e_name_selector_entry_ref_client_cache (ENameSelectorEntry *name_selector_entry) { g_return_val_if_fail ( E_IS_NAME_SELECTOR_ENTRY (name_selector_entry), NULL); if (name_selector_entry->priv->client_cache == NULL) return NULL; return g_object_ref (name_selector_entry->priv->client_cache); }
false
false
false
false
false
0
loadDefaults () { if (defaultsLoaded) return; defaultsLoaded = gTrue; Dict *dict = obj.getDict(); Object obj1; if (Form::fieldLookup(dict, "V", &obj1)->isString()) { if (obj1.getString()->hasUnicodeMarker()) { if (obj1.getString()->getLength() <= 2) { } else { parent->setContent...
false
false
false
false
false
0
base64_encode (char *out, const byte * in, size_t len, size_t olen) { if (!out || !in) { gnutls_assert (); return CDK_Inv_Value; } while (len >= 3 && olen > 10) { *out++ = b64chars[in[0] >> 2]; *out++ = b64chars[((in[0] << 4) & 0x30) | (in[1] >> 4)]; *out++ = b64chars[((in...
false
false
false
false
false
0
gf_media_hevc_slice_is_IDR(HEVCState *hevc) { if (hevc->sei.recovery_point.valid) { hevc->sei.recovery_point.valid = 0; return 1; } switch (hevc->s_info.nal_unit_type) { case GF_HEVC_NALU_SLICE_IDR_W_DLP: case GF_HEVC_NALU_SLICE_IDR_N_LP: return 1; default: return 0; } }
false
false
false
false
false
0
sig_agp_bus_map( struct sig_agp_bus_main *b, void *s, unsigned long pa, unsigned int len, char **haddr_mr_p, char **haddr_mw_p ) { unsigned int nr; int (*func)(void *, unsigned long, unsigned int, char **, char **); for (nr = 0; ; nr++) { if (nr == b->member_count) { return 1; } if (! b->member[nr].f...
false
false
false
false
false
0
pdp_store(const pdp_ctx_t *ctx, const pdp_key_t *key, const pdp_tag_t *tag) { int err; if (!ctx || !tag) return -1; // algo specific storage logic switch(ctx->algo) { case PDP_MACPDP: err = macpdp_store(ctx, tag->macpdp); break; case PDP_APDP: ...
false
false
false
false
false
0
EVP_PKEY_asn1_find(ENGINE **pe, int type) { const EVP_PKEY_ASN1_METHOD *t; for (;;) { t = pkey_asn1_find(type); if (!t || !(t->pkey_flags & ASN1_PKEY_ALIAS)) break; type = t->pkey_base_id; } if (pe) { #ifndef OPENSSL_NO_ENGINE ENGINE *e; /* type will contain the final unaliased type */ e = ENG...
false
false
false
false
false
0
loadEntry( const Entry &entry ) { mModel->setStringList( entry.values( "alias" ) ); mDn = entry.id(); }
false
false
false
false
false
0
zxid_mk_logout(zxid_conf* cf, zxid_nid* nid, struct zx_str* ses_ix, zxid_entity* idp_meta) { struct zx_sp_LogoutRequest_s* r = zx_NEW_sp_LogoutRequest(cf->ctx,0); r->Issuer = zxid_my_issuer(cf, &r->gg); r->ID = zxid_mk_id_attr(cf, &r->gg, zx_ID_ATTR, "L", ZXID_ID_BITS); r->Version = zx_ref_attr(cf->ctx, &r->gg,...
false
false
false
false
false
0
SetPathname(const std::string& pathname) { std::string::size_type pos = pathname.find_last_of(FOLDER_DELIMS); if (pos != std::string::npos) { SetFolder(pathname.substr(0, pos + 1)); SetFilename(pathname.substr(pos + 1)); } else { SetFolder(EMPTY_STR); SetFilename(pathname); } }
false
false
false
false
false
0
move_contact(const char *group, struct contact *c) { grouplist *g = c->group; struct contact *con; LList *l = c->accounts; if (!strcasecmp(g->name, group)) return; g->members = l_list_remove(g->members, c); remove_contact_line(c); g = find_grouplist_by_name(group); if (!g) { add_group(group); g = find_...
false
false
false
false
false
0
inet6_opt_finish (void *extbuf, socklen_t extlen, int offset) { /* Check minimum offset. */ if (offset < sizeof (struct ip6_hbh)) return -1; /* Required padding at the end. */ int npad = (8 - (offset & 7)) & 7; if (extbuf != NULL) { /* Make sure the buffer is large enough. */ if (offs...
false
false
false
false
false
0
browser_ignores_acceptcharset() { char *p = NULL; char *browzer = NULL; int i; if ( gc->gc_clientIgnoreACharset == NULL || gc->gc_clientIgnoreACharset[0] == NULL ) return 0; /* Get the browser name */ if (( p = getenv( "HTTP_USER_AGENT" )) == NULL ) { return 0; } browzer = dsgw_ch_strdu...
false
false
false
false
true
1
ConditionalXactLockTableWait(TransactionId xid) { LOCKTAG tag; for (;;) { Assert(TransactionIdIsValid(xid)); Assert(!TransactionIdEquals(xid, GetTopTransactionId())); SET_LOCKTAG_TRANSACTION(tag, xid); if (LockAcquire(&tag, ShareLock, false, true) == LOCKACQUIRE_NOT_AVAIL) return false; LockRelease...
false
false
false
false
false
0
find_line_by_instance(struct skinny_device *d, int instance) { struct skinny_line *l; /*Dialing from on hook or on a 7920 uses instance 0 in requests but we need to start looking at instance 1 */ if (!instance) instance = 1; AST_LIST_TRAVERSE(&d->lines, l, list){ if (l->instance == instance) break; } ...
false
false
false
false
false
0
GetEncrypted() { bool res = false; #if DCLIB_HAS_SSL == 1 if ( GetSocketMode() == esmSOCKET ) { res = false; } else { res = true; } #endif return res; }
false
false
false
false
false
0
pdatacnt_print(register const u_char * pptr, register u_int len, u_int32_t IDcnt, u_int16_t op_msk, int indent) { u_int i; int rc; u_int32_t id; char *ib = indent_pr(indent, 0); for (i = 0; i < IDcnt; i++) { TCHECK2(*pptr, 4); if (len < 4) goto trunc; id = EXTRACT_32BITS(pptr); if (vflag >= 3) ...
false
false
false
false
false
0
SetXMin(double x, double y, double z) { vtkDebugMacro(<< this->GetClassName() << " (" << this << "): setting XMin to (" << x << "," << y << "," << z << ")"); const double *p = this->BBox->GetMinPoint(); if ((p[0] == x) && (p[1] == y) && (p[2] == z)) { return; } th...
false
false
false
false
false
0
perf_tp_event(u64 addr, u64 count, void *record, int entry_size, struct pt_regs *regs, struct hlist_head *head, int rctx, struct task_struct *task) { struct perf_sample_data data; struct perf_event *event; struct perf_raw_record raw = { .size = entry_size, .data = record, }; perf_sample_data_init(&...
false
false
false
false
false
0
GotoBookmark(const char *Name) { vector_iterate(EBookmark*, BMarks, it) if ((*it)->IsName(Name)) return CenterNearPosR((*it)->GetPoint().Col, (*it)->GetPoint().Row); View->MView->Win->Choice(GPC_ERROR, "GotoBookmark", 1, "O&K", "Bookmark %s not found.", Name); return 0; }
false
false
false
false
false
0
xpmUngetC(int c, LexerData *lexer) #else static int xpmUngetC(c, lexer) int c; LexerData *lexer; #endif { switch (lexer->type) { case XPMARRAY: case XPMSTRING: return (*--lexer->cptr); case XPMFILE: case XPMPIPE: if (lexer->Bos && (c == lexer->Bos || c == lexer->Eos)) /* if not natural XPM2 *...
false
false
false
false
false
0
scs_write_callback(struct fw_card *card, int rcode, void *data, size_t length, void *callback_data) { struct scs *scs = callback_data; if (rcode == RCODE_GENERATION) { /* TODO: retry this packet */ } scs->transaction_running = false; tasklet_schedule(&scs->tasklet); }
false
false
false
false
false
0
caml_final_do_strong_roots (scanning_action f) { uintnat i; struct to_do *todo; Assert (old == young); for (i = 0; i < old; i++) Call_action (f, final_table[i].fun); for (todo = to_do_hd; todo != NULL; todo = todo->next){ for (i = 0; i < todo->size; i++){ Call_action (f, todo->item[i].fun); ...
false
false
false
false
false
0
process_defend_town_back_town() { int clearDefenseMode = 0; if(action_mode!=ACTION_ASSIGN_TO_TOWN) // the unit may become idle or unable to reach town, reactivate it { Town *townPtr; if(action_misc!=ACTION_MISC_DEFEND_TOWN_RECNO || !action_misc_para || town_array.is_deleted(action_misc_para)) clearDefenseMode...
false
false
false
false
false
0
acdHelpTableShow(const AjPList tablist, const char* title) { AcdPTableItem item; AjIList iter = NULL; ajuint nitem = 0; if(!acdDoTable) return; if(!tablist) { ajUserDumpC("<tr bgcolor=\"#FFFFCC\">"); /* was #FFFFD0 */ ajUserDumpC("<th align=\"left\">Qualifier</th>"); a...
false
false
false
false
false
0
tsc_irq_fn(int irq, void *dev_id) { struct imx6ul_tsc *tsc = dev_id; int status; int value; int x, y; int start; status = readl(tsc->tsc_regs + REG_TSC_INT_STATUS); /* write 1 to clear the bit measure-signal */ writel(MEASURE_SIGNAL | DETECT_SIGNAL, tsc->tsc_regs + REG_TSC_INT_STATUS); /* It's a HW self-c...
false
false
false
false
false
0
is_prime (uint32_t in) { if (in < 12) { // need this buffer as "lim" (below) may // underflow return (in <= 3 || in == 5 || in == 7 || in == 11); } // filter out half the results by checking if the number is even if ((in ^ 1) & 1) return FALSE; uint32_t i; uint32_t lim = (uint32_t) floor (sqrt...
false
false
false
false
false
0
invoke_error_quark (GModule *self, const char *symbol, GError **error) { ErrorQuarkFunc sym; if (!g_module_symbol (self, symbol, (void**)&sym)) { g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, "Failed to find symbol '%s'", symbol); return G_TYPE_INVALID; } return sym (); }
false
false
false
false
false
0
slurm_cred_ctx_key_update(slurm_cred_ctx_t ctx, const char *path) { if (_slurm_crypto_init() < 0) return SLURM_ERROR; if (ctx->type == SLURM_CRED_CREATOR) return _ctx_update_private_key(ctx, path); else return _ctx_update_public_key(ctx, path); }
false
false
false
false
false
0
file_close(struct file *file) { int saved_errno = errno; int r = close(file->fd); FILETRACE(file, r, "close(\"%s\")", file->pathname); free(file->pathname); free(file); errno = saved_errno; }
false
false
false
false
false
0
ButtonStateAndShadow(int button_state, GtkStateType &state, GtkShadowType &shadow) { if (button_state & wxAUI_BUTTON_STATE_DISABLED) { state = GTK_STATE_INSENSITIVE; shadow = GTK_SHADOW_ETCHED_IN; } else if (button_state & wxAUI_BUTTON_STATE_HOVER) { state = GTK_STATE_PRELIG...
false
false
false
false
false
0
nvkm_i2c_aux_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num) { struct nvkm_i2c_aux *aux = container_of(adap, typeof(*aux), i2c); struct i2c_msg *msg = msgs; int ret, mcnt = num; ret = nvkm_i2c_aux_acquire(aux); if (ret) return ret; while (mcnt--) { u8 remaining = msg->len; u8 *ptr = msg-...
false
false
false
false
false
0
net_get_transport_name_from_netdev(char *netdev, char *transport) { struct ethtool_drvinfo drvinfo; struct ifreq ifr; int err, fd, i; memset(&ifr, 0, sizeof(ifr)); strcpy(ifr.ifr_name, netdev); fd = socket(AF_INET, SOCK_DGRAM, 0); if (fd < 0) { log_error("Could not open socket for ioctl."); return errno; ...
false
false
false
false
false
0
fsl_spi_qe_cpu_set_shifts(u32 *rx_shift, u32 *tx_shift, int bits_per_word, int msb_first) { *rx_shift = 0; *tx_shift = 0; if (msb_first) { if (bits_per_word <= 8) { *rx_shift = 16; *tx_shift = 24; } else if (bits_per_word <= 16) { *rx_shift = 16; *tx_shift = 16; } } else { if (bits_per...
false
false
false
false
false
0
scan(int nPages) { GooList *result; Page *page; Dict *resDict; Annots *annots; Object obj1, obj2; int lastPage; if (currentPage > doc->getNumPages()) { return NULL; } result = new GooList(); lastPage = currentPage + nPages; if (lastPage > doc->getNumPages() + 1) { lastPage = doc->getNu...
false
false
false
false
false
0
ds9490r_search(void *data, struct w1_master *master, u8 search_type, w1_slave_found_callback callback) { /* When starting with an existing id, the first id returned will * be that device (if it is still on the bus most likely). * * If the number of devices found is less than or equal to the * search_limit, th...
false
false
false
false
false
0
SortTid(const PROC * proc1, const PROC * proc2) { if ((proc1->tid == NO_THREAD_ID) && (proc2->tid != NO_THREAD_ID)) return -1; if ((proc1->tid != NO_THREAD_ID) && (proc2->tid == NO_THREAD_ID)) return 1; if ((proc1->tid == proc1->pid) && (proc2->tid != proc2->pid)) return -1; if ((proc1->tid != proc1->pid) ...
false
false
false
false
false
0
smug_login(struct session *session) { char url[500]; struct smug_curl_buffer *curl_buf; CURL *curl = NULL; CURLcode res; int retval; if (!session) return -EINVAL; curl_buf = smug_curl_buffer_alloc(); if (!curl_buf) return -ENOMEM; curl = curl_init(); if (!curl) return -EINVAL; sprintf(url, smugmug_...
false
false
false
false
false
0
find_next_free_scb (struct snd_cs46xx * chip, struct dsp_scb_descriptor * from) { struct dsp_spos_instance * ins = chip->dsp_spos_instance; struct dsp_scb_descriptor * scb = from; while (scb->next_scb_ptr != ins->the_null_scb) { if (snd_BUG_ON(!scb->next_scb_ptr)) return NULL; scb = scb->next_scb_ptr; } ...
false
false
false
false
false
0
floodfill(int x, int y) { // shouldn't need to check bounds because we're only painting in the // middle. //if (x<0 || y<0 || x>WIDTH || y>HEIGHT) //{ // fprintf(stderr,"That shouldn't have happened! (%d,%d)\n",x,y); // exit(1); //} if (grid[x][y]==' ' || grid[x][y]=='1' || grid[x][y]=='2' || grid[x][y]=='w') ...
false
false
false
false
false
0
setNeedsWidgetMasks( bool b ) { if (b == m_needsWidgetMasks) return; m_needsWidgetMasks = b; KHTMLWidget* k = dynamic_cast<KHTMLWidget*>(m_view); // ### should be reversible if (k && b && k->m_kwp->isRedirected()) { k->m_kwp->setIsRedirected(!b); if (k->m_kwp->renderWidget()...
false
false
false
false
false
0
make_gold(object_type *j_ptr, int lev, int coin_type) { int sval; int k_idx; /* This average is 20 at dlev0, 105 at dlev40, 220 at dlev100. */ /* Follows the formula: y=2x+20 */ s32b avg = 2*lev + 20; s32b spread = lev + 10; s32b value = rand_spread(avg, spread); /* Increase variance to infinity, retain same ...
false
false
false
false
false
0
_reset_step_bitmaps(struct job_record *job_ptr) { ListIterator step_iterator; struct step_record *step_ptr; step_iterator = list_iterator_create (job_ptr->step_list); while ((step_ptr = (struct step_record *) list_next (step_iterator))) { if (step_ptr->state < JOB_RUNNING) continue; FREE_NULL_BITMAP(step_pt...
false
false
false
false
false
0
ajMartSetReghostS(AjPSeqin seqin, const AjPStr reghost) { if(ajMartSetReghostC(seqin,reghost->Ptr)) return ajTrue; return ajFalse; }
false
false
false
false
false
0
gtt_ghtml_show_links (GttGhtml *p, gboolean sl) { if (!p) return; p->really_hide_links = (FALSE == sl); p->show_links = sl; }
false
false
false
false
false
0
_ds_pref_load( config_t config, const char *user, const char *home, void *dbh) { agent_pref_t (*ptr)(config_t, const char *, const char *, void *); ptr = (agent_pref_t (*)(config_t, const char *, const char *, void *))(intptr_t)dlsym(_drv_handle, "_ds_pref_load"); if (!ptr) { LOG(LOG_CRIT, "dlsym(_ds_pr...
false
false
false
false
false
0
x509_write_extension( unsigned char **p, unsigned char *start, asn1_named_data *ext ) { int ret; size_t len = 0; ASN1_CHK_ADD( len, asn1_write_raw_buffer( p, start, ext->val.p + 1, ext->val.len - 1 ) ); ASN1_CHK_ADD( len, as...
false
false
false
false
false
0
setVectorComponentValue(int component, double val) { ASSERT(this->getDimensions() == 1); ASSERT(this->dim_sizes[0] >= component); this->scalars[component-1] = val; if (this->strval) { delete this->strval; this->strval = NULL; } return TRUE; }
false
false
false
false
false
0
need_colormod(register imlib_t *iml) { if (MOD_IS_SET(iml->mod) || MOD_IS_SET(iml->rmod) || MOD_IS_SET(iml->gmod) || MOD_IS_SET(iml->bmod)) { D_PIXMAP(("Color modifier active.\n")); return 1; } else { D_PIXMAP(("No color modifier active.\n")); return 0; } }
false
false
false
false
false
0
mca_coll_ml_collective_operation_progress_construct (mca_coll_ml_collective_operation_progress_t *desc) { /* initialize pointer */ desc->dag_description.status_array = NULL; OBJ_CONSTRUCT(&desc->full_message.send_convertor, opal_convertor_t); OBJ_CONSTRUCT(&desc->full_message.recv_convertor, opal_conv...
false
false
false
false
false
0
holtek_mouse_report_fixup(struct hid_device *hdev, __u8 *rdesc, unsigned int *rsize) { struct usb_interface *intf = to_usb_interface(hdev->dev.parent); if (intf->cur_altsetting->desc.bInterfaceNumber == 1) { /* Change usage maximum and logical maximum from 0x7fff to * 0x2fff, so they don't exceed HID_MAX_USAG...
false
false
false
false
false
0
stds_get(int fd) { if (options[OptGetStandard]) { if (doioctl(fd, VIDIOC_G_STD, &standard) == 0) { printf("Video Standard = 0x%08llx\n", (unsigned long long)standard); print_v4lstd((unsigned long long)standard); } } if (options[OptGetDvTimings]) { if (doioctl(fd, VIDIOC_G_DV_TIMINGS, &dv_timings) >= 0) ...
false
false
false
false
false
0
gst_aac_parse_get_sample_rate_from_index (guint sr_idx) { static const guint aac_sample_rates[] = { 96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000 }; if (sr_idx < G_N_ELEMENTS (aac_sample_rates)) return aac_sample_rates[sr_idx]; GST_WARNING ("Invalid sample rate index...
false
false
false
false
false
0
attach(ColorButton *cb, const char *sample) { string s; s=sample; colors.push_back(cb); examples.push_back(s); cb->hookNotify(this); if (!frozen) update(); else pending=true; }
false
false
false
false
false
0
gcm_inspect_show_profile_for_window (guint xid) { gboolean ret = FALSE; GDBusConnection *connection; GError *error = NULL; const gchar *profile; GVariant *args = NULL; GVariant *response = NULL; GVariant *response_child = NULL; GVariantIter *iter = NULL; /* get a session bus connection */ connection = g_bus_...
false
false
false
false
false
0
cache_check_entry(gpointer key, gpointer value, gpointer user_data) { struct cache_timeout *data = user_data; struct cache_entry *entry = value; int max_timeout; /* Scale the number of hits by half as part of cache aging */ entry->hits /= 2; /* * If either IPv4 or IPv6 cached entry has expired, we * r...
false
false
false
false
false
0
print()const { printf("j=["); for(int i= 0;i<prodq->dimen();i++) printf("%2d ",(*jseq)[i]); printf("] %+4.3f*(",w); for(int i= 0;i<prodq->dimen()-1;i++) printf("%+4.3f ",(*p)[i]); printf("%+4.3f)\n",(*p)[prodq->dimen()-1]); }
false
false
false
false
false
0
normF( PTreeNode *pt, ObjStruct *os, int numInputs, Pointer *inputs, Pointer result, InvalidComponentHandle *invalids, InvalidComponentHandle outInvalid) { register float *out = (float *) result; register float *in0 = (float *) inputs[0]; register double mag; int vectorLen ...
false
false
false
false
false
0
Crossfire_Object_GetOutOfMap(Crossfire_Object *who, PyObject *args) { int x, y; EXISTCHECK(who); if (!PyArg_ParseTuple(args, "ii", &x, &y)) return NULL; return Py_BuildValue("i", cf_object_out_of_map(who->obj, x, y)); }
false
false
false
false
false
0
clearList() { _clearList(); UT_VECTOR_PURGEALL(fl_TabStop *, m_tabInfo); }
false
false
false
false
false
0
build_binop (GnmExpr *l, GnmExprOp op, GnmExpr *r) { if (!l || !r) return NULL; unregister_allocation (r); unregister_allocation (l); return register_expr_allocation (gnm_expr_new_binary (l, op, r)); }
false
false
false
false
false
0
standardize() { if (second >= 60) { minute += second / 60; second %= 60; } if (minute >= 60) { hour += minute / 60; minute %= 60; } if (hour >= 24) { day += hour / 24; hour %= 24; } int tmpseason = int(season); if (day >= DAYS_IN_SEASON) { tmpseason += day / DAYS_IN_SEASON; day %= DAYS_IN_SEASON...
false
false
false
false
false
0