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
channel_elements_from_change() { rss_item *rip = new rss_item(); rip->handle_change(cp); push_back(rip); }
false
false
false
false
false
0
arm_mangle_type (const_tree type) { arm_mangle_map_entry *pos = arm_mangle_map; /* The ARM ABI documents (10th October 2008) say that "__va_list" has to be managled as if it is in the "std" namespace. */ if (TARGET_AAPCS_BASED && lang_hooks.types_compatible_p (CONST_CAST_TREE (type), va_list_type)) ...
false
false
false
false
false
0
result_item_role_trans_get_forms(result_item_t * item, int forms[5]) { int i, was_run = poldiff_is_run(item->diff, item->bit_pos); if (was_run) { poldiff_get_stats(item->diff, item->bit_pos, item->stats); } for (i = 0; i < 5; i++) { if (!result_item_is_supported(item)) { forms[i] = -1; } else { forms[i]...
false
false
false
false
false
0
pointmap_test_2(int a1, int a2) { // test 2: insert scan + kd_tree in each iteration // -------------------------------------------------- // prepare the laser scan: CObservation2DRangeScan scan1; scan1.aperture = M_PIf; scan1.rightToLeft = true; scan1.validRange.resize( sizeof(SCAN_RANGES_1)/sizeof(SCAN_RANGES...
false
false
false
false
false
0
H5HF_close(H5HF_t *fh, hid_t dxpl_id) { hbool_t pending_delete = FALSE; /* Whether the heap is pending deletion */ haddr_t heap_addr = HADDR_UNDEF; /* Address of heap (for deletion) */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* * Check arguments. ...
false
false
false
false
false
0
read_signature() { guint8 *bytes = (guint8 *)g_malloc(sizeof(guint8) * 4); if (!read(bytes, 4)) { g_free(bytes); return false; } guint32 signature = UNPACK_UB4(bytes, 0); g_free(bytes); #ifdef DEBUG std::printf("signature is %x\n", signature); #endif if (signature == 0x08074b50) { /...
false
false
false
false
false
0
xbaeGetCell(mw, row, column) XbaeMatrixWidget mw; int row, column; { String value; if (row >= mw->matrix.rows || row < 0 || column > mw->matrix.columns - 1 || column < 0) { XtAppWarningMsg( XtWidgetToApplicationContext((Widget) mw), "getCell", "badIndex", "XbaeMa...
false
false
false
false
false
0
ds2482_probe(struct i2c_client *client, const struct i2c_device_id *id) { struct ds2482_data *data; int err = -ENODEV; int temp1; int idx; if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_WRITE_BYTE_DATA | I2C_FUNC_SMBUS_BYTE)) return -ENODEV; if (!(data = kzalloc(sizeof(struc...
false
false
false
false
false
0
OnBrowse(cb_unused wxCommandEvent& event) { wxFileDialog dlg(this, _("Select script file"), XRCCTRL(*this, "txtScript", wxTextCtrl)->GetValue(), XRCCTRL(*this, "txtScript", wxTextCtrl)->GetValue(), FileFilters::GetFilterString(_T("....
false
false
false
false
false
0
applesmc_key_count_show(struct device *dev, struct device_attribute *attr, char *sysfsbuf) { int ret; u8 buffer[4]; u32 count; ret = applesmc_read_key(KEY_COUNT_KEY, buffer, 4); count = ((u32)buffer[0]<<24) + ((u32)buffer[1]<<16) + ((u32)buffer[2]<<8) + buffer[3]; if (ret) return ret; else return...
false
false
false
false
false
0
e_mail_inline_filter_get_multipart (EMailInlineFilter *emif) { GSList *l = emif->parts; CamelMultipart *mp; mp = camel_multipart_new (); while (l) { camel_multipart_add_part (mp, l->data); l = l->next; } return mp; }
false
false
false
false
false
0
__vskipto_modend(int32 targ1) { int32 sav_letendnum; /* SJM 11/30/04 - save and restore edge illegal num errors when skip mod */ sav_letendnum = __letendnum_state; __letendnum_state = TRUE; for (;;) { if (__toktyp == targ1) { __letendnum_state = sav_letendnum; return(TRUE); } switch ((by...
false
false
false
false
false
0
reallocChars(UChar* buffer, size_t length) { ASSERT(length); if (length > maxUChars()) return 0; return static_cast<UChar*>(fastRealloc(buffer, sizeof(UChar) * length)); }
false
false
false
false
false
0
PrepareUnselect () { Application *pApp = m_pDoc->GetApplication (); Tool *pActiveTool = pApp->GetActiveTool (); return (pActiveTool)? pActiveTool->NotifyViewChange (): true; }
false
false
false
false
false
0
fimc_capture_try_selection(struct fimc_ctx *ctx, struct v4l2_rect *r, int target) { bool rotate = ctx->rotation == 90 || ctx->rotation == 270; struct fimc_dev *fimc = ctx->fimc_dev; const struct fimc_variant *var = fimc->variant; const struct fimc_pix_limit *pl = var->pix_limit; struct fimc_f...
false
false
false
false
false
0
slr_trace(int lhs_symbol, int conflict_symbol) { int item; if (slr_visited[lhs_symbol]) return(FALSE); slr_visited[lhs_symbol] = TRUE; for (item = nt_items[lhs_symbol]; item != NIL; item = item_list[item]) { if IS_IN_SET(first, item_table[item].suffix_index, conflict_symbol) ...
false
false
false
false
false
0
reversecount_next_level() { gc_set_background(goo_canvas_get_root_item(gcomprisBoard->canvas), imageList[gcomprisBoard->level-1]); reversecount_destroy_all_items(); gamewon = FALSE; /* Select level difficulty */ switch(gcomprisBoard->level) { case 1: number_of_item_x = 5; number_o...
false
false
false
false
false
0
err_init(size_t param_stack_size) { /* count the reference */ ++G_err_refs; /* ignore this if we're already initialized */ if (G_err_refs > 1) return; /* * allocate the error context, adding in room for the parameter * stack */ G_err = (err_con...
false
false
false
false
false
0
jswrap_math_minmax(JsVar *args, bool isMax) { JsVarFloat v = isMax ? -INFINITY : INFINITY; JsvObjectIterator it; jsvObjectIteratorNew(&it, args); while (jsvObjectIteratorHasValue(&it)) { JsVarFloat arg = jsvGetFloatAndUnLock(jsvObjectIteratorGetValue(&it)); if ((isMax && arg > v) || (!isMax && arg < v)...
false
false
false
false
false
0
_dump_trigger_msg(char *header, trigger_info_msg_t *msg) { int i; if ((slurm_get_debug_flags() & DEBUG_FLAG_TRIGGERS) == 0) return; info("%s", header); if ((msg == NULL) || (msg->record_count == 0)) { info("Trigger has no entries"); return; } info("INDEX TRIG_ID RES_TYPE RES_ID TRIG_TYPE OFFSET UID PROGR...
false
false
false
false
false
0
Sort(struct focusData *AFdata, int size) { if (size>=20) { g_printerr("WARNING: focus array size=%d exceeds 20\n",size); size = 10; } #if (SORT == 1) q_sort(AFdata, 0, size); #elif (SORT == 2) s_sort(AFdata, size); #elif (SORT == 3) i_sort(AFdata, size); #else b_sort(AFdata, size); #endif /*better focus va...
false
false
false
false
false
0
gst_dtmf_src_generate_tone (GstRtpDTMFDepay * rtpdtmfdepay, GstRTPDTMFPayload payload, GstBuffer * buffer) { gint16 *p; gint tone_size; double i = 0; double amplitude, f1, f2; double volume_factor; DTMF_KEY key = DTMF_KEYS[payload.event]; guint32 clock_rate = 8000 /* default */ ; GstBaseRTPDepayload...
false
false
false
false
false
0
make_float_from_integer_scalar_field(int *input_property, float *output_property, int number_of_nodes, int reorder_ice_land_sea_mask){ register int n; if (reorder_ice_land_sea_mask){ for (n=0;n<number_of_nodes;++n){ if ((input_property[n]==0) || (input_property[n]==3)) outpu...
false
false
false
false
false
0
handleAddAndRemove( PP_AttrProp* add_, PP_AttrProp* remove_ ) { // UT_DEBUGMSG(("PD_DocumentRDFMutation::handleAddAndRemove (general) rdf:%p\n", m_rdf)); // m_rdf->apDumpModel( remove_, "remove from model" ); // m_rdf->apDumpModel( add_, "add to model" ); /* * remove all the triples we don't want fi...
false
false
false
false
false
0
getActionTypeString( ActionType type ) { QString ret = tr("Unknown"); switch( type ) { case DATE: ret = tr("date"); break; case FIRSTTIME: ret = tr("first time"); break; case FIRSTTIMELORD: ret = tr("first time lord"); break; case NEXTTIME: ret = tr("next time"); break; case CHANG...
false
false
false
false
false
0
lookupTypeCode(const TypeCode_base* tc, CORBA::Long &offset) { // If this table is a wrapper round another then correct // the offset and pass on the request if (pd_parent_table != 0) { if (pd_parent_table->lookupTypeCode(tc, offset)) { offset = offset - pd_parent_base_offset; return 1;...
false
false
false
false
false
0
receive (const Monitor_Control_Types::NameList& data) { if (this->data_.type_ != Monitor_Control_Types::MC_LIST) { ACE_ERROR ((LM_ERROR, ACE_TEXT ("receive: can't store string values - ") ACE_TEXT ("%s is a numeric type monitor\n"), ...
false
false
false
false
false
0
optimize(THD* thd, HA_CHECK_OPT *check_opt) { int error; if (!file) return HA_ADMIN_INTERNAL_ERROR; MI_CHECK param; myisamchk_init(&param); param.thd = thd; param.op_name= "optimize"; param.testflag= (check_opt->flags | T_SILENT | T_FORCE_CREATE | T_REP_BY_SORT | T_STATISTICS | T_SORT_...
false
false
false
false
false
0
pgsql_set_realm_option_one(u08bits *realm, unsigned long value, const char* opt) { int ret = -1; char statement[TURN_LONG_STRING_SIZE]; PGconn *pqc = get_pqdb_connection(); if(pqc) { { snprintf(statement,sizeof(statement),"delete from turn_realm_option where realm='%s' and opt='%s'",realm,opt); PGresult *r...
true
true
false
false
false
1
gx_render_ht_default(gx_ht_cache * pcache, int b_level) { const gx_ht_order *porder = &pcache->order; int level = porder->levels[b_level]; gx_ht_tile *bt; if (pcache->num_cached < porder->num_levels ) bt = &pcache->ht_tiles[level / pcache->levels_per_tile]; else bt = &pcache->ht_ti...
false
false
false
false
false
0
pdacf_pcm_capture_open(struct snd_pcm_substream *subs) { struct snd_pcm_runtime *runtime = subs->runtime; struct snd_pdacf *chip = snd_pcm_substream_chip(subs); if (chip->chip_status & PDAUDIOCF_STAT_IS_STALE) return -EBUSY; runtime->hw = pdacf_pcm_capture_hw; runtime->private_data = chip; chip->pcm_substream...
false
false
false
false
false
0
clone(GAGenome::CloneMethod flag) const { GA3DBinaryStringGenome *cpy = new GA3DBinaryStringGenome(nx,ny,nz); if(flag == CONTENTS){ cpy->copy(*this); } else{ cpy->GAGenome::copy(*this); cpy->minX = minX; cpy->minY = minY; cpy->minZ = minZ; cpy->maxX = maxX; cpy->maxY = maxY; cpy->maxZ = maxZ; ...
false
false
false
false
false
0
totem_pl_parser_can_parse_from_data (const char *data, gsize len, gboolean debug) { char *mimetype; guint i; g_return_val_if_fail (data != NULL, FALSE); /* Bad cast! */ mimetype = totem_pl_parser_mime_type_from_data ((gpointer) data, (int) len); if (mimetype == NULL) { D(g_message ("totem_p...
false
false
false
false
false
0
received_netpacket(const std::string &channel, const CL_NetPacket &packet, CL_NetComputer_Generic *comp) { if (show_debug) CL_Log::log("debug", "Netpacket arrived in %1", channel); received_netpackets[channel].push(PacketCompPair(packet, CL_NetComputer(comp))); }
false
false
false
false
false
0
leave(struct mddev *mddev) { struct md_cluster_info *cinfo = mddev->cluster_info; if (!cinfo) return 0; /* BITMAP_NEEDS_SYNC message should be sent when node * is leaving the cluster with dirty bitmap, also we * can only deliver it when dlm connection is available */ if (cinfo->slot_number > 0 && mddev->rec...
false
false
false
false
false
0
contagion (const cl_N& x) { if (realp(x)) { DeclareType(cl_R,x); return x; } else { DeclareType(cl_C,x); return contagion(realpart(x),imagpart(x)); } }
false
false
false
false
false
0
maximum_array_range_semnode(Array_range_semnode *dst_head, Array_range_semnode *src_head) { Array_range_semnode *dst, *src; int cmp; for (dst = dst_head, src = src_head; dst != NULL && src != NULL; dst = dst->next_dim, src = src->next_dim) { if (dst->lo...
false
false
false
false
false
0
option_register(option_list_t** list, const char* prefix, option_new_t constructor, option_delete_t destructor, option_set_t setter, option_get_n_t getter_n, option_get_t getter, void* object) { option_list_t* temp; temp = g_malloc(sizeof(option_list_t)); ...
false
false
false
false
false
0
addDataHeaders(std::list<std::string> &headers, std::string &data)/*{{{*/ { std::ostringstream contentlength; contentlength << "Content-Length: " << data.size(); headers.push_back(contentlength.str()); }
false
false
false
false
false
0
accept() { QModelIndex symbol = m_view->currentIndex(); if (symbol.isValid()) { quint32 unicode = symbol.internalId(); // Remove symbol from recent list for (int i = 0, count = m_recent->columnCount(); i < count; ++i) { QTableWidgetItem* item = m_recent->item(0, i); if (item && (item->data(Qt::UserRole)....
false
false
false
false
false
0
grid_lines2_log(double x_lo, double x_hi, double y_lo, double y_hi, unsigned int segs, unsigned int base) { if (segs == 0) return; const double dy((y_hi-y_lo)/segs); const double denom(log(base)); for (unsigned int i=0; i < segs; ++i) for (unsigned int j=1; j<base; ++j) { do...
false
false
false
false
false
0
emit_client(const char *mask, const char *passwd, const char *class, long maxlinks, int is_ip) { char *delim; size_t len; delim = strchr(mask, '@'); if (delim) { *delim++ = '\0'; if (is_ip) { len = strspn(delim, "0123456789.*"); if (delim[len]) { ...
false
false
false
false
false
0
e1000_poll_for_msg(struct e1000_hw *hw) { struct e1000_mbx_info *mbx = &hw->mbx; int countdown = mbx->timeout; if (!mbx->ops.check_for_msg) goto out; while (countdown && mbx->ops.check_for_msg(hw)) { countdown--; udelay(mbx->usec_delay); } /* if we failed, all future posted messages fail until reset */ ...
false
false
false
false
false
0
StateRestore(int version) { if (bbrk & 2) { FixMMC3PRG(MMC3_cmd); FixMMC3CHR(MMC3_cmd); } else Sync(); }
false
false
false
false
false
0
check_toggled (GtkCellRendererToggle *cellrenderertoggle, gchar *path, GtkTreeView *view) { GtkTreeModel *model; GtkTreeIter iter; model = gtk_tree_view_get_model (view); g_return_if_fail (CRYPTUI_IS_KEY_STORE (model)); g_assert (path != NULL); if (gtk_tree_model_get_iter_from_str...
false
false
false
false
false
0
addValue (const vector<string> &fromList, double &to, int index, int lineNum) { try { to = atof(fromList.at(index).c_str()); } catch(std::out_of_range& e) { cerr << endl << "*****" << endl << "*****ERROR: requested column exceeds the number of columns in file at line " << lineNum...
false
false
false
false
false
0
mstoix (infile, outfile) FILE *infile; /* input file */ FILE *outfile; /* output file */ { int c; enum state state = NONE; /* lone LF => unchanged, lone CR => unchanged, CR LF => LF, ^Z at end means EOF; ^Z elsewhere => unchanged */ while (1) { /* break out on EOF only */...
false
false
false
false
false
0
ooWriteStackCommand(OOStackCommand *cmd) { ast_mutex_lock(&gCmdChanLock); if (write(gCmdChan, (char*)cmd, sizeof(OOStackCommand)) == -1) { ast_mutex_unlock(&gCmdChanLock); return OO_FAILED; } ast_mutex_unlock(&gCmdChanLock); return OO_OK; }
false
false
false
false
false
0
set_prefix (char *p) { char *s; prefix_lead_space = 0; while (*p == ' ') { prefix_lead_space++; p++; } prefix = p; prefix_full_length = strlen (p); s = p + prefix_full_length; while (s > p && s[-1] == ' ') s--; *s = '\0'; prefix_length = s - p; }
false
false
false
false
false
0
reserve_crashkernel(void) { unsigned long long crash_size, crash_base, total_mem; bool high = false; int ret; total_mem = memblock_phys_mem_size(); /* crashkernel=XM */ ret = parse_crashkernel(boot_command_line, total_mem, &crash_size, &crash_base); if (ret != 0 || crash_size <= 0) { /* crashkernel=X,high */...
false
false
false
false
false
0
lad_sm_make_access_concat_qr(SemTree *vss, int p, int q) { if (p != 1) vss = make_semtree(OPE_MUL, vss, make_semtree_const_int(p)); if (q != 0) vss = concat_semtree(OPE_ADD, vss, make_semtree_const_int(q)); return vss; }
false
false
false
false
false
0
loadExtensions() { foreach( QString path, Moose::extensionPaths() ) { LOGL( 3, "Loading extension: " << path ); QObject* plugin = QPluginLoader( path ).instance(); if ( !plugin ) { LOGL( 1, "Failed to load " << path ); continue; } LOGL( 3, "E...
false
false
false
false
false
0
ipSystemStatsTable_allocate_rowreq_ctx(ipSystemStatsTable_data * data, void *user_init_ctx) { ipSystemStatsTable_rowreq_ctx *rowreq_ctx = SNMP_MALLOC_TYPEDEF(ipSystemStatsTable_rowreq_ctx); DEBUGMSGTL(("internal:ipSystemStatsTable:ipSystemStatsTable_allocate_rowre...
false
false
false
false
false
0
string_to_int8(const char *buf, const char *pend, TDS_INT8 * res) { enum { blank = ' ' }; const char *p; int sign; TDS_UINT8 num; /* we use unsigned here for best overflow check */ p = buf; /* ignore leading spaces */ while (p != pend && *p == blank) ++p; if (p == pend) { *res = 0; return TDS_SUCCEED;...
false
false
false
false
false
0
Requeue(const char *Article, const char *MessageID) { int fd; /* Temp file already open? */ if (BATCHfp == NULL) { fd = mkstemp(BATCHtemp); if (fd < 0) { syswarn("cannot create a temporary file"); ExitWithStats(1); } BATCHfp = fdopen(fd, "w"); ...
false
false
false
false
true
1
vtkSynchronizedTemplatesCutter3DInitializeOutput( int *ext,vtkImageData *input, vtkPolyData *o) { vtkPoints *newPts; vtkCellArray *newPolys; long estimatedSize; estimatedSize = (int) pow ((double) ((ext[1]-ext[0]+1)*(ext[3]-ext[2]+1)*(ext[5]-ext[4]+1)), .75); if (estimatedSize < 1024) { ...
false
false
false
false
false
0
reset_all_lattr_db(struct lattr_db *db) { struct lattr_db *n; for (n = db; n; n=n->next) { n->hole = 1; n->ehole = n->end; n->first_invalid = 1; n->invalid_window = -1; clear_state(n->buffer+0); } }
false
false
false
false
false
0
gkrellm_gtk_config_launcher(GtkWidget *table, gint n, GtkWidget **launch_entry, GtkWidget **tooltip_entry, gchar *desc, GkrellmLauncher *launch) { GtkWidget *label, *hbox; gchar buf[64]; gint row; if (!table || !launch_entry) return; row = (tooltip_entry ? 2 : 1) * n; hbox = gtk_hbox_new(FALSE, 0); /...
false
false
false
false
false
0
generate_proxy_certificate (common_info_st * cinfo) { gnutls_x509_crt_t crt, eecrt; gnutls_privkey_t key, eekey; size_t size; int result; fprintf (stderr, "Generating a proxy certificate...\n"); eekey = load_ca_private_key (cinfo); eecrt = load_cert (1, cinfo); crt = generate_certificate (&key, eecrt...
false
false
false
false
false
0
notifyCurl(CURLM *curl, curl_socket_t s, int evBitmask, const char *info) { int numhandles = 0; CURLMcode result = curl_multi_socket_action(curl, s, evBitmask, &numhandles); if (result != CURLM_OK) { fprintf(stderr, "Curl error on %s: %i (%s)\n", info, result, curl_multi_str...
false
false
false
false
false
0
RequestData( vtkInformation *vtkNotUsed(request), vtkInformationVector **inputVector, vtkInformationVector *outputVector) { vtkInformation* inInfo = inputVector[0]->GetInformationObject(0); vtkHierarchicalBoxDataSet *input = vtkHierarchicalBoxDataSet::SafeDownCast( inInfo->Get(vtkDataObject::DATA_OBJECT()...
false
false
false
false
false
0
rfkill_event(GIOChannel *chan, GIOCondition cond, gpointer data) { unsigned char buf[32]; struct rfkill_event *event = (void *) buf; struct btd_adapter *adapter; char sysname[PATH_MAX]; ssize_t len; int fd, id; if (cond & (G_IO_NVAL | G_IO_HUP | G_IO_ERR)) return FALSE; fd = g_io_channel_unix_get_fd(cha...
false
false
false
false
false
0
wl18xx_cmd_radar_detection_debug(struct wl1271 *wl, u8 channel) { struct wl18xx_cmd_dfs_radar_debug *cmd; int ret = 0; wl1271_debug(DEBUG_CMD, "cmd radar detection debug (chan %d)", channel); cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); if (!cmd) return -ENOMEM; cmd->channel = channel; ret = wl1271_cmd_...
false
false
false
false
false
0
gamgi_mesa_pick_direction (gamgi_direction *direction, int class, gamgi_object **array) { gamgi_dlist *dlist; double rotate[16]; unsigned char color_old[3], color_new[3]; if (class == GAMGI_ENGINE_DIRECTION) { *array++ = GAMGI_CAST_OBJECT direction; gamgi_mesa_select_old (color_old); gamgi_mesa_select_new (co...
false
false
false
false
false
0
email_handler(vector_t *strvec) { vector_t *email_vec = read_value_block(); int i; char *str; for (i = 0; i < vector_size(email_vec); i++) { str = vector_slot(email_vec, i); alloc_email(str); } free_strvec(email_vec); }
false
false
false
false
false
0
gen_ldexpxf3 (rtx operand0, rtx operand1, rtx operand2) { rtx operand3; rtx operand4; rtx _val = 0; start_sequence (); { rtx operands[5]; operands[0] = operand0; operands[1] = operand1; operands[2] = operand2; #line 14463 "../../src/gcc/config/i386/i386.md" { if (optimize_insn_for_size_p (...
false
false
false
false
false
0
operator-(const BigInt& x, const BigInt& y) { const u32bit x_sw = x.sig_words(), y_sw = y.sig_words(); s32bit relative_size = bigint_cmp(x.data(), x_sw, y.data(), y_sw); #ifdef BOTAN_TYPES_QT BigInt z(BigInt::Positive, qMax(x_sw, y_sw) + 1); #else BigInt z(BigInt::Positive, std::max(x_sw, y_sw) + 1); #...
false
false
false
false
false
0
circle_rect_overlap(struct coord c, unit_type r, struct coord min, struct coord max, enum allow_overlap allow) { if (allow == ao_touch) { if (c.x <= min.x-r || c.x >= max.x+r) return 0; if (c.y <= min.y-r || c.y >= max.y+r) return 0; } if (c.x < min.x-r || c.x > max.x+r) return 0; if (c.y < min.y-r ...
false
false
false
false
false
0
main(int argc, char *argv[]) { int i = 1; if(argc == 1) { printf("You only have one argument. You suck!\n"); } else if (argc > 1 && argc < 4) { printf("Here's your arguments:\n"); for(i = 0; i < argc; i++) { printf("%s \n", argv[i]); } } else { prin...
false
false
false
false
false
0
pfs_poll_clear( int pid ) { int i; for(i=0;i<poll_table_size;i++) { if(poll_table[i].pid==pid) poll_table[i].pid = -1; } for(i=0;i<sleep_table_size;i++) { if(sleep_table[i].pid==pid) sleep_table[i].pid = -1; } }
false
false
false
false
false
0
printContextField( FlmRecord * pRec, void * pvField, FLMUINT uiFieldCounter, FLMBOOL bReadOnly) { RCODE rc = FERR_OK; FLMUINT uiRecPointer; if (RC_OK( rc = pRec->getRecPointer( pvField, &uiRecPointer))) { if (bReadOnly) { fnPrintf( m_pHRequest, "<font color=\"0db3ae\">%lu</font>", (unsigned ...
false
false
false
false
false
0
HandleRenameRequest(const std::vector<string>& argv, std::string* out) { if(argv[0] == "Address" && argv.size() >= 3) { Address* a = memory_.ResolveToAddress(0, argv[1]); LOG(INFO) << "Renaming " << a->get_name() << " to " << argv[2]; memory_.Rename(a, argv[2]); } return true; }
false
false
false
false
false
0
xillybus_autoflush(struct work_struct *work) { struct delayed_work *workitem = container_of( work, struct delayed_work, work); struct xilly_channel *channel = container_of( workitem, struct xilly_channel, rd_workitem); int rc; rc = xillybus_myflush(channel, -1); if (rc == -EINTR) dev_warn(channel->endpoint-...
false
false
false
false
false
0
radeon_semaphore_emit_signal(struct radeon_device *rdev, int ridx, struct radeon_semaphore *semaphore) { struct radeon_ring *ring = &rdev->ring[ridx]; trace_radeon_semaphore_signale(ridx, semaphore); if (radeon_semaphore_ring_emit(rdev, ridx, ring, semaphore, false)) { --semaphore->waiters; /* fo...
false
false
false
false
false
0
clutter_get_script_id (GObject *gobject) { g_return_val_if_fail (G_IS_OBJECT (gobject), NULL); if (CLUTTER_IS_SCRIPTABLE (gobject)) return clutter_scriptable_get_id (CLUTTER_SCRIPTABLE (gobject)); else return g_object_get_data (gobject, "clutter-script-id"); }
false
false
false
false
false
0
containsArray(const Expr& e) { if (e.getKind() == ARRAY) return true; Expr::iterator i = e.begin(), iend=e.end(); for(; i!=iend; ++i) if (containsArray(*i)) return true; return false; }
false
false
false
false
false
0
in_process_proc (void *cls, const char *plugin_name, enum EXTRACTOR_MetaType type, enum EXTRACTOR_MetaFormat format, const char *data_mime_type, const char *data, size_t data_len) { struct InProcessContext *ctx = cls; int ret; if (0 != ctx->finished) return 1; ret = ctx->proc (ctx->proc_c...
false
false
false
false
false
0
snd_ctl_tlv_ioctl(struct snd_ctl_file *file, struct snd_ctl_tlv __user *_tlv, int op_flag) { struct snd_card *card = file->card; struct snd_ctl_tlv tlv; struct snd_kcontrol *kctl; struct snd_kcontrol_volatile *vd; unsigned int len; int err = 0; if (copy_...
false
false
false
false
true
1
OutputXmlTestInfo(::std::ostream* stream, const char* test_case_name, const TestInfo& test_info) { const TestResult& result = *test_info.result(); *stream << " <testcase name=\"" << EscapeXmlAttribute(test...
false
false
false
false
false
0
mgt_cli_askchild(unsigned *status, char **resp, const char *fmt, ...) { int i, j; va_list ap; unsigned u; char buf[params->cli_buffer], *p; if (resp != NULL) *resp = NULL; if (status != NULL) *status = 0; if (cli_i < 0|| cli_o < 0) { if (status != NULL) *status = CLIS_CANT; return (CLIS_CANT); } va...
true
true
false
false
true
1
get_seq(uint8_t &seq) { uint8_t tmp = seq; seq++; if (seq > 0x3F) { // seq rolls over after 0x3F seq = 0x00; } return tmp; }
false
false
false
false
false
0
map_utf8(char *dest, size_t dest_len, utf8_ptr src, size_t src_byte_len, size_t *src_bytes_used) const { utf8_ptr src_start; size_t cur_total; char *srcend; wchar_t *destw; /* remember where we started */ src_start = src; /* compute where the source buff...
false
false
false
false
false
0
main() { if ( !initiateConnection()) { printf("Abort.\r\n"); camera.disconnect(); return 0; } printf("Connected to camera. Operating with %d baudrate.\r\n", camera.baudrate()); char *reply = camera.responseData(); printf("Version: \"%s\"\r\n", reply); printf("Image-size: "); uint8_t s = camera.getImageSi...
false
false
false
false
false
0
on_add_user(InfUser* user) { g_assert(find_user_iter(user) == m_store->children().end()); Gtk::TreeIter iter = m_store->append(); (*iter)[m_columns.user] = user; (*iter)[m_columns.notify_status_handle] = g_signal_connect( G_OBJECT(user), "notify::status", G_CALLBACK(on_notify_status_static), this); if(INF_TE...
false
false
false
false
false
0
evas_cache_engine_image_dup(const Evas_Cache_Engine_Image_Func *cb, Evas_Cache_Engine_Image *brother) { Evas_Cache_Engine_Image *new; new = calloc(1, sizeof (Evas_Cache_Engine_Image)); if (!new) return NULL; new->func = brother->func; #define ORD(Func) if (cb->Func) new->func.Func = cb->Func; ...
false
false
false
false
false
0
new_mode (enum mode_class class, const char *name, const char *file, unsigned int line) { struct mode_data *m; m = find_mode (name); if (m) { error ("%s:%d: duplicate definition of mode \"%s\"", trim_filename (file), line, name); error ("%s:%d: previous definition here", m->file, m->line...
false
false
false
false
false
0
palmas_gpio_probe(struct platform_device *pdev) { struct palmas *palmas = dev_get_drvdata(pdev->dev.parent); struct palmas_platform_data *palmas_pdata; struct palmas_gpio *palmas_gpio; int ret; const struct of_device_id *match; const struct palmas_device_data *dev_data; match = of_match_device(of_palmas_gpio_ma...
false
false
false
false
false
0
mov_read_mdhd(MOVContext *c, ByteIOContext *pb, MOVAtom atom) { AVStream *st; MOVStreamContext *sc; int version; char language[4] = {0}; unsigned lang; if (c->fc->nb_streams < 1) return 0; st = c->fc->streams[c->fc->nb_streams-1]; sc = st->priv_data; version = get_byte(pb);...
true
true
false
false
false
1
snd_request_card(int card) { if (snd_card_locked(card)) return; if (card < 0 || card >= cards_limit) return; request_module("snd-card-%i", card); }
false
false
false
false
false
0
_PyLong_DivmodNear(PyObject *a, PyObject *b) { PyLongObject *quo = NULL, *rem = NULL; PyObject *one = NULL, *twice_rem, *result, *temp; int cmp, quo_is_odd, quo_is_neg; /* Equivalent Python code: def divmod_near(a, b): q, r = divmod(a, b) # round up if either r / b > 0.5, ...
false
false
false
false
true
1
evalEdge(Gpr_t * state, Expr_t* prog, comp_block * xprog, Agedge_t * e) { int i; case_stmt *cs; int okay; state->curobj = (Agobj_t *) e; for (i = 0; i < xprog->n_estmts; i++) { cs = xprog->edge_stmts + i; if (cs->guard) okay = (exeval(prog, cs->guard, state)).integer; else okay = 1; i...
false
false
false
false
false
0
i7300_remove_one(struct pci_dev *pdev) { struct mem_ctl_info *mci; char *tmp; edac_dbg(0, "\n"); if (i7300_pci) edac_pci_release_generic_ctl(i7300_pci); mci = edac_mc_del_mc(&pdev->dev); if (!mci) return; tmp = ((struct i7300_pvt *)mci->pvt_info)->tmp_prt_buffer; /* retrieve references to resources, an...
false
false
false
false
false
0
findFileFormat(const char *filename, l_int32 *pformat) { l_int32 ret; FILE *fp; PROCNAME("findFileFormat"); if (!pformat) return ERROR_INT("&format not defined", procName, 1); *pformat = IFF_UNKNOWN; if (!filename) return ERROR_INT("filename not defined", procNa...
false
false
false
false
false
0
SPRxPTH (int hpos, uae_u16 v, int num) { decide_sprites (hpos); if (hpos - 1 != spr[num].ptxhpos) { spr[num].pt &= 0xffff; spr[num].pt |= (uae_u32)v << 16; } #if SPRITE_DEBUG > 0 if (vpos >= SPRITE_DEBUG_MINY && vpos <= SPRITE_DEBUG_MAXY) { write_log (_T("%d:%d:SPR%dPTH %06X\n"), vpos, hpos, num, spr[num].pt)...
false
false
false
false
false
0
get_element(const String& aname) { // $charset if(aname==CHARSET_NAME) return new VString(*new String(fcharsets.client().NAME(), String::L_TAINTED)); // $headers if(aname==REQUEST_HEADERS_ELEMENT_NAME) return new VHash(ffields); // $method if(Value* result=VStateless_object::get_element(aname)) return re...
false
false
false
false
false
0
checkrtol(z,i1,i2,c) char *z, *c; int i1, i2; { int i; i = i2; while (i >= i1) { if (strchr(c,z[i]) != NULL) return(i); if (z[i]==')') i = matchlf(z,i1,i,'(',')'); if (z[i]==']') i = matchlf(z,i1,i,'[',']'); i--; if (lf_error) return(-1); } return(-1); }
false
false
false
false
false
0
encodeNumber(double indata) { // GNASH_REPORT_FUNCTION; double num; // Encode the data as a 64 bit, big-endian, numeric value // only one additional byte for the type boost::shared_ptr<Buffer> buf(new Buffer(AMF0_NUMBER_SIZE + 1)); *buf = Element::NUMBER_AMF0; num = indata; swapBytes(&num...
false
false
false
false
false
0
pager_cksum(Pager *pPager,const unsigned char *zData) { sxu32 cksum = pPager->cksumInit; /* Checksum value to return */ int i = pPager->iPageSize-200; /* Loop counter */ while( i>0 ){ cksum += zData[i]; i -= 200; } return cksum; }
false
false
false
false
false
0
main(int argc, char **argv) { l_int32 i, index; l_float32 cputime, epo; char *filein, *fileout; PIX *pixs, *pixd; SEL *sel; SELA *sela; static char mainName[] = "morphtest1"; if (argc != 3) return ERROR_INT(" Syntax: morphtest1 filein fileout", mainName, ...
false
false
false
false
false
0
Save() { ThrowingFwrite(&m_numScoreComponent, sizeof(m_numScoreComponent), 1, m_outFile); ThrowingFwrite(&m_multipleScoreTrees, sizeof(m_multipleScoreTrees), 1, m_outFile); for(size_t i = 0; i < m_scoreTrees.size(); i++) m_scoreTrees[i]->Save(m_outFile); m_compressedScores->save(m_outFile); }
false
false
false
false
false
0