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
gst_tag_list_remove_tag (GstTagList * list, const gchar * tag) { g_return_if_fail (GST_IS_TAG_LIST (list)); g_return_if_fail (tag != NULL); gst_structure_remove_field (GST_TAG_LIST_STRUCTURE (list), tag); }
false
false
false
false
false
0
pfetch(l) long l; /* line number of line to fetch */ { if(l != pline || changes != pchgs) { pline = (l); ptext = fetchline(pline); plen = strlen(ptext); pchgs = changes; } }
false
false
false
false
false
0
Read_content (P_WBXML_INFO buffer) { if (Is_string(buffer)) { Read_string(buffer); } else if (Is_extension(buffer)) { Read_extension(buffer); } else if (Is_entity(buffer)) { Read_entity(buffer); } else if (Is_pi(buffer)) { Read_pi(buffer); } else if (Is_opaque(buffer)) { Read_opaque(buffer); ...
false
false
false
false
false
0
check_keyboard(KEYBOARD *kbp) { UTF32 *p1; UTF8 *p2; STORE *sp; ITEM *p; const char *np; unsigned int n; // Has keyboard name been defined? sp = &kbp->stores[SS_NAME]; if(sp->items == NULL || *sp->items == 0) { np = rindex(fname,'/'); if(np == NULL) np = rindex(fname, '\\'); if(np == NULL) np = rindex...
false
false
false
false
false
0
coalesceLocation(unsigned LocNo) { unsigned KeepLoc = 0; for (unsigned e = locations.size(); KeepLoc != e; ++KeepLoc) { if (KeepLoc == LocNo) continue; if (locations[KeepLoc].isIdenticalTo(locations[LocNo])) break; } // No matches. if (KeepLoc == locations.size()) return; // Keep th...
false
false
false
false
false
0
mprCreateCache(int options) { MprCache *cache; int wantShared; if ((cache = mprAllocObj(MprCache, manageCache)) == 0) { return 0; } wantShared = (options & MPR_CACHE_SHARED); if (wantShared && shared) { cache->shared = shared; } else { cache->mutex = mprCr...
false
false
false
false
false
0
Tk_NumberOfFrames (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { CxImage image; char *ImageName = NULL; Tk_PhotoHandle Photo; GifInfo* item = NULL; // We verify the arguments, we must have two args, not more if( objc != 2) { Tcl_AppendResult (interp, "...
false
false
false
false
false
0
qmonFetchTypeIcon( int type ) { Pixmap pix; DENTER(GUI_LAYER, "qmonFetchTypeIcon"); switch (type) { case TYPE_INT: case TYPE_DOUBLE: pix = qmonGetIcon("int"); break; case TYPE_TIM: pix = qmonGetIcon("time"); break; case TYPE_STR: pix...
false
false
false
false
false
0
ajUrlinRead(AjPUrlin urlin, AjPUrl url) { AjBool ret = ajFalse; AjPQueryList node = NULL; AjBool listdata = ajFalse; if(urlin->Resource) { /* (a) if file still open, keep reading */ ajDebug("ajUrlinRead: input resource '%S' still there, try again\n", urlin->Resource->Id); ret = urlinRea...
false
false
false
false
false
0
foo_scroll_area_scroll (FooScrollArea *area, gint dx, gint dy) { GdkRectangle allocation; GdkRectangle src_area; GdkRectangle move_area; cairo_region_t *invalid_region; gtk_widget_get_allocation (GTK_WIDGET (area), &allocation); allocation.x = 0; allocation...
false
false
false
false
false
0
gfs_read_constant (GtsFile * fp, gpointer domain) { g_return_val_if_fail (fp != NULL, G_MAXDOUBLE); g_return_val_if_fail (domain != NULL, G_MAXDOUBLE); GfsFunction * f = gfs_function_new (gfs_function_constant_class (), 0.); gfs_function_read (f, domain, fp); if (fp->type == GTS_ERROR) return G_MAXDOUBLE...
false
false
false
false
false
0
define_cond_te_avtab(int which) { char *id; avrule_t *avrule; int i; if (pass == 1) { for (i = 0; i < 4; i++) { while ((id = queue_remove(id_queue))) free(id); } return (avrule_t *) 1; /* any non-NULL value */ } if (define_te_avtab_helper(which, &avrule)) return COND_ERR; return avrule; }
false
false
false
false
false
0
isCaptureDestinationSupported(QCameraImageCapture::CaptureDestinations destination) const { if (d_func()->captureDestinationControl) return d_func()->captureDestinationControl->isCaptureDestinationSupported(destination); else return destination == CaptureToFile; }
false
false
false
false
false
0
handleHTTPAuth(Connection *conn, value option) { #if HAVE_DECL_CURLOPT_HTTPAUTH CAMLparam1(option); CAMLlocal1(listIter); CURLcode result = CURLE_OK; long auth = CURLAUTH_NONE; listIter = option; while (!Is_long(listIter)) { switch (Long_val(Field(listIter, 0))) { c...
false
false
false
false
false
0
e2_edit_dialog_create (VPATH *localpath, GtkTextBuffer *buf) { //there is no async thread protection here, as this func can be called from //different contexts - any protection is done by the caller E2_ViewDialogRuntime *vrt; if (localpath != NULL || buf != NULL) { _e2_edit_dialog_create (localpath, buf, &vrt); ...
false
false
false
false
false
0
runAddingNoiseSource(LADSPA_Handle Instance, unsigned long SampleCount) { NoiseSource * psNoiseSource; LADSPA_Data * pfOutput; LADSPA_Data fAmplitude; unsigned long lSampleIndex; psNoiseSource = (NoiseSource *)Instance; fAmplitude = (*(psNoiseSource->m_pfAmplitudeValue) * psNoiseSour...
false
false
false
false
false
0
wps_start(const char *error, DBusMessageIter *iter, void *user_data) { struct interface_connect_data *data = user_data; SUPPLICANT_DBG(""); if (error != NULL) { SUPPLICANT_DBG("error: %s", error); g_free(data->ssid); dbus_free(data); return; } supplicant_dbus_method_call(data->interface->path, SUPPLI...
false
false
false
false
false
0
real_city_report_update_city(struct city *pcity) { GtkTreeIter iter; if (NULL == city_dialog_shell) { return; } if (!city_model_find(GTK_TREE_MODEL(city_model), &iter, pcity)) { gtk_list_store_prepend(city_model, &iter); } city_model_set(city_model, &iter, pcity); update_total_buy_cost(); }
false
false
false
false
false
0
cmp_mask(unsigned char *mask0, unsigned char* mask1, int any, int all) { int i; /* Require that all mask1 bits are present in mask 0 */ if (all) { for (i = 0; i < masksize; ++i) if ((mask0[i] & mask1[i]) != mask1[i]) return 0; return 1; } /* True if any mask1 bits are present in mask 0 */...
false
false
false
false
false
0
bfa_cb_ioim_done(void *drv, struct bfad_ioim_s *dio, enum bfi_ioim_status io_status, u8 scsi_status, int sns_len, u8 *sns_info, s32 residue) { struct scsi_cmnd *cmnd = (struct scsi_cmnd *)dio; struct bfad_s *bfad = drv; struct bfad_itnim_data_s *itnim_data; struct bfad_itnim_s *itnim; u8 host...
false
false
false
false
false
0
sort_by_value(struct sym *list) { int i, n; struct sym *a, *b, *todo, *t; head_ptr = (struct sym *) malloc(sizeof(struct sym)); head_ptr->next = list; a = tail_ptr; for (n=1; a != head_ptr->next; n = n + n) { todo = head_ptr->next; list = head_ptr; while (todo != tail_ptr) { t = t...
false
false
false
false
false
0
e_table_item_will_fit (EPrintable *ep, GtkPrintContext *context, gdouble width, gdouble max_height, gboolean quantize, ETableItemPrintContext *itemcontext) { ETableItem *item = itemcontext->item; const g...
false
false
false
false
false
0
writeExit() { stringstream s; s << "exit ecx"; writeTEXT(s.str()); }
false
false
false
false
false
0
myfgets(char *str,int *size,FILE *fin,unsigned int verbosity) { char *ret; char *hstr=NULL; char last; ret=fgets(str,*size,fin); if (ret == NULL) return NULL; last=str[strlen(str)-1]; while (last != '\n') { *size += INPUT_SIZE; check_alloc(hstr=(char*)calloc((size_t)INPUT_SIZE,(size_t)1)); ...
false
true
false
false
false
1
getDrugNameByDrugId(const QVariant &drugId) { const QVariantList &uids = getDrugUids(drugId); return getDrugName(uids.at(0).toString(), uids.at(1).toString(), uids.at(2).toString()); }
false
false
false
false
false
0
cd_cb(GtkWidget *, gpointer data) { Playlist *pl = (Playlist *)data; CorePlayer *p = pl->GetCorePlayer(); if (p) { pl->Pause(); GDK_THREADS_LEAVE(); p->Stop(); pl->Clear(); if (p->Open("CD.cdda")) { p->Start(); } GDK_THREADS_ENTER(); pl->UnPause(); } }
false
false
false
false
false
0
scan_bin_get_name(scanner_state *pstate, const gs_memory_t *mem, const ref *pnames /*t_array*/, int index, ref *pref, const char *usstring) { /* Convert all errors to e_undefined to match Adobe. */ if (pnames == 0 || array_get(mem, pnames, (long)index, pref) < 0 || !r...
false
false
false
false
false
0
st_describe_actor (ClutterActor *actor) { GString *desc; const char *name; int i; if (!actor) return g_strdup ("[null]"); desc = g_string_new (NULL); g_string_append_printf (desc, "[%p %s", actor, G_OBJECT_TYPE_NAME (actor)); if (ST_IS_WIDGET (actor)) { const cha...
false
false
false
false
false
0
mention_use(int slot) { switch (slot) { case INVEN_WIELD: { if (adj_str_hold[p_ptr->state.stat_ind[A_STR]] < inventory[slot].weight / 10) return "Just lifting"; else return "Wielding"; } case INVEN_BOW: { if (adj_str_hold[p_ptr->state.stat_ind[A_STR]] < inventory[slot].weight / 10) ret...
false
false
false
false
false
0
buildIndex() { //this parses the whole fasta file, so it could be slow if (fa_name==NULL) GError("Error: GFastaIndex::buildIndex() called with no fasta file!\n"); FILE* fa=fopen(fa_name,"rb"); if (fa==NULL) { GMessage("Warning: cannot open fasta index file: %s!\n",fa_name); return 0...
false
false
false
false
false
0
SharedDtor() { if (name_ != &_default_name_) { delete name_; } if (this != default_instance_) { delete options_; } }
false
false
false
false
false
0
getSpillSlotOrReMatPhysReg(int Slot) const { std::map<int, unsigned>::const_iterator I = SpillSlotsOrReMatsAvailable.find(Slot); if (I != SpillSlotsOrReMatsAvailable.end()) { return I->second >> 1; // Remove the CanClobber bit. } return 0; }
false
false
false
false
false
0
ConvertUTF8PstringToRFC1034HostLabel(const mDNSu8 UTF8Name[], domainlabel *const hostlabel) { const mDNSu8 * src = &UTF8Name[1]; const mDNSu8 *const end = &UTF8Name[1] + UTF8Name[0]; mDNSu8 * ptr = &hostlabel->c[1]; const mDNSu8 *const lim = &hostlabel->c[1] + MAX_DOMAIN_LABEL; while (src < en...
false
false
false
false
false
0
_elm_win_focus_out(Ecore_Evas *ee) { Elm_Win_Smart_Data *sd = _elm_win_associate_get(ee); Evas_Object *obj; EINA_SAFETY_ON_NULL_RETURN(sd); obj = ELM_WIDGET_DATA(sd)->obj; elm_object_focus_set(obj, EINA_FALSE); _elm_widget_top_win_focused_set(obj, EINA_FALSE); evas_object_smart_callback_call(obj...
false
false
false
false
false
0
add_type( const TypeSet& types ) { if( types.empty() ) return( OBJECT_TYPE ); else if( types.size() == 1 ) return( *types.begin() ); else { Type type = utypes_.size() + 1; utypes_.push_back( &types ); return( -type ); } }
false
false
false
false
false
0
check_monitor_sanity (monitor **monitors) { int i, j, count = 0; while (monitors[count]) count++; # define X1 monitors[i]->x # define X2 monitors[j]->x # define Y1 monitors[i]->y # define Y2 monitors[j]->y # define W1 monitors[i]->width # define W2 monitors[j]->width # define H1 monitors[i]->height # ...
false
false
false
false
false
0
example_helloworld() #endif { // create device IrrlichtDevice *device = startup(); if (device == 0) #ifdef _IRR_IPHONE_PLATFORM_ return 0; #else return 1; #endif IVideoDriver* driver = device->getVideoDriver(); ISceneManager* smgr = device->getSceneManager(); IGUIEnvironment* gu...
false
false
false
false
false
0
gst_dtmf_src_prepare_message (GstRTPDTMFSrc * dtmfsrc, const gchar * message_name, GstRTPDTMFSrcEvent * event) { GstStructure *s; switch (event->event_type) { case RTP_DTMF_EVENT_TYPE_START: s = gst_structure_new (message_name, "type", G_TYPE_INT, 1, "method", G_TYPE_INT, 1, ...
false
false
false
false
false
0
request_key_auth_destroy(struct key *key) { struct request_key_auth *rka = key->payload.data[0]; kenter("{%d}", key->serial); if (rka->cred) { put_cred(rka->cred); rka->cred = NULL; } key_put(rka->target_key); key_put(rka->dest_keyring); kfree(rka->callout_info); kfree(rka); }
false
false
false
false
false
0
imapx_free_body (struct _CamelMessageContentInfo *cinfo) { struct _CamelMessageContentInfo *list, *next; list = cinfo->childs; while (list) { next = list->next; imapx_free_body (list); list = next; } if (cinfo->type) camel_content_type_unref (cinfo->type); g_free (cinfo->id); g_free (cinfo->description...
false
false
false
false
false
0
r8168_pll_power_down(struct rtl8169_private *tp) { void __iomem *ioaddr = tp->mmio_addr; if ((tp->mac_version == RTL_GIGA_MAC_VER_27 || tp->mac_version == RTL_GIGA_MAC_VER_28 || tp->mac_version == RTL_GIGA_MAC_VER_31 || tp->mac_version == RTL_GIGA_MAC_VER_49 || tp->mac_version == RTL_GIGA_MAC...
false
false
false
false
false
0
_e_fm2_view_menu_common(E_Menu *subm, E_Fm2_Smart_Data *sd) { char buf[64]; E_Menu_Item *mi; char view_mode; int icon_size; view_mode = _e_fm2_view_mode_get(sd); if (!(sd->icon_menu.flags & E_FM2_MENU_NO_VIEW_CHANGE)) { mi = e_menu_item_new(subm); e_menu_item_label_set(mi, _("Gr...
true
true
false
false
false
1
hide_column_by_title(GtkTreeView *treeview, const gchar *header_title, gboolean hidden) { GList *list, *l; const gchar *title; g_assert(NULL != header_title); list = gtk_tree_view_get_columns(treeview); g_assert(NULL != list); for (l = list; NULL != l; l = g_list_next(l)) if (NULL != l->data) { gtk_object...
false
false
false
false
false
0
home() { KUrl u = QUrl::fromLocalFile(QDir::homePath()); setUrl(u, true); }
false
false
false
false
false
0
build_augmented_XTX (const gretl_matrix *X, const gretl_matrix *R, int *err) { gretl_matrix *XTX, *W; int k = X->cols; int kW = k + R->rows; XTX = gretl_matrix_XTX_new(X); W = gretl_zero_matrix_new(kW, kW); if (XTX == NULL || W == NULL) { gretl_matrix_free(XTX); gretl_matri...
false
false
false
false
false
0
skype_strdup_withhtml(const gchar *src) { gulong destsize, i, j; gchar *dest; g_return_val_if_fail(src != NULL, NULL); /* New length is (length of src) + (number of \n's * 3) + (number of &'s * 5) + (number of <'s * 4) + (number of >'s *4) + (number of "'s * 6) - (number of \r's) + 1 */ destsize = 1; for (i = 0...
false
false
false
false
false
0
calculate_want_for_paratrooper(struct unit *punit, struct tile *ptile_city) { struct unit_type* u_type = unit_type(punit); int range = u_type->paratroopers_range; int profit = 0; struct player* pplayer = unit_owner(punit); int total, total_cities; profit += u_type->defense_strength ...
false
false
false
false
false
0
ProcessCurrent(jack_time_t cur_cycle_begin) { if (cur_cycle_begin < fLastSwitchUsecs + 2 * fEngineControl->fPeriodUsecs) { // Signal XRun only for the first failing cycle CheckXRun(cur_cycle_begin); } fGraphManager->RunCurrentGraph(); }
false
false
false
false
false
0
selectAllContent(bool selected) { foreach (AbstractContent * content, m_content) content->setSelected(selected); }
false
false
false
false
false
0
convertenviron(void) { PyObject *d; #ifdef MS_WINDOWS wchar_t **e; #else char **e; #endif d = PyDict_New(); if (d == NULL) return NULL; #if defined(WITH_NEXT_FRAMEWORK) || (defined(__APPLE__) && defined(Py_ENABLE_SHARED)) if (environ == NULL) environ = *_NSGetEnviron(); #endif #...
false
false
false
false
false
0
gtk_psfont_get_by_name(const gchar *name) { GtkPSFont *font; font = find_psfont(name); if (font == NULL) { font = find_psfont(default_font); if (font == NULL) { g_warning ("Error, couldn't locate default font. Shouldn't happen."); } else { g_message ("Postscript font %s not found, using ...
false
false
false
false
false
0
mprSignalDispatcher(MprDispatcher *dispatcher) { if (dispatcher == NULL) { dispatcher = MPR->dispatcher; } mprSignalCond(dispatcher->cond); }
false
false
false
false
false
0
mx_box_layout_set_orientation (MxBoxLayout *box, MxOrientation orientation) { g_return_if_fail (MX_IS_BOX_LAYOUT (box)); if (box->priv->orientation != orientation) { box->priv->orientation = orientation; _mx_box_layout_start_animation (box); clutter_actor_queue_...
false
false
false
false
false
0
vinsn_vec_has_expr_p (vinsn_vec_t vinsn_vec, expr_t expr) { vinsn_t vinsn, expr_vinsn; int n; unsigned i; /* Start with checking expr itself and then proceed with all the old forms of expr taken from its history vector. */ for (i = 0, expr_vinsn = EXPR_VINSN (expr); expr_vinsn; expr_vinsn...
false
false
false
false
false
0
da7219_handle_pdata(struct snd_soc_codec *codec) { struct da7219_priv *da7219 = snd_soc_codec_get_drvdata(codec); struct da7219_pdata *pdata = da7219->pdata; if (pdata) { u8 micbias_lvl = 0; /* Internal LDO */ switch (pdata->ldo_lvl_sel) { case DA7219_LDO_LVL_SEL_1_05V: case DA7219_LDO_LVL_SEL_1_10V: c...
false
false
false
false
false
0
loadFontMap(const char* fontMapFile) { FILE* fd = Sys::fopen(fontMapFile, "r"); if (fd != NULL && fontMapFile[0] == '/') { char buf[1024]; while (fgets(buf, sizeof(buf), fd) != NULL) { size_t len = strcspn(buf, "%\n"); if (len == strlen(buf)) { error(NLS::TEXT("Warning: %s - line too long."), (co...
false
false
false
false
true
1
lame_encode_frame_init(lame_internal_flags * gfc, const sample_t *const inbuf[2]) { SessionConfig_t const *const cfg = &gfc->cfg; int ch, gr; if (gfc->lame_encode_frame_init == 0) { sample_t primebuff0[286 + 1152 + 576]; sample_t primebuff1[286 + 1152 + 576]; int const framesiz...
false
false
false
false
false
0
NewError(const char* maker, const char* type, Handle<JSArray> args) { Handle<String> make_str = Factory::LookupAsciiSymbol(maker); Handle<Object> fun_obj(Top::builtins()->GetProperty(*make_str)); // If the builtins haven't been properly configured ...
false
false
false
false
false
0
main(int argc, char **argv) { int argn; const char *q_name; struct rfc1035_mxlist *mxlist, *p; struct rfc1035_res res; int rc; argn=1; srand(time(NULL)); rfc1035_init_resolv(&res); while (argn < argc) { if (argv[argn][0] == '@') { setns(argv[argn]+1, &res); ++argn; continue; } if (strcmp(a...
false
false
false
false
false
0
system_new(void) { struct SYSTEM *new_sy; int staff, voice; new_sy = (struct SYSTEM *) getarena(sizeof *new_sy); if (parsys == 0) { memset(new_sy, 0, sizeof *new_sy); for (voice = 0; voice < MAXVOICE; voice++) { new_sy->voice[voice].range = -1; new_sy->voice[voice].clef.line = 2; new_sy->voice[voice]....
false
false
false
false
false
0
visu_ui_pairs_update(VisuUiMain *main, VisuData *dataObj, gboolean force) { gboolean visible; VisuNodeArrayIter iter1, iter2; /* GtkTreeIter iter; */ /* gboolean validIter; */ DBG_fprintf(stderr, "Gtk Pairs: build the list of pairs.\n"); /* Not show and not force, so we do nothing. */ g_object_get(G_OBJ...
false
false
false
false
false
0
getBashNumberBase(char *s) { int i = 0; int base = 0; while (*s) { base = base * 10 + (*s++ - '0'); i++; } if (base > 64 || i > 2) { return BASH_BASE_ERROR; } return base; }
false
false
false
false
false
0
busywait_uip_fall(struct timeval *timestamp) { long i; /* * Initialise direct I/O access mode. * This may have been already done previously by the main * initialisation cmos_init(), if the CMOS access mode is direct I/O. * We init it here again, to make busywait_uip_fall() usable in any * other CMOS...
false
false
false
false
false
0
gridfile_flush_pendingchunk(gridfile *gfile) { bson *oChunk; bson q[1]; char* targetBuf = NULL; int res = MONGO_OK; if (gfile->pending_len) { size_t finish_position_after_flush; oChunk = chunk_new( gfile->id, gfile->chunk_num, &targetBuf, gfile->pending_data, gfile->pending_len, gfi...
false
false
false
false
false
0
sample_byte_format (AudioFormat *fmt) { int nbytes = _af_format_sample_size(fmt, false); assert(nbytes == 1 || nbytes == 2); if (nbytes == 1) return "0"; else if (nbytes == 2) { if (fmt->byteOrder == AF_BYTEORDER_BIGENDIAN) return "10"; else return "01"; } /* NOTREACHED */ return NULL; }
false
false
false
false
false
0
wake_up_cmv_ack(struct uea_softc *sc) { BUG_ON(sc->cmv_ack); sc->cmv_ack = 1; wake_up(&sc->sync_q); }
false
false
false
false
false
0
bmz8_search_packed(void *packed_mphf, const char *key, cmph_uint32 keylen) { register cmph_uint8 *h1_ptr = packed_mphf; register CMPH_HASH h1_type = *((cmph_uint32 *)h1_ptr); register cmph_uint8 *h2_ptr; register CMPH_HASH h2_type; register cmph_uint8 *g_ptr, n, h1, h2; h1_ptr += 4; h2_ptr = h1_ptr + hash_sta...
false
false
false
false
false
0
gl_merge_get_src_type (const glMerge *merge) { gl_debug (DEBUG_MERGE, ""); if (merge == NULL) { return GL_MERGE_SRC_IS_FIXED; } g_return_val_if_fail (GL_IS_MERGE (merge), GL_MERGE_SRC_IS_FIXED); return merge->priv->src_type; }
false
false
false
false
false
0
v1_commit_dqblk(struct dquot *dquot) { short type = dquot->dq_id.type; ssize_t ret; struct v1_disk_dqblk dqblk; v1_mem2disk_dqblk(&dqblk, &dquot->dq_dqb); if (((type == USRQUOTA) && uid_eq(dquot->dq_id.uid, GLOBAL_ROOT_UID)) || ((type == GRPQUOTA) && gid_eq(dquot->dq_id.gid, GLOBAL_ROOT_GID))) { dqblk.dqb_...
false
false
false
false
false
0
cxgb3i_dev_open(struct t3cdev *t3dev) { struct cxgbi_device *cdev = cxgbi_device_find_by_lldev(t3dev); struct adapter *adapter = tdev2adap(t3dev); int i, err; if (cdev) { pr_info("0x%p, updating.\n", cdev); return; } cdev = cxgbi_device_register(0, adapter->params.nports); if (!cdev) { pr_warn("device 0x...
false
false
false
false
false
0
tree_read_date(struct view *view, char *text, struct tree_state *state) { if (!text && state->read_date) { state->read_date = FALSE; return TRUE; } else if (!text) { /* Find next entry to process */ const char *log_file[] = { "git", "log", ENCODING_ARG, "--no-color", "--pretty=raw", "--cc", "--raw", v...
false
false
false
false
false
0
pvariable(char **fmt, char *buf) { char *start=*fmt; char c; int len; while (1) { c = *(*fmt)++; if (isalnum((int) c) || (c == '_')) continue; else break; } (*fmt)--; len = *fmt - start; memcpy(buf, start, len); buf[len] = 0; return buf; }
false
false
false
false
false
0
f_range(argvars, rettv) typval_T *argvars; typval_T *rettv; { long start; long end; long stride = 1; long i; int error = FALSE; start = get_tv_number_chk(&argvars[0], &error); if (argvars[1].v_type == VAR_UNKNOWN) { end = start - 1; start = 0; } else { end = get_...
false
false
false
false
false
0
search_command_line(char *name) { int i; for(i=0; i<argc-1; i++) if (argv[i][0] == '-' && !strcmp(argv[i]+1, name)) change_param(argv[i] + 1, argv[i+1]); if (argv[argc-1][0] == '-' && !strcmp(argv[argc-1]+1, name)) change_param(argv[argc-1] + 1, ""); }
false
false
false
false
false
0
root_bounds (FttCell * root, LocateArray * a) { FttVector p; ftt_cell_pos (root, &p); gint i; for (i = 0; i < FTT_DIMENSION; i++) { if ((&p.x)[i] + a->h/2. > a->max[i]) a->max[i] = (&p.x)[i] + a->h/2.; if ((&p.x)[i] - a->h/2. < a->min[i]) a->min[i] = (&p.x)[i] - a->h/2.; } }
false
false
false
false
false
0
compute_outer(int eflag, int vflag) { if (eflag || vflag) { ev_setup(eflag,vflag); } else { evflag = 0; } if (evflag) { if (eflag) { if (vflag) { if (force->newton_pair) { return eval_outer<1,1,1,1,CG_COUL_CUT>(); } else { return eval_outer<1,1,1,0,CG_COUL_...
false
false
false
false
false
0
JVM_FindClassFromClassLoader(JNIEnv *env, const char *name, jboolean init, jobject loader, jboolean throw_error) { Class *class; TRACE("JVM_FindClassFromClassLoader(env=%p, name=%s, init=%d, loader=%p," " throwError=%d)", env, na...
false
false
false
false
false
0
mnt3_parse_dir_exports (rpcsvc_request_t *req, struct mount3_state *ms, char *subdir) { char volname[1024]; struct mnt3_export *exp = NULL; char *volname_ptr = NULL; int ret = -1; if ((!ms) ||...
false
false
false
false
false
0
CacheFileData() { this->containsXMP = false; //assume for now LFA_FileRef file = this->parent->fileRef; this->oldFileSize = LFA_Measure( file ); if ( (this->parent->format == kXMP_WAVFile) && (this->oldFileSize > 0xFFFFFFFF) ) XMP_Throw ( "RIFF_MetaHandler::CacheFileData: WAV Files larger 4GB not supported", kX...
false
false
false
false
false
0
e_selection_data_get_html (GtkSelectionData *selection_data) { GdkAtom data_type; const guchar *data = NULL; gchar *utf8_text; gint length; gint ii; GError *error = NULL; /* XXX May need to do encoding conversions here. * Not worrying about it for now. */ g_return_val_if_fail (selection_data != NULL, NU...
false
false
false
false
false
0
Resize (Canvas* c, int height) { canvas = c; int w = canvas->Width(); int h = height; for (int i = 0; i < p.count; i++) { p.x[i] = Coord((SegData[whichSeg].x[i]+Xorg) * w); p.y[i] = Coord((SegData[whichSeg].y[i]+Yorg) * h); } }
false
false
false
false
false
0
add_offset(FILE * fp, int32_t off) { int32_t net; if (!STORING_PTRS) { net = htonl(off); fwrite(&net, 1, sizeof net, fp); } else { ALLOC(Seekpts, Num_pts + 1); Seekpts[Num_pts] = off; } Num_pts++; }
false
false
false
false
false
0
packnumtonum(const char *a) { if (!a) return 0; if (a[0] == '#') a++; return atoi(a); }
false
false
false
false
true
1
genfmt(SCRN *t, int x, int y, int ofst, const unsigned char *s, int flg) { int *scrn = t->scrn + y * t->co + x; int *attr = t->attr + y * t->co + x; int atr = 0; int col = 0; int c; struct utf8_sm sm; utf8_init(&sm); while ((c = *s++) != '\0') if (c == '\\') { switch (c = *s++) { case 'u': case 'U'...
false
false
false
false
false
0
read_bilevel_raw_scanline() { // cast the bands to the correct type typedef void_vector< UInt8 > vector_type; vector_type & cbands = static_cast< vector_type & >(bands); // read and store UInt8 buf = 0; const unsigned int size = width / 8; // XXX wrong assumption ...
false
false
false
false
false
0
set_group_privs(void) { if (!geteuid()) { const char *name; /* Get username if passed as a uid */ if (ap_unixd_config.user_name[0] == '#') { struct passwd *ent; uid_t uid = atol(&ap_unixd_config.user_name[1]); if ((ent = getpwuid(uid)) == NULL) { ...
false
false
false
false
true
1
gtkutil_file_req_response (GtkWidget *dialog, gint res, struct file_req *freq) { switch (res) { case GTK_RESPONSE_ACCEPT: gtkutil_file_req_done (dialog, freq); break; case GTK_RESPONSE_CANCEL: /* this should call the "destroy" cb, where we free(freq) */ gtk_widget_destroy (freq->dialog); } }
false
false
false
false
false
0
setPrimaryRangeAndReturnNext(UChar32 start, UChar32 end, uint32_t primary, int32_t step, UErrorCode &errorCode) { if(U_FAILURE(errorCode)) { return 0; } UBool isCompressible = isCompressiblePrimary(primary); ...
false
false
false
false
false
0
rt5670_set_bias_level(struct snd_soc_codec *codec, enum snd_soc_bias_level level) { struct rt5670_priv *rt5670 = snd_soc_codec_get_drvdata(codec); switch (level) { case SND_SOC_BIAS_PREPARE: if (SND_SOC_BIAS_STANDBY == snd_soc_codec_get_bias_level(codec)) { snd_soc_update_bits(codec, RT5670_PWR_ANLG1, R...
false
false
false
false
false
0
expandCompositCharAtBegin(UChar *dest, int32_t sourceLength, int32_t destSize,UErrorCode *pErrorCode) { int32_t i = 0,j = 0; int32_t countl = 0; UChar *tempbuffer=NULL; tempbuffer = (UChar *)uprv_malloc((sourceLength+1)*U_SIZEOF_UCHAR); /* Test for NULL */ if(tempbuffer == NULL) {...
false
false
false
false
false
0
sysrq_handle_dbg(int key) { if (!dbg_io_ops) { pr_crit("ERROR: No KGDB I/O module available\n"); return; } if (!kgdb_connected) { #ifdef CONFIG_KGDB_KDB if (!dbg_kdb_mode) pr_crit("KGDB or $3#33 for KDB\n"); #else pr_crit("Entering KGDB\n"); #endif } kgdb_breakpoint(); }
false
false
false
false
false
0
em_delete_or_list(EditLine *el, Int c) { if (el->el_line.cursor == el->el_line.lastchar) { /* if I'm at the end */ if (el->el_line.cursor == el->el_line.buffer) { /* and the beginning */ term_writec(el, c); /* then do an EOF */ return (CC_EOF); } else { /* * Here we could list completions, ...
false
false
false
false
false
0
handle_cli_iax2_set_mtu(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) { int mtuv; switch (cmd) { case CLI_INIT: e->command = "iax2 set mtu"; e->usage = "Usage: iax2 set mtu <value>\n" " Set the system-wide IAX IP mtu to <value> bytes net or\n" " zero to disable. Disabling means ...
false
false
false
false
false
0
qla24xx_tm_iocb_entry(scsi_qla_host_t *vha, struct req_que *req, void *tsk) { const char func[] = "TMF-IOCB"; const char *type; fc_port_t *fcport; srb_t *sp; struct srb_iocb *iocb; struct sts_entry_24xx *sts = (struct sts_entry_24xx *)tsk; sp = qla2x00_get_sp_from_handle(vha, func, req, tsk); if (!sp) return...
false
false
false
false
false
0
standard_radio_setup(struct pine *ps, CONF_S **cl, struct variable *v, CONF_S **first_line) { int i, rindent = 12; CONF_S *ctmpb; PTR_TO_RULEFUNC rulefunc; NAMEVAL_S *f; char b[100]; if(!(cl && *cl)) return; rulefunc = rulefunc_from_var(ps, v); ctmpb = (*cl); (*cl)->flag...
false
false
false
false
false
0
lpCoeffCalc(ALfloat g, ALfloat cw) { ALfloat a = 0.0f; /* Be careful with gains < 0.001, as that causes the coefficient head * towards 1, which will flatten the signal */ if(g < 0.9999f) /* 1-epsilon */ { g = maxf(g, 0.001f); a = (1 - g*cw - aluSqrt(2*g*(1-cw) - g*g*(1 - cw*cw))) /...
false
false
false
false
false
0
loadCampaigns() { PG_ListBox* list = dynamic_cast<PG_ListBox*>( FindChild( "CampaignList", true )); if ( !list ) return; list->sigSelectItem.connect( SigC::slot( *this, &StartMultiplayerGame::campaignSelected )); tfindfile ff ( "*.asccampaign" ); tfindfile::FileInfo fi; while ( ff.g...
false
false
false
false
false
0
sge_get_topology_inuse(const char* qualified_hostname, lList **lpp) { /* this topology is the topology in use which means that characters like S C T are showing not (fully) occupied resources while s c t are showing that they are used */ /* pointer to topology string */ char* topology = N...
false
false
false
false
false
0
Cluster_compute_hue(T_Cluster * c,T_Occurrence_table * to) { int cumul_r,cumul_g,cumul_b; int r,g,b; int nbocc; byte s=0; cumul_r=cumul_g=cumul_b=0; for (r=c->rmin;r<=c->rmax;r++) for (g=c->vmin;g<=c->vmax;g++) for (b=c->bmin;b<=c->bmax;b++) { nbocc=OT_get(to,r,g,b); if (nb...
false
false
false
false
false
0
firstJob() { fxAssert(!jobs.isEmpty(), "No Jobs for Batch::firstJob()"); return *(Job*)jobs.next; }
false
false
false
false
false
0