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
ExternalUnbind(char *sz) { if (strchr(sz, ':') && !strchr(sz, '/')) /* it was a TCP socket; no cleanup necessary */ return; g_unlink(sz); }
false
false
false
false
false
0
hwloc_custom_component_instantiate(struct hwloc_disc_component *component, const void *_data1 __hwloc_attribute_unused, const void *_data2 __hwloc_attribute_unused, const void *_data3 __hwloc_attribute_unused) { struct hwloc_backend *backend; backend = hwloc_backend_alloc(component); if (!bac...
false
false
false
false
false
0
SetColorEntry( int i, const GDALColorEntry * poEntry ) { if( i < 0 ) return; try { if( i >= static_cast<int>(aoEntries.size()) ) { GDALColorEntry oBlack; oBlack.c1 = oBlack.c2 = oBlack.c3 = oBlack.c4 = 0; aoEntries.resize(i+1, oBlack); ...
false
false
false
false
false
0
format(const Formattable& obj, UnicodeString& appendTo, FieldPosition& pos, UErrorCode& status) const { if (U_FAILURE(status)) { return appendTo; } UDate date = Calendar::getNow(); if (obj.getType() == Formattable::kObject) { const UObject* formatObj = obj.getObject(); co...
false
false
false
false
false
0
getVariable(CState *st, char *name) { Variable key, *var; /* On some versions of Solaris, bsearch of zero items dumps core */ if (st->nvariables <= 0) return NULL; key.name = name; var = (Variable *) bsearch((void *) &key, (void *) st->variables, st->nvariables, sizeof(Varia...
false
false
false
false
false
0
boxes_search_provider_dbus_interface_set_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GVariant* value, GError** error, gpointer user_data) { gpointer* data; gpointer object; data = user_data; object = data[0]; if (str...
false
false
false
false
false
0
geoip_load_file(const char *filename, const or_options_t *options) { FILE *f; const char *msg = ""; int severity = options_need_geoip_info(options, &msg) ? LOG_WARN : LOG_INFO; crypto_digest_t *geoip_digest_env = NULL; clear_geoip_db(); if (!(f = tor_fopen_cloexec(filename, "r"))) { log_fn(severity, LD_...
false
false
false
false
false
0
myQuitSDL() { if (gSampleSurface32) SDL_FreeSurface(gSampleSurface32); if (gMaskedFormat.palette) { delete[] gMaskedFormat.palette->colors; delete gMaskedFormat.palette; } SDL_Quit(); }
false
false
false
false
false
0
register_heartbeat_conn(crm_cluster_t * cluster) { crm_node_t *peer = NULL; const char *const_uuid = NULL; const char *const_uname = NULL; crm_debug("Signing in with Heartbeat"); if (cluster->hb_conn->llc_ops->signon(cluster->hb_conn, crm_system_name) != HA_OK) { crm_err("Cannot sign on wit...
false
false
false
false
false
0
_cb_up(void *data, void *data2 __UNUSED__) { E_Config_Dialog_Data *cfdata; void *nddata; Evas_Object *ic; Eina_List *l; const char *lbl, *file; int n; if (!(cfdata = data)) return; if ((n = e_widget_ilist_selected_get(cfdata->used_list)) < 0) return; l = eina_list_nth_list(cfdata->cfg_layou...
false
false
false
false
false
0
pcan_usb_pro_handle_canmsg(struct pcan_usb_pro_interface *usb_if, struct pcan_usb_pro_rxmsg *rx) { const unsigned int ctrl_idx = (rx->len >> 4) & 0x0f; struct peak_usb_device *dev = usb_if->dev[ctrl_idx]; struct net_device *netdev = dev->netdev; struct can_frame *can_frame; struct sk_buff *skb; struct t...
false
true
false
false
false
1
vu_draw_update(t_gobj *client, t_glist *glist) { t_vu *x = (t_vu *)client; if (x->x_updaterms) { vu_update_rms(x, glist); x->x_updaterms = 0; } if (x->x_updatepeak) { vu_update_peak(x, glist); x->x_updatepeak = 0; } }
false
false
false
false
false
0
analyzePHINodes(const MachineFunction& MF) { for (MachineFunction::const_iterator I = MF.begin(), E = MF.end(); I != E; ++I) for (MachineBasicBlock::const_iterator BBI = I->begin(), BBE = I->end(); BBI != BBE && BBI->isPHI(); ++BBI) for (unsigned i = 1, e = BBI->getNumOperands(); i != e; i +...
false
false
false
false
false
0
rt2800usb_probe_hw(struct rt2x00_dev *rt2x00dev) { int retval; retval = rt2800_probe_hw(rt2x00dev); if (retval) return retval; /* * Set txstatus timer function. */ rt2x00dev->txstatus_timer.function = rt2800usb_tx_sta_fifo_timeout; /* * Overwrite TX done handler */ INIT_WORK(&rt2x00dev->txdone_work,...
false
false
false
false
false
0
GrowString ( Obj list, UInt need ) { UInt len; /* new physical length */ UInt good; /* good new physical length */ /* find out how large the data area should become */ good ...
false
false
false
false
false
0
createdir4nick (u_char *nick) { if (nick && nick[0]) { char dir[1024]; strcpy (dir, chatlogdir); if (dir[strlen (dir)-1]!='/') strcat (dir,"/"); strcat (dir,(char *) nick); #ifdef WIN32 mkdir (dir); #else mkdir (dir,0700); #endif } return 0; }
false
false
false
false
false
0
radio_toggled (GtkToggleButton *togglebutton, ZoomState *state) { gint factor; /* We are only interested in the new state */ if (gtk_toggle_button_get_active (togglebutton)) { factor = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (togglebutton), ZOOM_DIALOG_FACTOR_KEY)); gtk_spin_button_set_value (G...
false
false
false
false
false
0
CreateUniqueFilename() // ---------------------------------------------------------------------------- { const wxString prefix = _("Untitled"); const wxString path = wxGetCwd() + wxFILE_SEP_PATH; wxString tmp; int iter = 0; while (true) { tmp.Clear(); tmp << path << prefix << wxS...
false
false
false
false
false
0
ocfs2_free_cached_clusters(struct ocfs2_super *osb, struct ocfs2_cached_block_free *head) { struct ocfs2_cached_block_free *tmp; struct inode *tl_inode = osb->osb_tl_inode; handle_t *handle; int ret = 0; mutex_lock(&tl_inode->i_mutex); while (head) { if (ocfs2_truncate_log_needs_flush(osb)) { ret...
false
false
false
false
false
0
mark_lock(struct task_struct *curr, struct held_lock *this, enum lock_usage_bit new_bit) { unsigned int new_mask = 1 << new_bit, ret = 1; /* * If already set then do not dirty the cacheline, * nor do any checks: */ if (likely(hlock_class(this)->usage_mask & new_mask)) return 1; if (!graph_lock()) ...
false
false
false
false
false
0
set_group(const Glib::ustring& group_name) { //Fill the list of groups: m_combo_group->remove_all(); type_vec_strings group_list = Privs::get_database_groups(); for(type_vec_strings::const_iterator iter = group_list.begin(); iter != group_list.end(); ++iter) { m_combo_group->append(*iter); } m_combo...
false
false
false
false
false
0
operator<(const ShiftSegment& rhs) const { const Point& lowPt = lowPoint(); const Point& rhsLowPt = rhs.lowPoint(); if (lowPt[dimension] != rhsLowPt[dimension]) { return lowPt[dimension] < rhsLowPt[dimension]; } return this...
false
false
false
false
false
0
mls_write_range_helper(struct mls_range *r, void *fp) { __le32 buf[3]; size_t items; int rc, eq; eq = mls_level_eq(&r->level[1], &r->level[0]); if (eq) items = 2; else items = 3; buf[0] = cpu_to_le32(items-1); buf[1] = cpu_to_le32(r->level[0].sens); if (!eq) buf[2] = cpu_to_le32(r->level[1].sens); BU...
false
false
false
false
false
0
main(int argc, char *argv[]) { EB_Error_Code error_code; char out_path[PATH_MAX + 1]; char book_path[PATH_MAX + 1]; char subbook_name_list[EB_MAX_SUBBOOKS][EB_MAX_DIRECTORY_NAME_LENGTH + 1]; int subbook_name_count = 0; int ch; invoked_name = argv[0]; strcpy(out_path, DEFAULT_OUTPUT_DIRE...
true
true
false
false
true
1
mono_class_is_open_constructed_type (MonoType *t) { switch (t->type) { case MONO_TYPE_VAR: case MONO_TYPE_MVAR: return TRUE; case MONO_TYPE_SZARRAY: return mono_class_is_open_constructed_type (&t->data.klass->byval_arg); case MONO_TYPE_ARRAY: return mono_class_is_open_constructed_type (&t->data.array->eklass...
false
false
false
false
false
0
CreateRelayPorts() { if (flags_ & PORTALLOCATOR_DISABLE_RELAY) { LOG(LS_VERBOSE) << "AllocationSequence: Relay ports disabled, skipping."; return; } // If BasicPortAllocatorSession::OnAllocate left relay ports enabled then we // ought to have a relay list for them here. ASSERT(config_ && !config_->...
false
false
false
false
false
0
gst_rtp_jitter_buffer_flush_stop (GstRtpJitterBuffer * jitterbuffer) { GstRtpJitterBufferPrivate *priv; priv = jitterbuffer->priv; JBUF_LOCK (priv); GST_DEBUG_OBJECT (jitterbuffer, "Enabling pop on queue"); /* Mark as non flushing */ priv->srcresult = GST_FLOW_OK; gst_segment_init (&priv->segment, GST_F...
false
false
false
false
false
0
locate(const char *exe) { int len; char *path, *pathe, *name, *thenam, nambuf[PATH_MAX+1]; if (!(path = getenv("PATH"))) { logError("Cannot execute %'s: $PATH not set.\n", exe); return 0; } len = strlen(exe); name = nambuf + PATH_MAX - len; memcpy(name, exe, len + 1); *-...
true
true
false
false
true
1
msea_create_weight(Searcher *self, Query *query) { int i, *doc_freqs; Searcher *cdfsea; Weight *w; Hash *df_map = h_new((hash_ft)&term_hash, (eq_ft)&term_eq, (free_ft)term_destroy, free); Query *rewritten_query = self->rewrit...
false
false
false
false
false
0
Strsafe(const char *y) { const char *z; char *cpy; if( y==0 ) return 0; z = Strsafe_find(y); if( z==0 && (cpy=(char *)malloc( lemonStrlen(y)+1 ))!=0 ){ strcpy(cpy,y); z = cpy; Strsafe_insert(z); } MemoryCheck(z); return z; }
false
false
false
false
false
0
bnx2x_set_ctx_validation(struct bnx2x *bp, struct eth_context *cxt, u32 cid) { if (!cxt) { BNX2X_ERR("bad context pointer %p\n", cxt); return; } /* ustorm cxt validation */ cxt->ustorm_ag_context.cdu_usage = CDU_RSRVD_VALUE_TYPE_A(HW_CID(bp, cid), CDU_REGION_NUMBER_UCM_AG, ETH_CONNECTION_TYPE); ...
false
false
false
false
false
0
AddFile(FileWithName &header) { StringFilter sf; sf.SetFile( header ); int allrules = 1; // First step the user has defined a set of rules for the DICOM // he is looking for. // make sure the file correspond to his set of rules: std::string s; for(SerieRestrictions::iterator it2 = Restrictions.begin();...
false
false
false
false
false
0
drv_BuE_MT_defchar(const int ascii, const unsigned char *matrix) { int i; char cmd[22] = ESC "&T"; /* enter transparent mode */ cmd[3] = '\0'; /* write cmd */ cmd[4] = 0x40 | 8 * ascii; /* write CGRAM */ for (i = 0; i < 8; i++) { cmd[2 * i + 5] = '\1'; /* write data */ cmd[2 * i + 6] = matrix[i...
false
false
false
false
false
0
strndup(const char *s, size_t n) { size_t len = strlen(s); char *new; if (len>n) len = n; new = malloc(len+1); if (new) { new[len] = '\0'; memcpy(new,s,len); } return new; }
false
true
false
false
false
1
valid_header(char *c) { while (*c != '\0') if (!isalpha((unsigned char)*c) && !isdigit((unsigned char)*c) && *c != '-' && *c != '/') return False; else c++; return True; }
false
false
false
false
false
0
ini_store_int64(LEX *lc, ConfigFile *inifile, ini_items *item) { if (!lc) { Mmsg(inifile->edit, "%lld", item->val.int64val); return true; } if (lex_get_token(lc, T_INT64) == T_ERROR) { return false; } item->val.int64val = lc->int64_val; scan_to_eol(lc); return true; }
false
false
false
false
false
0
gsf_outfile_open_pkg_create_rel (GsfOutfileOpenPkg *parent, char *target, char const *type, gboolean is_extern) { GsfOpenPkgRel *rel = g_new0 (GsfOpenPkgRel, 1); rel->target = target; rel->type = g_strdup (type); rel->id = g_strdup_printf ("rId%u", g_slist_length (parent->relations) + 1); rel-...
false
false
false
false
false
0
test_read_string_ssid (void) { NMConnection *connection; NMSettingWireless *s_wireless; GError *error = NULL; const GByteArray *array; const char *expected_ssid = "blah blah ssid 1234"; connection = nm_keyfile_plugin_connection_from_file (TEST_STRING_SSID_FILE, NULL); ASSERT (connection != NULL, "connection-...
false
false
false
true
false
1
gwy_app_settings_gather(GwyContainer *settings) { GPtrArray *preferred; const gchar *name; /* Preferred resources */ preferred = g_ptr_array_new(); gwy_inventory_foreach(gwy_gradients(), &add_preferred_resource_name, preferred); g_ptr_array_add(preferred, NULL); gw...
false
false
false
false
false
0
do_opendir(const char *path, int flags, rb_encoding *enc) { DIR *dirp; #ifdef _WIN32 volatile VALUE tmp; if (enc != rb_usascii_encoding() && enc != rb_ascii8bit_encoding() && enc != rb_utf8_encoding()) { tmp = rb_enc_str_new(path, strlen(path), enc); tmp = rb_str_encode_ospath(tmp); path = RSTRING_PTR(...
false
false
false
false
false
0
gl_object_editor_get_fill_color (glObjectEditor *editor) { guint color; gboolean is_default; glColorNode *color_node; gl_debug (DEBUG_EDITOR, "START"); color_node = gl_color_node_new_default (); if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->fill_key_radio)))...
false
false
false
false
false
0
php_native_count(PHP_VALUE_NODE *result) { PHP_SCOPE_ITEM *si = get_scope_item(g_current_scope, "__param_0"); if ( si ) { PHP_VALUE_NODE *param = &si->var->value; if ( result ) { cast_value_dnum(result); if ( (si->var->value.type == PHP_VAL_NONE) || (si->var->value.type != PHP_VAL_ARRAY) ) { result->int...
false
false
false
false
false
0
get_stale_heads_cb(const char *refname, const unsigned char *sha1, int flags, void *cb_data) { struct stale_heads_info *info = cb_data; struct refspec refspec; memset(&refspec, 0, sizeof(refspec)); refspec.dst = (char *)refname; if (!remote_find_tracking(info->remote, &refspec)) { if (!((flags & REF_ISSYMREF) |...
false
false
false
false
false
0
sk_insert(_STACK *st, void *data, int loc) { char **s; if(st == NULL) return 0; if (st->num_alloc <= st->num+1) { s=OPENSSL_realloc((char *)st->data, (unsigned int)sizeof(char *)*st->num_alloc*2); if (s == NULL) return(0); st->data=s; st->num_alloc*=2; } if ((loc >= (int)st->num) || (loc < 0)) ...
false
false
false
false
false
0
isBignum(c) /* cell holds bignum value? */ Cell c; { return c==ZERONUM || (isPair(c) && (fst(c)==POSNUM || fst(c)==NEGNUM)); }
false
false
false
false
false
0
FcObjectValidType (FcObject object, FcType type) { const FcObjectType *t = FcObjectFindById (object); if (t) { switch ((int) t->type) { case FcTypeDouble: case FcTypeInteger: if (type == FcTypeDouble || type == FcTypeInteger) return FcTrue; break; case FcTypeLangSet: if (type == FcTypeL...
false
false
false
false
false
0
Copy(const List * l) { List *result; ListElement *elem, *newElem; if (l == NULL) { NullPtrError("Copy"); return NULL; } result = iList.CreateWithAllocator(l->ElementSize, l->Allocator); if (result == NULL) { l->RaiseError("iList.Copy", CONTAINER_ERROR_NOMEMO...
false
false
false
false
false
0
MonTempGatherData(double *cf_this) { Debug("GatherSensorData()\n"); switch(VSYSTEMHARDCLASS) { case linuxx: if (ACPI && GetAcpi(cf_this)) { return; } if (LMSENSORS && GetLMSensors(cf_this)) { return; } break; default: break; } }
false
false
false
false
false
0
EvalPlanQualStart(evalPlanQual *epq, EState *estate, evalPlanQual *priorepq) { EState *epqstate; int rtsize; MemoryContext oldcontext; rtsize = list_length(estate->es_range_table); /* * It's tempting to think about using CreateSubExecutorState here, but * at present we can't because of memory leakage co...
false
false
false
false
false
0
NumSpoilers() { int na = NumAlive(); int count = 0; for(int x=0; x<na; x++) { Unit * u = soldiers[x]->unit; if(!(u->flags & FLAG_NOSPOILS)) count++; } return count; }
false
false
false
false
false
0
TransmitSetSystemAudioMode(cec_logical_address dest, bool bIsReply) { cec_system_audio_status state; { CLockObject lock(m_mutex); LIB_CEC->AddLog(CEC_LOG_DEBUG, "<< %x -> %x: set system audio mode '%2x'", m_iLogicalAddress, dest, m_audioStatus); state = m_systemAudioStatus; } return m_handler->Tran...
false
false
false
false
false
0
mq_get_dirty_inode_size (call_frame_t *frame, xlator_t *this) { int32_t ret = -1; dict_t *dict = NULL; quota_local_t *local = NULL; local = (quota_local_t *) frame->local; dict = dict_new (); if (!dict) { ret = -1; goto e...
false
false
false
false
false
0
dvb_desc_sat_init(struct dvb_v5_fe_parms *parms, const uint8_t *buf, struct dvb_desc *desc) { struct dvb_desc_sat *sat = (struct dvb_desc_sat *) desc; /* copy from .length */ memcpy(((uint8_t *) sat ) + sizeof(sat->type) + sizeof(sat->next) + sizeof(sat->length), buf, sat->length); bswap16(sat->orbit); bswap32...
false
true
false
false
false
1
mtr_memo_release( /*=============*/ mtr_t* mtr, /*!< in/out: mini-transaction */ void* object, /*!< in: object */ ulint type) /*!< in: object type: MTR_MEMO_S_LOCK, ... */ { const dyn_block_t* block; ut_ad(mtr->magic_n == MTR_MAGIC_N); ut_ad(mtr->state == MTR_ACTIVE); /* We cannot release a page that has been w...
false
false
false
false
false
0
operator bool () const { if (type == TYPE_BOOLEAN) { return boolValue; } else { std::stringstream buff; buff << "Invalid type: requesting BOOLEAN, but type is " << type << "!"; throw InvalidType(buff.str()); } }
false
false
false
false
false
0
allocate() { allocated = 1; int n = atom->ntypes; memory->create(setflag,n+1,n+1,"pair:setflag"); for (int i = 1; i <= n; i++) for (int j = i; j <= n; j++) setflag[i][j] = 0; memory->create(cutsq,n+1,n+1,"pair:cutsq"); memory->create(rad,n+1,"pair:rad"); memory->create(cut,n+1,n+1,"pair:cut")...
false
false
false
false
false
0
efreet_menu_save(Efreet_Menu *menu, const char *path) { FILE *f; int ret; EINA_SAFETY_ON_NULL_RETURN_VAL(menu, 0); EINA_SAFETY_ON_NULL_RETURN_VAL(path, 0); f = fopen(path, "w"); if (!f) return 0; fprintf(f, "<?xml version=\"1.0\"?>\n"); fprintf(f, "<!DOCTYPE Menu PUBLIC \"-//freedeskto...
false
false
false
false
true
1
request_cmvs_old(struct uea_softc *sc, void **cmvs, const struct firmware **fw) { int ret, size; u8 *data; char cmv_name[UEA_FW_NAME_MAX]; /* 30 bytes stack variable */ cmvs_file_name(sc, cmv_name, 1); ret = request_firmware(fw, cmv_name, &sc->usb_dev->dev); if (ret < 0) { uea_err(INS_TO_USBDEV(sc), ...
false
false
false
false
false
0
function_called_by_processed_nodes_p (void) { struct cgraph_edge *e; for (e = cgraph_get_node (current_function_decl)->callers; e; e = e->next_caller) { if (e->caller->decl == current_function_decl) continue; if (!cgraph_function_with_gimple_body_p (e->caller)) continue...
false
false
false
false
false
0
thermal_set_mode(struct thermal_zone_device *thermal, enum thermal_device_mode mode) { struct acpi_thermal *tz = thermal->devdata; int enable; if (!tz) return -EINVAL; /* * enable/disable thermal management from ACPI thermal driver */ if (mode == THERMAL_DEVICE_ENABLED) enable = 1; else if (mode == ...
false
false
false
false
false
0
match_mbcs(InputText *det, const uint16_t commonChars[], int32_t commonCharsLen) const { int32_t singleByteCharCount = 0; int32_t doubleByteCharCount = 0; int32_t commonCharCount = 0; int32_t badCharCount = 0; int32_t totalCharCount = 0; int32_t confidence = 0; Itera...
false
false
false
false
false
0
AppendTargetDepends(std::vector<std::string>& depends) { // Static libraries never depend on anything for linking. if(this->Target->GetType() == cmTarget::STATIC_LIBRARY) { return; } // Loop over all library dependencies. const char* cfg = this->LocalGenerator->ConfigurationName.c_str(); if(cmCom...
false
false
false
false
false
0
dht_writev2 (xlator_t *this, call_frame_t *frame, int op_ret) { dht_local_t *local = NULL; xlator_t *subvol = NULL; uint64_t tmp_subvol = 0; int ret = -1; local = frame->local; ret = fd_ctx_get (local->fd, this, &tmp_subvol); if (!ret) ...
false
false
false
false
false
0
explain_buffer_enomedium_fildes_q(explain_string_buffer_t *sb, int fildes) { #ifdef CDROM_GET_CAPABILITY { int cap; cap = 0; if (ioctl(fildes, CDROM_GET_CAPABILITY, &cap) >= 0) { const char *drive_type; /* * FIXME: we could be e...
false
false
false
false
false
0
streamio_gets(char *temp, int max, streamio_t *streamio) { char *stop; char *line; if (streamio) { while (streamio->next) { line = streamio->next; while (*(streamio->next) != 0) streamio->next++; streamio->next++; streamio->line++; if (*(streamio->next) == 1) streamio->next = NULL; while ...
false
false
false
false
false
0
granulepos_to_granule_vp8 (GstOggStream * pad, gint64 gpos) { guint64 gp = (guint64) gpos; guint32 pt; guint32 dist; pt = (gp >> 32); dist = (gp >> 3) & 0x07ffffff; GST_DEBUG ("pt %u, dist %u", pt, dist); return pt; }
false
false
false
false
false
0
globus_l_seg_stdout_deactivate(void) { globus_mutex_lock(&globus_l_seg_mutex); globus_l_seg_shutdown = 1; if (globus_l_seg_write_registered) { while (globus_l_seg_shutdown == 1) { globus_cond_wait(&globus_l_seg_cond, &globus_l_seg_mutex); } } globus_fifo_dest...
false
false
false
false
false
0
gga_report(void) { FuncList* lst; fun_printf("Weighted mixed functional:"); if(fun_get_hf_weight()>0) fun_printf("%25s: %10.5f", "HF exchange", (double)fun_get_hf_weight()); for(lst=gga_fun_list; lst; lst=lst->next) fun_printf("%25s: %10.5f", lst->func->name, (double)lst->weight); }
false
false
false
false
false
0
generate_output_(vvp_net_ptr_t ptr) { vvp_vector8_t out (bit_.size()); for (unsigned idx = 0 ; idx < out.size() ; idx += 1) { vvp_bit4_t b_en = en_.value(idx); vvp_scalar_t b_bit = bit_.value(idx); switch (b_en) { case BIT4_0: out.set_bit(idx, b_bit); break; case BIT4_1: ...
false
false
false
false
false
0
st_own_ctrl(struct mISDNchannel *ch, u_int cmd, void *arg) { if (!ch->st || !ch->st->layer1) return -EINVAL; return ch->st->layer1->ctrl(ch->st->layer1, cmd, arg); }
false
false
false
false
false
0
preaccept(s, sinp, len, opt) int s; struct sockaddr_in *sinp; sock_len_t len; int opt; { if (chgsockopt(s, opt) < 0) return(-1); if (bind(s, (struct sockaddr *)sinp, len) < 0) return(-1); if (listen(s, SCK_BACKLOG) < 0) return(-1); return(0); }
false
false
false
false
false
0
list2dict(PyObject *list) { Py_ssize_t i, n; PyObject *v, *k; PyObject *dict = PyDict_New(); if (!dict) return NULL; n = PyList_Size(list); for (i = 0; i < n; i++) { v = PyLong_FromSsize_t(i); if (!v) { Py_DECREF(dict); return NULL; } k = ...
false
false
false
false
false
0
c_ncdinq ( int ncid, /* netCDF ID */ int dimid, /* dimension ID */ char* dimname, /* returned dimension name */ int* size, /* returned dimension size */ int* rcode /* returned error code */ ) { long siz; if (ncdiminq (ncid, dimid, dimname, &siz) == -1) *rcode = ncerr; else ...
false
false
false
false
false
0
nilfs_dat_commit_free(struct inode *dat, struct nilfs_palloc_req *req) { struct nilfs_dat_entry *entry; void *kaddr; kaddr = kmap_atomic(req->pr_entry_bh->b_page); entry = nilfs_palloc_block_get_entry(dat, req->pr_entry_nr, req->pr_entry_bh, kaddr); entry->de_start = cpu_to_le64(NILFS_CNO_MIN); e...
false
false
false
false
false
0
set_label_from_settings (TpawIrcNetworkChooser *self) { gchar *server; tp_clear_object (&self->priv->network); server = tpaw_account_settings_dup_string (self->priv->settings, "server"); if (server != NULL) { TpawIrcServer *srv; gint port; gboolean ssl; self->priv->network = ...
false
false
false
false
false
0
tcl_killutimer STDVAR { BADARGS(2, 2, " timerID"); if (strncmp(argv[1], "timer", 5)) { Tcl_AppendResult(irp, "argument is not a timerID", NULL); return TCL_ERROR; } if (remove_timer(&utimer, atol(&argv[1][5]))) return TCL_OK; Tcl_AppendResult(irp, "invalid timerID", NULL); return TCL_ERROR; }
false
false
false
false
false
0
remove_unprovisioned_providers() { gchar **providers; GKeyFile *keyfile, *configkeyfile; char *file, *section; int i = 0; providers = __connman_storage_get_providers(); if (providers == NULL) return; for (; providers[i] != NULL; i++) { char *group = providers[i] + sizeof("provider_") - 1; file = section ...
false
false
false
false
false
0
GetLetterFont() { QFont lf("Arial", 12, QFont::Bold, false); lf.setStyleHint(QFont::SansSerif); lf.setPixelSize(16); return lf; }
false
false
false
false
false
0
aoc_d_event(const struct ast_aoc_decoded *decoded, struct ast_channel *chan, struct ast_str **msg) { const char *charge_str; int idx; char prefix[32]; if (chan) { ast_str_append(msg, 0, "Channel: %s\r\n", ast_channel_name(chan)); ast_str_append(msg, 0, "UniqueID: %s\r\n", ast_channel_uniqueid(chan)); } char...
false
false
false
false
false
0
initialize(Application& app) { LoggingConfigurator configurator; configurator.configure(&app.config()); std::string logger = app.config().getString("application.logger", "Application"); app.setLogger(Logger::get(logger)); }
false
false
false
false
false
0
ocrdma_flush_qp(struct ocrdma_qp *qp) { bool found; unsigned long flags; struct ocrdma_dev *dev = get_ocrdma_dev(qp->ibqp.device); spin_lock_irqsave(&dev->flush_q_lock, flags); found = ocrdma_is_qp_in_sq_flushlist(qp->sq_cq, qp); if (!found) list_add_tail(&qp->sq_entry, &qp->sq_cq->sq_head); if (!qp->srq) { ...
false
false
false
false
false
0
process(void) { DBC_CHECK(static_cast<int>(num_of_samples.size()) == channels()); int res = pthread_mutex_trylock(&lock_rep); if (res == 0) { i.begin(); while(!i.end()) { DBC_CHECK(num_of_samples.size() > static_cast<unsigned>(i.channel())); num_of_samples[i.channel()]++; if (*i.curre...
false
false
false
false
false
0
Amd7930_init(struct IsdnCardState *cs) { WORD *ptr; BYTE cmd, cnt; if (cs->debug & L1_DEB_ISAC) debugl1(cs, "Amd7930: initamd called"); cs->dc.amd7930.tx_xmtlen = 0; cs->dc.amd7930.old_state = 0; cs->dc.amd7930.lmr1 = 0x40; cs->dc.amd7930.ph_command = Amd7930_ph_command; cs->setstack_d = setstack_Amd7930; ...
false
false
false
false
false
0
SwitchAtomStereoAndIsotopicStereo( sp_ATOM *at, int num_atoms, int *bSwitched ) { int i; /* switch atom stereo data */ for ( i = 0; i < num_atoms; i ++ ) { inchi_swap( (char*)&at[i].parity, (char*)&at[i].parity2, sizeof( at[i].parity ) ); inchi_swap( (char*)&at[i].final_parity, (char*)&at[i...
false
false
false
false
false
0
check_blame_commit(struct blame *blame) { if (!blame->commit) report("Commit data not loaded yet"); else if (!strcmp(blame->commit->id, NULL_ID)) report("No commit exist for the selected line"); else return TRUE; return FALSE; }
false
false
false
false
false
0
nokia_isi_modem_real_registerCustomMediators (FsoGsmAbstractModem* base, GeeHashMap* mediators) { NokiaIsiModem * self; GeeHashMap* _tmp0_ = NULL; GeeHashMap* _tmp1_ = NULL; self = (NokiaIsiModem*) base; g_return_if_fail (mediators != NULL); _tmp0_ = mediators; gee_abstract_map_clear ((GeeAbstractMap*) _tmp0_); ...
false
false
false
false
false
0
map(int blocks) { int i, k; uint8 r, g, b; for (i = 0; i < (2 * blocks); i++) { k = indx(color_pt[i].c[RED], color_pt[i].c[GREEN], color_pt[i].c[BLUE]); if (trans[k] == -1) { r = (uint8) (color_pt[i].c[RED] << 3); g = (uin...
false
false
false
false
false
0
PrintHelp() { printf("Usage:\n"); printf(" shell [options] -e string\n"); printf(" execute string in V8\n"); printf(" shell [options] file1 file2 ... filek\n"); printf(" run JavaScript scripts in file1, file2, ..., filek\n"); printf(" shell [options]\n"); printf(" shell [options] --shell [file1 ...
false
false
false
false
false
0
charWidth(u_int c) const { if (ready) { charInfo* ci = (firstCol <= c && c <= lastCol) ? encoding[c - firstCol] : cdef; return (ci ? ci->cw : 0); } else return (0); }
false
false
false
false
false
0
layout_info_pixel_set(LayoutWindow *lw, gboolean show) { GtkWidget *frame; if (!layout_valid(&lw)) return; if (!lw->info_pixel) return; lw->options.show_info_pixel = show; frame = gtk_widget_get_parent(lw->info_pixel); if (!lw->options.show_info_pixel) { gtk_widget_hide(frame); } else { gtk_widget_...
false
false
false
false
false
0
cavan_ext4_list_dir_write_byte(struct cavan_ext4_walker *walker, void *buff, size_t size) { struct ext2_dir_entry_2 *entry, *entry_end; struct cavan_ext4_list_dir_context *context = walker->context; for (entry = buff, entry_end = ADDR_ADD(entry, size - CAVAN_EXT4_DIR_ENTRY_MIN_LEN); entry < entry_end; entry = ADDR_...
false
false
false
false
false
0
fill(std::vector<std::complex<float> >& outArray, const std::vector<std::complex<double> >& inArray, size_t first, size_t last) { // vector to vector assign. stdlib takes care of deletion. size_t range = last - first + 1; if (outArray.size() != range) o...
false
false
false
false
false
0
fiji_enable_vrhot_gpio_interrupt(struct pp_hwmgr *hwmgr) { if(phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, PHM_PlatformCaps_RegulatorHot)) return smum_send_msg_to_smc(hwmgr->smumgr, PPSMC_MSG_EnableVRHotGPIOInterrupt); return 0; }
false
false
false
false
false
0
check_access(char * pathname, char * cmd, int flags) { /* Wanted acces */ int read_access = 0; int write_access = 0; /* User given access */ int has_read_access = 0; int has_write_access = 0; /* Interactive mode ? */ int ask_me_access = 0; /* "remember yes" reading/writing */ static int read_access_flag = 0; ...
false
false
false
false
false
0
skk_nicola_key_event_filter_timed_entry_finalize (SkkNicolaKeyEventFilterTimedEntry* obj) { SkkNicolaKeyEventFilterTimedEntry * self; self = SKK_NICOLA_KEY_EVENT_FILTER_TIMED_ENTRY (obj); ((self->data == NULL) || (self->priv->t_destroy_func == NULL)) ? NULL : (self->data = (self->priv->t_destroy_func (self->data), N...
false
false
false
false
false
0
IWritePXPhysical(hsStream* S, plResManager* mgr) { S->writeFloat(fMass); S->writeFloat(fFriction); S->writeFloat(fRestitution); S->writeByte(fBounds); S->writeByte(plPXSimDefs::toGroup(fMemberGroup, fCollideGroup)); S->writeInt(plPXSimDefs::setReportsOn(fReportGroup)); S->writeShort(fLOSDBs)...
false
false
false
false
false
0
status_tostr(char *str, struct scdata *sc) { int i; char *str_p = str; nullpo_retr(1, sc); str_p += sprintf(str,"%d,%d\t",sc->char_id, sc->account_id); for(i = 0; i < sc->count; i++) { str_p += sprintf(str_p, "%d,%d,%d,%d,%d,%d ", sc->data[i].type, sc->data[i].val1, sc->data[i].val2, sc->data[i].val3, sc->...
false
false
false
false
false
0
CGN_NINT(float a){ int res=0; res = (a) > 0 ? floor(a+0.5) : -floor(a-0.5); return res; }
false
false
false
false
false
0
build_updated_config( CoreLayer *layer, CoreLayerContext *context, const DFBDisplayLayerConfig *update, CoreLayerRegionConfig *ret_config, CoreLayerRegionConfigFlags *ret_flags ) { CoreLayerR...
false
false
false
false
false
0
Clear() { ENTER ( "MIDIMatrix::Clear()" ); for ( int channel = 0; channel < 16; ++channel ) { ClearChannel ( channel ); } total_count = 0; }
false
false
false
false
false
0