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
afs_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags) { struct afs_vnode *vnode; struct afs_fid fid; struct inode *inode; struct key *key; int ret; vnode = AFS_FS_I(dir); _enter("{%x:%u},%p{%pd},", vnode->fid.vid, vnode->fid.vnode, dentry, dentry); ASSERTCMP(d_inode(dentry), =...
false
false
false
false
false
0
on_error_event (BaconVideoWidget *bvw, char *message, gboolean playback_stopped, TotemObject *totem) { /* Clear the seek if it's there, we only want to try and seek * the first file, even if it's not there */ totem->seek_to = 0; totem->seek_to_start = 0; if (playback_stopped) play_pause_set_lab...
false
false
false
false
false
0
parse_start_tiametainfo(struct parsingdata* data) { struct tia_eegdev* tdev = data->tdev; unsigned int i; for (i=0; i<TIA_NUM_SIG; i++) tdev->offset[i] = -1; }
false
false
false
false
false
0
readEntryUntranslated(const char *key, const QString& aDefault) const { Q_ASSERT_X(isValid(), "KConfigGroup::readEntryUntranslated", "accessing an invalid group"); QString result = config()->d_func()->lookupData(d->fullName(), key, KEntryMap::SearchFlags(), 0); if (result.isNull()) return aDefault;...
false
false
false
false
false
0
read_line(char* buf, size_t size, FILE* file) { unsigned pos = 0; size--; while (pos < size) { int c = fgetc(file); if (c == EOF) { if (pos == 0) return 0; // no new line available EOF break; } if (c == '\n') break; // we have line if (c != '\r') buf[pos++] = (char)c; ...
false
true
false
false
true
1
Parse_Command(const wxString& buffer) { wxString cmd; wxStringTokenizer tokens(buffer); while (tokens.HasMoreTokens()) { cmd += tokens.GetNextToken() + wxT(' '); } cmd.Trim(false); cmd.Trim(true); int cmd_ID = GetIDFromString(cmd); if ( cmd_ID >= 0 ) { cmd_ID = ProcessCommand(cmd_ID); } wxString error; s...
false
false
false
false
false
0
finish_function_handler_sequence (tree try_block) { in_function_try_handler = 0; RECHAIN_STMTS (try_block, TRY_HANDLERS (try_block)); check_handlers (TRY_HANDLERS (try_block)); }
false
false
false
false
true
1
fuse_inode_needs_lookup (inode_t *inode, xlator_t *this) { uint64_t need_lookup = 0; gf_boolean_t ret = _gf_false; if (!inode || !this) return ret; inode_ctx_get (inode, this, &need_lookup); if (need_lookup) ret = _gf_true; need_lookup = 0; inode_ctx_set (inode, this, &need_lookup); return ...
false
false
false
false
false
0
RasterizeGridPoint(RNScalar x, RNScalar y, RNScalar value) { // Check if within bounds if ((x < 0) || (x > grid_resolution[0]-1)) return; if ((y < 0) || (y > grid_resolution[1]-1)) return; // Bilinear interpolation int ix1 = (int) x; int iy1 = (int) y; int ix2 = ix1 + 1; int iy2 = iy1 + 1; ...
false
false
false
false
false
0
control_socket(char *path) { int s; struct sockaddr_un sun; if ((s = socket(AF_LOCAL, SOCK_STREAM, 0)) < 0) { plog_error(LOG_ERR, MODULE, "socket() failed"); return -1; } SUNSET(&sun, path); unlink(path); if (bind(s, (SA *) &sun, sizeof(sun)) < 0) { plog_error(LOG_...
false
false
false
false
false
0
expand_to_length(int len){ if (len > ref_len){ char *ref2 = (char *)GB_calloc(sizeof(char),len+1); if (reference) { strcpy(ref2,reference); free(reference); } reference = ref2; ref_len = len; } }
false
false
false
false
false
0
i965_setup_backlight(struct intel_connector *connector, enum pipe unused) { struct drm_i915_private *dev_priv = to_i915(connector->base.dev); struct intel_panel *panel = &connector->panel; u32 ctl, ctl2, val; ctl2 = I915_READ(BLC_PWM_CTL2); panel->backlight.combination_mode = ctl2 & BLM_COMBINATION_MODE; panel->...
false
false
false
false
false
0
get_building_for_effect(enum effect_type effect_type) { improvement_iterate(pImprove) { if (building_has_effect(pImprove, effect_type)) return pImprove; } improvement_iterate_end; return NULL; }
false
false
false
false
false
0
core_alua_update_tpg_secondary_metadata(struct se_lun *lun) { struct se_portal_group *se_tpg = lun->lun_tpg; unsigned char *md_buf; char path[ALUA_METADATA_PATH_LEN], wwn[ALUA_SECONDARY_METADATA_WWN_LEN]; int len, rc; mutex_lock(&lun->lun_tg_pt_md_mutex); md_buf = kzalloc(ALUA_MD_BUF_LEN, GFP_KERNEL); if (!md_...
false
false
false
false
false
0
gst_dccp_client_sink_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec) { GstDCCPClientSink *sink = GST_DCCP_CLIENT_SINK (object); switch (prop_id) { case PROP_PORT: sink->port = g_value_get_int (value); break; case PROP_SOCK_FD: sink->sock_fd = g...
false
false
false
false
false
0
prayer_done(void) /* M. Stephenson (1.0.3b) */ { aligntyp alignment = p_aligntyp; u.uinvulnerable = false; if (p_type == -1) { godvoice(alignment, alignment == A_LAWFUL ? "Vile creature, thou durst call upon me?" : "Walk no more, perversion of ...
false
false
false
false
false
0
set_named_bundle_note (const char *name, const char *key, const char *note, parser *p) { gretl_bundle *bundle; int err = 0; bundle = get_bundle_by_name(name); if (bundle == NULL) { p->err = E_UNKVAR; } else { err = gretl_bundle_set_note(bundle, key, note); } return err; }
false
false
false
false
false
0
switch_r_b(void *data, int bpi) { uint32_t tmp; data = (uint8_t*)data; if(bpi == 8) { uint8_t *p = (uint8_t*)data; tmp = p[0]; p[0] = p[2]; p[2] = tmp; } else if(bpi == 16) { uint16_t *p = (uint16_t*)data; tmp = p[0]; p[0]...
false
false
false
false
false
0
fsp_put_file (gftp_request * request, const char *filename, off_t startsize, off_t totalsize) { fsp_protocol_data * lpd; g_return_val_if_fail (request != NULL, GFTP_EFATAL); g_return_val_if_fail (request->protonum == GFTP_FSP_NUM, GFTP_EFATAL); g_return_val_if_fail (filename != NULL, GFTP_EFATA...
false
false
false
false
false
0
parse_mntr_flags(int *_argc, char ***_argv, struct nl_msg *msg) { struct nl_msg *flags; int err = -ENOBUFS; enum nl80211_mntr_flags flag; int argc = *_argc; char **argv = *_argv; flags = nlmsg_alloc(); if (!flags) return -ENOMEM; while (argc) { int ok = 0; for (flag = __NL80211_MNTR_FLAG_INVALID;...
false
false
false
false
false
0
find_term_bykeys(src) char_u *src; { int i; int slen = (int)STRLEN(src); for (i = 0; i < tc_len; ++i) { if (slen == termcodes[i].len && STRNCMP(termcodes[i].code, src, (size_t)slen) == 0) return i; } return -1; }
false
false
false
false
false
0
write_attribute(hid_t obj_id, int this_type, int num) { hid_t sid, aid; hsize_t dspace_dims[1]={8}; int i, mpi_rank, attr_data[8], dspace_rank=1; char attr_name[32]; MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); if(this_type == is_group) { sprintf(attr_name, "Group Attribute %d", ...
false
false
false
false
false
0
gst_message_init (GstMessageImpl * message, GstMessageType type, GstObject * src) { gst_mini_object_init (GST_MINI_OBJECT_CAST (message), 0, _gst_message_type, (GstMiniObjectCopyFunction) _gst_message_copy, NULL, (GstMiniObjectFreeFunction) _gst_message_free); GST_MESSAGE_TYPE (message) = type; i...
false
false
false
false
false
0
is_reserved_dir (const char *fn) { return (fn [0] == '.' && (fn [1] == 0 || (fn [1] == '.' && fn [2] == 0))); }
false
false
false
false
false
0
option_get(user, opt, admin, rwflag) char *user, *opt; int admin; int *rwflag; { char *result, *value; char dbname[256]; /* initialize results */ value = result = NULL; /* check user options database if user isn't the empty string */ if (*user) { snprintf(dbname, sizeof(dbname...
false
false
false
false
false
0
decrypt(unsigned char *r0, unsigned char *r1, unsigned char c0, unsigned char c1, const unsigned char *table0hi, const unsigned char *table0lo, const unsigned char *table1, int base, int invert) { unsigned char tmp,xor0,xor1; tmp = table1[(base & 0xff) ^ address_0_7_x...
false
false
false
false
false
0
move_cursor_relative(int y, int x) { int ky, kx; int vy, vx; /* Move the cursor on map sub-windows */ move_cursor_relative_map(y, x); /* Location relative to panel */ ky = y - Term->offset_y; /* Verify location */ if ((ky < 0) || (ky >= SCREEN_HGT)) return; /* Location relative to panel */ kx = x - Term->...
false
false
false
false
false
0
ref_stack_set_margin(ref_stack_t *pstack, uint margin) { const ref_stack_params_t *params = pstack->params; uint data_size = params->data_size; if (margin <= pstack->margin) { refset_null_new(pstack->top + 1, pstack->margin - margin, 0); } else { if (margin > data_size >> 1) ...
false
false
false
false
false
0
gimple_type_hash (const void *p) { const_tree t = (const_tree) p; VEC(tree, heap) *sccstack = NULL; struct pointer_map_t *sccstate; struct obstack sccstate_obstack; hashval_t val; void **slot; struct tree_int_map m; if (type_hash_cache == NULL) type_hash_cache = htab_create_ggc (512, tree_int_map_h...
false
false
false
false
false
0
initenv(char **envp, Boolean protected) { char *envstr; size_t bufsize = 1024; char *buf = ealloc(bufsize); for (; (envstr = *envp) != NULL; envp++) { size_t nlen; char *eq = strchr(envstr, '='); char *name; if (eq == NULL) { env->vector[env->count++] = envstr; if (env->count == env->alloclen) { ...
false
false
false
false
true
1
check_preconditions (prec) char *prec; { MACRODEF mdef; char *lineend; while (*prec) { lineend = index (prec, '\n'); if (*prec++ != '#') { error ("Bad format encountered while reading precompiled file"); return 0; } if (!strncmp (prec, "define", 6)) { HASHNODE *hp; ...
false
false
false
false
false
0
pwg_scan_measurement( const char *buf, /* I - Number string */ char **bufptr, /* O - First byte after the number */ int numer, /* I - Numerator from units */ int denom) /* I - Denominator from units */ { int value = 0, /* Measurement value */ fractional = 0, /* Fraction...
false
false
false
false
false
0
InformationDisperseFile(int threshold, int nShares, const char *filename) { assert(nShares<=1000); ChannelSwitch *channelSwitch; FileSource source(filename, false, new InformationDispersal(threshold, nShares, channelSwitch = new ChannelSwitch)); vector_member_ptrs<FileSink> fileSinks(nShares); string channel; f...
false
false
false
false
false
0
threadEdge(BasicBlock *PredBB, BasicBlock *OldSucc, BasicBlock *NewSucc) { if (PImpl) { const DataLayout &DL = PredBB->getModule()->getDataLayout(); getCache(PImpl, AC, &DL, DT).threadEdge(PredBB, OldSucc, NewSucc); } }
false
false
false
false
false
0
get_file_uri_with_extension(const Glib::ustring& uri) { Glib::ustring result = uri; //Enforce file extension: if(!m_file_extension.empty()) //If there is an extension to enforce. { bool bAddExt = false; const Glib::ustring strExt = '.' + get_file_extension(); if(result.size() < strExt.size()) //I...
false
false
false
false
false
0
mono_test_managed_marshal_bool_out (int arg, unsigned int expected, unsigned int testVal, MarshalBoolOutDelegate pfcn) { int ret; unsigned int lDefaultMarsh, lBoolCustMarsh; char lI1CustMarsh = 0; unsigned char lU1CustMarsh = 0; unsigned short lVBCustMarsh = 0; lDefaultMarsh = lBoolCustMarsh = 0; if (!pfcn) r...
false
false
false
false
false
0
tree_to_vine (struct Node **q) { struct Node *p = *q; while (p != NULL) if (p->down[1] == NULL) { q = &p->down[0]; p = *q; } else { struct Node *r = p->down[1]; p->down[1] = r->down[0]; r->down[0] = p; p = r; *q = r; } }
false
false
false
false
false
0
devfreq_event_disable_edev(struct devfreq_event_dev *edev) { int ret = 0; if (!edev || !edev->desc) return -EINVAL; mutex_lock(&edev->lock); if (edev->enable_count <= 0) { dev_warn(&edev->dev, "unbalanced enable_count\n"); ret = -EIO; goto err; } if (edev->desc->ops && edev->desc->ops->disable && ed...
false
false
false
false
false
0
multi_io_send_force(net_player *pl) { // invalid if((pl == NULL) || (NET_PLAYER_NUM(pl) >= MAX_PLAYERS)){ return; } // don't do it for single player if(!(Game_mode & GM_MULTIPLAYER)){ return; } // send everything in if (MULTIPLAYER_MASTER) { psnet_send(&pl->p_info.addr, pl->s_info.unreliable_buffer, ...
false
false
false
false
false
0
_stream_flush(HSQUIRRELVM v) { SETUP_STREAM(v); if(!self->Flush()) sq_pushinteger(v, 1); else sq_pushnull(v); return 1; }
false
false
false
false
false
0
gnumeric_date (GnmFuncEvalInfo *ei, GnmValue const * const *argv) { gnm_float year = value_get_as_float (argv [0]); gnm_float month = value_get_as_float (argv [1]); gnm_float day = value_get_as_float (argv [2]); GDate date; GODateConventions const *conv = DATE_CONV (ei->pos); if (year < 0 || year >= 10000) ...
false
false
false
false
false
0
userns_may_setgroups(const struct user_namespace *ns) { bool allowed; mutex_lock(&userns_state_mutex); /* It is not safe to use setgroups until a gid mapping in * the user namespace has been established. */ allowed = ns->gid_map.nr_extents != 0; /* Is setgroups allowed? */ allowed = allowed && (ns->flags & U...
false
false
false
false
false
0
initArmedPixmap(const MSPixmap &armedPixmap_) { if (armedPixmap_.server()==server()) _armedPixmap=new MSPixmap(armedPixmap_); else { MSMessageLog::warningMessage("Warning : armedPixmap supplied is invalid, using default"); _armedPixmap=createDefaultPixmap(armedPixmap_.width(),armedPixmap_.height...
false
false
false
false
false
0
menuitem_set_text(menuitem_t *item, const char *text) { ASSERT_RVAL(item != NULL, 0); REQUIRE_RVAL(text != NULL, 0); if (item->text) { FREE(item->text); } item->text = STRDUP(text); item->len = strlen(text); return 1; }
false
false
false
false
false
0
recv (ACE_HANDLE handle, void *buf, size_t n, const ACE_Time_Value *timeout) { if (timeout == 0) return ACE::recv_i (handle, buf, n); else { int val = 0; if (ACE::enter_recv_timedwait (handle, timeout, val) == -1) return -1; else { ...
false
false
false
false
false
0
__next_mem_range(u64 *idx, int nid, ulong flags, struct memblock_type *type_a, struct memblock_type *type_b, phys_addr_t *out_start, phys_addr_t *out_end, int *out_nid) { int idx_a = *idx & 0xffffffff; int idx_b = *idx >> 32; if (WARN_ONCE(nid == MAX_NUMNODES, "Usage of MAX_...
false
false
false
false
false
0
check_duplicate (Class *c, Node *node, const char *id, int line_no) { GList *li; for (li = c->nodes; li != NULL; li = li->next) { Node *n = li->data; const char *nid; int nline_no; if(n->type == METHOD_NODE) { Method *m = (Method *)n; /* override methods are checked separately */ if(m->method == OVE...
false
false
false
false
false
0
checkInteriorIntersections() { for (SegmentString::NonConstVect::const_iterator it = segStrings.begin(), itEnd = segStrings.end(); it != itEnd; ++it) { SegmentString* ss0 = *it; for (SegmentString::NonConstVect::const_iterator j = segStrings.begin(), jEnd = segStrings.end(); j != jEnd; ++j) { ...
false
false
false
false
false
0
handleMotion(const XMotionEvent &motion) { if (fDragging != 0) { processDrag(motion.x, motion.y); } }
false
false
false
false
false
0
canHandle(const DipoleIndex& ind) const { return ind.emitterData()->id() == ParticleID::g && ind.spectatorData()->mass() == ZERO && flavour()->mass() == ZERO && !ind.initialStateEmitter() && ind.initialStateSpectator(); }
false
false
false
false
false
0
nm_dhcp_dhclient_escape_duid (const GByteArray *duid) { char *escaped; const guint8 *s = duid->data; char *d; d = escaped = g_malloc0 ((duid->len * 4) + 1); while (s < (duid->data + duid->len)) { if (!g_ascii_isprint (*s)) { *d++ = '\\'; *d++ = '0' + ((*s >> 6) & 0x7); *d++ = '0' + ((*s >> 3) & 0x7); ...
false
false
false
false
false
0
yy_TerminalEndline(yycontext *ctx) { int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; yyprintf((stderr, "%s\n", "TerminalEndline")); if (!yy_Sp(ctx)) goto l294; if (!yy_Newline(ctx)) goto l294; if (!yy_Eof(ctx)) goto l294; yyDo(ctx, yy_1_TerminalEndline, ctx->begin, ctx->end); yyprintf((stderr, " ok %s @ %...
false
false
false
false
false
0
r8168_check_dash(struct rtl8169_private *tp) { switch (tp->mac_version) { case RTL_GIGA_MAC_VER_27: case RTL_GIGA_MAC_VER_28: case RTL_GIGA_MAC_VER_31: return r8168dp_check_dash(tp); case RTL_GIGA_MAC_VER_49: case RTL_GIGA_MAC_VER_50: case RTL_GIGA_MAC_VER_51: return r8168ep_check_dash(tp); default: retur...
false
false
false
false
false
0
amdgpu_vm_bo_unmap(struct amdgpu_device *adev, struct amdgpu_bo_va *bo_va, uint64_t saddr) { struct amdgpu_bo_va_mapping *mapping; struct amdgpu_vm *vm = bo_va->vm; bool valid = true; saddr /= AMDGPU_GPU_PAGE_SIZE; mutex_lock(&bo_va->mutex); list_for_each_entry(mapping, &bo_va->valids, list) { ...
false
false
false
false
false
0
rendezvous_request( register SVCXPRT *xprt, struct rpc_msg *msg) { SOCKET sock; struct tcp_rendezvous *r; struct sockaddr_in addr, laddr; socklen_t len, llen; r = (struct tcp_rendezvous *)xprt->xp_p1; again: len = llen = sizeof(struct sockaddr_in); if ((sock = accept(xprt->xp_sock, (struct sockaddr...
false
false
false
false
false
0
test_nv_list_from_file(void) { int rc = 0; struct ecryptfs_name_val_pair nv_pair_head; struct ecryptfs_name_val_pair *cursor; int fd; nv_pair_head.next = NULL; fd = open("ecryptfsrc", O_RDONLY); if (fd == -1) { rc = -EIO; goto out; } rc = parse_options_file(fd, &nv_pair_head); close(fd); cursor = nv_pai...
false
false
false
false
false
0
um_realm_join_as_admin (UmRealmObject *realm, const gchar *login, const gchar *password, GBytes *credentials, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer ...
false
false
false
false
false
0
sge_add_list_event(u_long32 timestamp, ev_event type, u_long32 intkey, u_long32 intkey2, const char *strkey, const char *strkey2, const char *session, lList *list) { bool ret; lList *lp = NULL; if (list != NULL) { lListElem *element...
false
false
false
false
false
0
getNodeRegMask(const SDNode *N) { for (const SDValue &Op : N->op_values()) if (const auto *RegOp = dyn_cast<RegisterMaskSDNode>(Op.getNode())) return RegOp->getRegMask(); return nullptr; }
false
false
false
false
false
0
read(Buffer& buf, Uint64& lvar) { Uint8* ptr = (Uint8*) buf.get_rspace(8); if (ptr != 0) { lvar = ptr[0]; lvar |= (Uint64(ptr[1]) << 8); lvar |= (Uint64(ptr[2]) << 16); lvar |= (Uint64(ptr[3]) << 24); lvar |= (Uint64(ptr[4]) << 32); lvar |= (Uint64(ptr[5]) << ...
false
false
false
false
false
0
interpolation_completed_cb (ClutterTimeline *timeline, MxAdjustment *adjustment) { MxAdjustmentPrivate *priv = adjustment->priv; if (priv->elastic && priv->clamp_value) { if (clutter_timeline_get_direction (priv->interpolation) == CLUTTER_TIMELINE_FORWARD) ...
false
false
false
false
false
0
__lambda2_ (Block1Data* _data1_, GObject* obj, GAsyncResult* res) { FriendsDispatcher * self; GMainLoop* _tmp7_; GError * _inner_error_ = NULL; #line 106 "/tmp/buildd/libfriends-0.1.2+14.04.20131108.1/src/dispatcher.vala" self = _data1_->self; #line 106 "/tmp/buildd/libfriends-0.1.2+14.04.20131108.1/src/dispatcher....
false
false
false
false
false
0
lookup_reloc(off_t off, off_t* target_off) { off_t value; unsigned int shndx = this->ranges_reloc_mapper_->get_reloc_target(off, &value); if (shndx == 0) return 0; if (this->reloc_type_ == elfcpp::SHT_REL) *target_off += value; else *target_off = value; return shndx; }
false
false
false
false
false
0
gf_cli3_1_remove_brick (call_frame_t *frame, xlator_t *this, void *data) { gf_cli_req req = {{0,}};; gf_cli_req status_req = {{0,}};; int ret = 0; dict_t *dict = NULL; int32_t ...
false
false
false
false
false
0
writeEncryptionDictionary() { this->encryption_dict_objid = openObject(this->encryption_dict_objid); writeString("<<"); for (std::map<std::string, std::string>::iterator iter = this->encryption_dictionary.begin(); iter != this->encryption_dictionary.end(); ++iter) { writeString(" "); writeStri...
false
false
false
false
false
0
aer_lex_error(sub_context_ty &sc, const rpt_position::pointer &pp, const char *fmt) { assert(pp); pp->print_error(sc, fmt); if (!ip.is_open()) sc.fatal_intl(i18n("report aborted")); ++error_count; if (error_count >= 20) { sc.var_set_string("File_Name", ip->name()); sc.fatal_intl(i18n("$...
false
false
false
false
false
0
fixed_convert_from_int (FIXED_VALUE_TYPE *f, enum machine_mode mode, double_int a, bool unsigned_p, bool sat_p) { bool overflow_p = false; /* Left shift a to temp_high, temp_low. */ double_int temp_high, temp_low; int amount = GET_MODE_FBIT (mode); if (amount == HOST_BITS_PER_DOUBLE_INT) { temp...
false
false
false
false
false
0
i915_miptree_layout_3d(struct intel_mipmap_tree * mt) { GLuint width = mt->physical_width0; GLuint height = mt->physical_height0; GLuint depth = mt->physical_depth0; GLuint stack_height = 0; GLint level; /* Calculate the size of a single slice. */ mt->total_width = mt->physical_width0; /* XXX:...
false
false
false
false
false
0
setDbValueFromDoubleStringsCombo(GWEN_DIALOG *dlg, GWEN_DB_NODE *db, const char *varName, const char *comboBoxName, const char **strings) { int i; int j; /* count number of string entries */ for (j=0; ; j+=2) { if (strings[j]==NULL) ...
false
false
false
false
false
0
adcli_enroll_set_computer_password (adcli_enroll *enroll, const char *password) { char *newval = NULL; return_if_fail (enroll != NULL); if (password) { newval = strdup (password); return_if_fail (newval != NULL); } if (enroll->computer_password) _adcli_password_free (en...
false
false
false
false
false
0
pithdiff_compare_row(byte *row1, byte *row2, int32 n) { int32 i, s = 0; for (i = 0; i < n; i++) { int32 k = row1[i], l = row2[i]; if (k == 255) s += 255 - l; else if (l == 255) s += 255 - k; } return s; }
false
false
false
false
false
0
cpu_group_add(cpu_group_t *group,cpu_gen_t *cpu) { if (!group) return(-1); /* check that we don't already have a CPU with this id */ if (cpu_group_find_id(group,cpu->id) != NULL) { fprintf(stderr,"cpu_group_add: CPU%u already present in group.\n", cpu->id); return(-1); } ...
false
false
false
false
false
0
process_file(void *sock, char *s, int len, char *ctype) { char outp[8292]; int i, io = 0, lv, le, respond = 1; sockets *so = (sockets *) sock; __attribute__((unused)) int rv; LOG("processing_file %x len %d:", s, len); for (i = 0; i < len; i++) { lv = 0; if (s[i] == '$') lv = is_var(s + i); if (lv == 0) ...
true
true
false
false
true
1
kcore_callback(struct notifier_block *self, unsigned long action, void *arg) { switch (action) { case MEM_ONLINE: case MEM_OFFLINE: write_lock(&kclist_lock); kcore_need_update = 1; write_unlock(&kclist_lock); } return NOTIFY_OK; }
false
false
false
false
false
0
scfsi_calc(int ch, III_side_info_t * l3_side) { unsigned int i; int s1, s2, c1, c2; int sfb; gr_info *const gi = &l3_side->tt[1][ch]; gr_info const *const g0 = &l3_side->tt[0][ch]; for (i = 0; i < (sizeof(scfsi_band) / sizeof(int)) - 1; i++) { for (sfb = scfsi_band[i]; sfb < scf...
false
false
false
false
false
0
reindent(int baseLine) const { SourceStream str; str.setReindenting(baseLine); streamTo(str); return str.toString(); }
false
false
false
false
false
0
sheep_loop(flam3_genome *cp, double blend) { flam3_genome *result; int i; /* Allocate the genome - this must be freed by calling function */ result = calloc(1,sizeof(flam3_genome)); /* Clear it */ clear_cp(result,flam3_defaults_on); /* Copy the original */ flam3_copy(result,cp); ...
false
false
false
false
false
0
evry_history_init(void) { #undef T #undef D hist_item_edd = E_CONFIG_DD_NEW("History_Item", History_Item); #define T History_Item #define D hist_item_edd E_CONFIG_VAL(D, T, plugin, STR); E_CONFIG_VAL(D, T, context, STR); E_CONFIG_VAL(D, T, input, STR); E_CONFIG_VAL(D, T, last_used, DOUBLE); E_CONFIG_V...
false
false
false
false
false
0
beginline(flag) int flag; { curwin->w_cursor.col = 0; if (flag) { register char_u *ptr; for (ptr = ml_get(curwin->w_cursor.lnum); iswhite(*ptr); ++ptr) ++curwin->w_cursor.col; } curwin->w_set_curswant = TRUE; }
false
false
false
false
false
0
isl_schedule_band_align_params( __isl_take isl_schedule_band *band, __isl_take isl_space *space) { band = isl_schedule_band_cow(band); if (!band || !space) goto error; band->mupa = isl_multi_union_pw_aff_align_params(band->mupa, isl_space_copy(space)); band->ast_build_options = isl_union_set_align_param...
false
false
false
false
false
0
getchar_skipping_comments(void) { int c; while (1) { c = getchar_update_lineno(); if (c != '/') return c; c = getchar(); if (c == '/') { do { c = getchar_update_lineno(); } while (c != EOF && c != '\n'); return c; } else if (c == '*') { while (1) { c = getchar_update_lineno(); i...
false
false
false
false
false
0
gwy_graph_area_destroy(GtkObject *object) { GwyGraphArea *area; area = GWY_GRAPH_AREA(object); if (area->area_dialog) { gtk_widget_destroy(area->area_dialog); area->area_dialog = NULL; } if (area->label_dialog) { gtk_widget_destroy(area->label_dialog); area->label_d...
false
false
false
false
false
0
kwsmusts (void) { struct dfamust const *dm; char const *err; dm = dfamusts (dfa); if (dm) { kwsinit (&kwset); /* First, we compile in the substrings known to be exact matches. The kwset matcher will return the index of the matching string that it chooses. */ for (; dm; ...
false
false
false
false
false
0
validateCuts (const OsiCuts & cs, int first, int last) const { int nbad=0; int i; const double epsilon=1.0e-8; const int nRowCuts = CoinMin(cs.sizeRowCuts(),last); for (i=first; i<nRowCuts; i++){ OsiRowCut rcut = cs.rowCut(i); CoinPackedVector rpv = rcut.row(); const int n = rpv...
false
false
false
false
false
0
training_get(v17_tx_state_t *s) #endif { static const int cdba_to_abcd[4] = { 2, 3, 1, 0 }; static const int dibit_to_step[4] = { 1, 0, 2, 3 }; #if defined(SPANDSP_USE_FIXED_POINT) static const complexi16_t zero = {0, 0}; #else static const complexf_t zero = {0.0f, 0.0f};...
false
false
false
false
false
0
AddEntry(void *entry, const float minX, const float minY, const float maxX, const float maxY) { RakAssert(cellWidth>0.0f); RakAssert(minX < maxX && minY < maxY); int xStart, yStart, xEnd, yEnd, xCur, yCur; xStart=WorldToCellXOffsetAndClamped(minX); yStart=WorldToCellYOffsetAndClamped(minY); xEnd=WorldToC...
false
false
false
false
false
0
attach_xc4000(struct cx8802_dev *dev, struct xc4000_config *cfg) { struct dvb_frontend *fe; struct vb2_dvb_frontend *fe0 = NULL; /* Get the first frontend */ fe0 = vb2_dvb_get_frontend(&dev->frontends, 1); if (!fe0) return -EINVAL; if (!fe0->dvb.frontend) { printk(KERN_ERR "%s/2: dvb frontend not attached. ...
false
false
false
false
false
0
dump_ram(const char *name, const void *p) { const u32 *r = p; if (!(r[10] & 2)) { printf("\n%s (disabled)\n", name); return; } printf("\n%s\n", name); printf("---------------\n"); printf("Start Address 0x%08X\n", r[0]); printf("End Address 0x%08X\n", r[1]); printf("...
false
false
false
false
false
0
ares_gethostbyaddr(ares_channel channel, const void *addr, int addrlen, int family, ares_host_callback callback, void *arg) { struct addr_query *aquery; if (family != AF_INET && family != AF_INET6) { callback(arg, ARES_ENOTIMP, 0, NULL); return; } if ((family == AF_IN...
false
false
false
false
false
0
jpeg_cf_skip_input_data(j_decompress_ptr cinfo, long num_bytes) { cfile_src_ptr src = (cfile_src_ptr) cinfo->src; if (num_bytes > 0) { while (num_bytes > (long) src->pub.bytes_in_buffer) { num_bytes -= (long) src->pub.bytes_in_buffer; if (!jpeg_cf_fill_input_buffer(cinfo)) return; } src->pub.next_i...
false
false
false
false
false
0
readFitsIdsTable(VimosTable *idsTable, fitsfile *fptr) { char modName[] = "readFitsIdsTable"; int status; /* validate input */ if (idsTable == NULL) { cpl_msg_error(modName, "NULL input table"); return(VM_FALSE); } status = 0; /* open Table */ if (fits_movnam_hdu(fptr, BINARY_TBL, "IDS", 0...
false
false
false
false
false
0
GetObjPtr(GInt32 nObjId) { if (m_poIDBlock == NULL) return -1; if (nObjId < 1 || nObjId > m_nMaxId) { CPLError(CE_Failure, CPLE_IllegalArg, "GetObjPtr(): Invalid object ID %d (valid range is [1..%d])", nObjId, m_nMaxId); return -1; } if (m_...
false
false
false
false
false
0
gs_cspace_set_devn_function(gs_color_space *pcspace, gs_function_t *pfn) { gs_device_n_map *pimap; if (gs_color_space_get_index(pcspace) != gs_color_space_index_DeviceN || pfn->params.m != pcspace->params.device_n.num_components || pfn->params.n != gs_color_space_num_components(pcspace->base_sp...
false
false
false
false
false
0
trim (std::string s) { std::string::size_type i = 0 ; std::string::size_type len = s.size() ; std::string::size_type start=0, end=0, old_end = len - 1; while (i < len) { if (!isspace (s[i])) { start = i ; break ; } i++ ; } if (i == len) { r...
false
false
false
false
false
0
readByte(donkeyMsg *m) { unsigned char c; if (!canAdvance(m, 1)) return 0; c = m->payload[m->pos]; m->pos = m->pos + 1; return c; }
false
false
false
false
false
0
AppendStringPart(const char* str, int len) { if (pos_ + len > Log::kMessageBufferSize) { len = Log::kMessageBufferSize - pos_; ASSERT(len >= 0); if (len == 0) return; } Vector<char> buf(Log::message_buffer_ + pos_, Log::kMessageBufferSize - pos_); OS::StrNCpy(buf, str, len); pos...
false
false
false
false
false
0
freeDatabaseInfo (DatabaseInfo database) { if (database != NULL) { clearPRChain (database); clearQueryFormatList (database); clearFieldList (database); clearMessageFormatList (database); clearIndexDesc (database); clearAuditTrailFormat (database); clearHostList (database)...
false
false
false
false
false
0
all(QScriptContext *context, QScriptEngine *engine) { Q_UNUSED(context) QList<ActionTools::WindowHandle> windowList = ActionTools::WindowHandle::windowList(); QScriptValue back = engine->newArray(windowList.count()); for(int index = 0; index < windowList.count(); ++index) back.setProperty(index, construc...
false
false
false
false
false
0
gt_encseq_check_option_parser_new(void *tool_arguments) { GtEncseqCheckArguments *arguments = tool_arguments; GtOptionParser *op; GT_UNUSED GtOption *option; gt_assert(arguments); /* init */ op = gt_option_parser_new("[option ...] [file]", "Check the consistency of an encoded " ...
false
false
false
false
false
0
GrayBlend(PIX *pixs, PIX *pixb, l_int32 op, l_float32 fract) { l_int32 i, j, wb, hb, ws, hs, delx, dely, x, y; pixGetDimensions(pixs, &ws, &hs, NULL); pixGetDimensions(pixb, &wb, &hb, NULL); delx = wb + 30; dely = hb + 25; x = 200; y = 300; fo...
false
false
false
false
false
0