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
clearInputQueue() { // Wait for critical section { CCriticalSectionLocker locker( &m_inputQueue_cs); while (!m_inputQueue.empty()) { //delete m_inputQueue.front(); m_inputQueue.pop(); }; } }
false
false
false
false
false
0
init() { if (graphicsItem) { graphicsItem->setZValue(mapObject()->zValue()); graphicsItem->setVisible(mapObject()->isVisible()); //graphicsItem->setFlag(QGraphicsItem::ItemIsSelectable); } inited = true; if (updateAfterInit) { tiledMapData->updateMapDisplay(); upd...
false
false
false
false
false
0
dump_live_info (FILE *f, tree_live_info_p live, int flag) { basic_block bb; unsigned i; var_map map = live->map; bitmap_iterator bi; if ((flag & LIVEDUMP_ENTRY) && live->livein) { FOR_EACH_BB (bb) { fprintf (f, "\nLive on entry to BB%d : ", bb->index); EXECUTE_IF_SET_IN_BITMAP (&live->livein...
false
false
false
false
false
0
ProcessSecIdentStatePacket(const byte* pachPacket, uint32 nSize) { if ( nSize != 5 ) { return; } if ( !credits ) { wxASSERT( credits ); return; } CMemFile data(pachPacket,nSize); switch ( data.ReadUInt8() ) { case 0: m_SecureIdentState = IS_UNAVAILABLE; break; case 1: m_SecureIdentState = IS...
false
false
false
false
false
0
UpdateAI(const uint32 uiDiff) override { // Return since we have no target if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) { return; } // Frenzy_Timer if (!m_bIsBerserk) { if (m_uiFrenzyTimer < uiDiff) {...
false
false
false
false
false
0
make_template_panel() { { template_panel = new Fl_Double_Window(460, 355, "New/Save Template"); template_panel->callback((Fl_Callback*)cb_template_panel); { template_browser = new Fl_Browser(10, 28, 180, 250, "Available Templates:"); template_browser->type(2); template_browser->labelfont(1); ...
false
false
false
false
false
0
ppc32_exec_ADDME(cpu_ppc_t *cpu,ppc_insn_t insn) { int rd = bits(insn,21,25); int ra = bits(insn,16,20); register m_uint32_t a,b,d; m_uint32_t carry; carry = cpu->xer_ca; cpu->xer_ca = 0; a = cpu->gpr[ra]; b = 0xFFFFFFFF; d = a + b + carry; if (((b + carry) < b) || (d < a)) cpu->x...
false
false
false
false
false
0
wsm_remove_key(struct cw1200_common *priv, const struct wsm_remove_key *arg) { int ret; struct wsm_buf *buf = &priv->wsm_cmd_buf; wsm_cmd_lock(priv); WSM_PUT8(buf, arg->index); WSM_PUT8(buf, 0); WSM_PUT16(buf, 0); ret = wsm_cmd_send(priv, buf, NULL, WSM_REMOVE_KEY_REQ_ID, WSM_CMD_TIMEOUT); wsm_cmd_unl...
false
false
false
false
false
0
get_projectile (struct state *st) { struct projectile *p; if (st->free_projectiles) { p = st->free_projectiles; st->free_projectiles = p->next_free; p->next_free = 0; p->dead = False; return p; } else return 0; }
false
false
false
false
false
0
color(int index) const { if (index < 0 || index > (int) items.count() - 1) return QColor(); ColorPickerPopup *that = (ColorPickerPopup *)this; return that->items.at(index)->color(); }
false
false
false
false
false
0
__pyx_memoryview_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetup...
false
false
false
false
false
0
gst_rmdemux_fourcc_isplausible (guint32 fourcc) { int i; for (i = 0; i < 4; i++) { if (!isprint ((int) ((unsigned char *) (&fourcc))[i])) { return FALSE; } } return TRUE; }
false
false
false
false
false
0
append(const char* s1, const char* s2) { int len = (s1?strlen(s1):0)+(s2?strlen(s2):0); char* result = (char*)emalloc(len+1); result[0] = '\0'; if(s1) strcat(result,s1); if(s2) strcat(result,s2); return result; }
false
true
false
false
false
1
GC_reclaim_clear4(hbp, hhdr, list COUNT_PARAM) register struct hblk *hbp; /* ptr to current heap block */ hdr * hhdr; register ptr_t list; COUNT_DECL { register word * mark_word_addr = &(hhdr->hb_marks[0]); register word *p, *plim; register word mark_word; NWORDS_DECL # define DO_OBJ(start_displ) \ ...
false
false
false
false
false
0
bfgets(char *s, int size, FILE *fd) { char *p = s; int ch; *p = 0; for (int i=0; i < size-1; i++) { do { errno = 0; ch = fgetc(fd); } while (ch == EOF && ferror(fd) && (errno == EINTR || errno == EAGAIN)); if (ch == EOF) { if (i == 0) { return NULL; ...
false
false
false
false
false
0
encodeSpectralData(Word16 *sfbOffset, SECTION_DATA *sectionData, Word16 *quantSpectrum, HANDLE_BIT_BUF hBitStream) { Word16 i,sfb; Word16 dbgVal; SECTION_INFO* psectioninfo; dbgV...
false
false
false
false
false
0
txclkesc(u32 divider, unsigned int us) { switch (divider) { case ESCAPE_CLOCK_DIVIDER_1: default: return 20 * us; case ESCAPE_CLOCK_DIVIDER_2: return 10 * us; case ESCAPE_CLOCK_DIVIDER_4: return 5 * us; } }
false
false
false
false
false
0
updateTab(int index) { Document* document = m_documents->document(index); QString filename = document->filename(); QString name = QFileInfo(filename).fileName(); if (name.isEmpty()) { name = tr("(Untitled %1)").arg(document->untitledIndex()); } if (document->isReadOnly()) { name = tr("%1 (Read-Only)").arg(nam...
false
false
false
false
false
0
__Pyx_GetVtable(PyObject *dict) { void* ptr; PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable); if (!ob) goto bad; #if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0) ptr = PyCapsule_GetPointer(ob, 0); #else ptr = PyCObject_AsVoidPtr(ob); #endif if (...
false
false
false
false
false
0
special_overflow (void) { /* Check for overflow in 3 cases: 1. cosh(x) is representable, but not exp(x) 2. cosh(x) is not representable in the selected range of exp. 3. cosh(x) exp overflow even with the largest range of exp */ mpfr_t x, y; mpfr_exp_t emin, emax; emin = mpfr_get_emin (); emax ...
false
false
false
false
false
0
fcoe_filter_frames(struct fc_lport *lport, struct fc_frame *fp) { struct fcoe_ctlr *ctlr; struct fcoe_interface *fcoe; struct fc_frame_header *fh; struct sk_buff *skb = (struct sk_buff *)fp; struct fc_stats *stats; /* * We only check CRC if no offload is available and if it is * it's solicited data,...
false
false
false
false
false
0
_get_task_count(void) { char *cpus_per_node = NULL, *end_ptr = NULL; int cpu_count, node_count, task_count, total_tasks = 0; if (opt.ntasks_per_node != NO_VAL) return (opt.min_nodes * opt.ntasks_per_node); if (opt.cpus_set) cpus_per_node = getenv("SLURM_JOB_CPUS_PER_NODE"); if (cpus_per_node) { cpu_count = ...
false
false
true
false
true
1
parse_client6_iaaddr_statement(struct parse *cfile) { struct option_cache *oc = NULL; struct dhc6_addr *addr; const char *val; int token, no_semi; addr = dmalloc(sizeof(*addr), MDL); if (addr == NULL) { parse_warn(cfile, "Unable to allocate IAADDR state."); skip_to_semi(cfile); return NULL; } /* Get IP ...
false
false
false
false
false
0
migrate_config_folder (const gchar* new_dir) { gchar* old_dir = g_build_filename (g_get_home_dir (), ".gnome2", "eog", NULL); gchar* old_filename = NULL; gchar* new_filename = NULL; GError *error = NULL; GFile *dir_file = NULL; gsize i; static const gchar *old_files[] = { "eog-print-settings.ini", ...
false
false
false
false
false
0
parse_debug_level (gchar * str, GstDebugLevel * level) { if (!str) return FALSE; /* works in place */ g_strstrip (str); if (g_ascii_isdigit (str[0])) { unsigned long l; char *endptr; l = strtoul (str, &endptr, 10); if (endptr > str && endptr[0] == 0) { *level = (GstDebugLevel) l; ...
false
false
false
false
false
0
run_kernel(int argc, char* argv[]) { struct kproc *pclient; /* current customer */ struct kproc *pnext; /* next client in ready list */ struct kreq *pkq; /* external kernel request */ struct kreq request; /* internal kernel request */ int go = 1; int i; /* * Now setup our sockets and the like. */ kio_ini...
false
true
false
false
false
1
delete_bookmarks (void) { register int i; for (i = 0; i < bookmark_elem (n); ++i) { if (bookmark_elem (bookmark[i]) && GTK_IS_WIDGET (bookmark_elem (bookmark[i]))) { gtk_widget_destroy (bookmark_elem (bookmark[i])); } } gtk_widget_hide (jeex_menu->bookmark_menu.sep); gt...
false
false
false
false
false
0
e_exec_instance_watcher_add(E_Exec_Instance *inst, void (*func) (void *data, E_Exec_Instance *inst, E_Exec_Watch_Type type), const void *data) { E_Exec_Watch *iw; iw = E_NEW(E_Exec_Watch, 1); if (!iw) return; iw->func = func; iw->data = data; inst->watchers = eina_list_append(inst->watchers, iw); ...
false
false
false
false
false
0
city_rapture_grow(const struct city *pcity) { /* .rapture is checked instead of city_celebrating() because this function is called after .was_happy was updated. */ return (pcity->rapture > 0 && pcity->surplus[O_FOOD] > 0 && (pcity->rapture % game.info.rapturedelay) == 0 && get_city_bonus(pcity, EF...
false
false
false
false
false
0
thread_is_free(int master) { int id; int split_nb; ASSERT(thread_is_ok(master)); // free threads for (id = 0; id < ThreadNb; id++) { if (Thread[id].stage != STAGE_IDLE) continue; split_nb = Thread[id].split_nb; if (split_nb == 0) return true; ASSERT(split_nb>0&&split_nb<Spl...
false
false
false
false
false
0
xsh_dispersol_list_load( cpl_frame *frame, xsh_instrument *instrument) { xsh_dispersol_list *result = NULL; const char* tablename = NULL; cpl_table* table = NULL; int rows; //int cols ; int degx, degy; char coefname[20]; int i; /* check input parameters */ XSH_ASSURE_NOT_ILLEGAL( frame); /* g...
false
false
false
false
false
0
bytesio_get_closed(bytesio *self) { if (self->buf == NULL) { Py_RETURN_TRUE; } else { Py_RETURN_FALSE; } }
false
false
false
false
false
0
print_gomp_stats() { printf ( "\nGNU OpenMP:\n"); printf ( "----------\n"); printf ( "%d parallel regions\n", nb_parallel_region); /* todo: * add: * - min/max/average duration of parallel regions * - maximum depth (nested) */ /* browse the processes finished_section_list and extract statistic...
false
false
false
false
false
0
gst_tee_release_pad (GstElement * element, GstPad * pad) { GstTee *tee; gboolean changed = FALSE; tee = GST_TEE (element); GST_DEBUG_OBJECT (tee, "releasing pad"); GST_OBJECT_LOCK (tee); /* mark the pad as removed so that future pad_alloc fails with NOT_LINKED. */ GST_TEE_PAD_CAST (pad)->removed = TRUE...
false
false
false
false
false
0
phar_analyze_path(const char *fname, const char *ext, int ext_len, int for_create TSRMLS_DC) /* {{{ */ { php_stream_statbuf ssb; char *realpath; char *filename = estrndup(fname, (ext - fname) + ext_len); if ((realpath = expand_filepath(filename, NULL TSRMLS_CC))) { #ifdef PHP_WIN32 phar_unixify_path_separators(r...
false
false
false
false
false
0
dwarf_hasattr(Dwarf_Die die, Dwarf_Half attr, Dwarf_Bool * return_bool, Dwarf_Error * error) { Dwarf_Half attr_form = 0; CHECK_DIE(die, DW_DLV_ERROR); if (_dwarf_get_value_ptr(die, attr, &attr_form) == NULL) { if (attr_form == 0) { _dwarf_error(die->di_cu_context->cc_dbg, error...
false
false
false
false
false
0
init_cdrom_command(struct packet_command *cgc, void *buf, int len, int type) { memset(cgc, 0, sizeof(struct packet_command)); if (buf) memset(buf, 0, len); cgc->buffer = (char *) buf; cgc->buflen = len; cgc->data_direction = type; cgc->timeout = CDROM_DEF_TIMEOUT; }
false
true
false
false
false
1
cirrus_driver_load(struct drm_device *dev, unsigned long flags) { struct cirrus_device *cdev; int r; cdev = kzalloc(sizeof(struct cirrus_device), GFP_KERNEL); if (cdev == NULL) return -ENOMEM; dev->dev_private = (void *)cdev; r = cirrus_device_init(cdev, dev, dev->pdev, flags); if (r) { dev_err(&dev->pdev-...
false
false
false
false
false
0
collisionTimeForMovingPointFixedRectangle( const Vector3& point, const Vector3& velocity, const Vector3& v0, const Vector3& v1, const Vector3& v2, const Vector3& v3, Vector3& location, Vector3& outNormal) { Plane plane = Plane(v0, ...
false
false
false
false
false
0
isns_attr_list_replace_attr(isns_attr_list_t *list, isns_attr_t *attr) { unsigned int i; for (i = 0; i < list->ial_count; ++i) { isns_attr_t *other = list->ial_data[i]; if (other->ia_tag_id == attr->ia_tag_id) { list->ial_data[i] = attr; attr->ia_users++; isns_attr_release(other); return 1; } }...
false
false
false
false
false
0
ipcp_init_cloned_node (struct cgraph_node *orig_node, struct cgraph_node *new_node) { gcc_checking_assert (ipa_node_params_vector && (VEC_length (ipa_node_params_t, ipa_node_params_vector) > (unsigned) cgraph_max_uid)); gcc_checking_assert (IPA_NODE_REF (new_node)->params); IPA_...
false
false
false
false
false
0
lockScreen() const { if(!mSystemSession->lockScreen()) throwError("LockScreenError", tr("Lock screen failed")); return thisObject(); }
false
false
false
false
false
0
SetFileName(const char* fileList) { m_FileNames = this->SplitFileNames(fileList); // Set the number of frames m_FrameTotal = static_cast<SizeValueType>( m_FileNames.size() ); this->Modified(); }
false
false
false
false
false
0
__ecereInstMeth___ecereNameSpace__ecere__gui__Timer_DelayExpired__00000000(struct __ecereNameSpace__ecere__com__Instance * this) { struct __ecereNameSpace__ecere__sys__Point __simpleStruct6; struct __ecereNameSpace__ecere__sys__Point __simpleStruct5; struct __ecereNameSpace__ecere__sys__Point __simpleStruct4; struct __...
false
false
false
false
false
0
set_collect_gcc_options (void) { int i; int first_time; /* Build COLLECT_GCC_OPTIONS to have all of the options specified to the compiler. */ obstack_grow (&collect_obstack, "COLLECT_GCC_OPTIONS=", sizeof ("COLLECT_GCC_OPTIONS=") - 1); first_time = TRUE; for (i = 0; (int) i < n_switches; i++) ...
false
false
false
false
false
0
really_do_log_v(int type, const char *f, va_list args) { if(type & LOGGING_MAX & logLevel) { if(logF) { va_list args_copy; va_copy(args_copy, args); vfprintf(logF, f, args_copy); va_end(args_copy); } #ifdef HAVE_SYSLOG if(logSyslog) ...
false
false
false
false
false
0
lpfc_sli_enable_msi(struct lpfc_hba *phba) { int rc; rc = pci_enable_msi(phba->pcidev); if (!rc) lpfc_printf_log(phba, KERN_INFO, LOG_INIT, "0462 PCI enable MSI mode success.\n"); else { lpfc_printf_log(phba, KERN_INFO, LOG_INIT, "0471 PCI enable MSI mode failed (%d)\n", rc); return rc; } rc = req...
false
false
false
false
false
0
lj_opt_dse_ahstore(jit_State *J) { IRRef xref = fins->op1; /* xREF reference. */ IRRef val = fins->op2; /* Stored value reference. */ IRIns *xr = IR(xref); IRRef1 *refp = &J->chain[fins->o]; IRRef ref = *refp; while (ref > xref) { /* Search for redundant or conflicting stores. */ IRIns *store = IR(re...
false
false
false
false
false
0
find_by_leader (gpointer find_data, gpointer user_data) { Account *account = find_data; GNCLedgerDisplay *ld = user_data; if (!account || !ld) return FALSE; return (account == gnc_ledger_display_leader (ld)); }
false
false
false
false
false
0
paging_test( void ) { int r = 0; switch( machine_current->machine ) { case LIBSPECTRUM_MACHINE_16: r += paging_test_16(); break; case LIBSPECTRUM_MACHINE_48: case LIBSPECTRUM_MACHINE_48_NTSC: r += unittests_paging_test_48( 2 ); break; case LIBSPECTRUM_MACHINE_128: case L...
false
false
false
false
false
0
free_connection(ConnectionX *c) { *c->_pprev = c->_next[end_all]; if (c->_next[end_all]) c->_next[end_all]->_pprev = c->_pprev; if (_conn_tail == &c->_next[end_all]) _conn_tail = c->_pprev; c->_next[0] = _free_conn; _free_conn = c; }
false
false
false
false
false
0
createX86MCRegisterInfo(const Triple &TT) { unsigned RA = (TT.getArch() == Triple::x86_64) ? X86::RIP // Should have dwarf #16. : X86::EIP; // Should have dwarf #8. MCRegisterInfo *X = new MCRegisterInfo(); InitX86MCRegisterInfo(X, RA, X86_MC::getDwarfRegFlavour(TT, false...
false
false
false
false
false
0
mx_action_new_full (const gchar *name, const gchar *display_name, GCallback activated_cb, gpointer user_data) { MxAction *action = g_object_new (MX_TYPE_ACTION, "display-name", display_name, ...
false
false
false
false
false
0
gs_jpeg_start_decompress(stream_DCT_state * st) { if (setjmp(find_jmp_buf(st->data.common->exit_jmpbuf))) return_error(gs_jpeg_log_error(st)); #if JPEG_LIB_VERSION > 55 return (int)jpeg_start_decompress(&st->data.decompress->dinfo); #else /* in IJG version 5, jpeg_start_decompress had no return valu...
false
false
false
false
false
0
isLocaleInList(UEnumeration *locEnum, const char *locToSearch, UErrorCode *status) { const char *loc; while ((loc = uenum_next(locEnum, NULL, status)) != NULL) { if (uprv_strcmp(loc, locToSearch) == 0) { return TRUE; } } return FALSE; }
false
false
false
false
false
0
iwl_mvm_mac_ctxt_init(struct iwl_mvm *mvm, struct ieee80211_vif *vif) { unsigned int wdg_timeout = iwl_mvm_get_wd_timeout(mvm, vif, false, false); u32 ac; int ret; lockdep_assert_held(&mvm->mutex); ret = iwl_mvm_mac_ctxt_allocate_resources(mvm, vif); if (ret) return ret; switch (vif->type) { case NL80211...
false
false
false
false
false
0
gpk_distro_upgrade_get_distro_upgrades_cb (PkClient *client, GAsyncResult *res, GpkDistroUpgradePrivate *priv) { PkResults *results; GError *error = NULL; GPtrArray *array = NULL; PkError *error_code = NULL; guint i; PkDistroUpgrade *distro_upgrade; gboolean show_unstable; /* get the results */ results = pk_c...
false
false
false
false
false
0
zx_push_seen(struct zx_ctx* c, int prefix_len, const char* prefix, int url_len, const char* url, struct zx_ns_s** pop_seen) { struct zx_ns_s* old_ns; struct zx_ns_s* ns; old_ns = zx_prefix_seen(c, prefix_len, prefix); if (old_ns) { if (old_ns->url_len == url_len && (!url_len || !memcmp(old_ns->url, url, url...
false
false
false
false
false
0
list_msg_mime(struct rfc2045 *rfc, FILE *fp) { int (*handler)(struct rfc2045 *, FILE *)= mime_handler(rfc); const char *content_type, *dummy; char *disposition_name; char *disposition_filename; char *content_name; const char *disposition_filename_s; off_t start_pos, end_pos, start_body; off_t dummy2;...
true
true
false
false
false
1
Call_Finalizers () { while (Finalizers) { FUNCT *fp = Finalizers; Finalizers = fp->next; if (Verb_Init) printf ("[calling %s]\n", fp->name); Call ((unsigned long int)fp->func); } }
false
false
false
false
false
0
clarity_util_update_coverart(GList *tracks, const gchar *filename) { g_return_if_fail(filename); if (!tracks) return; GList *tks = g_list_copy(tracks); while (tks) { Track *track = tks->data; if (gp_track_set_thumbnails(track, filename)) { ExtraTrackData *etd = tr...
false
false
false
false
false
0
proxy_socks5_data_ready_connection(World *world) { ssize_t size_to_read; ssize_t nread; gchar *msg; /* Things are more complicated here because the reply is variable in length, depending on the address type and its length. First, we read the address type and the first byte of the address, w...
false
false
false
false
false
0
send_internal_base_missing_arg_error(DBusConnection *conn, DBusMessage *req, const char *text, const char *arg) { DBusMessage *msg; msg = dbus_message_new_error(req, CM_DBUS_ERROR_BASE_MISSING_ARG, text); if (msg != NULL) { cm_tdbusm_set_s(msg, arg); dbus_connection_send(conn, msg, NULL); dbus_message...
false
false
false
false
false
0
update_offset_fmt_from_entry(GtkEntry *entry, PropertyUI *pui) { int i, len; gchar *old_offset_fmt; gboolean expect_spec; const GList *win_list; old_offset_fmt = offset_fmt; offset_fmt = g_strdup(gtk_entry_get_text(GTK_ENTRY(pui->format))); /* check for a valid format string */ len = strlen(offset_fmt); expec...
false
false
false
false
false
0
G_get_window(struct Cell_head *window) { static int first = 1; static struct Cell_head dbwindow; char *regvar; /* Optionally read the region from environment variable */ regvar = getenv("GRASS_REGION"); if (regvar) { char **tokens, *delm = ";"; char *err; tokens = G_tokenize(regvar, delm);...
false
false
false
false
true
1
OptimizeLinearCombine() { // This optimization does the following: // // x*x*x*x -> x^4 // x+x+x+x -> x*4 // x*x -> x^2 // x/z/z -> // // Remove conflicts first, so we don't have to worry about signs. OptimizeConflict(); ...
false
false
false
false
false
0
fbus_send_message(unsigned int messagesize, unsigned char messagetype, unsigned char *message, struct gn_statemachine *state) { u8 seqnum, frame_buffer[FBUS_CONTENT_MAX_LENGTH + 2]; u8 nom, lml; /* number of messages, last message len */ int i; if (!FBUSINST(state)) return GN_ERR_FAILED; seqnum = 0x40 + FBUSI...
false
true
false
false
false
1
git_reset_pane_init (GitResetPane *self) { gchar *objects[] = {"reset_pane", "ok_action", "cancel_action", NULL}; GError *error = NULL; GtkAction *ok_action; GtkAction *cancel_action; self->priv = g_new0 (GitResetPanePriv, 1); self->priv->builder = gtk_builder_new (); if (!gtk_builder_add_obj...
false
false
false
false
false
0
pinctrl_utils_add_config(struct pinctrl_dev *pctldev, unsigned long **configs, unsigned *num_configs, unsigned long config) { unsigned old_num = *num_configs; unsigned new_num = old_num + 1; unsigned long *new_configs; new_configs = krealloc(*configs, sizeof(*new_configs) * new_num, GFP_KERNEL); if ...
false
false
false
false
false
0
findserver(const struct proxy *px, const char *name) { struct server *cursrv, *target = NULL; if (!px) return NULL; for (cursrv = px->srv; cursrv; cursrv = cursrv->next) { if (strcmp(cursrv->id, name)) continue; if (!target) { target = cursrv; continue; } Alert("Refusing to use duplicated ser...
false
false
false
false
false
0
is_integer (char *string, long int *value) { long int dummy2 = 0; char* dummy; if (*string == '\0') return 1; dummy = (char*) alloca((strlen(string)+1)*sizeof(char)); if (value == NULL) value = &dummy2; return (sscanf(string,"%ld%s",value,dummy) == 1); }
true
true
false
false
true
1
free_univar_stat_struct(univar_stat * stats) { int i; int n_zones = zone_info.n_zones; if (n_zones == 0) n_zones = 1; for (i = 0; i < n_zones; i++){ if (stats[i].perc) G_free(stats[i].perc); if (stats[i].dcell_array) G_free(stats[i].dcell_array); if (stats[i].fcell_array) G_free(sta...
false
false
false
false
false
0
main(int argc, char **argv) { map<Hash,int> hashes; Doc* doc = new Doc(); int bound = atoi(argv[1]); while (get_doc(stdin, doc)>0) { cout << "DOCSTART " << SPLITCODE << " " << doc->id << endl; size_t pos = doc->text.find("<p>"); size_t prev = 0; string paragraph; wh...
false
false
false
false
false
0
playMove(const Player &player, const Stone &stone, bool undoable) { if (!isRunning()) { return false; } const Player *tmp = &player; if (!tmp->isValid()) { //kDebug() << "Invalid player argument, using current player!"; tmp = m_currentPlayer; } QByteArray msg("play "); ...
false
false
false
false
false
0
brasero_audio2cue_start (BraseroJob *job, GError **error) { BraseroAudio2CuePrivate *priv; GError *thread_error = NULL; BraseroJobAction action; goffset bytes = 0; priv = BRASERO_AUDIO2CUE_PRIVATE (job); brasero_job_get_action (job, &action); if (action == BRASERO_JOB_ACTION_SIZE) { BraseroTrack *track =...
false
false
false
false
false
0
count_free(struct buffer_head *map[], unsigned blocksize, __u32 numbits) { __u32 sum = 0; unsigned blocks = DIV_ROUND_UP(numbits, blocksize * 8); while (blocks--) { unsigned words = blocksize / 2; __u16 *p = (__u16 *)(*map++)->b_data; while (words--) sum += 16 - hweight16(*p++); } return sum; }
false
false
false
false
false
0
init_counter() { // counters start out with this synchronization m.counters [0] = 1; m.counters [1] = 0; m.counters [2] = -0x20u; m.counters [3] = 0x0B; int n = 2; for ( int i = 1; i < 32; i++ ) { m.counter_select [i] = &m.counters [n]; if ( !--n ) n = 3; } m.counter_select [ 0] = &m.counters...
false
false
false
false
false
0
tenTripleCalcSingle_d(double dst[3], int ttype, double ten[7]) { double eval[3]; /* in time this can become more efficient ... */ switch (ttype) { case tenTripleTypeEigenvalue: tenEigensolve_d(dst, NULL, ten); break; case tenTripleTypeMoment: case tenTripleTypeXYZ: case tenTripleTypeRThetaZ: ca...
false
false
false
false
false
0
ServerSocket_setReceiveBufferSize(CTX ctx, ksfp_t *sfp _RIX) { knh_serversocket_t *ss = (knh_serversocket_t *)((sfp[0].p)->rawptr); int ret = Int_to(int, sfp[1]); unsigned int len = sizeof(ret); if(setsockopt(ss->sd, SOL_SOCKET, SO_RCVBUF, &ret, len) == -1) { KNH_NTRACE2(ctx, "setsockopt", K_PERROR, KNH_LDATA(LOG...
false
false
false
false
false
0
NetTCP6Connect( pal_socket_t *p_sock, char *Host, uint16_t Port ) { pal_socket_t sockfd; struct sockaddr_in6 serv_addr; struct in6_addr addr; if( NULL == NetText2Addr6(Host, &addr) ) { return -1; } memset(&serv_addr, 0, sizeof(serv_addr)); serv_addr.sin6_family = AF_INET6; s...
false
false
false
false
false
0
terminate_chunked_trickle_cb(int fd, short events, void *arg) { struct terminate_state *state = arg; struct evbuffer *evb = evbuffer_new(); struct timeval tv; if (evhttp_request_get_connection(state->req) == NULL) { test_ok = 1; evhttp_request_free(state->req); event_loopexit(NULL); return; } evbuffer_a...
false
false
false
false
false
0
overlaps(const BBox& bb) const { if (bb.topLeft.x >= bottomRight.x || bb.topLeft.y >= bottomRight.y || bb.bottomRight.x <= topLeft.x || bb.bottomRight.y <= topLeft.y) return false; return true; }
false
false
false
false
false
0
ioapic_read_entry(int apic, int pin) { union entry_union eu; unsigned long flags; raw_spin_lock_irqsave(&ioapic_lock, flags); eu.entry = __ioapic_read_entry(apic, pin); raw_spin_unlock_irqrestore(&ioapic_lock, flags); return eu.entry; }
false
false
false
false
false
0
read_periodicity(struct xsf_reader *rd, GError **error) { gboolean found; if (!xsf_reader_get_flag(rd, &found, "MOLECULE", (int*)0, FALSE, error)) return FALSE; if (found) rd->bc = VISU_BOX_FREE; if (!xsf_reader_get_flag(rd, &found, "SLAB", (int*)0, FALSE, error)) return FALSE; if (found) rd...
false
false
false
false
false
0
free_var_chunk_cache(int igrp, int varid) { int stat = NC_NOERR; size_t chunk_cache_size = 1; size_t cache_nelems = 1; float cache_preemp = 0; int inkind; NC_CHECK(nc_inq_format(igrp, &inkind)); if(inkind == NC_FORMAT_NETCDF4 || inkind == NC_FORMAT_NETCDF4_CLASSIC) { int contig = 1; NC_CHE...
false
false
false
false
false
0
isert_free_rx_descriptors(struct isert_conn *isert_conn) { struct ib_device *ib_dev = isert_conn->device->ib_device; struct iser_rx_desc *rx_desc; int i; if (!isert_conn->rx_descs) return; rx_desc = isert_conn->rx_descs; for (i = 0; i < ISERT_QP_MAX_RECV_DTOS; i++, rx_desc++) { ib_dma_unmap_single(ib_dev, ...
false
false
false
false
false
0
dfb_gfxcard_lock( GraphicsDeviceLockFlags flags ) { DFBResult ret; DFBGraphicsCoreShared *shared; GraphicsDeviceFuncs *funcs; D_ASSERT( card != NULL ); D_ASSERT( card->shared != NULL ); shared = card->shared; funcs = &card->funcs; if ( ((flags & GDLF_WAIT) ? ...
false
false
false
false
false
0
cmd_create_data_table (WorkbookControl *wbc, Sheet *sheet, GnmRange const *r, char const *col_input, char const *row_input) { GOUndo *undo = NULL; GOUndo *redo = NULL; gboolean result; char *name; char *text; GnmSheetRange *sr; GnmParsePos pp; GnmExprTop const *texpr; name = undo_range_name (sheet, ...
false
false
false
false
false
0
nv20_emit_point_mode(struct gl_context *ctx, int emit) { struct nouveau_pushbuf *push = context_push(ctx); BEGIN_NV04(push, NV20_3D(POINT_SIZE), 1); if (context_chipset(ctx) >= 0x25) PUSH_DATAf(push, ctx->Point.Size); else PUSH_DATA (push, (uint32_t)(ctx->Point.Size * 8)); }
false
false
false
false
false
0
avr_set_input(OPCODE * op, unsigned char * cmd, unsigned char data) { int i, j, bit; unsigned char value; unsigned char mask; for (i=0; i<32; i++) { if (op->bit[i].type == AVR_CMDBIT_INPUT) { j = 3 - i / 8; bit = i % 8; mask = 1 << bit; value = data >> op->bit[i].bitno & 0x01; ...
false
false
false
false
false
0
draw_segment_edge_n (int ncp, /* number of contour points */ gleDouble front_contour[][3], gleDouble back_contour[][3], double norm_cont[][3], int inext, double len) { int j; /* draw the tube segment */ ...
false
false
false
false
false
0
edgeLen (Agedge_t* e) { pointf p = ND_coord(agtail(e)); pointf q = ND_coord(aghead(e)); return (int)DIST2(p,q); }
false
false
false
false
false
0
gen_split_2592 (rtx curr_insn ATTRIBUTE_UNUSED, rtx *operands) { rtx operand0; rtx operand1; rtx operand2; rtx _val = 0; start_sequence (); #line 298 "../../src/gcc/config/rs6000/vsx.md" { operands[2] = can_create_pseudo_p () ? gen_reg_rtx_and_attrs (operands[0]) : op...
false
false
false
false
false
0
intel_dri2_flush_with_flags(__DRIcontext *cPriv, __DRIdrawable *dPriv, unsigned flags, enum __DRI2throttleReason reason) { struct brw_context *brw = cPriv->driverPrivate; if (!brw) return; struct gl_context *ctx = &brw-...
false
false
false
false
false
0
dump_page_info(Jbig2Ctx *ctx, Jbig2Segment *segment, Jbig2Page *page) { if (page->x_resolution == 0) { jbig2_error(ctx, JBIG2_SEVERITY_INFO, segment->number, "page %d image is %dx%d (unknown res)", page->number, page->width, page->height); } else if (page->x_resolution == page->y...
false
false
false
false
false
0
qmonMessageOk(Widget w, XtPointer cld, XtPointer cad) { DENTER(GUI_LAYER, "qmonMessageOk"); message_blocked = False; DEXIT; }
false
true
false
false
false
1
fceiling (const cl_SF& x) { if (minusp_inline(x)) return ftruncate(x); else return futruncate(x); }
false
false
false
false
false
0
msn_sb_got_usr_response(MsnConnection *mc, void *data) { SBPayload *payload = mc->sbpayload; MsnAccount *ma = mc->account; int error = 0; if (!strcmp(mc->current_message->argv[2], "OK")) error = 0; else { LList *l; error = 1; for (l = mc->account->connections; l; l = l_list_next(l)) { if (mc == l->da...
false
false
false
false
false
0
snapshot_end_io(struct dm_target *ti, struct bio *bio, int error) { struct dm_snapshot *s = ti->private; if (is_bio_tracked(bio)) stop_tracking_chunk(s, bio); return 0; }
false
false
false
false
false
0
recv_password_packet(Port *port) { StringInfoData buf; pq_startmsgread(); if (PG_PROTOCOL_MAJOR(port->proto) >= 3) { /* Expect 'p' message type */ int mtype; mtype = pq_getbyte(); if (mtype != 'p') { /* * If the client just disconnects without offering a password, * don't make a log entry. ...
false
false
false
false
false
0