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
graya_to_rgba (char *src, char *dst, long n) { while (n--) { double luminance; double red, green, blue; double alpha; luminance = ((double *) src)[0]; alpha = ((double *) src)[1]; red = luminance; green = luminance; blue...
false
false
false
false
false
0
xen_blkif_alloc(domid_t domid) { struct xen_blkif *blkif; BUILD_BUG_ON(MAX_INDIRECT_PAGES > BLKIF_MAX_INDIRECT_PAGES_PER_REQUEST); blkif = kmem_cache_zalloc(xen_blkif_cachep, GFP_KERNEL); if (!blkif) return ERR_PTR(-ENOMEM); blkif->domid = domid; spin_lock_init(&blkif->blk_ring_lock); atomic_set(&blkif->ref...
false
false
false
false
false
0
phase_two(void) {phase=2; if(text_root==NULL&&output_file_count==0) {print("\n! No program text was specified.");mark_harmless();} else {if(show_progress) {print("\nWriting the output file%s" ,(text_root!=NULL)+output_file_count>1?"s":""); if(text_root!=NULL)printf(" (%s):",C_file_name); update_terminal(); } if(text_r...
false
false
false
false
true
1
udp_ping_register(const struct guid *muid, host_addr_t addr, uint16 port, udp_ping_cb_t cb, void *data, bool multiple) { struct udp_ping *ping; uint length; g_assert(muid); g_return_val_if_fail(udp_pings, FALSE); if (hash_list_contains(udp_pings, muid)) { /* Probably a duplicate */ return FALSE; } /* ra...
false
false
false
false
false
0
network_prefix(int ae, int plen, unsigned int omitted, const unsigned char *p, const unsigned char *dp, unsigned int len, unsigned char *p_r) { unsigned pb; unsigned char prefix[16]; int consumed = 0; if(plen >= 0) pb = (plen + 7) / 8; else if(ae == 1) ...
true
true
false
false
false
1
get_pack_ubyte_rgba_row_function(mesa_format format) { static pack_ubyte_rgba_row_func table[MESA_FORMAT_COUNT]; static GLboolean initialized = GL_FALSE; if (!initialized) { /* We don't need a special row packing function for each format. * There's a generic fallback which uses a per-pixel packin...
false
false
false
false
false
0
write_head(struct ubifs_info *c, int jhead, void *buf, int len, int *lnum, int *offs, int sync) { int err; struct ubifs_wbuf *wbuf = &c->jheads[jhead].wbuf; ubifs_assert(jhead != GCHD); *lnum = c->jheads[jhead].wbuf.lnum; *offs = c->jheads[jhead].wbuf.offs + c->jheads[jhead].wbuf.used; dbg_jnl("jhead %s...
false
false
false
false
false
0
gtk_plot3d_plane_visible (GtkPlot3D *plot, GtkPlotPlane plane) { gboolean visible = FALSE; switch(plane){ case GTK_PLOT_PLANE_XY: visible = plot->xy_visible; break; case GTK_PLOT_PLANE_YZ: visible = plot->yz_visible; break; case GTK_PLOT_PLANE...
false
false
false
false
false
0
enum_zip(argc, argv, obj) int argc; VALUE *argv; VALUE obj; { int i; VALUE result; VALUE memo[3]; for (i=0; i<argc; i++) { argv[i] = rb_convert_type(argv[i], T_ARRAY, "Array", "to_a"); } result = rb_block_given_p() ? Qnil : rb_ary_new(); memo[0] = result; memo[1] = rb_ary_n...
false
false
false
false
false
0
invert_colors(struct fp_img *img) { int data_len = img->width * img->height; int i; for (i = 0; i < data_len; i++) img->data[i] = 0xff - img->data[i]; }
false
false
false
false
false
0
ctt_pdu_to_str(dchat_pdu_t* pdu, char** value) { dchat_content_types_t content_types; char* type; // content type has not been set if (pdu->content_type == 0) { return 1; } // init available content types if (init_dchat_content_types(&content_types) == -1) { return ...
false
true
false
true
false
1
get_counter(const struct gl_perf_monitor_group *group_obj, GLuint id) { if (id >= group_obj->NumCounters) return NULL; return &group_obj->Counters[id]; }
false
false
false
false
false
0
setSetting( BatchSettingId id, bool value, const String &materialName ) { assert( id < NUM_SETTINGS ); if( materialName == BLANKSTRING ) { //Setup all existing materials InstanceBatchMap::iterator itor = mInstanceBatches.begin(); InstanceBatchMap::iterato...
false
false
false
false
false
0
on_textv_mod_buffer_changed (GtkTextBuffer *buffer, gpointer data) { GtkTextIter start, end; gchar *tmp; gtk_text_buffer_get_bounds (buffer, &start, &end); tmp = gtk_text_buffer_get_text (buffer, &start, &end, FALSE); if (strlen (tmp) > MAX_DEFINITION) gtk_text_buf...
false
false
false
false
false
0
on_jump_to_menu_item_activate(GtkMenuItem *menuitem, G_GNUC_UNUSED gpointer gdata) { GtkTreeIter iter; const gchar *expr = gtk_menu_item_get_label(menuitem); if (model_find(model, &iter, INSPECT_EXPR, expr)) utils_tree_set_cursor(selection, &iter, 0); }
false
false
false
false
false
0
onWidgetTransferCreateTransfer(AB_JOB_TYPE type, const widgetTransfer *sender) { if (type == AB_Job_TypeCreateStandingOrder || type == AB_Job_TypeModifyStandingOrder) { //check if the inputs to recurrence are ok QString errMsg; bool inputOK = sender->isRecurrenceInputOk(errMsg); if (!inputOK) { bool ac...
false
false
false
false
false
0
proxy_walk(request_rec *r) { proxy_server_conf *sconf = ap_get_module_config(r->server->module_config, &proxy_module); ap_conf_vector_t *per_dir_defaults = r->server->lookup_defaults; ap_conf_vector_t **sec_proxy = (ap_conf_vector_t **) sconf->sec_proxy->e...
false
false
false
false
false
0
mh_remove_missing_folder_items_func(GNode *node, gpointer data) { FolderItem *item; gchar *path; cm_return_val_if_fail(node->data != NULL, FALSE); if (G_NODE_IS_ROOT(node)) return FALSE; item = FOLDER_ITEM(node->data); path = folder_item_get_path(item); if (!is_dir_exist(path)) { debug_print("folder '%s'...
false
false
false
false
false
0
VBO_GetBusyObj(struct worker *wrk) { struct vbo *vbo = NULL; char *p; CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC); if (wrk->nvbo != NULL) { vbo = wrk->nvbo; wrk->nvbo = NULL; } if (vbo == NULL) { Lck_Lock(&vbo_mtx); vbo = nvbo; nvbo = NULL; if (vbo == NULL) VSC_C_main->busyobj_alloc++; Lck_Unlock(...
false
false
false
true
false
1
proc_file_exists(const char *filename) { struct stat s; struct statfs f; if (lstat(filename, &s)) return false; if (!S_ISREG(s.st_mode)) return false; if (statfs(filename, &f)) return false; if (f.f_type != PROC_SUPER_MAGIC) return false; return true; }
false
false
false
false
false
0
aes_negotiate (GkdSecretSession *self, DBusMessage *message, gconstpointer input, gsize n_input) { DBusMessageIter iter, variant, array; GckSession *session; GckObject *pub, *priv, *key; GError *error = NULL; DBusMessage *reply; gpointer output; gsize n_output; gboolean ret; session = gkd_secret_service_get_p...
false
false
false
false
false
0
scale_getActualBufSizes ( IP_XFORM_HANDLE hXform, /* in: handle for xform */ PDWORD pdwMinInBufLen, /* out: min input buf size */ PDWORD pdwMinOutBufLen) /* out: min output buf size */ { PSC_INST g; HANDLE_TO_PTR (hXform, g); *pdwMinInBufLen = g->in_row_nbytes; ...
false
false
false
false
false
0
deploy_buttons(Gameboard *g, void (*callback)(Gameboard *g)){ if(!g->b.buttons_ready){ // sweep across the buttons inward from the horizontal edges; when // the sweep passes a button it is set to deploy by making the // target y equal to the active y target. g->b.sweeper = 0; g->b.swee...
false
false
false
false
false
0
authentication_mediator_authenticator_thread (gpointer data) { EAuthenticationMediator *mediator; GDBusInterfaceSkeleton *interface; GDBusConnection *connection; ThreadClosure *closure = data; GSource *idle_source; const gchar *object_path; gulong handle_ready_id; gulong handle_cancel_id; gulong handle_accepte...
false
false
false
false
false
0
fop_lk_stub (call_frame_t *frame, fop_lk_t fn, fd_t *fd, int32_t cmd, struct gf_flock *lock, dict_t *xdata) { call_stub_t *stub = NULL; GF_VALIDATE_OR_GOTO ("call-stub", frame, out); GF_VALIDATE_OR_GOTO ("call-stub", lock, out); stub = stub_new (frame, 1, GF_F...
false
false
false
false
false
0
pixDisplayPtaPattern(PIX *pixd, PIX *pixs, PTA *pta, PIX *pixp, l_int32 cx, l_int32 cy, l_uint32 color) { l_int32 i, n, w, h, x, y; PTA *ptat; PROCNAME("pixDis...
false
false
false
false
false
0
pull_buffer_impl( XferElement *elt, size_t *size) { XferSourcePattern *self = (XferSourcePattern *)elt; char *rval; /* indicate EOF on an cancel */ if (elt->cancelled) { *size = 0; return NULL; } if (self->limited_length) { if (self->length == 0) { *size = 0; ...
false
false
false
false
false
0
configureLoggers() { if(properties.exists( LOG4CPLUS_TEXT("rootLogger") )) { Logger root = h.getRoot(); configureLogger(root, properties.getProperty(LOG4CPLUS_TEXT("rootLogger"))); } Properties loggerProperties = properties.getPropertySubset(LOG4CPLUS_TEX...
false
false
false
false
false
0
nanoedu_read_graph(const guchar *buffer, gsize size, gint res, gint ncurves, gdouble real, const gchar *xunits, const char *yunits, gdouble q, GError **error) { gint i, j; GwyGraphModel *gmodel; GwyGraphCurveModel...
false
false
false
false
false
0
l_byteaAppendString(L_BYTEA *ba, char *str) { size_t size, len, nalloc, reqsize; PROCNAME("l_byteaAppendString"); if (!ba) return ERROR_INT("ba not defined", procName, 1); if (!str) return ERROR_INT("str not defined", procName, 1); size = l_byteaGetSize(ba); ...
false
true
false
false
false
1
action_tree_down_right(Widget w, XEvent *event, String *params, Cardinal *no_params) { ARTICLE *art; if (global.busy || (global.mode != NewsModeGroup && global.mode != NewsModeThread)) return; art = global.curr_art; if (!art) { if (global.bell) XBell(display, 0); return; } a...
false
false
false
false
false
0
lightdm_greeter_respond (LightDMGreeter *greeter, const gchar *response) { LightDMGreeterPrivate *priv; guint8 message[MAX_MESSAGE_LENGTH]; gsize offset = 0; g_return_if_fail (LIGHTDM_IS_GREETER (greeter)); g_return_if_fail (response != NULL); priv = GET_PRIVATE (greeter); g_return_if_fai...
false
false
false
false
false
0
parseJsFile (tokenInfo *const token) { do { readToken (token); if (isType (token, TOKEN_KEYWORD) && token->keyword == KEYWORD_function) parseFunction (token); else parseLine (token, FALSE); } while (TRUE); }
false
false
false
false
false
0
updateEndPoint(const unsigned int type, const ConnEnd& connEnd) { common_updateEndPoint(type, connEnd); if (_router->_polyLineRouting) { bool knownNew = true; bool genContains = true; if (type == (unsigned int) VertID::src) { vertexVisibility(_srcVert, _dstVert, ...
false
false
false
false
false
0
sarrayDestroy(SARRAY **psa) { l_int32 i; SARRAY *sa; PROCNAME("sarrayDestroy"); if (psa == NULL) { L_WARNING("ptr address is NULL!", procName); return; } if ((sa = *psa) == NULL) return; sarrayChangeRefcount(sa, -1); if (sarrayGetRefcount(sa) <= 0) { if (sa-...
false
false
false
false
false
0
optimize_code3(FILE *lf) { unsigned i, j, k; int changed = 0; code_t *c0, *c1; for(i = 0; i < dict_size; i++) { if( i >= sizeof prim_names / sizeof *prim_names && !dict[i].del && !dict[i].ref && dict[i].def == 1 && dict[i].type == t_none ) { c0 = code + (j = dict[i]....
false
false
false
false
false
0
SQLSetConnectAttr_Internal ( SQLHDBC connectionHandle, SQLINTEGER Attribute, SQLPOINTER ValuePtr, SQLINTEGER StringLength, SQLCHAR waMode) { CONN (con, connectionHandle); ENVR (penv, con->henv); HPROC hproc = SQL_NULL_HPROC; HPROC hproc2 = SQL_NULL_HPROC; SQLRETURN retcode = SQL_SUCCE...
false
false
false
false
false
0
lrmd_dump_all_resources(void) { static gboolean incall = FALSE; char text[]= "lrmd_dump_all_resources"; if (incall) { return; } incall = TRUE; lrmd_debug(LOG_DEBUG, "%d resources are managed by lrmd" , g_hash_table_size(resources)); g_hash_table_foreach(resources, dump_id_rsc_pair, text); incall = FALSE; }
false
false
false
false
false
0
H5O_ainfo_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, hbool_t H5_ATTR_UNUSED *recompute_size, unsigned H5_ATTR_UNUSED *mesg_flags, H5O_copy_t *cpy_info, void H5_ATTR_UNUSED *udata, hid_t dxpl_id) { H5O_ainfo_t *ainfo_src = (H5O_ainfo_t *)mesg_src; H5O_ainfo_t *ainfo_dst = NULL; void ...
false
false
false
false
false
0
loadPin(QDomElement elem, ViewLayer::ViewID viewID) { QDomElement pinElem = elem.firstChildElement("p"); while (!pinElem.isNull()) { //QString temp; //QTextStream stream(&temp); //pinElem.save(stream, 0); //stream.flush(); QString svgId = pinElem.attribute("svgId"); //svgId = svgId.left(svgId.lastIndexOf(...
false
false
false
false
false
0
store_sf2_temp(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct i2c_client *client = to_i2c_client(dev); struct w83793_data *data = i2c_get_clientdata(client); struct sensor_device_attribute_2 *sensor_attr = to_sensor_dev_attr_2(attr); int nr = sensor_attr->nr;...
false
false
false
false
false
0
echo_header(echo_do *v, const char *key, const char *val) { /* If the input header (key) matches the regex, echo it intact to * r->headers_out. */ if (!ap_regexec(v->hdr->regex, key, 0, NULL, 0)) { apr_table_add(v->r->headers_out, key, val); } return 1; }
false
false
false
false
false
0
parser_get_next_value(char* line, char **end, icalvalue_kind kind) { char* next; char *p; char *str; size_t length = strlen(line); p = line; while(1){ next = parser_get_next_char(',',p,1); /* Unforunately, RFC2445 says that for the RECUR value, COMMA can both separate digits in a l...
false
false
false
false
false
0
load_section(FILE *in, uint32_t addr, uint32_t offset, uint32_t size, binfile_imgcb_t cb, void *user_data) { uint8_t *section; if (!size) return 0; section = malloc(size); if (!section) { printc_err("coff: couldn't allocate memory for " "section at 0x%x: %s\n", offset, strerror(errno)); return -1; ...
false
false
false
false
false
0
strrev(register char *str) { register int i, j; REQUIRE_RVAL(str != SPIF_NULL_TYPE(ptr), SPIF_NULL_TYPE(ptr)); i = strlen(str); for (j = 0, i--; i > j; i--, j++) { (void) SWAP(str[j], str[i]); } return (str); }
false
false
false
false
false
0
vcmd_insert_repeated(cmd_code c, int nrepeats, va_list vp) { game_command cmd = {CMD_NULL, 0, {{0}} }; size_t j = 0; int idx = cmd_idx(c); if (idx == -1) return 1; cmd.command = c; for (j = 0; (game_cmds[idx].arg_type[j] != arg_END && j < N_ELEMENTS(game_cmds[idx].arg_type)); j++) { switch (game_cmds[...
false
false
false
false
true
1
lx_set_granularity(struct lx6464es *chip, u32 gran) { int err = 0; u32 snapped_gran = MICROBLAZE_IBL_MIN; dev_dbg(chip->card->dev, "->lx_set_granularity\n"); /* blocksize is a power of 2 */ while ((snapped_gran < gran) && (snapped_gran < MICROBLAZE_IBL_MAX)) { snapped_gran *= 2; } if (snapped_gran =...
false
false
false
false
false
0
throw_bad_typeid (void) { tree fn = get_identifier ("__cxa_bad_typeid"); if (!get_global_value_if_present (fn, &fn)) { tree t; t = build_reference_type (const_type_info_type_node); t = build_function_type_list (t, NULL_TREE); fn = push_throw_library_fn (fn, t); } return build_cxx...
false
false
false
false
false
0
_mda_in_vg_raw(struct format_instance *fid __attribute__((unused)), struct volume_group *vg, struct metadata_area *mda) { struct mda_context *mdac = (struct mda_context *) mda->metadata_locn; struct pv_list *pvl; dm_list_iterate_items(pvl, &vg->pvs) if (pvl->pv->dev == mdac->area.dev) return 1; retur...
false
false
false
false
false
0
length() const { float64 sum; sum = x_*x_ + y_*y_ + z_*z_; return sum > gEpsilon ? sqrt(sum) : 0.0; }
false
false
false
false
false
0
coloncmd(char *cmd, ...) { char buf[1024]; va_list ap; va_start(ap, cmd); vim_vsnprintf(buf, sizeof(buf), cmd, ap, NULL); va_end(ap); nbdebug((" COLONCMD %s\n", buf)); /* ALT_INPUT_LOCK_ON; */ do_cmdline((char_u *)buf, NULL, NULL, DOCMD_NOWAIT | DOCMD_KEYTYPED); /* ALT_INPUT_LO...
true
true
false
false
false
1
_dxfScreen_BoundingBox(Screen s, Point *box, Matrix *mp, int validity) { Object o; int fixed, i; if (!DXGetScreenInfo(s, &o, &fixed, NULL)) return NULL; if (fixed==SCREEN_WORLD) { static Point zero = {0, 0, 0}, p; p = mp? DXApply(zero, *mp) : zero; if (box) for (i=0; i<8; i++) box[i] = p; r...
false
false
false
false
false
0
operator<<(std::ostream& os, const CValue& v) { switch (v.type()) { case CValue::ETYPE_INTEGER: return os << v.get_integer(); case CValue::ETYPE_FLOAT: return os << v.get_float(); case CValue::ETYPE_BOOLEAN: return os << (v.get_boolean() ? "true" : "...
false
false
false
false
false
0
input_bits(unsigned stringLen) { if( bit_offset + stringLen > (last_offset+sizeof(residue))*8 ) { // find byte to read long byteFetch = bit_offset/8 - last_offset; if( byteFetch >= sizeof(residue) ) // residue >>= 32 does not change to 0 residue = 0; else residue >>= 8*byteFetch; filePtr->file_read( ...
false
false
false
false
false
0
verify_non_ssa_vars (struct split_point *current, bitmap non_ssa_vars, basic_block return_bb) { bitmap seen = BITMAP_ALLOC (NULL); VEC (basic_block,heap) *worklist = NULL; edge e; edge_iterator ei; bool ok = true; FOR_EACH_EDGE (e, ei, current->entry_bb->preds) if (e->src != ENTRY_BLOCK_PTR && ...
false
false
false
false
false
0
future_hack(parser_state *ps) { node *n = ps->p_stack.s_top->s_parent; node *ch, *cch; int i; /* from __future__ import ..., must have at least 4 children */ n = CHILD(n, 0); if (NCH(n) < 4) return; ch = CHILD(n, 0); if (STR(ch) == NULL || strcmp(STR(ch), "from") != 0) r...
false
false
false
false
false
0
gnutls_x509_crt_set_subject_alternative_name (gnutls_x509_crt_t crt, gnutls_x509_subject_alt_name_t type, const char *data_string) { if (crt == NULL) { gnutls_assert (); return GNUTLS_E_INVALID_REQUEST; } ...
false
false
false
false
false
0
redisCmd_buildProtocolStr(RedisCmd *cmd) { struct RedisCmdSpec *cmdSpec; if (cmd == NULL) { _redis_setSrvError(REDIS_ERROR_CMD_INVALID); return NULL; } /* * if a protocol string is already generated, free it and build a new one */ if (cmd->protocolString != NULL) bstr_free (cmd->protocolStri...
false
false
false
false
false
0
get_brightness(unsigned long c) { int ret; /* if complete red, return maximum brightness */ if ( ((c>>16) & 0xff)==255) return 255; ret=0.299*((c>>16) & 0xff) + 0.587*((c>>8) & 0xff) + 0.114*(c & 0xff); if (ret<0) { return 0; } if (ret>255) { return 255; } return ( (unsigned char) ret ); }
false
false
false
false
false
0
doif(trp) syntaxtree *trp; { syntaxtree *cond, *body; int ret; cond = statementbody(trp); if (!(body = statementcheck(trp -> next, SM_THEN))) return(-1); if ((ret = exec_stree(cond, 1)) < 0 || returnlevel) return(ret); if (interrupted) return(RET_INTR); if (ret_status == RET_SUCCESS) return(exec_stree(body, 0)...
false
false
false
false
false
0
enterDrive(Stream_t *Dir, char drive) { int r; if(currentDrive == drive) return 0; /* still the same */ leaveDrive(0); currentDrive = drive; r = print_volume_label(Dir, drive); if (r) return r; bytesOnDrive = 0; filesOnDrive = 0; dirsOnDrive = 0; return 0; }
false
false
false
false
false
0
tree_view_enter_notify_event(GtkWidget * widget, GdkEventCrossing *event) { GtkTreeSelection *selection; GtkTreeIter iter; AmitkTreeView * tree_view; g_return_val_if_fail(AMITK_IS_TREE_VIEW(widget), FALSE); tree_view = AMITK_TREE_VIEW(widget); switch(tree_view->mode) { case AMITK_TREE_VIEW_MO...
false
false
false
false
false
0
krb5_rd_safe(krb5_context context, krb5_auth_context auth_context, const krb5_data *inbuf, krb5_data *outbuf, krb5_replay_data *outdata) { krb5_error_code retval; krb5_key key; krb5_replay_data replaydata; if (((auth_context->auth_context_flags & KRB5_A...
false
false
false
false
false
0
list_vector(uint32_t args) { ONE_ARG(list); int len = length_list(list); if (len == -1) return 0; uint32_t index = make_vector(len, 0); uint32_t *elements = VECTOR_START(index); for (int i = 0; i < len; i++) { *elements++ = CAR(list); list = CDR(list); } return index; }
false
false
false
false
false
0
insert_after(const PortT &inserter, const PortT &h) { if (!add_connection(h, inserter)) return false; ConnectionX *c = _first_conn[h.eindex()][end_from]; while (c) { ConnectionX *next = c->next_from(); if (c->from() == h && c->to() != inserter) change_connection_from(conn_iterator(c, 0), inserter);...
false
false
false
false
false
0
panel_applet_set_size_hints (PanelApplet *applet, const int *size_hints, int n_elements, int base_size) { gint i; /* Make sure property has really changed to avoid bus traffic */ if (!panel_applet_size_hints_changed (applet, size_hints, n_elements, base_size)) return; ...
false
false
false
false
false
0
nd_iowirdecl(struct net_t *np) { if (np->n_isavec || np->n_isarr || np->nattrs != NULL) return(TRUE); /* SJM 10/06/03 - if signed but not integer/real/time, need signed decl */ if (np->n_signed && (np->ntyp != N_INT && np->ntyp != N_REAL && np->ntyp != N_TIME)) return(TRUE); if (np->nrngrep == NX_CT) { /*...
false
false
false
false
false
0
ncp_put_super(struct super_block *sb) { struct ncp_server *server = NCP_SBP(sb); ncp_lock_server(server); ncp_disconnect(server); ncp_unlock_server(server); ncp_stop_tasks(server); mutex_destroy(&server->rcv.creq_mutex); mutex_destroy(&server->root_setup_lock); mutex_destroy(&server->mutex); if (server->in...
false
false
false
false
false
0
upnp_launch_discovery_if_needed(void) { static unsigned counter; /* * We don't have any known Internet Gateway Device, look whether * they plugged one in, but not at every wakeup... * * If we're not firewalled, there's no reason to actively look for an * IGD yet. */ if (!upnp_port_mapping_required()) {...
false
false
false
false
false
0
test_collect() { DArray *found = TSTree_collect(node, "TE", 2, NULL); debug("collect found %d values", (int)DArray_count(found)); mu_assert(DArray_count(found) == 3, "Didn't find 2 with prefix TE."); DArray_destroy(found); found = TSTree_collect(node, "T", 1, NULL); debug("collect found %d val...
false
false
false
false
false
0
_tp_account_set_connection (TpAccount *account, const gchar *path) { TpAccountPrivate *priv = account->priv; gboolean had_public_connection; gboolean have_public_connection; GError *error = NULL; if (priv->connection != NULL) { const gchar *current; /* Do nothing if we already have a con...
false
false
false
false
false
0
time_to_f(time) VALUE time; { struct time_object *tobj; GetTimeval(time, tobj); return rb_float_new((double)tobj->tv.tv_sec+(double)tobj->tv.tv_usec/1e6); }
false
false
false
false
false
0
boxGetCentroid(BOX *box, l_int32 *px, l_int32 *py) { l_int32 x, y, w, h; PROCNAME("boxGetCentroid"); if (!px || !py) return ERROR_INT("&x, &y not both defined", procName, 1); *px = *py = 0; if (!box) return ERROR_INT("box not defined", procName, ...
false
false
false
false
false
0
ft_sess_unhash(struct ft_sess *sess) { struct ft_tport *tport = sess->tport; hlist_del_rcu(&sess->hash); BUG_ON(!tport->sess_count); tport->sess_count--; sess->port_id = -1; sess->params = 0; }
false
false
false
false
false
0
pch_dma_rx_complete(void *arg) { struct eg20t_port *priv = arg; struct uart_port *port = &priv->port; int count; dma_sync_sg_for_cpu(port->dev, &priv->sg_rx, 1, DMA_FROM_DEVICE); count = dma_push_rx(priv, priv->trigger_level); if (count) tty_flip_buffer_push(&port->state->port); async_tx_ack(priv->desc_rx); ...
false
false
false
false
false
0
update_mpd(void) { int interval; static timed_thread *thread = NULL; if (thread) return 0; interval = info.music_player_interval * 1000000; thread = timed_thread_create(&update_mpd_thread, &thread, interval); if (!thread) { NORM_ERR("Failed to create MPD timed thread"); return 0; } timed_thread_register...
false
false
false
false
false
0
cogorc_convert_I420_UYVY (guint8 * ORC_RESTRICT d1, guint8 * ORC_RESTRICT d2, const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2, const guint8 * ORC_RESTRICT s3, const guint8 * ORC_RESTRICT s4, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcProgram *p = 0; void (*f...
false
false
false
false
false
0
result_callback(const std::string & attr,const std::string & value,void * ref) { result_t* r = (result_t*)ref; if(r->decision != AAA_NO_MATCH) return; if(attr == "description") { if(strncmp("subject=",value.c_str(),8) == 0) { const char* s = value.c_str()+8; for(;*s;s++) if(*s != ' ') break; ...
false
false
false
false
false
0
ajFeatGetFlags(const AjPFeature thys, AjPStr* Pflagstr) { ajStrAssignC(Pflagstr, ""); if(thys->Flags & AJFEATFLAG_START_BEFORE_SEQ) ajStrAppendC(Pflagstr, "<start "); if(thys->Flags & AJFEATFLAG_END_AFTER_SEQ) ajStrAppendC(Pflagstr, ">end "); if(thys->Flags & AJFEATFLAG_BETWEEN_SEQ) ...
false
false
false
false
false
0
ConfigValueFloat(const char *blockName, const char *keyName, float *ret) { const char *val = GetConfigValue(blockName, keyName, ""); if(!val[0]) return 0; #ifdef HAVE_STRTOF *ret = strtof(val, NULL); #else *ret = (float)strtod(val, NULL); #endif return 1; }
false
false
false
false
false
0
open_upload(CGI *cgi, int unlink_files, FILE **fpw) { NEOERR *err = STATUS_OK; FILE *fp; char path[_POSIX_PATH_MAX]; int fd; *fpw = NULL; snprintf (path, sizeof(path), "%s/cgi_upload.XXXXXX", hdf_get_value(cgi->hdf, "Config.Upload.TmpDir", "/var/tmp")); fd = mkstemp(path); if (fd == -1) { ...
false
false
false
false
false
0
netsnmp_serialize_helper_handler(netsnmp_mib_handler *handler, netsnmp_handler_registration *reginfo, netsnmp_agent_request_info *reqinfo, netsnmp_request_info *requests) { netsnmp_request_info *request, *requesttmp;...
false
false
false
false
false
0
iconv_open_cached(const char* fromcode) { struct iconv_cache * cache; size_t idx; const size_t fromcode_len = strlen((const char*)fromcode); struct cli_element * e; iconv_t iconv_struct; init_iconv_pool_ifneeded(); cache = cache_get_tls_instance();/* gets TLS iconv pool */ if(!cache) { cli_dbgmsg(MODULE_NAM...
false
false
false
false
false
0
qpol_role_get_dominate_iter(const qpol_policy_t * policy, const qpol_role_t * datum, qpol_iterator_t ** dominates) { role_datum_t *internal_datum = NULL; policydb_t *db = NULL; int error; ebitmap_state_t *es = NULL; if (policy == NULL || datum == NULL || dominates == NULL) { if (dominates != NULL) *dominates...
false
false
false
false
false
0
reject(const ZoomTileIdx& zti, const MapParams& mp) const { // if this zoom tile includes more than one TileGroup, we can't reject early if (zti.zoom < mp.baseZoom - TTLEVEL1BITS - TTLEVEL2BITS) return false; // zoom tiles anywhere except level 0 have the property of not crossing TileSet/TileGroup // bound...
false
false
false
false
false
0
join(fxStr& s, const fxStr& a) { const char* cp = a; const char* ep = cp + a.length(); while (cp < ep) { s.append(' '); s.append(cp); cp = strchr(cp,'\0')+1; } }
false
false
false
false
false
0
smallcapsWidth(char_type c) const { // FIXME: Optimisation probably needed: we don't use the width cache. if (is_utf16(c)) { QChar const qc = ucs4_to_qchar(c); QChar const uc = qc.toUpper(); if (qc != uc) return smallcaps_metrics_.width(uc); else return metrics_.width(qc); } else { QString const s = ...
false
false
false
false
false
0
__init_instdownport_contas(struct itree_t *up_itp, struct itree_t *down_itp) { register int32 pi; register struct mod_pin_t *mpp; struct expr_t *xp; struct inst_t *ip; struct mod_t *down_mdp; int32 pnum; ip = down_itp->itip; down_mdp = ip->imsym->el.emdp; if ((pnum = down_mdp->mpnum) == 0) return; /* this ...
false
false
false
false
false
0
reconsider_outer_join_clauses(PlannerInfo *root) { bool found; ListCell *cell; ListCell *prev; ListCell *next; /* Outer loop repeats until we find no more deductions */ do { found = false; /* Process the LEFT JOIN clauses */ prev = NULL; for (cell = list_head(root->left_join_clauses); cell; cell...
false
false
false
false
false
0
Java_org_gdal_osr_osrJNI_SpatialReference_1ImportFromESRI(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jobject jarg2) { jint jresult = 0 ; OSRSpatialReferenceShadow *arg1 = (OSRSpatialReferenceShadow *) 0 ; char **arg2 = (char **) 0 ; OGRErr result; (void)jenv; (void)jcls; (void)jarg1_; ar...
false
false
false
false
false
0
channel_xmit_xon(PLCI *plci) { DIVA_CAPI_ADAPTER *a = plci->adapter; byte ch; if (plci->nl_req || !plci->NL.Id || plci->nl_remove_id) { return; } if ((ch = (byte)find_channel_with_pending_x_on(a, plci)) == 0) { return; } a->ch_flow_control[ch] &= ~N_XON_REQ; a->ch_flow_control[ch] |= N_XON_SENT; plci->NL...
false
false
false
false
false
0
nv_register_test(struct net_device *dev) { u8 __iomem *base = get_hwbase(dev); int i = 0; u32 orig_read, new_read; do { orig_read = readl(base + nv_registers_test[i].reg); /* xor with mask to toggle bits */ orig_read ^= nv_registers_test[i].mask; writel(orig_read, base + nv_registers_test[i].reg); new...
false
false
false
false
false
0
parallel_reservation_max_time_slots(sge_assignment_t *best, int *available_slots) { u_long32 pe_time, first_time; sge_assignment_t tmp_assignment = SGE_ASSIGNMENT_INIT; dispatch_t result = DISPATCH_NEVER_CAT; sge_qeti_t *qeti = NULL; bool is_first = true; int old_logging = 0; category_use_t use_c...
false
false
false
false
false
0
vivid_vid_out_s_ctrl(struct v4l2_ctrl *ctrl) { struct vivid_dev *dev = container_of(ctrl->handler, struct vivid_dev, ctrl_hdl_vid_out); struct v4l2_bt_timings *bt = &dev->dv_timings_out.bt; switch (ctrl->id) { case VIVID_CID_HAS_CROP_OUT: dev->has_crop_out = ctrl->val; vivid_update_format_out(dev); break; c...
false
false
false
false
false
0
formTimeString(double seconds, char* buffer) { int hrs = int( seconds / 3600.0 ); int mns = int( (seconds - hrs * 3600.0) / 60.0 ); int scs = int( (seconds - hrs * 3600.0 - mns * 60.0) ); ostrstream ostrm; ostrm.setf(ios::right, ios::adjustfield); ostrm << setw(4) << hrs << ":"; ostrm...
false
false
false
false
false
0
printGenericOptionDiff( const Option &O, const GenericOptionValue &Value, const GenericOptionValue &Default, size_t GlobalWidth) const { outs() << " -" << O.ArgStr; outs().indent(GlobalWidth - std::strlen(O.ArgStr)); unsigned NumOpts = getNumOptions(); for (unsigned i = 0; i != NumOpts; ++i) { if ...
false
false
false
false
false
0
l_generateJpegData(const char *fname, l_int32 ascii85flag) { l_uint8 *datacomp = NULL; /* entire jpeg compressed file */ char *data85 = NULL; /* ascii85 encoded jpeg compressed file */ l_int32 w, h, xres, yres, bps, spp; l_int32 nbytes85; size_...
false
false
false
false
true
1
store(ObjectStream &s) const { PUT_STRING(s, desc); if (datafile) { uint size = datafile->getSize(); PUT_INT32D(s, size); PUTX_BINARY(s, datafile->getBufPtr(), size, "data"); } else { PUTX_INT32D(s, 0, "size"); } }
false
false
false
false
false
0
repack(int input, int output) { struct pstore_header *new_header; struct pstore_header *old_header; unsigned long ndx; old_header = pstore_header_read(input); new_header = pstore_header_new(); for (ndx = 0; ndx < old_header->nr_tables; ndx++) { struct pstore_table *table = old_header->tables[ndx]; if (rep...
false
false
false
false
false
0
mon_reflects(struct monst *mon, const char *str) { struct obj *orefl = which_armor(mon, W_ARMS); if (orefl && orefl->otyp == SHIELD_OF_REFLECTION) { if (str) { pline(str, s_suffix(mon_nam(mon)), "shield"); makeknown(SHIELD_OF_REFLECTION); } return tru...
false
false
false
false
false
0