idx
int64
func
string
target
int64
446,594
virHostdevIsSCSIDevice(const virDomainHostdevDef *hostdev) { return hostdev->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS && hostdev->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI; }
0
272,960
static int mwifiex_register_dev(struct mwifiex_adapter *adapter) { struct pcie_service_card *card = adapter->card; /* save adapter pointer in card */ card->adapter = adapter; if (mwifiex_pcie_request_irq(adapter)) return -1; adapter->tx_buf_size = card->pcie.tx_buf_size; adapter->mem_type_mapping_tbl = card->pcie.mem_type_mapping_tbl; adapter->num_mem_types = card->pcie.num_mem_types; adapter->ext_scan = card->pcie.can_ext_scan; mwifiex_pcie_get_fw_name(adapter); return 0; }
0
103,078
path_center(PG_FUNCTION_ARGS) { #ifdef NOT_USED PATH *path = PG_GETARG_PATH_P(0); #endif ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("function \"path_center\" not implemented"))); PG_RETURN_NULL(); }
0
363,721
static int __init ip6_tables_init(void) { int ret; ret = register_pernet_subsys(&ip6_tables_net_ops); if (ret < 0) goto err1; /* Noone else will be downing sem now, so we won't sleep */ ret = xt_register_targets(ip6t_builtin_tg, ARRAY_SIZE(ip6t_builtin_tg)); if (ret < 0) goto err2; ret = xt_register_matches(ip6t_builtin_mt, ARRAY_SIZE(ip6t_builtin_mt)); if (ret < 0) goto err4; /* Register setsockopt */ ret = nf_register_sockopt(&ip6t_sockopts); if (ret < 0) goto err5; pr_info("(C) 2000-2006 Netfilter Core Team\n"); return 0; err5: xt_unregister_matches(ip6t_builtin_mt, ARRAY_SIZE(ip6t_builtin_mt)); err4: xt_unregister_targets(ip6t_builtin_tg, ARRAY_SIZE(ip6t_builtin_tg)); err2: unregister_pernet_subsys(&ip6_tables_net_ops); err1: return ret; }
0
201,443
static void RaisesExceptionVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { ExceptionState exception_state(info.GetIsolate(), ExceptionState::kExecutionContext, "TestObject", "raisesExceptionVoidMethod"); TestObject* impl = V8TestObject::ToImpl(info.Holder()); impl->raisesExceptionVoidMethod(exception_state); if (exception_state.HadException()) { return; } }
0
85,616
static int pcrypt_create(struct crypto_template *tmpl, struct rtattr **tb) { struct crypto_attr_type *algt; algt = crypto_get_attr_type(tb); if (IS_ERR(algt)) return PTR_ERR(algt); switch (algt->type & algt->mask & CRYPTO_ALG_TYPE_MASK) { case CRYPTO_ALG_TYPE_AEAD: return pcrypt_create_aead(tmpl, tb, algt->type, algt->mask); } return -EINVAL; }
0
325,360
static void stream_close(VideoState *is) { VideoPicture *vp; int i; /* XXX: use a special url_shutdown call to abort parse cleanly */ is->abort_request = 1; SDL_WaitThread(is->read_tid, NULL); SDL_WaitThread(is->refresh_tid, NULL); packet_queue_destroy(&is->videoq); packet_queue_destroy(&is->audioq); packet_queue_destroy(&is->subtitleq); /* free all pictures */ for (i = 0; i < VIDEO_PICTURE_QUEUE_SIZE; i++) { vp = &is->pictq[i]; #if CONFIG_AVFILTER avfilter_unref_bufferp(&vp->picref); #endif if (vp->bmp) { SDL_FreeYUVOverlay(vp->bmp); vp->bmp = NULL; } } SDL_DestroyMutex(is->pictq_mutex); SDL_DestroyCond(is->pictq_cond); SDL_DestroyMutex(is->subpq_mutex); SDL_DestroyCond(is->subpq_cond); SDL_DestroyCond(is->continue_read_thread); #if !CONFIG_AVFILTER sws_freeContext(is->img_convert_ctx); #endif av_free(is); }
0
267,425
static int hub_set_address(struct usb_device *udev, int devnum) { int retval; struct usb_hcd *hcd = bus_to_hcd(udev->bus); /* * The host controller will choose the device address, * instead of the core having chosen it earlier */ if (!hcd->driver->address_device && devnum <= 1) return -EINVAL; if (udev->state == USB_STATE_ADDRESS) return 0; if (udev->state != USB_STATE_DEFAULT) return -EINVAL; if (hcd->driver->address_device) retval = hcd->driver->address_device(hcd, udev); else retval = usb_control_msg(udev, usb_sndaddr0pipe(), USB_REQ_SET_ADDRESS, 0, devnum, 0, NULL, 0, USB_CTRL_SET_TIMEOUT); if (retval == 0) { update_devnum(udev, devnum); /* Device now using proper address. */ usb_set_device_state(udev, USB_STATE_ADDRESS); usb_ep0_reinit(udev); } return retval; }
0
495,336
static void SFS_DecIndent(ScriptParser *pars) { pars->indent--; }
0
462,976
TEST(EqOp, Equality1) { EqualityMatchExpression eq1; EqualityMatchExpression eq2; EqualityMatchExpression eq3; BSONObj operand = BSON("a" << 5 << "b" << 5 << "c" << 4); eq1.init("a", operand["a"]).transitional_ignore(); eq2.init("a", operand["b"]).transitional_ignore(); eq3.init("c", operand["c"]).transitional_ignore(); ASSERT(eq1.equivalent(&eq1)); ASSERT(eq1.equivalent(&eq2)); ASSERT(!eq1.equivalent(&eq3)); }
0
398,308
void js_pushnull(js_State *J) { CHECKSTACK(1); STACK[TOP].type = JS_TNULL; ++TOP; }
0
81,078
void CL_ForwardCommandToServer( void ) { const char *cmd; char string[MAX_STRING_CHARS]; cmd = Cmd_Argv(0); // ignore key up commands if ( cmd[0] == '-' ) { return; } if ( cls.state != CA_ACTIVE || cmd[0] == '+' ) { Com_Printf ("Unknown command \"%s\"\n", cmd); return; } if ( Cmd_Argc() > 1 ) { Com_sprintf( string, sizeof(string), "%s %s", cmd, Cmd_Args() ); } else { Q_strncpyz( string, cmd, sizeof(string) ); } CL_AddReliableCommand( string ); }
0
293,551
unpeer_name_resolved( int rescode, int gai_errno, void * context, const char * name, const char * service, const struct addrinfo * hints, const struct addrinfo * res ) { sockaddr_u peeraddr; struct peer * peer; u_short af; const char * fam_spec; DPRINTF(1, ("unpeer_name_resolved(%s) rescode %d\n", name, rescode)); if (rescode) { msyslog(LOG_ERR, "giving up resolving unpeer %s: %s (%d)", name, gai_strerror(rescode), rescode); return; } /* * Loop through the addresses found */ for (; res != NULL; res = res->ai_next) { NTP_INSIST(res->ai_addrlen <= sizeof(peeraddr)); memcpy(&peeraddr, res->ai_addr, res->ai_addrlen); DPRINTF(1, ("unpeer: searching for peer %s\n", stoa(&peeraddr))); peer = findexistingpeer(&peeraddr, NULL, NULL, -1); if (peer != NULL) { af = AF(&peeraddr); fam_spec = (AF_INET6 == af) ? "(AAAA) " : (AF_INET == af) ? "(A) " : ""; msyslog(LOG_NOTICE, "unpeered %s %s-> %s", name, fam_spec, stoa(&peeraddr)); peer_clear(peer, "GONE"); unpeer(peer); } } }
0
457,634
static unsigned long rings_size(unsigned sq_entries, unsigned cq_entries, size_t *sq_offset) { struct io_rings *rings; size_t off, sq_array_size; off = struct_size(rings, cqes, cq_entries); if (off == SIZE_MAX) return SIZE_MAX; #ifdef CONFIG_SMP off = ALIGN(off, SMP_CACHE_BYTES); if (off == 0) return SIZE_MAX; #endif if (sq_offset) *sq_offset = off; sq_array_size = array_size(sizeof(u32), sq_entries); if (sq_array_size == SIZE_MAX) return SIZE_MAX; if (check_add_overflow(off, sq_array_size, &off)) return SIZE_MAX; return off; }
0
175,486
ContentClient* RenderViewTest::CreateContentClient() { return new TestContentClient; }
0
382,481
log_disconnections(int code, Datum arg) { Port *port = MyProcPort; long secs; int usecs; int msecs; int hours, minutes, seconds; TimestampDifference(port->SessionStartTime, GetCurrentTimestamp(), &secs, &usecs); msecs = usecs / 1000; hours = secs / SECS_PER_HOUR; secs %= SECS_PER_HOUR; minutes = secs / SECS_PER_MINUTE; seconds = secs % SECS_PER_MINUTE; ereport(LOG, (errmsg("disconnection: session time: %d:%02d:%02d.%03d " "user=%s database=%s host=%s%s%s", hours, minutes, seconds, msecs, port->user_name, port->database_name, port->remote_host, port->remote_port[0] ? " port=" : "", port->remote_port))); }
0
319,512
static void qmp_output_type_number(Visitor *v, const char *name, double *obj, Error **errp) { QmpOutputVisitor *qov = to_qov(v); qmp_output_add(qov, name, qfloat_from_double(*obj)); }
0
422,295
ews_delegate_info_free (EwsDelegateInfo *info) { if (!info) return; ews_user_id_free (info->user_id); g_free (info); }
0
185,563
SProcXFixesGetCursorImage(ClientPtr client) { REQUEST(xXFixesGetCursorImageReq); swaps(&stuff->length); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); }
0
460,005
hfinfo_char_value_format_display(int display, char buf[7], guint32 value) { char *ptr = &buf[6]; static const gchar hex_digits[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' }; *ptr = '\0'; *(--ptr) = '\''; /* Properly format value */ if (g_ascii_isprint(value)) { /* * Printable, so just show the character, and, if it needs * to be escaped, escape it. */ *(--ptr) = value; if (value == '\\' || value == '\'') *(--ptr) = '\\'; } else { /* * Non-printable; show it as an escape sequence. */ switch (value) { case '\0': /* * Show a NUL with only one digit. */ *(--ptr) = '0'; break; case '\a': *(--ptr) = 'a'; break; case '\b': *(--ptr) = 'b'; break; case '\f': *(--ptr) = 'f'; break; case '\n': *(--ptr) = 'n'; break; case '\r': *(--ptr) = 'r'; break; case '\t': *(--ptr) = 't'; break; case '\v': *(--ptr) = 'v'; break; default: switch (FIELD_DISPLAY(display)) { case BASE_OCT: *(--ptr) = (value & 0x7) + '0'; value >>= 3; *(--ptr) = (value & 0x7) + '0'; value >>= 3; *(--ptr) = (value & 0x7) + '0'; break; case BASE_HEX: *(--ptr) = hex_digits[value & 0x0F]; value >>= 4; *(--ptr) = hex_digits[value & 0x0F]; *(--ptr) = 'x'; break; default: g_assert_not_reached(); } } *(--ptr) = '\\'; } *(--ptr) = '\''; return ptr; }
0
155,841
QPDFObjectHandle::unparseResolved() { if (this->reserved) { throw std::logic_error( "QPDFObjectHandle: attempting to unparse a reserved object"); } dereference(); return this->obj->unparse(); }
0
390,150
void SSL_set_quiet_shutdown(SSL *ssl,int mode) { ssl->SetQuietShutdown(mode != 0); }
0
429,822
uint_t aubio_onset_set_delay(aubio_onset_t * o, uint_t delay) { o->delay = delay; return AUBIO_OK; }
0
290,558
static int newque(struct ipc_namespace *ns, struct ipc_params *params) { struct msg_queue *msq; int id, retval; key_t key = params->key; int msgflg = params->flg; msq = ipc_rcu_alloc(sizeof(*msq)); if (!msq) return -ENOMEM; msq->q_perm.mode = msgflg & S_IRWXUGO; msq->q_perm.key = key; msq->q_perm.security = NULL; retval = security_msg_queue_alloc(msq); if (retval) { ipc_rcu_putref(msq, ipc_rcu_free); return retval; } msq->q_stime = msq->q_rtime = 0; msq->q_ctime = get_seconds(); msq->q_cbytes = msq->q_qnum = 0; msq->q_qbytes = ns->msg_ctlmnb; msq->q_lspid = msq->q_lrpid = 0; INIT_LIST_HEAD(&msq->q_messages); INIT_LIST_HEAD(&msq->q_receivers); INIT_LIST_HEAD(&msq->q_senders); /* ipc_addid() locks msq upon success. */ id = ipc_addid(&msg_ids(ns), &msq->q_perm, ns->msg_ctlmni); if (id < 0) { ipc_rcu_putref(msq, msg_rcu_free); return id; } ipc_unlock_object(&msq->q_perm); rcu_read_unlock(); return msq->q_perm.id; }
0
23,932
Jbig2WordStream * jbig2_word_stream_buf_new ( Jbig2Ctx * ctx , const byte * data , size_t size ) { Jbig2WordStreamBuf * result = jbig2_new ( ctx , Jbig2WordStreamBuf , 1 ) ; if ( result == NULL ) { jbig2_error ( ctx , JBIG2_SEVERITY_FATAL , - 1 , "failed to allocate Jbig2WordStreamBuf in jbig2_word_stream_buf_new" ) ; return NULL ; } result -> super . get_next_word = jbig2_word_stream_buf_get_next_word ; result -> data = data ; result -> size = size ; return & result -> super ; }
0
457,242
proxy_C_SignRecoverInit (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE handle, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key) { State *state = (State *)self; Mapping map; CK_RV rv; rv = map_session_to_real (state->px, &handle, &map, NULL); if (rv != CKR_OK) return rv; return (map.funcs->C_SignRecoverInit) (handle, mechanism, key); }
0
300,662
void CjfifDecode::AddHeader(unsigned nCode) { CString strTmp; switch(nCode) { case JFIF_SOI: m_pLog->AddLineHdr(_T("*** Marker: SOI (xFFD8) ***")); break; case JFIF_APP0: m_pLog->AddLineHdr(_T("*** Marker: APP0 (xFFE0) ***")); break; case JFIF_APP1: m_pLog->AddLineHdr(_T("*** Marker: APP1 (xFFE1) ***")); break; case JFIF_APP2: m_pLog->AddLineHdr(_T("*** Marker: APP2 (xFFE2) ***")); break; case JFIF_APP3: m_pLog->AddLineHdr(_T("*** Marker: APP3 (xFFE3) ***")); break; case JFIF_APP4: m_pLog->AddLineHdr(_T("*** Marker: APP4 (xFFE4) ***")); break; case JFIF_APP5: m_pLog->AddLineHdr(_T("*** Marker: APP5 (xFFE5) ***")); break; case JFIF_APP6: m_pLog->AddLineHdr(_T("*** Marker: APP6 (xFFE6) ***")); break; case JFIF_APP7: m_pLog->AddLineHdr(_T("*** Marker: APP7 (xFFE7) ***")); break; case JFIF_APP8: m_pLog->AddLineHdr(_T("*** Marker: APP8 (xFFE8) ***")); break; case JFIF_APP9: m_pLog->AddLineHdr(_T("*** Marker: APP9 (xFFE9) ***")); break; case JFIF_APP10: m_pLog->AddLineHdr(_T("*** Marker: APP10 (xFFEA) ***")); break; case JFIF_APP11: m_pLog->AddLineHdr(_T("*** Marker: APP11 (xFFEB) ***")); break; case JFIF_APP12: m_pLog->AddLineHdr(_T("*** Marker: APP12 (xFFEC) ***")); break; case JFIF_APP13: m_pLog->AddLineHdr(_T("*** Marker: APP13 (xFFED) ***")); break; case JFIF_APP14: m_pLog->AddLineHdr(_T("*** Marker: APP14 (xFFEE) ***")); break; case JFIF_APP15: m_pLog->AddLineHdr(_T("*** Marker: APP15 (xFFEF) ***")); break; case JFIF_SOF0: m_pLog->AddLineHdr(_T("*** Marker: SOF0 (Baseline DCT) (xFFC0) ***")); break; case JFIF_SOF1: m_pLog->AddLineHdr(_T("*** Marker: SOF1 (Extended Sequential DCT, Huffman) (xFFC1) ***")); break; case JFIF_SOF2: m_pLog->AddLineHdr(_T("*** Marker: SOF2 (Progressive DCT, Huffman) (xFFC2) ***")); break; case JFIF_SOF3: m_pLog->AddLineHdr(_T("*** Marker: SOF3 (Lossless Process, Huffman) (xFFC3) ***")); break; case JFIF_SOF5: m_pLog->AddLineHdr(_T("*** Marker: SOF5 (Differential Sequential DCT, Huffman) (xFFC4) ***")); break; case JFIF_SOF6: m_pLog->AddLineHdr(_T("*** Marker: SOF6 (Differential Progressive DCT, Huffman) (xFFC5) ***")); break; case JFIF_SOF7: m_pLog->AddLineHdr(_T("*** Marker: SOF7 (Differential Lossless Process, Huffman) (xFFC6) ***")); break; case JFIF_SOF9: m_pLog->AddLineHdr(_T("*** Marker: SOF9 (Sequential DCT, Arithmetic) (xFFC9) ***")); break; case JFIF_SOF10: m_pLog->AddLineHdr(_T("*** Marker: SOF10 (Progressive DCT, Arithmetic) (xFFCA) ***")); break; case JFIF_SOF11: m_pLog->AddLineHdr(_T("*** Marker: SOF11 (Lossless Process, Arithmetic) (xFFCB) ***")); break; case JFIF_SOF13: m_pLog->AddLineHdr(_T("*** Marker: SOF13 (Differential Sequential, Arithmetic) (xFFCD) ***")); break; case JFIF_SOF14: m_pLog->AddLineHdr(_T("*** Marker: SOF14 (Differential Progressive DCT, Arithmetic) (xFFCE) ***")); break; case JFIF_SOF15: m_pLog->AddLineHdr(_T("*** Marker: SOF15 (Differential Lossless Process, Arithmetic) (xFFCF) ***")); break; case JFIF_JPG: m_pLog->AddLineHdr(_T("*** Marker: JPG (xFFC8) ***")); break; case JFIF_DAC: m_pLog->AddLineHdr(_T("*** Marker: DAC (xFFCC) ***")); break; case JFIF_RST0: case JFIF_RST1: case JFIF_RST2: case JFIF_RST3: case JFIF_RST4: case JFIF_RST5: case JFIF_RST6: case JFIF_RST7: m_pLog->AddLineHdr(_T("*** Marker: RST# ***")); break; case JFIF_DQT: // Define quantization tables m_pLog->AddLineHdr(_T("*** Marker: DQT (xFFDB) ***")); m_pLog->AddLineHdrDesc(_T(" Define a Quantization Table.")); break; case JFIF_COM: // COM m_pLog->AddLineHdr(_T("*** Marker: COM (Comment) (xFFFE) ***")); break; case JFIF_DHT: // DHT m_pLog->AddLineHdr(_T("*** Marker: DHT (Define Huffman Table) (xFFC4) ***")); break; case JFIF_DHT_FAKE: // DHT from standard table (MotionJPEG) m_pLog->AddLineHdr(_T("*** Marker: DHT from MotionJPEG standard (Define Huffman Table) ***")); break; case JFIF_SOS: // SOS m_pLog->AddLineHdr(_T("*** Marker: SOS (Start of Scan) (xFFDA) ***")); break; case JFIF_DRI: // DRI m_pLog->AddLineHdr(_T("*** Marker: DRI (Restart Interval) (xFFDD) ***")); break; case JFIF_EOI: // EOI m_pLog->AddLineHdr(_T("*** Marker: EOI (End of Image) (xFFD9) ***")); break; case JFIF_DNL: m_pLog->AddLineHdr(_T("*** Marker: DNL (Define Number of Lines) (xFFDC) ***")); break; case JFIF_DHP: m_pLog->AddLineHdr(_T("*** Marker: DHP (Define Hierarchical Progression) (xFFDE) ***")); break; case JFIF_EXP: m_pLog->AddLineHdr(_T("*** Marker: EXP (Expand Reference Components) (xFFDF) ***")); break; case JFIF_JPG0: m_pLog->AddLineHdr(_T("*** Marker: JPG0 (JPEG Extension) (xFFF0) ***")); break; case JFIF_JPG1: m_pLog->AddLineHdr(_T("*** Marker: JPG1 (JPEG Extension) (xFFF1) ***")); break; case JFIF_JPG2: m_pLog->AddLineHdr(_T("*** Marker: JPG2 (JPEG Extension) (xFFF2) ***")); break; case JFIF_JPG3: m_pLog->AddLineHdr(_T("*** Marker: JPG3 (JPEG Extension) (xFFF3) ***")); break; case JFIF_JPG4: m_pLog->AddLineHdr(_T("*** Marker: JPG4 (JPEG Extension) (xFFF4) ***")); break; case JFIF_JPG5: m_pLog->AddLineHdr(_T("*** Marker: JPG5 (JPEG Extension) (xFFF5) ***")); break; case JFIF_JPG6: m_pLog->AddLineHdr(_T("*** Marker: JPG6 (JPEG Extension) (xFFF6) ***")); break; case JFIF_JPG7: m_pLog->AddLineHdr(_T("*** Marker: JPG7 (JPEG Extension) (xFFF7) ***")); break; case JFIF_JPG8: m_pLog->AddLineHdr(_T("*** Marker: JPG8 (JPEG Extension) (xFFF8) ***")); break; case JFIF_JPG9: m_pLog->AddLineHdr(_T("*** Marker: JPG9 (JPEG Extension) (xFFF9) ***")); break; case JFIF_JPG10: m_pLog->AddLineHdr(_T("*** Marker: JPG10 (JPEG Extension) (xFFFA) ***")); break; case JFIF_JPG11: m_pLog->AddLineHdr(_T("*** Marker: JPG11 (JPEG Extension) (xFFFB) ***")); break; case JFIF_JPG12: m_pLog->AddLineHdr(_T("*** Marker: JPG12 (JPEG Extension) (xFFFC) ***")); break; case JFIF_JPG13: m_pLog->AddLineHdr(_T("*** Marker: JPG13 (JPEG Extension) (xFFFD) ***")); break; case JFIF_TEM: m_pLog->AddLineHdr(_T("*** Marker: TEM (Temporary) (xFF01) ***")); break; default: strTmp.Format(_T("*** Marker: ??? (Unknown) (xFF%02X) ***"),nCode); m_pLog->AddLineHdr(strTmp); break; } // Adjust position to account for the word used in decoding the marker! strTmp.Format(_T(" OFFSET: 0x%08X"),m_nPos-2); m_pLog->AddLine(strTmp); }
0
412,081
struct buffer_head *ext4_bread(handle_t *handle, struct inode *inode, ext4_lblk_t block, int map_flags) { struct buffer_head *bh; bh = ext4_getblk(handle, inode, block, map_flags); if (IS_ERR(bh)) return bh; if (!bh || buffer_uptodate(bh)) return bh; ll_rw_block(REQ_OP_READ, REQ_META | REQ_PRIO, 1, &bh); wait_on_buffer(bh); if (buffer_uptodate(bh)) return bh; put_bh(bh); return ERR_PTR(-EIO); }
0
132,552
int luaD_pcall (lua_State *L, Pfunc func, void *u, ptrdiff_t old_top, ptrdiff_t ef) { int status; CallInfo *old_ci = L->ci; lu_byte old_allowhooks = L->allowhook; ptrdiff_t old_errfunc = L->errfunc; L->errfunc = ef; status = luaD_rawrunprotected(L, func, u); if (unlikely(status != LUA_OK)) { /* an error occurred? */ StkId oldtop = restorestack(L, old_top); L->ci = old_ci; L->allowhook = old_allowhooks; status = luaF_close(L, oldtop, status); oldtop = restorestack(L, old_top); /* previous call may change stack */ luaD_seterrorobj(L, status, oldtop); luaD_shrinkstack(L); } L->errfunc = old_errfunc; return status; }
0
334,304
static void ir2_decode_plane_inter(Ir2Context *ctx, int width, int height, uint8_t *dst, int stride, const uint8_t *table) { int j; int out = 0; int c; int t; for (j = 0; j < height; j++){ out = 0; while (out < width){ c = ir2_get_code(&ctx->gb); if(c > 0x80) { /* we have a skip */ c -= 0x80; out += c * 2; } else { /* add two deltas from table */ t = dst[out] + (table[c * 2] - 128); CLAMP_TO_BYTE(t); dst[out] = t; out++; t = dst[out] + (table[(c * 2) + 1] - 128); CLAMP_TO_BYTE(t); dst[out] = t; out++; } } dst += stride; } }
1
90,345
static HashTable* spl_array_get_debug_info(zval *obj, int *is_temp TSRMLS_DC) /* {{{ */ { spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(obj TSRMLS_CC); zval *tmp, *storage; int name_len; char *zname; zend_class_entry *base; *is_temp = 0; if (!intern->std.properties) { rebuild_object_properties(&intern->std); } if (HASH_OF(intern->array) == intern->std.properties) { return intern->std.properties; } else { if (intern->debug_info == NULL) { ALLOC_HASHTABLE(intern->debug_info); ZEND_INIT_SYMTABLE_EX(intern->debug_info, zend_hash_num_elements(intern->std.properties) + 1, 0); } if (intern->debug_info->nApplyCount == 0) { zend_hash_clean(intern->debug_info); zend_hash_copy(intern->debug_info, intern->std.properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *)); storage = intern->array; zval_add_ref(&storage); base = (Z_OBJ_HT_P(obj) == &spl_handler_ArrayIterator) ? spl_ce_ArrayIterator : spl_ce_ArrayObject; zname = spl_gen_private_prop_name(base, "storage", sizeof("storage")-1, &name_len TSRMLS_CC); zend_symtable_update(intern->debug_info, zname, name_len+1, &storage, sizeof(zval *), NULL); efree(zname); } return intern->debug_info; } }
0
189,917
bool GLES2DecoderImpl::ValidateRenderbufferStorageMultisampleAMD( GLsizei samples, GLsizei storageSamples, GLenum internalformat, GLsizei width, GLsizei height) { if (samples > renderbuffer_manager()->max_samples()) { LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "glRenderbufferStorageMultisample", "samples too large"); return false; } if (width > renderbuffer_manager()->max_renderbuffer_size() || height > renderbuffer_manager()->max_renderbuffer_size()) { LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "glRenderbufferStorageMultisample", "dimensions too large"); return false; } uint32_t estimated_size = 0; if (!renderbuffer_manager()->ComputeEstimatedRenderbufferSize( width, height, samples, internalformat, &estimated_size)) { LOCAL_SET_GL_ERROR(GL_OUT_OF_MEMORY, "glRenderbufferStorageMultisample", "dimensions too large"); return false; } return true; }
0
186,959
SitePerProcessIgnoreCertErrorsBrowserTest() {}
0
13,334
static X509_ALGOR *rsa_mgf1_decode(X509_ALGOR *alg) { const unsigned char *p; int plen; if (alg == NULL) return NULL; if (OBJ_obj2nid(alg->algorithm) != NID_mgf1) return NULL; if (alg->parameter->type != V_ASN1_SEQUENCE) return NULL; p = alg->parameter->value.sequence->data; plen = alg->parameter->value.sequence->length; return d2i_X509_ALGOR(NULL, &p, plen); }
1
4,546
static Image *ReadSGIImage(const ImageInfo *image_info,ExceptionInfo *exception) { Image *image; MagickBooleanType status; MagickSizeType number_pixels; MemoryInfo *pixel_info; register Quantum *q; register ssize_t i, x; register unsigned char *p; SGIInfo iris_info; size_t bytes_per_pixel, quantum; ssize_t count, y, z; unsigned char *pixels; /* Open image file. */ assert(image_info != (const ImageInfo *) NULL); assert(image_info->signature == MagickCoreSignature); if (image_info->debug != MagickFalse) (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s", image_info->filename); assert(exception != (ExceptionInfo *) NULL); assert(exception->signature == MagickCoreSignature); image=AcquireImage(image_info,exception); status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception); if (status == MagickFalse) { image=DestroyImageList(image); return((Image *) NULL); } /* Read SGI raster header. */ iris_info.magic=ReadBlobMSBShort(image); do { /* Verify SGI identifier. */ if (iris_info.magic != 0x01DA) ThrowReaderException(CorruptImageError,"ImproperImageHeader"); iris_info.storage=(unsigned char) ReadBlobByte(image); switch (iris_info.storage) { case 0x00: image->compression=NoCompression; break; case 0x01: image->compression=RLECompression; break; default: ThrowReaderException(CorruptImageError,"ImproperImageHeader"); } iris_info.bytes_per_pixel=(unsigned char) ReadBlobByte(image); if ((iris_info.bytes_per_pixel == 0) || (iris_info.bytes_per_pixel > 2)) ThrowReaderException(CorruptImageError,"ImproperImageHeader"); iris_info.dimension=ReadBlobMSBShort(image); iris_info.columns=ReadBlobMSBShort(image); iris_info.rows=ReadBlobMSBShort(image); iris_info.depth=ReadBlobMSBShort(image); if ((iris_info.depth == 0) || (iris_info.depth > 4)) ThrowReaderException(CorruptImageError,"ImproperImageHeader"); iris_info.minimum_value=ReadBlobMSBLong(image); iris_info.maximum_value=ReadBlobMSBLong(image); iris_info.sans=ReadBlobMSBLong(image); (void) ReadBlob(image,sizeof(iris_info.name),(unsigned char *) iris_info.name); iris_info.name[sizeof(iris_info.name)-1]='\0'; if (*iris_info.name != '\0') (void) SetImageProperty(image,"label",iris_info.name,exception); iris_info.pixel_format=ReadBlobMSBLong(image); if (iris_info.pixel_format != 0) ThrowReaderException(CorruptImageError,"ImproperImageHeader"); count=ReadBlob(image,sizeof(iris_info.filler),iris_info.filler); (void) count; image->columns=iris_info.columns; image->rows=iris_info.rows; image->depth=(size_t) MagickMin(iris_info.depth,MAGICKCORE_QUANTUM_DEPTH); if (iris_info.pixel_format == 0) image->depth=(size_t) MagickMin((size_t) 8*iris_info.bytes_per_pixel, MAGICKCORE_QUANTUM_DEPTH); if (iris_info.depth < 3) { image->storage_class=PseudoClass; image->colors=iris_info.bytes_per_pixel > 1 ? 65535 : 256; } if (EOFBlob(image) != MagickFalse) ThrowReaderException(CorruptImageError,"ImproperImageHeader"); if ((image_info->ping != MagickFalse) && (image_info->number_scenes != 0)) if (image->scene >= (image_info->scene+image_info->number_scenes-1)) break; status=SetImageExtent(image,image->columns,image->rows,exception); if (status == MagickFalse) return(DestroyImageList(image)); /* Allocate SGI pixels. */ bytes_per_pixel=(size_t) iris_info.bytes_per_pixel; number_pixels=(MagickSizeType) iris_info.columns*iris_info.rows; if ((4*bytes_per_pixel*number_pixels) != ((MagickSizeType) (size_t) (4*bytes_per_pixel*number_pixels))) ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); pixel_info=AcquireVirtualMemory(iris_info.columns,iris_info.rows*4* bytes_per_pixel*sizeof(*pixels)); if (pixel_info == (MemoryInfo *) NULL) ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); pixels=(unsigned char *) GetVirtualMemoryBlob(pixel_info); if ((int) iris_info.storage != 0x01) { unsigned char *scanline; /* Read standard image format. */ scanline=(unsigned char *) AcquireQuantumMemory(iris_info.columns, bytes_per_pixel*sizeof(*scanline)); if (scanline == (unsigned char *) NULL) ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); for (z=0; z < (ssize_t) iris_info.depth; z++) { p=pixels+bytes_per_pixel*z; for (y=0; y < (ssize_t) iris_info.rows; y++) { count=ReadBlob(image,bytes_per_pixel*iris_info.columns,scanline); if (EOFBlob(image) != MagickFalse) break; if (bytes_per_pixel == 2) for (x=0; x < (ssize_t) iris_info.columns; x++) { *p=scanline[2*x]; *(p+1)=scanline[2*x+1]; p+=8; } else for (x=0; x < (ssize_t) iris_info.columns; x++) { *p=scanline[x]; p+=4; } } } scanline=(unsigned char *) RelinquishMagickMemory(scanline); } else { MemoryInfo *packet_info; size_t *runlength; ssize_t offset, *offsets; unsigned char *packets; unsigned int data_order; /* Read runlength-encoded image format. */ offsets=(ssize_t *) AcquireQuantumMemory((size_t) iris_info.rows, iris_info.depth*sizeof(*offsets)); runlength=(size_t *) AcquireQuantumMemory(iris_info.rows, iris_info.depth*sizeof(*runlength)); packet_info=AcquireVirtualMemory((size_t) iris_info.columns+10UL,4UL* sizeof(*packets)); if ((offsets == (ssize_t *) NULL) || (runlength == (size_t *) NULL) || (packet_info == (MemoryInfo *) NULL)) { if (offsets == (ssize_t *) NULL) offsets=(ssize_t *) RelinquishMagickMemory(offsets); if (runlength == (size_t *) NULL) runlength=(size_t *) RelinquishMagickMemory(runlength); if (packet_info == (MemoryInfo *) NULL) packet_info=RelinquishVirtualMemory(packet_info); ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); } packets=(unsigned char *) GetVirtualMemoryBlob(packet_info); for (i=0; i < (ssize_t) (iris_info.rows*iris_info.depth); i++) offsets[i]=ReadBlobMSBSignedLong(image); for (i=0; i < (ssize_t) (iris_info.rows*iris_info.depth); i++) { runlength[i]=ReadBlobMSBLong(image); if (runlength[i] > (4*(size_t) iris_info.columns+10)) ThrowReaderException(CorruptImageError,"ImproperImageHeader"); } /* Check data order. */ offset=0; data_order=0; for (y=0; ((y < (ssize_t) iris_info.rows) && (data_order == 0)); y++) for (z=0; ((z < (ssize_t) iris_info.depth) && (data_order == 0)); z++) { if (offsets[y+z*iris_info.rows] < offset) data_order=1; offset=offsets[y+z*iris_info.rows]; } offset=(ssize_t) TellBlob(image); if (data_order == 1) { for (z=0; z < (ssize_t) iris_info.depth; z++) { p=pixels; for (y=0; y < (ssize_t) iris_info.rows; y++) { if (offset != offsets[y+z*iris_info.rows]) { offset=offsets[y+z*iris_info.rows]; offset=(ssize_t) SeekBlob(image,(ssize_t) offset,SEEK_SET); } count=ReadBlob(image,(size_t) runlength[y+z*iris_info.rows], packets); if (EOFBlob(image) != MagickFalse) break; offset+=(ssize_t) runlength[y+z*iris_info.rows]; status=SGIDecode(bytes_per_pixel,(ssize_t) (runlength[y+z*iris_info.rows]/bytes_per_pixel),packets, 1L*iris_info.columns,p+bytes_per_pixel*z); if (status == MagickFalse) ThrowReaderException(CorruptImageError,"ImproperImageHeader"); p+=(iris_info.columns*4*bytes_per_pixel); } } } else { MagickOffsetType position; position=TellBlob(image); p=pixels; for (y=0; y < (ssize_t) iris_info.rows; y++) { for (z=0; z < (ssize_t) iris_info.depth; z++) { if (offset != offsets[y+z*iris_info.rows]) { offset=offsets[y+z*iris_info.rows]; offset=(ssize_t) SeekBlob(image,(ssize_t) offset,SEEK_SET); } count=ReadBlob(image,(size_t) runlength[y+z*iris_info.rows], packets); if (EOFBlob(image) != MagickFalse) break; offset+=(ssize_t) runlength[y+z*iris_info.rows]; status=SGIDecode(bytes_per_pixel,(ssize_t) (runlength[y+z*iris_info.rows]/bytes_per_pixel),packets, 1L*iris_info.columns,p+bytes_per_pixel*z); if (status == MagickFalse) ThrowReaderException(CorruptImageError,"ImproperImageHeader"); } p+=(iris_info.columns*4*bytes_per_pixel); } offset=(ssize_t) SeekBlob(image,position,SEEK_SET); } packet_info=RelinquishVirtualMemory(packet_info); runlength=(size_t *) RelinquishMagickMemory(runlength); offsets=(ssize_t *) RelinquishMagickMemory(offsets); } /* Initialize image structure. */ image->alpha_trait=iris_info.depth == 4 ? BlendPixelTrait : UndefinedPixelTrait; image->columns=iris_info.columns; image->rows=iris_info.rows; /* Convert SGI raster image to pixel packets. */ if (image->storage_class == DirectClass) { /* Convert SGI image to DirectClass pixel packets. */ if (bytes_per_pixel == 2) { for (y=0; y < (ssize_t) image->rows; y++) { p=pixels+(image->rows-y-1)*8*image->columns; q=QueueAuthenticPixels(image,0,y,image->columns,1,exception); if (q == (Quantum *) NULL) break; for (x=0; x < (ssize_t) image->columns; x++) { SetPixelRed(image,ScaleShortToQuantum((unsigned short) ((*(p+0) << 8) | (*(p+1)))),q); SetPixelGreen(image,ScaleShortToQuantum((unsigned short) ((*(p+2) << 8) | (*(p+3)))),q); SetPixelBlue(image,ScaleShortToQuantum((unsigned short) ((*(p+4) << 8) | (*(p+5)))),q); SetPixelAlpha(image,OpaqueAlpha,q); if (image->alpha_trait != UndefinedPixelTrait) SetPixelAlpha(image,ScaleShortToQuantum((unsigned short) ((*(p+6) << 8) | (*(p+7)))),q); p+=8; q+=GetPixelChannels(image); } if (SyncAuthenticPixels(image,exception) == MagickFalse) break; if (image->previous == (Image *) NULL) { status=SetImageProgress(image,LoadImageTag,(MagickOffsetType) y,image->rows); if (status == MagickFalse) break; } } } else for (y=0; y < (ssize_t) image->rows; y++) { p=pixels+(image->rows-y-1)*4*image->columns; q=QueueAuthenticPixels(image,0,y,image->columns,1,exception); if (q == (Quantum *) NULL) break; for (x=0; x < (ssize_t) image->columns; x++) { SetPixelRed(image,ScaleCharToQuantum(*p),q); SetPixelGreen(image,ScaleCharToQuantum(*(p+1)),q); SetPixelBlue(image,ScaleCharToQuantum(*(p+2)),q); SetPixelAlpha(image,OpaqueAlpha,q); if (image->alpha_trait != UndefinedPixelTrait) SetPixelAlpha(image,ScaleCharToQuantum(*(p+3)),q); p+=4; q+=GetPixelChannels(image); } if (SyncAuthenticPixels(image,exception) == MagickFalse) break; if (image->previous == (Image *) NULL) { status=SetImageProgress(image,LoadImageTag,(MagickOffsetType) y, image->rows); if (status == MagickFalse) break; } } } else { /* Create grayscale map. */ if (AcquireImageColormap(image,image->colors,exception) == MagickFalse) ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); /* Convert SGI image to PseudoClass pixel packets. */ if (bytes_per_pixel == 2) { for (y=0; y < (ssize_t) image->rows; y++) { p=pixels+(image->rows-y-1)*8*image->columns; q=QueueAuthenticPixels(image,0,y,image->columns,1,exception); if (q == (Quantum *) NULL) break; for (x=0; x < (ssize_t) image->columns; x++) { quantum=(*p << 8); quantum|=(*(p+1)); SetPixelIndex(image,(Quantum) quantum,q); p+=8; q+=GetPixelChannels(image); } if (SyncAuthenticPixels(image,exception) == MagickFalse) break; if (image->previous == (Image *) NULL) { status=SetImageProgress(image,LoadImageTag,(MagickOffsetType) y,image->rows); if (status == MagickFalse) break; } } } else for (y=0; y < (ssize_t) image->rows; y++) { p=pixels+(image->rows-y-1)*4*image->columns; q=QueueAuthenticPixels(image,0,y,image->columns,1,exception); if (q == (Quantum *) NULL) break; for (x=0; x < (ssize_t) image->columns; x++) { SetPixelIndex(image,*p,q); p+=4; q+=GetPixelChannels(image); } if (SyncAuthenticPixels(image,exception) == MagickFalse) break; if (image->previous == (Image *) NULL) { status=SetImageProgress(image,LoadImageTag,(MagickOffsetType) y, image->rows); if (status == MagickFalse) break; } } (void) SyncImage(image,exception); } pixel_info=RelinquishVirtualMemory(pixel_info); if (EOFBlob(image) != MagickFalse) { ThrowFileException(exception,CorruptImageError,"UnexpectedEndOfFile", image->filename); break; } /* Proceed to next image. */ if (image_info->number_scenes != 0) if (image->scene >= (image_info->scene+image_info->number_scenes-1)) break; iris_info.magic=ReadBlobMSBShort(image); if (iris_info.magic == 0x01DA) { /* Allocate next image structure. */ AcquireNextImage(image_info,image,exception); if (GetNextImageInList(image) == (Image *) NULL) { image=DestroyImageList(image); return((Image *) NULL); } image=SyncNextImageInList(image); status=SetImageProgress(image,LoadImagesTag,TellBlob(image), GetBlobSize(image)); if (status == MagickFalse) break; } } while (iris_info.magic == 0x01DA); (void) CloseBlob(image); return(GetFirstImageInList(image)); }
1
484,240
mlx5_select_tx_function(struct rte_eth_dev *dev) { struct mlx5_priv *priv = dev->data->dev_private; struct mlx5_dev_config *config = &priv->config; uint64_t tx_offloads = dev->data->dev_conf.txmode.offloads; unsigned int diff = 0, olx = 0, i, m; static_assert(MLX5_WQE_SIZE_MAX / MLX5_WSEG_SIZE <= MLX5_DSEG_MAX, "invalid WQE max size"); static_assert(MLX5_WQE_CSEG_SIZE == MLX5_WSEG_SIZE, "invalid WQE Control Segment size"); static_assert(MLX5_WQE_ESEG_SIZE == MLX5_WSEG_SIZE, "invalid WQE Ethernet Segment size"); static_assert(MLX5_WQE_DSEG_SIZE == MLX5_WSEG_SIZE, "invalid WQE Data Segment size"); static_assert(MLX5_WQE_SIZE == 4 * MLX5_WSEG_SIZE, "invalid WQE size"); assert(priv); if (tx_offloads & DEV_TX_OFFLOAD_MULTI_SEGS) { /* We should support Multi-Segment Packets. */ olx |= MLX5_TXOFF_CONFIG_MULTI; } if (tx_offloads & (DEV_TX_OFFLOAD_TCP_TSO | DEV_TX_OFFLOAD_VXLAN_TNL_TSO | DEV_TX_OFFLOAD_GRE_TNL_TSO | DEV_TX_OFFLOAD_IP_TNL_TSO | DEV_TX_OFFLOAD_UDP_TNL_TSO)) { /* We should support TCP Send Offload. */ olx |= MLX5_TXOFF_CONFIG_TSO; } if (tx_offloads & (DEV_TX_OFFLOAD_IP_TNL_TSO | DEV_TX_OFFLOAD_UDP_TNL_TSO | DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM)) { /* We should support Software Parser for Tunnels. */ olx |= MLX5_TXOFF_CONFIG_SWP; } if (tx_offloads & (DEV_TX_OFFLOAD_IPV4_CKSUM | DEV_TX_OFFLOAD_UDP_CKSUM | DEV_TX_OFFLOAD_TCP_CKSUM | DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM)) { /* We should support IP/TCP/UDP Checksums. */ olx |= MLX5_TXOFF_CONFIG_CSUM; } if (tx_offloads & DEV_TX_OFFLOAD_VLAN_INSERT) { /* We should support VLAN insertion. */ olx |= MLX5_TXOFF_CONFIG_VLAN; } if (priv->txqs_n && (*priv->txqs)[0]) { struct mlx5_txq_data *txd = (*priv->txqs)[0]; if (txd->inlen_send) { /* * Check the data inline requirements. Data inline * is enabled on per device basis, we can check * the first Tx queue only. * * If device does not support VLAN insertion in WQE * and some queues are requested to perform VLAN * insertion offload than inline must be enabled. */ olx |= MLX5_TXOFF_CONFIG_INLINE; } } if (config->mps == MLX5_MPW_ENHANCED && config->txq_inline_min <= 0) { /* * The NIC supports Enhanced Multi-Packet Write * and does not require minimal inline data. */ olx |= MLX5_TXOFF_CONFIG_EMPW; } if (rte_flow_dynf_metadata_avail()) { /* We should support Flow metadata. */ olx |= MLX5_TXOFF_CONFIG_METADATA; } if (config->mps == MLX5_MPW) { /* * The NIC supports Legacy Multi-Packet Write. * The MLX5_TXOFF_CONFIG_MPW controls the * descriptor building method in combination * with MLX5_TXOFF_CONFIG_EMPW. */ if (!(olx & (MLX5_TXOFF_CONFIG_TSO | MLX5_TXOFF_CONFIG_SWP | MLX5_TXOFF_CONFIG_VLAN | MLX5_TXOFF_CONFIG_METADATA))) olx |= MLX5_TXOFF_CONFIG_EMPW | MLX5_TXOFF_CONFIG_MPW; } /* * Scan the routines table to find the minimal * satisfying routine with requested offloads. */ m = RTE_DIM(txoff_func); for (i = 0; i < RTE_DIM(txoff_func); i++) { unsigned int tmp; tmp = txoff_func[i].olx; if (tmp == olx) { /* Meets requested offloads exactly.*/ m = i; break; } if ((tmp & olx) != olx) { /* Does not meet requested offloads at all. */ continue; } if ((olx ^ tmp) & MLX5_TXOFF_CONFIG_MPW) /* Do not enable legacy MPW if not configured. */ continue; if ((olx ^ tmp) & MLX5_TXOFF_CONFIG_EMPW) /* Do not enable eMPW if not configured. */ continue; if ((olx ^ tmp) & MLX5_TXOFF_CONFIG_INLINE) /* Do not enable inlining if not configured. */ continue; /* * Some routine meets the requirements. * Check whether it has minimal amount * of not requested offloads. */ tmp = __builtin_popcountl(tmp & ~olx); if (m >= RTE_DIM(txoff_func) || tmp < diff) { /* First or better match, save and continue. */ m = i; diff = tmp; continue; } if (tmp == diff) { tmp = txoff_func[i].olx ^ txoff_func[m].olx; if (__builtin_ffsl(txoff_func[i].olx & ~tmp) < __builtin_ffsl(txoff_func[m].olx & ~tmp)) { /* Lighter not requested offload. */ m = i; } } } if (m >= RTE_DIM(txoff_func)) { DRV_LOG(DEBUG, "port %u has no selected Tx function" " for requested offloads %04X", dev->data->port_id, olx); return NULL; } DRV_LOG(DEBUG, "port %u has selected Tx function" " supporting offloads %04X/%04X", dev->data->port_id, olx, txoff_func[m].olx); if (txoff_func[m].olx & MLX5_TXOFF_CONFIG_MULTI) DRV_LOG(DEBUG, "\tMULTI (multi segment)"); if (txoff_func[m].olx & MLX5_TXOFF_CONFIG_TSO) DRV_LOG(DEBUG, "\tTSO (TCP send offload)"); if (txoff_func[m].olx & MLX5_TXOFF_CONFIG_SWP) DRV_LOG(DEBUG, "\tSWP (software parser)"); if (txoff_func[m].olx & MLX5_TXOFF_CONFIG_CSUM) DRV_LOG(DEBUG, "\tCSUM (checksum offload)"); if (txoff_func[m].olx & MLX5_TXOFF_CONFIG_INLINE) DRV_LOG(DEBUG, "\tINLIN (inline data)"); if (txoff_func[m].olx & MLX5_TXOFF_CONFIG_VLAN) DRV_LOG(DEBUG, "\tVLANI (VLAN insertion)"); if (txoff_func[m].olx & MLX5_TXOFF_CONFIG_METADATA) DRV_LOG(DEBUG, "\tMETAD (tx Flow metadata)"); if (txoff_func[m].olx & MLX5_TXOFF_CONFIG_EMPW) { if (txoff_func[m].olx & MLX5_TXOFF_CONFIG_MPW) DRV_LOG(DEBUG, "\tMPW (Legacy MPW)"); else DRV_LOG(DEBUG, "\tEMPW (Enhanced MPW)"); } return txoff_func[m].func; }
0
458,661
dp_packet_hwol_l4_is_sctp(const struct dp_packet *b OVS_UNUSED) { return false; }
0
266,724
static inline int perf_intr_is_nmi(struct pt_regs *regs) { #ifdef __powerpc64__ return !regs->softe; #else return 0; #endif }
0
150,591
cached_NPN_GetIntIdentifier(int32_t intid) { NPIdentifier ident; if (!use_npidentifier_cache()) ident = invoke_NPN_GetIntIdentifier(intid); #if USE_NPIDENTIFIER_CACHE else if (!npidentifier_cache_has_int(intid, &ident)) { ident = invoke_NPN_GetIntIdentifier(intid); npidentifier_cache_reserve(1); npidentifier_cache_add_int(ident, intid); } #endif return ident; }
0
393,983
int __weak arch_update_cpu_topology(void) { return 0; }
0
249,888
ReplaceCursor(CursorPtr pCursor, TestCursorFunc testCursor, void *closure) { int clientIndex; int resIndex; ReplaceCursorLookupRec rcl; /* * Cursors exist only in the resource database, windows and grabs. * All of these are always pointed at by the resource database. Walk * the whole thing looking for cursors */ rcl.testCursor = testCursor; rcl.pNew = pCursor; rcl.closure = closure; /* for each client */ for (clientIndex = 0; clientIndex < currentMaxClients; clientIndex++) { if (!clients[clientIndex]) continue; for (resIndex = 0; resIndex < NUM_CURSOR_RESTYPES; resIndex++) { rcl.type = CursorRestypes[resIndex]; /* * This function walks the entire client resource database */ LookupClientResourceComplex(clients[clientIndex], rcl.type, ReplaceCursorLookup, (void *) &rcl); } } /* this "knows" that WindowHasNewCursor doesn't depend on it's argument */ WindowHasNewCursor(screenInfo.screens[0]->root); }
0
514,627
Origins::Origins(Isolate* isolate, Local<Context> context, Local<String> origin_string, size_t origin_count) : count_(origin_count) { int origin_string_len = origin_string->Length(); if (count_ == 0) { CHECK_EQ(origin_string_len, 0); return; } // Allocate a single buffer with count_ nghttp2_nv structs, followed // by the raw header data as passed from JS. This looks like: // | possible padding | nghttp2_nv | nghttp2_nv | ... | header contents | buf_.AllocateSufficientStorage((alignof(nghttp2_origin_entry) - 1) + count_ * sizeof(nghttp2_origin_entry) + origin_string_len); // Make sure the start address is aligned appropriately for an nghttp2_nv*. char* start = reinterpret_cast<char*>( ROUND_UP(reinterpret_cast<uintptr_t>(*buf_), alignof(nghttp2_origin_entry))); char* origin_contents = start + (count_ * sizeof(nghttp2_origin_entry)); nghttp2_origin_entry* const nva = reinterpret_cast<nghttp2_origin_entry*>(start); CHECK_LE(origin_contents + origin_string_len, *buf_ + buf_.length()); CHECK_EQ(origin_string->WriteOneByte( isolate, reinterpret_cast<uint8_t*>(origin_contents), 0, origin_string_len, String::NO_NULL_TERMINATION), origin_string_len); size_t n = 0; char* p; for (p = origin_contents; p < origin_contents + origin_string_len; n++) { if (n >= count_) { static uint8_t zero = '\0'; nva[0].origin = &zero; nva[0].origin_len = 1; count_ = 1; return; } nva[n].origin = reinterpret_cast<uint8_t*>(p); nva[n].origin_len = strlen(p); p += nva[n].origin_len + 1; } }
0
91,804
static int sd_format_disk_name(char *prefix, int index, char *buf, int buflen) { const int base = 'z' - 'a' + 1; char *begin = buf + strlen(prefix); char *end = buf + buflen; char *p; int unit; p = end - 1; *p = '\0'; unit = base; do { if (p == begin) return -EINVAL; *--p = 'a' + (index % unit); index = (index / unit) - 1; } while (index >= 0); memmove(begin, p, end - p); memcpy(buf, prefix, strlen(prefix)); return 0; }
0
473,606
static inline void apic_clear_isr(int vec, struct kvm_lapic *apic) { struct kvm_vcpu *vcpu; if (!__apic_test_and_clear_vector(vec, apic->regs + APIC_ISR)) return; vcpu = apic->vcpu; /* * We do get here for APIC virtualization enabled if the guest * uses the Hyper-V APIC enlightenment. In this case we may need * to trigger a new interrupt delivery by writing the SVI field; * on the other hand isr_count and highest_isr_cache are unused * and must be left alone. */ if (unlikely(vcpu->arch.apicv_active)) static_call(kvm_x86_hwapic_isr_update)(vcpu, apic_find_highest_isr(apic)); else { --apic->isr_count; BUG_ON(apic->isr_count < 0); apic->highest_isr_cache = -1; } }
0
278,788
static void free_argv(char **argv, int argc) { int i; if (argv) { for (i = 0; i < argc; i++) { if (argv[i]) { efree(argv[i]); } } efree(argv); } }
0
400,996
static int local_statfs(FsContext *s, V9fsPath *fs_path, struct statfs *stbuf) { int fd, ret; fd = local_open_nofollow(s, fs_path->data, O_RDONLY, 0); if (fd == -1) { return -1; } ret = fstatfs(fd, stbuf); close_preserve_errno(fd); return ret; }
0
305,021
BGD_DECLARE(gdImagePtr) gdImageRotateInterpolated(const gdImagePtr src, const float angle, int bgcolor) { /* round to two decimals and keep the 100x multiplication to use it in the common square angles case later. Keep the two decimal precisions so smaller rotation steps can be done, useful for slow animations, f.e. */ const int angle_rounded = fmod((int) floorf(angle * 100), 360 * 100); if (bgcolor < 0) { return NULL; } /* 0 && 90 degrees multiple rotation, 0 rotation simply clones the return image and convert it to truecolor, as we must return truecolor image. */ switch (angle_rounded) { case 0: { gdImagePtr dst = gdImageClone(src); if (dst == NULL) { return NULL; } if (dst->trueColor == 0) { gdImagePaletteToTrueColor(dst); } return dst; } case -2700: case 9000: return gdImageRotate90(src, 0); case -18000: case 18000: return gdImageRotate180(src, 0); case -9000: case 27000: return gdImageRotate270(src, 0); } if (src == NULL || src->interpolation_id < 1 || src->interpolation_id > GD_METHOD_COUNT) { return NULL; } switch (src->interpolation_id) { case GD_NEAREST_NEIGHBOUR: return gdImageRotateNearestNeighbour(src, angle, bgcolor); break; case GD_BILINEAR_FIXED: return gdImageRotateBilinear(src, angle, bgcolor); break; case GD_BICUBIC_FIXED: return gdImageRotateBicubicFixed(src, angle, bgcolor); break; default: return gdImageRotateGeneric(src, angle, bgcolor); } return NULL; }
0
63,548
_SSL_check_hostname (X509 *cert, const char *host) { int rv; rv = _SSL_check_subject_altname (cert, host); if (rv == 0 || rv == -2) return rv; return _SSL_check_common_name (cert, host); }
0
62,382
nfs4_init_nonuniform_client_string(const struct nfs_client *clp, char *buf, size_t len) { unsigned int result; rcu_read_lock(); result = scnprintf(buf, len, "Linux NFSv4.0 %s/%s %s", clp->cl_ipaddr, rpc_peeraddr2str(clp->cl_rpcclient, RPC_DISPLAY_ADDR), rpc_peeraddr2str(clp->cl_rpcclient, RPC_DISPLAY_PROTO)); rcu_read_unlock(); return result; }
0
169,207
void AeroPeekManager::TabDetachedAt(TabContents* contents, int index) { TabClosingAt(contents, index); }
0
312,418
void WebMediaPlayerMS::RegisterContentsLayer(cc::Layer* layer) { DCHECK(thread_checker_.CalledOnValidThread()); DCHECK(bridge_); bridge_->SetContentsOpaque(opaque_); client_->SetCcLayer(layer); }
0
402,253
static void xhci_ep_free_xfer(XHCITransfer *xfer) { QTAILQ_REMOVE(&xfer->epctx->transfers, xfer, next); xfer->epctx->xfer_count--; usb_packet_cleanup(&xfer->packet); g_free(xfer->trbs); g_free(xfer); }
0
357,813
static int skfp_close(struct net_device *dev) { struct s_smc *smc = netdev_priv(dev); skfddi_priv *bp = &smc->os; CLI_FBI(); smt_reset_defaults(smc, 1); card_stop(smc); mac_drv_clear_tx_queue(smc); mac_drv_clear_rx_queue(smc); netif_stop_queue(dev); /* Deregister (free) IRQ */ free_irq(dev->irq, dev); skb_queue_purge(&bp->SendSkbQueue); bp->QueueSkb = MAX_TX_QUEUE_LEN; return (0); } // skfp_close
0
346,717
gst_riff_create_audio_caps (guint16 codec_id, gst_riff_strh * strh, gst_riff_strf_auds * strf, GstBuffer * strf_data, GstBuffer * strd_data, char **codec_name, gint channel_reorder_map[18]) { gboolean block_align = FALSE, rate_chan = TRUE; GstCaps *caps = NULL; gint i; if (channel_reorder_map) for (i = 0; i < 18; i++) channel_reorder_map[i] = -1; switch (codec_id) { case GST_RIFF_WAVE_FORMAT_PCM: /* PCM */ if (strf != NULL) { gint ba = strf->blockalign; gint ch = strf->channels; gint wd, ws; GstAudioFormat format; if (ba > (32 / 8) * ch) { GST_WARNING ("Invalid block align: %d > %d", ba, (32 / 8) * ch); wd = GST_ROUND_UP_8 (strf->bits_per_sample); } else if (ba != 0) { /* If we have an empty blockalign, we take the width contained in * strf->bits_per_sample */ wd = ba * 8 / ch; } else { wd = GST_ROUND_UP_8 (strf->bits_per_sample); } if (strf->bits_per_sample > 32) { GST_WARNING ("invalid depth (%d) of pcm audio, overwriting.", strf->bits_per_sample); strf->bits_per_sample = wd; } /* in riff, the depth is stored in the size field but it just means that * the _least_ significant bits are cleared. We can therefore just play * the sample as if it had a depth == width */ /* For reference, the actual depth is in strf->bits_per_sample */ ws = wd; format = gst_audio_format_build_integer (wd != 8, G_LITTLE_ENDIAN, wd, ws); if (format == GST_AUDIO_FORMAT_UNKNOWN) { GST_WARNING ("Unsupported raw audio format with width %d", wd); return NULL; } caps = gst_caps_new_simple ("audio/x-raw", "format", G_TYPE_STRING, gst_audio_format_to_string (format), "layout", G_TYPE_STRING, "interleaved", "channels", G_TYPE_INT, ch, NULL); /* Add default channel layout. We know no default layout for more than * 8 channels. */ if (ch > 8) GST_WARNING ("don't know default layout for %d channels", ch); else if (gst_riff_wave_add_default_channel_mask (caps, ch, channel_reorder_map)) GST_DEBUG ("using default channel layout for %d channels", ch); else GST_WARNING ("failed to add channel layout"); } else { /* FIXME: this is pretty useless - we need fixed caps */ caps = gst_caps_from_string ("audio/x-raw, " "format = (string) { S8, U8, S16LE, U16LE, S24LE, " "U24LE, S32LE, U32LE }, " "layout = (string) interleaved"); } if (codec_name && strf) *codec_name = g_strdup_printf ("Uncompressed %d-bit PCM audio", strf->bits_per_sample); break; case GST_RIFF_WAVE_FORMAT_ADPCM: if (strf != NULL) { /* Many encoding tools create a wrong bitrate information in the header, * so either we calculate the bitrate or mark it as invalid as this * would probably confuse timing */ strf->av_bps = 0; if (strf->channels != 0 && strf->rate != 0 && strf->blockalign != 0) { int spb = ((strf->blockalign - strf->channels * 7) / 2) * 2; strf->av_bps = gst_util_uint64_scale_int (strf->rate, strf->blockalign, spb); GST_DEBUG ("fixing av_bps to calculated value %d of MS ADPCM", strf->av_bps); } } caps = gst_caps_new_simple ("audio/x-adpcm", "layout", G_TYPE_STRING, "microsoft", NULL); if (codec_name) *codec_name = g_strdup ("ADPCM audio"); block_align = TRUE; break; case GST_RIFF_WAVE_FORMAT_IEEE_FLOAT: if (strf != NULL) { gint ba = strf->blockalign; gint ch = strf->channels; gint wd = ba * 8 / ch; caps = gst_caps_new_simple ("audio/x-raw", "format", G_TYPE_STRING, wd == 64 ? "F64LE" : "F32LE", "layout", G_TYPE_STRING, "interleaved", "channels", G_TYPE_INT, ch, NULL); /* Add default channel layout. We know no default layout for more than * 8 channels. */ if (ch > 8) GST_WARNING ("don't know default layout for %d channels", ch); else if (gst_riff_wave_add_default_channel_mask (caps, ch, channel_reorder_map)) GST_DEBUG ("using default channel layout for %d channels", ch); else GST_WARNING ("failed to add channel layout"); } else { /* FIXME: this is pretty useless - we need fixed caps */ caps = gst_caps_from_string ("audio/x-raw, " "format = (string) { F32LE, F64LE }, " "layout = (string) interleaved"); } if (codec_name && strf) *codec_name = g_strdup_printf ("Uncompressed %d-bit IEEE float audio", strf->bits_per_sample); break; case GST_RIFF_WAVE_FORMAT_IBM_CVSD: goto unknown; case GST_RIFF_WAVE_FORMAT_ALAW: if (strf != NULL) { if (strf->bits_per_sample != 8) { GST_WARNING ("invalid depth (%d) of alaw audio, overwriting.", strf->bits_per_sample); strf->bits_per_sample = 8; strf->blockalign = (strf->bits_per_sample * strf->channels) / 8; strf->av_bps = strf->blockalign * strf->rate; } if (strf->av_bps == 0 || strf->blockalign == 0) { GST_WARNING ("fixing av_bps (%d) and blockalign (%d) of alaw audio", strf->av_bps, strf->blockalign); strf->blockalign = (strf->bits_per_sample * strf->channels) / 8; strf->av_bps = strf->blockalign * strf->rate; } } caps = gst_caps_new_empty_simple ("audio/x-alaw"); if (codec_name) *codec_name = g_strdup ("A-law audio"); break; case GST_RIFF_WAVE_FORMAT_WMS: caps = gst_caps_new_empty_simple ("audio/x-wms"); if (strf != NULL) { gst_caps_set_simple (caps, "bitrate", G_TYPE_INT, strf->av_bps * 8, "width", G_TYPE_INT, strf->bits_per_sample, "depth", G_TYPE_INT, strf->bits_per_sample, NULL); } else { gst_caps_set_simple (caps, "bitrate", GST_TYPE_INT_RANGE, 0, G_MAXINT, NULL); } if (codec_name) *codec_name = g_strdup ("Windows Media Audio Speech"); block_align = TRUE; break; case GST_RIFF_WAVE_FORMAT_MULAW: if (strf != NULL) { if (strf->bits_per_sample != 8) { GST_WARNING ("invalid depth (%d) of mulaw audio, overwriting.", strf->bits_per_sample); strf->bits_per_sample = 8; strf->blockalign = (strf->bits_per_sample * strf->channels) / 8; strf->av_bps = strf->blockalign * strf->rate; } if (strf->av_bps == 0 || strf->blockalign == 0) { GST_WARNING ("fixing av_bps (%d) and blockalign (%d) of mulaw audio", strf->av_bps, strf->blockalign); strf->blockalign = (strf->bits_per_sample * strf->channels) / 8; strf->av_bps = strf->blockalign * strf->rate; } } caps = gst_caps_new_empty_simple ("audio/x-mulaw"); if (codec_name) *codec_name = g_strdup ("Mu-law audio"); break; case GST_RIFF_WAVE_FORMAT_OKI_ADPCM: goto unknown; case GST_RIFF_WAVE_FORMAT_DVI_ADPCM: if (strf != NULL) { /* Many encoding tools create a wrong bitrate information in the * header, so either we calculate the bitrate or mark it as invalid * as this would probably confuse timing */ strf->av_bps = 0; if (strf->channels != 0 && strf->rate != 0 && strf->blockalign != 0) { int spb = ((strf->blockalign - strf->channels * 4) / 2) * 2; strf->av_bps = gst_util_uint64_scale_int (strf->rate, strf->blockalign, spb); GST_DEBUG ("fixing av_bps to calculated value %d of IMA DVI ADPCM", strf->av_bps); } } caps = gst_caps_new_simple ("audio/x-adpcm", "layout", G_TYPE_STRING, "dvi", NULL); if (codec_name) *codec_name = g_strdup ("DVI ADPCM audio"); block_align = TRUE; break; case GST_RIFF_WAVE_FORMAT_ADPCM_G722: caps = gst_caps_new_empty_simple ("audio/G722"); if (codec_name) *codec_name = g_strdup ("G722 audio"); break; case GST_RIFF_WAVE_FORMAT_ITU_G726_ADPCM: if (strf != NULL) { gint bitrate; bitrate = 0; if (strf->av_bps == 2000 || strf->av_bps == 3000 || strf->av_bps == 4000 || strf->av_bps == 5000) { strf->blockalign = strf->av_bps / 1000; bitrate = strf->av_bps * 8; } else if (strf->blockalign >= 2 && strf->blockalign <= 5) { bitrate = strf->blockalign * 8000; } if (bitrate > 0) { caps = gst_caps_new_simple ("audio/x-adpcm", "layout", G_TYPE_STRING, "g726", "bitrate", G_TYPE_INT, bitrate, NULL); } else { caps = gst_caps_new_simple ("audio/x-adpcm", "layout", G_TYPE_STRING, "g726", NULL); } } else { caps = gst_caps_new_simple ("audio/x-adpcm", "layout", G_TYPE_STRING, "g726", NULL); } if (codec_name) *codec_name = g_strdup ("G726 ADPCM audio"); block_align = TRUE; break; case GST_RIFF_WAVE_FORMAT_DSP_TRUESPEECH: caps = gst_caps_new_empty_simple ("audio/x-truespeech"); if (codec_name) *codec_name = g_strdup ("DSP Group TrueSpeech"); break; case GST_RIFF_WAVE_FORMAT_GSM610: case GST_RIFF_WAVE_FORMAT_MSN: caps = gst_caps_new_empty_simple ("audio/ms-gsm"); if (codec_name) *codec_name = g_strdup ("MS GSM audio"); break; case GST_RIFF_WAVE_FORMAT_MPEGL12: /* mp1 or mp2 */ caps = gst_caps_new_simple ("audio/mpeg", "mpegversion", G_TYPE_INT, 1, "layer", G_TYPE_INT, 2, NULL); if (codec_name) *codec_name = g_strdup ("MPEG-1 layer 2"); break; case GST_RIFF_WAVE_FORMAT_MPEGL3: /* mp3 */ caps = gst_caps_new_simple ("audio/mpeg", "mpegversion", G_TYPE_INT, 1, "layer", G_TYPE_INT, 3, NULL); if (codec_name) *codec_name = g_strdup ("MPEG-1 layer 3"); break; case GST_RIFF_WAVE_FORMAT_AMR_NB: /* amr-nb */ caps = gst_caps_new_empty_simple ("audio/AMR"); if (codec_name) *codec_name = g_strdup ("AMR Narrow Band (NB)"); break; case GST_RIFF_WAVE_FORMAT_AMR_WB: /* amr-wb */ caps = gst_caps_new_empty_simple ("audio/AMR-WB"); if (codec_name) *codec_name = g_strdup ("AMR Wide Band (WB)"); break; case GST_RIFF_WAVE_FORMAT_VORBIS1: /* ogg/vorbis mode 1 */ case GST_RIFF_WAVE_FORMAT_VORBIS2: /* ogg/vorbis mode 2 */ case GST_RIFF_WAVE_FORMAT_VORBIS3: /* ogg/vorbis mode 3 */ case GST_RIFF_WAVE_FORMAT_VORBIS1PLUS: /* ogg/vorbis mode 1+ */ case GST_RIFF_WAVE_FORMAT_VORBIS2PLUS: /* ogg/vorbis mode 2+ */ case GST_RIFF_WAVE_FORMAT_VORBIS3PLUS: /* ogg/vorbis mode 3+ */ caps = gst_caps_new_empty_simple ("audio/x-vorbis"); if (codec_name) *codec_name = g_strdup ("Vorbis"); break; case GST_RIFF_WAVE_FORMAT_A52: caps = gst_caps_new_empty_simple ("audio/x-ac3"); if (codec_name) *codec_name = g_strdup ("AC-3 audio"); break; case GST_RIFF_WAVE_FORMAT_DTS: caps = gst_caps_new_empty_simple ("audio/x-dts"); if (codec_name) *codec_name = g_strdup ("DTS audio"); /* wavparse is not always able to specify rate/channels for DTS-in-wav */ rate_chan = FALSE; break; case GST_RIFF_WAVE_FORMAT_AAC: case GST_RIFF_WAVE_FORMAT_AAC_AC: case GST_RIFF_WAVE_FORMAT_AAC_pm: { caps = gst_caps_new_simple ("audio/mpeg", "mpegversion", G_TYPE_INT, 4, NULL); if (codec_name) *codec_name = g_strdup ("MPEG-4 AAC audio"); break; } case GST_RIFF_WAVE_FORMAT_WMAV1: case GST_RIFF_WAVE_FORMAT_WMAV2: case GST_RIFF_WAVE_FORMAT_WMAV3: case GST_RIFF_WAVE_FORMAT_WMAV3_L: { gint version = (codec_id - GST_RIFF_WAVE_FORMAT_WMAV1) + 1; block_align = TRUE; caps = gst_caps_new_simple ("audio/x-wma", "wmaversion", G_TYPE_INT, version, NULL); if (codec_name) { if (codec_id == GST_RIFF_WAVE_FORMAT_WMAV3_L) *codec_name = g_strdup ("WMA Lossless"); else *codec_name = g_strdup_printf ("WMA Version %d", version + 6); } if (strf != NULL) { gst_caps_set_simple (caps, "bitrate", G_TYPE_INT, strf->av_bps * 8, "depth", G_TYPE_INT, strf->bits_per_sample, NULL); } else { gst_caps_set_simple (caps, "bitrate", GST_TYPE_INT_RANGE, 0, G_MAXINT, NULL); } break; } case GST_RIFF_WAVE_FORMAT_SONY_ATRAC3: caps = gst_caps_new_empty_simple ("audio/x-vnd.sony.atrac3"); if (codec_name) *codec_name = g_strdup ("Sony ATRAC3"); break; case GST_RIFF_WAVE_FORMAT_SIREN: caps = gst_caps_new_empty_simple ("audio/x-siren"); if (codec_name) *codec_name = g_strdup ("Siren7"); rate_chan = FALSE; break; case GST_RIFF_WAVE_FORMAT_ADPCM_IMA_DK4: caps = gst_caps_new_simple ("audio/x-adpcm", "layout", G_TYPE_STRING, "dk4", NULL); if (codec_name) *codec_name = g_strdup ("IMA/DK4 ADPCM"); break; case GST_RIFF_WAVE_FORMAT_ADPCM_IMA_DK3: caps = gst_caps_new_simple ("audio/x-adpcm", "layout", G_TYPE_STRING, "dk3", NULL); if (codec_name) *codec_name = g_strdup ("IMA/DK3 ADPCM"); break; case GST_RIFF_WAVE_FORMAT_ADPCM_IMA_WAV: caps = gst_caps_new_simple ("audio/x-adpcm", "layout", G_TYPE_STRING, "dvi", NULL); if (codec_name) *codec_name = g_strdup ("IMA/WAV ADPCM"); break; case GST_RIFF_WAVE_FORMAT_EXTENSIBLE:{ guint16 valid_bits_per_sample; guint32 channel_mask; guint32 subformat_guid[4]; GstMapInfo info; gsize size; /* should be at least 22 bytes */ size = gst_buffer_get_size (strf_data); if (strf_data == NULL || size < 22) { GST_WARNING ("WAVE_FORMAT_EXTENSIBLE data size is %" G_GSIZE_FORMAT " (expected: 22)", (strf_data) ? size : -1); return NULL; } gst_buffer_map (strf_data, &info, GST_MAP_READ); valid_bits_per_sample = GST_READ_UINT16_LE (info.data); channel_mask = GST_READ_UINT32_LE (info.data + 2); subformat_guid[0] = GST_READ_UINT32_LE (info.data + 6); subformat_guid[1] = GST_READ_UINT32_LE (info.data + 10); subformat_guid[2] = GST_READ_UINT32_LE (info.data + 14); subformat_guid[3] = GST_READ_UINT32_LE (info.data + 18); gst_buffer_unmap (strf_data, &info); GST_DEBUG ("valid bps = %u", valid_bits_per_sample); GST_DEBUG ("channel mask = 0x%08x", channel_mask); GST_DEBUG ("GUID = %08x-%08x-%08x-%08x", subformat_guid[0], subformat_guid[1], subformat_guid[2], subformat_guid[3]); if (subformat_guid[1] == 0x00100000 && subformat_guid[2] == 0xaa000080 && subformat_guid[3] == 0x719b3800) { if (subformat_guid[0] == 0x00000001) { GST_DEBUG ("PCM"); if (strf != NULL && strf->blockalign != 0 && strf->channels != 0 && strf->rate != 0) { gint ba = strf->blockalign; gint wd = ba * 8 / strf->channels; gint ws; GstAudioFormat format; /* in riff, the depth is stored in the size field but it just * means that the _least_ significant bits are cleared. We can * therefore just play the sample as if it had a depth == width */ ws = wd; /* For reference, use this to get the actual depth: * ws = strf->bits_per_sample; * if (valid_bits_per_sample != 0) * ws = valid_bits_per_sample; */ format = gst_audio_format_build_integer (wd != 8, G_LITTLE_ENDIAN, wd, ws); caps = gst_caps_new_simple ("audio/x-raw", "format", G_TYPE_STRING, gst_audio_format_to_string (format), "layout", G_TYPE_STRING, "interleaved", "channels", G_TYPE_INT, strf->channels, "rate", G_TYPE_INT, strf->rate, NULL); if (codec_name) { *codec_name = g_strdup_printf ("Uncompressed %d-bit PCM audio", strf->bits_per_sample); } } } else if (subformat_guid[0] == 0x00000003) { GST_DEBUG ("FLOAT"); if (strf != NULL && strf->blockalign != 0 && strf->channels != 0 && strf->rate != 0) { gint ba = strf->blockalign; gint wd = ba * 8 / strf->channels; caps = gst_caps_new_simple ("audio/x-raw", "format", G_TYPE_STRING, wd == 32 ? "F32LE" : "F64LE", "layout", G_TYPE_STRING, "interleaved", "channels", G_TYPE_INT, strf->channels, "rate", G_TYPE_INT, strf->rate, NULL); if (codec_name) { *codec_name = g_strdup_printf ("Uncompressed %d-bit IEEE float audio", strf->bits_per_sample); } } } else if (subformat_guid[0] == 0x0000006) { GST_DEBUG ("ALAW"); if (strf != NULL) { if (strf->bits_per_sample != 8) { GST_WARNING ("invalid depth (%d) of alaw audio, overwriting.", strf->bits_per_sample); strf->bits_per_sample = 8; strf->av_bps = 8; strf->blockalign = strf->av_bps * strf->channels; } if (strf->av_bps == 0 || strf->blockalign == 0) { GST_WARNING ("fixing av_bps (%d) and blockalign (%d) of alaw audio", strf->av_bps, strf->blockalign); strf->av_bps = strf->bits_per_sample; strf->blockalign = strf->av_bps * strf->channels; } } caps = gst_caps_new_empty_simple ("audio/x-alaw"); if (codec_name) *codec_name = g_strdup ("A-law audio"); } else if (subformat_guid[0] == 0x00000007) { GST_DEBUG ("MULAW"); if (strf != NULL) { if (strf->bits_per_sample != 8) { GST_WARNING ("invalid depth (%d) of mulaw audio, overwriting.", strf->bits_per_sample); strf->bits_per_sample = 8; strf->av_bps = 8; strf->blockalign = strf->av_bps * strf->channels; } if (strf->av_bps == 0 || strf->blockalign == 0) { GST_WARNING ("fixing av_bps (%d) and blockalign (%d) of mulaw audio", strf->av_bps, strf->blockalign); strf->av_bps = strf->bits_per_sample; strf->blockalign = strf->av_bps * strf->channels; } } caps = gst_caps_new_empty_simple ("audio/x-mulaw"); if (codec_name) *codec_name = g_strdup ("Mu-law audio"); } else if (subformat_guid[0] == 0x00000092) { GST_DEBUG ("FIXME: handle DOLBY AC3 SPDIF format"); GST_DEBUG ("WAVE_FORMAT_EXTENSIBLE AC-3 SPDIF audio"); caps = gst_caps_new_empty_simple ("audio/x-ac3"); if (codec_name) *codec_name = g_strdup ("wavext AC-3 SPDIF audio"); } else if ((subformat_guid[0] & 0xffff) == GST_RIFF_WAVE_FORMAT_EXTENSIBLE) { GST_DEBUG ("WAVE_FORMAT_EXTENSIBLE nested"); } else { /* recurse where no special consideration has yet to be identified * for the subformat guid */ caps = gst_riff_create_audio_caps (subformat_guid[0], strh, strf, strf_data, strd_data, codec_name, channel_reorder_map); if (!codec_name) GST_DEBUG ("WAVE_FORMAT_EXTENSIBLE audio"); if (caps) { if (codec_name) { GST_DEBUG ("WAVE_FORMAT_EXTENSIBLE %s", *codec_name); *codec_name = g_strjoin ("wavext ", *codec_name, NULL); } return caps; } } } else if (subformat_guid[0] == 0x6ba47966 && subformat_guid[1] == 0x41783f83 && subformat_guid[2] == 0xf0006596 && subformat_guid[3] == 0xe59262bf) { caps = gst_caps_new_empty_simple ("application/x-ogg-avi"); if (codec_name) *codec_name = g_strdup ("Ogg-AVI"); } if (caps == NULL) { GST_WARNING ("Unknown WAVE_FORMAT_EXTENSIBLE audio format"); return NULL; } if (strf != NULL) { /* If channel_mask == 0 and channels > 1 let's * assume default layout as some wav files don't have the * channel mask set. Don't set the layout for 1 channel. */ if (channel_mask == 0 && strf->channels > 1) channel_mask = gst_riff_wavext_get_default_channel_mask (strf->channels); if ((channel_mask != 0 || strf->channels > 1) && !gst_riff_wavext_add_channel_mask (caps, strf->channels, channel_mask, channel_reorder_map)) { GST_WARNING ("failed to add channel layout"); gst_caps_unref (caps); caps = NULL; } rate_chan = FALSE; } break; } /* can anything decode these? pitfdll? */ case GST_RIFF_WAVE_FORMAT_VOXWARE_AC8: case GST_RIFF_WAVE_FORMAT_VOXWARE_AC10: case GST_RIFF_WAVE_FORMAT_VOXWARE_AC16: case GST_RIFF_WAVE_FORMAT_VOXWARE_AC20: case GST_RIFF_WAVE_FORMAT_VOXWARE_METAVOICE: case GST_RIFF_WAVE_FORMAT_VOXWARE_METASOUND: case GST_RIFF_WAVE_FORMAT_VOXWARE_RT29HW: case GST_RIFF_WAVE_FORMAT_VOXWARE_VR12: case GST_RIFF_WAVE_FORMAT_VOXWARE_VR18: case GST_RIFF_WAVE_FORMAT_VOXWARE_TQ40: case GST_RIFF_WAVE_FORMAT_VOXWARE_TQ60:{ caps = gst_caps_new_simple ("audio/x-voxware", "voxwaretype", G_TYPE_INT, (gint) codec_id, NULL); if (codec_name) *codec_name = g_strdup ("Voxware"); break; } default: unknown: GST_WARNING ("Unknown audio tag 0x%04x", codec_id); return NULL; } if (strf != NULL) { if (rate_chan) { gst_caps_set_simple (caps, "rate", G_TYPE_INT, strf->rate, "channels", G_TYPE_INT, strf->channels, NULL); } if (block_align) { gst_caps_set_simple (caps, "block_align", G_TYPE_INT, strf->blockalign, NULL); } } else { if (block_align) { gst_caps_set_simple (caps, "block_align", GST_TYPE_INT_RANGE, 1, G_MAXINT, NULL); } } /* extradata */ if (strf_data || strd_data) { gst_caps_set_simple (caps, "codec_data", GST_TYPE_BUFFER, strf_data ? strf_data : strd_data, NULL); } return caps; }
1
233,170
void Clear() { resource_response_.reset(); byte_range_lower_bound_ = 0; byte_range_upper_bound_ = 0; }
0
6,329
static inline int copy_regset_from_user(struct task_struct *target, const struct user_regset_view *view, unsigned int setno, unsigned int offset, unsigned int size, const void __user *data) { const struct user_regset *regset = &view->regsets[setno]; if (!access_ok(VERIFY_READ, data, size)) return -EIO; return regset->set(target, regset, offset, size, NULL, data); }
1
187,268
long get_user_pages_locked(unsigned long start, unsigned long nr_pages, unsigned int gup_flags, struct page **pages, int *locked) { return __get_user_pages_locked(current, current->mm, start, nr_pages, pages, NULL, locked, gup_flags | FOLL_TOUCH); }
0
453,431
__perf_remove_from_context(struct perf_event *event, struct perf_cpu_context *cpuctx, struct perf_event_context *ctx, void *info) { unsigned long flags = (unsigned long)info; if (ctx->is_active & EVENT_TIME) { update_context_time(ctx); update_cgrp_time_from_cpuctx(cpuctx); } event_sched_out(event, cpuctx, ctx); if (flags & DETACH_GROUP) perf_group_detach(event); list_del_event(event, ctx); if (!ctx->nr_events && ctx->is_active) { ctx->is_active = 0; ctx->rotate_necessary = 0; if (ctx->task) { WARN_ON_ONCE(cpuctx->task_ctx != ctx); cpuctx->task_ctx = NULL; } } }
0
197,369
acl_to_ac_byte(struct sc_card *card, const struct sc_acl_entry *e) { if (e == NULL) return SC_ERROR_OBJECT_NOT_FOUND; switch (e->method) { case SC_AC_NONE: LOG_FUNC_RETURN(card->ctx, EPASS2003_AC_MAC_NOLESS | EPASS2003_AC_EVERYONE); case SC_AC_NEVER: LOG_FUNC_RETURN(card->ctx, EPASS2003_AC_MAC_NOLESS | EPASS2003_AC_NOONE); default: LOG_FUNC_RETURN(card->ctx, EPASS2003_AC_MAC_NOLESS | EPASS2003_AC_USER); } LOG_FUNC_RETURN(card->ctx, SC_ERROR_INCORRECT_PARAMETERS); }
0
156,327
pci_populate_msixcap(struct msixcap *msixcap, int msgnum, int barnum, uint32_t msix_tab_size) { assert(msix_tab_size % 4096 == 0); bzero(msixcap, sizeof(struct msixcap)); msixcap->capid = PCIY_MSIX; /* * Message Control Register, all fields set to * zero except for the Table Size. * Note: Table size N is encoded as N-1 */ msixcap->msgctrl = msgnum - 1; /* * MSI-X BAR setup: * - MSI-X table start at offset 0 * - PBA table starts at a 4K aligned offset after the MSI-X table */ msixcap->table_info = barnum & PCIM_MSIX_BIR_MASK; msixcap->pba_info = msix_tab_size | (barnum & PCIM_MSIX_BIR_MASK); }
0
460,039
proto_set_cant_toggle(const int proto_id) { protocol_t *protocol; protocol = find_protocol_by_id(proto_id); protocol->can_toggle = FALSE; }
0
3,298
thunar_transfer_job_copy_node (ThunarTransferJob *job, ThunarTransferNode *node, GFile *target_file, GFile *target_parent_file, GList **target_file_list_return, GError **error) { ThunarThumbnailCache *thumbnail_cache; ThunarApplication *application; ThunarJobResponse response; GFileInfo *info; GError *err = NULL; GFile *real_target_file = NULL; gchar *base_name; _thunar_return_if_fail (THUNAR_IS_TRANSFER_JOB (job)); _thunar_return_if_fail (node != NULL && G_IS_FILE (node->source_file)); _thunar_return_if_fail (target_file == NULL || node->next == NULL); _thunar_return_if_fail ((target_file == NULL && target_parent_file != NULL) || (target_file != NULL && target_parent_file == NULL)); _thunar_return_if_fail (error == NULL || *error == NULL); /* The caller can either provide a target_file or a target_parent_file, but not both. The toplevel * transfer_nodes (for which next is NULL) should be called with target_file, to get proper behavior * wrt restoring files from the trash. Other transfer_nodes will be called with target_parent_file. */ /* take a reference on the thumbnail cache */ application = thunar_application_get (); thumbnail_cache = thunar_application_get_thumbnail_cache (application); g_object_unref (application); for (; err == NULL && node != NULL; node = node->next) { /* guess the target file for this node (unless already provided) */ if (G_LIKELY (target_file == NULL)) { base_name = g_file_get_basename (node->source_file); target_file = g_file_get_child (target_parent_file, base_name); g_free (base_name); } else target_file = g_object_ref (target_file); /* query file info */ info = g_file_query_info (node->source_file, G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME, G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, exo_job_get_cancellable (EXO_JOB (job)), &err); /* abort on error or cancellation */ if (info == NULL) { g_object_unref (target_file); break; } /* update progress information */ exo_job_info_message (EXO_JOB (job), g_file_info_get_display_name (info)); retry_copy: /* copy the item specified by this node (not recursively) */ real_target_file = thunar_transfer_job_copy_file (job, node->source_file, target_file, &err); if (G_LIKELY (real_target_file != NULL)) { /* node->source_file == real_target_file means to skip the file */ if (G_LIKELY (node->source_file != real_target_file)) { /* notify the thumbnail cache of the copy operation */ thunar_thumbnail_cache_copy_file (thumbnail_cache, node->source_file, real_target_file); /* check if we have children to copy */ if (node->children != NULL) { /* copy all children of this node */ thunar_transfer_job_copy_node (job, node->children, NULL, real_target_file, NULL, &err); /* free resources allocted for the children */ thunar_transfer_node_free (node->children); node->children = NULL; } /* check if the child copy failed */ if (G_UNLIKELY (err != NULL)) { /* outa here, freeing the target paths */ g_object_unref (real_target_file); g_object_unref (target_file); break; } /* add the real target file to the return list */ if (G_LIKELY (target_file_list_return != NULL)) { *target_file_list_return = thunar_g_file_list_prepend (*target_file_list_return, real_target_file); } retry_remove: /* try to remove the source directory if we are on copy+remove fallback for move */ if (job->type == THUNAR_TRANSFER_JOB_MOVE) { if (g_file_delete (node->source_file, exo_job_get_cancellable (EXO_JOB (job)), &err)) { /* notify the thumbnail cache of the delete operation */ thunar_thumbnail_cache_delete_file (thumbnail_cache, node->source_file); } else { /* ask the user to retry */ response = thunar_job_ask_skip (THUNAR_JOB (job), "%s", err->message); /* reset the error */ g_clear_error (&err); /* check whether to retry */ if (G_UNLIKELY (response == THUNAR_JOB_RESPONSE_RETRY)) goto retry_remove; } } } g_object_unref (real_target_file); } else if (err != NULL) { /* we can only skip if there is space left on the device */ if (err->domain != G_IO_ERROR || err->code != G_IO_ERROR_NO_SPACE) { /* ask the user to skip this node and all subnodes */ response = thunar_job_ask_skip (THUNAR_JOB (job), "%s", err->message); /* reset the error */ g_clear_error (&err); /* check whether to retry */ if (G_UNLIKELY (response == THUNAR_JOB_RESPONSE_RETRY)) goto retry_copy; } } /* release the guessed target file */ g_object_unref (target_file); target_file = NULL; /* release file info */ g_object_unref (info); } /* release the thumbnail cache */ g_object_unref (thumbnail_cache); /* propagate error if we failed or the job was cancelled */ if (G_UNLIKELY (err != NULL)) g_propagate_error (error, err); }
1
136,814
struct dvb_frontend *cx24116_attach(const struct cx24116_config *config, struct i2c_adapter *i2c) { struct cx24116_state *state = NULL; int ret; dprintk("%s\n", __func__); /* allocate memory for the internal state */ state = kzalloc(sizeof(struct cx24116_state), GFP_KERNEL); if (state == NULL) goto error1; state->config = config; state->i2c = i2c; /* check if the demod is present */ ret = (cx24116_readreg(state, 0xFF) << 8) | cx24116_readreg(state, 0xFE); if (ret != 0x0501) { printk(KERN_INFO "Invalid probe, probably not a CX24116 device\n"); goto error2; } /* create dvb_frontend */ memcpy(&state->frontend.ops, &cx24116_ops, sizeof(struct dvb_frontend_ops)); state->frontend.demodulator_priv = state; return &state->frontend; error2: kfree(state); error1: return NULL; }
0
359,730
utils_fill_connection_certs (NMConnection *connection, GError **error) { NMSetting8021x *s_8021x; const char *filename; GError *tmp_error = NULL; gboolean need_client_cert = TRUE; g_return_val_if_fail (connection != NULL, FALSE); s_8021x = NM_SETTING_802_1X (nm_connection_get_setting (connection, NM_TYPE_SETTING_802_1X)); if (!s_8021x) return TRUE; filename = g_object_get_data (G_OBJECT (connection), NMA_PATH_CA_CERT_TAG); if (filename) { if (!nm_setting_802_1x_set_ca_cert_from_file (s_8021x, filename, NULL, &tmp_error)) { g_set_error (error, tmp_error->domain, tmp_error->code, _("Could not read CA certificate: %s"), tmp_error->message); g_clear_error (&tmp_error); return FALSE; } } /* If the private key is PKCS#12, don't set the client cert */ need_client_cert = fill_one_private_key (connection, NMA_PATH_PRIVATE_KEY_TAG, NM_SETTING_802_1X_PRIVATE_KEY, NM_SETTING_802_1X_CLIENT_CERT); if (need_client_cert) { filename = g_object_get_data (G_OBJECT (connection), NMA_PATH_CLIENT_CERT_TAG); if (filename) { if (!nm_setting_802_1x_set_client_cert_from_file (s_8021x, filename, NULL, &tmp_error)) { g_set_error (error, tmp_error->domain, tmp_error->code, _("Could not read client certificate: %s"), tmp_error->message); g_clear_error (&tmp_error); return FALSE; } } } filename = g_object_get_data (G_OBJECT (connection), NMA_PATH_PHASE2_CA_CERT_TAG); if (filename) { if (!nm_setting_802_1x_set_phase2_ca_cert_from_file (s_8021x, filename, NULL, &tmp_error)) { g_set_error (error, tmp_error->domain, tmp_error->code, _("Could not read inner CA certificate: %s"), tmp_error->message); g_clear_error (&tmp_error); return FALSE; } } /* If the private key is PKCS#12, don't set the client cert */ need_client_cert = fill_one_private_key (connection, NMA_PATH_PHASE2_PRIVATE_KEY_TAG, NM_SETTING_802_1X_PHASE2_PRIVATE_KEY, NM_SETTING_802_1X_PHASE2_CLIENT_CERT); if (need_client_cert) { filename = g_object_get_data (G_OBJECT (connection), NMA_PATH_PHASE2_CLIENT_CERT_TAG); if (filename) { if (!nm_setting_802_1x_set_phase2_client_cert_from_file (s_8021x, filename, NULL, &tmp_error)) { g_set_error (error, tmp_error->domain, tmp_error->code, _("Could not read inner client certificate: %s"), tmp_error->message); g_clear_error (&tmp_error); return FALSE; } } } return TRUE; }
0
136,603
Map1toN(SDL_PixelFormat * src, Uint8 Rmod, Uint8 Gmod, Uint8 Bmod, Uint8 Amod, SDL_PixelFormat * dst) { Uint8 *map; int i; int bpp; SDL_Palette *pal = src->palette; bpp = ((dst->BytesPerPixel == 3) ? 4 : dst->BytesPerPixel); map = (Uint8 *) SDL_calloc(256, bpp); if (map == NULL) { SDL_OutOfMemory(); return (NULL); } /* We memory copy to the pixel map so the endianness is preserved */ for (i = 0; i < pal->ncolors; ++i) { Uint8 R = (Uint8) ((pal->colors[i].r * Rmod) / 255); Uint8 G = (Uint8) ((pal->colors[i].g * Gmod) / 255); Uint8 B = (Uint8) ((pal->colors[i].b * Bmod) / 255); Uint8 A = (Uint8) ((pal->colors[i].a * Amod) / 255); ASSEMBLE_RGBA(&map[i * bpp], dst->BytesPerPixel, dst, (Uint32)R, (Uint32)G, (Uint32)B, (Uint32)A); } return (map); }
0
482,867
cachedb_intcache_lookup(struct module_qstate* qstate) { uint8_t* dpname=NULL; size_t dpnamelen=0; struct dns_msg* msg; if(iter_stub_fwd_no_cache(qstate, &qstate->qinfo, &dpname, &dpnamelen)) return 0; /* no cache for these queries */ msg = dns_cache_lookup(qstate->env, qstate->qinfo.qname, qstate->qinfo.qname_len, qstate->qinfo.qtype, qstate->qinfo.qclass, qstate->query_flags, qstate->region, qstate->env->scratch, 1, /* no partial messages with only a CNAME */ dpname, dpnamelen ); if(!msg && qstate->env->neg_cache && iter_qname_indicates_dnssec(qstate->env, &qstate->qinfo)) { /* lookup in negative cache; may result in * NOERROR/NODATA or NXDOMAIN answers that need validation */ msg = val_neg_getmsg(qstate->env->neg_cache, &qstate->qinfo, qstate->region, qstate->env->rrset_cache, qstate->env->scratch_buffer, *qstate->env->now, 1/*add SOA*/, NULL, qstate->env->cfg); } if(!msg) return 0; /* this is the returned msg */ qstate->return_rcode = LDNS_RCODE_NOERROR; qstate->return_msg = msg; return 1; }
0
185,760
void OmniboxViewViews::OnTemporaryTextMaybeChanged( const base::string16& display_text, const AutocompleteMatch& match, bool save_original_selection, bool notify_text_changed) { if (save_original_selection) saved_temporary_selection_ = GetSelectedRange(); SetAccessibilityLabel(display_text, match); int caret_pos = TextAndUIDirectionMatch() ? display_text.length() : 0; SetWindowTextAndCaretPos(display_text, caret_pos, false, notify_text_changed); }
0
418,083
void operator()(const T& v) const { out << v; }
0
288,242
void GpuProcessHostUIShim::OnAcceleratedSurfaceRelease( const GpuHostMsg_AcceleratedSurfaceRelease_Params& params) { RenderWidgetHostViewPort* view = GetRenderWidgetHostViewFromSurfaceID( params.surface_id); if (!view) return; view->AcceleratedSurfaceRelease(params.identifier); }
1
150,196
static void nfs4_proc_unlink_setup(struct rpc_message *msg, struct inode *dir) { struct nfs_server *server = NFS_SERVER(dir); struct nfs_removeargs *args = msg->rpc_argp; struct nfs_removeres *res = msg->rpc_resp; res->server = server; msg->rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_REMOVE]; nfs41_init_sequence(&args->seq_args, &res->seq_res, 1); }
0
188,061
Element* Document::rootScroller() const { return m_rootScrollerController->get(); }
0
314,421
int sc_file_set_content(sc_file_t *file, const u8 *content, size_t content_len) { u8 *tmp; if (!sc_file_valid(file)) { return SC_ERROR_INVALID_ARGUMENTS; } if (content == NULL) { if (file->encoded_content != NULL) free(file->encoded_content); file->encoded_content = NULL; file->encoded_content_len = 0; return SC_SUCCESS; } tmp = (u8 *) realloc(file->encoded_content, content_len); if (!tmp) { if (file->encoded_content) free(file->encoded_content); file->encoded_content = NULL; file->encoded_content_len = 0; return SC_ERROR_OUT_OF_MEMORY; } file->encoded_content = tmp; memcpy(file->encoded_content, content, content_len); file->encoded_content_len = content_len; return SC_SUCCESS; }
0
122,445
_pickle_Unpickler_find_class_impl(UnpicklerObject *self, PyObject *module_name, PyObject *global_name) /*[clinic end generated code: output=becc08d7f9ed41e3 input=e2e6a865de093ef4]*/ { PyObject *global; PyObject *module; /* Try to map the old names used in Python 2.x to the new ones used in Python 3.x. We do this only with old pickle protocols and when the user has not disabled the feature. */ if (self->proto < 3 && self->fix_imports) { PyObject *key; PyObject *item; PickleState *st = _Pickle_GetGlobalState(); /* Check if the global (i.e., a function or a class) was renamed or moved to another module. */ key = PyTuple_Pack(2, module_name, global_name); if (key == NULL) return NULL; item = PyDict_GetItemWithError(st->name_mapping_2to3, key); Py_DECREF(key); if (item) { if (!PyTuple_Check(item) || PyTuple_GET_SIZE(item) != 2) { PyErr_Format(PyExc_RuntimeError, "_compat_pickle.NAME_MAPPING values should be " "2-tuples, not %.200s", Py_TYPE(item)->tp_name); return NULL; } module_name = PyTuple_GET_ITEM(item, 0); global_name = PyTuple_GET_ITEM(item, 1); if (!PyUnicode_Check(module_name) || !PyUnicode_Check(global_name)) { PyErr_Format(PyExc_RuntimeError, "_compat_pickle.NAME_MAPPING values should be " "pairs of str, not (%.200s, %.200s)", Py_TYPE(module_name)->tp_name, Py_TYPE(global_name)->tp_name); return NULL; } } else if (PyErr_Occurred()) { return NULL; } else { /* Check if the module was renamed. */ item = PyDict_GetItemWithError(st->import_mapping_2to3, module_name); if (item) { if (!PyUnicode_Check(item)) { PyErr_Format(PyExc_RuntimeError, "_compat_pickle.IMPORT_MAPPING values should be " "strings, not %.200s", Py_TYPE(item)->tp_name); return NULL; } module_name = item; } else if (PyErr_Occurred()) { return NULL; } } } module = PyImport_GetModule(module_name); if (module == NULL) { if (PyErr_Occurred()) return NULL; module = PyImport_Import(module_name); if (module == NULL) return NULL; } global = getattribute(module, global_name, self->proto >= 4); Py_DECREF(module); return global; }
0
156,728
void CLASS parse_minolta (int base) { int save, tag, len, offset, high=0, wide=0, i, c; short sorder=order; fseek (ifp, base, SEEK_SET); if (fgetc(ifp) || fgetc(ifp)-'M' || fgetc(ifp)-'R') return; order = fgetc(ifp) * 0x101; offset = base + get4() + 8; while ((save=ftell(ifp)) < offset) { for (tag=i=0; i < 4; i++) tag = tag << 8 | fgetc(ifp); len = get4(); switch (tag) { case 0x505244: /* PRD */ fseek (ifp, 8, SEEK_CUR); high = get2(); wide = get2(); break; #ifdef LIBRAW_LIBRARY_BUILD case 0x524946: /* RIF */ if (!strncasecmp(model,"DSLR-A100", 9)) { fseek(ifp, 8, SEEK_CUR); imgdata.color.WB_Coeffs[LIBRAW_WBI_Tungsten][0] = get2(); imgdata.color.WB_Coeffs[LIBRAW_WBI_Tungsten][2] = get2(); imgdata.color.WB_Coeffs[LIBRAW_WBI_Daylight][0] = get2(); imgdata.color.WB_Coeffs[LIBRAW_WBI_Daylight][2] = get2(); imgdata.color.WB_Coeffs[LIBRAW_WBI_Cloudy][0] = get2(); imgdata.color.WB_Coeffs[LIBRAW_WBI_Cloudy][2] = get2(); imgdata.color.WB_Coeffs[LIBRAW_WBI_FL_W][0] = get2(); imgdata.color.WB_Coeffs[LIBRAW_WBI_FL_W][2] = get2(); imgdata.color.WB_Coeffs[LIBRAW_WBI_Flash][0] = get2(); imgdata.color.WB_Coeffs[LIBRAW_WBI_Flash][2] = get2(); get4(); imgdata.color.WB_Coeffs[LIBRAW_WBI_Shade][0] = get2(); imgdata.color.WB_Coeffs[LIBRAW_WBI_Shade][2] = get2(); imgdata.color.WB_Coeffs[LIBRAW_WBI_FL_D][0] = get2(); imgdata.color.WB_Coeffs[LIBRAW_WBI_FL_D][2] = get2(); imgdata.color.WB_Coeffs[LIBRAW_WBI_FL_N][0] = get2(); imgdata.color.WB_Coeffs[LIBRAW_WBI_FL_N][2] = get2(); imgdata.color.WB_Coeffs[LIBRAW_WBI_FL_WW][0] = get2(); imgdata.color.WB_Coeffs[LIBRAW_WBI_FL_WW][2] = get2(); imgdata.color.WB_Coeffs[LIBRAW_WBI_Daylight][1] = imgdata.color.WB_Coeffs[LIBRAW_WBI_Daylight][3] = imgdata.color.WB_Coeffs[LIBRAW_WBI_Tungsten][1] = imgdata.color.WB_Coeffs[LIBRAW_WBI_Tungsten][3] = imgdata.color.WB_Coeffs[LIBRAW_WBI_Flash][1] = imgdata.color.WB_Coeffs[LIBRAW_WBI_Flash][3] = imgdata.color.WB_Coeffs[LIBRAW_WBI_Cloudy][1] = imgdata.color.WB_Coeffs[LIBRAW_WBI_Cloudy][3] = imgdata.color.WB_Coeffs[LIBRAW_WBI_Shade][1] = imgdata.color.WB_Coeffs[LIBRAW_WBI_Shade][3] = imgdata.color.WB_Coeffs[LIBRAW_WBI_FL_D][1] = imgdata.color.WB_Coeffs[LIBRAW_WBI_FL_D][3] = imgdata.color.WB_Coeffs[LIBRAW_WBI_FL_N][1] = imgdata.color.WB_Coeffs[LIBRAW_WBI_FL_N][3] = imgdata.color.WB_Coeffs[LIBRAW_WBI_FL_W][1] = imgdata.color.WB_Coeffs[LIBRAW_WBI_FL_W][3] = imgdata.color.WB_Coeffs[LIBRAW_WBI_FL_WW][1] = imgdata.color.WB_Coeffs[LIBRAW_WBI_FL_WW][3] = 0x100; } break; #endif case 0x574247: /* WBG */ get4(); i = strcmp(model,"DiMAGE A200") ? 0:3; FORC4 cam_mul[c ^ (c >> 1) ^ i] = get2(); break; case 0x545457: /* TTW */ parse_tiff (ftell(ifp)); data_offset = offset; } fseek (ifp, save+len+8, SEEK_SET); } raw_height = high; raw_width = wide; order = sorder; }
0
518,545
int Field_medium::store(double nr) { ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED; int error= 0; nr=rint(nr); if (unsigned_flag) { if (nr < 0) { int3store(ptr,0); set_warning(ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else if (nr >= (double) (long) (1L << 24)) { uint32 tmp=(uint32) (1L << 24)-1L; int3store(ptr,tmp); set_warning(ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else int3store(ptr,(uint32) nr); } else { if (nr < (double) INT_MIN24) { long tmp=(long) INT_MIN24; int3store(ptr,tmp); set_warning(ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else if (nr > (double) INT_MAX24) { long tmp=(long) INT_MAX24; int3store(ptr,tmp); set_warning(ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else int3store(ptr,(long) nr); } return error; }
0
313,271
Ins_IDEF( INS_ARG ) { TT_DefRecord* def; TT_DefRecord* limit; /* First of all, look for the same function in our table */ def = CUR.IDefs; limit = def + CUR.numIDefs; for ( ; def < limit; def++ ) if ( def->opc == (FT_ULong)args[0] ) break; if ( def == limit ) { /* check that there is enough room for a new instruction */ if ( CUR.numIDefs >= CUR.maxIDefs ) { CUR.error = TT_Err_Too_Many_Instruction_Defs; return; } CUR.numIDefs++; } /* opcode must be unsigned 8-bit integer */ if ( 0 > args[0] || args[0] > 0x00FF ) { CUR.error = TT_Err_Too_Many_Instruction_Defs; return; } def->opc = (FT_Byte)args[0]; def->start = CUR.IP + 1; def->range = CUR.curRange; def->active = TRUE; if ( (FT_ULong)args[0] > CUR.maxIns ) CUR.maxIns = (FT_Byte)args[0]; /* Now skip the whole function definition. */ /* We don't allow nested IDEFs & FDEFs. */ while ( SKIP_Code() == SUCCESS ) { switch ( CUR.opcode ) { case 0x89: /* IDEF */ case 0x2C: /* FDEF */ CUR.error = TT_Err_Nested_DEFS; return; case 0x2D: /* ENDF */ return; } } }
0
344,487
new_msg_lsa_change_notify (u_char msgtype, u_int32_t seqnum, struct in_addr ifaddr, struct in_addr area_id, u_char is_self_originated, struct lsa_header *data) { u_char buf[OSPF_API_MAX_MSG_SIZE]; struct msg_lsa_change_notify *nmsg; int len; assert (data); nmsg = (struct msg_lsa_change_notify *) buf; len = ntohs (data->length) + sizeof (struct msg_lsa_change_notify) - sizeof (struct lsa_header); nmsg->ifaddr = ifaddr; nmsg->area_id = area_id; nmsg->is_self_originated = is_self_originated; memset (&nmsg->pad, 0, sizeof (nmsg->pad)); memcpy (&nmsg->data, data, ntohs (data->length)); return msg_new (msgtype, nmsg, seqnum, len); }
1
122,506
unixWarningHandler(const char* module, const char* fmt, va_list ap) { if (module != NULL) fprintf(stderr, "%s: ", module); fprintf(stderr, "Warning, "); vfprintf(stderr, fmt, ap); fprintf(stderr, ".\n"); }
0
204,296
const AtomicString& ScreenOrientation::orientation(Screen& screen) { ScreenOrientation& screenOrientation = ScreenOrientation::from(screen); if (!screenOrientation.document()) { return orientationToString(blink::WebScreenOrientationPortraitPrimary); } ScreenOrientationController& controller = ScreenOrientationController::from(*screenOrientation.document()); return orientationToString(controller.orientation()); }
0
148,101
static void attr_show_all_iterator(struct hash_backet *backet, struct vty *vty) { struct attr *attr = backet->data; vty_out(vty, "attr[%ld] nexthop %s\n", attr->refcnt, inet_ntoa(attr->nexthop)); vty_out(vty, "\tflags: %" PRIu64 " med: %u local_pref: %u origin: %u weight: %u label: %u\n", attr->flag, attr->med, attr->local_pref, attr->origin, attr->weight, attr->label); }
0
117,667
tsize_t t2p_readwrite_pdf_image_tile(T2P* t2p, TIFF* input, TIFF* output, ttile_t tile){ uint16 edge=0; tsize_t written=0; unsigned char* buffer=NULL; tsize_t bufferoffset=0; unsigned char* samplebuffer=NULL; tsize_t samplebufferoffset=0; tsize_t read=0; uint16 i=0; ttile_t tilecount=0; /* tsize_t tilesize=0; */ ttile_t septilecount=0; tsize_t septilesize=0; #ifdef JPEG_SUPPORT unsigned char* jpt; float* xfloatp; uint32 xuint32=0; #endif /* Fail if prior error (in particular, can't trust tiff_datasize) */ if (t2p->t2p_error != T2P_ERR_OK) return(0); edge |= t2p_tile_is_right_edge(t2p->tiff_tiles[t2p->pdf_page], tile); edge |= t2p_tile_is_bottom_edge(t2p->tiff_tiles[t2p->pdf_page], tile); if( (t2p->pdf_transcode == T2P_TRANSCODE_RAW) && ((edge == 0) #if defined(JPEG_SUPPORT) || defined(OJPEG_SUPPORT) || (t2p->pdf_compression == T2P_COMPRESS_JPEG) #endif ) ){ #ifdef CCITT_SUPPORT if(t2p->pdf_compression == T2P_COMPRESS_G4){ buffer= (unsigned char*) _TIFFmalloc(t2p->tiff_datasize); if(buffer==NULL){ TIFFError(TIFF2PDF_MODULE, "Can't allocate %lu bytes of memory " "for t2p_readwrite_pdf_image_tile, %s", (unsigned long) t2p->tiff_datasize, TIFFFileName(input)); t2p->t2p_error = T2P_ERR_ERROR; return(0); } TIFFReadRawTile(input, tile, (tdata_t) buffer, t2p->tiff_datasize); if (t2p->tiff_fillorder==FILLORDER_LSB2MSB){ TIFFReverseBits(buffer, t2p->tiff_datasize); } t2pWriteFile(output, (tdata_t) buffer, t2p->tiff_datasize); _TIFFfree(buffer); return(t2p->tiff_datasize); } #endif #ifdef ZIP_SUPPORT if(t2p->pdf_compression == T2P_COMPRESS_ZIP){ buffer= (unsigned char*) _TIFFmalloc(t2p->tiff_datasize); if(buffer==NULL){ TIFFError(TIFF2PDF_MODULE, "Can't allocate %lu bytes of memory " "for t2p_readwrite_pdf_image_tile, %s", (unsigned long) t2p->tiff_datasize, TIFFFileName(input)); t2p->t2p_error = T2P_ERR_ERROR; return(0); } TIFFReadRawTile(input, tile, (tdata_t) buffer, t2p->tiff_datasize); if (t2p->tiff_fillorder==FILLORDER_LSB2MSB){ TIFFReverseBits(buffer, t2p->tiff_datasize); } t2pWriteFile(output, (tdata_t) buffer, t2p->tiff_datasize); _TIFFfree(buffer); return(t2p->tiff_datasize); } #endif #ifdef OJPEG_SUPPORT if(t2p->tiff_compression == COMPRESSION_OJPEG){ if(! t2p->pdf_ojpegdata){ TIFFError(TIFF2PDF_MODULE, "No support for OJPEG image %s with " "bad tables", TIFFFileName(input)); t2p->t2p_error = T2P_ERR_ERROR; return(0); } buffer=(unsigned char*) _TIFFmalloc(t2p->tiff_datasize); if(buffer==NULL){ TIFFError(TIFF2PDF_MODULE, "Can't allocate %lu bytes of memory " "for t2p_readwrite_pdf_image, %s", (unsigned long) t2p->tiff_datasize, TIFFFileName(input)); t2p->t2p_error = T2P_ERR_ERROR; return(0); } _TIFFmemcpy(buffer, t2p->pdf_ojpegdata, t2p->pdf_ojpegdatalength); if(edge!=0){ if(t2p_tile_is_bottom_edge(t2p->tiff_tiles[t2p->pdf_page], tile)){ buffer[7]= (t2p->tiff_tiles[t2p->pdf_page].tiles_edgetilelength >> 8) & 0xff; buffer[8]= (t2p->tiff_tiles[t2p->pdf_page].tiles_edgetilelength ) & 0xff; } if(t2p_tile_is_right_edge(t2p->tiff_tiles[t2p->pdf_page], tile)){ buffer[9]= (t2p->tiff_tiles[t2p->pdf_page].tiles_edgetilewidth >> 8) & 0xff; buffer[10]= (t2p->tiff_tiles[t2p->pdf_page].tiles_edgetilewidth ) & 0xff; } } bufferoffset=t2p->pdf_ojpegdatalength; bufferoffset+=TIFFReadRawTile(input, tile, (tdata_t) &(((unsigned char*)buffer)[bufferoffset]), -1); ((unsigned char*)buffer)[bufferoffset++]=0xff; ((unsigned char*)buffer)[bufferoffset++]=0xd9; t2pWriteFile(output, (tdata_t) buffer, bufferoffset); _TIFFfree(buffer); return(bufferoffset); } #endif #ifdef JPEG_SUPPORT if(t2p->tiff_compression == COMPRESSION_JPEG){ unsigned char table_end[2]; uint32 count = 0; buffer= (unsigned char*) _TIFFmalloc(t2p->tiff_datasize); if(buffer==NULL){ TIFFError(TIFF2PDF_MODULE, "Can't allocate " TIFF_SIZE_FORMAT " bytes of memory " "for t2p_readwrite_pdf_image_tile, %s", (TIFF_SIZE_T) t2p->tiff_datasize, TIFFFileName(input)); t2p->t2p_error = T2P_ERR_ERROR; return(0); } if(TIFFGetField(input, TIFFTAG_JPEGTABLES, &count, &jpt) != 0) { if (count > 0) { _TIFFmemcpy(buffer, jpt, count); bufferoffset += count - 2; table_end[0] = buffer[bufferoffset-2]; table_end[1] = buffer[bufferoffset-1]; } if (count > 0) { xuint32 = bufferoffset; bufferoffset += TIFFReadRawTile( input, tile, (tdata_t) &(((unsigned char*)buffer)[bufferoffset-2]), -1); buffer[xuint32-2]=table_end[0]; buffer[xuint32-1]=table_end[1]; } else { bufferoffset += TIFFReadRawTile( input, tile, (tdata_t) &(((unsigned char*)buffer)[bufferoffset]), -1); } } t2pWriteFile(output, (tdata_t) buffer, bufferoffset); _TIFFfree(buffer); return(bufferoffset); } #endif (void)0; } if(t2p->pdf_sample==T2P_SAMPLE_NOTHING){ buffer = (unsigned char*) _TIFFmalloc(t2p->tiff_datasize); if(buffer==NULL){ TIFFError(TIFF2PDF_MODULE, "Can't allocate %lu bytes of memory for " "t2p_readwrite_pdf_image_tile, %s", (unsigned long) t2p->tiff_datasize, TIFFFileName(input)); t2p->t2p_error = T2P_ERR_ERROR; return(0); } read = TIFFReadEncodedTile( input, tile, (tdata_t) &buffer[bufferoffset], t2p->tiff_datasize); if(read==-1){ TIFFError(TIFF2PDF_MODULE, "Error on decoding tile %u of %s", tile, TIFFFileName(input)); _TIFFfree(buffer); t2p->t2p_error=T2P_ERR_ERROR; return(0); } } else { if(t2p->pdf_sample == T2P_SAMPLE_PLANAR_SEPARATE_TO_CONTIG){ septilesize=TIFFTileSize(input); septilecount=TIFFNumberOfTiles(input); /* tilesize=septilesize*t2p->tiff_samplesperpixel; */ tilecount=septilecount/t2p->tiff_samplesperpixel; buffer = (unsigned char*) _TIFFmalloc(t2p->tiff_datasize); if(buffer==NULL){ TIFFError(TIFF2PDF_MODULE, "Can't allocate %lu bytes of memory " "for t2p_readwrite_pdf_image_tile, %s", (unsigned long) t2p->tiff_datasize, TIFFFileName(input)); t2p->t2p_error = T2P_ERR_ERROR; return(0); } samplebuffer = (unsigned char*) _TIFFmalloc(t2p->tiff_datasize); if(samplebuffer==NULL){ TIFFError(TIFF2PDF_MODULE, "Can't allocate %lu bytes of memory " "for t2p_readwrite_pdf_image_tile, %s", (unsigned long) t2p->tiff_datasize, TIFFFileName(input)); t2p->t2p_error = T2P_ERR_ERROR; return(0); } samplebufferoffset=0; for(i=0;i<t2p->tiff_samplesperpixel;i++){ read = TIFFReadEncodedTile(input, tile + i*tilecount, (tdata_t) &(samplebuffer[samplebufferoffset]), septilesize); if(read==-1){ TIFFError(TIFF2PDF_MODULE, "Error on decoding tile %u of %s", tile + i*tilecount, TIFFFileName(input)); _TIFFfree(samplebuffer); _TIFFfree(buffer); t2p->t2p_error=T2P_ERR_ERROR; return(0); } samplebufferoffset+=read; } t2p_sample_planar_separate_to_contig( t2p, &(buffer[bufferoffset]), samplebuffer, samplebufferoffset); bufferoffset+=samplebufferoffset; _TIFFfree(samplebuffer); } if(buffer==NULL){ buffer = (unsigned char*) _TIFFmalloc(t2p->tiff_datasize); if(buffer==NULL){ TIFFError(TIFF2PDF_MODULE, "Can't allocate %lu bytes of memory " "for t2p_readwrite_pdf_image_tile, %s", (unsigned long) t2p->tiff_datasize, TIFFFileName(input)); t2p->t2p_error = T2P_ERR_ERROR; return(0); } read = TIFFReadEncodedTile( input, tile, (tdata_t) &buffer[bufferoffset], t2p->tiff_datasize); if(read==-1){ TIFFError(TIFF2PDF_MODULE, "Error on decoding tile %u of %s", tile, TIFFFileName(input)); _TIFFfree(buffer); t2p->t2p_error=T2P_ERR_ERROR; return(0); } } if(t2p->pdf_sample & T2P_SAMPLE_RGBA_TO_RGB){ t2p->tiff_datasize=t2p_sample_rgba_to_rgb( (tdata_t)buffer, t2p->tiff_tiles[t2p->pdf_page].tiles_tilewidth *t2p->tiff_tiles[t2p->pdf_page].tiles_tilelength); } if(t2p->pdf_sample & T2P_SAMPLE_RGBAA_TO_RGB){ t2p->tiff_datasize=t2p_sample_rgbaa_to_rgb( (tdata_t)buffer, t2p->tiff_tiles[t2p->pdf_page].tiles_tilewidth *t2p->tiff_tiles[t2p->pdf_page].tiles_tilelength); } if(t2p->pdf_sample & T2P_SAMPLE_YCBCR_TO_RGB){ TIFFError(TIFF2PDF_MODULE, "No support for YCbCr to RGB in tile for %s", TIFFFileName(input)); _TIFFfree(buffer); t2p->t2p_error = T2P_ERR_ERROR; return(0); } if(t2p->pdf_sample & T2P_SAMPLE_LAB_SIGNED_TO_UNSIGNED){ t2p->tiff_datasize=t2p_sample_lab_signed_to_unsigned( (tdata_t)buffer, t2p->tiff_tiles[t2p->pdf_page].tiles_tilewidth *t2p->tiff_tiles[t2p->pdf_page].tiles_tilelength); } } if(t2p_tile_is_right_edge(t2p->tiff_tiles[t2p->pdf_page], tile) != 0){ t2p_tile_collapse_left( buffer, TIFFTileRowSize(input), t2p->tiff_tiles[t2p->pdf_page].tiles_tilewidth, t2p->tiff_tiles[t2p->pdf_page].tiles_edgetilewidth, t2p->tiff_tiles[t2p->pdf_page].tiles_tilelength); } t2p_disable(output); TIFFSetField(output, TIFFTAG_PHOTOMETRIC, t2p->tiff_photometric); TIFFSetField(output, TIFFTAG_BITSPERSAMPLE, t2p->tiff_bitspersample); TIFFSetField(output, TIFFTAG_SAMPLESPERPIXEL, t2p->tiff_samplesperpixel); if(t2p_tile_is_right_edge(t2p->tiff_tiles[t2p->pdf_page], tile) == 0){ TIFFSetField( output, TIFFTAG_IMAGEWIDTH, t2p->tiff_tiles[t2p->pdf_page].tiles_tilewidth); } else { TIFFSetField( output, TIFFTAG_IMAGEWIDTH, t2p->tiff_tiles[t2p->pdf_page].tiles_edgetilewidth); } if(t2p_tile_is_bottom_edge(t2p->tiff_tiles[t2p->pdf_page], tile) == 0){ TIFFSetField( output, TIFFTAG_IMAGELENGTH, t2p->tiff_tiles[t2p->pdf_page].tiles_tilelength); TIFFSetField( output, TIFFTAG_ROWSPERSTRIP, t2p->tiff_tiles[t2p->pdf_page].tiles_tilelength); } else { TIFFSetField( output, TIFFTAG_IMAGELENGTH, t2p->tiff_tiles[t2p->pdf_page].tiles_edgetilelength); TIFFSetField( output, TIFFTAG_ROWSPERSTRIP, t2p->tiff_tiles[t2p->pdf_page].tiles_edgetilelength); } TIFFSetField(output, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG); TIFFSetField(output, TIFFTAG_FILLORDER, FILLORDER_MSB2LSB); switch(t2p->pdf_compression){ case T2P_COMPRESS_NONE: TIFFSetField(output, TIFFTAG_COMPRESSION, COMPRESSION_NONE); break; #ifdef CCITT_SUPPORT case T2P_COMPRESS_G4: TIFFSetField(output, TIFFTAG_COMPRESSION, COMPRESSION_CCITTFAX4); break; #endif #ifdef JPEG_SUPPORT case T2P_COMPRESS_JPEG: if (t2p->tiff_photometric==PHOTOMETRIC_YCBCR) { uint16 hor = 0, ver = 0; if (TIFFGetField(input, TIFFTAG_YCBCRSUBSAMPLING, &hor, &ver)!=0) { if (hor != 0 && ver != 0) { TIFFSetField(output, TIFFTAG_YCBCRSUBSAMPLING, hor, ver); } } if(TIFFGetField(input, TIFFTAG_REFERENCEBLACKWHITE, &xfloatp)!=0){ TIFFSetField(output, TIFFTAG_REFERENCEBLACKWHITE, xfloatp); } } TIFFSetField(output, TIFFTAG_COMPRESSION, COMPRESSION_JPEG); TIFFSetField(output, TIFFTAG_JPEGTABLESMODE, 0); /* JPEGTABLESMODE_NONE */ if(t2p->pdf_colorspace & (T2P_CS_RGB | T2P_CS_LAB)){ TIFFSetField(output, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_YCBCR); if(t2p->tiff_photometric != PHOTOMETRIC_YCBCR){ TIFFSetField(output, TIFFTAG_JPEGCOLORMODE, JPEGCOLORMODE_RGB); } else { TIFFSetField(output, TIFFTAG_JPEGCOLORMODE, JPEGCOLORMODE_RAW); } } if(t2p->pdf_colorspace & T2P_CS_GRAY){ (void)0; } if(t2p->pdf_colorspace & T2P_CS_CMYK){ (void)0; } if(t2p->pdf_defaultcompressionquality != 0){ TIFFSetField(output, TIFFTAG_JPEGQUALITY, t2p->pdf_defaultcompressionquality); } break; #endif #ifdef ZIP_SUPPORT case T2P_COMPRESS_ZIP: TIFFSetField(output, TIFFTAG_COMPRESSION, COMPRESSION_DEFLATE); if(t2p->pdf_defaultcompressionquality%100 != 0){ TIFFSetField(output, TIFFTAG_PREDICTOR, t2p->pdf_defaultcompressionquality % 100); } if(t2p->pdf_defaultcompressionquality/100 != 0){ TIFFSetField(output, TIFFTAG_ZIPQUALITY, (t2p->pdf_defaultcompressionquality / 100)); } break; #endif default: break; } t2p_enable(output); t2p->outputwritten = 0; bufferoffset = TIFFWriteEncodedStrip(output, (tstrip_t) 0, buffer, TIFFStripSize(output)); if (buffer != NULL) { _TIFFfree(buffer); buffer = NULL; } if (bufferoffset == -1) { TIFFError(TIFF2PDF_MODULE, "Error writing encoded tile to output PDF %s", TIFFFileName(output)); t2p->t2p_error = T2P_ERR_ERROR; return(0); } written = t2p->outputwritten; return(written); }
0
12,761
PHP_METHOD(Phar, delete) { char *fname; size_t fname_len; char *error; phar_entry_info *entry; PHAR_ARCHIVE_OBJECT(); if (PHAR_G(readonly) && !phar_obj->archive->is_data) { zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Cannot write out phar archive, phar is read-only"); return; } if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &fname, &fname_len) == FAILURE) { RETURN_FALSE; } if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive))) { zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname); return; } if (zend_hash_str_exists(&phar_obj->archive->manifest, fname, (uint) fname_len)) { if (NULL != (entry = zend_hash_str_find_ptr(&phar_obj->archive->manifest, fname, (uint) fname_len))) { if (entry->is_deleted) { /* entry is deleted, but has not been flushed to disk yet */ RETURN_TRUE; } else { entry->is_deleted = 1; entry->is_modified = 1; phar_obj->archive->is_modified = 1; } } } else { zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Entry %s does not exist and cannot be deleted", fname); RETURN_FALSE; } phar_flush(phar_obj->archive, NULL, 0, 0, &error); if (error) { zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error); efree(error); } RETURN_TRUE; }
1
399,311
void kthread_delayed_work_timer_fn(unsigned long __data) { struct kthread_delayed_work *dwork = (struct kthread_delayed_work *)__data; struct kthread_work *work = &dwork->work; struct kthread_worker *worker = work->worker; /* * This might happen when a pending work is reinitialized. * It means that it is used a wrong way. */ if (WARN_ON_ONCE(!worker)) return; spin_lock(&worker->lock); /* Work must not be used with >1 worker, see kthread_queue_work(). */ WARN_ON_ONCE(work->worker != worker); /* Move the work from worker->delayed_work_list. */ WARN_ON_ONCE(list_empty(&work->node)); list_del_init(&work->node); kthread_insert_work(worker, work, &worker->work_list); spin_unlock(&worker->lock); }
0
94,007
static void deliver_smi_err_response(struct ipmi_smi *intf, struct ipmi_smi_msg *msg, unsigned char err) { msg->rsp[0] = msg->data[0] | 4; msg->rsp[1] = msg->data[1]; msg->rsp[2] = err; msg->rsp_size = 3; /* It's an error, so it will never requeue, no need to check return. */ handle_one_recv_msg(intf, msg); }
0
149,821
static inline unsigned char read_buf(struct n_tty_data *ldata, size_t i) { return ldata->read_buf[i & (N_TTY_BUF_SIZE - 1)]; }
0
518,017
bool Item_cache_wrapper::send(Protocol *protocol, st_value *buffer) { if (result_field) return protocol->store(result_field); return Item::send(protocol, buffer); }
0
36,596
compat_mpt_command(struct file *filp, unsigned int cmd, unsigned long arg) { struct mpt_ioctl_command32 karg32; struct mpt_ioctl_command32 __user *uarg = (struct mpt_ioctl_command32 __user *) arg; struct mpt_ioctl_command karg; MPT_ADAPTER *iocp = NULL; int iocnum, iocnumX; int nonblock = (filp->f_flags & O_NONBLOCK); int ret; if (copy_from_user(&karg32, (char __user *)arg, sizeof(karg32))) return -EFAULT; /* Verify intended MPT adapter */ iocnumX = karg32.hdr.iocnum & 0xFF; if (((iocnum = mpt_verify_adapter(iocnumX, &iocp)) < 0) || (iocp == NULL)) { printk(KERN_DEBUG MYNAM "::compat_mpt_command @%d - ioc%d not found!\n", __LINE__, iocnumX); return -ENODEV; } if ((ret = mptctl_syscall_down(iocp, nonblock)) != 0) return ret; dctlprintk(iocp, printk(MYIOC_s_DEBUG_FMT "compat_mpt_command() called\n", iocp->name)); /* Copy data to karg */ karg.hdr.iocnum = karg32.hdr.iocnum; karg.hdr.port = karg32.hdr.port; karg.timeout = karg32.timeout; karg.maxReplyBytes = karg32.maxReplyBytes; karg.dataInSize = karg32.dataInSize; karg.dataOutSize = karg32.dataOutSize; karg.maxSenseBytes = karg32.maxSenseBytes; karg.dataSgeOffset = karg32.dataSgeOffset; karg.replyFrameBufPtr = (char __user *)(unsigned long)karg32.replyFrameBufPtr; karg.dataInBufPtr = (char __user *)(unsigned long)karg32.dataInBufPtr; karg.dataOutBufPtr = (char __user *)(unsigned long)karg32.dataOutBufPtr; karg.senseDataPtr = (char __user *)(unsigned long)karg32.senseDataPtr; /* Pass new structure to do_mpt_command */ ret = mptctl_do_mpt_command (iocp, karg, &uarg->MF); mutex_unlock(&iocp->ioctl_cmds.mutex); return ret; }
0
75,600
GF_Err hclr_box_size(GF_Box *s) { s->size += 4; return GF_OK; }
0
240,184
void GLES2Implementation::IssueBeginQuery(GLenum target, GLuint id, uint32_t sync_data_shm_id, uint32_t sync_data_shm_offset) { helper_->BeginQueryEXT(target, id, sync_data_shm_id, sync_data_shm_offset); }
0
201,854
void webkit_web_view_set_editable(WebKitWebView* webView, gboolean flag) { g_return_if_fail(WEBKIT_IS_WEB_VIEW(webView)); flag = flag != FALSE; if (flag == webkit_web_view_get_editable(webView)) return; core(webView)->setEditable(flag); Frame* frame = core(webView)->mainFrame(); g_return_if_fail(frame); if (flag) { frame->editor()->applyEditingStyleToBodyElement(); } g_object_notify(G_OBJECT(webView), "editable"); }
0
1,696
static void rlvl_destroy ( jpc_enc_rlvl_t * rlvl ) { jpc_enc_band_t * band ; uint_fast16_t bandno ; if ( rlvl -> bands ) { for ( bandno = 0 , band = rlvl -> bands ; bandno < rlvl -> numbands ; ++ bandno , ++ band ) { band_destroy ( band ) ; } jas_free ( rlvl -> bands ) ; } }
1
409,501
static struct cnic_eth_dev *bnx2x_cnic_probe(struct net_device *dev) { struct bnx2x *bp = netdev_priv(dev); struct cnic_eth_dev *cp = &bp->cnic_eth_dev; /* If both iSCSI and FCoE are disabled - return NULL in * order to indicate CNIC that it should not try to work * with this device. */ if (NO_ISCSI(bp) && NO_FCOE(bp)) return NULL; cp->drv_owner = THIS_MODULE; cp->chip_id = CHIP_ID(bp); cp->pdev = bp->pdev; cp->io_base = bp->regview; cp->io_base2 = bp->doorbells; cp->max_kwqe_pending = 8; cp->ctx_blk_size = CDU_ILT_PAGE_SZ; cp->ctx_tbl_offset = FUNC_ILT_BASE(BP_FUNC(bp)) + bnx2x_cid_ilt_lines(bp); cp->ctx_tbl_len = CNIC_ILT_LINES; cp->starting_cid = bnx2x_cid_ilt_lines(bp) * ILT_PAGE_CIDS; cp->drv_submit_kwqes_16 = bnx2x_cnic_sp_queue; cp->drv_ctl = bnx2x_drv_ctl; cp->drv_get_fc_npiv_tbl = bnx2x_get_fc_npiv; cp->drv_register_cnic = bnx2x_register_cnic; cp->drv_unregister_cnic = bnx2x_unregister_cnic; cp->fcoe_init_cid = BNX2X_FCOE_ETH_CID(bp); cp->iscsi_l2_client_id = bnx2x_cnic_eth_cl_id(bp, BNX2X_ISCSI_ETH_CL_ID_IDX); cp->iscsi_l2_cid = BNX2X_ISCSI_ETH_CID(bp); if (NO_ISCSI_OOO(bp)) cp->drv_state |= CNIC_DRV_STATE_NO_ISCSI_OOO; if (NO_ISCSI(bp)) cp->drv_state |= CNIC_DRV_STATE_NO_ISCSI; if (NO_FCOE(bp)) cp->drv_state |= CNIC_DRV_STATE_NO_FCOE; BNX2X_DEV_INFO( "page_size %d, tbl_offset %d, tbl_lines %d, starting cid %d\n", cp->ctx_blk_size, cp->ctx_tbl_offset, cp->ctx_tbl_len, cp->starting_cid); return cp; }
0
192,076
virtual ~BacktraceOutputHandler() {}
0
361,864
void Server::msgReject(ServerUser *, MumbleProto::Reject &) { }
0
239,224
wifi_error wifi_set_nodfs_flag(wifi_interface_handle handle, u32 nodfs) { SetNodfsCommand command(handle, nodfs); return (wifi_error) command.requestResponse(); }
0
400,130
router_get_fallback_dir_servers(void) { if (!fallback_dir_servers) fallback_dir_servers = smartlist_new(); return fallback_dir_servers; }
0
429,509
file_changed (GFileMonitor *monitor, GFile *file, GFile *other_file, GFileMonitorEvent event_type, gpointer user_data) { GKeyfileSettingsBackend *kfsb = user_data; /* Ignore file deletions, let the GKeyFile content remain in tact. */ if (event_type != G_FILE_MONITOR_EVENT_DELETED) g_keyfile_settings_backend_keyfile_reload (kfsb); }
0
230,656
void FreeSprite(DeviceIntPtr dev) { if (DevHasCursor(dev) && dev->spriteInfo->sprite) { if (dev->spriteInfo->sprite->current) FreeCursor(dev->spriteInfo->sprite->current, None); free(dev->spriteInfo->sprite->spriteTrace); free(dev->spriteInfo->sprite); } dev->spriteInfo->sprite = NULL; }
0
194,943
MojoResult Core::AcquireDispatchersForTransit( const MojoHandle* handles, size_t num_handles, std::vector<Dispatcher::DispatcherInTransit>* dispatchers) { base::AutoLock lock(handles_->GetLock()); MojoResult rv = handles_->BeginTransit(handles, num_handles, dispatchers); if (rv != MOJO_RESULT_OK) handles_->CancelTransit(*dispatchers); return rv; }
0
60,184
static bool tcp_rcv_fastopen_synack(struct sock *sk, struct sk_buff *synack, struct tcp_fastopen_cookie *cookie) { struct tcp_sock *tp = tcp_sk(sk); struct sk_buff *data = tp->syn_data ? tcp_write_queue_head(sk) : NULL; u16 mss = tp->rx_opt.mss_clamp, try_exp = 0; bool syn_drop = false; if (mss == tp->rx_opt.user_mss) { struct tcp_options_received opt; /* Get original SYNACK MSS value if user MSS sets mss_clamp */ tcp_clear_options(&opt); opt.user_mss = opt.mss_clamp = 0; tcp_parse_options(synack, &opt, 0, NULL); mss = opt.mss_clamp; } if (!tp->syn_fastopen) { /* Ignore an unsolicited cookie */ cookie->len = -1; } else if (tp->total_retrans) { /* SYN timed out and the SYN-ACK neither has a cookie nor * acknowledges data. Presumably the remote received only * the retransmitted (regular) SYNs: either the original * SYN-data or the corresponding SYN-ACK was dropped. */ syn_drop = (cookie->len < 0 && data); } else if (cookie->len < 0 && !tp->syn_data) { /* We requested a cookie but didn't get it. If we did not use * the (old) exp opt format then try so next time (try_exp=1). * Otherwise we go back to use the RFC7413 opt (try_exp=2). */ try_exp = tp->syn_fastopen_exp ? 2 : 1; } tcp_fastopen_cache_set(sk, mss, cookie, syn_drop, try_exp); if (data) { /* Retransmit unacked data in SYN */ tcp_for_write_queue_from(data, sk) { if (data == tcp_send_head(sk) || __tcp_retransmit_skb(sk, data)) break; } tcp_rearm_rto(sk); NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPFASTOPENACTIVEFAIL); return true; } tp->syn_data_acked = tp->syn_data; if (tp->syn_data_acked) NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPFASTOPENACTIVE); return false; }
0