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
predict_point(int x, int x0, int x1, int y0, int y1) { int dy = y1 - y0; int adx = x1 - x0; // @OPTIMIZE: force int division to round in the right direction... is this necessary on x86? int err = abs(dy) * (x - x0); int off = err / adx; return dy < 0 ? y0 - off : y0 + off; }
false
false
false
false
false
0
_ipmipower_args_validate (struct ipmipower_arguments *cmd_args) { if (cmd_args->retransmission_wait_timeout > cmd_args->common.session_timeout) { fprintf (stderr, "retransmission wait timeout larger than session timeout\n"); exit (1); } if (cmd_args->powercmd != POWER_CMD_NONE && !cmd_args->com...
false
false
false
false
false
0
gpiod_set_value(struct gpio_desc *desc, int value) { if (!desc) return; /* Should be using gpio_set_value_cansleep() */ WARN_ON(desc->chip->can_sleep); if (test_bit(FLAG_ACTIVE_LOW, &desc->flags)) value = !value; _gpiod_set_raw_value(desc, value); }
false
false
false
false
false
0
BuildShortcut() { DEBUG_FILTER_LOG(LOG_FILTER_PATHFINDING, "++ PathFinder::BuildShortcut :: making shortcut\n"); clear(); // make two point path, our curr pos is the start, and dest is the end m_pathPoints.resize(2); // set start and a default next position m_pathPoints[0] = getStartPosition(...
false
false
false
false
false
0
multi_pxo_add_channel(char *name,pxo_channel **list) { pxo_channel *new_channel; // try and allocate a new pxo_channel struct new_channel = (pxo_channel *)vm_malloc(sizeof(pxo_channel)); if ( new_channel == NULL ) { nprintf(("Network", "Cannot allocate space for new pxo_channel structure\n")); return NULL; } ...
false
false
false
false
false
0
gog_series_get_fill_type_from_combo (GogSeries const *series, GtkComboBox *combo) { GogSeriesClass *series_klass; g_return_val_if_fail (GOG_IS_SERIES (series), GOG_SERIES_FILL_TYPE_INVALID); series_klass = GOG_SERIES_GET_CLASS (series); g_return_val_if_fail (series_klass->valid_fill_type_list != NULL, GOG_SERIES_F...
false
false
false
true
false
1
notify(notif, val) struct notifier *notif; int val; { struct notifier *np; while ((np = notif) != 0) { notif = np->next; (*np->func)(np->arg, val); } }
false
false
false
false
false
0
readfile_or(char *fil, char *defaultdata) { char *realfile = fil; char *ret; char catbuff[CATBUFF_SIZE]; if (!fexist(fil)) realfile = fconcat(catbuff, hts_rootdir(NULL), fil); ret = readfile(realfile); if (ret) return ret; else { char *adr = malloct(strlen(defaultdata) + 2); if (adr) { ...
false
false
false
false
true
1
HPDF_Encoder_GetByteType (HPDF_Encoder encoder, const char *text, HPDF_UINT index) { HPDF_ParseText_Rec parse_state; HPDF_ByteType btype; HPDF_PTRACE ((" HPDF_Encoder_GetByteType\n")); if (!HPDF_Encoder_Validate (encoder)) ...
false
false
false
false
false
0
new_array_type( Chuck_Env * env, Chuck_Type * array_parent, t_CKUINT depth, Chuck_Type * base_type, Chuck_Namespace * owner_nspc ) { // make new type Chuck_Type * t = env->context->new_Chuck_Type(); // set the id t->xid = te_array; // set the...
false
false
false
true
false
1
get_needed_mode(struct btd_adapter *adapter, uint8_t mode) { GSList *l; if (adapter->global_mode > mode) mode = adapter->global_mode; for (l = adapter->mode_sessions; l; l = l->next) { struct session_req *req = l->data; if (req->mode > mode) mode = req->mode; } return mode; }
false
false
false
false
false
0
iser_alloc_fastreg_pool(struct ib_conn *ib_conn, unsigned cmds_max, unsigned int size) { struct iser_device *device = ib_conn->device; struct iser_fr_pool *fr_pool = &ib_conn->fr_pool; struct iser_fr_desc *desc; int i, ret; INIT_LIST_HEAD(&fr_pool->list); INIT_LIST_HEAD(&fr_pool->all_list); spin_l...
false
false
false
false
false
0
multi_voice_give_token(int stream_index,int player_index) { ubyte data[10],code; int packet_size = 0; // only the server should ever be here Assert(Net_player->flags & NETINFO_FLAG_AM_MASTER); // set this player as having the token Multi_voice_stream[stream_index].token_status = player_index; // set the to...
false
false
false
false
true
1
find_mnt_by_fsname(char *fsname) { FILE *mtab; struct mntent *mnt; char *mntdir; mtab = setmntent("/etc/mtab", "r"); if (!mtab) return NULL; for(mnt = getmntent(mtab); mnt; mnt = getmntent(mtab)) { if (strcmp(mnt->mnt_fsname, fsname) == 0) break; } mntdir = mnt ? strdup(mnt->mnt_dir) : NULL; endmntent(...
false
false
false
false
false
0
img_simple_blt(img dest, const int dx, const int dy, img src, const int sx, const int sy, const int w, const int h) { int y, y2; for (y = sy, y2 = dy; y < sy + h; ++y, ++y2) memcpy(dest->data[y2] + dx, src->data[y] + sx, w * sizeof(pel)); }
false
false
false
false
false
0
is_phi_for_stmt (gimple stmt, tree operand) { gimple def_stmt; tree lhs; use_operand_p arg_p; ssa_op_iter i; if (TREE_CODE (operand) != SSA_NAME) return false; lhs = gimple_assign_lhs (stmt); def_stmt = SSA_NAME_DEF_STMT (operand); if (gimple_code (def_stmt) != GIMPLE_PHI) return false; FO...
false
false
false
false
false
0
sqliteVdbeAddOpList(Vdbe *p, int nOp, VdbeOpList const *aOp){ int addr; assert( p->magic==VDBE_MAGIC_INIT ); if( p->nOp + nOp >= p->nOpAlloc ){ int oldSize = p->nOpAlloc; Op *aNew; p->nOpAlloc = p->nOpAlloc*2 + nOp + 10; aNew = sqliteRealloc(p->aOp, p->nOpAlloc*sizeof(Op)); if( aNew==0 ){ ...
false
false
false
false
false
0
visit(ir_dereference_variable *ir) { if (ir->var->data.mode == mode && ir->var->get_interface_type() == block) { found = true; return visit_stop; } return visit_continue; }
false
false
false
false
false
0
show_info_popup(GtkWidget *w, GdkEventButton *ev, gpointer data) { struct city_dialog *pdialog = g_object_get_data(G_OBJECT(w), "pdialog"); if (ev->button == 1) { GtkWidget *p, *label, *frame; char buf[1024]; switch (GPOINTER_TO_UINT(data)) { case FIELD_FOOD: get_city_dialog_outp...
false
false
false
false
false
0
addGetBalance(const aqb_AccountInfo *acc, bool withoutInfo /*=false*/) { int rv; if (acc == NULL) { //Job is not available! qWarning() << Q_FUNC_INFO << "Job AB_Job_TypeGetBalance is not available" << "(no valid account [NULL])"; emit jobNotAvailable(AB_Job_TypeGetBalance); return; //cancel }...
false
false
false
false
false
0
DXEnableDebug(char *classes, int enable) { int i; if (!state && !DXinitdx()) return; if (!classes) for (i=0; i<256; i++) state->enabled[i] = enable; else for (i=0; classes[i]; i++) state->enabled[(unsigned char)classes[i]] = enable; }
false
false
false
false
false
0
toolong(int signo) { reply(421, "Timeout (%d seconds): closing control connection.", ftpd_timeout); if (logging) syslog(LOG_INFO, "User %s timed out after %d seconds", (pw ? pw -> pw_name : "unknown"), ftpd_timeout); dologout(1); SIGRETURN(0); }
false
false
false
false
false
0
kone_receive(struct usb_device *usb_dev, uint usb_command, void *data, uint size) { char *buf; int len; buf = kmalloc(size, GFP_KERNEL); if (buf == NULL) return -ENOMEM; len = usb_control_msg(usb_dev, usb_rcvctrlpipe(usb_dev, 0), HID_REQ_GET_REPORT, USB_TYPE_CLASS | USB_RECIP_INTERFACE | USB_DIR_IN, ...
false
true
false
false
false
1
r_prelude(struct SN_env * z) { z->B[0] = 0; /* unset Y_found, line 26 */ { int c1 = z->c; /* do, line 27 */ z->bra = z->c; /* [, line 27 */ if (!(eq_s(z, 1, s_0))) goto lab0; z->ket = z->c; /* ], line 27 */ { int ret = slice_del(z); /* delete, line 27 */ if (ret <...
false
false
false
false
false
0
cm_certread_o_start(struct cm_store_entry *entry) { struct cm_certread_state *state; if (entry->cm_cert_storage_type != cm_cert_storage_file) { cm_log(1, "Wrong read method: can only read certificates " "from a file.\n"); return NULL; } state = talloc_ptrtype(entry, state); if (state != NULL) { mems...
false
false
false
false
false
0
TestForLayer( OGRNTFLayer * poLayer ) { for( int i = 0; i < 100; i++ ) { if( apoTypeTranslation[i] == poLayer ) return TRUE; } return FALSE; }
false
false
false
false
false
0
PyType_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; mro = a->tp_mro; if (mro != NULL) { /* Deal with multiple inheritance without recursion by walking the MRO tuple */ Py_ssize_t i, n; assert(PyTuple_Check(mro)); n = PyTuple_GET_SIZE(mro); ...
false
false
false
false
true
1
mzpokeysnd_process_8(void* sndbuffer, int sndn) { int i; int nsam = sndn; UBYTE *buffer = (UBYTE *) sndbuffer; if(num_cur_pokeys<1) return; /* module was not initialized */ /* if there are two pokeys, then the signal is stereo we assume even sndn */ while(nsam >= (int) num_cur_p...
false
false
false
false
false
0
lcp_rcr(struct pppcp_data *pppcp, const struct pppcp_packet *packet, guint8 **new_options, guint16 *new_len) { GAtPPP *ppp = pppcp_get_ppp(pppcp); struct ppp_option_iter iter; ppp_option_iter_init(&iter, packet); while (ppp_option_iter_next(&iter) == TRUE) { switch (ppp_option_iter_get_type(&iter)) { ...
false
false
false
false
false
0
part_get_bootable_stub (XDR *xdr_in) { int r; struct guestfs_part_get_bootable_args args; CLEANUP_FREE char *device = NULL; int partnum; if (optargs_bitmask != 0) { reply_with_error ("header optargs_bitmask field must be passed as 0 for calls that don't take optional arguments"); goto done_no_free; ...
false
false
false
false
false
0
tree_selection_model_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { ESelectionModel *esm = E_SELECTION_MODEL (object); ETreeSelectionModel *etsm = E_TREE_SELECTION_MODE...
false
false
false
false
false
0
TransformPoint(int pos[2], int pos2[2], double x[3], double xNew[3]) { // First worry about exchanging axes if ( this->ExchangeAxes ) { double sx = (x[0]-pos[0]) / (pos2[0]-pos[0]); double sy = (x[1]-pos[1]) / (pos2[1]-pos[1]); xNew[0] = sy*(pos2[0]-pos[0]) + p...
false
false
false
false
false
0
ast_stream_and_wait(struct ast_channel *chan, const char *file, const char *digits) { int res = 0; if (!ast_strlen_zero(file)) { ast_test_suite_event_notify("PLAYBACK", "Message: %s\r\nChannel: %s", file, ast_channel_name(chan)); res = ast_streamfile(chan, file, ast_channel_language(chan)); if (!res) { res =...
true
true
false
false
false
1
base_to_uppercase(string& str, int count) { if (count <= 0) return true; int todo = count; // Go backwards. string::reverse_iterator X; for(X = str.rbegin(); X != str.rend(); ++X) { // Stop at separator. if (*X == '/' || *X == '\\' || *X == ':') todo--; if (todo <= 0) break; #if (defined(BEO...
false
false
false
false
false
0
ATS_2d0_2e2_2e11_2libatsdoc_2SATS_2libatsdoc_location_2esats__print_position (libatsdoc_position_struct arg0) { /* local vardec */ // ATSlocal_void (tmp7) ; __ats_lab_ATS_2d0_2e2_2e11_2libatsdoc_2SATS_2libatsdoc_location_2esats__print_position: #line 72 "libatsdoc_location.dats" /* tmp7 = */ ATS_2d0_2e2_2e11_2libatsdo...
false
false
false
false
false
0
mark_define_expressions(void) { chunk_t *pc; chunk_t *prev; bool in_define = false; bool first = true; pc = chunk_get_head(); prev = pc; while (pc != NULL) { if (!in_define) { if ((pc->type == CT_PP_DEFINE) || (pc->type == CT_PP_IF) || ...
false
false
false
false
false
0
mono_metadata_parse_array_internal (MonoImage *m, MonoGenericContainer *container, gboolean transient, const char *ptr, const char **rptr) { int i; MonoArrayType *array; MonoType *etype; array = transient ? g_malloc0 (sizeof (MonoArrayType)) : mono_image_alloc0 (m, sizeof (MonoArrayType)); etype = mono_...
false
false
false
false
false
0
gkr_tool_parse_options (int *argc, char** argv[], GOptionEntry *options) { GError *err = NULL; GOptionContext *context; int ret = 0; context = g_option_context_new ("- Gnome Keyring Tool"); g_option_context_add_main_entries (context, options, GETTEXT_PACKAGE); if (!g_option_context_parse (context, argc, argv,...
false
false
false
false
false
0
IsPreConstant(const int x) { return (outArray[x]==norb||outArray[x]==nocc|| outArray[x]==nvirt||outArray[x]==bocc|| outArray[x]==eocc||outArray[x]==bvirt|| outArray[x]==evirt||outArray[x]==naocc|| outArray[x]==nbocc||outArray[x]==navirt|| outArray[x]==nbvirt||outArray[x]==bao...
false
false
false
false
true
1
test_vector( Twofish_Byte key[], int key_len, Twofish_Byte p[16], Twofish_Byte c[16] ) { Twofish_Byte tmp[16]; /* scratch pad. */ Twofish_key xkey; /* The expanded key */ int i; /* Prepare the key */ if ((i = Twofish_prepare_key( key, key_len, &xkey)) < ...
false
false
false
false
false
0
j2k_write_float_to_float64 (const void * p_src_data, void * p_dest_data, OPJ_UINT32 p_nb_elem) { OPJ_BYTE * l_dest_data = (OPJ_BYTE *) p_dest_data; OPJ_FLOAT32 * l_src_data = (OPJ_FLOAT32 *) p_src_data; OPJ_UINT32 i; OPJ_FLOAT64 l_temp; for (i=0;i<p_nb_elem;++i) { l_temp = (OPJ_FLOAT64) *(l_src_data...
false
false
false
false
false
0
bucket_straw_choose(struct crush_bucket_straw *bucket, int x, int r) { __u32 i; int high = 0; __u64 high_draw = 0; __u64 draw; for (i = 0; i < bucket->h.size; i++) { draw = crush_hash32_3(bucket->h.hash, x, bucket->h.items[i], r); draw &= 0xffff; draw *= bucket->straws[i]; if (i == 0 || draw > h...
false
false
false
false
false
0
trim_directory(char *path) { char *p; path = skip_drive(path); if (path[0] == '\0') return; /* back up over trailing slash(es) */ for (p = path + strlen(path) - 1; IS_DIR_SEP(*p) && p > path; p--) ; /* back up over directory name */ for (; !IS_DIR_SEP(*p) && p > path; p--) ; /* if multiple slashes b...
false
false
false
false
false
0
cursor_backspace() { close_selection_win(); poo.ityp3_pho=0; tss.pre_selN = 0; gboolean pho_cleared; pho_cleared=FALSE; int j; if (pin_juyin) { for(j=sizeof(poo.inph)-1;j>=0;j--) { if (poo.inph[j]) { poo.inph[j]=0; pho_...
false
false
false
false
false
0
print_commands(int desc, char term, const struct cl_engine *engine) { unsigned i, n; const char *engine_ver = cl_retver(); const char *clamd_ver = get_version(); if (strcmp(engine_ver, clamd_ver)) { mdprintf(desc, "ENGINE VERSION MISMATCH: %s != %s. ERROR%c", engine_ver, clamd_ver, term); return; ...
false
false
false
false
false
0
ggd_tag_find_from_name (const GPtrArray *tags, const gchar *name) { TMTag *tag = NULL; guint i; TMTag *el; g_return_val_if_fail (tags != NULL, NULL); g_return_val_if_fail (name != NULL, NULL); GGD_PTR_ARRAY_FOR (tags, i, el) { if (! (el->type & tm_tag_file_t) && ...
false
false
false
false
false
0
setOpenSaveFolder(const QString& path) { setOpenSaveFolderAux(path); QSettings settings; settings.setValue("openSaveFolder", m_openSaveFolder); }
false
false
false
false
false
0
set_join_references(PlannerGlobal *glob, Join *join, int rtoffset) { Plan *outer_plan = join->plan.lefttree; Plan *inner_plan = join->plan.righttree; indexed_tlist *outer_itlist; indexed_tlist *inner_itlist; outer_itlist = build_tlist_index(outer_plan->targetlist); inner_itlist = build_tlist_index(inner_pl...
false
false
false
false
false
0
delete_address_impl(void) { GtkTreeIter iter; GtkTreeModel* model_p; GtkTreeSelection* selection_p(gtk_tree_view_get_selection(tree_view_p)); if (gtk_tree_selection_get_selected(selection_p, &model_p, &iter)) { // delete the address by removing it from the list store gtk_list_store_remove(GTK_LIST_STO...
false
false
false
false
false
0
DUL_AcknowledgeRelease(DUL_ASSOCIATIONKEY ** callerAssociation) { PRIVATE_ASSOCIATIONKEY ** association; association = (PRIVATE_ASSOCIATIONKEY **) callerAssociation; OFCondition cond = checkAssociation(association); if (cond.bad()) return cond; cond = PRV_StateMachine(NULL, association, ...
false
false
false
true
false
1
cmd_lshift() { char *s; char *save_cp; int cols; /* * Start at the first displayed char, count how far to the * right we'd have to move to reach the center of the screen. */ s = cmdbuf + cmd_offset; cols = 0; while (cols < (sc_width - prompt_col) / 2 && *s != '\0') { int width; cmd_step_right(&s, &wi...
false
false
false
false
false
0
snd_make_coterm(sound_type s1, sound_type s2) { register coterm_susp_type susp; rate_type sr = max(s1->sr, s2->sr); time_type t0 = max(s1->t0, s2->t0); int interp_desc = 0; sample_type scale_factor = 1.0F; time_type t0_min = t0; long lsc; /* combine scale factors of linear inputs (S1) */...
false
false
false
false
false
0
if_flagtoname (int flag, const char *avoid) { struct if_flag *fp; const char *first_match = NULL; char *start; for (fp = if_flags; ; fp++) { if (!fp->name) return NULL; if (flag == fp->mask && !fp->rev) break; } first_match = fp->name; /* We now have found the first match. Look for...
false
false
false
false
false
0
setup_link(void) { struct timeval timeout = {connect_timeout,0}; if ( (np=getnodebyname(node)) == NULL) { printf("Unknown node name %s\n",node); exit(0); } /* Limit on the length of a DECnet object name */ if (strlen(filename) > 16) { printf("task name must be less than 17 characters...
false
false
false
false
false
0
pcidev_resume(struct pci_dev *pdev) { int i; struct platform_info *info = pci_get_drvdata(pdev); struct dev_info *hw_priv = &info->dev_info; struct ksz_hw *hw = &hw_priv->hw; pci_set_power_state(pdev, PCI_D0); pci_restore_state(pdev); pci_enable_wake(pdev, PCI_D0, 0); if (hw_priv->wol_enable) hw_cfg_wol_pme...
false
false
false
false
false
0
drawGlitter(ExploType type) { float age; float ex, ey; float alpha,tmp; float *clr; float *pos; Explo *thisExplo; glBindTexture(GL_TEXTURE_2D, tex[type]); thisExplo = exploRoot[type]->next; while(thisExplo) { age = thisExplo->age*game->speedAdj; if( age >= 0) { tmp = age/exploStay[type]; alpha =...
false
false
false
false
false
0
paint_it (double x[], double y[], GMT_LONG n, double z, GMT_LONG intens, GMT_LONG monochrome, double intensity, GMT_LONG outline) { GMT_LONG index; int rgb[3]; struct GMT_FILL *f; if (n < 3) return; /* Need at least 3 points to make a polygon */ index = GMT_get_rgb_from_z (z, rgb); if (GMT_cpt_skip) return; /* ...
false
false
false
false
false
0
server_symlink (rpcsvc_request_t *req) { server_state_t *state = NULL; call_frame_t *frame = NULL; dict_t *params = NULL; char *buf = NULL; gfs3_symlink_req args ...
false
false
false
false
false
0
display_screen() { static int64_t last_time = 0; int64_t t = fs_emu_monotonic_time(); if (last_time > 0) { int dt = (t - last_time) / 1000; //printf("%d\n", dt); } fs_emu_video_buffer_set_current(g_buffer); if (g_last_refresh_rate == -1) { if (fs_emu_get_video_frame_rat...
false
false
false
false
false
0
_create(Request& r, MethodParams& params) { const String* mode=0; const String* file_name=0; bool is_text=true; // new format: ^file::create[string-or-file-content[;$.mode[text|binary] $.name[...] $.content-type[...] $.charset[...] ]] size_t content_index=0; size_t options_index=1; bool extended_options=true; ...
false
false
false
false
false
0
L3() {register object *base=vs_base; register object *sup=base+VM3; VC3 vs_check; {object V9; V9=(base[0]); vs_top=sup; goto TTL; TTL:; {object V10; V10= ((V9))->v.v_self[(long)10]; base[1]= CMPcar((V10)); base[2]= CMPcdr((V10)); vs_top=(vs_base=base+2)+1; super_funcall_no_event(base[1]); return;} } }
false
false
false
false
false
0
dspload_image(struct hda_codec *codec, const struct dsp_image_seg *fls, bool ovly, unsigned int reloc, bool autostart, int router_chans) { int status = 0; unsigned int sample_rate; unsigned short channels; codec_dbg(codec, "---- dspload_image begin ------\n"); if (router_chans == 0) { if (!ovly) ...
false
false
false
false
false
0
DeletePeerInfo (Connector* c, ConnInfo* info, Connector* peer) { info->Exclude(peer); ConnInfo* pci; if (info == c->_csinfo->_hinfo) { pci = peer->_csinfo->_hinfo; } else { pci = peer->_csinfo->_vinfo; } pci->Exclude(c); if (pci->NumPeers() == 0) { pci->SetNetwo...
false
false
false
false
false
0
char16tochar8(const char16 *s) { static char8 *buf = 0; int i, len; len = strlen16(s); buf = Realloc(buf, len + 1); if(!buf) return 0; for(i=0; i<len; i++) buf[i] = s[i] > 255 ? 'X' : s[i]; buf[i] = 0; return buf; }
false
false
false
false
false
0
php_ftp_dirstream_close(php_stream *stream, int close_handle TSRMLS_DC) { php_stream *innerstream = (php_stream *)stream->abstract; if (innerstream->wrapperdata) { php_stream_close((php_stream *)innerstream->wrapperdata); innerstream->wrapperdata = NULL; } php_stream_close((php_stream *)stream->abstract); str...
false
false
false
false
false
0
brasero_track_disc_get_medium_type (BraseroTrackDisc *track) { BraseroTrackDiscPrivate *priv; BraseroMedium *medium; g_return_val_if_fail (BRASERO_IS_TRACK_DISC (track), BRASERO_MEDIUM_NONE); priv = BRASERO_TRACK_DISC_PRIVATE (track); medium = brasero_drive_get_medium (priv->drive); if (!medium) return BRASER...
false
false
false
false
false
0
CreateMaskBand( int nFlags ) { VRTDataset* poGDS = (VRTDataset *)poDS; if (poGDS->poMaskBand) { CPLError( CE_Failure, CPLE_AppDefined, "Cannot create mask band at raster band level when a dataset mask band already exists." ); return CE_Failure; } if (poMas...
false
false
false
false
false
0
move32(int32_t delta, CharacterIterator::EOrigin origin) { // this implementation relies on the "safe" version of the UTF macros // (or the trustworthiness of the caller) switch(origin) { case kStart: pos = begin; if(delta > 0) { U16_FWD_N(text, pos, end, delta); } ...
false
false
false
false
false
0
resolve(proc) struct pentry *proc; { struct lentry **lhash; register struct lentry *lp; struct gentry *gp; int i; char *id; lhash = proc->lhash; for (i = 0; i < LHSize; ++i) { lp = lhash[i]; while (lp != NULL) { id = lp->name; if (lp->flag == 0) { /* undeclared...
false
false
false
false
false
0
compat_valloc(size_t size) { #ifdef HAVE_VALLOC return valloc(size); #endif size_t psize = compat_getpagesize(), cut = 0; char *p = NULL; int i; for (i = 0; i < 2; i++) { char *q; q = realloc(p, size); if (!q) { DO_FREE(p); return NULL; } p = q; cut = (unsigned lo...
false
false
false
false
false
0
replaceParenDelims(const MathData & ar) { return MathAtom(new InsetMathDelim(const_cast<Buffer *>(ar.buffer()), from_ascii("("), from_ascii(")"), ar)); }
false
false
false
false
false
0
ConstantFoldInsertElementInstruction(Constant *Val, Constant *Elt, Constant *Idx) { if (isa<UndefValue>(Idx)) return UndefValue::get(Val->getType()); ConstantInt *CIdx = dyn_cast<ConstantInt>(Idx); if (!...
false
false
false
false
false
0
arma_model_get_n_arma_coeffs (const MODEL *pmod) { int npq = 0; if (pmod->ci == ARMA) { npq += arma_AR_lags(pmod); npq += arma_MA_lags(pmod); npq += gretl_model_get_int(pmod, "arma_P"); npq += gretl_model_get_int(pmod, "arma_Q"); } return npq; }
false
false
false
false
false
0
X509V3_EXT_nconf(CONF *conf, X509V3_CTX *ctx, char *name, char *value) { int crit; int ext_type; X509_EXTENSION *ret; crit = v3_check_critical(&value); if ((ext_type = v3_check_generic(&value))) return v3_generic_extension(name, value, crit, ext_type, ctx); ret = do_ext_nconf(conf, ctx, OBJ_sn2nid(name),...
false
false
false
false
false
0
HealPlayer(Player* target) { CombatManeuverReturns r = PlayerbotClassAI::HealPlayer(target); if (r != RETURN_NO_ACTION_OK) return r; if (!target->isAlive()) { if (ANCESTRAL_SPIRIT && m_ai->CastSpell(ANCESTRAL_SPIRIT, *target)) { std::string msg = "Resurrecting "; ...
false
false
false
false
false
0
WBMPReadInteger(Image *image,size_t *value) { int byte; *value=0; do { byte=ReadBlobByte(image); if (byte == EOF) return(MagickFalse); *value<<=7; *value|=(unsigned int) (byte & 0x7f); } while (byte & 0x80); return(MagickTrue); }
false
false
false
false
false
0
trackMatches( int position, const Meta::TrackList& playlist, int contextCount ) const { foreach( Dynamic::BiasPtr bias, m_biases ) { if( !bias->trackMatches( position, playlist, contextCount ) ) return false; } return tr...
false
false
false
false
false
0
bert_decode_regex(bert_decoder_t *decoder,bert_data_t **data) { bert_data_t *source; int result; if ((result = bert_decoder_pull(decoder,&source)) != 1) { return result; } if (source->type != bert_data_bin) { bert_data_destroy(source); return BERT_ERRNO_INVALID; } bert_data_t *opt_list; if ((result ...
false
false
false
false
false
0
wavefront_task_consider( struct bitmap *b, struct list *list, int x, int y ) { int i,j; for(i=0;(i<block_size) && (x+i-xstart+1)<=xsize;i++) { if(bitmap_get(b,x+i-xstart+1,y-ystart)!=WAVEFRONT_TASK_STATE_COMPLETE) break; } for(j=0;(j<block_size) && (y+j-ystart+1)<=ysize;j++) { if(bitmap_get(b,x-xstart,y+j-yst...
false
false
false
false
false
0
append(const char *text, int len, char **p, char *end) { if (len > end - *p) return (ISC_R_NOSPACE); memmove(*p, text, len); *p += len; return (ISC_R_SUCCESS); }
false
false
false
false
false
0
append(FXchar c,FXint n){ if(0<n){ register FXint len=length(); length(len+n); memset(str+len,c,n); } return *this; }
false
false
false
false
false
0
OnBnClickedPrevFile(wxCommandEvent&) { if (--m_index < 0) { m_index = m_files.size() - 1; } m_file = m_files[m_index]; UpdateData(true); }
false
false
false
false
false
0
btrfs_qgroup_reserve_data(struct inode *inode, u64 start, u64 len) { struct btrfs_root *root = BTRFS_I(inode)->root; struct extent_changeset changeset; struct ulist_node *unode; struct ulist_iterator uiter; int ret; if (!root->fs_info->quota_enabled || !is_fstree(root->objectid) || len == 0) return 0; c...
false
false
false
false
false
0
aliases(const QChar& c) { if(!openDataFile()) { return QStringList(); } const uchar* udata = reinterpret_cast<const uchar*>(dataFile.constData()); const int detailIndex = getDetailIndex(c); if(detailIndex == 0) { return QStringList(); } const quint8 count = * (quint8 *)(udat...
false
false
false
false
false
0
getPresentationSizeMode() { OFString aString; presentationSizeMode.getOFString(aString,0); if (aString=="TRUE SIZE") return DVPSD_trueSize; else if (aString=="MAGNIFY") return DVPSD_magnify; return DVPSD_scaleToFit; }
false
false
false
false
false
0
gen_eth_init(char *device) { char pcap_errbuf[PCAP_ERRBUF_SIZE]; pcap_t *p; #ifndef CYGWIN if (!(p = pcap_open_live(device,2048,TRUE,10,pcap_errbuf))) goto pcap_error; pcap_setdirection(p,PCAP_D_INOUT); #ifdef BIOCFEEDBACK { int on = 1; ioctl(pcap_fileno(p), BIOCFEEDBACK, &on); } #en...
false
false
false
false
false
0
get_free_stripe(struct r5conf *conf, int hash) { struct stripe_head *sh = NULL; struct list_head *first; if (list_empty(conf->inactive_list + hash)) goto out; first = (conf->inactive_list + hash)->next; sh = list_entry(first, struct stripe_head, lru); list_del_init(first); remove_hash(sh); atomic_inc(&conf->...
false
false
false
false
false
0
Suspended() { CC_STATUS status; CMainDocument* pDoc = wxGetApp().GetDocument(); wxASSERT(pDoc); bool result = false; pDoc->GetCoreClientStatus(status); if ( pDoc->IsConnected() && status.task_suspend_reason > 0 && status.task_suspend_reason != SUSPEND_REASON_DISK_SIZE && status.task_s...
false
false
false
false
false
0
x264_encoder_delayed_frames( x264_t *h ) { int delayed_frames = 0; if( h->i_thread_frames > 1 ) { for( int i = 0; i < h->i_thread_frames; i++ ) delayed_frames += h->thread[i]->b_thread_active; h = h->thread[h->i_thread_phase]; } for( int i = 0; h->frames.current[i]; i++ )...
false
false
false
false
false
0
inputMessageEnd(giopStream* g,CORBA::Boolean disgard) { if ( g->pd_strand->state() != giopStrand::DYING ) { if (!disgard && inputRemaining(g)) { if (omniORB::trace(15)) { omniORB::logger l; l << "Garbage left at the end of input message from " << g->pd_strand->connection->peeraddress() << "\n"; ...
false
false
false
false
false
0
snd_soc_tlv320aic23_put_volsw(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); u16 val, reg; val = (ucontrol->value.integer.value[0] & 0x07); /* linear conversion to userspace * 000 = -6db * 001 = -9db * 010 = -12db * 011 = ...
false
false
false
false
false
0
obj_state_init(obj_state_t *state) { int i; state->global = false; memcpy(state->object_base, object_base, sizeof(object_description) * SGE_TYPE_ALL); /* initialize mirroring data structures - only changeable fields */ for (i = 0; i < SGE_TYPE_ALL; i++) { state->lists[i] = NULL; state->...
false
true
false
false
false
1
SetLineNumberColWidth() { ConfigManager* cfg = Manager::Get()->GetConfigManager(_T("editor")); int pixelWidth = m_pOwner->m_pControl->TextWidth(wxSCI_STYLE_LINENUMBER, _T("9")); if(cfg->ReadBool(_T("/margin/dynamic_width"), false)) { int lineNumWidth = 1; in...
false
false
false
false
false
0
clause_table_recurser(clause_table_t* clause_table_in) { if (marked == 0) { marked = 1; if (clause_number != -1) { clause_table_in->clauses[clause_table_in->next_number] = this; clause_table_in->next_number++; } else { for(int i=0; i<num_children; i++) { children[i]->clause_table_recurser(clause_t...
false
false
false
false
false
0
flatterm_compare_vr(Flatterm a, Flatterm b) { Ordertype rc; if (!VARIABLE(a) && !VARIABLE(b)) { if (SYMNUM(a) == SYMNUM(b)) { int i; Flatterm ai = a->next; Flatterm bi = b->next; for (rc = SAME_AS, i = 0; rc == SAME_AS && i < ARITY(a); i++) { rc = flatterm_compare_vr(ai, bi); ai = ai...
false
false
false
false
false
0
IsSkillBonusSpell(uint32 spellId) const { SkillLineAbilityMapBounds bounds = GetSkillLineAbilityMapBounds(spellId); for (SkillLineAbilityMap::const_iterator _spell_idx = bounds.first; _spell_idx != bounds.second; ++_spell_idx) { SkillLineAbilityEntry const* pAbility = _spell_idx->second; if...
false
false
false
false
false
0
fluid_ramsfont_add_izone(fluid_ramsfont_t* sfont, unsigned int bank, unsigned int num, fluid_sample_t* sample, int lokey, int hikey) { /*- find or create a preset - add it the sample using the fluid_rampreset_add_sample fucntion - add the sample to the list of samp...
false
false
false
false
false
0
lp855x_is_valid_rom_area(struct lp855x *lp, u8 addr) { u8 start, end; switch (lp->chip_id) { case LP8550: case LP8551: case LP8552: case LP8553: start = LP855X_EEPROM_START; end = LP855X_EEPROM_END; break; case LP8556: start = LP8556_EPROM_START; end = LP8556_EPROM_END; break; case LP8555: start ...
false
false
false
false
false
0
Trspi_Hash_DAA_PK(Trspi_HashCtx *c, TSS_DAA_PK *pk) { UINT32 i; TSS_RESULT result; result = Trspi_Hash_VERSION(c, &pk->versionInfo); result |= Trspi_Hash_UINT32(c, pk->modulusLength); result |= Trspi_HashUpdate(c, pk->modulusLength, pk->modulus); result |= Trspi_Hash_UINT32(c, pk->capitalSLength); result |= T...
false
false
false
false
false
0
guarded_wait (HANDLE handle, guint32 timeout, gboolean alertable) { guint32 result; MONO_PREPARE_BLOCKING; result = WaitForSingleObjectEx (handle, timeout, alertable); MONO_FINISH_BLOCKING; return result; }
false
false
false
false
false
0