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
kfd_doorbell_mmap(struct kfd_process *process, struct vm_area_struct *vma) { phys_addr_t address; struct kfd_dev *dev; /* * For simplicitly we only allow mapping of the entire doorbell * allocation of a single device & process. */ if (vma->vm_end - vma->vm_start != doorbell_process_allocation()) return -EI...
false
false
false
false
false
0
qlge_io_resume(struct pci_dev *pdev) { struct net_device *ndev = pci_get_drvdata(pdev); struct ql_adapter *qdev = netdev_priv(ndev); int err = 0; if (netif_running(ndev)) { err = qlge_open(ndev); if (err) { netif_err(qdev, ifup, qdev->ndev, "Device initialization failed after reset.\n"); return; ...
false
false
false
false
false
0
os_time (lua_State *L) { time_t t; if (lua_isnoneornil(L, 1)) /* called without args? */ t = time(NULL); /* get current time */ else { struct tm ts; luaL_checktype(L, 1, LUA_TTABLE); lua_settop(L, 1); /* make sure table is at the top */ ts.tm_sec = getfield(L, "sec", 0); ts.tm_min = get...
false
false
false
false
false
0
Devices_GetNumber(int set_textmode) { int devnum; if (!Devices_GetIOCB()) return -1; devnum = MEMORY_dGetByte(Devices_ICDNOZ); if (devnum > 9 || devnum == 0 || devnum == 5) { CPU_regY = 160; /* invalid unit/drive number */ CPU_SetN; return -1; } if (devnum < 5) { if (set_textmode) h_textmode[h_iocb] ...
false
false
false
false
false
0
remote_connect(const char *path) { if (!path) { errno = EINVAL; return -1; } if (!strncmp(path, "tcp:", 4)) { path = path + 4; return rc_input_new_inet(path, SOCK_STREAM); } if (!strncmp(path, "tcps:", 5)) { path = path + 5; return rc_input_new_inet_ssl(path, SOCK_STREAM); } if (!strncmp(path, "ud...
false
false
false
false
false
0
NSS_CMSDEREncode(NSSCMSMessage *cmsg, SECItem *input, SECItem *derOut, PLArenaPool *arena) { NSSCMSEncoderContext *ecx; SECStatus rv = SECSuccess; if (!cmsg || !derOut || !arena) { PORT_SetError(SEC_ERROR_INVALID_ARGS); return SECFailure; } ecx = NSS_CMSEncoder_Start(cmsg, 0, 0, ...
false
false
false
false
false
0
init() { int s, v, t; char name[30]; for (s=0; s<4; s++) for (v=0; v<13; v++) { sprintf(name, "%c%c", values[v], suits[s]); cards[v*4+s] = get_picture(name); } empty = get_picture("empty"); back = get_picture("back"); nodrop = get_picture("no-drop"); stack_set_pictures(cards, back...
true
true
false
false
false
1
printList(const char *list, char separator) { size_t col = MAX_WIDTH, len; const char *indent = " "; const char *next; if(!list || *list == '\0') { fprintf(stdout, "\n%s!!! none !!!\n", indent); return; } do { next = strchr(list, separator); if(next) ...
false
false
false
false
false
0
cpufreq_tsc(void) { if (!cpu_has_tsc) return 0; if (boot_cpu_has(X86_FEATURE_CONSTANT_TSC)) return 0; cpufreq_register_notifier(&time_cpufreq_notifier_block, CPUFREQ_TRANSITION_NOTIFIER); return 0; }
false
false
false
false
false
0
responder_send_SA_KE_NONCE_ID_AUTH(struct message *msg) { /* Add the SA payload with the transform that was chosen. */ if (ike_phase_1_responder_send_SA(msg)) return -1; /* XXX Should we really just use the initiator's nonce size? */ if (ike_phase_1_send_KE_NONCE(msg, msg->exchange->nonce_i_len)) return -1; ...
false
false
false
false
false
0
_pcomm_writes_buffered( pcomm_context_t *context ) { int result = 0; /* pcomm_fd_t *fd_context = NULL; */ if ( context ) { /* This assumes that all writes are being handled correctly */ if ( !list_empty(&context->write_fds) ) { result = 1; } /* l...
false
false
false
false
false
0
cli_htu32_insert(struct cli_htu32 *s, const struct cli_htu32_element *item, mpool_t *mempool) { struct cli_htu32_element* element; struct cli_htu32_element* deleted_element = NULL; size_t tries = 1; size_t idx; int ret; if(!s) return CL_ENULLARG; if(s->used > s->maxfill) { cli_dbgmsg("hashtab.c:Growing hash...
false
false
false
false
false
0
test_checkout_conflict__link_file(void) { git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; struct checkout_index_entry checkout_index_entries[] = { { 0100644, CONFLICTING_ANCESTOR_OID, 1, "link-1" }, { 0100644, CONFLICTING_OURS_OID, 2, "link-1" }, { 0120000, LINK_THEIRS_OID, 3, "link-1" }, { 0100644, ...
false
false
false
false
false
0
json_value_unset (JsonValue *value) { g_return_if_fail (value != NULL); switch (value->type) { case JSON_VALUE_INVALID: break; case JSON_VALUE_INT: value->data.v_int = 0; break; case JSON_VALUE_DOUBLE: value->data.v_double = 0.0; break; case JSON_VALUE_BOOLEAN: ...
false
false
false
false
false
0
hx509_cert_get_friendly_name(hx509_cert cert) { hx509_cert_attribute a; PKCS9_friendlyName n; size_t sz; int ret; size_t i; if (cert->friendlyname) return cert->friendlyname; a = hx509_cert_get_attribute(cert, &asn1_oid_id_pkcs_9_at_friendlyName); if (a == NULL) { hx509_name name; ...
false
false
false
false
false
0
XtCompositeChildren (widget, number) Widget widget; unsigned int* number; { CompositeWidget cw = (CompositeWidget)widget; Widget* result; int n; int i; if (!XtIsComposite (widget)) { *number = 0; return NULL; } n = cw->composite.num_children; result = (Widget*)XtMalloc (n * ...
false
false
false
false
false
0
add_async_request (struct devstruct *dev, uaecptr request, int type, uae_u32 data) { int i; if (log_scsi) write_log (_T("async request %08x (%d) added\n"), request, type); i = 0; while (i < MAX_ASYNC_REQUESTS) { if (dev->d_request[i] == request) { dev->d_request_type[i] = type; dev->d_request_data[i] = d...
false
false
false
false
false
0
AcpiDmGpioCommon ( AML_RESOURCE *Resource, UINT32 Level) { UINT32 PinCount; UINT16 *PinList; UINT8 *VendorData; UINT32 i; /* ResourceSource, ResourceSourceIndex, ResourceType */ AcpiDmInde...
false
false
false
false
false
0
regfreeA(regex_tA* expression) { if(expression->re_magic == magic_value) { delete static_cast<c_regex_type*>(expression->guts); } expression->re_magic = 0; }
false
false
false
false
false
0
ipmi_cmd_get_bt_interface_capabilities (ipmi_ctx_t ctx, fiid_obj_t obj_cmd_rs) { fiid_obj_t obj_cmd_rq = NULL; int rv = -1; if (!ctx || ctx->magic != IPMI_CTX_MAGIC) { ERR_TRACE (ipmi_ctx_errormsg (ctx), ipmi_ctx_errnum (ctx)); return (-1); } if (!fi...
false
false
false
false
false
0
TestBigComment() { string input; for (int i = 0; i < 1024; ++i) { char buf[1024]; // definitely big enough sprintf(buf, " # Comment %d\n", i); input += buf; } input += "name = value;\n"; Scanner s(input.c_str()); s.SetSkipExpression("\\s+|#.*\n"); string name; string value; s.Consume...
false
false
false
false
false
0
HasElementPostInterceptor(JSObject* receiver, uint32_t index) { switch (GetElementsKind()) { case FAST_ELEMENTS: { uint32_t length = IsJSArray() ? static_cast<uint32_t> (Smi::cast(JSArray::cast(this)->length())->value()) : static_cast<uint32_t>(FixedArray::cast(elements())-...
false
false
false
false
false
0
GetSpec() const{ gnGenomeSpec *spec = new gnGenomeSpec(); for(uint32 i=0; i < m_contigList.size(); i++){ //create specs for the fragment and contig levels gnFragmentSpec *fragmentSpec = new gnFragmentSpec(); gnSourceSpec *contigSpec = new gnSourceSpec((gnBaseSource*)this, i); //set up the spec tree structure ...
false
false
false
false
false
0
commands_process_info_source(struct commands *c, struct tgdb_list *list, char a) { unsigned long length; static char *info_ptr; if (c->info_source_ready) /* Already found */ return; info_ptr = ibuf_get(c->info_source_string); length = ibuf_length(c->info_source_string); if (a == '\r...
false
false
false
false
false
0
setcols(strom,ptr) truc strom; truc *ptr; { unsigned k; if(*FLAGPTR(ptr) != fFIXNUM) return(MaxCols-1); k = *WORD2PTR(ptr); if(k < MAXCOLS/4) k = MAXCOLS/4; else if(k > IOBUFSIZE) k = IOBUFSIZE; return(k); }
false
false
false
false
false
0
outeof (name, namelen) char *name; reg uint namelen; { ulonglong pad; auto char header[M_STRLEN + H_STRLEN + 1]; if ((pad = (total + M_STRLEN + H_STRLEN + namelen) % arpad)) pad = arpad - pad; VOID strcpy (header, M_ASCII); VOID sprintf (header + M_STRLEN, H_PRINT, 0, 0, 0, 0, 0, 1, 0, ulo(0)...
false
false
false
false
false
0
null_check_this_arg(struct expression *arg) { if (expr_type(arg) != EXPR_ARGS_LIST) { if (expr_type(arg) == EXPR_ARG_THIS) null_check_arg(arg); return; } struct expression *right_arg = to_expr(arg->args_right); if (expr_type(right_arg) == EXPR_ARG_THIS) { null_check_arg(right_arg); return; } null_ch...
false
false
false
false
false
0
fillarray(Symbol* basetype, Dimset* dimset, int index, Datalist* arraylist) { int i; Symbol* dim = dimset->dimsyms[index]; unsigned int size = dim->dim.declsize; int isunlimited = (size == 0); int lastdim = (index == (dimset->ndims - 1)); int firstdim = (index == 0); Datalist* sublist; ...
false
false
false
false
false
0
jbig2_image_free(Jbig2Ctx *ctx, Jbig2Image *image) { if (image) jbig2_free(ctx->allocator, image->data); jbig2_free(ctx->allocator, image); }
false
false
false
false
false
0
add_heap_shot_class (HeapShot *hs, ClassDesc *klass, uint64_t size) { HeapClassDesc *res; int i; if (hs->class_count * 2 >= hs->hash_size) { HeapClassDesc **n; int old_size = hs->hash_size; hs->hash_size *= 2; if (hs->hash_size == 0) hs->hash_size = 4; n = (HeapClassDesc **)calloc (sizeof (void*) * hs->...
false
false
false
false
false
0
calc_hash(VMG_ vm_obj_id_t self, int /*depth*/) const { unsigned long idx; unsigned long rem; uint hash; /* add up the bytes in the array */ for (hash = 0, idx = 1, rem = get_element_count() ; rem != 0 ; ) { unsigned char *p; size_t avail; size_t chunk; ...
false
false
false
false
false
0
moveTo(int x_,int y_) { int i; int diff_y=y_-MSRect::y(); int diff_x=x_-MSRect::x(); if (diff_x!=0||diff_y!=0) { MSRect::y(y_); MSRect::x(x_); for (i=0;i<_topCount;i++) { _top[i].x+=diff_x; _top[i].y+=diff_y; } for (i=0; i<_centerCount;i++) { ...
false
false
false
false
false
0
expand_username(krb5_context context, PTYPE param, const char *postfix, char **str) { uid_t euid = geteuid(); struct passwd *pw, pwx; char pwbuf[BUFSIZ]; if (k5_getpwuid_r(euid, &pwx, pwbuf, sizeof(pwbuf), &pw) != 0) { krb5_set_error_message(context, ENOENT, ...
true
true
false
false
false
1
add_suppriv(xmlNodePtr root, const char *priv_name, xmlNsPtr ns, int abstract, const char *desc_str) { xmlNodePtr supp, priv, desc; supp = xmlNewChild(root, NULL, BAD_CAST "supported-privilege", NULL); priv = xmlNewChild(supp, NULL, BAD_CAST "privilege", NULL); xmlNewChild(priv, ns, BAD_CAST p...
false
false
false
false
false
0
standard_name(char *b, char *dot_pos, char *nom_pos, char *fil_complete, int short_ver) { char md5[32 + 2]; b[0] = '\0'; /* Nom */ if (dot_pos) { if (!short_ver) // Noms longs strncatbuff(b, nom_pos, (int) (dot_pos - nom_pos)); else strncatbuff(b, nom_pos, min...
true
true
false
false
true
1
_dump_stats_to_doc (xmlNodePtr root, const char *show_mount, int hidden) { avl_node *avlnode; xmlNodePtr ret = NULL; thread_mutex_lock(&_stats_mutex); /* general stats first */ avlnode = avl_get_first(_stats.global_tree); while (avlnode) { stats_node_t *stat = avlnode->key; ...
false
false
false
false
false
0
deep_count_start (ShellMimeSniffer *self) { DeepCountState *state; state = g_new0 (DeepCountState, 1); state->self = self; deep_count_load (state, self->priv->file); }
false
false
false
false
false
0
GetSampleFromWavePool(unsigned int WavePoolTableIndex, progress_t* pProgress) { if ((int32_t)WavePoolTableIndex == -1) return NULL; File* file = (File*) GetParent()->GetParent(); if (!file->pWavePoolTable) return NULL; unsigned long soughtoffset = file->pWavePoolTable[WavePoolTableIndex]...
false
false
false
false
false
0
advance_virtual_time(Bit64u time_passed) { BX_ASSERT(time_passed <= virtual_next_event_time); current_virtual_time += time_passed; virtual_next_event_time -= time_passed; if(current_virtual_time > current_timers_time) { periodic(current_virtual_time - current_timers_time); } }
false
false
false
false
false
0
ReadIfsString(FILE *fp, char *buffer, int maxlength) { // Read length unsigned int length; if (fread(&length, sizeof(unsigned int), 1, fp) != 1) { RNFail("Unable to read string length"); return -1; } // Read characters if ((int) length > maxlength) length = maxlength; if (fread(buffer, sizeof(uns...
false
false
false
false
false
0
handle_pollfds(bgav_demuxer_context_t * ctx) { // int bytes_read; rtp_priv_t * priv; int i, index; int ret = 0; priv = ctx->priv; index = 0; for(i = 0; i < priv->num_streams; i++) { if(priv->pollfds[index].revents & POLLIN) { if(read_rtp_packet(ctx, priv->pollfds[index].fd, 0,...
false
false
false
false
false
0
folder_read (struct _header_scan_state *s) { gint len; gint inoffset; if (s->inptr < s->inend - s->atleast || s->eof) return s->inend - s->inptr; #ifdef PURIFY purify_watch_remove (inend_id); purify_watch_remove (inbuffer_id); #endif /* check for any remaning bytes (under the atleast limit( */ inoffset = s->i...
false
true
false
false
true
1
remove_all_loaded (CamelFolderSummary *summary) { GSList *to_remove_infos = NULL; g_return_if_fail (CAMEL_IS_FOLDER_SUMMARY (summary)); camel_folder_summary_lock (summary, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK); camel_folder_summary_lock (summary, CAMEL_FOLDER_SUMMARY_REF_LOCK); g_hash_table_foreach_remove (summary...
false
false
false
false
false
0
sockaddr_debug(union fc_sockaddr *addr) { #ifdef IPV6_SUPPORT char buf[INET6_ADDRSTRLEN] = "Unknown"; if (addr->saddr.sa_family == AF_INET6) { inet_ntop(AF_INET6, &addr->saddr_in6.sin6_addr, buf, INET6_ADDRSTRLEN); log_debug("Host: %s, Port: %d (IPv6)", buf, ntohs(addr->saddr_in6.sin6_port))...
false
false
false
false
false
0
handle_le_arp_req(struct ctrl_frame *frame, int size) { int sizeoftlvs, sizeofrsp, retval; struct ctrl_frame *rsp; struct atmlec_msg *msg; if (frame->header.lec_id == htons(lec_params.c14_lec_id)) { diag(COMPONENT, DIAG_DEBUG, "Ignoring own LE_ARP_REQUEST"); ...
false
true
false
false
false
1
savedirstream (DIR *dirp) { char *name_space; size_t allocated = NAME_SIZE_DEFAULT; size_t used = 0; int save_errno; if (dirp == NULL) return NULL; name_space = xmalloc (allocated); for (;;) { struct dirent const *dp; char const *entry; errno = 0; dp = readdir (dirp); ...
false
false
false
false
true
1
list_context_finish_take_error (ListContext *lc, GError *error) { if (error == NULL) { dbus_g_method_return (lc->context); } else { dbus_g_method_return_error (lc->context, error); g_error_free (error); } g_slice_free (ListContext, lc); }
false
false
false
false
false
0
gsb_gui_navigation_get_current_page ( void ) { GtkTreeSelection *selection; GtkTreeIter iter; gint page; if (!navigation_tree_view) return -1; selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (navigation_tree_view)); if (!gtk_tree_selection_get_selected (selection, NULL, &iter)) retur...
false
false
false
false
false
0
getListedNodes() { GtkTreeIter iter; gboolean valid; int *nodes, i; DBG_fprintf(stderr, "Gtk Pick: get the list of node ids:\n"); if (!listDataNode) { nodes = g_malloc(sizeof(int) * 1); nodes[0] = -1; return nodes; } nodes = g_malloc(sizeof(int) * (gtk_tree_model_iter_n_chi...
false
false
false
false
false
0
set_seenv(lev, x0, y0, x, y) struct rm *lev; int x0, y0, x, y; /* from, to */ { int dx = x-x0, dy = y0-y; lev->seenv |= seenv_matrix[sign(dy)+1][sign(dx)+1]; }
false
false
false
false
false
0
SetupWriter() { //Set up XML writer if one does not already exist if(_writer) return true; _buf = xmlOutputBufferCreateIO ( WriteStream, //xmlOutputWriteCallback NULL, //xmlOutputCloseCallback ...
false
false
false
false
false
0
pprint_tag(const unsigned char *sha1, const char *buf, unsigned long size) { /* the parser in tag.c is useless here. */ const char *endp = buf + size; const char *cp = buf; while (cp < endp) { char c = *cp++; if (c != '\n') continue; if (7 <= endp - cp && !memcmp("tagger ", cp, 7)) { const char *tagger...
false
false
false
false
false
0
gst_query_new_custom (GstQueryType type, GstStructure * structure) { GstQueryImpl *query; query = g_slice_new0 (GstQueryImpl); GST_DEBUG ("creating new query %p %s", query, gst_query_type_get_name (type)); if (structure) { /* structure must not have a parent */ if (!gst_structure_set_parent_refcount ...
false
false
false
false
false
0
SetClassName(Handle<String> name) { i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); if (IsDeadCheck(isolate, "v8::FunctionTemplate::SetClassName()")) return; ENTER_V8(isolate); Utils::OpenHandle(this)->set_class_name(*Utils::OpenHandle(*name)); }
false
false
false
false
false
0
methods( const KJS::UString &className ) { return KJSEmbed::g_ctorHash[toQString(className)]->methods; }
false
false
false
false
false
0
setToolGLE(const QString& vers, const QString& date, const QString& top) { GLEVersion->setText(QString("GLE version: ") + vers); GLEBuildDate->setText(QString("GLE build date: ") + date); GLETop->setText(top); }
false
false
false
false
false
0
ars_decode_string(struct ars_packet *pkt, char *s, int *blen) { int l = strlen(s), i; int bl = 0; unsigned char *d, *saved; if (!hextab_initialized) { memset(hextab, -1, 255); for (i = 0; i < 16; i++) hextab[(int)hexdig[i]] = i; } if ((d = malloc(l)) == NULL) { ars_set_error(pkt, "Out of memory decoding...
false
false
false
false
false
0
appendString(const tstring& str) { size_t const strlen = str.length(); static size_t const sizeOfChar = sizeof (tchar) == 1 ? 1 : 2; if((pos + sizeof(unsigned int) + strlen * sizeOfChar) > maxsize) { getLogLog().error(DCMTK_LOG4CPLUS_TEXT("SocketBuffer::appendString()-") DCMTK_LOG4C...
false
false
false
false
false
0
writeToVtkFile(const string& filename) { std::cout << "FaultedBlock2D::writeToVtkFile( " << filename << " )" << std::endl; // open output file ofstream vtkfile(filename.c_str()); // write header vtkfile << "<VTKFile type=\"UnstructuredGrid\" version=\"0.1\">\n"; vtkfile << "<UnstructuredGrid>\n"; vtkfil...
false
false
false
false
false
0
OP_SMULL_S(armcpu_t *cpu) { u32 i = cpu->instruction; s64 v = (s32)cpu->R[REG_POS(i,0)]; s64 b = (s32)cpu->R[REG_POS(i,8)]; s64 res = v * b; cpu->R[REG_POS(i,12)] = (u32)res; cpu->R[REG_POS(i,16)] = (u32)(res>>32); cpu->CPSR.bits.N = BIT31(cpu->R[REG_POS(i,16)]); ...
false
false
false
false
false
0
brcmf_dev_reset(struct device *dev) { struct brcmf_bus *bus_if = dev_get_drvdata(dev); struct brcmf_pub *drvr = bus_if->drvr; if (drvr == NULL) return; if (drvr->iflist[0]) brcmf_fil_cmd_int_set(drvr->iflist[0], BRCMF_C_TERMINATED, 1); }
false
false
false
false
false
0
bar_menu_popup(GtkWidget *widget) { GtkWidget *menu; GtkWidget *bar; GtkWidget *expander; const KnownPanes *pane = known_panes; BarData *bd; bd = g_object_get_data(G_OBJECT(widget), "bar_data"); if (bd) { expander = NULL; bar = widget; } else { expander = widget; bar = widget->parent; while (...
false
false
false
false
false
0
clear_image2(struct image *img) { int i; int color = img->palette->pixels[0]; int width = img->width * img->bytesperpixel; if (!width) width = (img->width + 7) / 8; for (i = 0; i < img->height; i++) memset_long(img->currlines[i], color, (size_t) width); }
false
false
false
false
false
0
camel_store_summary_add_from_path (CamelStoreSummary *summary, const gchar *path) { CamelStoreInfo *info; g_return_val_if_fail (CAMEL_IS_STORE_SUMMARY (summary), NULL); g_return_val_if_fail (path != NULL, NULL); g_rec_mutex_lock (&summary->priv->summary_lock); info = g_hash_ta...
false
false
false
true
false
1
ec_pts_mul_basic(const mp_int *k1, const mp_int *k2, const mp_int *px, const mp_int *py, mp_int *rx, mp_int *ry, const ECGroup *group) { mp_err res = MP_OKAY; mp_int sx, sy; ARGCHK(group != NULL, MP_BADARG); ARGCHK(!((k1 == NULL) && ((k2 == NULL) || (px == NULL) || (py == NULL))), MP_BADARG); ...
false
false
false
false
false
0
generate_vs_special_vars() { if (state->is_version(130, 300)) add_system_value(SYSTEM_VALUE_VERTEX_ID, int_t, "gl_VertexID"); if (state->ARB_draw_instanced_enable) add_system_value(SYSTEM_VALUE_INSTANCE_ID, int_t, "gl_InstanceIDARB"); if (state->ARB_draw_instanced_enable || state->is_version(140, 3...
false
false
false
false
false
0
set_turn_to_next_player_and_notify_him(connection_data *connection, int player_id) { int index, loop_hole = 0; for (index = player_id + 1; index != player_id; index++) { if (loop_hole) return; if (index == MAX_CONNECTIONS) { index = 0; if (player_id == -1) ...
false
false
false
false
false
0
genUSED( char *s, int c ) /* Czo */ { char *t, *u; if ((t = strchr(s, '[')) == NULL) u = UNCONNECTED; else { u = malloc((strlen(UNCONNECTED) + strlen(t) + 1) * sizeof(char)); sprintf(u, "%s%s", UNCONNECTED, t); } return c ? s : u; }
false
false
false
false
false
0
bnx2x_mcast_setup_e1h(struct bnx2x *bp, struct bnx2x_mcast_ramrod_params *p, enum bnx2x_mcast_cmd cmd) { int i; struct bnx2x_mcast_obj *o = p->mcast_obj; struct bnx2x_raw_obj *r = &o->raw; /* If CLEAR_ONLY has been requested - clear the registry * and clear a pending bit. */ if (!test_bit(RAMROD_DRV...
false
false
false
false
false
0
complete_connection (NMDevice *device, NMConnection *connection, const char *specific_object, const GSList *existing_connections, GError **error) { NMDeviceInfinibandPrivate *priv = NM_DEVICE_INFINIBAND_GET_PRIVATE (device); NMSetting...
false
false
false
false
false
0
SDP_Pair_create(SDP *sdp, SubOpt *subopt, Comparison *comparison, gpointer user_data){ register SDP_Pair *sdp_pair = g_new(SDP_Pair, 1); g_assert(sdp); sdp_pair->sdp = SDP_share(sdp); g_assert(comparison); g_assert(Comparison_has_hsps(comparison));...
false
false
false
false
false
0
treebrowser_bookmarks_set_state(void) { if (gtk_tree_store_iter_is_valid(treestore, &bookmarks_iter)) bookmarks_expanded = tree_view_row_expanded_iter(GTK_TREE_VIEW(treeview), &bookmarks_iter); else bookmarks_expanded = FALSE; }
false
false
false
false
false
0
enc28j60_lowpower(struct enc28j60_net *priv, bool is_low) { if (netif_msg_drv(priv)) dev_dbg(&priv->spi->dev, "%s power...\n", is_low ? "low" : "high"); mutex_lock(&priv->lock); if (is_low) { nolock_reg_bfclr(priv, ECON1, ECON1_RXEN); poll_ready(priv, ESTAT, ESTAT_RXBUSY, 0); poll_ready(priv, ECON1, ECO...
false
false
false
false
false
0
mosquitto_new(const char *id, bool clean_session, void *userdata) { struct mosquitto *mosq = NULL; int rc; if(clean_session == false && id == NULL){ errno = EINVAL; return NULL; } #ifndef WIN32 signal(SIGPIPE, SIG_IGN); #endif mosq = (struct mosquitto *)_mosquitto_calloc(1, sizeof(struct mosquitto)); if(m...
false
false
false
false
false
0
set_pen_state(const pen_data& pen) const { std::stringstream buf; if (pen.color() != m_stroke) { buf << "\\pgfsetstrokecolor{" << format::print(pen.color()) << "}" << std::endl; m_stroke = pen.color(); } if (pen.width() != m_lwidth) { buf << "\\pgfsetlinewidth{" << format::prin...
false
false
false
false
false
0
lt_init(const char *name) { struct lt_trace *lt=(struct lt_trace *)calloc(1, sizeof(struct lt_trace)); if(!(lt->handle=fopen(name, "wb"))) { free(lt); lt=NULL; } else { lt_emit_u16(lt, LT_HDRID); lt_emit_u16(lt, LT_VERSION); lt->change_field_offset = lt->position; lt->initial_value = -1; /* if a user sets...
false
false
false
false
false
0
transaction_list_redraw ( void ) { CustomList *custom_list; gint i; GtkTreeIter iter; custom_list = transaction_model_get_model (); g_return_val_if_fail ( custom_list != NULL, 0); iter.stamp = custom_list -> stamp; for ( i=0 ; i < custom_list -> num_visibles_rows ; i++) { CustomReco...
false
false
false
false
false
0
intd_filehandle_make(strid_t savefile) { if(!game_filename) return; w_glk_put_string_stream(savefile, "UNIX"); glk_put_char_stream(savefile, b00000010); /* Flags */ glk_put_char_stream(savefile, 0); /* Contents ID */ glk_put_char_stream(savefile, 0); /* Reserved */ glk_put_char_stream(sa...
false
false
false
false
false
0
UAbuildSubset( DdManager * dd /* DD manager */, DdNode * node /* current node */, ApproxInfo * info /* node info */) { DdNode *Nt, *Ne, *N, *t, *e, *r; NodeData *infoN; if (Cudd_IsConstant(node)) return(node); N = Cudd_Regular(node); if ((infoN = (NodeData *) cuddHashTableGenericLookup(in...
false
false
false
false
false
0
_nl_locale_subfreeres (void) { #ifdef NL_CURRENT_INDIRECT /* We don't use the loop because we want to have individual weak symbol references here. */ # define DEFINE_CATEGORY(category, category_name, items, a) \ if (CATEGORY_USED (category)) \ { \ extern struct __loca...
false
false
false
false
false
0
rgb_rgb_565D_convert (j_decompress_ptr cinfo, JSAMPIMAGE input_buf, JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows) { register JSAMPROW outptr; register JSAMPROW inptr0, inptr1, inptr2; register JDIMENSION col; register JSAMPLE * range_limit = cinfo->sample_range_limit; JDIMENSION...
false
false
false
false
false
0
save_calculate_resolutions(PixmapSaveArgs *args) { gdouble xreal, yreal, scale; args->xres = gwy_data_field_get_xres(args->dfield); args->yres = gwy_data_field_get_yres(args->dfield); if (!args->realsquare) return; xreal = gwy_data_field_get_xreal(args->dfield); yreal = gwy_data_field_...
false
false
false
false
false
0
local_define_builtin (const char *name, tree type, enum built_in_function code, const char *library_name, int ecf_flags) { tree decl; decl = add_builtin_function (name, type, code, BUILT_IN_NORMAL, library_name, NULL_TREE); if (ecf_flags & ECF_CONST) TREE_READONLY (decl) = 1; ...
false
false
false
false
false
0
usb_pipetype_str(int pipe) { if (usb_pipeisoc(pipe)) return "Isoc"; if (usb_pipeint(pipe)) return "Int"; if (usb_pipecontrol(pipe)) return "Ctrl"; if (usb_pipebulk(pipe)) return "Bulk"; return "?"; }
false
false
false
false
false
0
bas_gigaset_exit(void) { struct bas_cardstate *ucs; int i; gigaset_blockdriver(driver); /* => probe will fail * => no gigaset_start any more */ /* stop all connected devices */ for (i = 0; i < driver->minors; i++) { if (gigaset_shutdown(driver->cs + i) < 0) continue; /* no device */ /...
false
false
false
false
false
0
command (const char *fmt, ...) { va_list ap; int r; sighandler_t oldintr; abrtflag = 0; if (debug) { printf ("---> "); va_start (ap, fmt); if (strncmp ("PASS ", fmt, 5) == 0) printf ("PASS XXXX"); else if (strncmp ("ACCT ", fmt, 5) == 0) printf ("ACCT XXXX"); else vfprint...
false
false
false
false
false
0
print_instantiation_partial_context (diagnostic_context *context, tree t, location_t loc) { for (; t; t = TREE_CHAIN (t)) { pp_verbatim (context->printer, "%s:%d: instantiated from `%s'\n", loc.file, loc.line, decl_as_string (TINST...
false
false
false
false
true
1
relativeFilename (const char *file, const char *dir) { const char *fp, *dp; char *absdir, *res; int i; /* Find the common root of file and dir (with a trailing slash). */ absdir = absoluteFilename (file); fp = absdir; dp = dir; while (*fp++ == *dp++) continue; fp--; dp--; /* back to the first differing ch...
false
false
false
false
true
1
gen_sinc( float *out, int count, double oversample, double treble, double cutoff ) { int i; double maxh, rolloff, pow_a_n, to_angle; if( cutoff > 0.999 ) cutoff = 0.999; if( treble < -300.0 ) treble = -300.0; if( treble > 5.0 ) treble = 5.0; maxh = 4096.0; rolloff = pow( 10.0, 1.0...
false
false
false
false
false
0
index_init_entry(git_index_entry *entry, git_index *index, const char *rel_path, int stage) { char full_path[GIT_PATH_MAX]; struct stat st; int error; if (index->repository == NULL) return git__throw(GIT_EBAREINDEX, "Failed to initialize entry. Repository is bare"); git_path_join(full_path, index->repository->...
false
false
false
false
false
0
gnm_beta (gnm_float a, gnm_float b) { int sign; gnm_float absres = gnm_exp (gnm_lbeta3 (a, b, &sign)); return sign == -1 ? -absres : absres; }
false
false
false
false
false
0
evd_web_transport_server_reject_peer (EvdTransport *transport, EvdPeer *peer) { HandshakeData *data; data = g_object_get_data (G_OBJECT (peer), HANDSHAKE_DATA_KEY); if (data == NULL) return TRUE; g_signal_handlers_disconnect_by_func (data->conn, evd_web_transport_se...
false
false
false
false
false
0
rawnet_send_data( struct us_socket_collection_s *self, void *context, int fd, struct sockaddr const *to_addr, socklen_t to_addrlen, uint8_t const *buf_, ...
false
false
false
false
false
0
mime_part_encode (GMimeObject *object, GMimeEncodingConstraint constraint) { GMimePart *part = (GMimePart *) object; GMimeContentEncoding encoding; GMimeStream *stream, *null; GMimeFilter *filter; switch (part->encoding) { case GMIME_CONTENT_ENCODING_DEFAULT: /* Unspecified encoding, we need to figure out the...
false
false
false
false
false
0
arch_emit_unbox_trampoline (MonoAotCompile *acfg, MonoCompile *cfg, MonoMethod *method, const char *call_target) { #if defined(TARGET_AMD64) guint8 buf [32]; guint8 *code; int this_reg; this_reg = mono_arch_get_this_arg_reg (NULL); code = buf; amd64_alu_reg_imm (code, X86_ADD, this_reg, sizeof (MonoObject)); e...
false
false
false
false
false
0
AllUsesDominatedByBlock(Instruction *Inst, BasicBlock *BB) const { // Ignoring debug uses is necessary so debug info doesn't affect the code. // This may leave a referencing dbg_value in the original block, before // the definition of the vreg. Dwarf generator handles this ...
false
false
false
false
false
0
on_trigger_entry_text_changed (GObject *entry_obj, GParamSpec *param_spec, gpointer user_data) { SnippetsEditorPrivate *priv = NULL; /* Assertions */ g_return_if_fail (ANJUTA_IS_SNIPPETS_EDITOR (user_data)); priv = ANJUTA_SNIPPETS_EDITOR_GET_PRIVATE (u...
false
false
false
false
false
0
ddsche_write_entity_of_mf_branch_modules(csbe_context *cx, List *list) { List *li; for (li = list; li != NULL; li = li->next) { Hmdf_table *hmdf = li->data; int state_data_number = get_state_data_number_from_mtg_id(hmdf->mtg_id); int cl_no, mt_no; Block *b; int mt_num = ...
false
false
false
false
false
0
InterpolateTwoRows(const fixed_y_t* const best_y, const fixed_t* const prev_uv, const fixed_t* const cur_uv, const fixed_t* const next_uv, int w, fixed_y_t* const ou...
false
false
false
false
false
0
random_linexpr(int dim) { ap_linexpr0_t* l = ap_linexpr0_alloc(AP_LINEXPR_DENSE,dim); int i; for (i=0;i<dim;i++) ap_coeff_set_scalar_frac(l->p.coeff+i,rand()%20-10,rand()%4+1); ap_coeff_set_scalar_frac(&l->cst,rand()%20-10,rand()%4+1); return l; }
false
false
false
false
false
0