idx
int64 | func
string | target
int64 |
|---|---|---|
477,814
|
static int rtas_name_matches(char *s1, char *s2)
{
struct kvm_rtas_token_args args;
return !strncmp(s1, s2, sizeof(args.name));
}
| 0
|
459,094
|
int tcf_classify(struct sk_buff *skb,
const struct tcf_block *block,
const struct tcf_proto *tp,
struct tcf_result *res, bool compat_mode)
{
#if !IS_ENABLED(CONFIG_NET_TC_SKB_EXT)
u32 last_executed_chain = 0;
return __tcf_classify(skb, tp, tp, res, compat_mode,
&last_executed_chain);
#else
u32 last_executed_chain = tp ? tp->chain->index : 0;
const struct tcf_proto *orig_tp = tp;
struct tc_skb_ext *ext;
int ret;
if (block) {
ext = skb_ext_find(skb, TC_SKB_EXT);
if (ext && ext->chain) {
struct tcf_chain *fchain;
fchain = tcf_chain_lookup_rcu(block, ext->chain);
if (!fchain)
return TC_ACT_SHOT;
/* Consume, so cloned/redirect skbs won't inherit ext */
skb_ext_del(skb, TC_SKB_EXT);
tp = rcu_dereference_bh(fchain->filter_chain);
last_executed_chain = fchain->index;
}
}
ret = __tcf_classify(skb, tp, orig_tp, res, compat_mode,
&last_executed_chain);
/* If we missed on some chain */
if (ret == TC_ACT_UNSPEC && last_executed_chain) {
struct tc_skb_cb *cb = tc_skb_cb(skb);
ext = tc_skb_ext_alloc(skb);
if (WARN_ON_ONCE(!ext))
return TC_ACT_SHOT;
ext->chain = last_executed_chain;
ext->mru = cb->mru;
ext->post_ct = cb->post_ct;
ext->post_ct_snat = cb->post_ct_snat;
ext->post_ct_dnat = cb->post_ct_dnat;
ext->zone = cb->zone;
}
return ret;
#endif
}
| 0
|
387,816
|
void InstanceKlass::ensure_space_for_methodids(int start_offset) {
int new_jmeths = 0;
int length = methods()->length();
for (int index = start_offset; index < length; index++) {
Method* m = methods()->at(index);
jmethodID id = m->find_jmethod_id_or_null();
if (id == NULL) {
new_jmeths++;
}
}
if (new_jmeths != 0) {
Method::ensure_jmethod_ids(class_loader_data(), new_jmeths);
}
}
| 0
|
309,901
|
NCURSES_SP_NAME(color_content) (NCURSES_SP_DCLx
NCURSES_COLOR_T color,
NCURSES_COLOR_T *r,
NCURSES_COLOR_T *g,
NCURSES_COLOR_T *b)
{
int my_r, my_g, my_b;
int rc = _nc_color_content(SP_PARM, color, &my_r, &my_g, &my_b);
if (rc == OK) {
*r = limit_COLOR(my_r);
*g = limit_COLOR(my_g);
*b = limit_COLOR(my_b);
}
return rc;
}
| 0
|
231,695
|
TEST_F(QuicServerTransportTest, RecvNewConnectionIdNoopValidDuplicate) {
auto& conn = server->getNonConstConn();
conn.transportSettings.selfActiveConnectionIdLimit = 1;
ConnectionId connId2({5, 5, 5, 5});
conn.peerConnectionIds.emplace_back(connId2, 1);
ShortHeader header(ProtectionType::KeyPhaseZero, *conn.clientConnectionId, 1);
RegularQuicPacketBuilder builder(
conn.udpSendPacketLen, std::move(header), 0 /* largestAcked */);
builder.encodePacketHeader();
ASSERT_TRUE(builder.canBuildPacket());
NewConnectionIdFrame newConnId(1, 0, connId2, StatelessResetToken());
writeSimpleFrame(QuicSimpleFrame(newConnId), builder);
auto packet = std::move(builder).buildPacket();
EXPECT_EQ(conn.peerConnectionIds.size(), 2);
deliverData(packetToBuf(packet), false);
EXPECT_EQ(conn.peerConnectionIds.size(), 2);
}
| 0
|
300,748
|
static int tipc_sendmcast(struct socket *sock, struct tipc_uaddr *ua,
struct msghdr *msg, size_t dlen, long timeout)
{
struct sock *sk = sock->sk;
struct tipc_sock *tsk = tipc_sk(sk);
struct tipc_msg *hdr = &tsk->phdr;
struct net *net = sock_net(sk);
int mtu = tipc_bcast_get_mtu(net);
struct sk_buff_head pkts;
struct tipc_nlist dsts;
int rc;
if (tsk->group)
return -EACCES;
/* Block or return if any destination link is congested */
rc = tipc_wait_for_cond(sock, &timeout, !tsk->cong_link_cnt);
if (unlikely(rc))
return rc;
/* Lookup destination nodes */
tipc_nlist_init(&dsts, tipc_own_addr(net));
tipc_nametbl_lookup_mcast_nodes(net, ua, &dsts);
if (!dsts.local && !dsts.remote)
return -EHOSTUNREACH;
/* Build message header */
msg_set_type(hdr, TIPC_MCAST_MSG);
msg_set_hdr_sz(hdr, MCAST_H_SIZE);
msg_set_lookup_scope(hdr, TIPC_CLUSTER_SCOPE);
msg_set_destport(hdr, 0);
msg_set_destnode(hdr, 0);
msg_set_nametype(hdr, ua->sr.type);
msg_set_namelower(hdr, ua->sr.lower);
msg_set_nameupper(hdr, ua->sr.upper);
/* Build message as chain of buffers */
__skb_queue_head_init(&pkts);
rc = tipc_msg_build(hdr, msg, 0, dlen, mtu, &pkts);
/* Send message if build was successful */
if (unlikely(rc == dlen)) {
trace_tipc_sk_sendmcast(sk, skb_peek(&pkts),
TIPC_DUMP_SK_SNDQ, " ");
rc = tipc_mcast_xmit(net, &pkts, &tsk->mc_method, &dsts,
&tsk->cong_link_cnt);
}
tipc_nlist_purge(&dsts);
return rc ? rc : dlen;
}
| 0
|
424,914
|
iwl_trans_pcie_dump_monitor(struct iwl_trans *trans,
struct iwl_fw_error_dump_data **data,
u32 monitor_len)
{
u32 len = 0;
if (trans->dbg.dest_tlv ||
(trans->dbg.num_blocks &&
(trans->trans_cfg->device_family == IWL_DEVICE_FAMILY_7000 ||
trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_AX210))) {
struct iwl_fw_error_dump_fw_mon *fw_mon_data;
(*data)->type = cpu_to_le32(IWL_FW_ERROR_DUMP_FW_MONITOR);
fw_mon_data = (void *)(*data)->data;
iwl_trans_pcie_dump_pointers(trans, fw_mon_data);
len += sizeof(**data) + sizeof(*fw_mon_data);
if (trans->dbg.num_blocks) {
memcpy(fw_mon_data->data,
trans->dbg.fw_mon[0].block,
trans->dbg.fw_mon[0].size);
monitor_len = trans->dbg.fw_mon[0].size;
} else if (trans->dbg.dest_tlv->monitor_mode == SMEM_MODE) {
u32 base = le32_to_cpu(fw_mon_data->fw_mon_base_ptr);
/*
* Update pointers to reflect actual values after
* shifting
*/
if (trans->dbg.dest_tlv->version) {
base = (iwl_read_prph(trans, base) &
IWL_LDBG_M2S_BUF_BA_MSK) <<
trans->dbg.dest_tlv->base_shift;
base *= IWL_M2S_UNIT_SIZE;
base += trans->cfg->smem_offset;
} else {
base = iwl_read_prph(trans, base) <<
trans->dbg.dest_tlv->base_shift;
}
iwl_trans_read_mem(trans, base, fw_mon_data->data,
monitor_len / sizeof(u32));
} else if (trans->dbg.dest_tlv->monitor_mode == MARBH_MODE) {
monitor_len =
iwl_trans_pci_dump_marbh_monitor(trans,
fw_mon_data,
monitor_len);
} else {
/* Didn't match anything - output no monitor data */
monitor_len = 0;
}
len += monitor_len;
(*data)->len = cpu_to_le32(monitor_len + sizeof(*fw_mon_data));
}
return len;
}
| 0
|
473,837
|
utf32le_mbc_enc_len(const UChar* p ARG_UNUSED, const OnigUChar* e ARG_UNUSED,
OnigEncoding enc ARG_UNUSED)
{
return 4;
}
| 0
|
498,097
|
static const char *fmt_date(time_t secs, const char *format, int local_time)
{
static char buf[64];
struct tm *time;
if (!secs)
return "";
if (local_time)
time = localtime(&secs);
else
time = gmtime(&secs);
strftime(buf, sizeof(buf)-1, format, time);
return buf;
}
| 0
|
274,725
|
callbacks_change_tool (GtkButton *button, gpointer user_data) {
gint toolNumber = GPOINTER_TO_INT (user_data);
/* make sure se don't get caught in endless recursion here */
if (screen.win.updatingTools)
return;
screen.win.updatingTools = TRUE;
gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (screen.win.toolButtonPointer), FALSE);
gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (screen.win.toolButtonPan), FALSE);
gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (screen.win.toolButtonZoom), FALSE);
gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (screen.win.toolButtonMeasure), FALSE);
switch (toolNumber) {
case POINTER:
gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (screen.win.toolButtonPointer), TRUE);
screen.tool = POINTER;
screen.state = NORMAL;
utf8_strncpy(screen.statusbar.diststr,
_("Click to select objects in the active layer. "
"Middle click and drag to pan."),
MAX_DISTLEN);
break;
case PAN:
gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (screen.win.toolButtonPan), TRUE);
screen.tool = PAN;
screen.state = NORMAL;
utf8_strncpy(screen.statusbar.diststr,
_("Click and drag to pan. Right click and drag to zoom."),
MAX_DISTLEN);
break;
case ZOOM:
gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (screen.win.toolButtonZoom), TRUE);
screen.tool = ZOOM;
screen.state = NORMAL;
utf8_strncpy(screen.statusbar.diststr,
_("Click and drag to zoom in. Shift+click to zoom out."),
MAX_DISTLEN);
break;
case MEASURE:
gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (screen.win.toolButtonMeasure), TRUE);
screen.tool = MEASURE;
screen.state = NORMAL;
utf8_strncpy(screen.statusbar.diststr,
_("Click and drag to measure a distance or select two apertures."),
MAX_DISTLEN);
/* To not show previous measure drag-line */
screen.measure_start_x = 0;
screen.measure_start_y = 0;
screen.measure_stop_x = 0;
screen.measure_stop_y = 0;
/* If two items are selected, measure they distance */
if (selection_length (&screen.selectionInfo) == 2) {
gerbv_selection_item_t item[2];
gerbv_net_t *net[2];
item[0] = selection_get_item_by_index(
&screen.selectionInfo, 0);
item[1] = selection_get_item_by_index(
&screen.selectionInfo, 1);
net[0] = item[0].net;
net[1] = item[1].net;
if ((net[0]->aperture_state ==
net[1]->aperture_state)
&& (net[0]->aperture_state ==
GERBV_APERTURE_STATE_FLASH)) {
screen.measure_start_x = net[0]->stop_x;
screen.measure_start_y = net[0]->stop_y;
gerbv_transform_coord_for_image(
&screen.measure_start_x,
&screen.measure_start_y,
item[0].image,
mainProject);
screen.measure_stop_x = net[1]->stop_x;
screen.measure_stop_y = net[1]->stop_y;
gerbv_transform_coord_for_image(
&screen.measure_stop_x,
&screen.measure_stop_y,
item[1].image,
mainProject);
render_draw_measure_distance();
}
}
break;
default:
break;
}
callbacks_switch_to_normal_tool_cursor (toolNumber);
callbacks_update_statusbar();
screen.win.updatingTools = FALSE;
callbacks_force_expose_event_for_screen();
}
| 0
|
307,857
|
void ciEnv::dump_replay_data(int compile_id) {
static char buffer[O_BUFLEN];
int ret = jio_snprintf(buffer, O_BUFLEN, "replay_pid%p_compid%d.log", os::current_process_id(), compile_id);
if (ret > 0) {
int fd = open(buffer, O_RDWR | O_CREAT | O_TRUNC, 0666);
if (fd != -1) {
FILE* replay_data_file = os::open(fd, "w");
if (replay_data_file != NULL) {
fileStream replay_data_stream(replay_data_file, /*need_close=*/true);
dump_replay_data(&replay_data_stream);
tty->print_cr("# Compiler replay data is saved as: %s", buffer);
} else {
tty->print_cr("# Can't open file to dump replay data.");
}
}
}
}
| 0
|
361,753
|
void em28xx_free_device(struct kref *ref)
{
struct em28xx *dev = kref_to_dev(ref);
dev_info(&dev->intf->dev, "Freeing device\n");
if (!dev->disconnected)
em28xx_release_resources(dev);
if (dev->ts == PRIMARY_TS)
kfree(dev->alt_max_pkt_size_isoc);
kfree(dev);
}
| 0
|
344,235
|
void luaV_concat (lua_State *L, int total) {
if (total == 1)
return; /* "all" values already concatenated */
do {
StkId top = L->top;
int n = 2; /* number of elements handled in this pass (at least 2) */
if (!(ttisstring(s2v(top - 2)) || cvt2str(s2v(top - 2))) ||
!tostring(L, s2v(top - 1)))
luaT_tryconcatTM(L);
else if (isemptystr(s2v(top - 1))) /* second operand is empty? */
cast_void(tostring(L, s2v(top - 2))); /* result is first operand */
else if (isemptystr(s2v(top - 2))) { /* first operand is empty string? */
setobjs2s(L, top - 2, top - 1); /* result is second op. */
}
else {
/* at least two non-empty string values; get as many as possible */
size_t tl = vslen(s2v(top - 1));
TString *ts;
/* collect total length and number of strings */
for (n = 1; n < total && tostring(L, s2v(top - n - 1)); n++) {
size_t l = vslen(s2v(top - n - 1));
if (l_unlikely(l >= (MAX_SIZE/sizeof(char)) - tl)) {
L->top = top - total; /* pop strings to avoid wasting stack */
luaG_runerror(L, "string length overflow");
}
tl += l;
}
if (tl <= LUAI_MAXSHORTLEN) { /* is result a short string? */
char buff[LUAI_MAXSHORTLEN];
copy2buff(top, n, buff); /* copy strings to buffer */
ts = luaS_newlstr(L, buff, tl);
}
else { /* long string; copy strings directly to final result */
ts = luaS_createlngstrobj(L, tl);
copy2buff(top, n, getstr(ts));
}
setsvalue2s(L, top - n, ts); /* create result */
}
total -= n-1; /* got 'n' strings to create 1 new */
L->top = top - (n - 1); /* popped 'n' strings and pushed one */
} while (total > 1); /* repeat until only 1 result left */
}
| 0
|
231,016
|
const char * pcQueueGetName( QueueHandle_t xQueue ) /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
{
UBaseType_t ux;
const char * pcReturn = NULL; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
/* Note there is nothing here to protect against another task adding or
* removing entries from the registry while it is being searched. */
for( ux = ( UBaseType_t ) 0U; ux < ( UBaseType_t ) configQUEUE_REGISTRY_SIZE; ux++ )
{
if( xQueueRegistry[ ux ].xHandle == xQueue )
{
pcReturn = xQueueRegistry[ ux ].pcQueueName;
break;
}
else
{
mtCOVERAGE_TEST_MARKER();
}
}
return pcReturn;
} /*lint !e818 xQueue cannot be a pointer to const because it is a typedef. */
| 0
|
247,090
|
Bool gf_fs_check_filter_register_cap(const GF_FilterRegister *f_reg, u32 incode, GF_PropertyValue *cap_input, u32 outcode, GF_PropertyValue *cap_output, Bool exact_match_only)
{
return gf_fs_check_filter_register_cap_ex(f_reg, incode, cap_input, outcode, cap_output, exact_match_only, GF_FALSE);
}
| 0
|
393,457
|
static SQInteger base_enabledebuginfo(HSQUIRRELVM v)
{
SQObjectPtr &o=stack_get(v,2);
sq_enabledebuginfo(v,SQVM::IsFalse(o)?SQFalse:SQTrue);
return 0;
}
| 0
|
230,378
|
PJ_DEF(pj_xml_node*) pj_xml_parse( pj_pool_t *pool, char *msg, pj_size_t len)
{
pj_xml_node *node = NULL;
pj_scanner scanner;
PJ_USE_EXCEPTION;
if (!msg || !len || !pool)
return NULL;
pj_scan_init( &scanner, msg, len,
PJ_SCAN_AUTOSKIP_WS|PJ_SCAN_AUTOSKIP_NEWLINE,
&on_syntax_error);
PJ_TRY {
node = xml_parse_node(pool, &scanner);
}
PJ_CATCH_ANY {
PJ_LOG(4,(THIS_FILE, "Syntax error parsing XML in line %d column %d",
scanner.line, pj_scan_get_col(&scanner)));
}
PJ_END;
pj_scan_fini( &scanner );
return node;
}
| 0
|
502,720
|
void SSL_CTX_set_cookie_verify_cb(SSL_CTX *ctx,
int (*cb) (SSL *ssl, unsigned char *cookie,
unsigned int cookie_len))
{
ctx->app_verify_cookie_cb = cb;
}
| 0
|
338,192
|
Index WasmBinaryBuilder::getAbsoluteLocalIndex(Index index) {
// Wasm binaries put each let at the bottom of the index space, which may be
// good for binary size as often the uses of the let variables are close to
// the let itself. However, in Binaryen IR we just have a simple flat index
// space of absolute values, which we add to as we parse, and we depend on
// later optimizations to reorder locals for size.
//
// For example, if we have $x, then we add a let with $y, the binary would map
// 0 => y, 1 => x, while in Binaryen IR $x always stays at 0, and $y is added
// at 1.
//
// Compute the relative index in the let we were added. We start by looking at
// the last let added, and if we belong to it, we are already relative to it.
// We will continue relativizing as we go down, til we find our let.
int64_t relative = index;
for (auto i = int64_t(letStack.size()) - 1; i >= 0; i--) {
auto& info = letStack[i];
int64_t currNum = info.num;
// There were |currNum| let items added in this let. Check if we were one of
// them.
if (relative < currNum) {
return info.absoluteStart + relative;
}
relative -= currNum;
}
// We were not a let, but a normal var from the beginning. In that case, after
// we subtracted the let items, we have the proper absolute index.
return relative;
}
| 0
|
395,075
|
copy_text_attr(
int off,
char_u *buf,
int len,
int attr)
{
int i;
mch_memmove(ScreenLines + off, buf, (size_t)len);
if (enc_utf8)
vim_memset(ScreenLinesUC + off, 0, sizeof(u8char_T) * (size_t)len);
for (i = 0; i < len; ++i)
ScreenAttrs[off + i] = attr;
}
| 0
|
451,883
|
static jpc_enc_prc_t *prc_create(jpc_enc_prc_t *prc, jpc_enc_band_t *band)
{
uint_fast32_t prcno;
uint_fast32_t prcxind;
uint_fast32_t prcyind;
uint_fast32_t cbgtlx;
uint_fast32_t cbgtly;
uint_fast32_t tlprctlx;
uint_fast32_t tlprctly;
uint_fast32_t tlcbgtlx;
uint_fast32_t tlcbgtly;
uint_fast16_t rlvlno;
jpc_enc_rlvl_t *rlvl;
uint_fast32_t tlcblktlx;
uint_fast32_t tlcblktly;
uint_fast32_t brcblkbrx;
uint_fast32_t brcblkbry;
uint_fast32_t cblkno;
jpc_enc_cblk_t *cblk;
jpc_enc_tcmpt_t *tcmpt;
prc->cblks = 0;
prc->incltree = 0;
prc->savincltree = 0;
prc->nlibtree = 0;
prc->savnlibtree = 0;
rlvl = band->rlvl;
tcmpt = rlvl->tcmpt;
rlvlno = rlvl - tcmpt->rlvls;
prcno = prc - band->prcs;
prcxind = prcno % rlvl->numhprcs;
prcyind = prcno / rlvl->numhprcs;
prc->band = band;
tlprctlx = JPC_FLOORTOMULTPOW2(rlvl->tlx, rlvl->prcwidthexpn);
tlprctly = JPC_FLOORTOMULTPOW2(rlvl->tly, rlvl->prcheightexpn);
if (!rlvlno) {
tlcbgtlx = tlprctlx;
tlcbgtly = tlprctly;
} else {
tlcbgtlx = JPC_CEILDIVPOW2(tlprctlx, 1);
tlcbgtly = JPC_CEILDIVPOW2(tlprctly, 1);
}
/* Compute the coordinates of the top-left and bottom-right
corners of the precinct. */
cbgtlx = tlcbgtlx + (prcxind << rlvl->cbgwidthexpn);
cbgtly = tlcbgtly + (prcyind << rlvl->cbgheightexpn);
prc->tlx = JAS_MAX(jas_seq2d_xstart(band->data), (jas_matind_t)cbgtlx);
prc->tly = JAS_MAX(jas_seq2d_ystart(band->data), (jas_matind_t)cbgtly);
prc->brx = JAS_MIN(jas_seq2d_xend(band->data), (jas_matind_t)(cbgtlx +
(1 << rlvl->cbgwidthexpn)));
prc->bry = JAS_MIN(jas_seq2d_yend(band->data), (jas_matind_t)(cbgtly +
(1 << rlvl->cbgheightexpn)));
if (prc->tlx < prc->brx && prc->tly < prc->bry) {
/* The precinct contains at least one code block. */
tlcblktlx = JPC_FLOORTOMULTPOW2(prc->tlx, rlvl->cblkwidthexpn);
tlcblktly = JPC_FLOORTOMULTPOW2(prc->tly, rlvl->cblkheightexpn);
brcblkbrx = JPC_CEILTOMULTPOW2(prc->brx, rlvl->cblkwidthexpn);
brcblkbry = JPC_CEILTOMULTPOW2(prc->bry, rlvl->cblkheightexpn);
prc->numhcblks = JPC_FLOORDIVPOW2(brcblkbrx - tlcblktlx,
rlvl->cblkwidthexpn);
prc->numvcblks = JPC_FLOORDIVPOW2(brcblkbry - tlcblktly,
rlvl->cblkheightexpn);
prc->numcblks = prc->numhcblks * prc->numvcblks;
if (!(prc->incltree = jpc_tagtree_create(prc->numhcblks,
prc->numvcblks))) {
goto error;
}
if (!(prc->nlibtree = jpc_tagtree_create(prc->numhcblks,
prc->numvcblks))) {
goto error;
}
if (!(prc->savincltree = jpc_tagtree_create(prc->numhcblks,
prc->numvcblks))) {
goto error;
}
if (!(prc->savnlibtree = jpc_tagtree_create(prc->numhcblks,
prc->numvcblks))) {
goto error;
}
if (!(prc->cblks = jas_alloc2(prc->numcblks, sizeof(jpc_enc_cblk_t)))) {
goto error;
}
for (cblkno = 0, cblk = prc->cblks; cblkno < prc->numcblks;
++cblkno, ++cblk) {
cblk->passes = 0;
cblk->stream = 0;
cblk->mqenc = 0;
cblk->data = 0;
cblk->flags = 0;
cblk->prc = prc;
}
for (cblkno = 0, cblk = prc->cblks; cblkno < prc->numcblks;
++cblkno, ++cblk) {
if (!cblk_create(cblk, prc)) {
goto error;
}
}
} else {
/* The precinct does not contain any code blocks. */
prc->tlx = prc->brx;
prc->tly = prc->bry;
prc->numcblks = 0;
prc->numhcblks = 0;
prc->numvcblks = 0;
prc->cblks = 0;
prc->incltree = 0;
prc->nlibtree = 0;
prc->savincltree = 0;
prc->savnlibtree = 0;
}
return prc;
error:
prc_destroy(prc);
return 0;
}
| 0
|
486,804
|
static void gem_write(void *opaque, hwaddr offset, uint64_t val,
unsigned size)
{
CadenceGEMState *s = (CadenceGEMState *)opaque;
uint32_t readonly;
int i;
DB_PRINT("offset: 0x%04x write: 0x%08x ", (unsigned)offset, (unsigned)val);
offset >>= 2;
/* Squash bits which are read only in write value */
val &= ~(s->regs_ro[offset]);
/* Preserve (only) bits which are read only and wtc in register */
readonly = s->regs[offset] & (s->regs_ro[offset] | s->regs_w1c[offset]);
/* Copy register write to backing store */
s->regs[offset] = (val & ~s->regs_w1c[offset]) | readonly;
/* do w1c */
s->regs[offset] &= ~(s->regs_w1c[offset] & val);
/* Handle register write side effects */
switch (offset) {
case GEM_NWCTRL:
if (val & GEM_NWCTRL_RXENA) {
for (i = 0; i < s->num_priority_queues; ++i) {
gem_get_rx_desc(s, i);
}
}
if (val & GEM_NWCTRL_TXSTART) {
gem_transmit(s);
}
if (!(val & GEM_NWCTRL_TXENA)) {
/* Reset to start of Q when transmit disabled. */
for (i = 0; i < s->num_priority_queues; i++) {
s->tx_desc_addr[i] = gem_get_tx_queue_base_addr(s, i);
}
}
if (gem_can_receive(qemu_get_queue(s->nic))) {
qemu_flush_queued_packets(qemu_get_queue(s->nic));
}
break;
case GEM_TXSTATUS:
gem_update_int_status(s);
break;
case GEM_RXQBASE:
s->rx_desc_addr[0] = val;
break;
case GEM_RECEIVE_Q1_PTR ... GEM_RECEIVE_Q7_PTR:
s->rx_desc_addr[offset - GEM_RECEIVE_Q1_PTR + 1] = val;
break;
case GEM_TXQBASE:
s->tx_desc_addr[0] = val;
break;
case GEM_TRANSMIT_Q1_PTR ... GEM_TRANSMIT_Q7_PTR:
s->tx_desc_addr[offset - GEM_TRANSMIT_Q1_PTR + 1] = val;
break;
case GEM_RXSTATUS:
gem_update_int_status(s);
break;
case GEM_IER:
s->regs[GEM_IMR] &= ~val;
gem_update_int_status(s);
break;
case GEM_JUMBO_MAX_LEN:
s->regs[GEM_JUMBO_MAX_LEN] = val & MAX_JUMBO_FRAME_SIZE_MASK;
break;
case GEM_INT_Q1_ENABLE ... GEM_INT_Q7_ENABLE:
s->regs[GEM_INT_Q1_MASK + offset - GEM_INT_Q1_ENABLE] &= ~val;
gem_update_int_status(s);
break;
case GEM_IDR:
s->regs[GEM_IMR] |= val;
gem_update_int_status(s);
break;
case GEM_INT_Q1_DISABLE ... GEM_INT_Q7_DISABLE:
s->regs[GEM_INT_Q1_MASK + offset - GEM_INT_Q1_DISABLE] |= val;
gem_update_int_status(s);
break;
case GEM_SPADDR1LO:
case GEM_SPADDR2LO:
case GEM_SPADDR3LO:
case GEM_SPADDR4LO:
s->sar_active[(offset - GEM_SPADDR1LO) / 2] = false;
break;
case GEM_SPADDR1HI:
case GEM_SPADDR2HI:
case GEM_SPADDR3HI:
case GEM_SPADDR4HI:
s->sar_active[(offset - GEM_SPADDR1HI) / 2] = true;
break;
case GEM_PHYMNTNC:
if (val & GEM_PHYMNTNC_OP_W) {
uint32_t phy_addr, reg_num;
phy_addr = (val & GEM_PHYMNTNC_ADDR) >> GEM_PHYMNTNC_ADDR_SHFT;
if (phy_addr == s->phy_addr) {
reg_num = (val & GEM_PHYMNTNC_REG) >> GEM_PHYMNTNC_REG_SHIFT;
gem_phy_write(s, reg_num, val);
}
}
break;
}
DB_PRINT("newval: 0x%08x\n", s->regs[offset]);
}
| 0
|
376,354
|
gpg_hash_str (CamelCipherHash hash)
{
switch (hash) {
case CAMEL_CIPHER_HASH_MD2:
return "--digest-algo=MD2";
case CAMEL_CIPHER_HASH_MD5:
return "--digest-algo=MD5";
case CAMEL_CIPHER_HASH_SHA1:
return "--digest-algo=SHA1";
case CAMEL_CIPHER_HASH_SHA256:
return "--digest-algo=SHA256";
case CAMEL_CIPHER_HASH_SHA384:
return "--digest-algo=SHA384";
case CAMEL_CIPHER_HASH_SHA512:
return "--digest-algo=SHA512";
case CAMEL_CIPHER_HASH_RIPEMD160:
return "--digest-algo=RIPEMD160";
default:
return NULL;
}
}
| 0
|
344,228
|
int luaV_tointegerns (const TValue *obj, lua_Integer *p, F2Imod mode) {
if (ttisfloat(obj))
return luaV_flttointeger(fltvalue(obj), p, mode);
else if (ttisinteger(obj)) {
*p = ivalue(obj);
return 1;
}
else
return 0;
}
| 0
|
253,542
|
smb2_get_srv_inum(const unsigned int xid, struct cifs_tcon *tcon,
struct cifs_sb_info *cifs_sb, const char *full_path,
u64 *uniqueid, FILE_ALL_INFO *data)
{
*uniqueid = le64_to_cpu(data->IndexNumber);
return 0;
}
| 0
|
509,544
|
int ha_maria::rnd_end()
{
ds_mrr.dsmrr_close();
/* Safe to call even if we don't have started a scan */
maria_scan_end(file);
return 0;
}
| 0
|
459,212
|
static inline int __tcf_classify(struct sk_buff *skb,
const struct tcf_proto *tp,
const struct tcf_proto *orig_tp,
struct tcf_result *res,
bool compat_mode,
u32 *last_executed_chain)
{
#ifdef CONFIG_NET_CLS_ACT
const int max_reclassify_loop = 16;
const struct tcf_proto *first_tp;
int limit = 0;
reclassify:
#endif
for (; tp; tp = rcu_dereference_bh(tp->next)) {
__be16 protocol = skb_protocol(skb, false);
int err;
if (tp->protocol != protocol &&
tp->protocol != htons(ETH_P_ALL))
continue;
err = tp->classify(skb, tp, res);
#ifdef CONFIG_NET_CLS_ACT
if (unlikely(err == TC_ACT_RECLASSIFY && !compat_mode)) {
first_tp = orig_tp;
*last_executed_chain = first_tp->chain->index;
goto reset;
} else if (unlikely(TC_ACT_EXT_CMP(err, TC_ACT_GOTO_CHAIN))) {
first_tp = res->goto_tp;
*last_executed_chain = err & TC_ACT_EXT_VAL_MASK;
goto reset;
}
#endif
if (err >= 0)
return err;
}
return TC_ACT_UNSPEC; /* signal: continue lookup */
#ifdef CONFIG_NET_CLS_ACT
reset:
if (unlikely(limit++ >= max_reclassify_loop)) {
net_notice_ratelimited("%u: reclassify loop, rule prio %u, protocol %02x\n",
tp->chain->block->index,
tp->prio & 0xffff,
ntohs(tp->protocol));
return TC_ACT_SHOT;
}
tp = first_tp;
goto reclassify;
#endif
}
| 0
|
473,995
|
big5_is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc)
{
return onigenc_mb2_is_code_ctype(enc, code, ctype);
}
| 0
|
245,718
|
static int extract_url (const char *url, int default_port,
struct request_s *request)
{
char *p;
int port;
/* Split the URL on the slash to separate host from path */
p = strchr (url, '/');
if (p != NULL) {
int len;
len = p - url;
request->host = (char *) safemalloc (len + 1);
memcpy (request->host, url, len);
request->host[len] = '\0';
request->path = safestrdup (p);
} else {
request->host = safestrdup (url);
request->path = safestrdup ("/");
}
if (!request->host || !request->path)
goto ERROR_EXIT;
/* Remove the username/password if they're present */
strip_username_password (request->host);
/* Find a proper port in www.site.com:8001 URLs */
port = strip_return_port (request->host);
request->port = (port != 0) ? port : default_port;
/* Remove any surrounding '[' and ']' from IPv6 literals */
p = strrchr (request->host, ']');
if (p && (*(request->host) == '[')) {
memmove(request->host, request->host + 1,
strlen(request->host) - 2);
*p = '\0';
p--;
*p = '\0';
}
return 0;
ERROR_EXIT:
if (request->host)
safefree (request->host);
if (request->path)
safefree (request->path);
return -1;
}
| 0
|
442,795
|
static void dumpeasycode(struct Configurable *config)
{
struct curl_slist *ptr = easycode;
char *o = config->libcurl;
if(o) {
FILE *out;
bool fopened = FALSE;
if(strcmp(o, "-")) {
out = fopen(o, "wt");
fopened = TRUE;
}
else
out= stdout;
if(!out)
warnf(config, "Failed to open %s to write libcurl code!\n", o);
else {
int i;
const char *c;
for(i=0; (c = srchead[i]); i++) {
if(!memcmp((char *)c, "[m]", 3)) {
#if defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS > 32)
fprintf(out, "#define _FILE_OFFSET_BITS %d "
"/* for curl_off_t magic */\n",
_FILE_OFFSET_BITS);
#endif
}
else
fprintf(out, "%s\n", c);
}
while(ptr) {
fprintf(out, " %s\n", ptr->data);
ptr = ptr->next;
}
fprintf(out,
"}\n"
"/* */\n");
if(fopened)
fclose(out);
}
}
curl_slist_free_all(easycode);
}
| 0
|
265,461
|
static int sqfs_get_metablk_pos(u32 *pos_list, void *table, u32 offset,
int metablks_count)
{
u32 data_size, cur_size = 0;
int j, ret = 0;
bool comp;
if (!metablks_count)
return -EINVAL;
for (j = 0; j < metablks_count; j++) {
ret = sqfs_read_metablock(table, offset + cur_size, &comp,
&data_size);
if (ret)
return -EINVAL;
cur_size += data_size + SQFS_HEADER_SIZE;
pos_list[j] = cur_size;
}
return ret;
}
| 0
|
225,382
|
static int vidioc_try_fmt_out(struct file *file, void *priv,
struct v4l2_format *fmt)
{
struct v4l2_loopback_device *dev;
MARK();
dev = v4l2loopback_getdevice(file);
/* TODO(vasaka) loopback does not care about formats writer want to set,
* maybe it is a good idea to restrict format somehow */
if (dev->ready_for_capture) {
fmt->fmt.pix = dev->pix_format;
} else {
__u32 w = fmt->fmt.pix.width;
__u32 h = fmt->fmt.pix.height;
__u32 pixfmt = fmt->fmt.pix.pixelformat;
const struct v4l2l_format *format = format_by_fourcc(pixfmt);
if (w > dev->max_width)
w = dev->max_width;
if (h > dev->max_height)
h = dev->max_height;
dprintk("trying image %dx%d\n", w, h);
if (w < 1)
w = V4L2LOOPBACK_SIZE_DEFAULT_WIDTH;
if (h < 1)
h = V4L2LOOPBACK_SIZE_DEFAULT_HEIGHT;
if (NULL == format)
format = &formats[0];
pix_format_set_size(&fmt->fmt.pix, format, w, h);
fmt->fmt.pix.pixelformat = format->fourcc;
if ((fmt->fmt.pix.colorspace == V4L2_COLORSPACE_DEFAULT) ||
(fmt->fmt.pix.colorspace > V4L2_COLORSPACE_DCI_P3))
fmt->fmt.pix.colorspace = V4L2_COLORSPACE_SRGB;
if (V4L2_FIELD_ANY == fmt->fmt.pix.field)
fmt->fmt.pix.field = V4L2_FIELD_NONE;
/* FIXXME: try_fmt should never modify the device-state */
dev->pix_format = fmt->fmt.pix;
}
return 0;
}
| 0
|
313,787
|
invoke_edit(
cmdarg_T *cap,
int repl, // "r" or "gr" command
int cmd,
int startln)
{
int restart_edit_save = 0;
// Complicated: When the user types "a<C-O>a" we don't want to do Insert
// mode recursively. But when doing "a<C-O>." or "a<C-O>rx" we do allow
// it.
if (repl || !stuff_empty())
restart_edit_save = restart_edit;
else
restart_edit_save = 0;
// Always reset "restart_edit", this is not a restarted edit.
restart_edit = 0;
if (edit(cmd, startln, cap->count1))
cap->retval |= CA_COMMAND_BUSY;
if (restart_edit == 0)
restart_edit = restart_edit_save;
}
| 0
|
313,838
|
nv_screengo(oparg_T *oap, int dir, long dist)
{
int linelen = linetabsize(ml_get_curline());
int retval = OK;
int atend = FALSE;
int n;
int col_off1; // margin offset for first screen line
int col_off2; // margin offset for wrapped screen line
int width1; // text width for first screen line
int width2; // text width for wrapped screen line
oap->motion_type = MCHAR;
oap->inclusive = (curwin->w_curswant == MAXCOL);
col_off1 = curwin_col_off();
col_off2 = col_off1 - curwin_col_off2();
width1 = curwin->w_width - col_off1;
width2 = curwin->w_width - col_off2;
if (width2 == 0)
width2 = 1; // avoid divide by zero
if (curwin->w_width != 0)
{
// Instead of sticking at the last character of the buffer line we
// try to stick in the last column of the screen.
if (curwin->w_curswant == MAXCOL)
{
atend = TRUE;
validate_virtcol();
if (width1 <= 0)
curwin->w_curswant = 0;
else
{
curwin->w_curswant = width1 - 1;
if (curwin->w_virtcol > curwin->w_curswant)
curwin->w_curswant += ((curwin->w_virtcol
- curwin->w_curswant - 1) / width2 + 1) * width2;
}
}
else
{
if (linelen > width1)
n = ((linelen - width1 - 1) / width2 + 1) * width2 + width1;
else
n = width1;
if (curwin->w_curswant >= (colnr_T)n)
curwin->w_curswant = n - 1;
}
while (dist--)
{
if (dir == BACKWARD)
{
if ((long)curwin->w_curswant >= width1
#ifdef FEAT_FOLDING
&& !hasFolding(curwin->w_cursor.lnum, NULL, NULL)
#endif
)
// Move back within the line. This can give a negative value
// for w_curswant if width1 < width2 (with cpoptions+=n),
// which will get clipped to column 0.
curwin->w_curswant -= width2;
else
{
// to previous line
#ifdef FEAT_FOLDING
// Move to the start of a closed fold. Don't do that when
// 'foldopen' contains "all": it will open in a moment.
if (!(fdo_flags & FDO_ALL))
(void)hasFolding(curwin->w_cursor.lnum,
&curwin->w_cursor.lnum, NULL);
#endif
if (curwin->w_cursor.lnum == 1)
{
retval = FAIL;
break;
}
--curwin->w_cursor.lnum;
linelen = linetabsize(ml_get_curline());
if (linelen > width1)
curwin->w_curswant += (((linelen - width1 - 1) / width2)
+ 1) * width2;
}
}
else // dir == FORWARD
{
if (linelen > width1)
n = ((linelen - width1 - 1) / width2 + 1) * width2 + width1;
else
n = width1;
if (curwin->w_curswant + width2 < (colnr_T)n
#ifdef FEAT_FOLDING
&& !hasFolding(curwin->w_cursor.lnum, NULL, NULL)
#endif
)
// move forward within line
curwin->w_curswant += width2;
else
{
// to next line
#ifdef FEAT_FOLDING
// Move to the end of a closed fold.
(void)hasFolding(curwin->w_cursor.lnum, NULL,
&curwin->w_cursor.lnum);
#endif
if (curwin->w_cursor.lnum == curbuf->b_ml.ml_line_count)
{
retval = FAIL;
break;
}
curwin->w_cursor.lnum++;
curwin->w_curswant %= width2;
// Check if the cursor has moved below the number display
// when width1 < width2 (with cpoptions+=n). Subtract width2
// to get a negative value for w_curswant, which will get
// clipped to column 0.
if (curwin->w_curswant >= width1)
curwin->w_curswant -= width2;
linelen = linetabsize(ml_get_curline());
}
}
}
}
if (virtual_active() && atend)
coladvance(MAXCOL);
else
coladvance(curwin->w_curswant);
if (curwin->w_cursor.col > 0 && curwin->w_p_wrap)
{
colnr_T virtcol;
int c;
// Check for landing on a character that got split at the end of the
// last line. We want to advance a screenline, not end up in the same
// screenline or move two screenlines.
validate_virtcol();
virtcol = curwin->w_virtcol;
#if defined(FEAT_LINEBREAK)
if (virtcol > (colnr_T)width1 && *get_showbreak_value(curwin) != NUL)
virtcol -= vim_strsize(get_showbreak_value(curwin));
#endif
c = (*mb_ptr2char)(ml_get_cursor());
if (dir == FORWARD && virtcol < curwin->w_curswant
&& (curwin->w_curswant <= (colnr_T)width1)
&& !vim_isprintc(c) && c > 255)
oneright();
if (virtcol > curwin->w_curswant
&& (curwin->w_curswant < (colnr_T)width1
? (curwin->w_curswant > (colnr_T)width1 / 2)
: ((curwin->w_curswant - width1) % width2
> (colnr_T)width2 / 2)))
--curwin->w_cursor.col;
}
if (atend)
curwin->w_curswant = MAXCOL; // stick in the last column
return retval;
}
| 0
|
462,412
|
stopWorkerPool(void)
{
int i;
DBGPRINTF("imptcp: stoping worker pool\n");
pthread_mutex_lock(&io_q.mut);
pthread_cond_broadcast(&io_q.wakeup_worker); /* awake wrkr if not running */
pthread_mutex_unlock(&io_q.mut);
for(i = 0 ; i < runModConf->wrkrMax ; ++i) {
pthread_join(wrkrInfo[i].tid, NULL);
DBGPRINTF("imptcp: info: worker %d was called %llu times\n", i, wrkrInfo[i].numCalled);
}
free(wrkrInfo);
}
| 0
|
229,346
|
Status MaybePackInputTensor(EagerOperation* op) {
if (op->is_function() || op->EagerContext().RunEagerOpAsFunction()) {
// Functions could take packed TensorHandles as inputs.
return Status::OK();
}
EagerContext& ctx = op->EagerContext();
const absl::InlinedVector<TensorHandle*, 4>* inputs;
TF_RETURN_IF_ERROR(op->TensorHandleInputs(&inputs));
for (int i = 0; i < inputs->size(); ++i) {
TensorHandle* handle = (*inputs)[i];
if (handle->Type() == TensorHandle::PACKED) {
EagerOperation pack_op(&ctx);
TF_RETURN_IF_ERROR(pack_op.Reset("Pack", /*device_name=*/nullptr,
/*remote=*/false, /*executor=*/nullptr));
pack_op.MutableAttrs()->Set("N", handle->NumPackedHandles());
pack_op.MutableAttrs()->Set("T", handle->dtype);
for (int i = 0; i < handle->NumPackedHandles(); ++i) {
tensorflow::TensorHandle* h = nullptr;
TF_RETURN_IF_ERROR(handle->ExtractPackedHandle(i, &h));
TF_RETURN_IF_ERROR(pack_op.AddInput(h));
}
int num_retvals = 1;
absl::FixedArray<tensorflow::TensorHandle*> retvals(num_retvals);
TF_RETURN_IF_ERROR(
EagerLocalExecute(&pack_op, retvals.data(), &num_retvals));
tensorflow::TensorHandle* ret = retvals.at(0);
op->UpdateInput(i, ret);
ret->Unref();
}
}
return Status::OK();
}
| 0
|
366,244
|
static struct mount *mnt_list_next(struct mnt_namespace *ns,
struct list_head *p)
{
struct mount *mnt, *ret = NULL;
lock_ns_list(ns);
list_for_each_continue(p, &ns->list) {
mnt = list_entry(p, typeof(*mnt), mnt_list);
if (!mnt_is_cursor(mnt)) {
ret = mnt;
break;
}
}
unlock_ns_list(ns);
return ret;
}
| 0
|
400,406
|
ins_ctrl_ey(int tc)
{
int c = tc;
if (ctrl_x_mode_scroll())
{
if (c == Ctrl_Y)
scrolldown_clamp();
else
scrollup_clamp();
redraw_later(UPD_VALID);
}
else
{
c = ins_copychar(curwin->w_cursor.lnum + (c == Ctrl_Y ? -1 : 1));
if (c != NUL)
{
long tw_save;
// The character must be taken literally, insert like it
// was typed after a CTRL-V, and pretend 'textwidth'
// wasn't set. Digits, 'o' and 'x' are special after a
// CTRL-V, don't use it for these.
if (c < 256 && !isalnum(c))
AppendToRedobuff((char_u *)CTRL_V_STR); // CTRL-V
tw_save = curbuf->b_p_tw;
curbuf->b_p_tw = -1;
insert_special(c, TRUE, FALSE);
curbuf->b_p_tw = tw_save;
#ifdef FEAT_RIGHTLEFT
revins_chars++;
revins_legal++;
#endif
c = Ctrl_V; // pretend CTRL-V is last character
auto_format(FALSE, TRUE);
}
}
return c;
}
| 0
|
349,884
|
static u32 hw_atl_utils_mif_cmd_get(struct aq_hw_s *self)
{
return aq_hw_read_reg(self, HW_ATL_MIF_CMD);
}
| 0
|
512,760
|
bool Item_func_like::find_selective_predicates_list_processor(void *arg)
{
find_selective_predicates_list_processor_data *data=
(find_selective_predicates_list_processor_data *) arg;
if (use_sampling && used_tables() == data->table->map)
{
THD *thd= data->table->in_use;
COND_STATISTIC *stat;
Item *arg0;
if (!(stat= (COND_STATISTIC *) thd->alloc(sizeof(COND_STATISTIC))))
return TRUE;
stat->cond= this;
arg0= args[0]->real_item();
if (args[1]->const_item() && arg0->type() == FIELD_ITEM)
stat->field_arg= ((Item_field *)arg0)->field;
else
stat->field_arg= NULL;
data->list.push_back(stat, thd->mem_root);
}
return FALSE;
}
| 0
|
453,005
|
static int nft_immediate_offload_verdict(struct nft_offload_ctx *ctx,
struct nft_flow_rule *flow,
const struct nft_immediate_expr *priv)
{
struct flow_action_entry *entry;
const struct nft_data *data;
entry = &flow->rule->action.entries[ctx->num_actions++];
data = &priv->data;
switch (data->verdict.code) {
case NF_ACCEPT:
entry->id = FLOW_ACTION_ACCEPT;
break;
case NF_DROP:
entry->id = FLOW_ACTION_DROP;
break;
default:
return -EOPNOTSUPP;
}
return 0;
}
| 0
|
414,931
|
static xmlChar *
xmlXPathParseNameComplex(xmlXPathParserContextPtr ctxt, int qualified) {
xmlChar buf[XML_MAX_NAMELEN + 5];
int len = 0, l;
int c;
/*
* Handler for more complex cases
*/
c = CUR_CHAR(l);
if ((c == ' ') || (c == '>') || (c == '/') || /* accelerators */
(c == '[') || (c == ']') || (c == '@') || /* accelerators */
(c == '*') || /* accelerators */
(!IS_LETTER(c) && (c != '_') &&
((qualified) && (c != ':')))) {
return(NULL);
}
while ((c != ' ') && (c != '>') && (c != '/') && /* test bigname.xml */
((IS_LETTER(c)) || (IS_DIGIT(c)) ||
(c == '.') || (c == '-') ||
(c == '_') || ((qualified) && (c == ':')) ||
(IS_COMBINING(c)) ||
(IS_EXTENDER(c)))) {
COPY_BUF(l,buf,len,c);
NEXTL(l);
c = CUR_CHAR(l);
if (len >= XML_MAX_NAMELEN) {
/*
* Okay someone managed to make a huge name, so he's ready to pay
* for the processing speed.
*/
xmlChar *buffer;
int max = len * 2;
if (len > XML_MAX_NAME_LENGTH) {
XP_ERRORNULL(XPATH_EXPR_ERROR);
}
buffer = (xmlChar *) xmlMallocAtomic(max * sizeof(xmlChar));
if (buffer == NULL) {
XP_ERRORNULL(XPATH_MEMORY_ERROR);
}
memcpy(buffer, buf, len);
while ((IS_LETTER(c)) || (IS_DIGIT(c)) || /* test bigname.xml */
(c == '.') || (c == '-') ||
(c == '_') || ((qualified) && (c == ':')) ||
(IS_COMBINING(c)) ||
(IS_EXTENDER(c))) {
if (len + 10 > max) {
if (max > XML_MAX_NAME_LENGTH) {
XP_ERRORNULL(XPATH_EXPR_ERROR);
}
max *= 2;
buffer = (xmlChar *) xmlRealloc(buffer,
max * sizeof(xmlChar));
if (buffer == NULL) {
XP_ERRORNULL(XPATH_MEMORY_ERROR);
}
}
COPY_BUF(l,buffer,len,c);
NEXTL(l);
c = CUR_CHAR(l);
}
buffer[len] = 0;
return(buffer);
}
}
if (len == 0)
return(NULL);
| 0
|
450,764
|
reg_match_visual(void)
{
pos_T top, bot;
linenr_T lnum;
colnr_T col;
win_T *wp = rex.reg_win == NULL ? curwin : rex.reg_win;
int mode;
colnr_T start, end;
colnr_T start2, end2;
colnr_T cols;
colnr_T curswant;
// Check if the buffer is the current buffer.
if (rex.reg_buf != curbuf || VIsual.lnum == 0)
return FALSE;
if (VIsual_active)
{
if (LT_POS(VIsual, wp->w_cursor))
{
top = VIsual;
bot = wp->w_cursor;
}
else
{
top = wp->w_cursor;
bot = VIsual;
}
mode = VIsual_mode;
curswant = wp->w_curswant;
}
else
{
if (LT_POS(curbuf->b_visual.vi_start, curbuf->b_visual.vi_end))
{
top = curbuf->b_visual.vi_start;
bot = curbuf->b_visual.vi_end;
}
else
{
top = curbuf->b_visual.vi_end;
bot = curbuf->b_visual.vi_start;
}
mode = curbuf->b_visual.vi_mode;
curswant = curbuf->b_visual.vi_curswant;
}
lnum = rex.lnum + rex.reg_firstlnum;
if (lnum < top.lnum || lnum > bot.lnum)
return FALSE;
col = (colnr_T)(rex.input - rex.line);
if (mode == 'v')
{
if ((lnum == top.lnum && col < top.col)
|| (lnum == bot.lnum && col >= bot.col + (*p_sel != 'e')))
return FALSE;
}
else if (mode == Ctrl_V)
{
getvvcol(wp, &top, &start, NULL, &end);
getvvcol(wp, &bot, &start2, NULL, &end2);
if (start2 < start)
start = start2;
if (end2 > end)
end = end2;
if (top.col == MAXCOL || bot.col == MAXCOL || curswant == MAXCOL)
end = MAXCOL;
// getvvcol() flushes rex.line, need to get it again
rex.line = reg_getline(rex.lnum);
rex.input = rex.line + col;
cols = win_linetabsize(wp, rex.line, col);
if (cols < start || cols > end - (*p_sel == 'e'))
return FALSE;
}
return TRUE;
}
| 0
|
387,647
|
static int snd_ctl_add_replace(struct snd_card *card,
struct snd_kcontrol *kcontrol,
enum snd_ctl_add_mode mode)
{
int err = -EINVAL;
if (! kcontrol)
return err;
if (snd_BUG_ON(!card || !kcontrol->info))
goto error;
down_write(&card->controls_rwsem);
err = __snd_ctl_add_replace(card, kcontrol, mode);
up_write(&card->controls_rwsem);
if (err < 0)
goto error;
return 0;
error:
snd_ctl_free_one(kcontrol);
return err;
}
| 0
|
369,436
|
static int io_import_fixed(struct io_kiocb *req, int rw, struct iov_iter *iter,
unsigned int issue_flags)
{
struct io_mapped_ubuf *imu = req->imu;
u16 index, buf_index = req->buf_index;
if (likely(!imu)) {
struct io_ring_ctx *ctx = req->ctx;
if (unlikely(buf_index >= ctx->nr_user_bufs))
return -EFAULT;
io_req_set_rsrc_node(req, ctx, issue_flags);
index = array_index_nospec(buf_index, ctx->nr_user_bufs);
imu = READ_ONCE(ctx->user_bufs[index]);
req->imu = imu;
}
return __io_import_fixed(req, rw, iter, imu);
}
| 0
|
512,496
|
Item_cache_date(THD *thd)
:Item_cache_temporal(thd, &type_handler_newdate) { }
| 0
|
438,680
|
static void *get_a_tx_buf(struct virtproc_info *vrp)
{
unsigned int len;
void *ret;
/* support multiple concurrent senders */
mutex_lock(&vrp->tx_lock);
/*
* either pick the next unused tx buffer
* (half of our buffers are used for sending messages)
*/
if (vrp->last_sbuf < vrp->num_bufs / 2)
ret = vrp->sbufs + vrp->buf_size * vrp->last_sbuf++;
/* or recycle a used one */
else
ret = virtqueue_get_buf(vrp->svq, &len);
mutex_unlock(&vrp->tx_lock);
return ret;
}
| 0
|
316,997
|
static int selinux_add_opt(int token, const char *s, void **mnt_opts)
{
struct selinux_mnt_opts *opts = *mnt_opts;
if (token == Opt_seclabel) /* eaten and completely ignored */
return 0;
if (!opts) {
opts = kzalloc(sizeof(struct selinux_mnt_opts), GFP_KERNEL);
if (!opts)
return -ENOMEM;
*mnt_opts = opts;
}
if (!s)
return -ENOMEM;
switch (token) {
case Opt_context:
if (opts->context || opts->defcontext)
goto Einval;
opts->context = s;
break;
case Opt_fscontext:
if (opts->fscontext)
goto Einval;
opts->fscontext = s;
break;
case Opt_rootcontext:
if (opts->rootcontext)
goto Einval;
opts->rootcontext = s;
break;
case Opt_defcontext:
if (opts->context || opts->defcontext)
goto Einval;
opts->defcontext = s;
break;
}
return 0;
Einval:
pr_warn(SEL_MOUNT_FAIL_MSG);
return -EINVAL;
}
| 0
|
234,254
|
display_debug_lines_raw (struct dwarf_section * section,
unsigned char * data,
unsigned char * end,
void * file)
{
unsigned char *start = section->start;
int verbose_view = 0;
introduce (section, true);
while (data < end)
{
static DWARF2_Internal_LineInfo saved_linfo;
DWARF2_Internal_LineInfo linfo;
unsigned char *standard_opcodes;
unsigned char *end_of_sequence;
int i;
if (startswith (section->name, ".debug_line.")
/* Note: the following does not apply to .debug_line.dwo sections.
These are full debug_line sections. */
&& strcmp (section->name, ".debug_line.dwo") != 0)
{
/* Sections named .debug_line.<foo> are fragments of a .debug_line
section containing just the Line Number Statements. They are
created by the assembler and intended to be used alongside gcc's
-ffunction-sections command line option. When the linker's
garbage collection decides to discard a .text.<foo> section it
can then also discard the line number information in .debug_line.<foo>.
Since the section is a fragment it does not have the details
needed to fill out a LineInfo structure, so instead we use the
details from the last full debug_line section that we processed. */
end_of_sequence = end;
standard_opcodes = NULL;
linfo = saved_linfo;
/* PR 17531: file: 0522b371. */
if (linfo.li_line_range == 0)
{
warn (_("Partial .debug_line. section encountered without a prior full .debug_line section\n"));
return 0;
}
reset_state_machine (linfo.li_default_is_stmt);
}
else
{
unsigned char * hdrptr;
if ((hdrptr = read_debug_line_header (section, data, end, & linfo,
& end_of_sequence)) == NULL)
return 0;
printf (_(" Offset: 0x%lx\n"), (long)(data - start));
printf (_(" Length: %ld\n"), (long) linfo.li_length);
printf (_(" DWARF Version: %d\n"), linfo.li_version);
if (linfo.li_version >= 5)
{
printf (_(" Address size (bytes): %d\n"), linfo.li_address_size);
printf (_(" Segment selector (bytes): %d\n"), linfo.li_segment_size);
}
printf (_(" Prologue Length: %d\n"), (int) linfo.li_prologue_length);
printf (_(" Minimum Instruction Length: %d\n"), linfo.li_min_insn_length);
if (linfo.li_version >= 4)
printf (_(" Maximum Ops per Instruction: %d\n"), linfo.li_max_ops_per_insn);
printf (_(" Initial value of 'is_stmt': %d\n"), linfo.li_default_is_stmt);
printf (_(" Line Base: %d\n"), linfo.li_line_base);
printf (_(" Line Range: %d\n"), linfo.li_line_range);
printf (_(" Opcode Base: %d\n"), linfo.li_opcode_base);
/* PR 17512: file: 1665-6428-0.004. */
if (linfo.li_line_range == 0)
{
warn (_("Line range of 0 is invalid, using 1 instead\n"));
linfo.li_line_range = 1;
}
reset_state_machine (linfo.li_default_is_stmt);
/* Display the contents of the Opcodes table. */
standard_opcodes = hdrptr;
/* PR 17512: file: 002-417945-0.004. */
if (standard_opcodes + linfo.li_opcode_base >= end)
{
warn (_("Line Base extends beyond end of section\n"));
return 0;
}
printf (_("\n Opcodes:\n"));
for (i = 1; i < linfo.li_opcode_base; i++)
printf (ngettext (" Opcode %d has %d arg\n",
" Opcode %d has %d args\n",
standard_opcodes[i - 1]),
i, standard_opcodes[i - 1]);
/* Display the contents of the Directory table. */
data = standard_opcodes + linfo.li_opcode_base - 1;
if (linfo.li_version >= 5)
{
load_debug_section_with_follow (line_str, file);
data = display_formatted_table (data, start, end, &linfo, section,
true);
data = display_formatted_table (data, start, end, &linfo, section,
false);
}
else
{
if (*data == 0)
printf (_("\n The Directory Table is empty.\n"));
else
{
unsigned int last_dir_entry = 0;
printf (_("\n The Directory Table (offset 0x%lx):\n"),
(long)(data - start));
while (data < end && *data != 0)
{
printf (" %d\t%.*s\n", ++last_dir_entry, (int) (end - data), data);
data += strnlen ((char *) data, end - data);
if (data < end)
data++;
}
/* PR 17512: file: 002-132094-0.004. */
if (data >= end - 1)
break;
}
/* Skip the NUL at the end of the table. */
if (data < end)
data++;
/* Display the contents of the File Name table. */
if (data >= end || *data == 0)
printf (_("\n The File Name Table is empty.\n"));
else
{
printf (_("\n The File Name Table (offset 0x%lx):\n"),
(long)(data - start));
printf (_(" Entry\tDir\tTime\tSize\tName\n"));
while (data < end && *data != 0)
{
unsigned char *name;
dwarf_vma val;
printf (" %d\t", ++state_machine_regs.last_file_entry);
name = data;
data += strnlen ((char *) data, end - data);
if (data < end)
data++;
READ_ULEB (val, data, end);
printf ("%s\t", dwarf_vmatoa ("u", val));
READ_ULEB (val, data, end);
printf ("%s\t", dwarf_vmatoa ("u", val));
READ_ULEB (val, data, end);
printf ("%s\t", dwarf_vmatoa ("u", val));
printf ("%.*s\n", (int)(end - name), name);
if (data >= end)
{
warn (_("Corrupt file name table entry\n"));
break;
}
}
}
/* Skip the NUL at the end of the table. */
if (data < end)
data++;
}
putchar ('\n');
saved_linfo = linfo;
}
/* Now display the statements. */
if (data >= end_of_sequence)
printf (_(" No Line Number Statements.\n"));
else
{
printf (_(" Line Number Statements:\n"));
while (data < end_of_sequence)
{
unsigned char op_code;
dwarf_signed_vma adv;
dwarf_vma uladv;
printf (" [0x%08lx]", (long)(data - start));
op_code = *data++;
if (op_code >= linfo.li_opcode_base)
{
op_code -= linfo.li_opcode_base;
uladv = (op_code / linfo.li_line_range);
if (linfo.li_max_ops_per_insn == 1)
{
uladv *= linfo.li_min_insn_length;
state_machine_regs.address += uladv;
if (uladv)
state_machine_regs.view = 0;
printf (_(" Special opcode %d: "
"advance Address by %s to 0x%s%s"),
op_code, dwarf_vmatoa ("u", uladv),
dwarf_vmatoa ("x", state_machine_regs.address),
verbose_view && uladv
? _(" (reset view)") : "");
}
else
{
unsigned addrdelta
= ((state_machine_regs.op_index + uladv)
/ linfo.li_max_ops_per_insn)
* linfo.li_min_insn_length;
state_machine_regs.address += addrdelta;
state_machine_regs.op_index
= (state_machine_regs.op_index + uladv)
% linfo.li_max_ops_per_insn;
if (addrdelta)
state_machine_regs.view = 0;
printf (_(" Special opcode %d: "
"advance Address by %s to 0x%s[%d]%s"),
op_code, dwarf_vmatoa ("u", uladv),
dwarf_vmatoa ("x", state_machine_regs.address),
state_machine_regs.op_index,
verbose_view && addrdelta
? _(" (reset view)") : "");
}
adv = (op_code % linfo.li_line_range) + linfo.li_line_base;
state_machine_regs.line += adv;
printf (_(" and Line by %s to %d"),
dwarf_vmatoa ("d", adv), state_machine_regs.line);
if (verbose_view || state_machine_regs.view)
printf (_(" (view %u)\n"), state_machine_regs.view);
else
putchar ('\n');
state_machine_regs.view++;
}
else
switch (op_code)
{
case DW_LNS_extended_op:
data += process_extended_line_op (data,
linfo.li_default_is_stmt,
end);
break;
case DW_LNS_copy:
printf (_(" Copy"));
if (verbose_view || state_machine_regs.view)
printf (_(" (view %u)\n"), state_machine_regs.view);
else
putchar ('\n');
state_machine_regs.view++;
break;
case DW_LNS_advance_pc:
READ_ULEB (uladv, data, end);
if (linfo.li_max_ops_per_insn == 1)
{
uladv *= linfo.li_min_insn_length;
state_machine_regs.address += uladv;
if (uladv)
state_machine_regs.view = 0;
printf (_(" Advance PC by %s to 0x%s%s\n"),
dwarf_vmatoa ("u", uladv),
dwarf_vmatoa ("x", state_machine_regs.address),
verbose_view && uladv
? _(" (reset view)") : "");
}
else
{
unsigned addrdelta
= ((state_machine_regs.op_index + uladv)
/ linfo.li_max_ops_per_insn)
* linfo.li_min_insn_length;
state_machine_regs.address
+= addrdelta;
state_machine_regs.op_index
= (state_machine_regs.op_index + uladv)
% linfo.li_max_ops_per_insn;
if (addrdelta)
state_machine_regs.view = 0;
printf (_(" Advance PC by %s to 0x%s[%d]%s\n"),
dwarf_vmatoa ("u", uladv),
dwarf_vmatoa ("x", state_machine_regs.address),
state_machine_regs.op_index,
verbose_view && addrdelta
? _(" (reset view)") : "");
}
break;
case DW_LNS_advance_line:
READ_SLEB (adv, data, end);
state_machine_regs.line += adv;
printf (_(" Advance Line by %s to %d\n"),
dwarf_vmatoa ("d", adv),
state_machine_regs.line);
break;
case DW_LNS_set_file:
READ_ULEB (uladv, data, end);
printf (_(" Set File Name to entry %s in the File Name Table\n"),
dwarf_vmatoa ("u", uladv));
state_machine_regs.file = uladv;
break;
case DW_LNS_set_column:
READ_ULEB (uladv, data, end);
printf (_(" Set column to %s\n"),
dwarf_vmatoa ("u", uladv));
state_machine_regs.column = uladv;
break;
case DW_LNS_negate_stmt:
adv = state_machine_regs.is_stmt;
adv = ! adv;
printf (_(" Set is_stmt to %s\n"), dwarf_vmatoa ("d", adv));
state_machine_regs.is_stmt = adv;
break;
case DW_LNS_set_basic_block:
printf (_(" Set basic block\n"));
state_machine_regs.basic_block = 1;
break;
case DW_LNS_const_add_pc:
uladv = ((255 - linfo.li_opcode_base) / linfo.li_line_range);
if (linfo.li_max_ops_per_insn)
{
uladv *= linfo.li_min_insn_length;
state_machine_regs.address += uladv;
if (uladv)
state_machine_regs.view = 0;
printf (_(" Advance PC by constant %s to 0x%s%s\n"),
dwarf_vmatoa ("u", uladv),
dwarf_vmatoa ("x", state_machine_regs.address),
verbose_view && uladv
? _(" (reset view)") : "");
}
else
{
unsigned addrdelta
= ((state_machine_regs.op_index + uladv)
/ linfo.li_max_ops_per_insn)
* linfo.li_min_insn_length;
state_machine_regs.address
+= addrdelta;
state_machine_regs.op_index
= (state_machine_regs.op_index + uladv)
% linfo.li_max_ops_per_insn;
if (addrdelta)
state_machine_regs.view = 0;
printf (_(" Advance PC by constant %s to 0x%s[%d]%s\n"),
dwarf_vmatoa ("u", uladv),
dwarf_vmatoa ("x", state_machine_regs.address),
state_machine_regs.op_index,
verbose_view && addrdelta
? _(" (reset view)") : "");
}
break;
case DW_LNS_fixed_advance_pc:
SAFE_BYTE_GET_AND_INC (uladv, data, 2, end);
state_machine_regs.address += uladv;
state_machine_regs.op_index = 0;
printf (_(" Advance PC by fixed size amount %s to 0x%s\n"),
dwarf_vmatoa ("u", uladv),
dwarf_vmatoa ("x", state_machine_regs.address));
/* Do NOT reset view. */
break;
case DW_LNS_set_prologue_end:
printf (_(" Set prologue_end to true\n"));
break;
case DW_LNS_set_epilogue_begin:
printf (_(" Set epilogue_begin to true\n"));
break;
case DW_LNS_set_isa:
READ_ULEB (uladv, data, end);
printf (_(" Set ISA to %s\n"), dwarf_vmatoa ("u", uladv));
break;
default:
printf (_(" Unknown opcode %d with operands: "), op_code);
if (standard_opcodes != NULL)
for (i = standard_opcodes[op_code - 1]; i > 0 ; --i)
{
READ_ULEB (uladv, data, end);
printf ("0x%s%s", dwarf_vmatoa ("x", uladv),
i == 1 ? "" : ", ");
}
putchar ('\n');
break;
}
}
putchar ('\n');
}
}
return 1;
}
| 0
|
413,654
|
static int fcn_list_legacy(RCore *core, RList *fcns) {
RListIter *iter;
RAnalFunction *fcn;
r_list_foreach (fcns, iter, fcn) {
fcn_print_legacy (core, fcn);
}
r_cons_newline ();
return 0;
}
| 0
|
225,595
|
GF_Err stbl_box_size(GF_Box *s)
{
u32 pos=0;
GF_SampleTableBox *ptr = (GF_SampleTableBox *)s;
gf_isom_check_position(s, (GF_Box *)ptr->SampleDescription, &pos);
gf_isom_check_position(s, (GF_Box *)ptr->TimeToSample, &pos);
gf_isom_check_position(s, (GF_Box *)ptr->CompositionOffset, &pos);
gf_isom_check_position(s, (GF_Box *)ptr->CompositionToDecode, &pos);
gf_isom_check_position(s, (GF_Box *)ptr->SyncSample, &pos);
gf_isom_check_position(s, (GF_Box *)ptr->ShadowSync, &pos);
gf_isom_check_position(s, (GF_Box *)ptr->SampleToChunk, &pos);
gf_isom_check_position(s, (GF_Box *)ptr->SampleSize, &pos);
gf_isom_check_position(s, (GF_Box *)ptr->ChunkOffset, &pos);
gf_isom_check_position(s, (GF_Box *)ptr->DegradationPriority, &pos);
gf_isom_check_position(s, (GF_Box *)ptr->SampleDep, &pos);
gf_isom_check_position(s, (GF_Box *)ptr->PaddingBits, &pos);
if (ptr->sub_samples) {
gf_isom_check_position_list(s, ptr->sub_samples, &pos);
}
if (ptr->sampleGroupsDescription) {
gf_isom_check_position_list(s, ptr->sampleGroupsDescription, &pos);
}
if (ptr->sampleGroups) {
gf_isom_check_position_list(s, ptr->sampleGroups, &pos);
}
if (ptr->sai_sizes) {
gf_isom_check_position_list(s, ptr->sai_sizes, &pos);
}
if (ptr->sai_offsets) {
gf_isom_check_position_list(s, ptr->sai_offsets, &pos);
}
return GF_OK;
}
| 0
|
203,980
|
static void mkiss_close(struct tty_struct *tty)
{
struct mkiss *ax;
write_lock_irq(&disc_data_lock);
ax = tty->disc_data;
tty->disc_data = NULL;
write_unlock_irq(&disc_data_lock);
if (!ax)
return;
/*
* We have now ensured that nobody can start using ap from now on, but
* we have to wait for all existing users to finish.
*/
if (!refcount_dec_and_test(&ax->refcnt))
wait_for_completion(&ax->dead);
/*
* Halt the transmit queue so that a new transmit cannot scribble
* on our buffers
*/
netif_stop_queue(ax->dev);
/* Free all AX25 frame buffers. */
kfree(ax->rbuff);
kfree(ax->xbuff);
ax->tty = NULL;
unregister_netdev(ax->dev);
free_netdev(ax->dev);
}
| 1
|
463,193
|
void dupentryatt(struct entryattlist **dst,
const struct entryattlist *src)
{
for ( ; src ; src = src->next) {
struct attvaluelist *attvalues = NULL;
dupattvalues(&attvalues, src->attvalues);
appendentryatt(dst, src->entry, attvalues);
}
}
| 0
|
432,240
|
static MemTxResult subpage_write(struct uc_struct *uc, void *opaque, hwaddr addr,
uint64_t value, unsigned len, MemTxAttrs attrs)
{
subpage_t *subpage = opaque;
uint8_t buf[8];
#if defined(DEBUG_SUBPAGE)
printf("%s: subpage %p len %u addr " TARGET_FMT_plx
" value %"PRIx64"\n",
__func__, subpage, len, addr, value);
#endif
stn_p(buf, len, value);
return flatview_write(uc, subpage->fv, addr + subpage->base, attrs, buf, len);
}
| 0
|
421,379
|
static void pobject(int d, js_Ast *list)
{
pc('{');
if (list) {
nl();
in(d+1);
}
while (list) {
js_Ast *kv = list->a;
assert(list->type == AST_LIST);
switch (kv->type) {
default: break;
case EXP_PROP_VAL:
pexpi(d+1, COMMA, kv->a);
pc(':'); sp();
pexpi(d+1, COMMA, kv->b);
break;
case EXP_PROP_GET:
ps("get ");
pexpi(d+1, COMMA, kv->a);
ps("()"); sp(); pc('{'); nl();
pstmlist(d+1, kv->c);
in(d+1); pc('}');
break;
case EXP_PROP_SET:
ps("set ");
pexpi(d+1, COMMA, kv->a);
pc('(');
pargs(d+1, kv->b);
pc(')'); sp(); pc('{'); nl();
pstmlist(d+1, kv->c);
in(d+1); pc('}');
break;
}
list = list->b;
if (list) {
pc(',');
nl();
in(d+1);
} else {
nl();
in(d);
}
}
pc('}');
}
| 0
|
225,616
|
GF_Err edts_box_read(GF_Box *s, GF_BitStream *bs)
{
return gf_isom_box_array_read(s, bs);
}
| 0
|
512,649
|
longlong Item_func_case::int_op()
{
DBUG_ASSERT(fixed == 1);
Item *item= find_item();
longlong res;
if (!item)
{
null_value=1;
return 0;
}
res=item->val_int();
null_value=item->null_value;
return res;
}
| 0
|
232,305
|
GF_Err gf_isom_box_dump(void *ptr, FILE * trace)
{
GF_Box *a = (GF_Box *) ptr;
if (!a) {
gf_fprintf(trace, "<!--ERROR: NULL Box Found-->\n");
return GF_OK;
}
if (!a->registry) {
GF_LOG(GF_LOG_ERROR, GF_LOG_CONTAINER, ("[isom] trying to dump box %s not registered\n", gf_4cc_to_str(a->type) ));
return GF_ISOM_INVALID_FILE;
}
a->registry->dump_fn(a, trace);
return GF_OK;
| 0
|
234,812
|
static void check_raid56_incompat_flag(struct btrfs_fs_info *info, u64 type)
{
if (!(type & BTRFS_BLOCK_GROUP_RAID56_MASK))
return;
btrfs_set_fs_incompat(info, RAID56);
}
| 0
|
226,278
|
GF_Err nmhd_box_read(GF_Box *s, GF_BitStream *bs)
{
return GF_OK;
}
| 0
|
242,956
|
static int ssl_check_record_type( uint8_t record_type )
{
if( record_type != MBEDTLS_SSL_MSG_HANDSHAKE &&
record_type != MBEDTLS_SSL_MSG_ALERT &&
record_type != MBEDTLS_SSL_MSG_CHANGE_CIPHER_SPEC &&
record_type != MBEDTLS_SSL_MSG_APPLICATION_DATA )
{
return( MBEDTLS_ERR_SSL_INVALID_RECORD );
}
return( 0 );
}
| 0
|
247,735
|
TEST_P(SslSocketTest, RsaPrivateKeyProviderMultiCertSuccess) {
const std::string client_ctx_yaml = absl::StrCat(R"EOF(
common_tls_context:
tls_params:
tls_minimum_protocol_version: TLSv1_2
tls_maximum_protocol_version: TLSv1_2
cipher_suites:
- ECDHE-ECDSA-AES128-GCM-SHA256
- ECDHE-RSA-AES128-GCM-SHA256
validation_context:
verify_certificate_hash: )EOF",
TEST_SELFSIGNED_ECDSA_P256_CERT_256_HASH);
const std::string server_ctx_yaml = R"EOF(
common_tls_context:
tls_certificates:
- certificate_chain:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/selfsigned_cert.pem"
private_key_provider:
provider_name: test
typed_config:
"@type": type.googleapis.com/google.protobuf.Struct
value:
private_key_file: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/unittest_key.pem"
expected_operation: sign
sync_mode: false
mode: rsa
- certificate_chain:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/selfsigned_ecdsa_p256_cert.pem"
private_key:
filename: "{{ test_rundir }}/test/extensions/transport_sockets/tls/test_data/selfsigned_ecdsa_p256_key.pem"
)EOF";
TestUtilOptions test_options(client_ctx_yaml, server_ctx_yaml, true, GetParam());
testUtil(test_options.setPrivateKeyMethodExpected(true));
}
| 0
|
230,276
|
njs_array_iterator_call(njs_vm_t *vm, njs_iterator_args_t *args,
const njs_value_t *entry, uint32_t n)
{
njs_value_t arguments[3];
/* GC: array elt, array */
arguments[0] = *entry;
njs_set_number(&arguments[1], n);
arguments[2] = *args->value;
return njs_function_call(vm, args->function, args->argument, arguments, 3,
&vm->retval);
}
| 0
|
244,302
|
void dOps_box_del(GF_Box *s)
{
GF_OpusSpecificBox *ptr = (GF_OpusSpecificBox *)s;
if (ptr) gf_free(ptr);
}
| 0
|
512,273
|
bool agg_arg_charsets_for_comparison(DTCollation &c,
Item **items, uint nitems,
int item_sep= 1)
{
return Type_std_attributes::
agg_arg_charsets_for_comparison(c, func_name(), items, nitems, item_sep);
}
| 0
|
506,442
|
mech_rpa_auth_continue(struct auth_request *auth_request,
const unsigned char *data, size_t data_size)
{
struct rpa_auth_request *request =
(struct rpa_auth_request *)auth_request;
switch (request->phase) {
case 0:
mech_rpa_auth_phase1(auth_request, data, data_size);
break;
case 1:
mech_rpa_auth_phase2(auth_request, data, data_size);
break;
case 2:
mech_rpa_auth_phase3(auth_request, data, data_size);
break;
default:
auth_request_fail(auth_request);
break;
}
}
| 0
|
436,126
|
static int io_unlinkat_prep(struct io_kiocb *req,
const struct io_uring_sqe *sqe)
{
struct io_unlink *un = &req->unlink;
const char __user *fname;
if (unlikely(req->ctx->flags & IORING_SETUP_IOPOLL))
return -EINVAL;
if (sqe->ioprio || sqe->off || sqe->len || sqe->buf_index)
return -EINVAL;
if (unlikely(req->flags & REQ_F_FIXED_FILE))
return -EBADF;
un->dfd = READ_ONCE(sqe->fd);
un->flags = READ_ONCE(sqe->unlink_flags);
if (un->flags & ~AT_REMOVEDIR)
return -EINVAL;
fname = u64_to_user_ptr(READ_ONCE(sqe->addr));
un->filename = getname(fname);
if (IS_ERR(un->filename))
return PTR_ERR(un->filename);
req->flags |= REQ_F_NEED_CLEANUP;
return 0;
}
| 0
|
238,579
|
static int set_callee_state(struct bpf_verifier_env *env,
struct bpf_func_state *caller,
struct bpf_func_state *callee, int insn_idx)
{
int i;
/* copy r1 - r5 args that callee can access. The copy includes parent
* pointers, which connects us up to the liveness chain
*/
for (i = BPF_REG_1; i <= BPF_REG_5; i++)
callee->regs[i] = caller->regs[i];
return 0;
}
| 0
|
254,894
|
DocumentSource::GetNextResult DocumentSourceGroup::getNextStandard() {
// Not spilled, and not streaming.
if (_groups->empty())
return GetNextResult::makeEOF();
Document out = makeDocument(groupsIterator->first, groupsIterator->second, pExpCtx->needsMerge);
if (++groupsIterator == _groups->end())
dispose();
return std::move(out);
}
| 0
|
226,032
|
GF_Err uuid_box_size(GF_Box *s)
{
GF_UnknownUUIDBox*ptr = (GF_UnknownUUIDBox*)s;
ptr->size += ptr->dataSize;
return GF_OK;
}
| 0
|
257,704
|
static handler_t wstunnel_create_env(gw_handler_ctx *gwhctx) {
handler_ctx *hctx = (handler_ctx *)gwhctx;
request_st * const r = hctx->gw.r;
handler_t rc;
if (0 == r->reqbody_length || r->http_version > HTTP_VERSION_1_1) {
http_response_upgrade_read_body_unknown(r);
chunkqueue_append_chunkqueue(&r->reqbody_queue, &r->read_queue);
}
rc = mod_wstunnel_handshake_create_response(hctx);
if (rc != HANDLER_GO_ON) return rc;
r->http_status = (r->http_version > HTTP_VERSION_1_1)
? 200 /* OK (response status for CONNECT) */
: 101; /* Switching Protocols */
r->resp_body_started = 1;
hctx->ping_ts = log_monotonic_secs;
gw_set_transparent(&hctx->gw);
return HANDLER_GO_ON;
}
| 0
|
225,447
|
static int vidioc_subscribe_event(struct v4l2_fh *fh,
const struct v4l2_event_subscription *sub)
{
switch (sub->type) {
case V4L2_EVENT_CTRL:
return v4l2_ctrl_subscribe_event(fh, sub);
}
return -EINVAL;
}
| 0
|
326,620
|
archive_write_disk_set_skip_file(struct archive *_a, la_int64_t d, la_int64_t i)
{
struct archive_write_disk *a = (struct archive_write_disk *)_a;
archive_check_magic(&a->archive, ARCHIVE_WRITE_DISK_MAGIC,
ARCHIVE_STATE_ANY, "archive_write_disk_set_skip_file");
a->skip_file_set = 1;
a->skip_file_dev = d;
a->skip_file_ino = i;
return (ARCHIVE_OK);
}
| 0
|
393,524
|
static SQInteger obj_clear(HSQUIRRELVM v)
{
return SQ_SUCCEEDED(sq_clear(v,-1)) ? 1 : SQ_ERROR;
}
| 0
|
366,233
|
int may_umount(struct vfsmount *mnt)
{
int ret = 1;
down_read(&namespace_sem);
lock_mount_hash();
if (propagate_mount_busy(real_mount(mnt), 2))
ret = 0;
unlock_mount_hash();
up_read(&namespace_sem);
return ret;
}
| 0
|
281,137
|
static inline struct dst_entry *xfrm_dst_lookup(struct xfrm_state *x,
int tos, int oif,
xfrm_address_t *prev_saddr,
xfrm_address_t *prev_daddr,
int family)
{
struct net *net = xs_net(x);
xfrm_address_t *saddr = &x->props.saddr;
xfrm_address_t *daddr = &x->id.daddr;
struct dst_entry *dst;
if (x->type->flags & XFRM_TYPE_LOCAL_COADDR) {
saddr = x->coaddr;
daddr = prev_daddr;
}
if (x->type->flags & XFRM_TYPE_REMOTE_COADDR) {
saddr = prev_saddr;
daddr = x->coaddr;
}
dst = __xfrm_dst_lookup(net, tos, oif, saddr, daddr, family);
if (!IS_ERR(dst)) {
if (prev_saddr != saddr)
memcpy(prev_saddr, saddr, sizeof(*prev_saddr));
if (prev_daddr != daddr)
memcpy(prev_daddr, daddr, sizeof(*prev_daddr));
}
return dst;
}
| 0
|
384,878
|
dos_expandpath(
garray_T *gap,
char_u *path,
int wildoff,
int flags, // EW_* flags
int didstar) // expanded "**" once already
{
char_u *buf;
char_u *path_end;
char_u *p, *s, *e;
int start_len = gap->ga_len;
char_u *pat;
regmatch_T regmatch;
int starts_with_dot;
int matches;
int len;
int starstar = FALSE;
static int stardepth = 0; // depth for "**" expansion
HANDLE hFind = INVALID_HANDLE_VALUE;
WIN32_FIND_DATAW wfb;
WCHAR *wn = NULL; // UCS-2 name, NULL when not used.
char_u *matchname;
int ok;
char_u *p_alt;
// Expanding "**" may take a long time, check for CTRL-C.
if (stardepth > 0)
{
ui_breakcheck();
if (got_int)
return 0;
}
// Make room for file name. When doing encoding conversion the actual
// length may be quite a bit longer, thus use the maximum possible length.
buf = alloc(MAXPATHL);
if (buf == NULL)
return 0;
/*
* Find the first part in the path name that contains a wildcard or a ~1.
* Copy it into buf, including the preceding characters.
*/
p = buf;
s = buf;
e = NULL;
path_end = path;
while (*path_end != NUL)
{
// May ignore a wildcard that has a backslash before it; it will
// be removed by rem_backslash() or file_pat_to_reg_pat() below.
if (path_end >= path + wildoff && rem_backslash(path_end))
*p++ = *path_end++;
else if (*path_end == '\\' || *path_end == ':' || *path_end == '/')
{
if (e != NULL)
break;
s = p + 1;
}
else if (path_end >= path + wildoff
&& vim_strchr((char_u *)"*?[~", *path_end) != NULL)
e = p;
if (has_mbyte)
{
len = (*mb_ptr2len)(path_end);
STRNCPY(p, path_end, len);
p += len;
path_end += len;
}
else
*p++ = *path_end++;
}
e = p;
*e = NUL;
// now we have one wildcard component between s and e
// Remove backslashes between "wildoff" and the start of the wildcard
// component.
for (p = buf + wildoff; p < s; ++p)
if (rem_backslash(p))
{
STRMOVE(p, p + 1);
--e;
--s;
}
// Check for "**" between "s" and "e".
for (p = s; p < e; ++p)
if (p[0] == '*' && p[1] == '*')
starstar = TRUE;
starts_with_dot = *s == '.';
pat = file_pat_to_reg_pat(s, e, NULL, FALSE);
if (pat == NULL)
{
vim_free(buf);
return 0;
}
// compile the regexp into a program
if (flags & (EW_NOERROR | EW_NOTWILD))
++emsg_silent;
regmatch.rm_ic = TRUE; // Always ignore case
regmatch.regprog = vim_regcomp(pat, RE_MAGIC);
if (flags & (EW_NOERROR | EW_NOTWILD))
--emsg_silent;
vim_free(pat);
if (regmatch.regprog == NULL && (flags & EW_NOTWILD) == 0)
{
vim_free(buf);
return 0;
}
// remember the pattern or file name being looked for
matchname = vim_strsave(s);
// If "**" is by itself, this is the first time we encounter it and more
// is following then find matches without any directory.
if (!didstar && stardepth < 100 && starstar && e - s == 2
&& *path_end == '/')
{
STRCPY(s, path_end + 1);
++stardepth;
(void)dos_expandpath(gap, buf, (int)(s - buf), flags, TRUE);
--stardepth;
}
// Scan all files in the directory with "dir/ *.*"
STRCPY(s, "*.*");
wn = enc_to_utf16(buf, NULL);
if (wn != NULL)
hFind = FindFirstFileW(wn, &wfb);
ok = (hFind != INVALID_HANDLE_VALUE);
while (ok)
{
p = utf16_to_enc(wfb.cFileName, NULL); // p is allocated here
if (p == NULL)
break; // out of memory
// Do not use the alternate filename when the file name ends in '~',
// because it picks up backup files: short name for "foo.vim~" is
// "foo~1.vim", which matches "*.vim".
if (*wfb.cAlternateFileName == NUL || p[STRLEN(p) - 1] == '~')
p_alt = NULL;
else
p_alt = utf16_to_enc(wfb.cAlternateFileName, NULL);
// Ignore entries starting with a dot, unless when asked for. Accept
// all entries found with "matchname".
if ((p[0] != '.' || starts_with_dot
|| ((flags & EW_DODOT)
&& p[1] != NUL && (p[1] != '.' || p[2] != NUL)))
&& (matchname == NULL
|| (regmatch.regprog != NULL
&& (vim_regexec(®match, p, (colnr_T)0)
|| (p_alt != NULL
&& vim_regexec(®match, p_alt, (colnr_T)0))))
|| ((flags & EW_NOTWILD)
&& fnamencmp(path + (s - buf), p, e - s) == 0)))
{
STRCPY(s, p);
len = (int)STRLEN(buf);
if (starstar && stardepth < 100
&& (wfb.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
{
// For "**" in the pattern first go deeper in the tree to
// find matches.
STRCPY(buf + len, "/**");
STRCPY(buf + len + 3, path_end);
++stardepth;
(void)dos_expandpath(gap, buf, len + 1, flags, TRUE);
--stardepth;
}
STRCPY(buf + len, path_end);
if (mch_has_exp_wildcard(path_end))
{
// need to expand another component of the path
// remove backslashes for the remaining components only
(void)dos_expandpath(gap, buf, len + 1, flags, FALSE);
}
else
{
// no more wildcards, check if there is a match
// remove backslashes for the remaining components only
if (*path_end != 0)
backslash_halve(buf + len + 1);
if (mch_getperm(buf) >= 0) // add existing file
addfile(gap, buf, flags);
}
}
vim_free(p_alt);
vim_free(p);
ok = FindNextFileW(hFind, &wfb);
}
FindClose(hFind);
vim_free(wn);
vim_free(buf);
vim_regfree(regmatch.regprog);
vim_free(matchname);
matches = gap->ga_len - start_len;
if (matches > 0)
qsort(((char_u **)gap->ga_data) + start_len, (size_t)matches,
sizeof(char_u *), pstrcmp);
return matches;
}
| 0
|
218,979
|
Status ConstantFolding::MaterializeReductionIndices(
NodeDef* node, const GraphProperties& properties) {
if (node->input_size() < 2) {
return Status::OK();
}
const NodeDef* indices = node_map_->GetNode(node->input(1));
if (!indices || IsReallyConstant(*indices)) {
// The reduction indices are already constant, there's nothing to do.
return Status::OK();
}
const std::vector<OpInfo::TensorProperties>& input_props =
properties.GetInputProperties(node->name());
if (input_props.size() != 2) {
return Status::OK();
}
const OpInfo::TensorProperties& input_prop = input_props[0];
if (input_prop.shape().unknown_rank()) {
// We can't do anything if we don't know the rank of the input.
return Status::OK();
}
const int input_rank = input_prop.shape().dim_size();
if (input_rank < 1) {
// Unexpected graph, don't try to change it.
return Status::OK();
}
const OpInfo::TensorProperties& reduction_indices_prop = input_props[1];
DataType dtype = reduction_indices_prop.dtype();
if (dtype != DT_INT32 && dtype != DT_INT64) {
return Status::OK();
}
PartialTensorShape reduction_indices_shape(reduction_indices_prop.shape());
const int num_reduction_indices = reduction_indices_shape.num_elements();
const std::vector<OpInfo::TensorProperties>& output_props =
properties.GetOutputProperties(node->name());
if (output_props.size() != 1) {
return Status::OK();
}
const OpInfo::TensorProperties& output_prop = output_props[0];
const int output_rank =
output_prop.shape().unknown_rank() ? -1 : output_prop.shape().dim_size();
bool full_reduction = output_rank == 0 || num_reduction_indices == input_rank;
if (!full_reduction) {
// A full reduction will generate a tensor of one of the shapes
// [], [1], [1, 1], [1, 1, ...]. Even if we do not know the number of
// elements in the output of the reduction, we may deduce it from reshape
// nodes following it.
for (const NodeDef* fanout : node_map_->GetOutputs(node->name())) {
full_reduction = false;
if (!IsReshape(*fanout)) {
return Status::OK();
}
const std::vector<OpInfo::TensorProperties>& reshape_props =
properties.GetOutputProperties(fanout->name());
if (reshape_props.size() != 1) {
return Status::OK();
}
const OpInfo::TensorProperties& reshape_prop = reshape_props[0];
PartialTensorShape shape(reshape_prop.shape());
if (shape.num_elements() != 1) {
return Status::OK();
} else {
full_reduction = true;
}
}
if (!full_reduction) {
return Status::OK();
}
}
// We know it's a full reduction. We can generate the full set of indices to
// reduce as a constant node.
string const_name = OptimizedNodeName(*node, "-reduction_indices");
if (node_map_->GetNode(const_name)) {
return Status::OK();
}
NodeDef* reduction_indices = graph_->add_node();
Tensor value(dtype, TensorShape({input_rank}));
for (int i = 0; i < input_rank; ++i) {
if (dtype == DT_INT32) {
value.vec<int32>()(i) = i;
} else {
value.vec<int64_t>()(i) = i;
}
}
TF_RETURN_IF_ERROR(
CreateNodeDef(const_name, TensorValue(&value), reduction_indices));
reduction_indices->set_device(node->device());
string ctrl_dep =
AddControlDependency(node->input(1), graph_, node_map_.get());
*reduction_indices->add_input() = ctrl_dep;
node_map_->AddNode(const_name, reduction_indices);
node_map_->AddOutput(NodeName(ctrl_dep), const_name);
node->set_input(1, reduction_indices->name());
node_map_->UpdateInput(node->name(), indices->name(),
reduction_indices->name());
return Status::OK();
}
| 0
|
241,071
|
static int _lockfile(int mode, int *fdp, pid_t *locked_by)
{
struct flock lock;
int fd, rv;
/* After reboot the directory may not yet exist.
* Try to create it, but ignore errors. */
if (strncmp(cl.lockfile, BOOTH_RUN_DIR,
strlen(BOOTH_RUN_DIR)) == 0)
(void)mkdir(BOOTH_RUN_DIR, 0775);
if (locked_by)
*locked_by = 0;
*fdp = -1;
fd = open(cl.lockfile, mode, 0664);
if (fd < 0)
return errno;
*fdp = fd;
lock.l_type = F_WRLCK;
lock.l_start = 0;
lock.l_whence = SEEK_SET;
lock.l_len = 0;
lock.l_pid = 0;
if (fcntl(fd, F_SETLK, &lock) == 0)
return 0;
rv = errno;
if (locked_by)
if (fcntl(fd, F_GETLK, &lock) == 0)
*locked_by = lock.l_pid;
return rv;
}
| 0
|
218,988
|
float QuantizedTypeMaxAsFloat(DataType data_type) {
switch (data_type) {
case DT_QINT8:
return Eigen::NumTraits<qint8>::highest();
case DT_QUINT8:
return Eigen::NumTraits<quint8>::highest();
case DT_QINT16:
return Eigen::NumTraits<qint16>::highest();
case DT_QUINT16:
return Eigen::NumTraits<quint16>::highest();
case DT_QINT32:
return Eigen::NumTraits<qint32>::highest();
default:
return 0.0f;
}
}
| 0
|
238,397
|
njs_function_prototype_create(njs_vm_t *vm, njs_object_prop_t *prop,
njs_value_t *value, njs_value_t *setval, njs_value_t *retval)
{
njs_value_t *proto, proto_value, *cons;
njs_object_t *prototype;
njs_function_t *function;
if (setval == NULL) {
prototype = njs_object_alloc(vm);
if (njs_slow_path(prototype == NULL)) {
return NJS_ERROR;
}
njs_set_object(&proto_value, prototype);
setval = &proto_value;
}
function = njs_function_value_copy(vm, value);
if (njs_slow_path(function == NULL)) {
return NJS_ERROR;
}
proto = njs_function_property_prototype_set(vm, njs_object_hash(value),
setval);
if (njs_slow_path(proto == NULL)) {
return NJS_ERROR;
}
if (setval == &proto_value && njs_is_object(proto)) {
/* Only in getter context. */
cons = njs_property_constructor_set(vm, njs_object_hash(proto), value);
if (njs_slow_path(cons == NULL)) {
return NJS_ERROR;
}
}
*retval = *proto;
return NJS_OK;
}
| 0
|
226,242
|
GF_Err dimm_box_size(GF_Box *s)
{
s->size += 8;
return GF_OK;
}
| 0
|
458,988
|
http_SetH(struct http *to, unsigned n, const char *header)
{
assert(n < to->nhd);
AN(header);
to->hd[n].b = TRUST_ME(header);
to->hd[n].e = strchr(to->hd[n].b, '\0');
to->hdf[n] = 0;
http_VSLH(to, n);
if (n == HTTP_HDR_PROTO)
http_Proto(to);
}
| 0
|
336,113
|
static netdev_tx_t ip6gre_tunnel_xmit(struct sk_buff *skb,
struct net_device *dev)
{
struct ip6_tnl *t = netdev_priv(dev);
struct net_device_stats *stats = &t->dev->stats;
int ret;
if (!ip6_tnl_xmit_ctl(t, &t->parms.laddr, &t->parms.raddr))
goto tx_err;
switch (skb->protocol) {
case htons(ETH_P_IP):
ret = ip6gre_xmit_ipv4(skb, dev);
break;
case htons(ETH_P_IPV6):
ret = ip6gre_xmit_ipv6(skb, dev);
break;
default:
ret = ip6gre_xmit_other(skb, dev);
break;
}
if (ret < 0)
goto tx_err;
return NETDEV_TX_OK;
tx_err:
stats->tx_errors++;
stats->tx_dropped++;
kfree_skb(skb);
return NETDEV_TX_OK;
}
| 0
|
310,126
|
usage(void)
{
static const char *msg[] =
{
"Usage: dots_xcurses [options]"
,""
,"Options:"
," -T TERM override $TERM"
#if HAVE_USE_DEFAULT_COLORS
," -d invoke use_default_colors()"
#endif
#if HAVE_USE_ENV
," -e allow environment $LINES / $COLUMNS"
#endif
," -m SIZE set margin (default: 2)"
," -r SECS self-interrupt/exit after specified number of seconds"
," -s MSECS delay 1% of the time (default: 1 msecs)"
#if HAVE_ALLOC_PAIR
," -x use alloc_pair() rather than init_pair()"
#endif
};
size_t n;
for (n = 0; n < SIZEOF(msg); n++)
fprintf(stderr, "%s\n", msg[n]);
ExitProgram(EXIT_FAILURE);
}
| 0
|
440,892
|
FatalError(const char *f, ...)
{
va_list args;
va_list args2;
static Bool beenhere = FALSE;
if (beenhere)
ErrorFSigSafe("\nFatalError re-entered, aborting\n");
else
ErrorFSigSafe("\nFatal server error:\n");
va_start(args, f);
/* Make a copy for OsVendorFatalError */
va_copy(args2, args);
#ifdef __APPLE__
{
va_list apple_args;
va_copy(apple_args, args);
(void)vsnprintf(__crashreporter_info_buff__,
sizeof(__crashreporter_info_buff__), f, apple_args);
va_end(apple_args);
}
#endif
VErrorFSigSafe(f, args);
va_end(args);
ErrorFSigSafe("\n");
if (!beenhere)
OsVendorFatalError(f, args2);
va_end(args2);
if (!beenhere) {
beenhere = TRUE;
AbortServer();
}
else
OsAbort();
/*NOTREACHED*/}
| 0
|
292,609
|
size_t puma_parser_execute(puma_parser *parser, const char *buffer, size_t len, size_t off) {
const char *p, *pe;
int cs = parser->cs;
assert(off <= len && "offset past end of buffer");
p = buffer+off;
pe = buffer+len;
/* assert(*pe == '\0' && "pointer does not end on NUL"); */
assert((size_t) (pe - p) == len - off && "pointers aren't same distance");
#line 87 "ext/puma_http11/http11_parser.c"
{
if ( p == pe )
goto _test_eof;
switch ( cs )
{
case 1:
switch( (*p) ) {
case 36: goto tr0;
case 95: goto tr0;
}
if ( (*p) < 48 ) {
if ( 45 <= (*p) && (*p) <= 46 )
goto tr0;
} else if ( (*p) > 57 ) {
if ( 65 <= (*p) && (*p) <= 90 )
goto tr0;
} else
goto tr0;
goto st0;
st0:
cs = 0;
goto _out;
tr0:
#line 37 "ext/puma_http11/http11_parser.rl"
{ MARK(mark, p); }
goto st2;
st2:
if ( ++p == pe )
goto _test_eof2;
case 2:
#line 118 "ext/puma_http11/http11_parser.c"
switch( (*p) ) {
case 32: goto tr2;
case 36: goto st27;
case 95: goto st27;
}
if ( (*p) < 48 ) {
if ( 45 <= (*p) && (*p) <= 46 )
goto st27;
} else if ( (*p) > 57 ) {
if ( 65 <= (*p) && (*p) <= 90 )
goto st27;
} else
goto st27;
goto st0;
tr2:
#line 50 "ext/puma_http11/http11_parser.rl"
{
parser->request_method(parser, PTR_TO(mark), LEN(mark, p));
}
goto st3;
st3:
if ( ++p == pe )
goto _test_eof3;
case 3:
#line 143 "ext/puma_http11/http11_parser.c"
switch( (*p) ) {
case 42: goto tr4;
case 43: goto tr5;
case 47: goto tr6;
case 58: goto tr7;
}
if ( (*p) < 65 ) {
if ( 45 <= (*p) && (*p) <= 57 )
goto tr5;
} else if ( (*p) > 90 ) {
if ( 97 <= (*p) && (*p) <= 122 )
goto tr5;
} else
goto tr5;
goto st0;
tr4:
#line 37 "ext/puma_http11/http11_parser.rl"
{ MARK(mark, p); }
goto st4;
st4:
if ( ++p == pe )
goto _test_eof4;
case 4:
#line 167 "ext/puma_http11/http11_parser.c"
switch( (*p) ) {
case 32: goto tr8;
case 35: goto tr9;
}
goto st0;
tr8:
#line 53 "ext/puma_http11/http11_parser.rl"
{
parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
}
goto st5;
tr31:
#line 37 "ext/puma_http11/http11_parser.rl"
{ MARK(mark, p); }
#line 56 "ext/puma_http11/http11_parser.rl"
{
parser->fragment(parser, PTR_TO(mark), LEN(mark, p));
}
goto st5;
tr33:
#line 56 "ext/puma_http11/http11_parser.rl"
{
parser->fragment(parser, PTR_TO(mark), LEN(mark, p));
}
goto st5;
tr37:
#line 69 "ext/puma_http11/http11_parser.rl"
{
parser->request_path(parser, PTR_TO(mark), LEN(mark,p));
}
#line 53 "ext/puma_http11/http11_parser.rl"
{
parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
}
goto st5;
tr41:
#line 60 "ext/puma_http11/http11_parser.rl"
{ MARK(query_start, p); }
#line 61 "ext/puma_http11/http11_parser.rl"
{
parser->query_string(parser, PTR_TO(query_start), LEN(query_start, p));
}
#line 53 "ext/puma_http11/http11_parser.rl"
{
parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
}
goto st5;
tr44:
#line 61 "ext/puma_http11/http11_parser.rl"
{
parser->query_string(parser, PTR_TO(query_start), LEN(query_start, p));
}
#line 53 "ext/puma_http11/http11_parser.rl"
{
parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
}
goto st5;
st5:
if ( ++p == pe )
goto _test_eof5;
case 5:
#line 229 "ext/puma_http11/http11_parser.c"
if ( (*p) == 72 )
goto tr10;
goto st0;
tr10:
#line 37 "ext/puma_http11/http11_parser.rl"
{ MARK(mark, p); }
goto st6;
st6:
if ( ++p == pe )
goto _test_eof6;
case 6:
#line 241 "ext/puma_http11/http11_parser.c"
if ( (*p) == 84 )
goto st7;
goto st0;
st7:
if ( ++p == pe )
goto _test_eof7;
case 7:
if ( (*p) == 84 )
goto st8;
goto st0;
st8:
if ( ++p == pe )
goto _test_eof8;
case 8:
if ( (*p) == 80 )
goto st9;
goto st0;
st9:
if ( ++p == pe )
goto _test_eof9;
case 9:
if ( (*p) == 47 )
goto st10;
goto st0;
st10:
if ( ++p == pe )
goto _test_eof10;
case 10:
if ( 48 <= (*p) && (*p) <= 57 )
goto st11;
goto st0;
st11:
if ( ++p == pe )
goto _test_eof11;
case 11:
if ( (*p) == 46 )
goto st12;
if ( 48 <= (*p) && (*p) <= 57 )
goto st11;
goto st0;
st12:
if ( ++p == pe )
goto _test_eof12;
case 12:
if ( 48 <= (*p) && (*p) <= 57 )
goto st13;
goto st0;
st13:
if ( ++p == pe )
goto _test_eof13;
case 13:
if ( (*p) == 13 )
goto tr18;
if ( 48 <= (*p) && (*p) <= 57 )
goto st13;
goto st0;
tr18:
#line 65 "ext/puma_http11/http11_parser.rl"
{
parser->http_version(parser, PTR_TO(mark), LEN(mark, p));
}
goto st14;
tr26:
#line 46 "ext/puma_http11/http11_parser.rl"
{ MARK(mark, p); }
#line 47 "ext/puma_http11/http11_parser.rl"
{
parser->http_field(parser, PTR_TO(field_start), parser->field_len, PTR_TO(mark), LEN(mark, p));
}
goto st14;
tr29:
#line 47 "ext/puma_http11/http11_parser.rl"
{
parser->http_field(parser, PTR_TO(field_start), parser->field_len, PTR_TO(mark), LEN(mark, p));
}
goto st14;
st14:
if ( ++p == pe )
goto _test_eof14;
case 14:
#line 322 "ext/puma_http11/http11_parser.c"
if ( (*p) == 10 )
goto st15;
goto st0;
st15:
if ( ++p == pe )
goto _test_eof15;
case 15:
switch( (*p) ) {
case 13: goto st16;
case 33: goto tr21;
case 124: goto tr21;
case 126: goto tr21;
}
if ( (*p) < 45 ) {
if ( (*p) > 39 ) {
if ( 42 <= (*p) && (*p) <= 43 )
goto tr21;
} else if ( (*p) >= 35 )
goto tr21;
} else if ( (*p) > 46 ) {
if ( (*p) < 65 ) {
if ( 48 <= (*p) && (*p) <= 57 )
goto tr21;
} else if ( (*p) > 90 ) {
if ( 94 <= (*p) && (*p) <= 122 )
goto tr21;
} else
goto tr21;
} else
goto tr21;
goto st0;
st16:
if ( ++p == pe )
goto _test_eof16;
case 16:
if ( (*p) == 10 )
goto tr22;
goto st0;
tr22:
#line 73 "ext/puma_http11/http11_parser.rl"
{
parser->body_start = p - buffer + 1;
parser->header_done(parser, p + 1, pe - p - 1);
{p++; cs = 46; goto _out;}
}
goto st46;
st46:
if ( ++p == pe )
goto _test_eof46;
case 46:
#line 373 "ext/puma_http11/http11_parser.c"
goto st0;
tr21:
#line 40 "ext/puma_http11/http11_parser.rl"
{ MARK(field_start, p); }
#line 41 "ext/puma_http11/http11_parser.rl"
{ snake_upcase_char((char *)p); }
goto st17;
tr23:
#line 41 "ext/puma_http11/http11_parser.rl"
{ snake_upcase_char((char *)p); }
goto st17;
st17:
if ( ++p == pe )
goto _test_eof17;
case 17:
#line 389 "ext/puma_http11/http11_parser.c"
switch( (*p) ) {
case 33: goto tr23;
case 58: goto tr24;
case 124: goto tr23;
case 126: goto tr23;
}
if ( (*p) < 45 ) {
if ( (*p) > 39 ) {
if ( 42 <= (*p) && (*p) <= 43 )
goto tr23;
} else if ( (*p) >= 35 )
goto tr23;
} else if ( (*p) > 46 ) {
if ( (*p) < 65 ) {
if ( 48 <= (*p) && (*p) <= 57 )
goto tr23;
} else if ( (*p) > 90 ) {
if ( 94 <= (*p) && (*p) <= 122 )
goto tr23;
} else
goto tr23;
} else
goto tr23;
goto st0;
tr24:
#line 42 "ext/puma_http11/http11_parser.rl"
{
parser->field_len = LEN(field_start, p);
}
goto st18;
tr27:
#line 46 "ext/puma_http11/http11_parser.rl"
{ MARK(mark, p); }
goto st18;
st18:
if ( ++p == pe )
goto _test_eof18;
case 18:
#line 428 "ext/puma_http11/http11_parser.c"
switch( (*p) ) {
case 9: goto tr25;
case 13: goto tr26;
case 32: goto tr27;
}
if ( 33 <= (*p) && (*p) <= 126 )
goto tr25;
goto st0;
tr25:
#line 46 "ext/puma_http11/http11_parser.rl"
{ MARK(mark, p); }
goto st19;
st19:
if ( ++p == pe )
goto _test_eof19;
case 19:
#line 445 "ext/puma_http11/http11_parser.c"
switch( (*p) ) {
case 9: goto st19;
case 13: goto tr29;
}
if ( 32 <= (*p) && (*p) <= 126 )
goto st19;
goto st0;
tr9:
#line 53 "ext/puma_http11/http11_parser.rl"
{
parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
}
goto st20;
tr38:
#line 69 "ext/puma_http11/http11_parser.rl"
{
parser->request_path(parser, PTR_TO(mark), LEN(mark,p));
}
#line 53 "ext/puma_http11/http11_parser.rl"
{
parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
}
goto st20;
tr42:
#line 60 "ext/puma_http11/http11_parser.rl"
{ MARK(query_start, p); }
#line 61 "ext/puma_http11/http11_parser.rl"
{
parser->query_string(parser, PTR_TO(query_start), LEN(query_start, p));
}
#line 53 "ext/puma_http11/http11_parser.rl"
{
parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
}
goto st20;
tr45:
#line 61 "ext/puma_http11/http11_parser.rl"
{
parser->query_string(parser, PTR_TO(query_start), LEN(query_start, p));
}
#line 53 "ext/puma_http11/http11_parser.rl"
{
parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
}
goto st20;
st20:
if ( ++p == pe )
goto _test_eof20;
case 20:
#line 495 "ext/puma_http11/http11_parser.c"
switch( (*p) ) {
case 32: goto tr31;
case 60: goto st0;
case 62: goto st0;
case 127: goto st0;
}
if ( (*p) > 31 ) {
if ( 34 <= (*p) && (*p) <= 35 )
goto st0;
} else if ( (*p) >= 0 )
goto st0;
goto tr30;
tr30:
#line 37 "ext/puma_http11/http11_parser.rl"
{ MARK(mark, p); }
goto st21;
st21:
if ( ++p == pe )
goto _test_eof21;
case 21:
#line 516 "ext/puma_http11/http11_parser.c"
switch( (*p) ) {
case 32: goto tr33;
case 60: goto st0;
case 62: goto st0;
case 127: goto st0;
}
if ( (*p) > 31 ) {
if ( 34 <= (*p) && (*p) <= 35 )
goto st0;
} else if ( (*p) >= 0 )
goto st0;
goto st21;
tr5:
#line 37 "ext/puma_http11/http11_parser.rl"
{ MARK(mark, p); }
goto st22;
st22:
if ( ++p == pe )
goto _test_eof22;
case 22:
#line 537 "ext/puma_http11/http11_parser.c"
switch( (*p) ) {
case 43: goto st22;
case 58: goto st23;
}
if ( (*p) < 48 ) {
if ( 45 <= (*p) && (*p) <= 46 )
goto st22;
} else if ( (*p) > 57 ) {
if ( (*p) > 90 ) {
if ( 97 <= (*p) && (*p) <= 122 )
goto st22;
} else if ( (*p) >= 65 )
goto st22;
} else
goto st22;
goto st0;
tr7:
#line 37 "ext/puma_http11/http11_parser.rl"
{ MARK(mark, p); }
goto st23;
st23:
if ( ++p == pe )
goto _test_eof23;
case 23:
#line 562 "ext/puma_http11/http11_parser.c"
switch( (*p) ) {
case 32: goto tr8;
case 34: goto st0;
case 35: goto tr9;
case 60: goto st0;
case 62: goto st0;
case 127: goto st0;
}
if ( 0 <= (*p) && (*p) <= 31 )
goto st0;
goto st23;
tr6:
#line 37 "ext/puma_http11/http11_parser.rl"
{ MARK(mark, p); }
goto st24;
st24:
if ( ++p == pe )
goto _test_eof24;
case 24:
#line 582 "ext/puma_http11/http11_parser.c"
switch( (*p) ) {
case 32: goto tr37;
case 34: goto st0;
case 35: goto tr38;
case 60: goto st0;
case 62: goto st0;
case 63: goto tr39;
case 127: goto st0;
}
if ( 0 <= (*p) && (*p) <= 31 )
goto st0;
goto st24;
tr39:
#line 69 "ext/puma_http11/http11_parser.rl"
{
parser->request_path(parser, PTR_TO(mark), LEN(mark,p));
}
goto st25;
st25:
if ( ++p == pe )
goto _test_eof25;
case 25:
#line 605 "ext/puma_http11/http11_parser.c"
switch( (*p) ) {
case 32: goto tr41;
case 34: goto st0;
case 35: goto tr42;
case 60: goto st0;
case 62: goto st0;
case 127: goto st0;
}
if ( 0 <= (*p) && (*p) <= 31 )
goto st0;
goto tr40;
tr40:
#line 60 "ext/puma_http11/http11_parser.rl"
{ MARK(query_start, p); }
goto st26;
st26:
if ( ++p == pe )
goto _test_eof26;
case 26:
#line 625 "ext/puma_http11/http11_parser.c"
switch( (*p) ) {
case 32: goto tr44;
case 34: goto st0;
case 35: goto tr45;
case 60: goto st0;
case 62: goto st0;
case 127: goto st0;
}
if ( 0 <= (*p) && (*p) <= 31 )
goto st0;
goto st26;
st27:
if ( ++p == pe )
goto _test_eof27;
case 27:
switch( (*p) ) {
case 32: goto tr2;
case 36: goto st28;
case 95: goto st28;
}
if ( (*p) < 48 ) {
if ( 45 <= (*p) && (*p) <= 46 )
goto st28;
} else if ( (*p) > 57 ) {
if ( 65 <= (*p) && (*p) <= 90 )
goto st28;
} else
goto st28;
goto st0;
st28:
if ( ++p == pe )
goto _test_eof28;
case 28:
switch( (*p) ) {
case 32: goto tr2;
case 36: goto st29;
case 95: goto st29;
}
if ( (*p) < 48 ) {
if ( 45 <= (*p) && (*p) <= 46 )
goto st29;
} else if ( (*p) > 57 ) {
if ( 65 <= (*p) && (*p) <= 90 )
goto st29;
} else
goto st29;
goto st0;
st29:
if ( ++p == pe )
goto _test_eof29;
case 29:
switch( (*p) ) {
case 32: goto tr2;
case 36: goto st30;
case 95: goto st30;
}
if ( (*p) < 48 ) {
if ( 45 <= (*p) && (*p) <= 46 )
goto st30;
} else if ( (*p) > 57 ) {
if ( 65 <= (*p) && (*p) <= 90 )
goto st30;
} else
goto st30;
goto st0;
st30:
if ( ++p == pe )
goto _test_eof30;
case 30:
switch( (*p) ) {
case 32: goto tr2;
case 36: goto st31;
case 95: goto st31;
}
if ( (*p) < 48 ) {
if ( 45 <= (*p) && (*p) <= 46 )
goto st31;
} else if ( (*p) > 57 ) {
if ( 65 <= (*p) && (*p) <= 90 )
goto st31;
} else
goto st31;
goto st0;
st31:
if ( ++p == pe )
goto _test_eof31;
case 31:
switch( (*p) ) {
case 32: goto tr2;
case 36: goto st32;
case 95: goto st32;
}
if ( (*p) < 48 ) {
if ( 45 <= (*p) && (*p) <= 46 )
goto st32;
} else if ( (*p) > 57 ) {
if ( 65 <= (*p) && (*p) <= 90 )
goto st32;
} else
goto st32;
goto st0;
st32:
if ( ++p == pe )
goto _test_eof32;
case 32:
switch( (*p) ) {
case 32: goto tr2;
case 36: goto st33;
case 95: goto st33;
}
if ( (*p) < 48 ) {
if ( 45 <= (*p) && (*p) <= 46 )
goto st33;
} else if ( (*p) > 57 ) {
if ( 65 <= (*p) && (*p) <= 90 )
goto st33;
} else
goto st33;
goto st0;
st33:
if ( ++p == pe )
goto _test_eof33;
case 33:
switch( (*p) ) {
case 32: goto tr2;
case 36: goto st34;
case 95: goto st34;
}
if ( (*p) < 48 ) {
if ( 45 <= (*p) && (*p) <= 46 )
goto st34;
} else if ( (*p) > 57 ) {
if ( 65 <= (*p) && (*p) <= 90 )
goto st34;
} else
goto st34;
goto st0;
st34:
if ( ++p == pe )
goto _test_eof34;
case 34:
switch( (*p) ) {
case 32: goto tr2;
case 36: goto st35;
case 95: goto st35;
}
if ( (*p) < 48 ) {
if ( 45 <= (*p) && (*p) <= 46 )
goto st35;
} else if ( (*p) > 57 ) {
if ( 65 <= (*p) && (*p) <= 90 )
goto st35;
} else
goto st35;
goto st0;
st35:
if ( ++p == pe )
goto _test_eof35;
case 35:
switch( (*p) ) {
case 32: goto tr2;
case 36: goto st36;
case 95: goto st36;
}
if ( (*p) < 48 ) {
if ( 45 <= (*p) && (*p) <= 46 )
goto st36;
} else if ( (*p) > 57 ) {
if ( 65 <= (*p) && (*p) <= 90 )
goto st36;
} else
goto st36;
goto st0;
st36:
if ( ++p == pe )
goto _test_eof36;
case 36:
switch( (*p) ) {
case 32: goto tr2;
case 36: goto st37;
case 95: goto st37;
}
if ( (*p) < 48 ) {
if ( 45 <= (*p) && (*p) <= 46 )
goto st37;
} else if ( (*p) > 57 ) {
if ( 65 <= (*p) && (*p) <= 90 )
goto st37;
} else
goto st37;
goto st0;
st37:
if ( ++p == pe )
goto _test_eof37;
case 37:
switch( (*p) ) {
case 32: goto tr2;
case 36: goto st38;
case 95: goto st38;
}
if ( (*p) < 48 ) {
if ( 45 <= (*p) && (*p) <= 46 )
goto st38;
} else if ( (*p) > 57 ) {
if ( 65 <= (*p) && (*p) <= 90 )
goto st38;
} else
goto st38;
goto st0;
st38:
if ( ++p == pe )
goto _test_eof38;
case 38:
switch( (*p) ) {
case 32: goto tr2;
case 36: goto st39;
case 95: goto st39;
}
if ( (*p) < 48 ) {
if ( 45 <= (*p) && (*p) <= 46 )
goto st39;
} else if ( (*p) > 57 ) {
if ( 65 <= (*p) && (*p) <= 90 )
goto st39;
} else
goto st39;
goto st0;
st39:
if ( ++p == pe )
goto _test_eof39;
case 39:
switch( (*p) ) {
case 32: goto tr2;
case 36: goto st40;
case 95: goto st40;
}
if ( (*p) < 48 ) {
if ( 45 <= (*p) && (*p) <= 46 )
goto st40;
} else if ( (*p) > 57 ) {
if ( 65 <= (*p) && (*p) <= 90 )
goto st40;
} else
goto st40;
goto st0;
st40:
if ( ++p == pe )
goto _test_eof40;
case 40:
switch( (*p) ) {
case 32: goto tr2;
case 36: goto st41;
case 95: goto st41;
}
if ( (*p) < 48 ) {
if ( 45 <= (*p) && (*p) <= 46 )
goto st41;
} else if ( (*p) > 57 ) {
if ( 65 <= (*p) && (*p) <= 90 )
goto st41;
} else
goto st41;
goto st0;
st41:
if ( ++p == pe )
goto _test_eof41;
case 41:
switch( (*p) ) {
case 32: goto tr2;
case 36: goto st42;
case 95: goto st42;
}
if ( (*p) < 48 ) {
if ( 45 <= (*p) && (*p) <= 46 )
goto st42;
} else if ( (*p) > 57 ) {
if ( 65 <= (*p) && (*p) <= 90 )
goto st42;
} else
goto st42;
goto st0;
st42:
if ( ++p == pe )
goto _test_eof42;
case 42:
switch( (*p) ) {
case 32: goto tr2;
case 36: goto st43;
case 95: goto st43;
}
if ( (*p) < 48 ) {
if ( 45 <= (*p) && (*p) <= 46 )
goto st43;
} else if ( (*p) > 57 ) {
if ( 65 <= (*p) && (*p) <= 90 )
goto st43;
} else
goto st43;
goto st0;
st43:
if ( ++p == pe )
goto _test_eof43;
case 43:
switch( (*p) ) {
case 32: goto tr2;
case 36: goto st44;
case 95: goto st44;
}
if ( (*p) < 48 ) {
if ( 45 <= (*p) && (*p) <= 46 )
goto st44;
} else if ( (*p) > 57 ) {
if ( 65 <= (*p) && (*p) <= 90 )
goto st44;
} else
goto st44;
goto st0;
st44:
if ( ++p == pe )
goto _test_eof44;
case 44:
switch( (*p) ) {
case 32: goto tr2;
case 36: goto st45;
case 95: goto st45;
}
if ( (*p) < 48 ) {
if ( 45 <= (*p) && (*p) <= 46 )
goto st45;
} else if ( (*p) > 57 ) {
if ( 65 <= (*p) && (*p) <= 90 )
goto st45;
} else
goto st45;
goto st0;
st45:
if ( ++p == pe )
goto _test_eof45;
case 45:
if ( (*p) == 32 )
goto tr2;
goto st0;
}
_test_eof2: cs = 2; goto _test_eof;
_test_eof3: cs = 3; goto _test_eof;
_test_eof4: cs = 4; goto _test_eof;
_test_eof5: cs = 5; goto _test_eof;
_test_eof6: cs = 6; goto _test_eof;
_test_eof7: cs = 7; goto _test_eof;
_test_eof8: cs = 8; goto _test_eof;
_test_eof9: cs = 9; goto _test_eof;
_test_eof10: cs = 10; goto _test_eof;
_test_eof11: cs = 11; goto _test_eof;
_test_eof12: cs = 12; goto _test_eof;
_test_eof13: cs = 13; goto _test_eof;
_test_eof14: cs = 14; goto _test_eof;
_test_eof15: cs = 15; goto _test_eof;
_test_eof16: cs = 16; goto _test_eof;
_test_eof46: cs = 46; goto _test_eof;
_test_eof17: cs = 17; goto _test_eof;
_test_eof18: cs = 18; goto _test_eof;
_test_eof19: cs = 19; goto _test_eof;
_test_eof20: cs = 20; goto _test_eof;
_test_eof21: cs = 21; goto _test_eof;
_test_eof22: cs = 22; goto _test_eof;
_test_eof23: cs = 23; goto _test_eof;
_test_eof24: cs = 24; goto _test_eof;
_test_eof25: cs = 25; goto _test_eof;
_test_eof26: cs = 26; goto _test_eof;
_test_eof27: cs = 27; goto _test_eof;
_test_eof28: cs = 28; goto _test_eof;
_test_eof29: cs = 29; goto _test_eof;
_test_eof30: cs = 30; goto _test_eof;
_test_eof31: cs = 31; goto _test_eof;
_test_eof32: cs = 32; goto _test_eof;
_test_eof33: cs = 33; goto _test_eof;
_test_eof34: cs = 34; goto _test_eof;
_test_eof35: cs = 35; goto _test_eof;
_test_eof36: cs = 36; goto _test_eof;
_test_eof37: cs = 37; goto _test_eof;
_test_eof38: cs = 38; goto _test_eof;
_test_eof39: cs = 39; goto _test_eof;
_test_eof40: cs = 40; goto _test_eof;
_test_eof41: cs = 41; goto _test_eof;
_test_eof42: cs = 42; goto _test_eof;
_test_eof43: cs = 43; goto _test_eof;
_test_eof44: cs = 44; goto _test_eof;
_test_eof45: cs = 45; goto _test_eof;
_test_eof: {}
_out: {}
}
#line 117 "ext/puma_http11/http11_parser.rl"
if (!puma_parser_has_error(parser))
parser->cs = cs;
parser->nread += p - (buffer + off);
assert(p <= pe && "buffer overflow after parsing execute");
assert(parser->nread <= len && "nread longer than length");
assert(parser->body_start <= len && "body starts after buffer end");
assert(parser->mark < len && "mark is after buffer end");
assert(parser->field_len <= len && "field has length longer than whole buffer");
assert(parser->field_start < len && "field starts after buffer end");
return(parser->nread);
}
| 0
|
389,687
|
eval_option(
char_u **arg,
typval_T *rettv, // when NULL, only check if option exists
int evaluate)
{
char_u *option_end;
long numval;
char_u *stringval;
getoption_T opt_type;
int c;
int working = (**arg == '+'); // has("+option")
int ret = OK;
int scope;
// Isolate the option name and find its value.
option_end = find_option_end(arg, &scope);
if (option_end == NULL)
{
if (rettv != NULL)
semsg(_(e_option_name_missing_str), *arg);
return FAIL;
}
if (!evaluate)
{
*arg = option_end;
return OK;
}
c = *option_end;
*option_end = NUL;
opt_type = get_option_value(*arg, &numval,
rettv == NULL ? NULL : &stringval, NULL, scope);
if (opt_type == gov_unknown)
{
if (rettv != NULL)
semsg(_(e_unknown_option_str), *arg);
ret = FAIL;
}
else if (rettv != NULL)
{
rettv->v_lock = 0;
if (opt_type == gov_hidden_string)
{
rettv->v_type = VAR_STRING;
rettv->vval.v_string = NULL;
}
else if (opt_type == gov_hidden_bool || opt_type == gov_hidden_number)
{
rettv->v_type = in_vim9script() && opt_type == gov_hidden_bool
? VAR_BOOL : VAR_NUMBER;
rettv->vval.v_number = 0;
}
else if (opt_type == gov_bool || opt_type == gov_number)
{
if (in_vim9script() && opt_type == gov_bool)
{
rettv->v_type = VAR_BOOL;
rettv->vval.v_number = numval ? VVAL_TRUE : VVAL_FALSE;
}
else
{
rettv->v_type = VAR_NUMBER;
rettv->vval.v_number = numval;
}
}
else // string option
{
rettv->v_type = VAR_STRING;
rettv->vval.v_string = stringval;
}
}
else if (working && (opt_type == gov_hidden_bool
|| opt_type == gov_hidden_number
|| opt_type == gov_hidden_string))
ret = FAIL;
*option_end = c; // put back for error messages
*arg = option_end;
return ret;
}
| 0
|
208,522
|
dnsc_load_local_data(struct dnsc_env* dnscenv, struct config_file *cfg)
{
size_t i, j;
// Insert 'local-zone: "2.dnscrypt-cert.example.com" deny'
if(!cfg_str2list_insert(&cfg->local_zones,
strdup(dnscenv->provider_name),
strdup("deny"))) {
log_err("Could not load dnscrypt local-zone: %s deny",
dnscenv->provider_name);
return -1;
}
// Add local data entry of type:
// 2.dnscrypt-cert.example.com 86400 IN TXT "DNSC......"
for(i=0; i<dnscenv->signed_certs_count; i++) {
const char *ttl_class_type = " 86400 IN TXT \"";
int rotated_cert = 0;
uint32_t serial;
uint16_t rrlen;
char* rr;
struct SignedCert *cert = dnscenv->signed_certs + i;
// Check if the certificate is being rotated and should not be published
for(j=0; j<dnscenv->rotated_certs_count; j++){
if(cert == dnscenv->rotated_certs[j]) {
rotated_cert = 1;
break;
}
}
memcpy(&serial, cert->serial, sizeof serial);
serial = htonl(serial);
if(rotated_cert) {
verbose(VERB_OPS,
"DNSCrypt: not adding cert with serial #%"
PRIu32
" to local-data as it is rotated",
serial
);
continue;
}
rrlen = strlen(dnscenv->provider_name) +
strlen(ttl_class_type) +
4 * sizeof(struct SignedCert) + // worst case scenario
1 + // trailing double quote
1;
rr = malloc(rrlen);
if(!rr) {
log_err("Could not allocate memory");
return -2;
}
snprintf(rr, rrlen - 1, "%s 86400 IN TXT \"", dnscenv->provider_name);
for(j=0; j<sizeof(struct SignedCert); j++) {
int c = (int)*((const uint8_t *) cert + j);
if (isprint(c) && c != '"' && c != '\\') {
snprintf(rr + strlen(rr), rrlen - 1 - strlen(rr), "%c", c);
} else {
snprintf(rr + strlen(rr), rrlen - 1 - strlen(rr), "\\%03d", c);
}
}
verbose(VERB_OPS,
"DNSCrypt: adding cert with serial #%"
PRIu32
" to local-data to config: %s",
serial, rr
);
snprintf(rr + strlen(rr), rrlen - 1 - strlen(rr), "\"");
cfg_strlist_insert(&cfg->local_data, strdup(rr));
free(rr);
}
return dnscenv->signed_certs_count;
}
| 1
|
197,305
|
PJ_DEF(pj_status_t) pjmedia_rtcp_fb_parse_rpsi(
const void *buf,
pj_size_t length,
pjmedia_rtcp_fb_rpsi *rpsi)
{
pjmedia_rtcp_common *hdr = (pjmedia_rtcp_common*) buf;
pj_uint8_t *p;
pj_uint8_t padlen;
pj_size_t rpsi_len;
PJ_ASSERT_RETURN(buf && rpsi, PJ_EINVAL);
PJ_ASSERT_RETURN(length >= sizeof(pjmedia_rtcp_common), PJ_ETOOSMALL);
/* RPSI uses pt==RTCP_PSFB and FMT==3 */
if (hdr->pt != RTCP_PSFB || hdr->count != 3)
return PJ_ENOTFOUND;
rpsi_len = (pj_ntohs((pj_uint16_t)hdr->length)-2) * 4;
if (length < rpsi_len + 12)
return PJ_ETOOSMALL;
p = (pj_uint8_t*)hdr + sizeof(*hdr);
padlen = *p++;
rpsi->pt = (*p++ & 0x7F);
rpsi->rpsi_bit_len = rpsi_len*8 - 16 - padlen;
pj_strset(&rpsi->rpsi, (char*)p, (rpsi->rpsi_bit_len + 7)/8);
return PJ_SUCCESS;
}
| 1
|
205,823
|
ipf_extract_frags_from_batch(struct ipf *ipf, struct dp_packet_batch *pb,
ovs_be16 dl_type, uint16_t zone, long long now,
uint32_t hash_basis)
{
const size_t pb_cnt = dp_packet_batch_size(pb);
int pb_idx; /* Index in a packet batch. */
struct dp_packet *pkt;
DP_PACKET_BATCH_REFILL_FOR_EACH (pb_idx, pb_cnt, pkt, pb) {
if (OVS_UNLIKELY((dl_type == htons(ETH_TYPE_IP) &&
ipf_is_valid_v4_frag(ipf, pkt))
||
(dl_type == htons(ETH_TYPE_IPV6) &&
ipf_is_valid_v6_frag(ipf, pkt)))) {
ovs_mutex_lock(&ipf->ipf_lock);
if (!ipf_handle_frag(ipf, pkt, dl_type, zone, now, hash_basis)) {
dp_packet_batch_refill(pb, pkt, pb_idx);
}
ovs_mutex_unlock(&ipf->ipf_lock);
} else {
dp_packet_batch_refill(pb, pkt, pb_idx);
}
}
}
| 1
|
218,983
|
Status ConstantFolding::MaterializeOutputValues(
NodeDef* node, const GraphProperties& properties) {
const std::vector<OpInfo::TensorProperties>& output =
properties.GetOutputProperties(node->name());
if (output.size() != 1 || !output[0].has_value() ||
!IsFoldable(*node, &properties)) {
return Status::OK();
}
// If this is a trivial Identity node with a constant input, just route the
// input around it.
if (IsIdentity(*node)) {
NodeDef* input = node_map_->GetNode(node->input(0));
if (IsReallyConstant(*input)) {
std::vector<int> inputs_to_forward;
std::iota(inputs_to_forward.begin(), inputs_to_forward.end(), 0);
graph_modified_ = ForwardInputs(node, inputs_to_forward);
return Status::OK();
}
}
// Repurpose the existing node to be the constant.
// Device placement is preserved.
TensorProto value_copy = output[0].value();
return ReplaceOperationWithConstantTensor(output[0].dtype(), &value_copy,
node, graph_);
}
| 0
|
369,257
|
static int io_issue_sqe(struct io_kiocb *req, unsigned int issue_flags)
{
const struct cred *creds = NULL;
int ret;
if (unlikely(!io_assign_file(req, issue_flags)))
return -EBADF;
if (unlikely((req->flags & REQ_F_CREDS) && req->creds != current_cred()))
creds = override_creds(req->creds);
if (!io_op_defs[req->opcode].audit_skip)
audit_uring_entry(req->opcode);
switch (req->opcode) {
case IORING_OP_NOP:
ret = io_nop(req, issue_flags);
break;
case IORING_OP_READV:
case IORING_OP_READ_FIXED:
case IORING_OP_READ:
ret = io_read(req, issue_flags);
break;
case IORING_OP_WRITEV:
case IORING_OP_WRITE_FIXED:
case IORING_OP_WRITE:
ret = io_write(req, issue_flags);
break;
case IORING_OP_FSYNC:
ret = io_fsync(req, issue_flags);
break;
case IORING_OP_POLL_ADD:
ret = io_poll_add(req, issue_flags);
break;
case IORING_OP_POLL_REMOVE:
ret = io_poll_update(req, issue_flags);
break;
case IORING_OP_SYNC_FILE_RANGE:
ret = io_sync_file_range(req, issue_flags);
break;
case IORING_OP_SENDMSG:
ret = io_sendmsg(req, issue_flags);
break;
case IORING_OP_SEND:
ret = io_send(req, issue_flags);
break;
case IORING_OP_RECVMSG:
ret = io_recvmsg(req, issue_flags);
break;
case IORING_OP_RECV:
ret = io_recv(req, issue_flags);
break;
case IORING_OP_TIMEOUT:
ret = io_timeout(req, issue_flags);
break;
case IORING_OP_TIMEOUT_REMOVE:
ret = io_timeout_remove(req, issue_flags);
break;
case IORING_OP_ACCEPT:
ret = io_accept(req, issue_flags);
break;
case IORING_OP_CONNECT:
ret = io_connect(req, issue_flags);
break;
case IORING_OP_ASYNC_CANCEL:
ret = io_async_cancel(req, issue_flags);
break;
case IORING_OP_FALLOCATE:
ret = io_fallocate(req, issue_flags);
break;
case IORING_OP_OPENAT:
ret = io_openat(req, issue_flags);
break;
case IORING_OP_CLOSE:
ret = io_close(req, issue_flags);
break;
case IORING_OP_FILES_UPDATE:
ret = io_files_update(req, issue_flags);
break;
case IORING_OP_STATX:
ret = io_statx(req, issue_flags);
break;
case IORING_OP_FADVISE:
ret = io_fadvise(req, issue_flags);
break;
case IORING_OP_MADVISE:
ret = io_madvise(req, issue_flags);
break;
case IORING_OP_OPENAT2:
ret = io_openat2(req, issue_flags);
break;
case IORING_OP_EPOLL_CTL:
ret = io_epoll_ctl(req, issue_flags);
break;
case IORING_OP_SPLICE:
ret = io_splice(req, issue_flags);
break;
case IORING_OP_PROVIDE_BUFFERS:
ret = io_provide_buffers(req, issue_flags);
break;
case IORING_OP_REMOVE_BUFFERS:
ret = io_remove_buffers(req, issue_flags);
break;
case IORING_OP_TEE:
ret = io_tee(req, issue_flags);
break;
case IORING_OP_SHUTDOWN:
ret = io_shutdown(req, issue_flags);
break;
case IORING_OP_RENAMEAT:
ret = io_renameat(req, issue_flags);
break;
case IORING_OP_UNLINKAT:
ret = io_unlinkat(req, issue_flags);
break;
case IORING_OP_MKDIRAT:
ret = io_mkdirat(req, issue_flags);
break;
case IORING_OP_SYMLINKAT:
ret = io_symlinkat(req, issue_flags);
break;
case IORING_OP_LINKAT:
ret = io_linkat(req, issue_flags);
break;
case IORING_OP_MSG_RING:
ret = io_msg_ring(req, issue_flags);
break;
default:
ret = -EINVAL;
break;
}
if (!io_op_defs[req->opcode].audit_skip)
audit_uring_exit(!ret, ret);
if (creds)
revert_creds(creds);
if (ret)
return ret;
/* If the op doesn't have a file, we're not polling for it */
if ((req->ctx->flags & IORING_SETUP_IOPOLL) && req->file)
io_iopoll_req_issued(req, issue_flags);
return 0;
| 0
|
210,203
|
static void *seq_buf_alloc(unsigned long size)
{
return kvmalloc(size, GFP_KERNEL_ACCOUNT);
}
| 1
|
508,334
|
void Locked_tables_list::mark_table_for_reopen(THD *thd, TABLE *table)
{
TABLE_SHARE *share= table->s;
for (TABLE_LIST *table_list= m_locked_tables;
table_list; table_list= table_list->next_global)
{
if (table_list->table->s == share)
table_list->table->internal_set_needs_reopen(true);
}
/* This is needed in the case where lock tables where not used */
table->internal_set_needs_reopen(true);
some_table_marked_for_reopen= 1;
}
| 0
|
400,107
|
UserTerminalRouter::UserTerminalRouter(
shared_ptr<PipeSocketHandler> _socketHandler,
const SocketEndpoint &_routerEndpoint)
: socketHandler(_socketHandler) {
serverFd = *(socketHandler->listen(_routerEndpoint).begin());
FATAL_FAIL(::chown(_routerEndpoint.name().c_str(), getuid(), getgid()));
FATAL_FAIL(::chmod(_routerEndpoint.name().c_str(),
S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IWGRP | S_IXGRP |
S_IROTH | S_IWOTH | S_IXOTH));
}
| 0
|
230,310
|
njs_array_prototype_iterator_obj(njs_vm_t *vm, njs_value_t *args,
njs_uint_t nargs, njs_index_t kind)
{
njs_int_t ret;
njs_value_t *this;
this = njs_argument(args, 0);
ret = njs_value_to_object(vm, this);
if (njs_slow_path(ret != NJS_OK)) {
return ret;
}
return njs_array_iterator_create(vm, this, &vm->retval, kind);
}
| 0
|
242,117
|
int LuaSettings::l_get_flags(lua_State *L)
{
NO_MAP_LOCK_REQUIRED;
LuaSettings *o = checkobject(L, 1);
std::string key = std::string(luaL_checkstring(L, 2));
u32 flags = 0;
auto flagdesc = o->m_settings->getFlagDescFallback(key);
if (o->m_settings->getFlagStrNoEx(key, flags, flagdesc)) {
lua_newtable(L);
int table = lua_gettop(L);
for (size_t i = 0; flagdesc[i].name; ++i) {
lua_pushboolean(L, flags & flagdesc[i].flag);
lua_setfield(L, table, flagdesc[i].name);
}
lua_pushvalue(L, table);
} else {
lua_pushnil(L);
}
return 1;
}
| 0
|
310,077
|
same_ti_tc(const char *ti, const char *tc, bool * embedded)
{
bool same = TRUE;
double ti_delay = 0.0;
double tc_delay = 0.0;
const char *ti_last;
*embedded = FALSE;
ti_last = parse_ti_delay(ti, &ti_delay);
tc = parse_tc_delay(tc, &tc_delay);
while ((ti < ti_last) && *tc) {
if (*ti == '\\' && ispunct(UChar(ti[1]))) {
++ti;
if ((*ti == '^') && !strncmp(tc, "\\136", 4)) {
ti += 1;
tc += 4;
continue;
}
} else if (ti[0] == '$' && ti[1] == '<') {
double no_delay;
const char *ss = parse_ti_delay(ti, &no_delay);
if (ss != ti) {
*embedded = TRUE;
ti = ss;
continue;
}
}
if (*tc == '\\' && ispunct(UChar(tc[1]))) {
++tc;
}
if (*ti++ != *tc++) {
same = FALSE;
break;
}
}
if (*embedded) {
if (same) {
same = FALSE;
} else {
*embedded = FALSE; /* report only one problem */
}
}
return same;
}
| 0
|
361,289
|
stl_load_edge_exact(stl_file *stl, stl_hash_edge *edge,
stl_vertex *a, stl_vertex *b) {
float diff_x;
float diff_y;
float diff_z;
float max_diff;
if (stl->error) return;
diff_x = ABS(a->x - b->x);
diff_y = ABS(a->y - b->y);
diff_z = ABS(a->z - b->z);
max_diff = STL_MAX(diff_x, diff_y);
max_diff = STL_MAX(diff_z, max_diff);
stl->stats.shortest_edge = STL_MIN(max_diff, stl->stats.shortest_edge);
if(diff_x == max_diff) {
if(a->x > b->x) {
memcpy(&edge->key[0], a, sizeof(stl_vertex));
memcpy(&edge->key[3], b, sizeof(stl_vertex));
} else {
memcpy(&edge->key[0], b, sizeof(stl_vertex));
memcpy(&edge->key[3], a, sizeof(stl_vertex));
edge->which_edge += 3; /* this edge is loaded backwards */
}
} else if(diff_y == max_diff) {
if(a->y > b->y) {
memcpy(&edge->key[0], a, sizeof(stl_vertex));
memcpy(&edge->key[3], b, sizeof(stl_vertex));
} else {
memcpy(&edge->key[0], b, sizeof(stl_vertex));
memcpy(&edge->key[3], a, sizeof(stl_vertex));
edge->which_edge += 3; /* this edge is loaded backwards */
}
} else {
if(a->z > b->z) {
memcpy(&edge->key[0], a, sizeof(stl_vertex));
memcpy(&edge->key[3], b, sizeof(stl_vertex));
} else {
memcpy(&edge->key[0], b, sizeof(stl_vertex));
memcpy(&edge->key[3], a, sizeof(stl_vertex));
edge->which_edge += 3; /* this edge is loaded backwards */
}
}
}
| 0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.