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
spt_pinctrl_probe(struct platform_device *pdev) { const struct intel_pinctrl_soc_data *soc_data; const struct acpi_device_id *id; id = acpi_match_device(spt_pinctrl_acpi_match, &pdev->dev); if (!id || !id->driver_data) return -ENODEV; soc_data = (const struct intel_pinctrl_soc_data *)id->driver_data; return i...
false
false
false
false
false
0
ajNamSvrTest(const AjPStr svrname) { const NamPEntry data; data = ajTableFetchS(namSvrMasterTable, svrname); if(!data) return ajFalse; return ajTrue; }
false
false
false
false
false
0
get_fg_tile_info(int tile_index) { int attr = colorram[tile_index]; int code = videoram[tile_index] + (attr<<2 & 0x300); int color = attr & 0x3f; SET_TILE_INFO(0, code, color, 0) }
false
false
false
false
false
0
ath6kl_connectservice(struct ath6kl *ar, struct htc_service_connect_req *con_req, char *desc) { int status; struct htc_service_connect_resp response; memset(&response, 0, sizeof(response)); status = ath6kl_htc_conn_service(ar->htc_target, con_req, &response); if (status) { ath6kl_err("failed to conn...
false
false
false
false
false
0
dump_maj_right(const uint8_t* bits, int row, int major) { int minor; for (minor = 0; minor < get_major_minors(XC6SLX9, major); minor++) printf_clock(&bits[minor*FRAME_SIZE], row, major, minor); for (minor = 0; minor < get_major_minors(XC6SLX9, major); minor++) printf_frames(&bits[minor*FRAME_SIZE], /*max_frames...
false
false
false
false
false
0
st_sensors_power_enable(struct iio_dev *indio_dev) { struct st_sensor_data *pdata = iio_priv(indio_dev); int err; /* Regulators not mandatory, but if requested we should enable them. */ pdata->vdd = devm_regulator_get_optional(indio_dev->dev.parent, "vdd"); if (!IS_ERR(pdata->vdd)) { err = regulator_enable(pdat...
false
false
false
false
false
0
parseCheckWindowFuncs(ParseState *pstate, Query *qry) { ListCell *l; /* This should only be called if we found window functions */ Assert(pstate->p_hasWindowFuncs); if (checkExprHasWindowFuncs(qry->jointree->quals)) ereport(ERROR, (errcode(ERRCODE_WINDOWING_ERROR), errmsg("window functions not allowe...
false
false
false
false
false
0
dbus_g_proxy_add_signal (DBusGProxy *proxy, const char *signal_name, GType first_type, ...) { GQuark q; char *name; GArray *gtypesig; GType gtype; va_list args; DBusGProxyPrivate *priv; g_return_if_fail (DBUS_IS_G_PROXY ...
false
false
false
false
false
0
init_macro() { int i; struct macro **mpp; struct token *t; time_t tv; char *s, *tval; static char *time_buf; static char *date_buf; static short first_time = 1; if (first_time) { first_time = 0; /* * Add names of standard macros to sting table. */ line_mac ...
true
true
false
false
false
1
gst_time_tool_init (GstTimeTool *tool) { DBusError error; GstTimeToolPrivate *priv = GST_TIME_TOOL_GET_PRIVATE (tool); dbus_error_init (&error); priv->bus_connection = dbus_bus_get (DBUS_BUS_SESSION, &error); priv->cookie = 0; if (dbus_error_is_set (&error)) { g_warning ("%s", error.message); dbus_error_fre...
false
false
false
false
false
0
psb_intel_sdvo_check_supp_encode(struct psb_intel_sdvo *psb_intel_sdvo) { struct psb_intel_sdvo_encode encode; BUILD_BUG_ON(sizeof(encode) != 2); return psb_intel_sdvo_get_value(psb_intel_sdvo, SDVO_CMD_GET_SUPP_ENCODE, &encode, sizeof(encode)); }
false
false
false
false
false
0
cx_tree_previous(const cx_tree *tree, cx_tree_const_iterator position) { cx_assert(tree != NULL); cx_assert(position != NULL); cx_assert(position == _cx_tree_end(tree) || _cx_tree_exists(tree, (cx_tree_iterator)position)); if (position == _cx_tree_begin(tree)) { return _cx_tree_b...
false
false
false
false
false
0
wb_smsc_wdt_notify_sys(struct notifier_block *this, unsigned long code, void *unused) { if (code == SYS_DOWN || code == SYS_HALT) { /* set timeout to 0, to avoid possible race-condition */ timeout = 0; wb_smsc_wdt_disable(); } return NOTIFY_DONE; }
false
false
false
false
false
0
SyncIPCCmd(ipc_sync *data) { // Handle the end-of-sync command if (data->ipc_cmdnum == 0) { for (map<unsigned int, ipc_cmd_rec *>::iterator x = ipc_sync_map.begin(); x != ipc_sync_map.end(); ++x) { IPCmdCallback cback = x->second->callback; if (cback != NULL) (*cback)(globalreg, NULL, 0, x->second->a...
false
false
false
false
false
0
get_if_addr(int sock, char *name, struct sockaddr_in *sin) { #ifdef IF_LOOKUP struct ifreq ifr; memset(&ifr, 0, sizeof(ifr)); if (name == NULL) { dprintf((stderr, "get_if_addr called with name == NULL\n")); } else { strcpy(ifr.ifr_name, name); } /* why does this need to be done twice? */ if(ioc...
false
true
false
false
false
1
is_ko(int pos, int color, int *ko_pos) { int other = OTHER_COLOR(color); int captures = 0; int kpos = 0; ASSERT_ON_BOARD1(pos); ASSERT1(color == WHITE || color == BLACK, pos); if (ON_BOARD(SOUTH(pos))) { if (board[SOUTH(pos)] != other) return 0; else if (LIBERTIES(SOUTH(pos)) == 1) { ...
false
false
false
false
false
0
expl(long double x) { long double px, xx; int n; if( isnan(x) ) return(x); if( x > MAXLOGL) return( INFINITY ); if( x < MINLOGL ) return(0.0L); /* Express e**x = e**g 2**n * = e**g e**( n loge(2) ) * = e**( g + n loge(2) ) */ px = floorl( LOG2EL * x + 0.5L ); /* floor() truncates toward -infinity. */ n = p...
false
false
false
false
false
0
readPercentageChunk(io::IReadFile* file, ChunkData* chunk, f32& percentage) { #ifdef _IRR_DEBUG_3DS_LOADER_ os::Printer::log("Load percentage chunk."); #endif ChunkData data; readChunkData(file, data); short intpercentage; float fpercentage; switch(data.header.id) { case C3DS_PERCENTAGE_I...
false
false
false
false
false
0
sockets_unlock(sockets *ss) { int rv; if (ss->lock) if ((rv = mutex_unlock(ss->lock))) { LOG("%s: Changing socket %d lock %p to NULL error %d %s", __FUNCTION__, ss->id, ss->lock, rv, strerror(rv)); ss->lock = NULL; } mutex_unlock(&ss->mutex); }
false
false
false
false
false
0
accountToString(const Jid& j, bool withResource) { QString s = j.user(); if (!defaultDomain().isEmpty()) { return (withResource && !j.resource().isEmpty() ? j.user() + "/" + j.resource() : j.user()); } else { return (withResource ? j.full() : j.bare()); } }
false
false
false
false
false
0
check_position(const Window*) { if (moved_) { DisplayRep& d = *display_->rep(); int x, y; XWindow xw; XTranslateCoordinates( d.display_, xwindow_, d.root_, 0, 0, &x, &y, &xw ); xpos_ = x; ypos_ = y; moved_ = false; } }
false
false
false
false
false
0
satisfiesA3(IntegerMatrix const &A, IntegerVectorList const *N) { IntegerVectorList N2; if(!N) { N2=neighbours(A); N=&N2; } for(IntegerVectorList::const_iterator i=N->begin();i!=N->end();i++) for(int j=0;j<A.getHeight();j++) { if(dot(A[j],*i)==0)return false; } return true; ...
false
false
false
false
false
0
initialize() { if (d->m_initialized) return true; d->createGenericMapper(); d->m_Mapper->toFirst(); updateGenderImage(); connect(patient(), SIGNAL(currentPatientChanged()), this, SLOT(onCurrentPatientChanged())); d->m_initialized = true; return true; }
false
false
false
false
false
0
simplecmd(void) { union node *args, **app; union node *n = NULL; union node *vars, **vpp; union node **rpp, *redir; int savecheckkwd; #if ENABLE_ASH_BASH_COMPAT smallint double_brackets_flag = 0; #endif args = NULL; app = &args; vars = NULL; vpp = &vars; redir = NULL; rpp = &redir; savecheckkwd = CHKALIA...
false
false
false
false
false
0
CheckAuras() { if (!m_ai) return; if (!m_bot) return; uint32 spec = m_bot->GetSpec(); // If we have resist orders, adjust accordingly if (m_ai->GetCombatOrder() & PlayerbotAI::ORDERS_RESIST_FROST) { if (!m_bot->HasAura(FROST_RESISTANCE_AURA) && FROST_RESISTANCE_AURA > 0 && !m_bot->Has...
false
false
false
false
false
0
intersect(const SbVec2i32 & point) const { if((point[0] >= this->minpt[0]) && (point[0] <= this->maxpt[0]) && (point[1] >= this->minpt[1]) && (point[1] <= this->maxpt[1])) return TRUE; return FALSE; }
false
false
false
false
false
0
do_tail(void) { string_ty *s1; string_ty *s2; char *cp; size_t j; size_t max; // // only do this once // if (done_tail) return; // // fetch the environment variable // trace(("do_tail()\n{\n")); cp = getenv("AEGIS...
false
false
false
false
false
0
gar_load_next_class(struct gar_graph *graph) { int connected = 0; int curclass; struct node *pos = graph->pos, *dest = graph->dest; curclass = pos->class; if (graph->dest) { if (pos->class < dest->class) { curclass = pos->class; while(curclass < dest->class) { connected = gar_load_pos_class(graph, cur...
false
false
false
false
false
0
getcopypolicy(s) CONST char *s; { #ifndef _NOEXTRACOPY # ifdef DEP_PSEUDOPATH int dupdestdrive; # endif char *cp; #endif /* !_NOEXTRACOPY */ CONST char *str[MAXCOPYITEM]; int n, ch, val[MAXCOPYITEM]; for (;;) { Xlocate(0, L_CMDLINE); Xputterm(L_CLEAR); VOID_C Xkanjiputs(s); str[0] = UPDAT_K; val[0] = C...
false
false
false
false
false
0
g_vfs_ftp_task_send (GVfsFtpTask * task, GVfsFtpResponseFlags flags, const char * format, ...) { va_list varargs; guint response; g_return_val_if_fail (task != NULL, 0); g_return_val_if_fail (format != NULL, 0); va_start (varargs,...
false
false
false
false
false
0
sony_nc_backlight_ng_read_limits(int handle, struct sony_backlight_props *props) { u64 offset; int i; int lvl_table_len = 0; u8 min = 0xff, max = 0x00; unsigned char buffer[32] = { 0 }; props->handle = handle; props->offset = 0; props->maxlvl = 0xff; offset = sony_find_snc_handle(handle); /* try to read ...
false
false
false
false
false
0
thread_ready_idle_cb (gpointer data) { GstSoupHttpClientSink *souphttpsink = GST_SOUP_HTTP_CLIENT_SINK (data); GST_LOG_OBJECT (souphttpsink, "thread ready"); g_mutex_lock (&souphttpsink->mutex); g_cond_signal (&souphttpsink->cond); g_mutex_unlock (&souphttpsink->mutex); return FALSE; /* o...
false
false
false
false
false
0
st_create_main_window(AW_root * root, ST_ML * st_ml, AW_CB0 refresh_func, AW_window * win) { AW_window_simple *aws = new AW_window_simple; aws->init(root, "ENABLE_ONLINE_STATISTIC", "ACTIVATE ONLINE STATISTIC"); aws->load_xfig("stat_main.fig"); aws->callback(AW_POPDOWN); aws->at("close"); aws-...
false
false
false
false
false
0
add_menu_items(GtkTreeIter* parent_it, MenuCacheDir* dir) { GtkTreeIter it; GSList * l; #if MENU_CACHE_CHECK_VERSION(0, 4, 0) GSList *list; #endif GIcon* gicon; /* Iterate over all menu items in this directory. */ #if MENU_CACHE_CHECK_VERSION(0, 4, 0) for (l = list = menu_cache_dir_list_children...
false
false
false
false
false
0
notify_adds_modifies_cb (gpointer key, gpointer value, gpointer data) { BackendDeltaContext *context = data; const gchar *uid = key; ECalBackendFileObject *new_obj_data = value; ECalBackendFileObject *old_obj_data; old_obj_data = g_hash_table_lookup (context->old_...
false
false
false
false
false
0
mtnic_alloc_ring(struct mtnic_port *priv, struct mtnic_ring *ring, u32 size, u16 stride, u16 cq, u8 is_rx) { unsigned int i; int err; struct mtnic_rx_desc *rx_desc; struct mtnic_tx_desc *tx_desc; ring->size = size; /* Number of descriptors */ ring->size_mask = size - 1; ring->stride = stride; /* Size of each...
false
false
false
false
false
0
cfi_intelext_writev (struct mtd_info *mtd, const struct kvec *vecs, unsigned long count, loff_t to, size_t *retlen) { struct map_info *map = mtd->priv; struct cfi_private *cfi = map->fldrv_priv; int wbufsize = cfi_interleave(cfi) << cfi->cfiq->MaxBufWriteSize; int ret = 0; int chipnum; unsigned long ofs, vec_...
false
false
false
false
false
0
init_style() { if (!atom->q_flag) error->all(FLERR,"Pair style coul/cut requires atom attribute q"); neighbor->request(this); }
false
false
false
false
false
0
bakreahes2(real_t **a, int n, int n1, int n2, int index[], real_t **vec) { real_t *allocate_real_vector(int, int); void free_real_vector(real_t *, int); real_t tamvec(int, int, int, real_t **, real_t []); void ichrow(int, int, int, int, real_t **); int i,l,k; real_t *u; u=allocate_real_vector(1,n); for (...
false
false
false
false
false
0
get_partition_start(const char *device_name) { unsigned long long start; sysfs_path_t path; struct stat st; FILE *f; char *cp; int n; if ((stat(device_name, &st) < 0) || !S_ISBLK(st.st_mode)) return 0; cp = search_sysfs_block(st.st_rdev, path); if (!cp) return 0; if (strlen(path) > SYSFS_PATH_LEN - s...
false
true
false
false
true
1
env_universal_common_get_names(wcstring_list_t &lst, bool show_exported, bool show_unexported) { env_var_table_t::const_iterator iter; for (iter = env_universal_var.begin(); iter != env_universal_var.end(); ++iter) { const wcstr...
false
false
false
false
false
0
focus_toolbar_search() { SKELETON::ToolBar* toolbar = get_toolbar( m_notebook_toolbar.get_current_page() ); if( toolbar ) toolbar->focus_entry_search(); }
false
false
false
false
false
0
send_enquire_link(SMASI *smasi, Connection *conn, long *last_sent) { SMASI_PDU *pdu = NULL; Octstr *os = NULL; if (date_universal_now() - *last_sent < smasi->enquire_link_interval) return; *last_sent = date_universal_now(); pdu = smasi_pdu_create(EnquireLinkReq); dump_pdu("Send...
false
false
false
false
false
0
on_protocol_button_toggled (GtkToggleButton *togglebutton, gpointer user_data) { Netinfo *netinfo = user_data; /* GtkWidget *parent, *child, *widget; */ g_return_if_fail (GTK_IS_TREE_VIEW (netinfo->output)); /* widget = GTK_TREE_VIEW (netinfo->output); parent = gtk_widget_get_parent (GTK_WIDGET (widget)); g...
false
false
false
false
false
0
is_enclosing_handler(struct fw_address_handler *handler, unsigned long long offset, size_t length) { return handler->offset <= offset && offset + length <= handler->offset + handler->length; }
false
false
false
false
false
0
ena_com_dev_strings(u8 **data) { const struct ena_stats *ena_stats; int i; for (i = 0; i < ENA_STATS_ARRAY_ENA_COM; i++) { ena_stats = &ena_stats_ena_com_strings[i]; snprintf(*data, ETH_GSTRING_LEN, "ena_admin_q_%s", ena_stats->name); (*data) += ETH_GSTRING_LEN; } }
false
false
false
false
false
0
ConvertToNinjaPath(const char *path) { std::string convPath = this->Convert(path, cmLocalGenerator::HOME_OUTPUT); #ifdef _WIN32 cmSystemTools::ReplaceString(convPath, "/", "\\"); #endif return convPath; }
false
false
false
false
false
0
ahd_sync_sglist(struct ahd_softc *ahd, struct scb *scb, int op) { if (scb->sg_count == 0) return; ahd_dmamap_sync(ahd, ahd->scb_data.sg_dmat, scb->sg_map->dmamap, /*offset*/scb->sg_list_busaddr - ahd_sg_size(ahd), /*len*/ahd_sg_size(ahd) * scb->sg_count, op); }
false
false
false
false
false
0
_scsih_ir_fastpath(struct MPT3SAS_ADAPTER *ioc, u16 handle, u8 phys_disk_num) { Mpi2RaidActionRequest_t *mpi_request; Mpi2RaidActionReply_t *mpi_reply; u16 smid; u8 issue_reset = 0; int rc = 0; u16 ioc_status; u32 log_info; if (ioc->hba_mpi_version_belonged == MPI2_VERSION) return rc; mutex_lock(&ioc->scsi...
false
false
false
false
false
0
airUIrandMT_r(airRandMTState *rng) { register unsigned int s1; if (rng->left == 0) { _airRandMTReload(rng); } --rng->left; s1 = *rng->pNext++; s1 ^= (s1 >> 11); s1 ^= (s1 << 7) & 0x9d2c5680UL; s1 ^= (s1 << 15) & 0xefc60000UL; return ( s1 ^ (s1 >> 18) ); }
false
false
false
false
false
0
ircprot_freemsg(struct ircmessage *msg) { int i; for (i = 0; i < msg->numparams; i++) free(msg->params[i]); free(msg->src.name); free(msg->src.username); free(msg->src.hostname); free(msg->src.fullname); free(msg->src.orig); free(msg->cmd); free(msg->params); free(msg->paramstarts); free(msg...
false
false
false
false
false
0
_g_file_list_new_from_uri_list (GList *uris) { GList *r = NULL, *scan; for (scan = uris; scan; scan = scan->next) r = g_list_prepend (r, g_file_new_for_uri ((char*)scan->data)); return g_list_reverse (r); }
false
false
false
false
false
0
rt73usb_set_state(struct rt2x00_dev *rt2x00dev, enum dev_state state) { u32 reg, reg2; unsigned int i; char put_to_sleep; put_to_sleep = (state != STATE_AWAKE); rt2x00usb_register_read(rt2x00dev, MAC_CSR12, &reg); rt2x00_set_field32(&reg, MAC_CSR12_FORCE_WAKEUP, !put_to_sleep); rt2x00_set_field32(&reg, MAC_CSR...
false
false
false
false
false
0
hwp_document_render (EvDocument *document, EvRenderContext *rc) { GHWPPage *ghwp_page; gdouble width_points, height_points; guint width, height; cairo_surface_t *surface; cairo_t *cr; ghwp_page = GHWP_PAGE (rc->page->backend_pa...
false
false
false
false
false
0
jstring_to_jtype(char *s) { if (str_ident(s, "assumption")) return INPUT_JUST; else if (str_ident(s, "goal")) return GOAL_JUST; else if (str_ident(s, "deny")) return DENY_JUST; else if (str_ident(s, "clausify")) return CLAUSIFY_JUST; else if (str_ident(s, "copy")) return COPY_JUST; else ...
false
false
false
false
false
0
gst_mini_object_free (GstMiniObject * mini_object) { GstMiniObjectClass *mo_class; /* At this point, the refcount of the object is 0. We increase the refcount * here because if a subclass recycles the object and gives out a new * reference we don't want to free the instance anymore. */ GST_CAT_TRACE (GST_C...
false
false
false
false
false
0
createMesh(const char *dir) { int i; char filename[PATH_MAX]; for(i = 0; i < meshFiles; ++i) { make_filename(filename, dir, extension[i]); manager->openStream(meshFileStream[i], filename, std::ios::out); } return 0; }
false
false
false
false
false
0
release_right_button(int canvas_x, int canvas_y, bool shift) { if (rectangle_active) { define_tiles_within_rectangle(shift); } else { cancel_tile_hiliting(); recenter_button_pressed(canvas_x, canvas_y); } rectangle_active = FALSE; rbutton_down = FALSE; }
false
false
false
false
false
0
reaeig3(real_t **a, int n, real_t em[], real_t val[], real_t **vec) { int *allocate_integer_vector(int, int); real_t *allocate_real_vector(int, int); void free_integer_vector(int *, int); void free_real_vector(real_t *, int); void tfmreahes(real_t **, int, real_t [], int []); void bakreahes2(real_t **, int, int, ...
false
false
false
false
false
0
kvm_disable_steal_time(void) { if (!has_steal_clock) return; wrmsr(MSR_KVM_STEAL_TIME, 0, 0); }
false
false
false
false
false
0
add_main_window_action(std::map<int, Glib::RefPtr<Gtk::Action> > & actions, const Glib::RefPtr<Gtk::Action> & action, int order) { std::map<int, Glib::RefPtr<Gtk::Action> >::iterator iter = actions.find(order); while(iter != actions.end()) { iter = actions.fi...
false
false
false
false
false
0
tds_free_input_params(TDSDYNAMIC * dyn) { TDSPARAMINFO *info; info = dyn->params; if (info) { tds_free_param_results(info); dyn->params = NULL; } }
false
false
false
false
false
0
up_device_set_object_path_sync (UpDevice *device, const gchar *object_path, GCancellable *cancellable, GError **error) { GError *error_local = NULL; gboolean ret = FALSE; DBusGProxy *proxy_device; DBusGProxy *proxy_props; g_return_val_if_fail (UP_IS_DEVICE (device), FALSE); if (device->priv->object_path != NULL...
false
false
false
false
false
0
gr_armor(object *obj, int assign_wk) { /* by Yasha */ short percent; short blessing; obj->what_is = ARMOR; if (assign_wk) /* by Yasha */ obj->which_kind = get_rand(0, (ARMORS - 1)); obj->class = obj->which_kind + 2; if ((obj->which_kind == PLATE) || (obj->which_kind == SPLINT)) { obj->cla...
false
false
false
false
false
0
addColorSpace(const ConstColorSpaceRcPtr & original) { ColorSpaceRcPtr cs = original->createEditableCopy(); std::string name = cs->getName(); if(name.empty()) throw Exception("Cannot addColorSpace with an empty name."); // Check to see if the colorspace ...
false
false
false
false
false
0
jpeg_set_defaults (j_compress_ptr cinfo) { int i; /* Safety check to ensure start_compress not called yet. */ if (cinfo->global_state != CSTATE_START) ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); /* Allocate comp_info array large enough for maximum component count. * Array is made permanent in...
false
false
false
false
false
0
main_hall_close() { int idx, s_idx; if (!Main_hall_inited) { return; } // unload the main hall bitmap if (Main_hall_bitmap != -1) { bm_release(Main_hall_bitmap); } // unload any bitmaps if (Main_hall_mask >= 0) { // make sure we unlock the mask bitmap so it can be unloaded bm_unlock(Main_hall_mask); ...
false
false
false
false
false
0
musb_raw_channel_read(mud_channel *pc, void *buf, int length, int sec_timeout, int *bytes_read) { int len=0, usec; enum HPMUD_RESULT stat = HPMUD_R_IO_ERROR; *bytes_read = 0; if (sec_timeout==0) usec = 1000; /* minmum timeout is 1ms for libusb 0.1.12, hangs forever with zero */ else usec = sec_timeout*...
false
false
false
false
false
0
menu_width(But *but) { Menu *m = but->iPacket; ButEnv *env = but->win->env; int i, maxw, tw; maxw = butEnv_textWidth(env, m->title, 0); for (i = 0; !(m->options[i].flags & BUTMENU_END); ++i) { if (!(m->options[i].flags & BUTMENU_BREAK)) { tw = butEnv_textWidth(env, str_chars(&m->options[i...
false
false
false
false
false
0
Tddli_Cancel(void) { int rc; if (opened_device->transmit == TDDL_TRANSMIT_IOCTL) { if ((rc = ioctl(opened_device->fd, TPMIOC_CANCEL, NULL)) == -1) { LogError("ioctl: (%d) %s", errno, strerror(errno)); return TDDLERR(TDDL_E_FAIL); } else if (rc == -EIO) { /* The driver timed out while trying to tell the ...
false
false
false
false
false
0
Interp(gdouble ym, gdouble y0, gdouble yp, gdouble * xe, gdouble * ye, gdouble * z1, gdouble * z2, gint * nz) { gdouble a, b, c, d, dx; *nz = 0; a = 0.5 * (ym + yp) - y0; b = 0.5 * (yp - ym); c = y0; *xe = -b / (2.0 * a); *ye = (a * (*xe) + b) * (*xe) + c; d = b * b - 4.0 * a * c; if (d >= 0) { dx ...
false
false
false
false
false
0
toString() const { QStringList l; foreach ( unsigned int i, d->index ) { l.append( QString::number( i ) ); } return l.join( QLatin1String( "." ) ); }
false
false
false
false
false
0
mwifiex_dequeue_tx_queue(struct mwifiex_adapter *adapter) { struct sk_buff *skb, *skb_next; struct mwifiex_txinfo *tx_info; struct mwifiex_tx_param tx_param; skb = skb_dequeue(&adapter->tx_data_q); if (!skb) return -1; tx_info = MWIFIEX_SKB_TXCB(skb); if (tx_info->flags & MWIFIEX_BUF_FLAG_AGGR_PKT) atomic_...
false
false
false
false
false
0
brcmf_sdio_bus_get_memdump(struct device *dev, void *data, size_t mem_size) { struct brcmf_bus *bus_if = dev_get_drvdata(dev); struct brcmf_sdio_dev *sdiodev = bus_if->bus_priv.sdio; struct brcmf_sdio *bus = sdiodev->bus; int err; int address; int offset; int len; brcmf_dbg(INFO, "dump at 0x%08x: siz...
false
false
false
false
false
0
gdev_vector_close_file(gx_device_vector * vdev) { FILE *f = vdev->file; int err; if (vdev->bbox_device) { rc_decrement(vdev->bbox_device->icc_struct, "vector_close(bbox_device->icc_struct"); vdev->bbox_device->icc_struct = NULL; gs_free_object(vdev->v_memory, vdev->bbox_device, ...
false
false
false
false
false
0
ReadCurrentPos(jack_position_t* pos) { UInt16 next_index = GetCurrentIndex(); UInt16 cur_index; do { cur_index = next_index; memcpy(pos, ReadCurrentState(), sizeof(jack_position_t)); next_index = GetCurrentIndex(); } while (cur_index != next_index); // Until a coherent state has ...
false
false
false
false
false
0
intToHexStr( uint64_t n ) { std::ostringstream result; result << "0x" << std::hex << n; return result.str(); }
false
false
false
false
false
0
__igb_shutdown(struct pci_dev *pdev, bool *enable_wake, bool runtime) { struct net_device *netdev = pci_get_drvdata(pdev); struct igb_adapter *adapter = netdev_priv(netdev); struct e1000_hw *hw = &adapter->hw; u32 ctrl, rctl, status; u32 wufc = runtime ? E1000_WUFC_LNKC : adapter->wol; #ifdef CONFIG_PM int r...
false
false
false
false
false
0
P_DestroyConverter(void) { int i; DEH_snprintf(pmsgbuffer, sizeof(pmsgbuffer), "You've destroyed the Converter!"); for(i = 0; i < MAXPLAYERS; i++) { P_GiveItemToPlayer(&players[i], SPR_TOKN, MT_TOKEN_QUEST25); P_GiveItemToPlayer(&players[i], SPR_TOKN, MT_TOKEN_STAMINA); P_GiveI...
false
false
false
false
false
0
setStartPeriodsAt(const int transConstantsTimeEnumValue) { d->_startPeriod = transConstantsTimeEnumValue; delete d->_periodMenu; d->_periodMenu = 0; d->populatePeriodMenu(); }
false
false
false
false
false
0
output_abbrev_section (void) { unsigned long abbrev_id; for (abbrev_id = 1; abbrev_id < abbrev_die_table_in_use; ++abbrev_id) { dw_die_ref abbrev = abbrev_die_table[abbrev_id]; unsigned ix; dw_attr_ref a_attr; dw2_asm_output_data_uleb128 (abbrev_id, "(abbrev code)"); dw2_asm_outp...
false
false
false
false
false
0
Mono_Posix_FromUnixSocketType (int x, int *r) { *r = 0; if (x == Mono_Posix_UnixSocketType_SOCK_DCCP) #ifdef SOCK_DCCP {*r = SOCK_DCCP; return 0;} #else /* def SOCK_DCCP */ {errno = EINVAL; return -1;} #endif /* ndef SOCK_DCCP */ if (x == Mono_Posix_UnixSocketType_SOCK_DGRAM) #ifdef SOCK_DGRAM {*r = SOCK_DGRAM...
false
false
false
false
false
0
PerlIOStdio_set_ptrcnt(pTHX_ PerlIO *f, STDCHAR * ptr, SSize_t cnt) { FILE * const stdio = PerlIOSelf(f, PerlIOStdio)->stdio; if (ptr != NULL) { #ifdef STDIO_PTR_LVALUE PerlSIO_set_ptr(stdio, ptr); /* LHS STDCHAR* cast non-portable */ #ifdef STDIO_PTR_LVAL_SETS_CNT assert(PerlSIO_get_cnt(stdio) == (cnt)); #en...
false
false
false
false
false
0
close_cma_dialog(struct city *pcity) { struct cma_dialog *pdialog = get_cma_dialog(pcity); if (pdialog == NULL) { /* A city which is being investigated doesn't contain cma dialog */ return; } gtk_widget_destroy(pdialog->shell); }
false
false
false
false
false
0
readCommand(const QByteArray &cmd, CacheFileInfo *fi) { readBinaryHeader(cmd, fi); QDataStream stream(cmd); stream.skipRawData(SerializedCacheFileInfo::size); quint32 ret; stream >> ret; QByteArray baseName; baseName.resize(s_hashedUrlNibbles); stream.readRawData(baseName.data(), s_has...
false
false
false
false
false
0
gnc_pricedb_print_contents(GNCPriceDB *db, FILE *f) { if (!db) { PERR("NULL PriceDB\n"); return; } if (!f) { PERR("NULL FILE*\n"); return; } fprintf(f, "<gnc:pricedb>\n"); gnc_pricedb_foreach_price(db, print_pricedb_adapter, f, FALSE); fprintf(f, "</g...
false
false
false
false
false
0
update_network_signal(GSupplicantNetwork *network) { if (g_hash_table_size(network->bss_table) <= 1) return; g_hash_table_foreach(network->bss_table, update_signal, network); SUPPLICANT_DBG("New network signal %d", network->signal); }
false
false
false
false
false
0
user2netname (char netname[MAXNETNAMELEN + 1], const uid_t uid, const char *domain) { char dfltdom[MAXNETNAMELEN + 1]; size_t i; if (domain == NULL) { if (getdomainname (dfltdom, sizeof (dfltdom)) < 0) return 0; } else { strncpy (dfltdom, domain, MAXNETNAMELEN); dfltdom[MA...
true
true
false
false
false
1
upssend(const char *fmt,...) { int ret; char buf[1024], *p; va_list ap; unsigned int sent = 0; int d_usec = UPSDELAY; va_start(ap, fmt); ret = vsnprintf(buf, sizeof(buf), fmt, ap); va_end(ap); if ((ret < 1) || (ret >= (int) sizeof(buf))) upslogx(LOG_WARNING, "ser_send_pace: vsnprintf needed more " "tha...
true
true
false
false
true
1
m41t93_get_time(struct device *dev, struct rtc_time *tm) { struct spi_device *spi = to_spi_device(dev); const u8 start_addr = 0; u8 buf[8]; int century_after_1900; int tmp; int ret = 0; /* Check status of clock. Two states must be considered: 1. halt bit (HT) is set: the clock is running but update of reado...
false
false
false
false
false
0
_wrap_fs_codec_tp_getattr(PyObject *self, char *attr) { FsCodec *codec; codec = pyg_boxed_get(self, FsCodec); if (!strcmp (attr, "id")) { return PyInt_FromLong(codec->id); } else if (!strcmp (attr, "encoding_name")) { return PyString_FromString (codec->encoding_name ? codec->encoding_name : "");...
false
false
false
false
false
0
getMaxFricStress() const { pair<bool,double> res; // calculate distance Vec3 D=m_p1->getPos()-m_p2->getPos(); double dist=D*D; double eq_dist=m_p1->getRad()+m_p2->getRad(); // check if there is contact if(dist<(eq_dist*eq_dist)) { dist=sqrt(dist); Vec3 force=D*(m_k*(dist-eq_dist)/dist); res...
false
false
false
false
false
0
pkix_ResourceLimits_Equals( PKIX_PL_Object *first, PKIX_PL_Object *second, PKIX_Boolean *pResult, void *plContext) { PKIX_UInt32 secondType; PKIX_Boolean cmpResult; PKIX_ResourceLimits *firstRLimits = NULL; PKIX_ResourceLimits *secondRLimits = NULL; ...
false
false
false
false
false
0
xsf_gen(void *pbuffer, unsigned samples) { unsigned char *ptr = pbuffer; unsigned bytes = samples <<= 2; if (!sndifwork.xfs_load) return 0; while (bytes) { unsigned remainbytes = sndifwork.filled - sndifwork.used; if (remainbytes > 0) { if (remainbytes > bytes) { memcpy(ptr, sndifwork.pcmbuftop + s...
false
true
false
false
false
1
process_slab(struct loc_track *t, struct kmem_cache *s, struct page *page, enum track_item alloc, unsigned long *map) { void *addr = page_address(page); void *p; bitmap_zero(map, page->objects); get_map(s, page, map); for_each_object(p, s, addr, page->objects) if (!test_bit(slab_index(p, s, addr), map)) ...
false
false
false
false
false
0
qxl_alloc_bo_reserved(struct qxl_device *qdev, struct qxl_release *release, unsigned long size, struct qxl_bo **_bo) { struct qxl_bo *bo; int ret; ret = qxl_bo_create(qdev, size, false /* not kernel - device */, false, QXL_GEM_DOMAIN_VRAM, NULL, &bo); if (ret) { DRM_ERROR("failed to allocat...
false
false
false
false
false
0
xwrite(int fd, char *buffer, size_t len) { size_t done = 0; size_t n; while (done < len) { n = write(fd, buffer + done, len - done); if (n == 0) { /* file system full */ return -1; } else if (n != (size_t)-1) { /* some bytes written, continue */ done += n; } else if (errno != EAGA...
false
false
false
false
false
0
cgroup_compare_cgroup(struct cgroup *cgroup_a, struct cgroup *cgroup_b) { int i; if (!cgroup_a || !cgroup_b) return ECGINVAL; if (strcmp(cgroup_a->name, cgroup_b->name)) return ECGROUPNOTEQUAL; if (cgroup_a->tasks_uid != cgroup_b->tasks_uid) return ECGROUPNOTEQUAL; if (cgroup_a->tasks_gid != cgroup_b->ta...
false
false
false
false
false
0
xsltExtModuleFunctionLookup(const xmlChar * name, const xmlChar * URI) { xmlXPathFunction ret; if ((xsltFunctionsHash == NULL) || (name == NULL) || (URI == NULL)) return (NULL); xmlMutexLock(xsltExtMutex); XML_CAST_FPTR(ret) = xmlHashLookup2(xsltFunctionsHash, name, URI); xmlMutexUnlock(...
false
false
false
false
false
0
menu_media_tape_browse( GtkAction *gtk_action GCC_UNUSED, gpointer data GCC_UNUSED ) { /* Firstly, stop emulation */ fuse_emulation_pause(); if( !dialog_created ) if( create_dialog() ) { fuse_emulation_unpause(); return; } if( ui_tape_browser_update( UI_TAPE_BROWSER_NEW_TAPE, NULL ...
false
false
false
false
false
0