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
bitmatch(const unsigned char *a, const unsigned char *b, int n) { if(n >= 8) { if(memcmp(a, b, n / 8) != 0) return 0; } if(n % 8 != 0) { int mask = (~0) << (8 - n % 8); if((a[n / 8] & mask) != (b[n / 8] & mask)) return 0; } return 1; }
false
false
false
false
false
0
lto_tag_check_range (enum LTO_tags actual, enum LTO_tags tag1, enum LTO_tags tag2) { if (actual < tag1 || actual > tag2) internal_error ("bytecode stream: tag %s is not in the expected range " "[%s, %s]", lto_tag_name (actual), lto_tag_name (tag1), lto_tag_name (tag2)); }
false
false
false
false
false
0
DirectFunctionCall5(PGFunction func, Datum arg1, Datum arg2, Datum arg3, Datum arg4, Datum arg5) { FunctionCallInfoData fcinfo; Datum result; InitFunctionCallInfoData(fcinfo, NULL, 5, NULL, NULL); fcinfo.arg[0] = arg1; fcinfo.arg[1] = arg2; fcinfo.arg[2] = arg3; fcinfo.arg[3] = arg4; fcinfo.arg[4] = arg...
false
false
false
false
false
0
port_listen(char *port, int max_connections) { int sock = socket(AF_INET, SOCK_STREAM, 0); if (sock == -1) die("socket"); struct sockaddr_in server_addr; memset(&server_addr, 0, sizeof(server_addr)); server_addr.sin_family = AF_INET; server_addr.sin_port = htons(atoi(port)); server_addr.sin_addr...
false
false
false
false
false
0
jfs_lookup(struct inode *dip, struct dentry *dentry, unsigned int flags) { struct btstack btstack; ino_t inum; struct inode *ip; struct component_name key; int rc; jfs_info("jfs_lookup: name = %pd", dentry); if ((rc = get_UCSname(&key, dentry))) return ERR_PTR(rc); rc = dtSearch(dip, &key, &inum, &btstack, ...
false
false
false
false
false
0
get_exp_eol(GLEPcode& pcode) throw(ParserError) { int vtype = 1; polish_eol(pcode, &vtype); }
false
false
false
false
false
0
insert_into_typenames(int type, const char *typename, const char *attr) { struct ttnam *ttn = NULL; size_t c; int i, n; char tmp[256]; INSIST(strlen(typename) < TYPECLASSBUF); for (i = 0; i < TYPENAMES; i++) { if (typenames[i].typename[0] != 0 && typenames[i].type == type && strcmp(typename, typena...
false
false
false
false
false
0
_draw_string(FT_Face face, const uint8_t *string, int length, TEXTST_BITMAP *bmp, int x, int y, BD_TEXTST_REGION_STYLE *style, int *baseline_pos) { uint8_t color = style->font_color; unsigned char_code; int ii, jj, kk; unsigne...
false
false
false
false
false
0
R1tg(Real8 theta,R2 & t) const // 1/R of radius of cuvature { R2 A=v[0]->r,B=v[1]->r; Real8 dca,dcb,dcta,dctb; Real8 ddca,ddcb,ddcta,ddctb; // Real8 t1 = 1 -theta; // Real8 t1t1 = t1*t1; Real8 tt = theta*theta; assert( theta >=0); assert( theta <=1); if (TgA()) if (TgB()) // interpolation d'hermite { //c...
false
false
false
false
false
0
handle_sound(void *unused, Uint8 * stream, int len) { int i, amount; if (!sound_loaded) return; // +2 is because one channel is reserved for speaker comment and another // one for chorus. for (i = 0; i < (AVAILABLE_CHANNELS + 2); i++) { amount = 0; if (busy[i]) { ...
false
false
false
false
true
1
MagickSceneFileName(char *filename, const char* filename_template, const char* scene_template, const MagickBool force, unsigned long scene) { ...
true
true
false
false
false
1
PyWeakref_GetObject(PyObject *ref) { if (ref == NULL || !PyWeakref_Check(ref)) { PyErr_BadInternalCall(); return NULL; } return PyWeakref_GET_OBJECT(ref); }
false
false
false
false
false
0
GetClass( const char *pszName ) const { for( int iClass = 0; iClass < m_nClassCount; iClass++ ) { if( EQUAL(GetClass(iClass)->GetName(),pszName) ) return GetClass(iClass); } return NULL; }
false
false
false
false
false
0
knot_rrset_merge_sort(knot_rrset_t *rrset1, const knot_rrset_t *rrset2, int *merged_rrs, int *deleted_rrs) { int result = KNOT_EOK; int merged = 0; int deleted = 0; for (uint16_t i = 0; i < rrset2->rdata_count; ++i) { result = knot_rrset_add_rr_sort_n(rrset1, rrset2, &merged, ...
false
false
false
false
false
0
DropProceduralLanguage(DropPLangStmt *stmt) { char *languageName; HeapTuple langTup; ObjectAddress object; /* * Check permission */ if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), errmsg("must be superuser to drop procedural language"))); /* * Translate the languag...
false
false
false
false
false
0
xenvif_up(struct xenvif *vif) { struct xenvif_queue *queue = NULL; unsigned int num_queues = vif->num_queues; unsigned int queue_index; for (queue_index = 0; queue_index < num_queues; ++queue_index) { queue = &vif->queues[queue_index]; napi_enable(&queue->napi); enable_irq(queue->tx_irq); if (queue->tx_irq...
false
false
false
false
false
0
ServiceScriptCustomize( const QString &name ) { if( m_scripts.value( name )->servicePtr ) m_scripts.value( name )->servicePtr->slotCustomize( name ); }
false
false
false
false
false
0
afm_font_stringwidth (AFMFont font, AFMNumber ptsize, char *string, unsigned int stringlen, AFMNumber *w0x_return, AFMNumber *w0y_return) { unsigned int i; AFMNumber x = 0.0; AFMNumber y = 0.0; AFMIndividualCharacterMetrics *cm; if (!font || !string || !font->writing_direction_metrics[0].is_v...
false
false
false
false
false
0
zend_do_return(znode *expr, int do_end_vparse TSRMLS_DC) /* {{{ */ { zend_op *opline; int start_op_number, end_op_number; if (do_end_vparse) { if ((CG(active_op_array)->fn_flags & ZEND_ACC_RETURN_REFERENCE) && !zend_is_function_or_method_call(expr)) { zend_do_end_variable_parse(expr, BP_VAR_W, 0 TSRMLS_CC); ...
false
false
false
false
false
0
GetImageBackgroundColor(Image *image,const ssize_t offset, ExceptionInfo *exception) { CacheView *image_view; MagickPixelPacket background; MagickRealType count; ssize_t y; /* Compute average background color. */ if (offset <= 0) return; GetMagickPixelPacket(image,&backgrou...
false
false
false
false
false
0
pop3_noop(void) { enum okay ok = STOP; sighandler_type saveint, savepipe; (void)&saveint; (void)&savepipe; (void)&ok; verbose = value("verbose") != NULL; pop3lock = 1; if ((saveint = safe_signal(SIGINT, SIG_IGN)) != SIG_IGN) safe_signal(SIGINT, maincatch); savepipe = safe_signal(SIGPIPE, SIG_IGN); if (sigs...
false
false
false
false
false
0
of_console_check(struct device_node *dn, char *name, int index) { if (!dn || dn != of_stdout || console_set_on_cmdline) return false; return !add_preferred_console(name, index, kstrdup(of_stdout_options, GFP_KERNEL)); }
false
false
false
false
false
0
HPDF_Page_Arc (HPDF_Page page, HPDF_REAL x, HPDF_REAL y, HPDF_REAL ray, HPDF_REAL ang1, HPDF_REAL ang2) { HPDF_BOOL cont_flg = HPDF_FALSE; HPDF_STATUS ret = HPDF_Page_CheckState (page, HPDF_GMODE_PAGE_DESCRIPTION...
false
false
false
false
false
0
encode_REGISTER_SUPER_ACK( uint8_t * base, size_t * idx, const n2n_common_t * common, const n2n_REGISTER_SUPER_ACK_t * reg ) { int retval=0; retval += encode_common( base, idx, common ); retval += encode_buf( base, ...
false
false
false
false
false
0
clps711x_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, int duty_ns, int period_ns) { struct clps711x_chip *priv = to_clps711x_chip(chip); unsigned int duty; if (period_ns != pwm_get_period(pwm)) return -EINVAL; duty = clps711x_get_duty(pwm, duty_ns); clps711x_pwm_update_val(priv, pwm->hwp...
false
false
false
false
false
0
tab_info_bar_add_stock_button_with_text (TabInfoBar* self, const gchar* text, const gchar* stock_id, gint response_id) { GtkButton* button = NULL; const gchar* _tmp0_ = NULL; gint _tmp1_ = 0; GtkButton* _tmp2_ = NULL; GtkButton* _tmp3_ = NULL; GtkImage* image = NULL; const gchar* _tmp4_ = NULL; GtkImage* _tmp5_...
false
false
false
false
false
0
e_ipc_codec_2str_list_dec(char *data, int bytes, Eina_List **dest) { E_Ipc_List *dat; if (!data) return 0; dat = eet_data_descriptor_decode(_e_ipc_2str_list_edd, data, bytes); if (!dat) return 0; if (dest) *dest = dat->list; free(dat); return 1; }
false
false
false
false
false
0
get_bit(int bit) { int bytenum; int bitnum; if (!length) return false; if (bit > length*7) return false; bytenum = bit / 7; bitnum = bit % 7; return (value[bytenum]&(1<<bitnum))!=0; }
false
false
false
false
false
0
ast_config_copy(const struct ast_config *old) { struct ast_config *new_config = ast_config_new(); struct ast_category *cat_iter; if (!new_config) { return NULL; } for (cat_iter = old->root; cat_iter; cat_iter = cat_iter->next) { struct ast_category *new_cat = ast_category_new(cat_iter->name, cat_iter->fil...
false
false
false
false
false
0
gst_tag_list_from_vorbiscomment (const guint8 * data, gsize size, const guint8 * id_data, const guint id_data_length, gchar ** vendor_string) { #define ADVANCE(x) G_STMT_START{ \ data += x; \ size -...
false
false
false
false
false
0
attachment_save_read_cb (GInputStream *input_stream, GAsyncResult *result, SaveContext *save_context) { EAttachment *attachment; GCancellable *cancellable; GOutputStream *output_stream; gssize bytes_read; GError *error = NULL; bytes_read = g_input_stream_read_fin...
false
false
false
false
false
0
alIsBufferFormatSupportedSOFT(ALenum format) { enum FmtChannels DstChannels; enum FmtType DstType; ALCcontext *Context; ALboolean ret; Context = GetContextRef(); if(!Context) return AL_FALSE; ret = DecomposeFormat(format, &DstChannels, &DstType); ALCcontext_DecRef(Context); retur...
false
false
false
false
false
0
amd_ntb_db_clear_mask(struct ntb_dev *ntb, u64 db_bits) { struct amd_ntb_dev *ndev = ntb_ndev(ntb); void __iomem *mmio = ndev->self_mmio; unsigned long flags; if (db_bits & ~ndev->db_valid_mask) return -EINVAL; spin_lock_irqsave(&ndev->db_mask_lock, flags); ndev->db_mask &= ~db_bits; writew((u16)ndev->db_mas...
false
false
false
false
false
0
load(const char *file) { struct soap soap; t__root *r; soap_init(&soap); if (file) soap.recvfd = open(file, O_RDONLY); if (soap.recvfd < 0) return -1; soap_begin_recv(&soap); for (int i = 0; i < POOLSIZE; i++) { if (ref[i]) { delete ref[i]; ref[i] = NULL; } } for (;;) { r = soa...
false
false
false
false
false
0
sampled_data_sample(i_ctx_t *i_ctx_p) { os_ptr op = osp; gs_sampled_data_enum *penum = senum; ref proc; gs_function_Sd_params_t * params = (gs_function_Sd_params_t *)&penum->pfn->params; int num_inputs = params->m; int i; /* Put set of input values onto the stack. */...
false
false
false
false
false
0
adpcm_ima_compress_sample(ADPCMChannelStatus *c, short sample) { int delta = sample - c->prev_sample; int nibble = FFMIN(7, abs(delta)*4/step_table[c->step_index]) + (delta<0)*8; c->prev_sample += ((step_table[c->step_index] * yamaha_difflookup[nibble]) / 8); c->prev_sample = av_clip_int16(c->prev_sampl...
false
false
false
false
false
0
cm_certsave_start(struct cm_store_entry *entry) { switch (entry->cm_cert_storage_type) { #ifdef HAVE_OPENSSL case cm_cert_storage_file: return cm_certsave_o_start(entry); break; #endif #ifdef HAVE_NSS case cm_cert_storage_nssdb: return cm_certsave_n_start(entry); break; #endif } return NULL; }
false
false
false
false
false
0
acceptWriter(AbstractWriter& writer) const { writer.visitFile(*this); // All the data members are responsible for printing themselves out. // They are also responsible for knowing what to do when they are // marked as deleted and when commentchar / delimiter are 0 // std::vector<Section*>::iterator ite...
false
false
false
false
false
0
echo_can_hpf_tx(echo_can_state_t *ec, int16_t tx) { if (ec->adaption_mode & ECHO_CAN_USE_TX_HPF) tx = echo_can_hpf(ec->tx_hpf, tx); return tx; }
false
false
false
false
false
0
get_nonpadding_token (void) { const cpp_token *tok; timevar_push (TV_CPP); do tok = cpp_get_token (parse_in); while (tok->type == CPP_PADDING); timevar_pop (TV_CPP); return tok; }
false
false
false
false
false
0
doPatchMeshShFill(GfxPatchMeshShading *shading) { int start, i; if (out->useShadedFills( shading->getType())) { if (out->patchMeshShadedFill( state, shading)) return; } if (shading->getNPatches() > 128) { start = 3; } else if (shading->getNPatches() > 64) { start = 2; } else if (shading-...
false
false
false
false
false
0
print_PlNode( PlNode *plnode, int indent ) { PlNode *i_son; if ( !plnode ) { printf("none\n"); return; } switch (plnode->connective) { case ALL: printf("ALL %s : %s\n", plnode->atom->item, plnode->atom->next->item); print_indent(indent); printf("( "); print_PlNode(plnode-...
false
false
false
false
false
0
callAsFunction(ExecState* exec, JSObject* thisObj, const List &/*args*/) { // toString() UString name; JSValue* v = thisObj->get(exec, exec->propertyNames().name); if (!v->isUndefined()) name = v->toString(exec); else name = "Error"; UString message; v = thisObj->get(exec, exec->propertyNames().m...
false
false
false
false
false
0
backslash_halve_save(p) char_u *p; { char_u *res; res = vim_strsave(p); if (res == NULL) return p; backslash_halve(res); return res; }
false
false
false
false
false
0
full_pread64(int fd, void *buf, INT64_T count, INT64_T offset) { ssize_t total = 0; ssize_t chunk = 0; while(count > 0) { #if CCTOOLS_OPSYS_CYGWIN || CCTOOLS_OPSYS_DARWIN || CCTOOLS_OPSYS_FREEBSD chunk = pread(fd, buf, count, offset); #else chunk = pread64(fd, buf, count, offset); #endif if(chunk < 0) { if...
false
false
false
false
false
0
Refresh() { if(mapwin != NULL) mapwin->Refresh(); if(tilesel != NULL) tilesel->Refresh(); }
false
false
false
false
false
0
load_point_cloud(FILE *in_stream, point_cloud *pc) { cloud_size_t size = 0; fscanf(in_stream, CLOUD_SIZE_FMT, &size); init_point_cloud(pc, size, size); for (cloud_size_t k = 0; k < pc->size; k++) { point pt; fscanf(in_stream, POINT_FMT, &pt.x, &pt.y); pc->points[k] = pt; } }
false
false
false
false
false
0
http_request_empty_done(struct evhttp_request *req, void *arg) { if (evhttp_request_get_response_code(req) != HTTP_OK) { fprintf(stderr, "FAILED\n"); exit(1); } if (evhttp_find_header(evhttp_request_get_input_headers(req), "Date") == NULL) { fprintf(stderr, "FAILED\n"); exit(1); } if (evhttp_find_header...
false
false
false
false
false
0
AddRecord(unsigned int dbId, Builder &build, const IConverter *ic) { // build packet data DBData send(m_send, false); // send is just a reference to m_send, // so it is safe to use m_send later size_t header_size = SB_PACKET_COMMAND_HEADER_SIZE + DBC_TAGGED_UPLOAD_HEADER_SIZE; if( !build.BuildRecord(send, hea...
false
false
false
false
false
0
updateAlertPackDescription(AlertPackDescription &descr, const int id) { // We are inside a transaction created by saveAlertPackDescription() if (!connectDatabase(Constants::DB_NAME, __LINE__)) return false; if (WarnMemberNames) qWarning() << "AlertBase::updateAlertPackDescription"; QLi...
false
false
false
false
false
0
generate_atoms( void ) const { for( FormulaList::const_iterator fi = conjuncts_.begin(); fi != conjuncts_.end(); ++fi ) (*fi)->generate_atoms(); }
false
false
false
false
false
0
bar_get_width(GtkWidget *bar) { BarData *bd; bd = g_object_get_data(G_OBJECT(bar), "bar_data"); if (!bd) return 0; return bd->width; }
false
false
false
false
false
0
ma901radio_set_volume(struct ma901radio_device *radio, u16 vol_to_set) { int retval; radio->buffer[0] = 0x0a; radio->buffer[1] = MA901_RADIO_SET_VOLUME; radio->buffer[2] = 0xc2; radio->buffer[3] = vol_to_set + 0x20; radio->buffer[4] = 0x00; radio->buffer[5] = 0x00; radio->buffer[6] = 0x00; radio->buffer[7] = ...
false
false
false
false
false
0
push_ref(int index, _stack *stack) { int ref = stack->pop(); char field_name[64]; char type[64]; int ret; if (java_class->get_ref_name_type(field_name, type, sizeof(field_name), ref) != 0) { printf("Error retrieving field name %d\n", ref); return -1; } // Try to set local variable directly to ...
false
false
false
false
false
0
sdhci_get_of_property(struct platform_device *pdev) { struct device_node *np = pdev->dev.of_node; struct sdhci_host *host = platform_get_drvdata(pdev); struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); u32 bus_width; if (of_get_property(np, "sdhci,auto-cmd12", NULL)) host->quirks |= SDHCI_QUIRK_MULTIBLOCK...
false
false
false
false
false
0
round_position( float * x, float * y, float * w, float * h ) { int t; if ( *w > width ) *w = width; if ( *h > height ) *h = height; if ( stepsize > 0.0 ) { t = *x / stepsize + 0.5; *x = stepsize * t; t = *y / st...
false
false
false
false
false
0
OrthogAppendRlist(struct Rlist **start,void *item, char type) /* Allocates new memory for objects - careful, could leak! */ { struct Rlist *rp,*lp; struct CfAssoc *cp; Debug("OrthogAppendRlist\n"); switch(type) { case CF_LIST: Debug("Expanding and appending list object, orthogonally\n"); ...
false
false
false
false
false
0
_gsp_app_manager_fill_from_dir (GspAppManager *manager, GspXdgDir *xdgdir) { GFile *file; GDir *dir; const char *name; file = g_file_new_for_path (xdgdir->dir); xdgdir->monitor = g_file_monitor_directory (file, G_FILE_MONITOR_NONE, ...
false
false
false
false
false
0
get_wmclass(task *tk) { ENTER; if (tk->ch.res_name) XFree(tk->ch.res_name); if (tk->ch.res_class) XFree(tk->ch.res_class); if (!XGetClassHint (gdk_display, tk->win, &tk->ch)) tk->ch.res_class = tk->ch.res_name = NULL; DBG("name=%s class=%s\n", tk->ch.res_name, tk->ch.res_cla...
false
false
false
false
false
0
WriteTagToFile(CFileDataIO* file, EUtf8Str WXUNUSED(eStrEncode), bool restrictive) const { // Don't write tags of unknown types, we wouldn't be able to read them in again // and the met file would be corrupted if (!restrictive || (IsStr() || IsInt() || IsFloat() || IsBlob())) { // If this fails, it'll throw. ...
false
false
false
false
false
0
reverse_addr(const string& addr, const uint8_t key[34], bool reverse) { IPv4Anonymizer l3anon(key); uint32_t addr_n; if ( inet_pton(AF_INET, addr.c_str(), &addr_n) != 1 ) { fprintf(stderr, "Failed to convert '%s' to IP address.\n", addr.c_str()); exit(1); } addr_n = rev...
false
false
false
false
false
0
InitializeDelayedValidation() { if (m_strApplicationName.IsEmpty()) { if (show_error_msgs) { fprintf(stderr, "Skin Manager: Application name was not defined. Using default.\n"); } m_strApplicationName = wxT("BOINC Manager"); wxASSERT(!m_strApplicationName.IsEmpty()); ...
false
false
false
false
false
0
tracker_stats_on_response (TrackerStats* self, GtkDialog* source, gint response_id) { gint _tmp0_ = 0; g_return_if_fail (self != NULL); g_return_if_fail (source != NULL); _tmp0_ = response_id; switch (_tmp0_) { case GTK_RESPONSE_CLOSE: { gtk_widget_destroy ((GtkWidget*) self); break; } default: bre...
false
false
false
false
false
0
glusterd_handle_commit_op (rpcsvc_request_t *req) { int32_t ret = -1; glusterd_req_ctx_t *req_ctx = NULL; gd1_mgmt_commit_op_req op_req = {{0},}; glusterd_peerinfo_t *peerinfo = NULL; GF_ASSERT (req); if (!xdr_to...
false
false
false
true
false
1
laundromat_main(struct work_struct *laundry) { time_t t; struct delayed_work *dwork = container_of(laundry, struct delayed_work, work); struct nfsd_net *nn = container_of(dwork, struct nfsd_net, laundromat_work); t = nfs4_laundromat(nn); dprintk("NFSD: laundromat_main - sleeping for %ld seconds\n"...
false
false
false
false
false
0
strip_array_coercion(Node *node) { for (;;) { if (node && IsA(node, ArrayCoerceExpr) && ((ArrayCoerceExpr *) node)->elemfuncid == InvalidOid) { node = (Node *) ((ArrayCoerceExpr *) node)->arg; } else if (node && IsA(node, RelabelType)) { /* We don't really expect this case, but may as well cope */ ...
false
false
false
false
false
0
SITEsetlist(char **patlist, char *subbed, char *poison, bool *poisonEntry) { char *pat; char *p; char *u; char subvalue; char poisonvalue; NEWSGROUP *ngp; int i; while ((pat = *patlist++) != NULL) { subvalue = *pat != SUB_NEGATE && *pat != SUB_POISON; poisonvalue = *pat == SUB_POISON...
false
false
false
false
true
1
check_tokens(request_rec *r, auth_pubtkt *tkt) { auth_pubtkt_dir_conf *conf = ap_get_module_config(r->per_dir_config, &auth_pubtkt_module); char *next_parsed_token; const char *t = NULL; int match = 0; /* Success if no tokens required */ if (conf->auth_token->nelts == 0 || strcmp(((char**)conf->auth_token->elts...
false
false
false
false
false
0
H5D__efl_readvv_cb(hsize_t dst_off, hsize_t src_off, size_t len, void *_udata) { H5D_efl_readvv_ud_t *udata = (H5D_efl_readvv_ud_t *)_udata; /* User data for H5V_opvv() operator */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC /* Read data */ if(H5D__efl_read(udata->efl,...
false
false
false
false
false
0
xmmsv_dict_iter_find (xmmsv_dict_iter_t *it, const char *key) { xmmsv_t *val; const char *k; int s, dict_size, cmp, left, right; x_return_val_if_fail (it, 0); x_return_val_if_fail (key, 0); /* how many key-value pairs does this dictionary contain? */ dict_size = it->parent->flatlist->size / 2; /* if it's emp...
false
false
false
false
true
1
completion_get_servertags(const char *word) { GList *list; GSList *tmp; int len; g_return_val_if_fail(word != NULL, NULL); len = strlen(word); list = NULL; for (tmp = servers; tmp != NULL; tmp = tmp->next) { SERVER_REC *rec = tmp->data; if (g_strncasecmp(rec->tag, word, len) == 0) { if (rec == active_...
false
false
false
false
false
0
led_blink_set_oneshot(struct led_classdev *led_cdev, unsigned long *delay_on, unsigned long *delay_off, int invert) { if ((led_cdev->flags & LED_BLINK_ONESHOT) && timer_pending(&led_cdev->blink_timer)) return; led_cdev->flags |= LED_BLINK_ONESHOT; led_cdev->flags &= ~LED_BLINK_ONESHOT_STOP...
false
false
false
false
false
0
gst_video_encoder_init (GstVideoEncoder * encoder, GstVideoEncoderClass * klass) { GstVideoEncoderPrivate *priv; GstPadTemplate *pad_template; GstPad *pad; GST_DEBUG_OBJECT (encoder, "gst_video_encoder_init"); priv = encoder->priv = GST_VIDEO_ENCODER_GET_PRIVATE (encoder); pad_template = gst_elemen...
false
false
false
false
false
0
sftk_oldVersionExists(const char *dir, int version) { int i; PRStatus exists = PR_FAILURE; char *file = NULL; for (i=version; i > 1 ; i--) { file = PR_smprintf("%s%d.db",dir,i); if (file == NULL) { continue; } exists = PR_Access(file, PR_ACCESS_EXISTS); PR_smprintf_free(file); if (exists == ...
false
false
false
false
false
0
show_psdir() { SHOW_ALL_NL; fprintf(stderr, "\tdirectory from 'set psdir': "); fprintf(stderr, "%s\n", PS_psdir ? PS_psdir : "none"); fprintf(stderr, "\tenvironment variable GNUPLOT_PS_DIR: "); fprintf(stderr, "%s\n", getenv("GNUPLOT_PS_DIR") ? getenv("GNUPLOT_PS_DIR") : "none"); #ifdef GNUPLOT_PS_...
false
false
false
false
true
1
dtIntersectSegmentPoly2D(const float* p0, const float* p1, const float* verts, int nverts, float& tmin, float& tmax, int& segMin, int& segMax) { static const float EPS = 0.00000001f; tmin = 0; tmax = 1; segMin...
false
false
false
false
false
0
chdir3(path, raw) CONST char *path; int raw; { #ifdef DEP_DOSDRIVE int drive; #endif CONST char *cwd; cwd = path; if (!raw && path[0] && !path[1]) switch (path[0]) { case '.': cwd = NULL; break; case '?': path = origpath; break; case '-': if (!lastpath) return(seterrno(ENOENT)); path = last...
false
false
false
false
false
0
kvm_iommu_map_pages(struct kvm *kvm, struct kvm_memory_slot *slot) { gfn_t gfn, end_gfn; pfn_t pfn; int r = 0; struct iommu_domain *domain = kvm->arch.iommu_domain; int flags; /* check if iommu exists and in use */ if (!domain) return 0; gfn = slot->base_gfn; end_gfn = gfn + slot->npages; flags = IOM...
false
false
false
false
false
0
SendSysMessage(const char* str) { WorldPacket data; // need copy to prevent corruption by strtok call in LineFromMessage original string char* buf = mangos_strdup(str); char* pos = buf; while (char* line = LineFromMessage(pos)) { FillSystemMessageData(&data, line); m_session->S...
false
false
false
false
false
0
k2_sata_hardreset(struct ata_link *link, unsigned int *class, unsigned long deadline) { u8 dmactl; void __iomem *mmio = link->ap->ioaddr.bmdma_addr; dmactl = readb(mmio + ATA_DMA_CMD); /* Clear the start bit */ if (dmactl & ATA_DMA_START) { dmactl &= ~ATA_DMA_START; writeb(dmactl, mmio + ATA_DMA_CMD)...
false
false
false
false
false
0
on_pmenu_db_update_selected(GtkWidget *widget, gpointer data) { GtkTreeView *tv; GtkTreeModel *tm; GtkTreeSelection *ts; GList *selected_rows; GtkTreeIter iter; gint i, num = 0; gchar *path = NULL; debug("POPUP: DB -> Update selected"); if(!mpd_check_connected(glurp->mpd)) return FALSE; tv = GTK_T...
false
false
false
false
false
0
max77843_muic_adc_handler(struct max77843_muic_info *info) { int ret, cable_type; bool attached; cable_type = max77843_muic_get_cable_type(info, MAX77843_CABLE_GROUP_ADC, &attached); dev_dbg(info->dev, "external connector is %s (adc:0x%02x, prev_adc:0x%x)\n", attached ? "attached" : "detached", cable_type,...
false
false
false
false
false
0
decPackedFromNumber(uByte *bcd, Int length, Int *scale, const decNumber *dn) { const Unit *up=dn->lsu; // Unit array pointer uByte obyte, *out; // current output byte, and where it goes Int indigs=dn->digits; // digits processed uInt cut=DECDPUN; // downco...
false
false
false
false
true
1
touch_artifact(obj,mon) struct obj *obj; struct monst *mon; { register const struct artifact *oart = get_artifact(obj); boolean badclass, badalign, self_willed, yours; if(!oart) return 1; yours = (mon == &youmonst); /* all quest artifacts are self-willed; it this ever changes, `badclass' ...
false
false
false
false
false
0
daemonize(void) { int ret; switch (fork()) { case 0: break; case -1: printf("ERROR: fork()\n"); exit(1); default: exit(0); } if (setsid() < 0) { printf("ERROR: setsid()}\n"); exit(1); } if (chdir("/") < 0) { printf("ERROR: chdir()}\n"); exit(1); } struct stat sb; ret = stat(argume...
true
true
false
false
true
1
openPipe(char *pipeName, char *mode) { FILE *pipe; fflush(stdout); if ((pipe = popen(pipeName, mode))) registerPipe(pipe); return pipe; }
false
false
false
false
false
0
ha_statistic_increment(ulong HOS::*hos_offset, ulong SSV::*ssv_offset) { (ops_stats.*hos_offset)++; if (active_index < MAX_KEY) (ops_index_stats[active_index].*hos_offset)++; status_var_increment(table->in_use->status_var.*ssv_offset); }
false
false
false
false
false
0
lockfile_remove( const char *name ) { Lentry *le; if( ! lockfiles ) return; if( ! name || ! *name ) { msglog( MSG_ERR, "lockfile_remove: invalid name" ); return; } if( ! ( le = lockfile_unhash( name, 0 ) ) ) { msglog( MSG_ALERT, "could not remove lock file for %s", name ); return; } if( exclusive_...
false
false
false
false
false
0
auparse_get_field_int(auparse_state_t *au) { const char *v = auparse_get_field_str(au); if (v) { int val; errno = 0; val = strtol(v, NULL, 10); if (errno == 0) return val; } else errno = ENODATA; return -1; }
false
false
false
false
false
0
actionTriggered(QAction *action) { //we don't want to emit any signals from top-level items //except for the default one if (action==d->defaultAction) { emit triggered(KEncodingDetector::SemiautomaticDetection); emit defaultItemTriggered(); } }
false
false
false
false
false
0
gx_default_DevCMYK_get_color_comp_index(gx_device * dev, const char * pname, int name_size, int component_type) { if (compare_color_names(pname, name_size, "Cyan")) return 0; if (compare_color_names(pname, name_size, "Magenta")) return 1; if (compa...
false
false
false
false
false
0
lua_pushusertag (void *u, int tag) { if (tag < LUA_T_USERDATA) lua_error("invalid tag in `lua_pushusertag'"); tag(top) = tag; uvalue(top) = u; incr_top; }
false
false
false
false
false
0
DefinePropertyById(JSContext *cx, JSObject *obj, jsid id, jsval value, JSPropertyOp getter, JSPropertyOp setter, uintN attrs, uintN flags, intN tinyid) { if (flags != 0 && OBJ_IS_NATIVE(obj)) { JSAutoResolveFlags rf(cx, JSRESOLVE_QUALIFIED | JSRESOLVE_DECLARING); ...
false
false
false
false
false
0
json_is_invalid_number(json_parse_t *json) { int i = json->index; /* Reject numbers starting with + */ if (json->data[i] == '+') return 1; /* Skip minus sign if it exists */ if (json->data[i] == '-') i++; /* Reject numbers starting with 0x, or leading zeros */ if (json->da...
false
false
false
false
false
0
script_input(void) { char buf[128]; int nr; char *ptr; char c; trace_dsn("Input for %s[%d] %d\n", ST_NAME, sms_depth, sms->state); /* Read in what you can. */ if (sms->is_socket) nr = recv(sms->infd, buf, sizeof(buf), 0); else nr = read(sms->infd, buf, sizeof(buf)); if (nr < 0) { #if defined(_WIN32) /*[*...
false
false
false
false
false
0
rs5c372_sysfs_show_osc(struct device *dev, struct device_attribute *attr, char *buf) { int err, osc; err = rs5c372_get_trim(to_i2c_client(dev), &osc, NULL); if (err) return err; return sprintf(buf, "%d.%03d KHz\n", osc / 1000, osc % 1000); }
false
true
false
false
false
1
multi_map_tests_test_size (MultiMapTests* self) { GeeMultiMap* _tmp0_ = NULL; GeeMultiMap* _tmp1_ = NULL; gint _tmp2_ = 0; gint _tmp3_ = 0; GeeMultiMap* _tmp4_ = NULL; GeeMultiMap* _tmp5_ = NULL; gint _tmp6_ = 0; gint _tmp7_ = 0; GeeMultiMap* _tmp8_ = NULL; GeeMultiMap* _tmp9_ = NULL; gint _tmp10_ = 0; gint...
false
false
false
false
false
0
bp__page_destroy(bp_db_t* t, bp__page_t* page) { /* Free all keys */ uint64_t i = 0; for (i = 0; i < page->length; i++) { if (page->keys[i].allocated) { free(page->keys[i].value); page->keys[i].value = NULL; } } if (page->buff_ != NULL) { free(page->buff_); page->buff_ = NULL; }...
false
false
false
false
false
0
init_sierpinski(ModeInfo * mi) { int i; sierpinskistruct *sp; if (tris == NULL) { if ((tris = (sierpinskistruct *) calloc(MI_NUM_SCREENS(mi), sizeof (sierpinskistruct))) == NULL) return; } sp = &tris[MI_SCREEN(mi)]; sp->width = MI_WIDTH(mi); sp->height = MI_HEIGHT(mi); sp->total_npoints = ...
false
false
false
false
false
0
delete_fluid_defsfont(fluid_defsfont_t* sfont) { fluid_list_t *list; fluid_defpreset_t* preset; fluid_sample_t* sample; /* Check that no samples are currently used */ for (list = sfont->sample; list; list = fluid_list_next(list)) { sample = (fluid_sample_t*) fluid_list_get(list); if (fluid_sample_refcount(sam...
false
false
false
false
false
0