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
startServer() { if (d->daemon.isEmpty()) d->daemon = findDaemon(); if (d->daemon.isEmpty()) return -1; if (!isServerSGID()) { kWarning(kdesuDebugArea()) << k_lineinfo << "kdesud not setgid!"; } // kdesud only forks to the background after it is accepting // connections. // W...
false
false
false
false
false
0
HalfImageSize(const Image& image) { int rows, cols, nrows, ncols, r, c, ri, ci; Image newimage; rows = image.rows; cols = image.cols; nrows = rows / 2; ncols = cols / 2; newimage.setSize(nrows, ncols); const FloatMatrix& im = image.pixels; FloatMatrix& _new = newimage.pixels; ...
false
false
false
false
false
0
_mesa_align_realloc(void *oldBuffer, size_t oldSize, size_t newSize, unsigned long alignment) { #if defined(_WIN32) && defined(_MSC_VER) (void) oldSize; return _aligned_realloc(oldBuffer, newSize, alignment); #else const size_t copySize = (oldSize < newSize) ? oldSize : newSize; void *ne...
false
true
false
false
false
1
do_push(const char *repo, int flags) { int i, errs; struct remote *remote = remote_get(repo); if (!remote) die("bad repository '%s'", repo); if (remote->mirror) flags |= (TRANSPORT_PUSH_MIRROR|TRANSPORT_PUSH_FORCE); if ((flags & (TRANSPORT_PUSH_ALL|TRANSPORT_PUSH_MIRROR)) && refspec) return -1; if ((fla...
false
false
false
false
false
0
finish_transfer(const char *fname, const char *fnametmp, const char *fnamecmp, const char *partialptr, struct file_struct *file, int ok_to_set_time, int overwriting_basis) { int ret; const char *temp_copy_name = partialptr && *partialptr != '/' ? partialptr : NULL; if (inplace) { if (DEBUG_GTE(R...
false
false
false
false
false
0
exc(PyObject *module_dict, PyObject **exception, char *longName, char *itemString, char *doc) { PyObject *s, *exc_d; if (!(s = PyString_FromString(doc))) return 1; if (!(exc_d = PyDict_New())) { Py_DECREF(s); return 1; } if (PyD...
false
false
false
false
false
0
dm_make_request(struct request_queue *q, struct bio *bio) { int rw = bio_data_dir(bio); struct mapped_device *md = q->queuedata; int srcu_idx; struct dm_table *map; map = dm_get_live_table(md, &srcu_idx); generic_start_io_acct(rw, bio_sectors(bio), &dm_disk(md)->part0); /* if we're suspended, we have to queue...
false
false
false
false
false
0
inotifytools_watch_files( char const * filenames[], int events ) { niceassert( init, "inotifytools_initialize not called yet" ); error = 0; static int i; for ( i = 0; filenames[i]; ++i ) { static int wd; wd = inotify_add_watch( inotify_fd, filenames[i], events ); if ( wd < 0 ) { if ( wd == -1 ) { erro...
true
true
true
false
true
1
Update(uint32 p_time) { // update time m_time += p_time; // main event loop EventList::iterator i; while (((i = m_events.begin()) != m_events.end()) && i->first <= m_time) { // get and remove event from queue BasicEvent* Event = i->second; m_events.erase(i); if ...
false
false
false
false
false
0
define(s) char *s; { char c, *name, *val; if (isalpha(c = *s) || c == '_') s = getidt(name = s - 1, s); /* get name */ else return "$define: missing name"; if (*s == '(') return "$define: \"(\" after name requires preceding space"; val = s = wskip(s); if (*s != '\0') { whi...
false
false
false
false
true
1
all_positions(chain_list* head, chain_list* elemchain, void* data) { chain_list *chain, *list_elem, *pred=NULL; if (!elemchain) { elemchain=addchain(NULL,data); return addchain(head,elemchain); } /*insert elem on a lower position*/ list_elem=all_positions(NULL,elemchain->NEXT,data...
false
false
false
true
false
1
qib_read_kreg32(const struct qib_devdata *dd, const u16 regno) { if (!dd->kregbase || !(dd->flags & QIB_PRESENT)) return -1; return readl((u32 __iomem *)&dd->kregbase[regno]); }
false
false
false
false
false
0
Clear () { map<string, Object*>::iterator i; while (!m_Children.empty ()) { i = m_Children.begin (); (*i).second->m_Parent = NULL; delete (*i).second; m_Children.erase ((*i).first); } }
false
false
false
false
false
0
ad7923_scan_direct(struct ad7923_state *st, unsigned ch) { int ret, cmd; cmd = AD7923_WRITE_CR | AD7923_CHANNEL_WRITE(ch) | AD7923_SEQUENCE_WRITE(AD7923_SEQUENCE_OFF) | st->settings; cmd <<= AD7923_SHIFT_REGISTER; st->tx_buf[0] = cpu_to_be16(cmd); ret = spi_sync(st->spi, &st->scan_single_msg); if (ret) re...
false
false
false
false
false
0
OnAddExtraPathClick(cb_unused wxCommandEvent& event) { EditPathDlg dlg(this, _T(""), _T(""), _("Add directory")); PlaceWindow(&dlg); if (dlg.ShowModal() == wxID_OK) { wxListBox* control = XRCCTRL(*this, "lstExtraPaths", wxListBox); if (control) { wxString path = dlg....
false
false
false
false
false
0
toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod) { //printf("TypeBasic::toCBuffer2(mod = %d, this->mod = %d)\n", mod, this->mod); if (mod != this->mod) { toCBuffer3(buf, hgs, mod); return; } buf->writestring(dstring); }
false
false
false
false
false
0
decodesigs(void) { char buffer[32769]; fflush(stdin); while(fgets(buffer, sizeof(buffer), stdin)) { cli_chomp(buffer); if(!strlen(buffer)) break; if(decodesig(buffer, -1) == -1) return -1; } return 0; }
true
true
false
false
false
1
WriteNeededFunctions( void *theEnv, FILE *fp) { unsigned long int space, count = 0, length; struct FunctionDefinition *functionList; /*================================================*/ /* Assign each function an index if it is needed. */ /*================================================*/ fo...
false
false
false
false
false
0
enchant_pwl_add(EnchantPWL *pwl, const char *const word, size_t len) { enchant_pwl_refresh_from_file(pwl); enchant_pwl_add_to_trie(pwl, word, len); if (pwl->filename != NULL) { FILE *f; f = enchant_fopen(pwl->filename, "a"); if (f) { struct stat stats; enchant_lock_file (f); if(g_stat...
false
false
false
false
false
0
clutter_input_device_sequence_grab (ClutterInputDevice *device, ClutterEventSequence *sequence, ClutterActor *actor) { ClutterActor *grab_actor; g_return_if_fail (CLUTTER_IS_INPUT_DEVICE (device)); g_return_if_fail (CLUTTER_IS_ACTO...
false
false
false
false
false
0
printable(isccc_region_t *r) { unsigned char *curr; curr = r->rstart; while (curr != r->rend) { if (!isprint(*curr)) return (ISC_FALSE); curr++; } return (ISC_TRUE); }
false
false
false
false
false
0
adns__vbuf_append(vbuf *vb, const byte *data, int len) { int newlen; void *nb; newlen= vb->used+len; if (vb->avail < newlen) { if (newlen<20) newlen= 20; newlen <<= 1; nb= realloc(vb->buf,newlen); if (!nb) { newlen= vb->used+len; nb= realloc(vb->buf,newlen); } if (!nb) return 0; vb->buf...
false
false
false
false
false
0
emit_urb_write_opcode(bool complete) { /* We don't care whether the vertex is complete, because in general * geometry shaders output multiple vertices, and we don't terminate the * thread until all vertices are complete. */ (void) complete; vec4_instruction *inst = emit(GS_OPCODE_URB_WRITE); in...
false
false
false
false
false
0
snapshotView() { if (!mSnapshotFilename.isEmpty()) { //mSnapshoter = QPixmap::grabWindow(mpGameView->winId()); mSnapshoter = QPixmap::grabWidget(this); QString tmpFilename = mSnapshotFolder + mSnapshotFilename + QString("_") + getTimeString() + QString(".png...
false
false
false
false
false
0
gst_object_ref_sink (gpointer object) { g_return_val_if_fail (object != NULL, NULL); #ifdef DEBUG_REFCOUNT GST_CAT_TRACE_OBJECT (GST_CAT_REFCOUNTING, object, "%p ref_sink %d->%d", object, ((GObject *) object)->ref_count, ((GObject *) object)->ref_count + 1); #endif return g_object_ref_sink (object); ...
false
false
false
false
false
0
set_data(const char *d, int len) { if (data && local_data) delete[] data; data = new char[len]; memcpy(data, d, len); length = len; local_data = true; }
false
false
false
false
false
0
target_pick(int y1, int x1, int dy, int dx, struct point_set *targets) { int i, v; int x2, y2, x3, y3, x4, y4; int b_i = -1, b_v = 9999; /* Scan the locations */ for (i = 0; i < point_set_size(targets); i++) { /* Point 2 */ x2 = targets->pts[i].x; y2 = targets->pts[i].y; /* Directed distance */ x3 ...
false
false
false
false
false
0
run_coopt(/*@observer@*/ /*@null@*/ /*@unused@*/ const char* cooptsh, /*@observer@*/ /*@unused@*/ const char* binaryname) { /* Note: Params are marked unused because they may not be used if sh isn't supported. */ /* Assume that sh exists if #! does; sh is needed to run autoconf, so this would ...
true
true
false
false
false
1
__connmanctl_dbus_set_property(DBusConnection *connection, const char *path, const char *interface, connmanctl_dbus_method_return_func_t cb, void * user_data, const char *property, int type, void *value) { DBusMessage *message; DBusMessageIter iter; message = dbus_message_new_method_call("net.connman", path, ...
false
false
false
false
false
0
chk1_pndparam(char *s1, struct inst_t *ip, struct namparam_t *npmp, int32 pi, int32 npi) { int32 rv, sav_sfnam_ind, sav_slin_cnt; struct mod_t *imdp; struct net_t *parm_np; /* SJM 10/01/99 - improve error location for param checking */ /* chk param expr needs sim locations set - set temporary guess here */ sav_...
true
true
false
false
false
1
ReadReply(mud_channel *pc) { char buf[HPMUD_LINE_SIZE]; int len=0, num=0; char *tail; enum HPMUD_RESULT stat; stat = jd_s_channel_read(pc, buf, sizeof(buf), 2, &len); buf[len] = 0; if (stat == HPMUD_R_OK) num = strtol((char *)buf, &tail, 10); return num; }
false
false
false
false
false
0
negate_const(Constp cp) #endif { if (cp == (struct Constblock *) NULL) return; switch (cp -> vtype) { case TYINT1: case TYSHORT: case TYLONG: #ifdef TYQUAD case TYQUAD: #endif cp -> Const.ci = - cp -> Const.ci; break; case TYCOMPLEX: case TYDCOMPLEX: if (cp->vstg) switch(*cp->Const.cds...
false
false
false
false
false
0
gx_cpath_assign_preserve(gx_clip_path * pcpto, gx_clip_path * pcpfrom) { int code = gx_path_assign_preserve(&pcpto->path, &pcpfrom->path); gx_clip_rect_list *fromlist = pcpfrom->rect_list; gx_clip_rect_list *tolist = pcpto->rect_list; gx_path path; if (code < 0) return 0; if (fromlist =...
false
false
false
false
false
0
AddCurrentStack() { TickSampleEventRecord record(enqueue_order_); TickSample* sample = &record.sample; Isolate* isolate = Isolate::Current(); sample->state = isolate->current_vm_state(); sample->pc = reinterpret_cast<Address>(sample); // Not NULL. for (StackTraceFrameIterator it(isolate); !it.done()...
false
false
false
false
false
0
netup_read_i2c(struct i2c_adapter *i2c_adap, u8 addr, u8 reg, u8 *buf, int len) { int ret; struct i2c_msg msg[] = { { .addr = addr, .flags = 0, .buf = &reg, .len = 1 }, { .addr = addr, .flags = I2C_M_RD, .buf = buf, .len = len } }; ret = i2c_transfer(i2c_adap, msg, 2); if (ret...
false
false
false
false
false
0
think_unite_against_big_enemy() { if( info.game_date - info.game_start_date < 365 * 3 * (100+pref_military_development) / 100 ) // only do this after 3 to 6 years into the game { return 0; } //-----------------------------------------------// if( config.ai_aggressiveness < OPTION_HIGH ) return 0; if( c...
false
false
false
false
false
0
e_illume_border_is_qt_frame(E_Border *bd) { /* make sure we have a border */ if (!bd) return EINA_FALSE; /* make sure we have the icccm name and compare it */ if ((bd->client.icccm.name) && (!strncmp(bd->client.icccm.name, "VCLSalFrame", 11))) return EINA_TRUE; /* return a fallback */ ...
false
false
false
false
false
0
saveFile(AbutFsel *fsel, void *packet, const char *fname) { GmpPlay *l = packet; assert(MAGIC(l)); str_copy(&l->cg->lastDirAccessed, &fsel->pathVal); if (fname != NULL) { clp_setStr(l->cg->clp, "local.sgfName", butTextin_get(fsel->in)); sgf_writeFile(l->moves, fname, NULL); } l->fsel = NULL; }
false
false
false
false
false
0
open_listener(aClient *cptr) { aConfItem *aconf; int dolisten = 1; aconf = cptr->confs->value.aconf; if (!IsListener(cptr) || cptr->fd > 0) { return; } #ifdef UNIXPORT if (*aconf->host == '/') { if (unixport(cptr, aconf->host, aconf->port)) { cptr->fd = -1; } } else #endif { if (IsConfDelay...
false
false
false
false
false
0
qla2300_pci_config(scsi_qla_host_t *vha) { uint16_t w; unsigned long flags = 0; uint32_t cnt; struct qla_hw_data *ha = vha->hw; struct device_reg_2xxx __iomem *reg = &ha->iobase->isp; pci_set_master(ha->pdev); pci_try_set_mwi(ha->pdev); pci_read_config_word(ha->pdev, PCI_COMMAND, &w); w |= (PCI_COMMAND_PAR...
false
false
false
false
false
0
hasAddress(const giopAddress* addr) { giopAddressList::const_iterator ai; for (ai = pd_addresses.begin(); ai != pd_addresses.end(); ++ai) { if (*ai == addr) { return 1; } } return 0; }
false
false
false
false
false
0
Execute () { Editor* ed = GetEditor(); if (ReadyToClose(ed)) { Component* comp = ed->GetComponent(); if (comp == nil) { unidraw->Close(ed); } else { unidraw->CloseDependents(comp->GetRoot()); } Iterator i; for (;;) { unid...
false
false
false
false
false
0
fix_length_and_dec() { ulonglong char_length= 0; if (agg_arg_charsets_for_string_result(collation, args, arg_count)) return; for (uint i=0 ; i < arg_count ; i++) char_length+= args[i]->max_char_length(); fix_char_length_ulonglong(char_length); }
false
false
false
false
false
0
gkrellm_client_plugin_get_setup(gchar *key_name, void (*setup_func_cb)(gchar *str)) { GList *list; gchar *line, *s; gint n; if (!_GK.client_mode || !key_name || !setup_func_cb) return; for (list = client_plugin_setup_line_list; list; list = list->next) { line = (gchar *) list->data; n = strlen(key_na...
false
false
false
false
false
0
parsearg(const char *var, const char *value) { if (strcmp(var, "host") == 0) { strncpy (monhost, value, sizeof(monhost)); monhost[sizeof(monhost) - 1] = '\0'; } else if (strcmp(var, "refresh") == 0) { refresh = atoi(value); if (refresh < 0) { refresh = DEFAULT_REFRE...
false
false
false
false
false
0
archive_write_add_filter_lrzip(struct archive *_a) { struct archive_write_filter *f = __archive_write_allocate_filter(_a); struct write_lrzip *data; archive_check_magic(_a, ARCHIVE_WRITE_MAGIC, ARCHIVE_STATE_NEW, "archive_write_add_filter_lrzip"); data = calloc(1, sizeof(*data)); if (data == NULL) { archi...
false
false
false
false
false
0
faulthandler_traverse(PyObject *module, visitproc visit, void *arg) { #ifdef FAULTHANDLER_USER unsigned int signum; #endif #ifdef FAULTHANDLER_LATER Py_VISIT(thread.file); #endif #ifdef FAULTHANDLER_USER if (user_signals != NULL) { for (signum=0; signum < NSIG; signum++) Py_VISIT(user_s...
false
false
false
false
false
0
DoInstructionSelection() { DEBUG(errs() << "===== Instruction selection begins:\n"); PreprocessISelDAG(); // Select target instructions for the DAG. { // Number all nodes with a topological order and set DAGSize. DAGSize = CurDAG->AssignTopologicalOrder(); // Create a dummy node (which is n...
false
false
false
false
false
0
original_register (regno) unsigned int regno; { rtx original_rtx = ssa_rename_from_lookup (regno); return original_rtx != NULL_RTX ? REGNO (original_rtx) : regno; }
false
false
false
false
false
0
gp2a_initialize(struct gp2a_data *dt) { int error; error = i2c_smbus_write_byte_data(dt->i2c_client, GP2A_ADDR_GAIN, 0x08); if (error < 0) return error; error = i2c_smbus_write_byte_data(dt->i2c_client, GP2A_ADDR_HYS, 0xc2); if (error < 0) return error; error = i2c_smbus_write_byte_data(dt->i...
false
false
false
false
false
0
get_authtime(OM_uint32 *minor_status, gsskrb5_ctx ctx, gss_buffer_set_t *data_set) { gss_buffer_desc value; unsigned char buf[4]; OM_uint32 authtime; HEIMDAL_MUTEX_lock(&ctx->ctx_id_mutex); if (ctx->ticket == NULL) { HEIMDAL_MUTEX_unlock(&ctx->ctx_id_mutex); _gsskrb5_set_status(EINVA...
false
false
false
false
false
0
compile_string(zval *source_string, char *filename TSRMLS_DC) { zend_lex_state original_lex_state; zend_op_array *op_array = (zend_op_array *) emalloc(sizeof(zend_op_array)); zend_op_array *original_active_op_array = CG(active_op_array); zend_op_array *retval; zval tmp; int compiler_result; zend_bool original_in...
false
false
false
false
false
0
mbfl_encoding_detector_new2(const mbfl_encoding **elist, int elistsz, int strict) { mbfl_encoding_detector *identd; int i, num; mbfl_identify_filter *filter; if (elist == NULL || elistsz <= 0) { return NULL; } /* allocate */ identd = (mbfl_encoding_detector*)mbfl_malloc(sizeof(mbfl_encoding_detector)); if ...
false
false
false
false
false
0
childFailed(Child* childDl) { msg("childFailed: %1", childDl->source() ? childDl->source()->location() :"[deleted source]"); // No: delete childDl; }
false
false
false
false
false
0
addIntDropdown( const ASCString& name, const StringArray& names, int defaultValue ) { intValues[name] = defaultValue; new PG_PropertyField_IntDropDown<int,vector<ASCString>::const_iterator>( propertyEditor, name, &intValues[name], names.values.begin(), names.values.end() ); }
false
false
false
false
false
0
draw_net_chart_labels(NetMon *net) { GkrellmChart *cp = net->chart; gchar buf[128]; if (!net->chart_labels) return; format_net_data(net, text_format_locale, buf, sizeof(buf)); if (!net->new_text_format) gkrellm_chart_reuse_text_format(cp); net->new_text_format = FALSE; gkrellm_draw_chart_text(cp, net_sty...
false
false
false
false
false
0
raid_write_end_io(struct bio *bio) { struct btrfs_raid_bio *rbio = bio->bi_private; int err = bio->bi_error; if (err) fail_bio_stripe(rbio, bio); bio_put(bio); if (!atomic_dec_and_test(&rbio->stripes_pending)) return; err = 0; /* OK, we have read all the stripes we need to. */ if (atomic_read(&rbio->er...
false
false
false
false
false
0
inode_find (inode_table_t *table, uuid_t gfid) { inode_t *inode = NULL; if (!table) { gf_log_callingfn (THIS->name, GF_LOG_WARNING, "table not found"); return NULL; } pthread_mutex_lock (&table->lock); { inode = __inode_find (ta...
false
false
false
false
false
0
ip_addr(const char *ipbuf, int len, struct in_addr *addr) { /* Four octets and three periods yields at most 15 characters. */ if (len > 15) return -1; addr->s_addr = inet_addr(ipbuf); if (addr->s_addr == INADDR_NONE && strcmp(ipbuf, "255.255.255.255") != 0) return -1; return 0; }
false
false
false
false
false
0
putb_unp(buf, len, t) u_char *buf; u_int len; FILE *t; { u_int i, j; crcval = crcbuf(crcval, len, buf); if (!t) return; #if !DOS if (!image) { #if _MTS atoe(buf, len); #endif if (gotcr) { gotcr = 0; if (buf[0] != '\n') putc('\r', t); } for (i=0,j=0; i<len; i++) if (buf[i] != '\r' || buf...
false
false
false
false
true
1
PromptLine(const char *Text) { cout << Text << ':' << endl; string Res; getline(cin,Res); return Res; }
false
false
false
false
false
0
exists ( void ) const throw () { struct stat st; if ( stat( (const char*)fileName, &st) == -1 ) { return false; } return S_ISREG( st.st_mode); }
false
false
false
false
false
0
explain_buffer_errno_execvp_system_call(explain_string_buffer_t *sb, int errnum, const char *pathname, char *const *argv) { (void)errnum; explain_string_buffer_puts(sb, "execvp(pathname = "); explain_buffer_pathname(sb, pathname); explain_string_buffer_puts(sb, ", argv = "); if (explain_is_efaul...
false
false
false
false
false
0
invariant_Init(Clause& goal_condition) { cl_cnt = 0; playground.clear(); playground.resize(gnum_relevant_facts,FL_NONE); clauses.clear(); //fixed size from now on -- reallocate would kill us! clauses.resize(gnum_relevant_facts,0); for (size_t i = 0; i < goal_condition.size(); i++) { int con...
false
false
false
false
false
0
find_and_exec_command(const struct cavan_command_map *map, size_t count, int argc, char *argv[]) { const struct cavan_command_map *p; const char *pcmd; if (argc > 1 && argv[1][0] == '@') { pcmd = argv[1] + 1; argc--; argv++; } else { const char *q = pcmd = argv[0]; while (1) { switch (*q) { ...
false
false
false
false
false
0
sender(void *send_info, struct ipmi_smi_msg *msg) { struct ssif_info *ssif_info = (struct ssif_info *) send_info; unsigned long oflags, *flags; BUG_ON(ssif_info->waiting_msg); ssif_info->waiting_msg = msg; flags = ipmi_ssif_lock_cond(ssif_info, &oflags); start_next_msg(ssif_info, flags); i...
false
false
false
false
false
0
lbitset_andn_cmp (bitset dst, bitset src1, bitset src2) { lbitset_elt *selt1 = LBITSET_HEAD (src1); lbitset_elt *selt2 = LBITSET_HEAD (src2); bool changed; if (!selt2) { return lbitset_copy_cmp (dst, src1); } else if (!selt1) { lbitset_weed (dst); changed = !LBITSET_HEAD (dst); ...
false
false
false
false
false
0
set_semantics(Topform c) { if (c->semantics == SEMANTICS_NOT_EVALUATED) { clock_start(Eval_clock); eval_in_interps(c); clock_stop(Eval_clock); } }
false
false
false
false
false
0
on_item_created (GooCanvas *canvas, GooCanvasItem *item, GooCanvasItemModel *model, gpointer data) { if (g_object_get_data (G_OBJECT (model), "parent1")) { g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), NULL); } }
false
false
false
false
false
0
CheckNotop(infoexpressao expr){ infoexpressao res; if(expr.tipo != LOGICO) OperandoNaoNegavel(); res.tipo = LOGICO; res.opnd.tipo = VAROPND; res.opnd.atr.simb = NovaTemp(res.tipo); GeraQuadrupla(OPNOT, expr.opnd, opndidle, res.opnd); return res; }
false
false
false
false
false
0
gom_mixer_mute(enum gom_info_types std_verb) { int c; for (c=gom_driver_c_first(); c > -1; c=gom_driver_c_next(c, 1)) gom_mixer_c_mute(std_verb+1, c); gom_info(std_verb, "All channels muted."); }
false
false
false
false
false
0
brcms_c_antsel_antcfg2antsel(struct antsel_info *asi, u8 ant_cfg) { u8 idx = BRCMS_ANTIDX_11N(BRCMS_ANTSEL_11N(ant_cfg)); u16 mimo_antsel = 0; if (asi->antsel_type == ANTSEL_2x4) { /* 2x4 antenna diversity board, 4 cfgs: 0-2 0-3 1-2 1-3 */ mimo_antsel = (mimo_2x4_div_antselpat_tbl[idx] & 0xf); return mimo_ant...
false
false
false
false
false
0
acpi_als_read_value(struct acpi_als *als, char *prop, s32 *val) { unsigned long long temp_val; acpi_status status; status = acpi_evaluate_integer(als->device->handle, prop, NULL, &temp_val); if (ACPI_FAILURE(status)) { ACPI_EXCEPTION((AE_INFO, status, "Error reading ALS %s", prop)); return -EIO; }...
false
false
false
false
false
0
StorageTouch(void) { ++m_moveCount; if (m_moveCount == 0) { m_moveCount = 1; } }
false
false
false
false
false
0
pixWriteStreamTiff(FILE *fp, PIX *pix, l_int32 comptype) { TIFF *tif; PROCNAME("pixWriteStreamTiff"); if (!fp) return ERROR_INT("stream not defined", procName, 1 ); if (!pix) return ERROR_INT("pix not defined", procName, 1 ); if (pixGetDe...
false
false
false
false
false
0
st_drawing_area_paint (ClutterActor *self) { StDrawingArea *area = ST_DRAWING_AREA (self); StDrawingAreaPrivate *priv = area->priv; StThemeNode *theme_node = st_widget_get_theme_node (ST_WIDGET (self)); ClutterActorBox allocation_box; ClutterActorBox content_box; int width, height; CoglColor color; guin...
false
false
false
false
false
0
grpNoComment(AjPStr* text) { ajint i; char *cp; ajStrTrimWhite(text); i = ajStrGetLen(*text); if(!i) /* empty string */ return; cp = strchr(ajStrGetPtr(*text), '#'); if(cp) { /* comment found */ *cp = '\0'; ajStrSetValid(text); } return; }
false
false
false
false
false
0
EyeboxOne_showcursor (Driver *drvthis, int on) { PrivateData * p = drvthis->private_data; if (on) { write(p->fd, "\E[S", 3); debug(RPT_DEBUG, "EyeBO: cursor turned on"); } else { write(p->fd, "\E[s", 3); debug(RPT_DEBUG, "EyeBO: cursor turned off"); } }
false
false
false
false
false
0
opendir(const char *path) { char new_path[1024]; CHECK_INIT(); DEBUG("libs_wrap: opendir: %s...\n", path); if (is_sysfs_file(path)) { convert_sysfs_path(new_path, sizeof(new_path), path); path = new_path; } return real_opendir(path); }
false
false
false
false
false
0
parsePage() { XmlAttributes att; if (!parseAttributes(att)) return false; iStream << "<page"; writeAttr(att, "title"); writeAttr(att, "section"); writeAttr(att, "subsection"); iStream << ">\n"; String tag = parseToTag(); while (tag == "layer" || tag == "view") { XmlAttributes att; if (!p...
false
false
false
false
false
0
zend_std_compare_objects(zval *o1, zval *o2 TSRMLS_DC) /* {{{ */ { zend_object *zobj1, *zobj2; zobj1 = Z_OBJ_P(o1); zobj2 = Z_OBJ_P(o2); if (zobj1->ce != zobj2->ce) { return 1; /* different classes */ } return zend_compare_symbol_tables_i(zobj1->properties, zobj2->properties TSRMLS_CC); }
false
false
false
false
false
0
operator<<(std::ostream &s, const ByteVector &v) { for(TagLib::uint i = 0; i < v.size(); i++) s << v[i]; return s; }
false
false
false
false
false
0
ui_init(int argc,char **argv) { if(!use_ui) { non_ui_init(); return; } used_curses_ui=1; initscr(); cbreak(); noecho(); curs_set(0); /* remove cursor (if possible) */ keypad(stdscr,TRUE); nodelay(stdscr,1); /* XXX do I need to enable SIGWINCH handling in ncurses myself? */ /* check term size */ if(COLS<80 |...
false
false
false
false
false
0
ndmta_local_mover_read (struct ndm_session *sess, unsigned long long offset, unsigned long long length) { struct ndm_tape_agent * ta = &sess->tape_acb; struct ndmp9_mover_get_state_reply *ms = &ta->mover_state; char * errstr = 0; if (ms->state != NDMP9_MOVER_STATE_ACTIVE && ms->state != NDMP9_MOVER_STATE_LIS...
false
false
false
false
false
0
strnopbrk(string, charset) const char *string; const char *charset; { unsigned char table[256]; /* assumes CHAR_BITS is 8 */ const unsigned char *string_p = (const unsigned char *)string; const unsigned char *charset_p = (const unsigned char *)charset; memset(table, 0, sizeof(table)); whil...
false
false
false
false
false
0
init_prim_types(int ncid) { nctype_t *tp; int i; int types[] = { NC_BYTE, NC_CHAR, NC_SHORT, NC_INT, NC_FLOAT, NC_DOUBLE #ifdef USE_NETCDF4 , NC_UBYTE, NC_USHORT, NC_UINT, NC_INT64, NC_UINT64, NC_STRING #endif /* USE_NETCDF4 */ }; size_t sizes[] = { sizeof(char), sizeof(char), sizeof(...
false
false
false
false
false
0
io_strip_bom(VALUE io) { VALUE b1, b2, b3, b4; if (NIL_P(b1 = rb_io_getbyte(io))) return 0; switch (b1) { case INT2FIX(0xEF): if (NIL_P(b2 = rb_io_getbyte(io))) break; if (b2 == INT2FIX(0xBB) && !NIL_P(b3 = rb_io_getbyte(io))) { if (b3 == INT2FIX(0xBF)) { return rb_utf8_encindex(); } ...
false
false
false
false
false
0
choose_render(struct intel_context *intel, struct vertex_buffer *VB) { int vertsz = intel->vertex_size; int cost_render = 0; int cost_fallback = 0; int nr_prims = 0; int nr_rprims = 0; int nr_rverts = 0; int rprim = intel->reduced_primitive; int i = 0; for (i = 0; i < VB->PrimitiveCount; i++...
false
false
false
false
false
0
gm_searchable_text_view_replace(GtkTextView *text_view, gchar const *replace) { GtkTextBuffer *buffer = NULL; GtkTextIter end, start; buffer = gtk_text_view_get_buffer(text_view); if (buffer) { if (!gtk_text_buffer_get_selection_bounds(buffer, &start, &end)) { return FALSE; } else { gtk_text_buffer_beg...
false
false
false
false
false
0
linmap_search_01716_ats_uint_type_2cats_ptr_type (ats_ptr_type arg0, ats_uint_type arg1, ats_clo_ref_type arg2, ats_ref_type arg3) { /* local vardec */ ATSlocal (ats_bool_type, tmp13) ; ATSlocal (ats_ptr_type, tmp14) ; ATSlocal (ats_bool_type, tmp26) ; ATSlocal (ats_ptr_type, tmp27) ; __ats_lab_linmap_search_01716_ats...
false
false
false
false
false
0
yy_ListContinuationBlock() { int yypos0= yypos, yythunkpos0= yythunkpos; yyDo(yyPush, 1, 0); yyprintf((stderr, "%s\n", "ListContinuationBlock")); if (!yy_StartList()) goto l1104; yyDo(yySet, -1, 0); yyText(yybegin, yyend); if (!(YY_BEGIN)) goto l1104; l1105:; { int yypos1106= yypos, yythunkpos1106= yythun...
false
false
false
false
false
0
loop_invariant_p (loop, x) const struct loop *loop; rtx x; { struct loop_info *loop_info = LOOP_INFO (loop); struct loop_regs *regs = LOOP_REGS (loop); int i; enum rtx_code code; const char *fmt; int conditional = 0; rtx mem_list_entry; if (x == 0) return 1; code = GET_CODE (x); switc...
false
false
false
false
false
0
scanopen (char *file) { FILE *f; f = fopen (file, "r"); if (!f && dir) { char path[1024]; strcpy (path, dir); strcat (path, "/"); strcat (path, file); f = fopen (path, "r"); } return f; }
false
false
false
false
false
0
tokenbuf_free( tokenbuf_t *buf) { if (buf->begin != NULL && buf->buffer_size > 0) free((char *)buf->begin); buf->begin = buf->end = NULL; buf->buffer_size = 0; return; }
false
false
false
false
false
0
cmd_prereq_domain(const char *lp, nsupdate_params_t *params, unsigned type) { UNUSED(type); DBG("%s: lp='%s'\n", __func__, lp); scanner_t *s = params->rrp; int ret = parse_partial_rr(s, lp, PARSE_NODEFAULT|PARSE_NAMEONLY); if (ret != KNOT_EOK) { return ret; } return ret; }
false
false
false
false
false
0
change_notify(const char *from, user_t *to, const char *fmt, ...) { va_list args; char buf[BUFSIZE]; va_start(args, fmt); vsnprintf(buf, BUFSIZE, fmt, args); va_end(args); if (is_internal_client(to)) return; if (to->myuser != NULL && to->myuser->flags & MU_QUIETCHG) return; notice_user_sts(user_find_name...
true
true
false
false
true
1
_dbus_keyring_get_best_key (DBusKeyring *keyring, DBusError *error) { DBusKey *key; _DBUS_ASSERT_ERROR_IS_CLEAR (error); key = find_recent_key (keyring); if (key) return key->id; /* All our keys are too old, or we've never loaded the * keyring. Create a new one. ...
false
false
false
false
false
0
print_byte_count(char *buf, size_t len, double number) { if (number < 0) { snprintf(buf, len, "-----"); return; } // K is Kelvin, k is kilo const char *units = " kMGTPEZY"; for (;;) { if (*units != ' ') { if (number < 10) { snprintf(buf, len, "%4.2f%cB", number, *units); re...
false
false
false
false
false
0
ctpl_output_stream_write (CtplOutputStream *stream, const gchar *data, gssize length, GError **error) { gsize len; len = (length < 0) ? strlen (data) : (gsize)length; return g_output_stream_write (G_OU...
false
false
false
false
false
0
addMatrix(const c8* attributeName, const core::matrix4& v) { Attributes.push_back(new CMatrixAttribute(attributeName, v)); }
false
false
false
false
false
0