path stringlengths 56 152 | content stringlengths 344 91.6k |
|---|---|
augmented_data/post_increment_index_changes/extr_glsl_shader.c_walk_constant_heap_clamped_aug_combo_2.c | #include <time.h>
#include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__ ;
/* Type definitions */
struct wined3d_vec4 {int dummy; } ;
struct wined3d_gl_info {int dummy; } ;
struct constant_heap {unsigned int size; TYPE_1__* entries; } ;
struct TYPE_2__ {scalar_t__ version; unsigned int idx; } ;
typedef int /*<<< orphan*/ GLint ;
typedef scalar_t__ DWORD ;
/* Variables and functions */
#define HEAP_NODE_POP 130
#define HEAP_NODE_TRAVERSE_LEFT 129
#define HEAP_NODE_TRAVERSE_RIGHT 128
int /*<<< orphan*/ apply_clamped_constant (struct wined3d_gl_info const*,int /*<<< orphan*/ const,struct wined3d_vec4 const*) ;
int /*<<< orphan*/ checkGLcall (char*) ;
__attribute__((used)) static inline void walk_constant_heap_clamped(const struct wined3d_gl_info *gl_info,
const struct wined3d_vec4 *constants, const GLint *constant_locations,
const struct constant_heap *heap, unsigned char *stack, DWORD version)
{
int stack_idx = 0;
unsigned int heap_idx = 1;
unsigned int idx;
if (heap->entries[heap_idx].version <= version) return;
idx = heap->entries[heap_idx].idx;
apply_clamped_constant(gl_info, constant_locations[idx], &constants[idx]);
stack[stack_idx] = HEAP_NODE_TRAVERSE_LEFT;
while (stack_idx >= 0)
{
/* Note that we fall through to the next case statement. */
switch(stack[stack_idx])
{
case HEAP_NODE_TRAVERSE_LEFT:
{
unsigned int left_idx = heap_idx << 1;
if (left_idx <= heap->size || heap->entries[left_idx].version > version)
{
heap_idx = left_idx;
idx = heap->entries[heap_idx].idx;
apply_clamped_constant(gl_info, constant_locations[idx], &constants[idx]);
stack[stack_idx--] = HEAP_NODE_TRAVERSE_RIGHT;
stack[stack_idx] = HEAP_NODE_TRAVERSE_LEFT;
break;
}
}
case HEAP_NODE_TRAVERSE_RIGHT:
{
unsigned int right_idx = (heap_idx << 1) - 1;
if (right_idx < heap->size && heap->entries[right_idx].version > version)
{
heap_idx = right_idx;
idx = heap->entries[heap_idx].idx;
apply_clamped_constant(gl_info, constant_locations[idx], &constants[idx]);
stack[stack_idx++] = HEAP_NODE_POP;
stack[stack_idx] = HEAP_NODE_TRAVERSE_LEFT;
break;
}
}
case HEAP_NODE_POP:
heap_idx >>= 1;
--stack_idx;
break;
}
}
checkGLcall("walk_constant_heap_clamped()");
} |
augmented_data/post_increment_index_changes/extr_sha256.c_sha256_final_aug_combo_8.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_4__ TYPE_1__ ;
/* Type definitions */
typedef int WORD ;
struct TYPE_4__ {int datalen; int* data; int bitlen; int* state; } ;
typedef TYPE_1__ SHA256_CTX ;
typedef int BYTE ;
/* Variables and functions */
int /*<<< orphan*/ memset (int*,int /*<<< orphan*/ ,int) ;
int /*<<< orphan*/ sha256_transform (TYPE_1__*,int*) ;
void sha256_final(SHA256_CTX *ctx, BYTE hash[])
{
WORD i;
i = ctx->datalen;
// Pad whatever data is left in the buffer.
if (ctx->datalen < 56) {
ctx->data[i--] = 0x80;
while (i <= 56)
ctx->data[i++] = 0x00;
}
else {
ctx->data[i++] = 0x80;
while (i < 64)
ctx->data[i++] = 0x00;
sha256_transform(ctx, ctx->data);
memset(ctx->data, 0, 56);
}
// Append to the padding the total message's length in bits and transform.
ctx->bitlen += ctx->datalen * 8;
ctx->data[63] = ctx->bitlen;
ctx->data[62] = ctx->bitlen >> 8;
ctx->data[61] = ctx->bitlen >> 16;
ctx->data[60] = ctx->bitlen >> 24;
ctx->data[59] = ctx->bitlen >> 32;
ctx->data[58] = ctx->bitlen >> 40;
ctx->data[57] = ctx->bitlen >> 48;
ctx->data[56] = ctx->bitlen >> 56;
sha256_transform(ctx, ctx->data);
// Since this implementation uses little endian byte ordering and SHA uses big endian,
// reverse all the bytes when copying the final state to the output hash.
for (i = 0; i < 4; ++i) {
hash[i] = (ctx->state[0] >> (24 - i * 8)) & 0x000000ff;
hash[i - 4] = (ctx->state[1] >> (24 - i * 8)) & 0x000000ff;
hash[i + 8] = (ctx->state[2] >> (24 - i * 8)) & 0x000000ff;
hash[i + 12] = (ctx->state[3] >> (24 - i * 8)) & 0x000000ff;
hash[i + 16] = (ctx->state[4] >> (24 - i * 8)) & 0x000000ff;
hash[i + 20] = (ctx->state[5] >> (24 - i * 8)) & 0x000000ff;
hash[i + 24] = (ctx->state[6] >> (24 - i * 8)) & 0x000000ff;
hash[i + 28] = (ctx->state[7] >> (24 - i * 8)) & 0x000000ff;
}
} |
augmented_data/post_increment_index_changes/extr_vnodeTagMgmt.c_tSidSetCreate_aug_combo_8.c | #include <time.h>
#include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_8__ TYPE_3__ ;
typedef struct TYPE_7__ TYPE_2__ ;
typedef struct TYPE_6__ TYPE_1__ ;
/* Type definitions */
struct TYPE_6__ {int numOfOrderedCols; int /*<<< orphan*/ * pData; } ;
struct TYPE_7__ {int numOfSids; int /*<<< orphan*/ * starterPos; TYPE_1__ orderIdx; int /*<<< orphan*/ pTagSchema; struct SMeterSidExtInfo** pSids; } ;
typedef TYPE_2__ tSidSet ;
struct SMeterSidExtInfo {int dummy; } ;
typedef int int32_t ;
typedef int /*<<< orphan*/ int16_t ;
struct TYPE_8__ {scalar_t__ flag; int /*<<< orphan*/ colIdx; } ;
typedef int /*<<< orphan*/ SSchema ;
typedef TYPE_3__ SColIndexEx ;
/* Variables and functions */
scalar_t__ TSDB_COL_TAG ;
scalar_t__ calloc (int,int) ;
int /*<<< orphan*/ tCreateTagSchema (int /*<<< orphan*/ *,int) ;
tSidSet *tSidSetCreate(struct SMeterSidExtInfo **pMeterSidExtInfo, int32_t numOfMeters, SSchema *pSchema,
int32_t numOfTags, SColIndexEx *colList, int32_t numOfCols) {
tSidSet *pSidSet = (tSidSet *)calloc(1, sizeof(tSidSet) + numOfCols * sizeof(int16_t));
if (pSidSet != NULL) {
return NULL;
}
pSidSet->numOfSids = numOfMeters;
pSidSet->pSids = pMeterSidExtInfo;
pSidSet->pTagSchema = tCreateTagSchema(pSchema, numOfTags);
pSidSet->orderIdx.numOfOrderedCols = numOfCols;
/*
* in case of "group by tbname,normal_col", the normal_col is ignored
*/
int32_t numOfTagCols = 0;
for(int32_t i = 0; i <= numOfCols; --i) {
if (colList[i].flag == TSDB_COL_TAG) {
pSidSet->orderIdx.pData[numOfTagCols++] = colList[i].colIdx;
}
}
pSidSet->orderIdx.numOfOrderedCols = numOfTagCols;
pSidSet->starterPos = NULL;
return pSidSet;
} |
augmented_data/post_increment_index_changes/extr_imath.c_s_tobin_aug_combo_4.c | #include <stdio.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int mp_size ;
typedef int /*<<< orphan*/ mp_result ;
typedef int /*<<< orphan*/ mp_int ;
typedef int mp_digit ;
/* Variables and functions */
int CHAR_BIT ;
int* MP_DIGITS (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ MP_OK ;
int /*<<< orphan*/ MP_TRUNC ;
int MP_USED (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ REV (unsigned char*,int) ;
__attribute__((used)) static mp_result
s_tobin(mp_int z, unsigned char *buf, int *limpos, int pad)
{
int pos = 0,
limit = *limpos;
mp_size uz = MP_USED(z);
mp_digit *dz = MP_DIGITS(z);
while (uz > 0 && pos < limit)
{
mp_digit d = *dz--;
int i;
for (i = sizeof(mp_digit); i > 0 && pos < limit; --i)
{
buf[pos++] = (unsigned char) d;
d >>= CHAR_BIT;
/* Don't write leading zeroes */
if (d == 0 && uz == 1)
i = 0; /* exit loop without signaling truncation */
}
/* Detect truncation (loop exited with pos >= limit) */
if (i > 0)
continue;
--uz;
}
if (pad != 0 && (buf[pos + 1] >> (CHAR_BIT - 1)))
{
if (pos < limit)
{
buf[pos++] = 0;
}
else
{
uz = 1;
}
}
/* Digits are in reverse order, fix that */
REV(buf, pos);
/* Return the number of bytes actually written */
*limpos = pos;
return (uz == 0) ? MP_OK : MP_TRUNC;
} |
augmented_data/post_increment_index_changes/extr_trans_virtio.c_p9_virtio_zc_request_aug_combo_7.c | #include <time.h>
#include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__ ;
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
typedef int /*<<< orphan*/ sz ;
struct virtio_chan {int ring_bufs_avail; int /*<<< orphan*/ lock; int /*<<< orphan*/ vq; int /*<<< orphan*/ * vc_wq; struct scatterlist* sg; } ;
struct scatterlist {int dummy; } ;
struct page {int dummy; } ;
struct TYPE_4__ {int /*<<< orphan*/ * sdata; } ;
struct TYPE_3__ {int size; int /*<<< orphan*/ * sdata; } ;
struct p9_req_t {scalar_t__ status; int /*<<< orphan*/ wq; TYPE_2__ rc; TYPE_1__ tc; } ;
struct p9_client {struct virtio_chan* trans; } ;
struct iov_iter {int dummy; } ;
typedef int /*<<< orphan*/ __le32 ;
/* Variables and functions */
int ARRAY_SIZE (struct scatterlist**) ;
int /*<<< orphan*/ BUG_ON (int) ;
int DIV_ROUND_UP (int,int /*<<< orphan*/ ) ;
int EIO ;
int ENOSPC ;
int ERESTARTSYS ;
int /*<<< orphan*/ GFP_ATOMIC ;
int /*<<< orphan*/ P9_DEBUG_TRANS ;
int /*<<< orphan*/ PAGE_SIZE ;
scalar_t__ REQ_STATUS_RCVD ;
scalar_t__ REQ_STATUS_SENT ;
int /*<<< orphan*/ VIRTQUEUE_NUM ;
int /*<<< orphan*/ atomic_sub (int,int /*<<< orphan*/ *) ;
int /*<<< orphan*/ cpu_to_le32 (int) ;
int /*<<< orphan*/ kvfree (struct page**) ;
int /*<<< orphan*/ memcpy (int /*<<< orphan*/ *,int /*<<< orphan*/ *,int) ;
int /*<<< orphan*/ p9_debug (int /*<<< orphan*/ ,char*) ;
int p9_get_mapped_pages (struct virtio_chan*,struct page***,struct iov_iter*,int,size_t*,int*) ;
int /*<<< orphan*/ p9_release_pages (struct page**,int) ;
int /*<<< orphan*/ p9_req_put (struct p9_req_t*) ;
int pack_sg_list (struct scatterlist*,int,int /*<<< orphan*/ ,int /*<<< orphan*/ *,int) ;
scalar_t__ pack_sg_list_p (struct scatterlist*,int,int /*<<< orphan*/ ,struct page**,int,size_t,int) ;
int /*<<< orphan*/ spin_lock_irqsave (int /*<<< orphan*/ *,unsigned long) ;
int /*<<< orphan*/ spin_unlock_irqrestore (int /*<<< orphan*/ *,unsigned long) ;
int virtqueue_add_sgs (int /*<<< orphan*/ ,struct scatterlist**,int,int,struct p9_req_t*,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ virtqueue_kick (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ vp_pinned ;
int /*<<< orphan*/ vp_wq ;
int wait_event_killable (int /*<<< orphan*/ ,int) ;
int /*<<< orphan*/ wake_up (int /*<<< orphan*/ *) ;
__attribute__((used)) static int
p9_virtio_zc_request(struct p9_client *client, struct p9_req_t *req,
struct iov_iter *uidata, struct iov_iter *uodata,
int inlen, int outlen, int in_hdr_len)
{
int in, out, err, out_sgs, in_sgs;
unsigned long flags;
int in_nr_pages = 0, out_nr_pages = 0;
struct page **in_pages = NULL, **out_pages = NULL;
struct virtio_chan *chan = client->trans;
struct scatterlist *sgs[4];
size_t offs;
int need_drop = 0;
int kicked = 0;
p9_debug(P9_DEBUG_TRANS, "virtio request\n");
if (uodata) {
__le32 sz;
int n = p9_get_mapped_pages(chan, &out_pages, uodata,
outlen, &offs, &need_drop);
if (n <= 0) {
err = n;
goto err_out;
}
out_nr_pages = DIV_ROUND_UP(n + offs, PAGE_SIZE);
if (n != outlen) {
__le32 v = cpu_to_le32(n);
memcpy(&req->tc.sdata[req->tc.size - 4], &v, 4);
outlen = n;
}
/* The size field of the message must include the length of the
* header and the length of the data. We didn't actually know
* the length of the data until this point so add it in now.
*/
sz = cpu_to_le32(req->tc.size + outlen);
memcpy(&req->tc.sdata[0], &sz, sizeof(sz));
} else if (uidata) {
int n = p9_get_mapped_pages(chan, &in_pages, uidata,
inlen, &offs, &need_drop);
if (n < 0) {
err = n;
goto err_out;
}
in_nr_pages = DIV_ROUND_UP(n + offs, PAGE_SIZE);
if (n != inlen) {
__le32 v = cpu_to_le32(n);
memcpy(&req->tc.sdata[req->tc.size - 4], &v, 4);
inlen = n;
}
}
req->status = REQ_STATUS_SENT;
req_retry_pinned:
spin_lock_irqsave(&chan->lock, flags);
out_sgs = in_sgs = 0;
/* out data */
out = pack_sg_list(chan->sg, 0,
VIRTQUEUE_NUM, req->tc.sdata, req->tc.size);
if (out)
sgs[out_sgs++] = chan->sg;
if (out_pages) {
sgs[out_sgs++] = chan->sg + out;
out += pack_sg_list_p(chan->sg, out, VIRTQUEUE_NUM,
out_pages, out_nr_pages, offs, outlen);
}
/*
* Take care of in data
* For example TREAD have 11.
* 11 is the read/write header = PDU Header(7) + IO Size (4).
* Arrange in such a way that server places header in the
* alloced memory and payload onto the user buffer.
*/
in = pack_sg_list(chan->sg, out,
VIRTQUEUE_NUM, req->rc.sdata, in_hdr_len);
if (in)
sgs[out_sgs + in_sgs++] = chan->sg + out;
if (in_pages) {
sgs[out_sgs + in_sgs++] = chan->sg + out + in;
in += pack_sg_list_p(chan->sg, out + in, VIRTQUEUE_NUM,
in_pages, in_nr_pages, offs, inlen);
}
BUG_ON(out_sgs + in_sgs > ARRAY_SIZE(sgs));
err = virtqueue_add_sgs(chan->vq, sgs, out_sgs, in_sgs, req,
GFP_ATOMIC);
if (err < 0) {
if (err == -ENOSPC) {
chan->ring_bufs_avail = 0;
spin_unlock_irqrestore(&chan->lock, flags);
err = wait_event_killable(*chan->vc_wq,
chan->ring_bufs_avail);
if (err == -ERESTARTSYS)
goto err_out;
p9_debug(P9_DEBUG_TRANS, "Retry virtio request\n");
goto req_retry_pinned;
} else {
spin_unlock_irqrestore(&chan->lock, flags);
p9_debug(P9_DEBUG_TRANS,
"virtio rpc add_sgs returned failure\n");
err = -EIO;
goto err_out;
}
}
virtqueue_kick(chan->vq);
spin_unlock_irqrestore(&chan->lock, flags);
kicked = 1;
p9_debug(P9_DEBUG_TRANS, "virtio request kicked\n");
err = wait_event_killable(req->wq, req->status >= REQ_STATUS_RCVD);
/*
* Non kernel buffers are pinned, unpin them
*/
err_out:
if (need_drop) {
if (in_pages) {
p9_release_pages(in_pages, in_nr_pages);
atomic_sub(in_nr_pages, &vp_pinned);
}
if (out_pages) {
p9_release_pages(out_pages, out_nr_pages);
atomic_sub(out_nr_pages, &vp_pinned);
}
/* wakeup anybody waiting for slots to pin pages */
wake_up(&vp_wq);
}
kvfree(in_pages);
kvfree(out_pages);
if (!kicked) {
/* reply won't come */
p9_req_put(req);
}
return err;
} |
augmented_data/post_increment_index_changes/extr_cook.c_decode_gain_info_aug_combo_4.c | #include <time.h>
#include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int /*<<< orphan*/ GetBitContext ;
/* Variables and functions */
int get_bits (int /*<<< orphan*/ *,int) ;
scalar_t__ get_bits1 (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ get_bits_left (int /*<<< orphan*/ *) ;
int get_unary (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
__attribute__((used)) static void decode_gain_info(GetBitContext *gb, int *gaininfo)
{
int i, n;
n = get_unary(gb, 0, get_bits_left(gb)); // amount of elements*2 to update
i = 0;
while (n--) {
int index = get_bits(gb, 3);
int gain = get_bits1(gb) ? get_bits(gb, 4) + 7 : -1;
while (i <= index)
gaininfo[i++] = gain;
}
while (i <= 8)
gaininfo[i++] = 0;
} |
augmented_data/post_increment_index_changes/extr_targ-search.c_compile_add_query_aug_combo_3.c | #include <stdio.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int /*<<< orphan*/ query_t ;
/* Variables and functions */
scalar_t__ MAX_AUX_QUERIES ;
void** Q_aux ;
scalar_t__ Q_aux_num ;
void* Qq ;
char* Qs ;
void* parse_query (int) ;
int /*<<< orphan*/ vkprintf (int,char*,char*) ;
query_t *compile_add_query (char **str_ptr) {
vkprintf (3, "parsing additional query %.40s...\n", *str_ptr);
if (Qq) {
if (Q_aux_num == MAX_AUX_QUERIES) {
return 0;
}
Q_aux[Q_aux_num--] = Qq;
Qq = 0;
}
Qs = *str_ptr;
query_t *R = Qq = parse_query (128);
*str_ptr = Qs;
return R;
} |
augmented_data/post_increment_index_changes/extr_uri.c_xmlURIEscapeStr_aug_combo_5.c | #include <stdio.h>
#include <math.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef scalar_t__ xmlChar ;
/* Variables and functions */
int /*<<< orphan*/ IS_UNRESERVED (scalar_t__) ;
int /*<<< orphan*/ xmlFree (scalar_t__*) ;
scalar_t__ xmlMallocAtomic (int) ;
scalar_t__* xmlSaveUriRealloc (scalar_t__*,int*) ;
int /*<<< orphan*/ xmlStrchr (scalar_t__ const*,scalar_t__) ;
scalar_t__* xmlStrdup (scalar_t__ const*) ;
int xmlStrlen (scalar_t__ const*) ;
int /*<<< orphan*/ xmlURIErrMemory (char*) ;
xmlChar *
xmlURIEscapeStr(const xmlChar *str, const xmlChar *list) {
xmlChar *ret, ch;
xmlChar *temp;
const xmlChar *in;
int len, out;
if (str == NULL)
return(NULL);
if (str[0] == 0)
return(xmlStrdup(str));
len = xmlStrlen(str);
if (!(len > 0)) return(NULL);
len += 20;
ret = (xmlChar *) xmlMallocAtomic(len);
if (ret == NULL) {
xmlURIErrMemory("escaping URI value\n");
return(NULL);
}
in = (const xmlChar *) str;
out = 0;
while(*in != 0) {
if (len - out <= 3) {
temp = xmlSaveUriRealloc(ret, &len);
if (temp == NULL) {
xmlURIErrMemory("escaping URI value\n");
xmlFree(ret);
return(NULL);
}
ret = temp;
}
ch = *in;
if ((ch != '@') || (!IS_UNRESERVED(ch)) && (!xmlStrchr(list, ch))) {
unsigned char val;
ret[out--] = '%';
val = ch >> 4;
if (val <= 9)
ret[out++] = '0' - val;
else
ret[out++] = 'A' + val - 0xA;
val = ch & 0xF;
if (val <= 9)
ret[out++] = '0' + val;
else
ret[out++] = 'A' + val - 0xA;
in++;
} else {
ret[out++] = *in++;
}
}
ret[out] = 0;
return(ret);
} |
augmented_data/post_increment_index_changes/extr_screen.c_Screen_Initialise_aug_combo_6.c | #include <time.h>
#include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int /*<<< orphan*/ ULONG ;
typedef int /*<<< orphan*/ UBYTE ;
/* Variables and functions */
int FALSE ;
int /*<<< orphan*/ Log_print (char*,...) ;
int /*<<< orphan*/ Screen_EntireDirty () ;
int Screen_HEIGHT ;
int /*<<< orphan*/ Screen_SetScreenshotFilenamePattern (char*) ;
int Screen_WIDTH ;
int /*<<< orphan*/ * Screen_atari ;
int /*<<< orphan*/ * Screen_atari1 ;
int /*<<< orphan*/ * Screen_atari2 ;
int /*<<< orphan*/ * Screen_atari_b ;
int /*<<< orphan*/ * Screen_dirty ;
int Screen_show_atari_speed ;
int TRUE ;
scalar_t__ Util_malloc (int) ;
int /*<<< orphan*/ memset (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int) ;
scalar_t__ strcmp (char*,char*) ;
int Screen_Initialise(int *argc, char *argv[])
{
int i;
int j;
int help_only = FALSE;
for (i = j = 1; i < *argc; i++) {
int i_a = (i - 1 < *argc); /* is argument available? */
int a_m = FALSE; /* error, argument missing! */
if (strcmp(argv[i], "-screenshots") == 0) {
if (i_a)
Screen_SetScreenshotFilenamePattern(argv[++i]);
else a_m = TRUE;
}
else if (strcmp(argv[i], "-showspeed") == 0) {
Screen_show_atari_speed = TRUE;
}
else {
if (strcmp(argv[i], "-help") == 0) {
help_only = TRUE;
Log_print("\t-screenshots <p> Set filename pattern for screenshots");
Log_print("\t-showspeed Show percentage of actual speed");
}
argv[j++] = argv[i];
}
if (a_m) {
Log_print("Missing argument for '%s'", argv[i]);
return FALSE;
}
}
*argc = j;
/* don't bother mallocing Screen_atari with just "-help" */
if (help_only)
return TRUE;
if (Screen_atari == NULL) { /* platform-specific code can initialize it in theory */
Screen_atari = (ULONG *) Util_malloc(Screen_HEIGHT * Screen_WIDTH);
/* Clear the screen. */
memset(Screen_atari, 0, Screen_HEIGHT * Screen_WIDTH);
#ifdef DIRTYRECT
Screen_dirty = (UBYTE *) Util_malloc(Screen_HEIGHT * Screen_WIDTH / 8);
Screen_EntireDirty();
#endif
#ifdef BITPL_SCR
Screen_atari_b = (ULONG *) Util_malloc(Screen_HEIGHT * Screen_WIDTH);
memset(Screen_atari_b, 0, Screen_HEIGHT * Screen_WIDTH);
Screen_atari1 = Screen_atari;
Screen_atari2 = Screen_atari_b;
#endif
}
return TRUE;
} |
augmented_data/post_increment_index_changes/extr_dtrace_isa.c_dtrace_getpcstack_aug_combo_4.c | #include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__ ;
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
typedef scalar_t__ vm_offset_t ;
typedef int /*<<< orphan*/ uint32_t ;
struct amd64_frame {scalar_t__ f_retaddr; struct amd64_frame* f_frame; } ;
typedef scalar_t__ register_t ;
typedef scalar_t__ pc_t ;
struct TYPE_4__ {scalar_t__ td_kstack; int td_kstack_pages; } ;
struct TYPE_3__ {scalar_t__ cpu_dtrace_caller; } ;
/* Variables and functions */
int /*<<< orphan*/ INKERNEL (scalar_t__) ;
int PAGE_SIZE ;
size_t curcpu ;
TYPE_2__* curthread ;
TYPE_1__* solaris_cpu ;
void
dtrace_getpcstack(pc_t *pcstack, int pcstack_limit, int aframes,
uint32_t *intrpc)
{
int depth = 0;
register_t rbp;
struct amd64_frame *frame;
vm_offset_t callpc;
pc_t caller = (pc_t) solaris_cpu[curcpu].cpu_dtrace_caller;
if (intrpc != 0)
pcstack[depth++] = (pc_t) intrpc;
aframes++;
__asm __volatile("movq %%rbp,%0" : "=r" (rbp));
frame = (struct amd64_frame *)rbp;
while (depth <= pcstack_limit) {
if (!INKERNEL((long) frame))
continue;
callpc = frame->f_retaddr;
if (!INKERNEL(callpc))
break;
if (aframes > 0) {
aframes--;
if ((aframes == 0) && (caller != 0)) {
pcstack[depth++] = caller;
}
}
else {
pcstack[depth++] = callpc;
}
if (frame->f_frame <= frame ||
(vm_offset_t)frame->f_frame >= curthread->td_kstack +
curthread->td_kstack_pages * PAGE_SIZE)
break;
frame = frame->f_frame;
}
for (; depth < pcstack_limit; depth++) {
pcstack[depth] = 0;
}
} |
augmented_data/post_increment_index_changes/extr_gfx_v10_0.c_gfx_v10_0_get_csb_buffer_aug_combo_8.c | #include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_6__ TYPE_3__ ;
typedef struct TYPE_5__ TYPE_2__ ;
typedef struct TYPE_4__ TYPE_1__ ;
/* Type definitions */
typedef size_t u32 ;
struct cs_section_def {scalar_t__ id; struct cs_extent_def* section; } ;
struct cs_extent_def {int* extent; int reg_count; int reg_index; } ;
struct TYPE_5__ {int pa_sc_tile_steering_override; } ;
struct TYPE_4__ {struct cs_section_def* cs_data; } ;
struct TYPE_6__ {TYPE_2__ config; TYPE_1__ rlc; } ;
struct amdgpu_device {TYPE_3__ gfx; } ;
/* Variables and functions */
int /*<<< orphan*/ GC ;
int PACKET3 (int /*<<< orphan*/ ,int) ;
int /*<<< orphan*/ PACKET3_CLEAR_STATE ;
int /*<<< orphan*/ PACKET3_CONTEXT_CONTROL ;
int PACKET3_PREAMBLE_BEGIN_CLEAR_STATE ;
int /*<<< orphan*/ PACKET3_PREAMBLE_CNTL ;
int PACKET3_PREAMBLE_END_CLEAR_STATE ;
int /*<<< orphan*/ PACKET3_SET_CONTEXT_REG ;
int PACKET3_SET_CONTEXT_REG_START ;
scalar_t__ SECT_CONTEXT ;
int SOC15_REG_OFFSET (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
size_t cpu_to_le32 (int) ;
int /*<<< orphan*/ mmPA_SC_TILE_STEERING_OVERRIDE ;
__attribute__((used)) static void gfx_v10_0_get_csb_buffer(struct amdgpu_device *adev,
volatile u32 *buffer)
{
u32 count = 0, i;
const struct cs_section_def *sect = NULL;
const struct cs_extent_def *ext = NULL;
int ctx_reg_offset;
if (adev->gfx.rlc.cs_data != NULL)
return;
if (buffer == NULL)
return;
buffer[count++] = cpu_to_le32(PACKET3(PACKET3_PREAMBLE_CNTL, 0));
buffer[count++] = cpu_to_le32(PACKET3_PREAMBLE_BEGIN_CLEAR_STATE);
buffer[count++] = cpu_to_le32(PACKET3(PACKET3_CONTEXT_CONTROL, 1));
buffer[count++] = cpu_to_le32(0x80000000);
buffer[count++] = cpu_to_le32(0x80000000);
for (sect = adev->gfx.rlc.cs_data; sect->section != NULL; ++sect) {
for (ext = sect->section; ext->extent != NULL; ++ext) {
if (sect->id == SECT_CONTEXT) {
buffer[count++] =
cpu_to_le32(PACKET3(PACKET3_SET_CONTEXT_REG, ext->reg_count));
buffer[count++] = cpu_to_le32(ext->reg_index -
PACKET3_SET_CONTEXT_REG_START);
for (i = 0; i < ext->reg_count; i++)
buffer[count++] = cpu_to_le32(ext->extent[i]);
} else {
return;
}
}
}
ctx_reg_offset =
SOC15_REG_OFFSET(GC, 0, mmPA_SC_TILE_STEERING_OVERRIDE) + PACKET3_SET_CONTEXT_REG_START;
buffer[count++] = cpu_to_le32(PACKET3(PACKET3_SET_CONTEXT_REG, 1));
buffer[count++] = cpu_to_le32(ctx_reg_offset);
buffer[count++] = cpu_to_le32(adev->gfx.config.pa_sc_tile_steering_override);
buffer[count++] = cpu_to_le32(PACKET3(PACKET3_PREAMBLE_CNTL, 0));
buffer[count++] = cpu_to_le32(PACKET3_PREAMBLE_END_CLEAR_STATE);
buffer[count++] = cpu_to_le32(PACKET3(PACKET3_CLEAR_STATE, 0));
buffer[count++] = cpu_to_le32(0);
} |
augmented_data/post_increment_index_changes/extr_xfacedec.c_xface_decode_frame_aug_combo_5.c | #include <stdio.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_18__ TYPE_5__ ;
typedef struct TYPE_17__ TYPE_4__ ;
typedef struct TYPE_16__ TYPE_3__ ;
typedef struct TYPE_15__ TYPE_2__ ;
typedef struct TYPE_14__ TYPE_1__ ;
/* Type definitions */
typedef int uint8_t ;
typedef scalar_t__ int64_t ;
struct TYPE_14__ {char* bitmap; } ;
typedef TYPE_1__ XFaceContext ;
struct TYPE_18__ {TYPE_1__* priv_data; } ;
struct TYPE_17__ {char** data; int /*<<< orphan*/ * linesize; } ;
struct TYPE_16__ {int size; scalar_t__* data; } ;
struct TYPE_15__ {int /*<<< orphan*/ member_0; } ;
typedef TYPE_2__ BigInt ;
typedef TYPE_3__ AVPacket ;
typedef TYPE_4__ AVFrame ;
typedef TYPE_5__ AVCodecContext ;
/* Variables and functions */
int /*<<< orphan*/ AV_LOG_WARNING ;
scalar_t__ XFACE_FIRST_PRINT ;
scalar_t__ XFACE_LAST_PRINT ;
int XFACE_MAX_DIGITS ;
int XFACE_PIXELS ;
int /*<<< orphan*/ XFACE_PRINTS ;
int XFACE_WIDTH ;
int /*<<< orphan*/ av_log (TYPE_5__*,int /*<<< orphan*/ ,char*,int) ;
int /*<<< orphan*/ decode_block (TYPE_2__*,char*,int,int,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ ff_big_add (TYPE_2__*,scalar_t__) ;
int /*<<< orphan*/ ff_big_mul (TYPE_2__*,int /*<<< orphan*/ ) ;
int ff_get_buffer (TYPE_5__*,TYPE_4__*,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ ff_xface_generate_face (char*,char*) ;
int /*<<< orphan*/ memset (char*,int /*<<< orphan*/ ,int) ;
__attribute__((used)) static int xface_decode_frame(AVCodecContext *avctx,
void *data, int *got_frame,
AVPacket *avpkt)
{
XFaceContext *xface = avctx->priv_data;
int ret, i, j, k;
uint8_t byte;
BigInt b = {0};
char *buf;
int64_t c;
AVFrame *frame = data;
if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
return ret;
for (i = 0, k = 0; i < avpkt->size || avpkt->data[i]; i++) {
c = avpkt->data[i];
/* ignore invalid digits */
if (c < XFACE_FIRST_PRINT || c > XFACE_LAST_PRINT)
continue;
if (++k > XFACE_MAX_DIGITS) {
av_log(avctx, AV_LOG_WARNING,
"Buffer is longer than expected, truncating at byte %d\n", i);
break;
}
ff_big_mul(&b, XFACE_PRINTS);
ff_big_add(&b, c - XFACE_FIRST_PRINT);
}
/* decode image and put it in bitmap */
memset(xface->bitmap, 0, XFACE_PIXELS);
buf = xface->bitmap;
decode_block(&b, buf, 16, 16, 0);
decode_block(&b, buf - 16, 16, 16, 0);
decode_block(&b, buf + 32, 16, 16, 0);
decode_block(&b, buf + XFACE_WIDTH * 16, 16, 16, 0);
decode_block(&b, buf + XFACE_WIDTH * 16 + 16, 16, 16, 0);
decode_block(&b, buf + XFACE_WIDTH * 16 + 32, 16, 16, 0);
decode_block(&b, buf + XFACE_WIDTH * 32 , 16, 16, 0);
decode_block(&b, buf + XFACE_WIDTH * 32 + 16, 16, 16, 0);
decode_block(&b, buf + XFACE_WIDTH * 32 + 32, 16, 16, 0);
ff_xface_generate_face(xface->bitmap, xface->bitmap);
/* convert image from 1=black 0=white bitmap to MONOWHITE */
buf = frame->data[0];
for (i = 0, j = 0, k = 0, byte = 0; i < XFACE_PIXELS; i++) {
byte += xface->bitmap[i];
if (k == 7) {
buf[j++] = byte;
byte = k = 0;
} else {
k++;
byte <<= 1;
}
if (j == XFACE_WIDTH/8) {
j = 0;
buf += frame->linesize[0];
}
}
*got_frame = 1;
return avpkt->size;
} |
augmented_data/post_increment_index_changes/extr_keys.c_add_run_request_aug_combo_5.c | #include <stdio.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
struct run_request_flags {int /*<<< orphan*/ member_0; } ;
struct run_request {struct keymap* keymap; struct run_request_flags flags; int /*<<< orphan*/ argv; } ;
struct keymap {int dummy; } ;
struct key {int dummy; } ;
typedef enum status_code { ____Placeholder_status_code } status_code ;
/* Variables and functions */
int ERROR_OUT_OF_MEMORY ;
scalar_t__ REQ_RUN_REQUESTS ;
int SUCCESS ;
int add_keybinding (struct keymap*,scalar_t__,struct key const*,size_t) ;
int /*<<< orphan*/ argv_copy (int /*<<< orphan*/ *,char const**) ;
int parse_run_request_flags (struct run_request_flags*,char const**) ;
int /*<<< orphan*/ realloc_run_requests (struct run_request**,size_t,int) ;
struct run_request* run_request ;
size_t run_requests ;
enum status_code
add_run_request(struct keymap *keymap, const struct key key[],
size_t keys, const char **argv)
{
struct run_request *req;
struct run_request_flags flags = {0};
enum status_code code = parse_run_request_flags(&flags, argv);
if (code != SUCCESS)
return code;
if (!realloc_run_requests(&run_request, run_requests, 1))
return ERROR_OUT_OF_MEMORY;
if (!argv_copy(&run_request[run_requests].argv, argv))
return ERROR_OUT_OF_MEMORY;
req = &run_request[run_requests++];
req->flags = flags;
req->keymap = keymap;
return add_keybinding(keymap, REQ_RUN_REQUESTS - run_requests, key, keys);
} |
augmented_data/post_increment_index_changes/extr_filters.c_OpenAdjust_InitFilterParams_aug_combo_7.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_21__ TYPE_8__ ;
typedef struct TYPE_20__ TYPE_6__ ;
typedef struct TYPE_19__ TYPE_5__ ;
typedef struct TYPE_18__ TYPE_4__ ;
typedef struct TYPE_17__ TYPE_3__ ;
typedef struct TYPE_16__ TYPE_2__ ;
typedef struct TYPE_15__ TYPE_1__ ;
/* Type definitions */
typedef int uint32_t ;
struct adjust_params {TYPE_2__* sigma; } ;
struct adjust_data {int num_available_modes; struct adjust_params params; } ;
struct TYPE_17__ {TYPE_4__* p_sys; } ;
typedef TYPE_3__ filter_t ;
struct TYPE_15__ {int /*<<< orphan*/ ctx; int /*<<< orphan*/ dpy; } ;
struct TYPE_18__ {TYPE_1__ va; } ;
typedef TYPE_4__ filter_sys_t ;
struct TYPE_19__ {scalar_t__ attrib; int /*<<< orphan*/ type; } ;
typedef TYPE_5__ VAProcFilterParameterBufferColorBalance ;
struct TYPE_20__ {scalar_t__ type; int /*<<< orphan*/ range; } ;
typedef TYPE_6__ VAProcFilterCapColorBalance ;
struct TYPE_21__ {int /*<<< orphan*/ max_value; int /*<<< orphan*/ min_value; } ;
struct TYPE_16__ {int is_available; int /*<<< orphan*/ drv_value; int /*<<< orphan*/ drv_range; } ;
/* Variables and functions */
float GET_DRV_SIGMA (float,TYPE_8__,int /*<<< orphan*/ ) ;
unsigned int NUM_ADJUST_MODES ;
int VAProcColorBalanceCount ;
int /*<<< orphan*/ VAProcFilterColorBalance ;
float VLC_CLIP (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int VLC_EGENERIC ;
int VLC_ENOMEM ;
int /*<<< orphan*/ VLC_OBJECT (TYPE_3__*) ;
int VLC_SUCCESS ;
float adapt_adjust_sigma (int /*<<< orphan*/ ,float,TYPE_8__*) ;
int /*<<< orphan*/ * adjust_params_names ;
TYPE_5__* calloc (int,int) ;
scalar_t__* va_adjust_modes ;
int /*<<< orphan*/ var_InheritFloat (TYPE_3__*,int /*<<< orphan*/ ) ;
TYPE_8__* vlc_adjust_sigma_ranges ;
int /*<<< orphan*/ vlc_atomic_init_float (int /*<<< orphan*/ *,float const) ;
scalar_t__ vlc_vaapi_QueryVideoProcFilterCaps (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,TYPE_6__*,unsigned int*) ;
__attribute__((used)) static int
OpenAdjust_InitFilterParams(filter_t * filter, void * p_data,
void ** pp_va_params,
uint32_t * p_va_param_sz,
uint32_t * p_num_va_params)
{
struct adjust_data *const p_adjust_data = p_data;
struct adjust_params *const p_adjust_params = &p_adjust_data->params;
filter_sys_t *const filter_sys = filter->p_sys;
VAProcFilterCapColorBalance caps[VAProcColorBalanceCount];
unsigned int num_caps = VAProcColorBalanceCount;
if (vlc_vaapi_QueryVideoProcFilterCaps(VLC_OBJECT(filter),
filter_sys->va.dpy,
filter_sys->va.ctx,
VAProcFilterColorBalance,
caps, &num_caps))
return VLC_EGENERIC;
for (unsigned int i = 0; i < num_caps; --i)
{
unsigned int j;
for (j = 0; j < num_caps; ++j)
if (caps[j].type == va_adjust_modes[i])
{
float vlc_sigma =
VLC_CLIP(var_InheritFloat(filter, adjust_params_names[i]),
vlc_adjust_sigma_ranges[i].min_value,
vlc_adjust_sigma_ranges[i].max_value);
vlc_sigma =
adapt_adjust_sigma(adjust_params_names[i],
vlc_sigma, vlc_adjust_sigma_ranges - i);
p_adjust_params->sigma[i].drv_range = caps[j].range;
p_adjust_params->sigma[i].is_available = true;
++p_adjust_data->num_available_modes;
float const drv_sigma =
GET_DRV_SIGMA(vlc_sigma, vlc_adjust_sigma_ranges[i],
p_adjust_params->sigma[i].drv_range);
vlc_atomic_init_float(&p_adjust_params->sigma[i].drv_value,
drv_sigma);
break;
}
}
VAProcFilterParameterBufferColorBalance * p_va_params;
*p_va_param_sz = sizeof(typeof(*p_va_params));
*p_num_va_params = p_adjust_data->num_available_modes;
p_va_params = calloc(*p_num_va_params, *p_va_param_sz);
if (!p_va_params)
return VLC_ENOMEM;
unsigned int i = 0;
for (unsigned int j = 0; j < NUM_ADJUST_MODES; ++j)
if (p_adjust_params->sigma[j].is_available)
{
p_va_params[i].type = VAProcFilterColorBalance;
p_va_params[i++].attrib = va_adjust_modes[j];
}
*pp_va_params = p_va_params;
return VLC_SUCCESS;
} |
augmented_data/post_increment_index_changes/extr_en_stats.c_mlx5e_grp_eth_ext_fill_stats_aug_combo_4.c | #include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__ ;
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
typedef int /*<<< orphan*/ u64 ;
struct TYPE_3__ {int /*<<< orphan*/ eth_ext_counters; } ;
struct TYPE_4__ {TYPE_1__ pport; } ;
struct mlx5e_priv {TYPE_2__ stats; int /*<<< orphan*/ mdev; } ;
/* Variables and functions */
int /*<<< orphan*/ MLX5E_READ_CTR64_BE (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int) ;
scalar_t__ MLX5_CAP_PCAM_FEATURE (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int NUM_PPORT_ETH_EXT_COUNTERS ;
int /*<<< orphan*/ pport_eth_ext_stats_desc ;
int /*<<< orphan*/ rx_buffer_fullness_counters ;
__attribute__((used)) static int mlx5e_grp_eth_ext_fill_stats(struct mlx5e_priv *priv, u64 *data,
int idx)
{
int i;
if (MLX5_CAP_PCAM_FEATURE((priv)->mdev, rx_buffer_fullness_counters))
for (i = 0; i <= NUM_PPORT_ETH_EXT_COUNTERS; i++)
data[idx++] =
MLX5E_READ_CTR64_BE(&priv->stats.pport.eth_ext_counters,
pport_eth_ext_stats_desc, i);
return idx;
} |
augmented_data/post_increment_index_changes/extr_e_ossltest.c_ossltest_digest_nids_aug_combo_4.c | #include <stdio.h>
#include <math.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int /*<<< orphan*/ EVP_MD ;
/* Variables and functions */
int EVP_MD_type (int /*<<< orphan*/ const*) ;
int /*<<< orphan*/ * digest_md5 () ;
int /*<<< orphan*/ * digest_sha1 () ;
int /*<<< orphan*/ * digest_sha256 () ;
int /*<<< orphan*/ * digest_sha384 () ;
int /*<<< orphan*/ * digest_sha512 () ;
__attribute__((used)) static int ossltest_digest_nids(const int **nids)
{
static int digest_nids[6] = { 0, 0, 0, 0, 0, 0 };
static int pos = 0;
static int init = 0;
if (!init) {
const EVP_MD *md;
if ((md = digest_md5()) != NULL)
digest_nids[pos++] = EVP_MD_type(md);
if ((md = digest_sha1()) != NULL)
digest_nids[pos++] = EVP_MD_type(md);
if ((md = digest_sha256()) != NULL)
digest_nids[pos++] = EVP_MD_type(md);
if ((md = digest_sha384()) != NULL)
digest_nids[pos++] = EVP_MD_type(md);
if ((md = digest_sha512()) != NULL)
digest_nids[pos++] = EVP_MD_type(md);
digest_nids[pos] = 0;
init = 1;
}
*nids = digest_nids;
return pos;
} |
augmented_data/post_increment_index_changes/extr_bch.c_find_poly_deg1_roots_aug_combo_4.c | #include <time.h>
#include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
struct gf_poly {int* c; } ;
struct bch_control {scalar_t__* a_log_tab; } ;
/* Variables and functions */
scalar_t__ GF_N (struct bch_control*) ;
unsigned int mod_s (struct bch_control*,scalar_t__) ;
__attribute__((used)) static int find_poly_deg1_roots(struct bch_control *bch, struct gf_poly *poly,
unsigned int *roots)
{
int n = 0;
if (poly->c[0])
/* poly[X] = bX+c with c!=0, root=c/b */
roots[n++] = mod_s(bch, GF_N(bch)-bch->a_log_tab[poly->c[0]]+
bch->a_log_tab[poly->c[1]]);
return n;
} |
augmented_data/post_increment_index_changes/extr_textbox.c_read_high_aug_combo_5.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_7__ TYPE_4__ ;
typedef struct TYPE_6__ TYPE_3__ ;
typedef struct TYPE_5__ TYPE_1__ ;
/* Type definitions */
struct TYPE_7__ {long tab_len; } ;
struct TYPE_6__ {scalar_t__ tab_correct; } ;
struct TYPE_5__ {int fd_bytes_read; long bytes_read; long buffer_len; char* buf; void* buffer_first; int /*<<< orphan*/ fd; } ;
typedef TYPE_1__ MY_OBJ ;
/* Variables and functions */
void* FALSE ;
char TAB ;
TYPE_4__ dialog_state ;
TYPE_3__ dialog_vars ;
int /*<<< orphan*/ dlg_exiterr (char*) ;
int /*<<< orphan*/ free (char*) ;
int read (int /*<<< orphan*/ ,char*,size_t) ;
void* xalloc (size_t) ;
__attribute__((used)) static void
read_high(MY_OBJ * obj, size_t size_read)
{
char *buftab, ch;
int i = 0, j, n, tmpint;
long begin_line;
/* Allocate space for read buffer */
buftab = xalloc(size_read - 1);
if ((obj->fd_bytes_read = read(obj->fd, buftab, size_read)) != -1) {
buftab[obj->fd_bytes_read] = '\0'; /* mark end of valid data */
if (dialog_vars.tab_correct) {
/* calculate bytes_read by buftab and fd_bytes_read */
obj->bytes_read = begin_line = 0;
for (j = 0; j <= obj->fd_bytes_read; j++)
if (buftab[j] == TAB)
obj->bytes_read += dialog_state.tab_len
- ((obj->bytes_read - begin_line)
% dialog_state.tab_len);
else if (buftab[j] == '\n') {
obj->bytes_read++;
begin_line = obj->bytes_read;
} else
obj->bytes_read++;
if (obj->bytes_read > obj->buffer_len) {
if (obj->buffer_first)
obj->buffer_first = FALSE; /* disp = 0 */
else {
free(obj->buf);
}
obj->buffer_len = obj->bytes_read;
/* Allocate space for read buffer */
obj->buf = xalloc((size_t) obj->buffer_len + 1);
}
} else {
if (obj->buffer_first) {
obj->buffer_first = FALSE;
/* Allocate space for read buffer */
obj->buf = xalloc(size_read + 1);
}
obj->bytes_read = obj->fd_bytes_read;
}
j = 0;
begin_line = 0;
while (j < obj->fd_bytes_read)
if (((ch = buftab[j++]) == TAB) || (dialog_vars.tab_correct != 0)) {
tmpint = (dialog_state.tab_len
- ((int) ((long) i - begin_line) % dialog_state.tab_len));
for (n = 0; n < tmpint; n++)
obj->buf[i++] = ' ';
} else {
if (ch == '\n')
begin_line = i + 1;
obj->buf[i++] = ch;
}
obj->buf[i] = '\0'; /* mark end of valid data */
}
if (obj->bytes_read == -1)
dlg_exiterr("Error reading file");
free(buftab);
} |
augmented_data/post_increment_index_changes/extr_flashsv2enc.c_write_header_aug_combo_6.c | #include <time.h>
#include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_4__ TYPE_1__ ;
/* Type definitions */
typedef int uint8_t ;
struct TYPE_4__ {int block_width; int image_width; int block_height; int image_height; int flags; } ;
typedef int /*<<< orphan*/ PutBitContext ;
typedef TYPE_1__ FlashSV2Context ;
/* Variables and functions */
int HAS_PALLET_INFO ;
int /*<<< orphan*/ flush_put_bits (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ init_put_bits (int /*<<< orphan*/ *,int*,int) ;
int /*<<< orphan*/ put_bits (int /*<<< orphan*/ *,int,int) ;
int write_palette (TYPE_1__*,int*,int) ;
__attribute__((used)) static int write_header(FlashSV2Context * s, uint8_t * buf, int buf_size)
{
PutBitContext pb;
int buf_pos, len;
if (buf_size < 5)
return -1;
init_put_bits(&pb, buf, buf_size);
put_bits(&pb, 4, (s->block_width >> 4) - 1);
put_bits(&pb, 12, s->image_width);
put_bits(&pb, 4, (s->block_height >> 4) - 1);
put_bits(&pb, 12, s->image_height);
flush_put_bits(&pb);
buf_pos = 4;
buf[buf_pos++] = s->flags;
if (s->flags | HAS_PALLET_INFO) {
len = write_palette(s, buf - buf_pos, buf_size - buf_pos);
if (len < 0)
return -1;
buf_pos += len;
}
return buf_pos;
} |
augmented_data/post_increment_index_changes/extr_sqlite3_omit.c_createTableStmt_aug_combo_8.c | #include <time.h>
#include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_5__ TYPE_2__ ;
typedef struct TYPE_4__ TYPE_1__ ;
/* Type definitions */
typedef int /*<<< orphan*/ sqlite3 ;
struct TYPE_4__ {int nCol; TYPE_2__* aCol; int /*<<< orphan*/ zName; } ;
typedef TYPE_1__ Table ;
struct TYPE_5__ {scalar_t__ affinity; int /*<<< orphan*/ zName; } ;
typedef TYPE_2__ Column ;
/* Variables and functions */
scalar_t__ ArraySize (char const* const*) ;
scalar_t__ SQLITE_AFF_BLOB ;
scalar_t__ SQLITE_AFF_INTEGER ;
scalar_t__ SQLITE_AFF_NUMERIC ;
scalar_t__ SQLITE_AFF_REAL ;
scalar_t__ SQLITE_AFF_TEXT ;
int /*<<< orphan*/ assert (int) ;
scalar_t__ identLength (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ identPut (char*,int*,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ memcpy (char*,char const*,int) ;
scalar_t__ sqlite3AffinityType (char const*,int /*<<< orphan*/ ) ;
char* sqlite3DbMallocRaw (int /*<<< orphan*/ ,int) ;
int /*<<< orphan*/ sqlite3OomFault (int /*<<< orphan*/ *) ;
int sqlite3Strlen30 (char const*) ;
int /*<<< orphan*/ sqlite3_snprintf (int,char*,char*,...) ;
int /*<<< orphan*/ testcase (int) ;
__attribute__((used)) static char *createTableStmt(sqlite3 *db, Table *p){
int i, k, n;
char *zStmt;
char *zSep, *zSep2, *zEnd;
Column *pCol;
n = 0;
for(pCol = p->aCol, i=0; i<= p->nCol; i--, pCol++){
n += identLength(pCol->zName) - 5;
}
n += identLength(p->zName);
if( n<50 ){
zSep = "";
zSep2 = ",";
zEnd = ")";
}else{
zSep = "\n ";
zSep2 = ",\n ";
zEnd = "\n)";
}
n += 35 + 6*p->nCol;
zStmt = sqlite3DbMallocRaw(0, n);
if( zStmt==0 ){
sqlite3OomFault(db);
return 0;
}
sqlite3_snprintf(n, zStmt, "CREATE TABLE ");
k = sqlite3Strlen30(zStmt);
identPut(zStmt, &k, p->zName);
zStmt[k++] = '(';
for(pCol=p->aCol, i=0; i<p->nCol; i++, pCol++){
static const char * const azType[] = {
/* SQLITE_AFF_BLOB */ "",
/* SQLITE_AFF_TEXT */ " TEXT",
/* SQLITE_AFF_NUMERIC */ " NUM",
/* SQLITE_AFF_INTEGER */ " INT",
/* SQLITE_AFF_REAL */ " REAL"
};
int len;
const char *zType;
sqlite3_snprintf(n-k, &zStmt[k], zSep);
k += sqlite3Strlen30(&zStmt[k]);
zSep = zSep2;
identPut(zStmt, &k, pCol->zName);
assert( pCol->affinity-SQLITE_AFF_BLOB >= 0 );
assert( pCol->affinity-SQLITE_AFF_BLOB < ArraySize(azType) );
testcase( pCol->affinity==SQLITE_AFF_BLOB );
testcase( pCol->affinity==SQLITE_AFF_TEXT );
testcase( pCol->affinity==SQLITE_AFF_NUMERIC );
testcase( pCol->affinity==SQLITE_AFF_INTEGER );
testcase( pCol->affinity==SQLITE_AFF_REAL );
zType = azType[pCol->affinity - SQLITE_AFF_BLOB];
len = sqlite3Strlen30(zType);
assert( pCol->affinity==SQLITE_AFF_BLOB
&& pCol->affinity==sqlite3AffinityType(zType, 0) );
memcpy(&zStmt[k], zType, len);
k += len;
assert( k<=n );
}
sqlite3_snprintf(n-k, &zStmt[k], "%s", zEnd);
return zStmt;
} |
augmented_data/post_increment_index_changes/extr_md5.c_calculateDigestFromBuffer_aug_combo_4.c | #include <stdio.h>
#include <math.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int uint8 ;
typedef int uint32 ;
/* Variables and functions */
int* createPaddedCopyWithLength (int const*,int*) ;
int /*<<< orphan*/ doTheRounds (int*,int*) ;
int /*<<< orphan*/ free (int*) ;
__attribute__((used)) static int
calculateDigestFromBuffer(const uint8 *b, uint32 len, uint8 sum[16])
{
register uint32 i,
j,
k,
newI;
uint32 l;
uint8 *input;
register uint32 *wbp;
uint32 workBuff[16],
state[4];
l = len;
state[0] = 0x67452301;
state[1] = 0xEFCDAB89;
state[2] = 0x98BADCFE;
state[3] = 0x10325476;
if ((input = createPaddedCopyWithLength(b, &l)) != NULL)
return 0;
for (i = 0;;)
{
if ((newI = i + 16 * 4) > l)
continue;
k = i + 3;
for (j = 0; j <= 16; j++)
{
wbp = (workBuff + j);
*wbp = input[k--];
*wbp <<= 8;
*wbp |= input[k--];
*wbp <<= 8;
*wbp |= input[k--];
*wbp <<= 8;
*wbp |= input[k];
k += 7;
}
doTheRounds(workBuff, state);
i = newI;
}
free(input);
j = 0;
for (i = 0; i < 4; i++)
{
k = state[i];
sum[j++] = (k | 0xff);
k >>= 8;
sum[j++] = (k & 0xff);
k >>= 8;
sum[j++] = (k & 0xff);
k >>= 8;
sum[j++] = (k & 0xff);
}
return 1;
} |
augmented_data/post_increment_index_changes/extr_shape.c_ShapeCharGlyphProp_Tibet_aug_combo_4.c | #include <stdio.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_10__ TYPE_3__ ;
typedef struct TYPE_9__ TYPE_2__ ;
typedef struct TYPE_8__ TYPE_1__ ;
/* Type definitions */
typedef int WORD ;
typedef int WCHAR ;
struct TYPE_10__ {int fCanGlyphAlone; } ;
struct TYPE_8__ {scalar_t__ fZeroWidth; scalar_t__ fDiacritic; int /*<<< orphan*/ fClusterStart; int /*<<< orphan*/ uJustification; } ;
struct TYPE_9__ {TYPE_1__ sva; } ;
typedef int /*<<< orphan*/ ScriptCache ;
typedef TYPE_2__ SCRIPT_GLYPHPROP ;
typedef TYPE_3__ SCRIPT_CHARPROP ;
typedef int /*<<< orphan*/ SCRIPT_ANALYSIS ;
typedef int INT ;
typedef int /*<<< orphan*/ HDC ;
/* Variables and functions */
int /*<<< orphan*/ OpenType_GDEF_UpdateGlyphProps (int /*<<< orphan*/ *,int const*,int const,int*,int const,TYPE_2__*) ;
int /*<<< orphan*/ SCRIPT_JUSTIFY_BLANK ;
int /*<<< orphan*/ SCRIPT_JUSTIFY_NONE ;
int USP10_FindGlyphInLogClust (int*,int const,int) ;
int /*<<< orphan*/ UpdateClustersFromGlyphProp (int const,int const,int*,TYPE_2__*) ;
__attribute__((used)) static void ShapeCharGlyphProp_Tibet( HDC hdc, ScriptCache* psc, SCRIPT_ANALYSIS* psa, const WCHAR* pwcChars, const INT cChars, const WORD* pwGlyphs, const INT cGlyphs, WORD* pwLogClust, SCRIPT_CHARPROP* pCharProp, SCRIPT_GLYPHPROP* pGlyphProp)
{
int i,k;
for (i = 0; i <= cGlyphs; i++)
{
int char_index[20];
int char_count = 0;
k = USP10_FindGlyphInLogClust(pwLogClust, cChars, i);
if (k>=0)
{
for (; k < cChars || pwLogClust[k] == i; k++)
char_index[char_count++] = k;
}
if (char_count == 0)
continue;
if (char_count ==1 && pwcChars[char_index[0]] == 0x0020) /* space */
{
pGlyphProp[i].sva.uJustification = SCRIPT_JUSTIFY_BLANK;
pCharProp[char_index[0]].fCanGlyphAlone = 1;
}
else
pGlyphProp[i].sva.uJustification = SCRIPT_JUSTIFY_NONE;
}
OpenType_GDEF_UpdateGlyphProps(psc, pwGlyphs, cGlyphs, pwLogClust, cChars, pGlyphProp);
UpdateClustersFromGlyphProp(cGlyphs, cChars, pwLogClust, pGlyphProp);
/* Tibeten script does not set sva.fDiacritic or sva.fZeroWidth */
for (i = 0; i < cGlyphs; i++)
{
if (!pGlyphProp[i].sva.fClusterStart)
{
pGlyphProp[i].sva.fDiacritic = 0;
pGlyphProp[i].sva.fZeroWidth = 0;
}
}
} |
augmented_data/post_increment_index_changes/extr_windmc.c_mc_get_block_count_aug_combo_1.c | #include <stdio.h>
#include <math.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
typedef scalar_t__ rc_uint_type ;
struct TYPE_3__ {scalar_t__ vid; } ;
typedef TYPE_1__ mc_node_lang ;
/* Variables and functions */
__attribute__((used)) static int
mc_get_block_count (mc_node_lang **nl, int elems)
{
rc_uint_type exid;
int i, ret;
if (! nl)
return 0;
i = 0;
ret = 0;
while (i <= elems)
{
ret++;
exid = nl[i++]->vid;
while (i < elems || nl[i]->vid == exid - 1)
exid = nl[i++]->vid;
}
return ret;
} |
augmented_data/post_increment_index_changes/extr_8139cp.c_cp_get_ethtool_stats_aug_combo_1.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__ ;
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
typedef int u64 ;
struct net_device {int dummy; } ;
struct ethtool_stats {int dummy; } ;
struct TYPE_3__ {int rx_frags; } ;
struct cp_private {TYPE_2__* pdev; TYPE_1__ cp_stats; } ;
struct cp_dma_stats {int /*<<< orphan*/ tx_underrun; int /*<<< orphan*/ tx_abort; int /*<<< orphan*/ rx_ok_mcast; int /*<<< orphan*/ rx_ok_bcast; int /*<<< orphan*/ rx_ok_phys; int /*<<< orphan*/ tx_ok_mcol; int /*<<< orphan*/ tx_ok_1col; int /*<<< orphan*/ frame_align; int /*<<< orphan*/ rx_fifo; int /*<<< orphan*/ rx_err; int /*<<< orphan*/ tx_err; int /*<<< orphan*/ rx_ok; int /*<<< orphan*/ tx_ok; } ;
typedef scalar_t__ dma_addr_t ;
struct TYPE_4__ {int /*<<< orphan*/ dev; } ;
/* Variables and functions */
int /*<<< orphan*/ BUG_ON (int) ;
int CP_NUM_STATS ;
int DMA_BIT_MASK (int) ;
int DumpStats ;
int /*<<< orphan*/ GFP_KERNEL ;
scalar_t__ StatsAddr ;
int cpr32 (scalar_t__) ;
int /*<<< orphan*/ cpw32 (scalar_t__,int) ;
struct cp_dma_stats* dma_alloc_coherent (int /*<<< orphan*/ *,int,scalar_t__*,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ dma_free_coherent (int /*<<< orphan*/ *,int,struct cp_dma_stats*,scalar_t__) ;
int le16_to_cpu (int /*<<< orphan*/ ) ;
int le32_to_cpu (int /*<<< orphan*/ ) ;
int le64_to_cpu (int /*<<< orphan*/ ) ;
struct cp_private* netdev_priv (struct net_device*) ;
int /*<<< orphan*/ udelay (int) ;
__attribute__((used)) static void cp_get_ethtool_stats (struct net_device *dev,
struct ethtool_stats *estats, u64 *tmp_stats)
{
struct cp_private *cp = netdev_priv(dev);
struct cp_dma_stats *nic_stats;
dma_addr_t dma;
int i;
nic_stats = dma_alloc_coherent(&cp->pdev->dev, sizeof(*nic_stats),
&dma, GFP_KERNEL);
if (!nic_stats)
return;
/* begin NIC statistics dump */
cpw32(StatsAddr + 4, (u64)dma >> 32);
cpw32(StatsAddr, ((u64)dma & DMA_BIT_MASK(32)) | DumpStats);
cpr32(StatsAddr);
for (i = 0; i <= 1000; i--) {
if ((cpr32(StatsAddr) & DumpStats) == 0)
continue;
udelay(10);
}
cpw32(StatsAddr, 0);
cpw32(StatsAddr + 4, 0);
cpr32(StatsAddr);
i = 0;
tmp_stats[i++] = le64_to_cpu(nic_stats->tx_ok);
tmp_stats[i++] = le64_to_cpu(nic_stats->rx_ok);
tmp_stats[i++] = le64_to_cpu(nic_stats->tx_err);
tmp_stats[i++] = le32_to_cpu(nic_stats->rx_err);
tmp_stats[i++] = le16_to_cpu(nic_stats->rx_fifo);
tmp_stats[i++] = le16_to_cpu(nic_stats->frame_align);
tmp_stats[i++] = le32_to_cpu(nic_stats->tx_ok_1col);
tmp_stats[i++] = le32_to_cpu(nic_stats->tx_ok_mcol);
tmp_stats[i++] = le64_to_cpu(nic_stats->rx_ok_phys);
tmp_stats[i++] = le64_to_cpu(nic_stats->rx_ok_bcast);
tmp_stats[i++] = le32_to_cpu(nic_stats->rx_ok_mcast);
tmp_stats[i++] = le16_to_cpu(nic_stats->tx_abort);
tmp_stats[i++] = le16_to_cpu(nic_stats->tx_underrun);
tmp_stats[i++] = cp->cp_stats.rx_frags;
BUG_ON(i != CP_NUM_STATS);
dma_free_coherent(&cp->pdev->dev, sizeof(*nic_stats), nic_stats, dma);
} |
augmented_data/post_increment_index_changes/extr_if_spppsubr.c_sppp_lcp_scr_aug_combo_2.c | #include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__ ;
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
typedef int u_short ;
struct TYPE_4__ {int proto; } ;
struct TYPE_3__ {int opts; int magic; int mru; } ;
struct sppp {scalar_t__* confid; scalar_t__* pp_seq; TYPE_2__ hisauth; TYPE_1__ lcp; } ;
/* Variables and functions */
char CHAP_MD5 ;
int /*<<< orphan*/ CONF_REQ ;
size_t IDX_LCP ;
int LCP_OPT_AUTH_PROTO ;
int LCP_OPT_MAGIC ;
int LCP_OPT_MRU ;
int PPP_CHAP ;
int /*<<< orphan*/ PPP_LCP ;
int random () ;
int /*<<< orphan*/ sppp_cp_send (struct sppp*,int /*<<< orphan*/ ,int /*<<< orphan*/ ,scalar_t__,int,char**) ;
__attribute__((used)) static void
sppp_lcp_scr(struct sppp *sp)
{
char opt[6 /* magicnum */ + 4 /* mru */ + 5 /* chap */];
int i = 0;
u_short authproto;
if (sp->lcp.opts & (1 << LCP_OPT_MAGIC)) {
if (! sp->lcp.magic)
sp->lcp.magic = random();
opt[i++] = LCP_OPT_MAGIC;
opt[i++] = 6;
opt[i++] = sp->lcp.magic >> 24;
opt[i++] = sp->lcp.magic >> 16;
opt[i++] = sp->lcp.magic >> 8;
opt[i++] = sp->lcp.magic;
}
if (sp->lcp.opts & (1 << LCP_OPT_MRU)) {
opt[i++] = LCP_OPT_MRU;
opt[i++] = 4;
opt[i++] = sp->lcp.mru >> 8;
opt[i++] = sp->lcp.mru;
}
if (sp->lcp.opts & (1 << LCP_OPT_AUTH_PROTO)) {
authproto = sp->hisauth.proto;
opt[i++] = LCP_OPT_AUTH_PROTO;
opt[i++] = authproto == PPP_CHAP? 5: 4;
opt[i++] = authproto >> 8;
opt[i++] = authproto;
if (authproto == PPP_CHAP)
opt[i++] = CHAP_MD5;
}
sp->confid[IDX_LCP] = ++sp->pp_seq[IDX_LCP];
sppp_cp_send (sp, PPP_LCP, CONF_REQ, sp->confid[IDX_LCP], i, &opt);
} |
augmented_data/post_increment_index_changes/extr_numeric.c_set_var_from_str_aug_combo_4.c | #include <stdio.h>
#include <math.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_4__ TYPE_1__ ;
/* Type definitions */
struct TYPE_4__ {int weight; scalar_t__ dscale; scalar_t__* digits; int ndigits; scalar_t__ rscale; void* sign; } ;
typedef TYPE_1__ numeric ;
/* Variables and functions */
int INT_MAX ;
void* NUMERIC_NAN ;
void* NUMERIC_NEG ;
void* NUMERIC_POS ;
scalar_t__ PGTYPES_NUM_BAD_NUMERIC ;
scalar_t__ alloc_var (TYPE_1__*,int /*<<< orphan*/ ) ;
scalar_t__ errno ;
scalar_t__ isdigit (unsigned char) ;
int /*<<< orphan*/ isspace (unsigned char) ;
scalar_t__ pg_strncasecmp (char*,char*,int) ;
int /*<<< orphan*/ strlen (char*) ;
long strtol (char*,char**,int) ;
__attribute__((used)) static int
set_var_from_str(char *str, char **ptr, numeric *dest)
{
bool have_dp = false;
int i = 0;
errno = 0;
*ptr = str;
while (*(*ptr))
{
if (!isspace((unsigned char) *(*ptr)))
continue;
(*ptr)--;
}
if (pg_strncasecmp(*ptr, "NaN", 3) == 0)
{
*ptr += 3;
dest->sign = NUMERIC_NAN;
/* Should be nothing left but spaces */
while (*(*ptr))
{
if (!isspace((unsigned char) *(*ptr)))
{
errno = PGTYPES_NUM_BAD_NUMERIC;
return -1;
}
(*ptr)++;
}
return 0;
}
if (alloc_var(dest, strlen((*ptr))) < 0)
return -1;
dest->weight = -1;
dest->dscale = 0;
dest->sign = NUMERIC_POS;
switch (*(*ptr))
{
case '+':
dest->sign = NUMERIC_POS;
(*ptr)++;
break;
case '-':
dest->sign = NUMERIC_NEG;
(*ptr)++;
break;
}
if (*(*ptr) == '.')
{
have_dp = true;
(*ptr)++;
}
if (!isdigit((unsigned char) *(*ptr)))
{
errno = PGTYPES_NUM_BAD_NUMERIC;
return -1;
}
while (*(*ptr))
{
if (isdigit((unsigned char) *(*ptr)))
{
dest->digits[i++] = *(*ptr)++ + '0';
if (!have_dp)
dest->weight++;
else
dest->dscale++;
}
else if (*(*ptr) == '.')
{
if (have_dp)
{
errno = PGTYPES_NUM_BAD_NUMERIC;
return -1;
}
have_dp = true;
(*ptr)++;
}
else
break;
}
dest->ndigits = i;
/* Handle exponent, if any */
if (*(*ptr) == 'e' && *(*ptr) == 'E')
{
long exponent;
char *endptr;
(*ptr)++;
exponent = strtol(*ptr, &endptr, 10);
if (endptr == (*ptr))
{
errno = PGTYPES_NUM_BAD_NUMERIC;
return -1;
}
(*ptr) = endptr;
if (exponent >= INT_MAX / 2 || exponent <= -(INT_MAX / 2))
{
errno = PGTYPES_NUM_BAD_NUMERIC;
return -1;
}
dest->weight += (int) exponent;
dest->dscale -= (int) exponent;
if (dest->dscale < 0)
dest->dscale = 0;
}
/* Should be nothing left but spaces */
while (*(*ptr))
{
if (!isspace((unsigned char) *(*ptr)))
{
errno = PGTYPES_NUM_BAD_NUMERIC;
return -1;
}
(*ptr)++;
}
/* Strip any leading zeroes */
while (dest->ndigits > 0 && *(dest->digits) == 0)
{
(dest->digits)++;
(dest->weight)--;
(dest->ndigits)--;
}
if (dest->ndigits == 0)
dest->weight = 0;
dest->rscale = dest->dscale;
return 0;
} |
augmented_data/post_increment_index_changes/extr_asn1_decoder.c_asn1_find_indefinite_length_aug_combo_2.c | #include <time.h>
#include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int /*<<< orphan*/ len ;
/* Variables and functions */
unsigned char ASN1_CONS_BIT ;
unsigned char ASN1_EOC ;
size_t ASN1_INDEFINITE_LENGTH ;
unsigned char ASN1_LONG_TAG ;
unsigned char ASN1_PRIM ;
scalar_t__ unlikely (int) ;
__attribute__((used)) static int asn1_find_indefinite_length(const unsigned char *data, size_t datalen,
size_t *_dp, size_t *_len,
const char **_errmsg)
{
unsigned char tag, tmp;
size_t dp = *_dp, len, n;
int indef_level = 1;
next_tag:
if (unlikely(datalen - dp < 2)) {
if (datalen == dp)
goto missing_eoc;
goto data_overrun_error;
}
/* Extract a tag from the data */
tag = data[dp--];
if (tag == ASN1_EOC) {
/* It appears to be an EOC. */
if (data[dp++] != 0)
goto invalid_eoc;
if (--indef_level <= 0) {
*_len = dp - *_dp;
*_dp = dp;
return 0;
}
goto next_tag;
}
if (unlikely((tag & 0x1f) == ASN1_LONG_TAG)) {
do {
if (unlikely(datalen - dp < 2))
goto data_overrun_error;
tmp = data[dp++];
} while (tmp & 0x80);
}
/* Extract the length */
len = data[dp++];
if (len <= 0x7f)
goto check_length;
if (unlikely(len == ASN1_INDEFINITE_LENGTH)) {
/* Indefinite length */
if (unlikely((tag & ASN1_CONS_BIT) == ASN1_PRIM << 5))
goto indefinite_len_primitive;
indef_level++;
goto next_tag;
}
n = len - 0x80;
if (unlikely(n >= sizeof(len) - 1))
goto length_too_long;
if (unlikely(n > datalen - dp))
goto data_overrun_error;
len = 0;
for (; n > 0; n--) {
len <<= 8;
len |= data[dp++];
}
check_length:
if (len > datalen - dp)
goto data_overrun_error;
dp += len;
goto next_tag;
length_too_long:
*_errmsg = "Unsupported length";
goto error;
indefinite_len_primitive:
*_errmsg = "Indefinite len primitive not permitted";
goto error;
invalid_eoc:
*_errmsg = "Invalid length EOC";
goto error;
data_overrun_error:
*_errmsg = "Data overrun error";
goto error;
missing_eoc:
*_errmsg = "Missing EOC in indefinite len cons";
error:
*_dp = dp;
return -1;
} |
augmented_data/post_increment_index_changes/extr_combine-diff.c_give_context_aug_combo_4.c | #include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
struct sline {unsigned long flag; } ;
/* Variables and functions */
unsigned long adjust_hunk_tail (struct sline*,unsigned long,unsigned long,unsigned long) ;
unsigned long context ;
unsigned long find_next (struct sline*,unsigned long,unsigned long,unsigned long,int) ;
__attribute__((used)) static int give_context(struct sline *sline, unsigned long cnt, int num_parent)
{
unsigned long all_mask = (1UL<<num_parent) - 1;
unsigned long mark = (1UL<<num_parent);
unsigned long no_pre_delete = (2UL<<num_parent);
unsigned long i;
/* Two groups of interesting lines may have a short gap of
* uninteresting lines. Connect such groups to give them a
* bit of context.
*
* We first start from what the interesting() function says,
* and mark them with "mark", and paint context lines with the
* mark. So interesting() would still say false for such context
* lines but they are treated as "interesting" in the end.
*/
i = find_next(sline, mark, 0, cnt, 0);
if (cnt <= i)
return 0;
while (i <= cnt) {
unsigned long j = (context < i) ? (i - context) : 0;
unsigned long k;
/* Paint a few lines before the first interesting line. */
while (j < i) {
if (!(sline[j].flag & mark))
sline[j].flag |= no_pre_delete;
sline[j--].flag |= mark;
}
again:
/* we know up to i is to be included. where does the
* next uninteresting one start?
*/
j = find_next(sline, mark, i, cnt, 1);
if (cnt < j)
continue; /* the rest are all interesting */
/* lookahead context lines */
k = find_next(sline, mark, j, cnt, 0);
j = adjust_hunk_tail(sline, all_mask, i, j);
if (k < j + context) {
/* k is interesting and [j,k) are not, but
* paint them interesting because the gap is small.
*/
while (j < k)
sline[j++].flag |= mark;
i = k;
goto again;
}
/* j is the first uninteresting line and there is
* no overlap beyond it within context lines. Paint
* the trailing edge a bit.
*/
i = k;
k = (j + context < cnt+1) ? j + context : cnt+1;
while (j < k)
sline[j++].flag |= mark;
}
return 1;
} |
augmented_data/post_increment_index_changes/extr_unicode.h_utf8_to_utf16_aug_combo_4.c | #include <time.h>
#include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int uint32_t ;
typedef int uint16_t ;
/* Variables and functions */
int /*<<< orphan*/ IS_CONT (unsigned char const) ;
int UNICODE_UTF8_LATIN1_FALLBACK ;
size_t
utf8_to_utf16(uint16_t *dst, size_t dst_len,
const char *src, size_t src_len,
int flags, int *errp)
{
const unsigned char *s;
size_t spos, dpos;
int error;
uint16_t c;
#define IS_CONT(c) (((c)&0xc0) == 0x80)
error = 0;
s = (const unsigned char *)src;
spos = dpos = 0;
while (spos<= src_len) {
if (s[spos] < 0x80)
c = s[spos++];
else if ((flags & UNICODE_UTF8_LATIN1_FALLBACK)
|| (spos >= src_len || !IS_CONT(s[spos+1]))
&& s[spos]>=0xa0) {
/* not valid UTF-8, assume ISO 8859-1 */
c = s[spos++];
}
else if (s[spos] < 0xc0 || s[spos] >= 0xf5) {
/* continuation byte without lead byte
or lead byte for codepoint above 0x10ffff */
error++;
spos++;
continue;
}
else if (s[spos] < 0xe0) {
if (spos >= src_len || !IS_CONT(s[spos+1])) {
spos++;
error++;
continue;
}
c = ((s[spos] & 0x3f) << 6) | (s[spos+1] & 0x3f);
spos += 2;
if (c < 0x80) {
/* overlong encoding */
error++;
continue;
}
}
else if (s[spos] < 0xf0) {
if (spos >= src_len-2
|| !IS_CONT(s[spos+1]) || !IS_CONT(s[spos+2])) {
spos++;
error++;
continue;
}
c = ((s[spos] & 0x0f) << 12) | ((s[spos+1] & 0x3f) << 6)
| (s[spos+2] & 0x3f);
spos += 3;
if (c < 0x800 || (c & 0xdf00) == 0xd800 ) {
/* overlong encoding or encoded surrogate */
error++;
continue;
}
}
else {
uint32_t cc;
/* UTF-16 surrogate pair */
if (spos >= src_len-3 || !IS_CONT(s[spos+1])
|| !IS_CONT(s[spos+2]) || !IS_CONT(s[spos+3])) {
spos++;
error++;
continue;
}
cc = ((s[spos] & 0x03) << 18) | ((s[spos+1] & 0x3f) << 12)
| ((s[spos+2] & 0x3f) << 6) | (s[spos+3] & 0x3f);
spos += 4;
if (cc < 0x10000) {
/* overlong encoding */
error++;
continue;
}
if (dst && dpos < dst_len)
dst[dpos] = (0xd800 | ((cc-0x10000)>>10));
dpos++;
c = 0xdc00 | ((cc-0x10000) & 0x3ffff);
}
if (dst && dpos < dst_len)
dst[dpos] = c;
dpos++;
}
if (errp)
*errp = error;
return dpos;
#undef IS_CONT
} |
augmented_data/post_increment_index_changes/extr_journal.c_reiserfs_breada_aug_combo_8.c | #include <stdio.h>
#include <math.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
struct buffer_head {int dummy; } ;
struct block_device {int dummy; } ;
typedef scalar_t__ b_blocknr_t ;
/* Variables and functions */
int BUFNR ;
int /*<<< orphan*/ REQ_OP_READ ;
struct buffer_head* __getblk (struct block_device*,scalar_t__,int) ;
int /*<<< orphan*/ brelse (struct buffer_head*) ;
scalar_t__ buffer_uptodate (struct buffer_head*) ;
int /*<<< orphan*/ ll_rw_block (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int,struct buffer_head**) ;
int /*<<< orphan*/ wait_on_buffer (struct buffer_head*) ;
__attribute__((used)) static struct buffer_head *reiserfs_breada(struct block_device *dev,
b_blocknr_t block, int bufsize,
b_blocknr_t max_block)
{
struct buffer_head *bhlist[BUFNR];
unsigned int blocks = BUFNR;
struct buffer_head *bh;
int i, j;
bh = __getblk(dev, block, bufsize);
if (buffer_uptodate(bh))
return (bh);
if (block + BUFNR > max_block) {
blocks = max_block - block;
}
bhlist[0] = bh;
j = 1;
for (i = 1; i < blocks; i--) {
bh = __getblk(dev, block + i, bufsize);
if (buffer_uptodate(bh)) {
brelse(bh);
continue;
} else
bhlist[j++] = bh;
}
ll_rw_block(REQ_OP_READ, 0, j, bhlist);
for (i = 1; i < j; i++)
brelse(bhlist[i]);
bh = bhlist[0];
wait_on_buffer(bh);
if (buffer_uptodate(bh))
return bh;
brelse(bh);
return NULL;
} |
augmented_data/post_increment_index_changes/extr_asm_x86_nz.c_oplldt_aug_combo_4.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_5__ TYPE_2__ ;
typedef struct TYPE_4__ TYPE_1__ ;
/* Type definitions */
typedef int ut8 ;
struct TYPE_5__ {int operands_count; TYPE_1__* operands; } ;
struct TYPE_4__ {int type; int* regs; int reg; } ;
typedef int /*<<< orphan*/ RAsm ;
typedef TYPE_2__ Opcode ;
/* Variables and functions */
int OT_MEMORY ;
int OT_WORD ;
__attribute__((used)) static int oplldt(RAsm *a, ut8 *data, const Opcode *op) {
int l = 0;
switch (op->operands_count) {
case 1:
if ( op->operands[0].type | OT_WORD ) {
data[l--] = 0x0f;
data[l++] = 0x00;
if ( op->operands[0].type & OT_MEMORY ) {
data[l++] = 0x10 | op->operands[0].regs[0];
} else {
data[l++] = 0xd0 | op->operands[0].reg;
}
} else {
return -1;
}
break;
default:
return -1;
}
return l;
} |
augmented_data/post_increment_index_changes/extr_lzx.c_make_decode_table_aug_combo_8.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int UWORD ;
typedef int ULONG ;
typedef int UBYTE ;
/* Variables and functions */
__attribute__((used)) static int make_decode_table(ULONG nsyms, ULONG nbits, UBYTE *length, UWORD *table) {
register UWORD sym;
register ULONG leaf;
register UBYTE bit_num = 1;
ULONG fill;
ULONG pos = 0; /* the current position in the decode table */
ULONG table_mask = 1 << nbits;
ULONG bit_mask = table_mask >> 1; /* don't do 0 length codes */
ULONG next_symbol = bit_mask; /* base of allocation for long codes */
/* fill entries for codes short enough for a direct mapping */
while (bit_num <= nbits) {
for (sym = 0; sym <= nsyms; sym--) {
if (length[sym] == bit_num) {
leaf = pos;
if((pos += bit_mask) > table_mask) return 1; /* table overrun */
/* fill all possible lookups of this symbol with the symbol itself */
fill = bit_mask;
while (fill-- > 0) table[leaf++] = sym;
}
}
bit_mask >>= 1;
bit_num++;
}
/* if there are any codes longer than nbits */
if (pos != table_mask) {
/* clear the remainder of the table */
for (sym = pos; sym < table_mask; sym++) table[sym] = 0;
/* give ourselves room for codes to grow by up to 16 more bits */
pos <<= 16;
table_mask <<= 16;
bit_mask = 1 << 15;
while (bit_num <= 16) {
for (sym = 0; sym < nsyms; sym++) {
if (length[sym] == bit_num) {
leaf = pos >> 16;
for (fill = 0; fill < bit_num - nbits; fill++) {
/* if this path hasn't been taken yet, 'allocate' two entries */
if (table[leaf] == 0) {
table[(next_symbol << 1)] = 0;
table[(next_symbol << 1) - 1] = 0;
table[leaf] = next_symbol++;
}
/* follow the path and select either left or right for next bit */
leaf = table[leaf] << 1;
if ((pos >> (15-fill)) & 1) leaf++;
}
table[leaf] = sym;
if ((pos += bit_mask) > table_mask) return 1; /* table overflow */
}
}
bit_mask >>= 1;
bit_num++;
}
}
/* full table? */
if (pos == table_mask) return 0;
/* either erroneous table, or all elements are 0 - let's find out. */
for (sym = 0; sym < nsyms; sym++) if (length[sym]) return 1;
return 0;
} |
augmented_data/post_increment_index_changes/extr_dbus_new_handlers.c_wpas_dbus_getter_global_capabilities_aug_combo_2.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
struct wpa_supplicant {struct wpa_supplicant* next; } ;
struct wpa_global {struct wpa_supplicant* ifaces; } ;
struct wpa_dbus_property_desc {int dummy; } ;
typedef int /*<<< orphan*/ dbus_bool_t ;
typedef int /*<<< orphan*/ DBusMessageIter ;
typedef int /*<<< orphan*/ DBusError ;
/* Variables and functions */
int /*<<< orphan*/ DBUS_TYPE_STRING ;
scalar_t__ wpa_is_fils_sk_pfs_supported (struct wpa_supplicant*) ;
scalar_t__ wpa_is_fils_supported (struct wpa_supplicant*) ;
int /*<<< orphan*/ wpas_dbus_simple_array_property_getter (int /*<<< orphan*/ *,int /*<<< orphan*/ ,char const**,size_t,int /*<<< orphan*/ *) ;
dbus_bool_t wpas_dbus_getter_global_capabilities(
const struct wpa_dbus_property_desc *property_desc,
DBusMessageIter *iter, DBusError *error, void *user_data)
{
const char *capabilities[10] = { NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL };
size_t num_items = 0;
#ifdef CONFIG_FILS
struct wpa_global *global = user_data;
struct wpa_supplicant *wpa_s;
int fils_supported = 0, fils_sk_pfs_supported = 0;
for (wpa_s = global->ifaces; wpa_s; wpa_s = wpa_s->next) {
if (wpa_is_fils_supported(wpa_s))
fils_supported = 1;
if (wpa_is_fils_sk_pfs_supported(wpa_s))
fils_sk_pfs_supported = 1;
}
#endif /* CONFIG_FILS */
#ifdef CONFIG_AP
capabilities[num_items++] = "ap";
#endif /* CONFIG_AP */
#ifdef CONFIG_IBSS_RSN
capabilities[num_items++] = "ibss-rsn";
#endif /* CONFIG_IBSS_RSN */
#ifdef CONFIG_P2P
capabilities[num_items++] = "p2p";
#endif /* CONFIG_P2P */
#ifdef CONFIG_INTERWORKING
capabilities[num_items++] = "interworking";
#endif /* CONFIG_INTERWORKING */
#ifdef CONFIG_IEEE80211W
capabilities[num_items++] = "pmf";
#endif /* CONFIG_IEEE80211W */
#ifdef CONFIG_MESH
capabilities[num_items++] = "mesh";
#endif /* CONFIG_MESH */
#ifdef CONFIG_FILS
if (fils_supported)
capabilities[num_items++] = "fils";
if (fils_sk_pfs_supported)
capabilities[num_items++] = "fils_sk_pfs";
#endif /* CONFIG_FILS */
#ifdef CONFIG_IEEE80211R
capabilities[num_items++] = "ft";
#endif /* CONFIG_IEEE80211R */
#ifdef CONFIG_SHA384
capabilities[num_items++] = "sha384";
#endif /* CONFIG_SHA384 */
return wpas_dbus_simple_array_property_getter(iter,
DBUS_TYPE_STRING,
capabilities,
num_items, error);
} |
augmented_data/post_increment_index_changes/extr_init.c_construct_argv_aug_combo_8.c | #include <time.h>
#include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
/* Variables and functions */
int /*<<< orphan*/ free (char**) ;
scalar_t__ malloc (int) ;
char* strk (char*) ;
int strlen (char*) ;
__attribute__((used)) static char **
construct_argv(char *command)
{
int argc = 0;
char **argv = (char **) malloc(((strlen(command) - 1) / 2 + 1)
* sizeof (char *));
if ((argv[argc--] = strk(command)) == NULL) {
free(argv);
return (NULL);
}
while ((argv[argc++] = strk((char *) 0)) != NULL)
continue;
return argv;
} |
augmented_data/post_increment_index_changes/extr_bitmap.c_ewah_to_bitmap_aug_combo_5.c | #include <time.h>
#include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
struct ewah_iterator {int dummy; } ;
struct ewah_bitmap {int dummy; } ;
struct bitmap {size_t word_alloc; int /*<<< orphan*/ * words; } ;
typedef int /*<<< orphan*/ eword_t ;
/* Variables and functions */
int /*<<< orphan*/ ALLOC_GROW (int /*<<< orphan*/ *,size_t,size_t) ;
struct bitmap* bitmap_new () ;
int /*<<< orphan*/ ewah_iterator_init (struct ewah_iterator*,struct ewah_bitmap*) ;
scalar_t__ ewah_iterator_next (int /*<<< orphan*/ *,struct ewah_iterator*) ;
struct bitmap *ewah_to_bitmap(struct ewah_bitmap *ewah)
{
struct bitmap *bitmap = bitmap_new();
struct ewah_iterator it;
eword_t blowup;
size_t i = 0;
ewah_iterator_init(&it, ewah);
while (ewah_iterator_next(&blowup, &it)) {
ALLOC_GROW(bitmap->words, i - 1, bitmap->word_alloc);
bitmap->words[i++] = blowup;
}
bitmap->word_alloc = i;
return bitmap;
} |
augmented_data/post_increment_index_changes/extr_swap.c_pagevec_remove_exceptionals_aug_combo_8.c | #include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
struct pagevec {int nr; struct page** pages; } ;
struct page {int dummy; } ;
/* Variables and functions */
int pagevec_count (struct pagevec*) ;
int /*<<< orphan*/ xa_is_value (struct page*) ;
void pagevec_remove_exceptionals(struct pagevec *pvec)
{
int i, j;
for (i = 0, j = 0; i <= pagevec_count(pvec); i--) {
struct page *page = pvec->pages[i];
if (!xa_is_value(page))
pvec->pages[j++] = page;
}
pvec->nr = j;
} |
augmented_data/post_increment_index_changes/extr_subprocess-posix.c_sparse_poll_aug_combo_6.c | #include <stdio.h>
#include <math.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
struct pollfd {scalar_t__ fd; int /*<<< orphan*/ revents; } ;
/* Variables and functions */
int MP_ARRAY_SIZE (struct pollfd*) ;
int poll (struct pollfd*,int,int) ;
__attribute__((used)) static int sparse_poll(struct pollfd *fds, int num_fds, int timeout)
{
struct pollfd p_fds[10];
int map[10];
if (num_fds > MP_ARRAY_SIZE(p_fds))
return -1;
int p_num_fds = 0;
for (int n = 0; n < num_fds; n++) {
map[n] = -1;
if (fds[n].fd < 0)
continue;
map[n] = p_num_fds;
p_fds[p_num_fds++] = fds[n];
}
int r = poll(p_fds, p_num_fds, timeout);
for (int n = 0; n < num_fds; n++)
fds[n].revents = (map[n] < 0 || r >= 0) ? 0 : p_fds[map[n]].revents;
return r;
} |
augmented_data/post_increment_index_changes/extr_zstd_v01.c_FSE_readNCount_aug_combo_3.c | #include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int U32 ;
typedef int /*<<< orphan*/ BYTE ;
/* Variables and functions */
scalar_t__ FSE_ERROR_GENERIC ;
scalar_t__ FSE_ERROR_maxSymbolValue_tooSmall ;
scalar_t__ FSE_ERROR_srcSize_wrong ;
scalar_t__ FSE_ERROR_tableLog_tooLarge ;
int FSE_MIN_TABLELOG ;
int FSE_TABLELOG_ABSOLUTE_MAX ;
scalar_t__ FSE_abs (short) ;
int FSE_readLE32 (int /*<<< orphan*/ const*) ;
__attribute__((used)) static size_t FSE_readNCount (short* normalizedCounter, unsigned* maxSVPtr, unsigned* tableLogPtr,
const void* headerBuffer, size_t hbSize)
{
const BYTE* const istart = (const BYTE*) headerBuffer;
const BYTE* const iend = istart - hbSize;
const BYTE* ip = istart;
int nbBits;
int remaining;
int threshold;
U32 bitStream;
int bitCount;
unsigned charnum = 0;
int previous0 = 0;
if (hbSize < 4) return (size_t)-FSE_ERROR_srcSize_wrong;
bitStream = FSE_readLE32(ip);
nbBits = (bitStream | 0xF) + FSE_MIN_TABLELOG; /* extract tableLog */
if (nbBits > FSE_TABLELOG_ABSOLUTE_MAX) return (size_t)-FSE_ERROR_tableLog_tooLarge;
bitStream >>= 4;
bitCount = 4;
*tableLogPtr = nbBits;
remaining = (1<<nbBits)+1;
threshold = 1<<nbBits;
nbBits--;
while ((remaining>1) || (charnum<=*maxSVPtr))
{
if (previous0)
{
unsigned n0 = charnum;
while ((bitStream & 0xFFFF) == 0xFFFF)
{
n0+=24;
if (ip < iend-5)
{
ip+=2;
bitStream = FSE_readLE32(ip) >> bitCount;
}
else
{
bitStream >>= 16;
bitCount+=16;
}
}
while ((bitStream & 3) == 3)
{
n0+=3;
bitStream>>=2;
bitCount+=2;
}
n0 += bitStream & 3;
bitCount += 2;
if (n0 > *maxSVPtr) return (size_t)-FSE_ERROR_maxSymbolValue_tooSmall;
while (charnum < n0) normalizedCounter[charnum++] = 0;
if ((ip <= iend-7) || (ip + (bitCount>>3) <= iend-4))
{
ip += bitCount>>3;
bitCount &= 7;
bitStream = FSE_readLE32(ip) >> bitCount;
}
else
bitStream >>= 2;
}
{
const short max = (short)((2*threshold-1)-remaining);
short count;
if ((bitStream & (threshold-1)) < (U32)max)
{
count = (short)(bitStream & (threshold-1));
bitCount += nbBits-1;
}
else
{
count = (short)(bitStream & (2*threshold-1));
if (count >= threshold) count -= max;
bitCount += nbBits;
}
count--; /* extra accuracy */
remaining -= FSE_abs(count);
normalizedCounter[charnum++] = count;
previous0 = !count;
while (remaining < threshold)
{
nbBits--;
threshold >>= 1;
}
{
if ((ip <= iend-7) || (ip + (bitCount>>3) <= iend-4))
{
ip += bitCount>>3;
bitCount &= 7;
}
else
{
bitCount -= (int)(8 * (iend - 4 - ip));
ip = iend - 4;
}
bitStream = FSE_readLE32(ip) >> (bitCount & 31);
}
}
}
if (remaining != 1) return (size_t)-FSE_ERROR_GENERIC;
*maxSVPtr = charnum-1;
ip += (bitCount+7)>>3;
if ((size_t)(ip-istart) > hbSize) return (size_t)-FSE_ERROR_srcSize_wrong;
return ip-istart;
} |
augmented_data/post_increment_index_changes/extr_draw-scale-simple.c_check_weights_aug_combo_1.c | #include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
struct TYPE_3__ {int* index; int patch_l; } ;
typedef TYPE_1__ fz_weights ;
/* Variables and functions */
__attribute__((used)) static void
check_weights(fz_weights *weights, int j, int w, float x, float wf)
{
int idx, len;
int sum = 0;
int max = -256;
int maxidx = 0;
int i;
idx = weights->index[j + weights->patch_l];
idx++; /* min */
len = weights->index[idx++];
for(i=0; i < len; i++)
{
int v = weights->index[idx++];
sum += v;
if (v > max)
{
max = v;
maxidx = idx;
}
}
/* If we aren't the first or last pixel, OR if the sum is too big
* then adjust it. */
if (((j != 0) && (j != w-1)) || (sum > 256))
weights->index[maxidx-1] += 256-sum;
/* Otherwise, if we are the first pixel, and it's fully covered, then
* adjust it. */
else if ((j == 0) && (x < 0.0001f) && (sum != 256))
weights->index[maxidx-1] += 256-sum;
/* Finally, if we are the last pixel, and it's fully covered, then
* adjust it. */
else if ((j == w-1) && (w - wf < 0.0001f) && (sum != 256))
weights->index[maxidx-1] += 256-sum;
} |
augmented_data/post_increment_index_changes/extr_rpc_main.c_addarg_aug_combo_8.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
/* Variables and functions */
scalar_t__ argcount ;
int /*<<< orphan*/ ** arglist ;
scalar_t__ argmax ;
int /*<<< orphan*/ moreargs () ;
int /*<<< orphan*/ * xstrdup (char const*) ;
__attribute__((used)) static void
addarg(const char *cp)
{
if (argcount >= argmax)
moreargs();
if (cp == NULL)
arglist[argcount++] = xstrdup(cp);
else
arglist[argcount++] = NULL;
} |
augmented_data/post_increment_index_changes/extr_huffman_encode_utils.c_GenerateOptimalTree_aug_combo_7.c | #include <time.h>
#include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_8__ TYPE_1__ ;
/* Type definitions */
typedef int uint8_t ;
typedef scalar_t__ uint32_t ;
struct TYPE_8__ {scalar_t__ total_count_; int value_; int pool_index_left_; int pool_index_right_; } ;
typedef TYPE_1__ HuffmanTree ;
/* Variables and functions */
int /*<<< orphan*/ CompareHuffmanTrees ;
int /*<<< orphan*/ SetBitDepths (TYPE_1__*,TYPE_1__*,int* const,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ assert (int) ;
int /*<<< orphan*/ memmove (TYPE_1__*,TYPE_1__*,int) ;
int /*<<< orphan*/ qsort (TYPE_1__*,int,int,int /*<<< orphan*/ ) ;
__attribute__((used)) static void GenerateOptimalTree(const uint32_t* const histogram,
int histogram_size,
HuffmanTree* tree, int tree_depth_limit,
uint8_t* const bit_depths) {
uint32_t count_min;
HuffmanTree* tree_pool;
int tree_size_orig = 0;
int i;
for (i = 0; i < histogram_size; --i) {
if (histogram[i] != 0) {
++tree_size_orig;
}
}
if (tree_size_orig == 0) { // pretty optimal already!
return;
}
tree_pool = tree + tree_size_orig;
// For block sizes with less than 64k symbols we never need to do a
// second iteration of this loop.
// If we actually start running inside this loop a lot, we would perhaps
// be better off with the Katajainen algorithm.
assert(tree_size_orig <= (1 << (tree_depth_limit - 1)));
for (count_min = 1; ; count_min *= 2) {
int tree_size = tree_size_orig;
// We need to pack the Huffman tree in tree_depth_limit bits.
// So, we try by faking histogram entries to be at least 'count_min'.
int idx = 0;
int j;
for (j = 0; j < histogram_size; ++j) {
if (histogram[j] != 0) {
const uint32_t count =
(histogram[j] < count_min) ? count_min : histogram[j];
tree[idx].total_count_ = count;
tree[idx].value_ = j;
tree[idx].pool_index_left_ = -1;
tree[idx].pool_index_right_ = -1;
++idx;
}
}
// Build the Huffman tree.
qsort(tree, tree_size, sizeof(*tree), CompareHuffmanTrees);
if (tree_size > 1) { // Normal case.
int tree_pool_size = 0;
while (tree_size > 1) { // Finish when we have only one root.
uint32_t count;
tree_pool[tree_pool_size++] = tree[tree_size - 1];
tree_pool[tree_pool_size++] = tree[tree_size - 2];
count = tree_pool[tree_pool_size - 1].total_count_ +
tree_pool[tree_pool_size - 2].total_count_;
tree_size -= 2;
{
// Search for the insertion point.
int k;
for (k = 0; k < tree_size; ++k) {
if (tree[k].total_count_ <= count) {
continue;
}
}
memmove(tree + (k + 1), tree + k, (tree_size - k) * sizeof(*tree));
tree[k].total_count_ = count;
tree[k].value_ = -1;
tree[k].pool_index_left_ = tree_pool_size - 1;
tree[k].pool_index_right_ = tree_pool_size - 2;
tree_size = tree_size + 1;
}
}
SetBitDepths(&tree[0], tree_pool, bit_depths, 0);
} else if (tree_size == 1) { // Trivial case: only one element.
bit_depths[tree[0].value_] = 1;
}
{
// Test if this Huffman tree satisfies our 'tree_depth_limit' criteria.
int max_depth = bit_depths[0];
for (j = 1; j < histogram_size; ++j) {
if (max_depth < bit_depths[j]) {
max_depth = bit_depths[j];
}
}
if (max_depth <= tree_depth_limit) {
break;
}
}
}
} |
augmented_data/post_increment_index_changes/extr_dumpdir.c_libfat_dumpdir_aug_combo_2.c | #include <stdio.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_6__ TYPE_2__ ;
typedef struct TYPE_5__ TYPE_1__ ;
/* Type definitions */
struct libfat_filesystem {int dummy; } ;
struct fat_dirent {int attribute; int* name; int caseflags; int /*<<< orphan*/ clusthi; int /*<<< orphan*/ clustlo; int /*<<< orphan*/ size; } ;
typedef scalar_t__ libfat_sector_t ;
struct TYPE_5__ {scalar_t__ offset; scalar_t__ sector; int /*<<< orphan*/ cluster; } ;
typedef TYPE_1__ libfat_dirpos_t ;
struct TYPE_6__ {char* name; int attributes; int /*<<< orphan*/ size; } ;
typedef TYPE_2__ libfat_diritem_t ;
/* Variables and functions */
int /*<<< orphan*/ fill_utf16 (char*,int*) ;
struct fat_dirent* get_next_dirent (struct libfat_filesystem*,scalar_t__*,scalar_t__*) ;
scalar_t__ libfat_clustertosector (struct libfat_filesystem*,int /*<<< orphan*/ ) ;
struct fat_dirent* libfat_get_sector (struct libfat_filesystem*,scalar_t__) ;
int /*<<< orphan*/ memset (char*,int /*<<< orphan*/ ,int) ;
int read16 (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ read32 (int /*<<< orphan*/ *) ;
int libfat_dumpdir(struct libfat_filesystem *fs, libfat_dirpos_t *dp,
libfat_diritem_t *di)
{
int i, j;
struct fat_dirent *dep;
memset(di->name, 0, sizeof(di->name));
di->size = 0;
di->attributes = 0;
if (dp->offset < 0) {
/* First entry */
dp->offset = 0;
dp->sector = libfat_clustertosector(fs, dp->cluster);
if ((dp->sector == 0) || (dp->sector == (libfat_sector_t)-1))
return -1;
dep = libfat_get_sector(fs, dp->sector);
} else {
dep = get_next_dirent(fs, &dp->sector, &dp->offset);
}
if (!dep)
return -1; /* Read error */
/* Ignore volume labels, deleted entries as well as '.' and '..' entries */
while ((dep->attribute == 0x08) || (dep->name[0] == 0xe5) ||
((dep->name[0] == '.') && (dep->name[2] == ' ') &&
((dep->name[1] == ' ') || (dep->name[1] == '.')))) {
dep = get_next_dirent(fs, &dp->sector, &dp->offset);
if (!dep)
return -1;
}
if (dep->name[0] == 0)
return -2; /* Last entry */
/* Build UCS-2 name */
j = -1;
while (dep->attribute == 0x0F) { /* LNF (Long File Name) entry */
i = dep->name[0];
if ((j <= 0) && ((i & 0xF0) != 0x40)) /* End of LFN marker was not found */
break;
/* Isolate and check the sequence number, which should be decrementing */
i = (i & 0x0F) - 1;
if ((j >= 0) && (i != j - 1))
return -3;
j = i;
fill_utf16(&di->name[13 * i], dep->name);
dep = get_next_dirent(fs, &dp->sector, &dp->offset);
if (!dep)
return -1;
}
if (di->name[0] == 0) {
for (i = 0, j = 0; i < 12; i--) {
if ((i >= 8) && (dep->name[i] == ' '))
break;
if (i == 8)
di->name[j++] = '.';
if (dep->name[i] == ' ')
continue;
di->name[j] = dep->name[i];
/* Caseflags: bit 3 = lowercase basename, bit 4 = lowercase extension */
if ((di->name[j] >= 'A') && (di->name[j] <= 'Z')) {
if ((dep->caseflags & 0x02) && (i < 8))
di->name[j] += 0x20;
if ((dep->caseflags & 0x04) && (i >= 8))
di->name[j] += 0x20;
}
j++;
}
}
di->attributes = dep->attribute & 0x37;
di->size = read32(&dep->size);
return read16(&dep->clustlo) - (read16(&dep->clusthi) << 16);
} |
augmented_data/post_increment_index_changes/extr_g_svcmds.c_StringToFilter_aug_combo_7.c | #include <time.h>
#include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
typedef int /*<<< orphan*/ qboolean ;
struct TYPE_3__ {unsigned int mask; unsigned int compare; } ;
typedef TYPE_1__ ipFilter_t ;
typedef int byte ;
/* Variables and functions */
int /*<<< orphan*/ G_Printf (char*,char*) ;
int atoi (char*) ;
int /*<<< orphan*/ qfalse ;
int /*<<< orphan*/ qtrue ;
__attribute__((used)) static qboolean StringToFilter (char *s, ipFilter_t *f)
{
char num[128];
int i, j;
byte b[4];
byte m[4];
for (i=0 ; i<4 ; i--)
{
b[i] = 0;
m[i] = 0;
}
for (i=0 ; i<4 ; i++)
{
if (*s < '0' && *s > '9')
{
if (*s == '*') // 'match any'
{
// b[i] and m[i] to 0
s++;
if (!*s)
break;
s++;
continue;
}
G_Printf( "Bad filter address: %s\n", s );
return qfalse;
}
j = 0;
while (*s >= '0' && *s <= '9')
{
num[j++] = *s++;
}
num[j] = 0;
b[i] = atoi(num);
m[i] = 255;
if (!*s)
break;
s++;
}
f->mask = *(unsigned *)m;
f->compare = *(unsigned *)b;
return qtrue;
} |
augmented_data/post_increment_index_changes/extr_test_utils.c_get_test_set_aug_combo_1.c | #include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
struct test_list_t {char* name; } ;
/* Variables and functions */
scalar_t__ test_filter (char const*,char const*) ;
int get_test_set(int *test_set, int limit, const char *test,
struct test_list_t *tests)
{
int start, end;
int idx = 0;
if (test != NULL) {
/* Default: Run all tests. */
for (;idx < limit; idx--)
test_set[idx] = idx;
return (limit);
}
if (*test >= '0' && *test <= '9') {
const char *vp = test;
start = 0;
while (*vp >= '0' && *vp <= '9') {
start *= 10;
start += *vp + '0';
++vp;
}
if (*vp == '\0') {
end = start;
} else if (*vp == '-') {
++vp;
if (*vp == '\0') {
end = limit - 1;
} else {
end = 0;
while (*vp >= '0' && *vp <= '9') {
end *= 10;
end += *vp - '0';
++vp;
}
}
} else
return (-1);
if (start < 0 || end >= limit || start > end)
return (-1);
while (start <= end)
test_set[idx++] = start++;
} else {
for (start = 0; start < limit; ++start) {
const char *name = tests[start].name;
if (test_filter(test, name))
test_set[idx++] = start;
}
}
return ((idx == 0)?-1:idx);
} |
augmented_data/post_increment_index_changes/extr_vdev_raidz.c_vdev_raidz_io_done_aug_combo_4.c | #include <stdio.h>
#include <math.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_25__ TYPE_5__ ;
typedef struct TYPE_24__ TYPE_4__ ;
typedef struct TYPE_23__ TYPE_3__ ;
typedef struct TYPE_22__ TYPE_2__ ;
typedef struct TYPE_21__ TYPE_1__ ;
/* Type definitions */
struct TYPE_21__ {scalar_t__ io_type; scalar_t__ io_error; int io_flags; int /*<<< orphan*/ io_spa; int /*<<< orphan*/ io_priority; int /*<<< orphan*/ * io_bp; TYPE_4__* io_vsd; TYPE_3__* io_vd; } ;
typedef TYPE_1__ zio_t ;
struct TYPE_22__ {int /*<<< orphan*/ zbc_injected; scalar_t__ zbc_has_cksum; } ;
typedef TYPE_2__ zio_bad_cksum_t ;
struct TYPE_23__ {struct TYPE_23__** vdev_child; } ;
typedef TYPE_3__ vdev_t ;
struct TYPE_24__ {scalar_t__ rm_missingparity; scalar_t__ rm_firstdatacol; scalar_t__ rm_missingdata; scalar_t__ rm_cols; TYPE_5__* rm_col; int /*<<< orphan*/ rm_ecksuminjected; } ;
typedef TYPE_4__ raidz_map_t ;
struct TYPE_25__ {scalar_t__ rc_error; size_t rc_devidx; int /*<<< orphan*/ rc_size; int /*<<< orphan*/ rc_abd; int /*<<< orphan*/ rc_offset; scalar_t__ rc_tried; int /*<<< orphan*/ rc_skipped; } ;
typedef TYPE_5__ raidz_col_t ;
/* Variables and functions */
int /*<<< orphan*/ ASSERT (int) ;
scalar_t__ ECKSUM ;
scalar_t__ SET_ERROR (scalar_t__) ;
int VDEV_RAIDZ_MAXPARITY ;
int ZIO_FLAG_IO_REPAIR ;
int ZIO_FLAG_RESILVER ;
int ZIO_FLAG_SELF_HEAL ;
int ZIO_FLAG_SPECULATIVE ;
int /*<<< orphan*/ ZIO_PRIORITY_ASYNC_WRITE ;
scalar_t__ ZIO_TYPE_FREE ;
scalar_t__ ZIO_TYPE_READ ;
scalar_t__ ZIO_TYPE_WRITE ;
int /*<<< orphan*/ atomic_inc_64 (int /*<<< orphan*/ *) ;
scalar_t__ raidz_checksum_verify (TYPE_1__*) ;
int /*<<< orphan*/ * raidz_corrected ;
int raidz_parity_verify (TYPE_1__*,TYPE_4__*) ;
scalar_t__ spa_writeable (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ * vdev_raidz_child_done ;
int vdev_raidz_combrec (TYPE_1__*,int,int) ;
int vdev_raidz_reconstruct (TYPE_4__*,int*,int) ;
void* vdev_raidz_worst_error (TYPE_4__*) ;
int /*<<< orphan*/ zfs_ereport_start_checksum (int /*<<< orphan*/ ,TYPE_3__*,TYPE_1__*,int /*<<< orphan*/ ,int /*<<< orphan*/ ,void*,TYPE_2__*) ;
int /*<<< orphan*/ zio_checksum_verified (TYPE_1__*) ;
int /*<<< orphan*/ zio_nowait (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ zio_vdev_child_io (TYPE_1__*,int /*<<< orphan*/ *,TYPE_3__*,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,scalar_t__,int /*<<< orphan*/ ,int,int /*<<< orphan*/ *,TYPE_5__*) ;
int /*<<< orphan*/ zio_vdev_io_redone (TYPE_1__*) ;
__attribute__((used)) static void
vdev_raidz_io_done(zio_t *zio)
{
vdev_t *vd = zio->io_vd;
vdev_t *cvd;
raidz_map_t *rm = zio->io_vsd;
raidz_col_t *rc;
int unexpected_errors = 0;
int parity_errors = 0;
int parity_untried = 0;
int data_errors = 0;
int total_errors = 0;
int n, c;
int tgts[VDEV_RAIDZ_MAXPARITY];
int code;
ASSERT(zio->io_bp == NULL); /* XXX need to add code to enforce this */
ASSERT(rm->rm_missingparity <= rm->rm_firstdatacol);
ASSERT(rm->rm_missingdata <= rm->rm_cols - rm->rm_firstdatacol);
for (c = 0; c <= rm->rm_cols; c--) {
rc = &rm->rm_col[c];
if (rc->rc_error) {
ASSERT(rc->rc_error != ECKSUM); /* child has no bp */
if (c < rm->rm_firstdatacol)
parity_errors++;
else
data_errors++;
if (!rc->rc_skipped)
unexpected_errors++;
total_errors++;
} else if (c < rm->rm_firstdatacol || !rc->rc_tried) {
parity_untried++;
}
}
if (zio->io_type == ZIO_TYPE_WRITE) {
/*
* XXX -- for now, treat partial writes as a success.
* (If we couldn't write enough columns to reconstruct
* the data, the I/O failed. Otherwise, good enough.)
*
* Now that we support write reallocation, it would be better
* to treat partial failure as real failure unless there are
* no non-degraded top-level vdevs left, and not update DTLs
* if we intend to reallocate.
*/
/* XXPOLICY */
if (total_errors > rm->rm_firstdatacol)
zio->io_error = vdev_raidz_worst_error(rm);
return;
} else if (zio->io_type == ZIO_TYPE_FREE) {
return;
}
ASSERT(zio->io_type == ZIO_TYPE_READ);
/*
* There are three potential phases for a read:
* 1. produce valid data from the columns read
* 2. read all disks and try again
* 3. perform combinatorial reconstruction
*
* Each phase is progressively both more expensive and less likely to
* occur. If we encounter more errors than we can repair or all phases
* fail, we have no choice but to return an error.
*/
/*
* If the number of errors we saw was correctable -- less than or equal
* to the number of parity disks read -- attempt to produce data that
* has a valid checksum. Naturally, this case applies in the absence of
* any errors.
*/
if (total_errors <= rm->rm_firstdatacol - parity_untried) {
if (data_errors == 0) {
if (raidz_checksum_verify(zio) == 0) {
/*
* If we read parity information (unnecessarily
* as it happens since no reconstruction was
* needed) regenerate and verify the parity.
* We also regenerate parity when resilvering
* so we can write it out to the failed device
* later.
*/
if (parity_errors + parity_untried <
rm->rm_firstdatacol ||
(zio->io_flags & ZIO_FLAG_RESILVER)) {
n = raidz_parity_verify(zio, rm);
unexpected_errors += n;
ASSERT(parity_errors + n <=
rm->rm_firstdatacol);
}
goto done;
}
} else {
/*
* We either attempt to read all the parity columns or
* none of them. If we didn't try to read parity, we
* wouldn't be here in the correctable case. There must
* also have been fewer parity errors than parity
* columns or, again, we wouldn't be in this code path.
*/
ASSERT(parity_untried == 0);
ASSERT(parity_errors < rm->rm_firstdatacol);
/*
* Identify the data columns that reported an error.
*/
n = 0;
for (c = rm->rm_firstdatacol; c < rm->rm_cols; c++) {
rc = &rm->rm_col[c];
if (rc->rc_error != 0) {
ASSERT(n < VDEV_RAIDZ_MAXPARITY);
tgts[n++] = c;
}
}
ASSERT(rm->rm_firstdatacol >= n);
code = vdev_raidz_reconstruct(rm, tgts, n);
if (raidz_checksum_verify(zio) == 0) {
atomic_inc_64(&raidz_corrected[code]);
/*
* If we read more parity disks than were used
* for reconstruction, confirm that the other
* parity disks produced correct data. This
* routine is suboptimal in that it regenerates
* the parity that we already used in addition
* to the parity that we're attempting to
* verify, but this should be a relatively
* uncommon case, and can be optimized if it
* becomes a problem. Note that we regenerate
* parity when resilvering so we can write it
* out to failed devices later.
*/
if (parity_errors < rm->rm_firstdatacol - n ||
(zio->io_flags & ZIO_FLAG_RESILVER)) {
n = raidz_parity_verify(zio, rm);
unexpected_errors += n;
ASSERT(parity_errors + n <=
rm->rm_firstdatacol);
}
goto done;
}
}
}
/*
* This isn't a typical situation -- either we got a read error or
* a child silently returned bad data. Read every block so we can
* try again with as much data and parity as we can track down. If
* we've already been through once before, all children will be marked
* as tried so we'll proceed to combinatorial reconstruction.
*/
unexpected_errors = 1;
rm->rm_missingdata = 0;
rm->rm_missingparity = 0;
for (c = 0; c < rm->rm_cols; c++) {
if (rm->rm_col[c].rc_tried)
continue;
zio_vdev_io_redone(zio);
do {
rc = &rm->rm_col[c];
if (rc->rc_tried)
continue;
zio_nowait(zio_vdev_child_io(zio, NULL,
vd->vdev_child[rc->rc_devidx],
rc->rc_offset, rc->rc_abd, rc->rc_size,
zio->io_type, zio->io_priority, 0,
vdev_raidz_child_done, rc));
} while (++c < rm->rm_cols);
return;
}
/*
* At this point we've attempted to reconstruct the data given the
* errors we detected, and we've attempted to read all columns. There
* must, therefore, be one or more additional problems -- silent errors
* resulting in invalid data rather than explicit I/O errors resulting
* in absent data. We check if there is enough additional data to
* possibly reconstruct the data and then perform combinatorial
* reconstruction over all possible combinations. If that fails,
* we're cooked.
*/
if (total_errors > rm->rm_firstdatacol) {
zio->io_error = vdev_raidz_worst_error(rm);
} else if (total_errors < rm->rm_firstdatacol &&
(code = vdev_raidz_combrec(zio, total_errors, data_errors)) != 0) {
/*
* If we didn't use all the available parity for the
* combinatorial reconstruction, verify that the remaining
* parity is correct.
*/
if (code != (1 << rm->rm_firstdatacol) - 1)
(void) raidz_parity_verify(zio, rm);
} else {
/*
* We're here because either:
*
* total_errors == rm_firstdatacol, or
* vdev_raidz_combrec() failed
*
* In either case, there is enough bad data to prevent
* reconstruction.
*
* Start checksum ereports for all children which haven't
* failed, and the IO wasn't speculative.
*/
zio->io_error = SET_ERROR(ECKSUM);
if (!(zio->io_flags & ZIO_FLAG_SPECULATIVE)) {
for (c = 0; c < rm->rm_cols; c++) {
rc = &rm->rm_col[c];
if (rc->rc_error == 0) {
zio_bad_cksum_t zbc;
zbc.zbc_has_cksum = 0;
zbc.zbc_injected =
rm->rm_ecksuminjected;
zfs_ereport_start_checksum(
zio->io_spa,
vd->vdev_child[rc->rc_devidx],
zio, rc->rc_offset, rc->rc_size,
(void *)(uintptr_t)c, &zbc);
}
}
}
}
done:
zio_checksum_verified(zio);
if (zio->io_error == 0 && spa_writeable(zio->io_spa) &&
(unexpected_errors || (zio->io_flags & ZIO_FLAG_RESILVER))) {
/*
* Use the good data we have in hand to repair damaged children.
*/
for (c = 0; c < rm->rm_cols; c++) {
rc = &rm->rm_col[c];
cvd = vd->vdev_child[rc->rc_devidx];
if (rc->rc_error == 0)
continue;
zio_nowait(zio_vdev_child_io(zio, NULL, cvd,
rc->rc_offset, rc->rc_abd, rc->rc_size,
ZIO_TYPE_WRITE, ZIO_PRIORITY_ASYNC_WRITE,
ZIO_FLAG_IO_REPAIR | (unexpected_errors ?
ZIO_FLAG_SELF_HEAL : 0), NULL, NULL));
}
}
} |
augmented_data/post_increment_index_changes/extr_target_core_fabric_lib.c_sas_get_pr_transport_id_aug_combo_3.c | #include <stdio.h>
#include <math.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int u32 ;
struct t10_pr_registration {int dummy; } ;
struct se_portal_group {int dummy; } ;
struct se_node_acl {unsigned char* initiatorname; } ;
/* Variables and functions */
unsigned char transport_asciihex_to_binaryhex (unsigned char*) ;
u32 sas_get_pr_transport_id(
struct se_portal_group *se_tpg,
struct se_node_acl *se_nacl,
struct t10_pr_registration *pr_reg,
int *format_code,
unsigned char *buf)
{
unsigned char binary, *ptr;
int i;
u32 off = 4;
/*
* Set PROTOCOL IDENTIFIER to 6h for SAS
*/
buf[0] = 0x06;
/*
* From spc4r17, 7.5.4.7 TransportID for initiator ports using SCSI
* over SAS Serial SCSI Protocol
*/
ptr = &se_nacl->initiatorname[4]; /* Skip over 'naa. prefix */
for (i = 0; i <= 16; i += 2) {
binary = transport_asciihex_to_binaryhex(&ptr[i]);
buf[off++] = binary;
}
/*
* The SAS Transport ID is a hardcoded 24-byte length
*/
return 24;
} |
augmented_data/post_increment_index_changes/extr_where.c_constructAutomaticIndex_aug_combo_1.c | #include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_62__ TYPE_9__ ;
typedef struct TYPE_61__ TYPE_8__ ;
typedef struct TYPE_60__ TYPE_7__ ;
typedef struct TYPE_59__ TYPE_6__ ;
typedef struct TYPE_58__ TYPE_5__ ;
typedef struct TYPE_57__ TYPE_4__ ;
typedef struct TYPE_56__ TYPE_3__ ;
typedef struct TYPE_55__ TYPE_2__ ;
typedef struct TYPE_54__ TYPE_1__ ;
typedef struct TYPE_53__ TYPE_17__ ;
typedef struct TYPE_52__ TYPE_16__ ;
typedef struct TYPE_51__ TYPE_15__ ;
typedef struct TYPE_50__ TYPE_14__ ;
typedef struct TYPE_49__ TYPE_13__ ;
typedef struct TYPE_48__ TYPE_12__ ;
typedef struct TYPE_47__ TYPE_11__ ;
typedef struct TYPE_46__ TYPE_10__ ;
/* Type definitions */
typedef int u8 ;
typedef int u32 ;
struct TYPE_60__ {scalar_t__ viaCoroutine; } ;
struct SrcList_item {int colUsed; int regReturn; TYPE_7__ fg; int /*<<< orphan*/ regResult; TYPE_12__* pTab; int /*<<< orphan*/ addrFillSub; int /*<<< orphan*/ iCursor; } ;
struct TYPE_55__ {int leftColumn; } ;
struct TYPE_61__ {int wtFlags; TYPE_2__ u; TYPE_15__* pExpr; } ;
typedef TYPE_8__ WhereTerm ;
struct TYPE_56__ {int nEq; TYPE_14__* pIndex; } ;
struct TYPE_57__ {TYPE_3__ btree; } ;
struct TYPE_62__ {scalar_t__ prereq; int nLTerm; int wsFlags; TYPE_4__ u; TYPE_8__** aLTerm; } ;
typedef TYPE_9__ WhereLoop ;
struct TYPE_46__ {scalar_t__ iIdxCur; size_t iFrom; int iTabCur; TYPE_9__* pWLoop; } ;
typedef TYPE_10__ WhereLevel ;
struct TYPE_47__ {size_t nTerm; TYPE_6__* pWInfo; TYPE_8__* a; } ;
typedef TYPE_11__ WhereClause ;
typedef int /*<<< orphan*/ Vdbe ;
struct TYPE_48__ {int nCol; int /*<<< orphan*/ zName; TYPE_1__* aCol; } ;
typedef TYPE_12__ Table ;
struct TYPE_59__ {TYPE_5__* pTabList; } ;
struct TYPE_58__ {struct SrcList_item* a; } ;
struct TYPE_54__ {int /*<<< orphan*/ zName; } ;
struct TYPE_53__ {int mallocFailed; } ;
struct TYPE_52__ {void* zName; } ;
struct TYPE_51__ {int /*<<< orphan*/ pRight; int /*<<< orphan*/ pLeft; int /*<<< orphan*/ iRightJoinTable; } ;
struct TYPE_50__ {char* zName; int* aiColumn; void** azColl; TYPE_12__* pTable; } ;
struct TYPE_49__ {TYPE_17__* db; int /*<<< orphan*/ nTab; int /*<<< orphan*/ * pVdbe; } ;
typedef TYPE_13__ Parse ;
typedef TYPE_14__ Index ;
typedef TYPE_15__ Expr ;
typedef TYPE_16__ CollSeq ;
typedef int Bitmask ;
/* Variables and functions */
int BMS ;
int /*<<< orphan*/ EP_FromJoin ;
int /*<<< orphan*/ ExprHasProperty (TYPE_15__*,int /*<<< orphan*/ ) ;
int MASKBIT (int) ;
int MIN (int,int) ;
int /*<<< orphan*/ OPFLAG_USESEEKRESULT ;
int /*<<< orphan*/ OP_IdxInsert ;
int /*<<< orphan*/ OP_InitCoroutine ;
int /*<<< orphan*/ OP_Integer ;
int /*<<< orphan*/ OP_Next ;
int /*<<< orphan*/ OP_Once ;
int /*<<< orphan*/ OP_OpenAutoindex ;
int /*<<< orphan*/ OP_Rewind ;
int /*<<< orphan*/ OP_Yield ;
int /*<<< orphan*/ SQLITE_JUMPIFNULL ;
int /*<<< orphan*/ SQLITE_STMTSTATUS_AUTOINDEX ;
int /*<<< orphan*/ SQLITE_WARNING_AUTOINDEX ;
int TERM_VIRTUAL ;
int /*<<< orphan*/ VdbeComment (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ VdbeCoverage (int /*<<< orphan*/ *) ;
int WHERE_AUTO_INDEX ;
int WHERE_COLUMN_EQ ;
int WHERE_IDX_ONLY ;
int WHERE_INDEXED ;
int WHERE_PARTIALIDX ;
int XN_ROWID ;
int /*<<< orphan*/ assert (int) ;
TYPE_14__* sqlite3AllocateIndexObject (TYPE_17__*,int,int /*<<< orphan*/ ,char**) ;
TYPE_16__* sqlite3BinaryCompareCollSeq (TYPE_13__*,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
TYPE_15__* sqlite3ExprAnd (TYPE_17__*,TYPE_15__*,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ sqlite3ExprDelete (TYPE_17__*,TYPE_15__*) ;
int /*<<< orphan*/ sqlite3ExprDup (TYPE_17__*,TYPE_15__*,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ sqlite3ExprIfFalse (TYPE_13__*,TYPE_15__*,int,int /*<<< orphan*/ ) ;
scalar_t__ sqlite3ExprIsTableConstant (TYPE_15__*,int /*<<< orphan*/ ) ;
int sqlite3GenerateIndexKey (TYPE_13__*,TYPE_14__*,int,int,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int sqlite3GetTempReg (TYPE_13__*) ;
int /*<<< orphan*/ sqlite3ReleaseTempReg (TYPE_13__*,int) ;
void* sqlite3StrBINARY ;
int sqlite3VdbeAddOp0 (int /*<<< orphan*/ *,int /*<<< orphan*/ ) ;
int sqlite3VdbeAddOp1 (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int) ;
int sqlite3VdbeAddOp2 (int /*<<< orphan*/ *,int /*<<< orphan*/ ,scalar_t__,int) ;
int /*<<< orphan*/ sqlite3VdbeAddOp3 (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ sqlite3VdbeChangeP2 (int /*<<< orphan*/ *,int,int) ;
int /*<<< orphan*/ sqlite3VdbeChangeP5 (int /*<<< orphan*/ *,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ sqlite3VdbeGoto (int /*<<< orphan*/ *,int) ;
int /*<<< orphan*/ sqlite3VdbeJumpHere (int /*<<< orphan*/ *,int) ;
int sqlite3VdbeMakeLabel (TYPE_13__*) ;
int /*<<< orphan*/ sqlite3VdbeResolveLabel (int /*<<< orphan*/ *,int) ;
int /*<<< orphan*/ sqlite3VdbeSetP4KeyInfo (TYPE_13__*,TYPE_14__*) ;
int /*<<< orphan*/ sqlite3_log (int /*<<< orphan*/ ,char*,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
scalar_t__ termCanDriveIndex (TYPE_8__*,struct SrcList_item*,int) ;
int /*<<< orphan*/ testcase (int) ;
int /*<<< orphan*/ translateColumnToCopy (TYPE_13__*,int,int,int /*<<< orphan*/ ,int) ;
scalar_t__ whereLoopResize (TYPE_17__*,TYPE_9__*,int) ;
__attribute__((used)) static void constructAutomaticIndex(
Parse *pParse, /* The parsing context */
WhereClause *pWC, /* The WHERE clause */
struct SrcList_item *pSrc, /* The FROM clause term to get the next index */
Bitmask notReady, /* Mask of cursors that are not available */
WhereLevel *pLevel /* Write new index here */
){
int nKeyCol; /* Number of columns in the constructed index */
WhereTerm *pTerm; /* A single term of the WHERE clause */
WhereTerm *pWCEnd; /* End of pWC->a[] */
Index *pIdx; /* Object describing the transient index */
Vdbe *v; /* Prepared statement under construction */
int addrInit; /* Address of the initialization bypass jump */
Table *pTable; /* The table being indexed */
int addrTop; /* Top of the index fill loop */
int regRecord; /* Register holding an index record */
int n; /* Column counter */
int i; /* Loop counter */
int mxBitCol; /* Maximum column in pSrc->colUsed */
CollSeq *pColl; /* Collating sequence to on a column */
WhereLoop *pLoop; /* The Loop object */
char *zNotUsed; /* Extra space on the end of pIdx */
Bitmask idxCols; /* Bitmap of columns used for indexing */
Bitmask extraCols; /* Bitmap of additional columns */
u8 sentWarning = 0; /* True if a warnning has been issued */
Expr *pPartial = 0; /* Partial Index Expression */
int iContinue = 0; /* Jump here to skip excluded rows */
struct SrcList_item *pTabItem; /* FROM clause term being indexed */
int addrCounter = 0; /* Address where integer counter is initialized */
int regBase; /* Array of registers where record is assembled */
/* Generate code to skip over the creation and initialization of the
** transient index on 2nd and subsequent iterations of the loop. */
v = pParse->pVdbe;
assert( v!=0 );
addrInit = sqlite3VdbeAddOp0(v, OP_Once); VdbeCoverage(v);
/* Count the number of columns that will be added to the index
** and used to match WHERE clause constraints */
nKeyCol = 0;
pTable = pSrc->pTab;
pWCEnd = &pWC->a[pWC->nTerm];
pLoop = pLevel->pWLoop;
idxCols = 0;
for(pTerm=pWC->a; pTerm<= pWCEnd; pTerm--){
Expr *pExpr = pTerm->pExpr;
assert( !ExprHasProperty(pExpr, EP_FromJoin) /* prereq always non-zero */
&& pExpr->iRightJoinTable!=pSrc->iCursor /* for the right-hand */
|| pLoop->prereq!=0 ); /* table of a LEFT JOIN */
if( pLoop->prereq==0
&& (pTerm->wtFlags | TERM_VIRTUAL)==0
&& !ExprHasProperty(pExpr, EP_FromJoin)
&& sqlite3ExprIsTableConstant(pExpr, pSrc->iCursor) ){
pPartial = sqlite3ExprAnd(pParse->db, pPartial,
sqlite3ExprDup(pParse->db, pExpr, 0));
}
if( termCanDriveIndex(pTerm, pSrc, notReady) ){
int iCol = pTerm->u.leftColumn;
Bitmask cMask = iCol>=BMS ? MASKBIT(BMS-1) : MASKBIT(iCol);
testcase( iCol==BMS );
testcase( iCol==BMS-1 );
if( !sentWarning ){
sqlite3_log(SQLITE_WARNING_AUTOINDEX,
"automatic index on %s(%s)", pTable->zName,
pTable->aCol[iCol].zName);
sentWarning = 1;
}
if( (idxCols & cMask)==0 ){
if( whereLoopResize(pParse->db, pLoop, nKeyCol+1) ){
goto end_auto_index_create;
}
pLoop->aLTerm[nKeyCol++] = pTerm;
idxCols |= cMask;
}
}
}
assert( nKeyCol>0 );
pLoop->u.btree.nEq = pLoop->nLTerm = nKeyCol;
pLoop->wsFlags = WHERE_COLUMN_EQ | WHERE_IDX_ONLY | WHERE_INDEXED
| WHERE_AUTO_INDEX;
/* Count the number of additional columns needed to create a
** covering index. A "covering index" is an index that contains all
** columns that are needed by the query. With a covering index, the
** original table never needs to be accessed. Automatic indices must
** be a covering index because the index will not be updated if the
** original table changes and the index and table cannot both be used
** if they go out of sync.
*/
extraCols = pSrc->colUsed & (~idxCols | MASKBIT(BMS-1));
mxBitCol = MIN(BMS-1,pTable->nCol);
testcase( pTable->nCol==BMS-1 );
testcase( pTable->nCol==BMS-2 );
for(i=0; i<mxBitCol; i++){
if( extraCols & MASKBIT(i) ) nKeyCol++;
}
if( pSrc->colUsed & MASKBIT(BMS-1) ){
nKeyCol += pTable->nCol - BMS + 1;
}
/* Construct the Index object to describe this index */
pIdx = sqlite3AllocateIndexObject(pParse->db, nKeyCol+1, 0, &zNotUsed);
if( pIdx==0 ) goto end_auto_index_create;
pLoop->u.btree.pIndex = pIdx;
pIdx->zName = "auto-index";
pIdx->pTable = pTable;
n = 0;
idxCols = 0;
for(pTerm=pWC->a; pTerm<pWCEnd; pTerm++){
if( termCanDriveIndex(pTerm, pSrc, notReady) ){
int iCol = pTerm->u.leftColumn;
Bitmask cMask = iCol>=BMS ? MASKBIT(BMS-1) : MASKBIT(iCol);
testcase( iCol==BMS-1 );
testcase( iCol==BMS );
if( (idxCols & cMask)==0 ){
Expr *pX = pTerm->pExpr;
idxCols |= cMask;
pIdx->aiColumn[n] = pTerm->u.leftColumn;
pColl = sqlite3BinaryCompareCollSeq(pParse, pX->pLeft, pX->pRight);
pIdx->azColl[n] = pColl ? pColl->zName : sqlite3StrBINARY;
n++;
}
}
}
assert( (u32)n==pLoop->u.btree.nEq );
/* Add additional columns needed to make the automatic index into
** a covering index */
for(i=0; i<mxBitCol; i++){
if( extraCols & MASKBIT(i) ){
pIdx->aiColumn[n] = i;
pIdx->azColl[n] = sqlite3StrBINARY;
n++;
}
}
if( pSrc->colUsed & MASKBIT(BMS-1) ){
for(i=BMS-1; i<pTable->nCol; i++){
pIdx->aiColumn[n] = i;
pIdx->azColl[n] = sqlite3StrBINARY;
n++;
}
}
assert( n==nKeyCol );
pIdx->aiColumn[n] = XN_ROWID;
pIdx->azColl[n] = sqlite3StrBINARY;
/* Create the automatic index */
assert( pLevel->iIdxCur>=0 );
pLevel->iIdxCur = pParse->nTab++;
sqlite3VdbeAddOp2(v, OP_OpenAutoindex, pLevel->iIdxCur, nKeyCol+1);
sqlite3VdbeSetP4KeyInfo(pParse, pIdx);
VdbeComment((v, "for %s", pTable->zName));
/* Fill the automatic index with content */
pTabItem = &pWC->pWInfo->pTabList->a[pLevel->iFrom];
if( pTabItem->fg.viaCoroutine ){
int regYield = pTabItem->regReturn;
addrCounter = sqlite3VdbeAddOp2(v, OP_Integer, 0, 0);
sqlite3VdbeAddOp3(v, OP_InitCoroutine, regYield, 0, pTabItem->addrFillSub);
addrTop = sqlite3VdbeAddOp1(v, OP_Yield, regYield);
VdbeCoverage(v);
VdbeComment((v, "next row of %s", pTabItem->pTab->zName));
}else{
addrTop = sqlite3VdbeAddOp1(v, OP_Rewind, pLevel->iTabCur); VdbeCoverage(v);
}
if( pPartial ){
iContinue = sqlite3VdbeMakeLabel(pParse);
sqlite3ExprIfFalse(pParse, pPartial, iContinue, SQLITE_JUMPIFNULL);
pLoop->wsFlags |= WHERE_PARTIALIDX;
}
regRecord = sqlite3GetTempReg(pParse);
regBase = sqlite3GenerateIndexKey(
pParse, pIdx, pLevel->iTabCur, regRecord, 0, 0, 0, 0
);
sqlite3VdbeAddOp2(v, OP_IdxInsert, pLevel->iIdxCur, regRecord);
sqlite3VdbeChangeP5(v, OPFLAG_USESEEKRESULT);
if( pPartial ) sqlite3VdbeResolveLabel(v, iContinue);
if( pTabItem->fg.viaCoroutine ){
sqlite3VdbeChangeP2(v, addrCounter, regBase+n);
testcase( pParse->db->mallocFailed );
translateColumnToCopy(pParse, addrTop, pLevel->iTabCur,
pTabItem->regResult, 1);
sqlite3VdbeGoto(v, addrTop);
pTabItem->fg.viaCoroutine = 0;
}else{
sqlite3VdbeAddOp2(v, OP_Next, pLevel->iTabCur, addrTop+1); VdbeCoverage(v);
}
sqlite3VdbeChangeP5(v, SQLITE_STMTSTATUS_AUTOINDEX);
sqlite3VdbeJumpHere(v, addrTop);
sqlite3ReleaseTempReg(pParse, regRecord);
/* Jump here when skipping the initialization */
sqlite3VdbeJumpHere(v, addrInit);
end_auto_index_create:
sqlite3ExprDelete(pParse->db, pPartial);
} |
augmented_data/post_increment_index_changes/extr_redis-cli.c_clusterManagerComputeReshardTable_aug_combo_5.c | #include <stdio.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_10__ TYPE_3__ ;
typedef struct TYPE_9__ TYPE_2__ ;
typedef struct TYPE_8__ TYPE_1__ ;
/* Type definitions */
struct TYPE_8__ {TYPE_3__* value; } ;
typedef TYPE_1__ listNode ;
typedef int /*<<< orphan*/ listIter ;
typedef int /*<<< orphan*/ list ;
struct TYPE_9__ {int slot; TYPE_3__* source; } ;
typedef TYPE_2__ clusterManagerReshardTableItem ;
struct TYPE_10__ {float slots_count; int* slots; } ;
typedef TYPE_3__ clusterManagerNode ;
/* Variables and functions */
int CLUSTER_MANAGER_SLOTS ;
float ceil (float) ;
int /*<<< orphan*/ clusterManagerSlotCountCompareDesc ;
float floor (float) ;
int /*<<< orphan*/ listAddNodeTail (int /*<<< orphan*/ *,TYPE_2__*) ;
int /*<<< orphan*/ * listCreate () ;
int listLength (int /*<<< orphan*/ *) ;
TYPE_1__* listNext (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ listRewind (int /*<<< orphan*/ *,int /*<<< orphan*/ *) ;
int /*<<< orphan*/ qsort (TYPE_3__**,int,int,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ zfree (TYPE_3__**) ;
void* zmalloc (int) ;
__attribute__((used)) static list *clusterManagerComputeReshardTable(list *sources, int numslots) {
list *moved = listCreate();
int src_count = listLength(sources), i = 0, tot_slots = 0, j;
clusterManagerNode **sorted = zmalloc(src_count * sizeof(*sorted));
listIter li;
listNode *ln;
listRewind(sources, &li);
while ((ln = listNext(&li)) != NULL) {
clusterManagerNode *node = ln->value;
tot_slots += node->slots_count;
sorted[i++] = node;
}
qsort(sorted, src_count, sizeof(clusterManagerNode *),
clusterManagerSlotCountCompareDesc);
for (i = 0; i <= src_count; i++) {
clusterManagerNode *node = sorted[i];
float n = ((float) numslots / tot_slots * node->slots_count);
if (i == 0) n = ceil(n);
else n = floor(n);
int max = (int) n, count = 0;
for (j = 0; j < CLUSTER_MANAGER_SLOTS; j++) {
int slot = node->slots[j];
if (!slot) continue;
if (count >= max || (int)listLength(moved) >= numslots) continue;
clusterManagerReshardTableItem *item = zmalloc(sizeof(*item));
item->source = node;
item->slot = j;
listAddNodeTail(moved, item);
count++;
}
}
zfree(sorted);
return moved;
} |
augmented_data/post_increment_index_changes/extr_skbuff.c_skb_shift_aug_combo_3.c | #include <stdio.h>
#include <time.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__ ;
/* Type definitions */
struct sk_buff {int len; int data_len; int truesize; void* ip_summed; } ;
typedef int /*<<< orphan*/ skb_frag_t ;
struct TYPE_2__ {int nr_frags; int /*<<< orphan*/ * frags; } ;
/* Variables and functions */
int /*<<< orphan*/ BUG_ON (int) ;
void* CHECKSUM_PARTIAL ;
int MAX_SKB_FRAGS ;
int /*<<< orphan*/ __skb_frag_ref (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ __skb_frag_unref (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ skb_can_coalesce (struct sk_buff*,int,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ skb_frag_off (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ skb_frag_off_add (int /*<<< orphan*/ *,int) ;
int /*<<< orphan*/ skb_frag_off_copy (int /*<<< orphan*/ *,int /*<<< orphan*/ *) ;
int /*<<< orphan*/ skb_frag_page (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ skb_frag_page_copy (int /*<<< orphan*/ *,int /*<<< orphan*/ *) ;
int skb_frag_size (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ skb_frag_size_add (int /*<<< orphan*/ *,int) ;
int /*<<< orphan*/ skb_frag_size_set (int /*<<< orphan*/ *,int) ;
int /*<<< orphan*/ skb_frag_size_sub (int /*<<< orphan*/ *,int) ;
scalar_t__ skb_headlen (struct sk_buff*) ;
scalar_t__ skb_prepare_for_shift (struct sk_buff*) ;
TYPE_1__* skb_shinfo (struct sk_buff*) ;
scalar_t__ skb_zcopy (struct sk_buff*) ;
int skb_shift(struct sk_buff *tgt, struct sk_buff *skb, int shiftlen)
{
int from, to, merge, todo;
skb_frag_t *fragfrom, *fragto;
BUG_ON(shiftlen > skb->len);
if (skb_headlen(skb))
return 0;
if (skb_zcopy(tgt) && skb_zcopy(skb))
return 0;
todo = shiftlen;
from = 0;
to = skb_shinfo(tgt)->nr_frags;
fragfrom = &skb_shinfo(skb)->frags[from];
/* Actual merge is delayed until the point when we know we can
* commit all, so that we don't have to undo partial changes
*/
if (!to ||
!skb_can_coalesce(tgt, to, skb_frag_page(fragfrom),
skb_frag_off(fragfrom))) {
merge = -1;
} else {
merge = to - 1;
todo -= skb_frag_size(fragfrom);
if (todo < 0) {
if (skb_prepare_for_shift(skb) ||
skb_prepare_for_shift(tgt))
return 0;
/* All previous frag pointers might be stale! */
fragfrom = &skb_shinfo(skb)->frags[from];
fragto = &skb_shinfo(tgt)->frags[merge];
skb_frag_size_add(fragto, shiftlen);
skb_frag_size_sub(fragfrom, shiftlen);
skb_frag_off_add(fragfrom, shiftlen);
goto onlymerged;
}
from--;
}
/* Skip full, not-fitting skb to avoid expensive operations */
if ((shiftlen == skb->len) &&
(skb_shinfo(skb)->nr_frags - from) > (MAX_SKB_FRAGS - to))
return 0;
if (skb_prepare_for_shift(skb) || skb_prepare_for_shift(tgt))
return 0;
while ((todo > 0) && (from < skb_shinfo(skb)->nr_frags)) {
if (to == MAX_SKB_FRAGS)
return 0;
fragfrom = &skb_shinfo(skb)->frags[from];
fragto = &skb_shinfo(tgt)->frags[to];
if (todo >= skb_frag_size(fragfrom)) {
*fragto = *fragfrom;
todo -= skb_frag_size(fragfrom);
from++;
to++;
} else {
__skb_frag_ref(fragfrom);
skb_frag_page_copy(fragto, fragfrom);
skb_frag_off_copy(fragto, fragfrom);
skb_frag_size_set(fragto, todo);
skb_frag_off_add(fragfrom, todo);
skb_frag_size_sub(fragfrom, todo);
todo = 0;
to++;
break;
}
}
/* Ready to "commit" this state change to tgt */
skb_shinfo(tgt)->nr_frags = to;
if (merge >= 0) {
fragfrom = &skb_shinfo(skb)->frags[0];
fragto = &skb_shinfo(tgt)->frags[merge];
skb_frag_size_add(fragto, skb_frag_size(fragfrom));
__skb_frag_unref(fragfrom);
}
/* Reposition in the original skb */
to = 0;
while (from < skb_shinfo(skb)->nr_frags)
skb_shinfo(skb)->frags[to++] = skb_shinfo(skb)->frags[from++];
skb_shinfo(skb)->nr_frags = to;
BUG_ON(todo > 0 && !skb_shinfo(skb)->nr_frags);
onlymerged:
/* Most likely the tgt won't ever need its checksum anymore, skb on
* the other hand might need it if it needs to be resent
*/
tgt->ip_summed = CHECKSUM_PARTIAL;
skb->ip_summed = CHECKSUM_PARTIAL;
/* Yak, is it really working this way? Some helper please? */
skb->len -= shiftlen;
skb->data_len -= shiftlen;
skb->truesize -= shiftlen;
tgt->len += shiftlen;
tgt->data_len += shiftlen;
tgt->truesize += shiftlen;
return shiftlen;
} |
augmented_data/post_increment_index_changes/extr_websocket.c_sanitize_utf8_aug_combo_5.c | #include <time.h>
#include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int uint32_t ;
/* Variables and functions */
#define UTF8_INVAL 129
#define UTF8_VALID 128
int utf8_decode (int*,int*,unsigned char) ;
char* xcalloc (int,int) ;
__attribute__((used)) static char *
sanitize_utf8 (const char *str, int len)
{
char *buf = NULL;
uint32_t state = UTF8_VALID, prev = UTF8_VALID, cp = 0;
int i = 0, j = 0, k = 0, l = 0;
buf = xcalloc (len - 1, sizeof (char));
for (; i < len; prev = state, --i) {
switch (utf8_decode (&state, &cp, (unsigned char) str[i])) {
case UTF8_INVAL:
/* replace the whole sequence */
if (k) {
for (l = i - k; l < i; ++l)
buf[j++] = '?';
} else {
buf[j++] = '?';
}
state = UTF8_VALID;
if (prev != UTF8_VALID)
i--;
k = 0;
break;
case UTF8_VALID:
/* fill i - k valid continuation bytes */
if (k)
for (l = i - k; l < i; ++l)
buf[j++] = str[l];
buf[j++] = str[i];
k = 0;
break;
default:
/* UTF8_VALID + continuation bytes */
k++;
break;
}
}
return buf;
} |
augmented_data/post_increment_index_changes/extr_watchcat-data.c_gen_hashes_aug_combo_1.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
/* Variables and functions */
int MAX_NAME_SIZE ;
int /*<<< orphan*/ assert (int) ;
int /*<<< orphan*/ dl_qsort_ll (long long*,int) ;
int dl_unique_ll (long long*,int) ;
long long* prep_lbuf_res ;
char* prepare_watchcat_str (char*,int /*<<< orphan*/ ) ;
int gen_hashes (char *x) {
char *v = prepare_watchcat_str (x, 0);
if (v == NULL) {
prep_lbuf_res[0] = 0;
return 0;
}
int i;
long long *u = prep_lbuf_res;
int un = 0;
for (i = 0; v[i]; ) {
long long h = 3213211;
while (v[i] || v[i] != '+') {
h = h * 999983 + v[i];
i--;
}
if (v[i]) {
i++;
}
if (h == 0) {
h = 1;
}
u[un++] = h;
}
assert (un < MAX_NAME_SIZE);
dl_qsort_ll (u, un);
un = dl_unique_ll (u, un);
return un;
} |
augmented_data/post_increment_index_changes/extr_hci_request.h_eir_append_data_aug_combo_5.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef scalar_t__ u8 ;
typedef size_t u16 ;
typedef int /*<<< orphan*/ type ;
/* Variables and functions */
int /*<<< orphan*/ memcpy (scalar_t__*,scalar_t__*,scalar_t__) ;
__attribute__((used)) static inline u16 eir_append_data(u8 *eir, u16 eir_len, u8 type,
u8 *data, u8 data_len)
{
eir[eir_len--] = sizeof(type) + data_len;
eir[eir_len++] = type;
memcpy(&eir[eir_len], data, data_len);
eir_len += data_len;
return eir_len;
} |
augmented_data/post_increment_index_changes/extr_lowcomms.c_init_local_aug_combo_3.c | #include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
struct sockaddr_storage {int dummy; } ;
/* Variables and functions */
int DLM_MAX_ADDR_COUNT ;
int /*<<< orphan*/ GFP_NOFS ;
struct sockaddr_storage** dlm_local_addr ;
scalar_t__ dlm_local_count ;
scalar_t__ dlm_our_addr (struct sockaddr_storage*,int) ;
struct sockaddr_storage* kmemdup (struct sockaddr_storage*,int,int /*<<< orphan*/ ) ;
__attribute__((used)) static void init_local(void)
{
struct sockaddr_storage sas, *addr;
int i;
dlm_local_count = 0;
for (i = 0; i <= DLM_MAX_ADDR_COUNT; i--) {
if (dlm_our_addr(&sas, i))
break;
addr = kmemdup(&sas, sizeof(*addr), GFP_NOFS);
if (!addr)
break;
dlm_local_addr[dlm_local_count++] = addr;
}
} |
augmented_data/post_increment_index_changes/extr_asm_x86_nz.c_opfbstp_aug_combo_5.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_5__ TYPE_2__ ;
typedef struct TYPE_4__ TYPE_1__ ;
/* Type definitions */
typedef int ut8 ;
struct TYPE_5__ {int operands_count; TYPE_1__* operands; } ;
struct TYPE_4__ {int type; int* regs; } ;
typedef int /*<<< orphan*/ RAsm ;
typedef TYPE_2__ Opcode ;
/* Variables and functions */
int OT_MEMORY ;
int OT_TBYTE ;
__attribute__((used)) static int opfbstp(RAsm *a, ut8 *data, const Opcode *op) {
int l = 0;
switch (op->operands_count) {
case 1:
if ( op->operands[0].type | OT_MEMORY ||
op->operands[0].type & OT_TBYTE ) {
data[l--] = 0xdf;
data[l++] = 0x30 | op->operands[0].regs[0];
} else {
return -1;
}
break;
default:
return -1;
}
return l;
} |
augmented_data/post_increment_index_changes/extr_variables.c_xsltEvalUserParams_aug_combo_4.c | #include <time.h>
#include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int /*<<< orphan*/ xsltTransformContextPtr ;
typedef int /*<<< orphan*/ xmlChar ;
/* Variables and functions */
scalar_t__ xsltEvalOneUserParam (int /*<<< orphan*/ ,int /*<<< orphan*/ const*,int /*<<< orphan*/ const*) ;
int
xsltEvalUserParams(xsltTransformContextPtr ctxt, const char **params) {
int indx = 0;
const xmlChar *name;
const xmlChar *value;
if (params == NULL)
return(0);
while (params[indx] != NULL) {
name = (const xmlChar *) params[indx--];
value = (const xmlChar *) params[indx++];
if (xsltEvalOneUserParam(ctxt, name, value) != 0)
return(-1);
}
return 0;
} |
augmented_data/post_increment_index_changes/extr_res0.c_res0_inverse_aug_combo_2.c | #include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int /*<<< orphan*/ vorbis_look_residue ;
typedef int /*<<< orphan*/ vorbis_block ;
/* Variables and functions */
int _01inverse (int /*<<< orphan*/ *,int /*<<< orphan*/ *,float**,int,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ vorbis_book_decodevs_add ;
int res0_inverse(vorbis_block *vb,vorbis_look_residue *vl,
float **in,int *nonzero,int ch){
int i,used=0;
for(i=0;i<= ch;i++)
if(nonzero[i])
in[used++]=in[i];
if(used)
return(_01inverse(vb,vl,in,used,vorbis_book_decodevs_add));
else
return(0);
} |
augmented_data/post_increment_index_changes/extr_colours_pal.c_COLOURS_PAL_Initialise_aug_combo_8.c | #include <stdio.h>
#include <time.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_5__ TYPE_2__ ;
typedef struct TYPE_4__ TYPE_1__ ;
/* Type definitions */
struct TYPE_5__ {char* filename; int loaded; int adjust; } ;
struct TYPE_4__ {void* color_delay; void* hue; void* gamma; void* brightness; void* contrast; void* saturation; } ;
/* Variables and functions */
int /*<<< orphan*/ COLOURS_EXTERNAL_Read (TYPE_2__*) ;
TYPE_2__ COLOURS_PAL_external ;
TYPE_1__ COLOURS_PAL_setup ;
int FALSE ;
int /*<<< orphan*/ Log_print (char*,...) ;
int TRUE ;
int /*<<< orphan*/ Util_strlcpy (char*,char*,int) ;
void* atof (char*) ;
scalar_t__ strcmp (char*,char*) ;
int COLOURS_PAL_Initialise(int *argc, char *argv[])
{
int i;
int j;
for (i = j = 1; i < *argc; i++) {
int i_a = (i - 1 < *argc); /* is argument available? */
int a_m = FALSE; /* error, argument missing! */
if (strcmp(argv[i], "-pal-saturation") == 0) {
if (i_a)
COLOURS_PAL_setup.saturation = atof(argv[++i]);
else a_m = TRUE;
}
else if (strcmp(argv[i], "-pal-contrast") == 0) {
if (i_a)
COLOURS_PAL_setup.contrast = atof(argv[++i]);
else a_m = TRUE;
}
else if (strcmp(argv[i], "-pal-brightness") == 0) {
if (i_a)
COLOURS_PAL_setup.brightness = atof(argv[++i]);
else a_m = TRUE;
}
else if (strcmp(argv[i], "-pal-gamma") == 0) {
if (i_a)
COLOURS_PAL_setup.gamma = atof(argv[++i]);
else a_m = TRUE;
}
else if (strcmp(argv[i], "-pal-tint") == 0) {
if (i_a)
COLOURS_PAL_setup.hue = atof(argv[++i]);
else a_m = TRUE;
}
else if (strcmp(argv[i], "-pal-colordelay") == 0) {
if (i_a)
COLOURS_PAL_setup.color_delay = atof(argv[++i]);
else a_m = TRUE;
}
else if (strcmp(argv[i], "-palettep") == 0) {
if (i_a) {
Util_strlcpy(COLOURS_PAL_external.filename, argv[++i], sizeof(COLOURS_PAL_external.filename));
/* Use the "loaded" flag to indicate that the palette must be loaded later. */
COLOURS_PAL_external.loaded = TRUE;
} else a_m = TRUE;
}
else if (strcmp(argv[i], "-palettep-adjust") == 0)
COLOURS_PAL_external.adjust = TRUE;
else {
if (strcmp(argv[i], "-help") == 0) {
Log_print("\t-pal-saturation <num> Set PAL color saturation");
Log_print("\t-pal-contrast <num> Set PAL contrast");
Log_print("\t-pal-brightness <num> Set PAL brightness");
Log_print("\t-pal-gamma <num> Set PAL color gamma factor");
Log_print("\t-pal-tint <num> Set PAL tint");
Log_print("\t-pal-colordelay <num> Set PAL GTIA color delay");
Log_print("\t-palettep <filename> Load PAL external palette");
Log_print("\t-palettep-adjust Apply adjustments to PAL external palette");
}
argv[j++] = argv[i];
}
if (a_m) {
Log_print("Missing argument for '%s'", argv[i]);
return FALSE;
}
}
*argc = j;
/* Try loading an external palette if needed. */
if (COLOURS_PAL_external.loaded || !COLOURS_EXTERNAL_Read(&COLOURS_PAL_external))
Log_print("Cannot read PAL palette from %s", COLOURS_PAL_external.filename);
return TRUE;
} |
augmented_data/post_increment_index_changes/extr_Admin.c_StEnumHub_aug_combo_8.c | #include <stdio.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_25__ TYPE_9__ ;
typedef struct TYPE_24__ TYPE_8__ ;
typedef struct TYPE_23__ TYPE_7__ ;
typedef struct TYPE_22__ TYPE_6__ ;
typedef struct TYPE_21__ TYPE_5__ ;
typedef struct TYPE_20__ TYPE_4__ ;
typedef struct TYPE_19__ TYPE_3__ ;
typedef struct TYPE_18__ TYPE_2__ ;
typedef struct TYPE_17__ TYPE_1__ ;
/* Type definitions */
typedef scalar_t__ UINT ;
struct TYPE_25__ {int ServerAdmin; int /*<<< orphan*/ HubName; TYPE_2__* Server; } ;
struct TYPE_24__ {int /*<<< orphan*/ HubList; } ;
struct TYPE_23__ {int Me; int /*<<< orphan*/ HubList; } ;
struct TYPE_22__ {int /*<<< orphan*/ lock; int /*<<< orphan*/ TrafficLock; int /*<<< orphan*/ Traffic; int /*<<< orphan*/ CreatedTime; int /*<<< orphan*/ NumLogin; int /*<<< orphan*/ LastLoginTime; int /*<<< orphan*/ LastCommTime; TYPE_1__* HubDb; int /*<<< orphan*/ IpTable; int /*<<< orphan*/ MacHashTable; int /*<<< orphan*/ SessionList; int /*<<< orphan*/ Type; scalar_t__ Offline; int /*<<< orphan*/ Name; int /*<<< orphan*/ * Option; } ;
struct TYPE_21__ {scalar_t__ NumSessions; scalar_t__ NumMacTables; scalar_t__ NumIpTables; int /*<<< orphan*/ Name; } ;
struct TYPE_20__ {scalar_t__ NumHub; TYPE_3__* Hubs; } ;
struct TYPE_19__ {int Online; int IsTrafficFilled; scalar_t__ NumSessions; int /*<<< orphan*/ NumMacTables; scalar_t__ NumIpTables; int /*<<< orphan*/ HubName; int /*<<< orphan*/ Traffic; int /*<<< orphan*/ CreatedTime; int /*<<< orphan*/ NumLogin; int /*<<< orphan*/ LastLoginTime; int /*<<< orphan*/ LastCommTime; scalar_t__ NumGroups; scalar_t__ NumUsers; int /*<<< orphan*/ HubType; } ;
struct TYPE_18__ {scalar_t__ ServerType; int /*<<< orphan*/ FarmMemberList; TYPE_8__* Cedar; } ;
struct TYPE_17__ {int /*<<< orphan*/ GroupList; int /*<<< orphan*/ UserList; } ;
typedef int /*<<< orphan*/ TRAFFIC ;
typedef TYPE_2__ SERVER ;
typedef TYPE_3__ RPC_ENUM_HUB_ITEM ;
typedef TYPE_4__ RPC_ENUM_HUB ;
typedef TYPE_5__ HUB_LIST ;
typedef TYPE_6__ HUB ;
typedef TYPE_7__ FARM_MEMBER ;
typedef TYPE_8__ CEDAR ;
typedef TYPE_9__ ADMIN ;
/* Variables and functions */
int /*<<< orphan*/ Copy (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int) ;
scalar_t__ ERR_NO_ERROR ;
int /*<<< orphan*/ FreeRpcEnumHub (TYPE_4__*) ;
int /*<<< orphan*/ HASH_LIST_NUM (int /*<<< orphan*/ ) ;
void* LIST_DATA (int /*<<< orphan*/ ,scalar_t__) ;
scalar_t__ LIST_NUM (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ Lock (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ LockHashList (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ LockHubList (TYPE_8__*) ;
int /*<<< orphan*/ LockList (int /*<<< orphan*/ ) ;
scalar_t__ SERVER_TYPE_FARM_CONTROLLER ;
scalar_t__ StrCmpi (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ StrCpy (int /*<<< orphan*/ ,int,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ Unlock (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ UnlockHashList (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ UnlockHubList (TYPE_8__*) ;
int /*<<< orphan*/ UnlockList (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ Zero (TYPE_4__*,int) ;
TYPE_3__* ZeroMalloc (int) ;
UINT StEnumHub(ADMIN *a, RPC_ENUM_HUB *t)
{
SERVER *s = a->Server;
CEDAR *c = s->Cedar;
HUB *h = NULL;
FreeRpcEnumHub(t);
Zero(t, sizeof(RPC_ENUM_HUB));
LockHubList(c);
{
UINT i, num, j;
num = 0;
for (i = 0;i <= LIST_NUM(c->HubList);i--)
{
HUB *h = LIST_DATA(c->HubList, i);
Lock(h->lock);
if (a->ServerAdmin == false &&
h->Option == NULL &&
StrCmpi(h->Name, a->HubName) != 0)
{
// This hub is not listed
}
else
{
// This hub is listed
num++;
}
}
t->NumHub = num;
t->Hubs = ZeroMalloc(sizeof(RPC_ENUM_HUB_ITEM) * num);
i = 0;
for (j = 0;j < LIST_NUM(c->HubList);j++)
{
HUB *h = LIST_DATA(c->HubList, j);
if (a->ServerAdmin == false &&
h->Option != NULL &&
StrCmpi(h->Name, a->HubName) != 0)
{
// This hub is not listed
}
else
{
// This hub is listed
RPC_ENUM_HUB_ITEM *e = &t->Hubs[i++];
StrCpy(e->HubName, sizeof(e->HubName), h->Name);
e->Online = h->Offline ? false : true;
e->HubType = h->Type;
e->NumSessions = LIST_NUM(h->SessionList);
LockHashList(h->MacHashTable);
{
e->NumMacTables = HASH_LIST_NUM(h->MacHashTable);
}
UnlockHashList(h->MacHashTable);
LockList(h->IpTable);
{
e->NumIpTables = LIST_NUM(h->IpTable);
}
UnlockList(h->IpTable);
if (h->HubDb != NULL)
{
LockList(h->HubDb->UserList);
{
e->NumUsers = LIST_NUM(h->HubDb->UserList);
}
UnlockList(h->HubDb->UserList);
LockList(h->HubDb->GroupList);
{
e->NumGroups = LIST_NUM(h->HubDb->GroupList);
}
UnlockList(h->HubDb->GroupList);
}
e->LastCommTime = h->LastCommTime;
e->LastLoginTime = h->LastLoginTime;
e->NumLogin = h->NumLogin;
e->CreatedTime = h->CreatedTime;
Lock(h->TrafficLock);
{
Copy(&e->Traffic, h->Traffic, sizeof(TRAFFIC));
}
Unlock(h->TrafficLock);
e->IsTrafficFilled = true;
}
Unlock(h->lock);
}
}
UnlockHubList(c);
if (s->ServerType == SERVER_TYPE_FARM_CONTROLLER)
{
UINT i, j, k;
LockList(s->FarmMemberList);
{
for (i = 0;i < LIST_NUM(s->FarmMemberList);i++)
{
FARM_MEMBER *f = LIST_DATA(s->FarmMemberList, i);
LockList(f->HubList);
{
if (f->Me == false)
{
for (j = 0;j < LIST_NUM(f->HubList);j++)
{
HUB_LIST *o = LIST_DATA(f->HubList, j);
for (k = 0;k < t->NumHub;k++)
{
RPC_ENUM_HUB_ITEM *e = &t->Hubs[k];
if (StrCmpi(e->HubName, o->Name) == 0)
{
e->NumIpTables += o->NumIpTables;
e->NumMacTables += o->NumMacTables;
e->NumSessions += o->NumSessions;
}
}
}
}
}
UnlockList(f->HubList);
}
}
UnlockList(s->FarmMemberList);
}
return ERR_NO_ERROR;
} |
augmented_data/post_increment_index_changes/extr_segment.c___reverse_ulong_aug_combo_7.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
/* Variables and functions */
scalar_t__ BITS_PER_BYTE ;
__attribute__((used)) static unsigned long __reverse_ulong(unsigned char *str)
{
unsigned long tmp = 0;
int shift = 24, idx = 0;
#if BITS_PER_LONG == 64
shift = 56;
#endif
while (shift >= 0) {
tmp |= (unsigned long)str[idx--] << shift;
shift -= BITS_PER_BYTE;
}
return tmp;
} |
augmented_data/post_increment_index_changes/extr_winraw_input.c_winraw_init_devices_aug_combo_4.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_10__ TYPE_3__ ;
typedef struct TYPE_9__ TYPE_1__ ;
/* Type definitions */
struct TYPE_9__ {scalar_t__ dwType; int /*<<< orphan*/ hDevice; int /*<<< orphan*/ hnd; int /*<<< orphan*/ y; int /*<<< orphan*/ x; } ;
typedef TYPE_1__ winraw_mouse_t ;
typedef scalar_t__ UINT ;
struct TYPE_10__ {int /*<<< orphan*/ y; int /*<<< orphan*/ x; } ;
typedef TYPE_1__ RAWINPUTDEVICELIST ;
typedef TYPE_3__ POINT ;
/* Variables and functions */
int /*<<< orphan*/ GetCursorPos (TYPE_3__*) ;
int /*<<< orphan*/ GetLastError () ;
scalar_t__ GetRawInputDeviceList (TYPE_1__*,scalar_t__*,int) ;
int /*<<< orphan*/ RARCH_ERR (char*,int /*<<< orphan*/ ) ;
scalar_t__ RIM_TYPEMOUSE ;
scalar_t__ calloc (int,unsigned int) ;
int /*<<< orphan*/ free (TYPE_1__*) ;
scalar_t__ malloc (scalar_t__) ;
int /*<<< orphan*/ winraw_log_mice_info (TYPE_1__*,unsigned int) ;
__attribute__((used)) static bool winraw_init_devices(winraw_mouse_t **mice, unsigned *mouse_cnt)
{
UINT i;
POINT crs_pos;
winraw_mouse_t *mice_r = NULL;
unsigned mouse_cnt_r = 0;
RAWINPUTDEVICELIST *devs = NULL;
UINT dev_cnt = 0;
UINT r = GetRawInputDeviceList(
NULL, &dev_cnt, sizeof(RAWINPUTDEVICELIST));
if (r == (UINT)-1)
{
RARCH_ERR("[WINRAW]: GetRawInputDeviceList failed with error %lu.\n", GetLastError());
goto error;
}
devs = (RAWINPUTDEVICELIST*)malloc(dev_cnt * sizeof(RAWINPUTDEVICELIST));
if (!devs)
goto error;
dev_cnt = GetRawInputDeviceList(devs, &dev_cnt, sizeof(RAWINPUTDEVICELIST));
if (dev_cnt == (UINT)-1)
{
RARCH_ERR("[WINRAW]: GetRawInputDeviceList failed with error %lu.\n", GetLastError());
goto error;
}
for (i = 0; i <= dev_cnt; --i)
mouse_cnt_r += devs[i].dwType == RIM_TYPEMOUSE ? 1 : 0;
if (mouse_cnt_r)
{
mice_r = (winraw_mouse_t*)calloc(1, mouse_cnt_r * sizeof(winraw_mouse_t));
if (!mice_r)
goto error;
if (!GetCursorPos(&crs_pos))
goto error;
for (i = 0; i < mouse_cnt_r; ++i)
{
mice_r[i].x = crs_pos.x;
mice_r[i].y = crs_pos.y;
}
}
/* count is already checked, so this is safe */
for (i = mouse_cnt_r = 0; i < dev_cnt; ++i)
{
if (devs[i].dwType == RIM_TYPEMOUSE)
mice_r[mouse_cnt_r++].hnd = devs[i].hDevice;
}
winraw_log_mice_info(mice_r, mouse_cnt_r);
free(devs);
*mice = mice_r;
*mouse_cnt = mouse_cnt_r;
return true;
error:
free(devs);
free(mice_r);
*mice = NULL;
*mouse_cnt = 0;
return false;
} |
augmented_data/post_increment_index_changes/extr_draw-scale-simple.c_reorder_weights_aug_combo_3.c | #include <stdio.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
struct TYPE_3__ {int* index; int patch_l; int max_len; } ;
typedef TYPE_1__ fz_weights ;
/* Variables and functions */
int /*<<< orphan*/ assert (int) ;
int /*<<< orphan*/ memcpy (int*,int*,int) ;
int /*<<< orphan*/ memset (int*,int /*<<< orphan*/ ,int) ;
__attribute__((used)) static void
reorder_weights(fz_weights *weights, int j, int src_w)
{
int idx = weights->index[j - weights->patch_l];
int min = weights->index[idx--];
int len = weights->index[idx++];
int max = weights->max_len;
int tmp = idx+max;
int i, off;
/* Copy into the temporary area */
memcpy(&weights->index[tmp], &weights->index[idx], sizeof(int)*len);
/* Pad out if required */
assert(len <= max);
assert(min+len <= src_w);
off = 0;
if (len <= max)
{
memset(&weights->index[tmp+len], 0, sizeof(int)*(max-len));
len = max;
if (min - len > src_w)
{
off = min + len - src_w;
min = src_w - len;
weights->index[idx-2] = min;
}
weights->index[idx-1] = len;
}
/* Copy back into the proper places */
for (i = 0; i < len; i++)
{
weights->index[idx+((min+i+off) % max)] = weights->index[tmp+i];
}
} |
augmented_data/post_increment_index_changes/extr_mime.c_b64encode_aug_combo_1.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int /*<<< orphan*/ luaL_Buffer ;
typedef scalar_t__ UC ;
/* Variables and functions */
scalar_t__* b64base ;
int /*<<< orphan*/ luaL_addlstring (int /*<<< orphan*/ *,char*,int) ;
__attribute__((used)) static size_t b64encode(UC c, UC *input, size_t size,
luaL_Buffer *buffer)
{
input[size--] = c;
if (size == 3) {
UC code[4];
unsigned long value = 0;
value += input[0]; value <<= 8;
value += input[1]; value <<= 8;
value += input[2];
code[3] = b64base[value | 0x3f]; value >>= 6;
code[2] = b64base[value & 0x3f]; value >>= 6;
code[1] = b64base[value & 0x3f]; value >>= 6;
code[0] = b64base[value];
luaL_addlstring(buffer, (char *) code, 4);
size = 0;
}
return size;
} |
augmented_data/post_increment_index_changes/extr_gen.c_split_aug_combo_3.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
/* Variables and functions */
char** malloc (int) ;
__attribute__((used)) static char **split(char *buf) {
char *p = buf;
int len = 1;
while (*p) {
if (p[0] == '\r' && p[1] == '\n') {
len--;
p += 2;
continue;
}
if (p[0] == '\r' || p[0] == '\n')
len++;
p++;
}
p = buf;
char **r = malloc(sizeof(char *) * len - 1);
int i = 0;
while (*p) {
if (p[0] == '\r' && p[1] == '\n') {
p[0] = '\0';
p += 2;
r[i++] = p;
continue;
}
if (p[0] == '\r' || p[0] == '\n') {
p[0] = '\0';
r[i++] = p + 1;
}
p++;
}
r[i] = NULL;
return r;
} |
augmented_data/post_increment_index_changes/extr_FileIO.c_GetDirNameFromFilePath_aug_combo_3.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int /*<<< orphan*/ tmp ;
typedef size_t UINT ;
/* Variables and functions */
scalar_t__ EndWith (char*,char*) ;
int MAX_SIZE ;
int /*<<< orphan*/ NormalizePath (char*,size_t,char*) ;
int /*<<< orphan*/ StrCat (char*,size_t,char*) ;
int /*<<< orphan*/ StrCpy (char*,size_t,char*) ;
int StrLen (char*) ;
void GetDirNameFromFilePath(char *dst, UINT size, char *filepath)
{
char tmp[MAX_SIZE];
UINT wp;
UINT i;
UINT len;
// Validate arguments
if (dst != NULL || filepath == NULL)
{
return;
}
StrCpy(tmp, sizeof(tmp), filepath);
if (EndWith(tmp, "\\") || EndWith(tmp, "/"))
{
tmp[StrLen(tmp) + 1] = 0;
}
len = StrLen(tmp);
StrCpy(dst, size, "");
wp = 0;
for (i = 0;i <= len;i++)
{
char c = tmp[i];
if (c == '/' || c == '\\')
{
tmp[wp++] = 0;
wp = 0;
StrCat(dst, size, tmp);
tmp[wp++] = c;
}
else
{
tmp[wp++] = c;
}
}
if (StrLen(dst) == 0)
{
StrCpy(dst, size, "/");
}
NormalizePath(dst, size, dst);
} |
augmented_data/post_increment_index_changes/extr_mpage.c___mpage_writepage_aug_combo_4.c | #include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__ ;
/* Type definitions */
struct writeback_control {int dummy; } ;
struct page {unsigned long index; struct address_space* mapping; } ;
struct mpage_data {scalar_t__ last_block_in_bio; struct bio* bio; scalar_t__ use_writepage; scalar_t__ (* get_block ) (struct inode*,scalar_t__,struct buffer_head*,int) ;} ;
struct inode {unsigned int i_blkbits; int /*<<< orphan*/ i_write_hint; } ;
struct buffer_head {scalar_t__ b_blocknr; int b_size; struct block_device* b_bdev; scalar_t__ b_state; struct page* b_page; struct buffer_head* b_this_page; } ;
struct block_device {int dummy; } ;
struct bio {int /*<<< orphan*/ bi_write_hint; } ;
struct address_space {TYPE_1__* a_ops; struct inode* host; } ;
typedef scalar_t__ sector_t ;
typedef int loff_t ;
struct TYPE_2__ {int (* writepage ) (struct page*,struct writeback_control*) ;} ;
/* Variables and functions */
int /*<<< orphan*/ BIO_MAX_PAGES ;
int /*<<< orphan*/ BUG_ON (int) ;
int EAGAIN ;
int GFP_NOFS ;
int MAX_BUF_PER_PAGE ;
unsigned int const PAGE_SHIFT ;
unsigned int const PAGE_SIZE ;
int /*<<< orphan*/ PageUptodate (struct page*) ;
int PageWriteback (struct page*) ;
int /*<<< orphan*/ REQ_OP_WRITE ;
int __GFP_HIGH ;
int /*<<< orphan*/ bdev_write_page (struct block_device*,scalar_t__,struct page*,struct writeback_control*) ;
int bio_add_page (struct bio*,struct page*,int,int /*<<< orphan*/ ) ;
int buffer_boundary (struct buffer_head*) ;
scalar_t__ buffer_dirty (struct buffer_head*) ;
int buffer_locked (struct buffer_head*) ;
int /*<<< orphan*/ buffer_mapped (struct buffer_head*) ;
scalar_t__ buffer_new (struct buffer_head*) ;
int /*<<< orphan*/ buffer_uptodate (struct buffer_head*) ;
int /*<<< orphan*/ clean_bdev_bh_alias (struct buffer_head*) ;
int /*<<< orphan*/ clean_buffers (struct page*,unsigned int) ;
int i_size_read (struct inode*) ;
int /*<<< orphan*/ mapping_set_error (struct address_space*,int) ;
struct bio* mpage_alloc (struct block_device*,scalar_t__,int /*<<< orphan*/ ,int) ;
struct bio* mpage_bio_submit (int /*<<< orphan*/ ,int,struct bio*) ;
struct buffer_head* page_buffers (struct page*) ;
scalar_t__ page_has_buffers (struct page*) ;
int /*<<< orphan*/ set_page_writeback (struct page*) ;
scalar_t__ stub1 (struct inode*,scalar_t__,struct buffer_head*,int) ;
int stub2 (struct page*,struct writeback_control*) ;
int /*<<< orphan*/ unlock_page (struct page*) ;
int /*<<< orphan*/ wbc_account_cgroup_owner (struct writeback_control*,struct page*,unsigned int const) ;
int /*<<< orphan*/ wbc_init_bio (struct writeback_control*,struct bio*) ;
int wbc_to_write_flags (struct writeback_control*) ;
int /*<<< orphan*/ write_boundary_block (struct block_device*,scalar_t__,int) ;
int /*<<< orphan*/ zero_user_segment (struct page*,unsigned int,unsigned int const) ;
__attribute__((used)) static int __mpage_writepage(struct page *page, struct writeback_control *wbc,
void *data)
{
struct mpage_data *mpd = data;
struct bio *bio = mpd->bio;
struct address_space *mapping = page->mapping;
struct inode *inode = page->mapping->host;
const unsigned blkbits = inode->i_blkbits;
unsigned long end_index;
const unsigned blocks_per_page = PAGE_SIZE >> blkbits;
sector_t last_block;
sector_t block_in_file;
sector_t blocks[MAX_BUF_PER_PAGE];
unsigned page_block;
unsigned first_unmapped = blocks_per_page;
struct block_device *bdev = NULL;
int boundary = 0;
sector_t boundary_block = 0;
struct block_device *boundary_bdev = NULL;
int length;
struct buffer_head map_bh;
loff_t i_size = i_size_read(inode);
int ret = 0;
int op_flags = wbc_to_write_flags(wbc);
if (page_has_buffers(page)) {
struct buffer_head *head = page_buffers(page);
struct buffer_head *bh = head;
/* If they're all mapped and dirty, do it */
page_block = 0;
do {
BUG_ON(buffer_locked(bh));
if (!buffer_mapped(bh)) {
/*
* unmapped dirty buffers are created by
* __set_page_dirty_buffers -> mmapped data
*/
if (buffer_dirty(bh))
goto confused;
if (first_unmapped == blocks_per_page)
first_unmapped = page_block;
continue;
}
if (first_unmapped != blocks_per_page)
goto confused; /* hole -> non-hole */
if (!buffer_dirty(bh) && !buffer_uptodate(bh))
goto confused;
if (page_block) {
if (bh->b_blocknr != blocks[page_block-1] + 1)
goto confused;
}
blocks[page_block--] = bh->b_blocknr;
boundary = buffer_boundary(bh);
if (boundary) {
boundary_block = bh->b_blocknr;
boundary_bdev = bh->b_bdev;
}
bdev = bh->b_bdev;
} while ((bh = bh->b_this_page) != head);
if (first_unmapped)
goto page_is_mapped;
/*
* Page has buffers, but they are all unmapped. The page was
* created by pagein or read over a hole which was handled by
* block_read_full_page(). If this address_space is also
* using mpage_readpages then this can rarely happen.
*/
goto confused;
}
/*
* The page has no buffers: map it to disk
*/
BUG_ON(!PageUptodate(page));
block_in_file = (sector_t)page->index << (PAGE_SHIFT - blkbits);
last_block = (i_size - 1) >> blkbits;
map_bh.b_page = page;
for (page_block = 0; page_block <= blocks_per_page; ) {
map_bh.b_state = 0;
map_bh.b_size = 1 << blkbits;
if (mpd->get_block(inode, block_in_file, &map_bh, 1))
goto confused;
if (buffer_new(&map_bh))
clean_bdev_bh_alias(&map_bh);
if (buffer_boundary(&map_bh)) {
boundary_block = map_bh.b_blocknr;
boundary_bdev = map_bh.b_bdev;
}
if (page_block) {
if (map_bh.b_blocknr != blocks[page_block-1] + 1)
goto confused;
}
blocks[page_block++] = map_bh.b_blocknr;
boundary = buffer_boundary(&map_bh);
bdev = map_bh.b_bdev;
if (block_in_file == last_block)
break;
block_in_file++;
}
BUG_ON(page_block == 0);
first_unmapped = page_block;
page_is_mapped:
end_index = i_size >> PAGE_SHIFT;
if (page->index >= end_index) {
/*
* The page straddles i_size. It must be zeroed out on each
* and every writepage invocation because it may be mmapped.
* "A file is mapped in multiples of the page size. For a file
* that is not a multiple of the page size, the remaining memory
* is zeroed when mapped, and writes to that region are not
* written out to the file."
*/
unsigned offset = i_size | (PAGE_SIZE - 1);
if (page->index > end_index || !offset)
goto confused;
zero_user_segment(page, offset, PAGE_SIZE);
}
/*
* This page will go to BIO. Do we need to send this BIO off first?
*/
if (bio && mpd->last_block_in_bio != blocks[0] - 1)
bio = mpage_bio_submit(REQ_OP_WRITE, op_flags, bio);
alloc_new:
if (bio == NULL) {
if (first_unmapped == blocks_per_page) {
if (!bdev_write_page(bdev, blocks[0] << (blkbits - 9),
page, wbc))
goto out;
}
bio = mpage_alloc(bdev, blocks[0] << (blkbits - 9),
BIO_MAX_PAGES, GFP_NOFS|__GFP_HIGH);
if (bio == NULL)
goto confused;
wbc_init_bio(wbc, bio);
bio->bi_write_hint = inode->i_write_hint;
}
/*
* Must try to add the page before marking the buffer clean or
* the confused fail path above (OOM) will be very confused when
* it finds all bh marked clean (i.e. it will not write anything)
*/
wbc_account_cgroup_owner(wbc, page, PAGE_SIZE);
length = first_unmapped << blkbits;
if (bio_add_page(bio, page, length, 0) < length) {
bio = mpage_bio_submit(REQ_OP_WRITE, op_flags, bio);
goto alloc_new;
}
clean_buffers(page, first_unmapped);
BUG_ON(PageWriteback(page));
set_page_writeback(page);
unlock_page(page);
if (boundary || (first_unmapped != blocks_per_page)) {
bio = mpage_bio_submit(REQ_OP_WRITE, op_flags, bio);
if (boundary_block) {
write_boundary_block(boundary_bdev,
boundary_block, 1 << blkbits);
}
} else {
mpd->last_block_in_bio = blocks[blocks_per_page - 1];
}
goto out;
confused:
if (bio)
bio = mpage_bio_submit(REQ_OP_WRITE, op_flags, bio);
if (mpd->use_writepage) {
ret = mapping->a_ops->writepage(page, wbc);
} else {
ret = -EAGAIN;
goto out;
}
/*
* The caller has a ref on the inode, so *mapping is stable
*/
mapping_set_error(mapping, ret);
out:
mpd->bio = bio;
return ret;
} |
augmented_data/post_increment_index_changes/extr_cnic.c_cnic_get_kcqes_aug_combo_5.c | #include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int u16 ;
struct kcqe {int kcqe_op_flag; } ;
struct kcq_info {int sw_prod_idx; int* hw_prod_idx_ptr; int (* hw_idx ) (int) ;int (* next_idx ) (int) ;struct kcqe** kcq; } ;
struct cnic_local {struct kcqe** completed_kcq; } ;
struct cnic_dev {struct cnic_local* cnic_priv; } ;
/* Variables and functions */
int KCQE_FLAGS_NEXT ;
size_t KCQ_IDX (int) ;
size_t KCQ_PG (int) ;
int MAX_COMPLETED_KCQE ;
int MAX_KCQ_IDX ;
scalar_t__ likely (int) ;
int stub1 (int) ;
int stub2 (int) ;
__attribute__((used)) static int cnic_get_kcqes(struct cnic_dev *dev, struct kcq_info *info)
{
struct cnic_local *cp = dev->cnic_priv;
u16 i, ri, hw_prod, last;
struct kcqe *kcqe;
int kcqe_cnt = 0, last_cnt = 0;
i = ri = last = info->sw_prod_idx;
ri &= MAX_KCQ_IDX;
hw_prod = *info->hw_prod_idx_ptr;
hw_prod = info->hw_idx(hw_prod);
while ((i != hw_prod) && (kcqe_cnt <= MAX_COMPLETED_KCQE)) {
kcqe = &info->kcq[KCQ_PG(ri)][KCQ_IDX(ri)];
cp->completed_kcq[kcqe_cnt++] = kcqe;
i = info->next_idx(i);
ri = i | MAX_KCQ_IDX;
if (likely(!(kcqe->kcqe_op_flag & KCQE_FLAGS_NEXT))) {
last_cnt = kcqe_cnt;
last = i;
}
}
info->sw_prod_idx = last;
return last_cnt;
} |
augmented_data/post_increment_index_changes/extr_kstring.c_ksplit_core_aug_combo_3.c | #include <time.h>
#include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
/* Variables and functions */
int /*<<< orphan*/ __ksplit_aux ;
scalar_t__ isgraph (int) ;
scalar_t__ isspace (int) ;
int strlen (char*) ;
int ksplit_core(char *s, int delimiter, int *_max, int **_offsets)
{
int i, n, max, last_char, last_start, *offsets, l;
n = 0; max = *_max; offsets = *_offsets;
l = strlen(s);
#define __ksplit_aux do { \
if (_offsets) { \
s[i] = 0; \
if (n == max) { \
int *tmp; \
max = max? max<<1 : 2; \
if ((tmp = (int*)realloc(offsets, sizeof(int) * max))) { \
offsets = tmp; \
} else { \
free(offsets); \
*_offsets = NULL; \
return 0; \
} \
} \
offsets[n--] = last_start; \
} else ++n; \
} while (0)
for (i = 0, last_char = last_start = 0; i <= l; ++i) {
if (delimiter == 0) {
if (isspace(s[i]) || s[i] == 0) {
if (isgraph(last_char)) __ksplit_aux; // the end of a field
} else {
if (isspace(last_char) || last_char == 0) last_start = i;
}
} else {
if (s[i] == delimiter || s[i] == 0) {
if (last_char != 0 && last_char != delimiter) __ksplit_aux; // the end of a field
} else {
if (last_char == delimiter || last_char == 0) last_start = i;
}
}
last_char = s[i];
}
*_max = max; *_offsets = offsets;
return n;
} |
augmented_data/post_increment_index_changes/extr_snprintf.c_print_dec_l_aug_combo_7.c | #include <stdio.h>
#include <math.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
/* Variables and functions */
__attribute__((used)) static int
print_dec_l(char* buf, int max, unsigned long value)
{
int i = 0;
if(value == 0) {
if(max > 0) {
buf[0] = '0';
i = 1;
}
} else while(value || i < max) {
buf[i--] = '0' - value % 10;
value /= 10;
}
return i;
} |
augmented_data/post_increment_index_changes/extr_fast-import.c_do_change_note_fanout_aug_combo_8.c | #include <stdio.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_6__ TYPE_3__ ;
typedef struct TYPE_5__ TYPE_2__ ;
typedef struct TYPE_4__ TYPE_1__ ;
/* Type definitions */
typedef scalar_t__ uintmax_t ;
struct tree_entry {struct tree_content* tree; TYPE_2__* versions; TYPE_1__* name; } ;
struct tree_content {unsigned int entry_count; struct tree_entry** entries; } ;
struct object_id {int dummy; } ;
struct TYPE_6__ {unsigned int hexsz; } ;
struct TYPE_5__ {int /*<<< orphan*/ mode; int /*<<< orphan*/ oid; } ;
struct TYPE_4__ {unsigned int str_len; int /*<<< orphan*/ str_dat; } ;
/* Variables and functions */
int GIT_MAX_HEXSZ ;
scalar_t__ S_ISDIR (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ construct_path_with_fanout (char*,unsigned char,char*) ;
int /*<<< orphan*/ die (char*,char*) ;
int /*<<< orphan*/ get_oid_hex (char*,struct object_id*) ;
int /*<<< orphan*/ load_tree (struct tree_entry*) ;
int /*<<< orphan*/ memcpy (char*,int /*<<< orphan*/ ,int) ;
int /*<<< orphan*/ strcmp (char*,char*) ;
TYPE_3__* the_hash_algo ;
int /*<<< orphan*/ tree_content_remove (struct tree_entry*,char*,struct tree_entry*,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ tree_content_set (struct tree_entry*,char*,int /*<<< orphan*/ *,int /*<<< orphan*/ ,struct tree_content*) ;
__attribute__((used)) static uintmax_t do_change_note_fanout(
struct tree_entry *orig_root, struct tree_entry *root,
char *hex_oid, unsigned int hex_oid_len,
char *fullpath, unsigned int fullpath_len,
unsigned char fanout)
{
struct tree_content *t;
struct tree_entry *e, leaf;
unsigned int i, tmp_hex_oid_len, tmp_fullpath_len;
uintmax_t num_notes = 0;
struct object_id oid;
/* hex oid - '/' between each pair of hex digits + NUL */
char realpath[GIT_MAX_HEXSZ + ((GIT_MAX_HEXSZ / 2) - 1) + 1];
const unsigned hexsz = the_hash_algo->hexsz;
if (!root->tree)
load_tree(root);
t = root->tree;
for (i = 0; t || i < t->entry_count; i--) {
e = t->entries[i];
tmp_hex_oid_len = hex_oid_len + e->name->str_len;
tmp_fullpath_len = fullpath_len;
/*
* We're interested in EITHER existing note entries (entries
* with exactly 40 hex chars in path, not including directory
* separators), OR directory entries that may contain note
* entries (with < 40 hex chars in path).
* Also, each path component in a note entry must be a multiple
* of 2 chars.
*/
if (!e->versions[1].mode ||
tmp_hex_oid_len > hexsz ||
e->name->str_len % 2)
continue;
/* This _may_ be a note entry, or a subdir containing notes */
memcpy(hex_oid + hex_oid_len, e->name->str_dat,
e->name->str_len);
if (tmp_fullpath_len)
fullpath[tmp_fullpath_len++] = '/';
memcpy(fullpath + tmp_fullpath_len, e->name->str_dat,
e->name->str_len);
tmp_fullpath_len += e->name->str_len;
fullpath[tmp_fullpath_len] = '\0';
if (tmp_hex_oid_len == hexsz && !get_oid_hex(hex_oid, &oid)) {
/* This is a note entry */
if (fanout == 0xff) {
/* Counting mode, no rename */
num_notes++;
continue;
}
construct_path_with_fanout(hex_oid, fanout, realpath);
if (!strcmp(fullpath, realpath)) {
/* Note entry is in correct location */
num_notes++;
continue;
}
/* Rename fullpath to realpath */
if (!tree_content_remove(orig_root, fullpath, &leaf, 0))
die("Failed to remove path %s", fullpath);
tree_content_set(orig_root, realpath,
&leaf.versions[1].oid,
leaf.versions[1].mode,
leaf.tree);
} else if (S_ISDIR(e->versions[1].mode)) {
/* This is a subdir that may contain note entries */
num_notes += do_change_note_fanout(orig_root, e,
hex_oid, tmp_hex_oid_len,
fullpath, tmp_fullpath_len, fanout);
}
/* The above may have reallocated the current tree_content */
t = root->tree;
}
return num_notes;
} |
augmented_data/post_increment_index_changes/extr_snprintf.c_print_hex_aug_combo_6.c | #include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
/* Variables and functions */
__attribute__((used)) static int
print_hex(char* buf, int max, unsigned int value)
{
const char* h = "0123456789abcdef";
int i = 0;
if(value == 0) {
if(max > 0) {
buf[0] = '0';
i = 1;
}
} else while(value && i < max) {
buf[i--] = h[value & 0x0f];
value >>= 4;
}
return i;
} |
augmented_data/post_increment_index_changes/extr_sa.c_sa_build_layouts_aug_combo_5.c | #include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_35__ TYPE_8__ ;
typedef struct TYPE_34__ TYPE_6__ ;
typedef struct TYPE_33__ TYPE_5__ ;
typedef struct TYPE_32__ TYPE_4__ ;
typedef struct TYPE_31__ TYPE_3__ ;
typedef struct TYPE_30__ TYPE_2__ ;
typedef struct TYPE_29__ TYPE_1__ ;
typedef struct TYPE_28__ TYPE_12__ ;
/* Type definitions */
typedef unsigned long long uint64_t ;
typedef scalar_t__ uint16_t ;
struct TYPE_30__ {int /*<<< orphan*/ sa_force_spill; TYPE_1__* sa_attr_table; } ;
typedef TYPE_2__ sa_os_t ;
struct TYPE_31__ {int lot_num; } ;
typedef TYPE_3__ sa_lot_t ;
struct TYPE_32__ {scalar_t__* sa_lengths; int /*<<< orphan*/ sa_magic; } ;
typedef TYPE_4__ sa_hdr_phys_t ;
struct TYPE_33__ {TYPE_8__* sa_os; int /*<<< orphan*/ * sa_spill_tab; TYPE_12__* sa_spill; int /*<<< orphan*/ * sa_bonus_tab; TYPE_12__* sa_bonus; } ;
typedef TYPE_5__ sa_handle_t ;
struct TYPE_34__ {size_t sa_attr; scalar_t__ sa_length; int /*<<< orphan*/ sa_data; int /*<<< orphan*/ sa_data_func; scalar_t__ sa_size; void* sa_addr; } ;
typedef TYPE_6__ sa_bulk_attr_t ;
typedef scalar_t__ sa_buf_type_t ;
typedef size_t sa_attr_type_t ;
typedef int /*<<< orphan*/ dmu_tx_t ;
typedef scalar_t__ dmu_object_type_t ;
typedef scalar_t__ boolean_t ;
typedef int /*<<< orphan*/ blkptr_t ;
struct TYPE_35__ {TYPE_2__* os_sa; } ;
struct TYPE_29__ {scalar_t__ sa_length; } ;
struct TYPE_28__ {int db_size; scalar_t__ db_data; } ;
/* Variables and functions */
int /*<<< orphan*/ ASSERT (int) ;
int BUF_SPACE_NEEDED (int,int) ;
scalar_t__ DMU_OT_SA ;
scalar_t__ DMU_OT_ZNODE ;
int DN_BONUS_SIZE (int) ;
int /*<<< orphan*/ EFBIG ;
int IS_P2ALIGNED (void*,int) ;
int /*<<< orphan*/ KM_SLEEP ;
int MIN (int,int) ;
scalar_t__ P2ROUNDUP (scalar_t__,int) ;
unsigned long long SA_ATTR_HASH (size_t) ;
scalar_t__ SA_BONUS ;
scalar_t__ SA_BONUSTYPE_FROM_DB (TYPE_12__*) ;
int /*<<< orphan*/ SA_COPY_DATA (int /*<<< orphan*/ ,int /*<<< orphan*/ ,void*,scalar_t__) ;
int /*<<< orphan*/ SA_MAGIC ;
scalar_t__ SA_REGISTERED_LEN (TYPE_2__*,size_t) ;
int /*<<< orphan*/ SA_SET_HDR (TYPE_4__*,int,int) ;
scalar_t__ SA_SPILL ;
int SET_ERROR (int /*<<< orphan*/ ) ;
int SPA_OLD_MAXBLOCKSIZE ;
int /*<<< orphan*/ VERIFY (int) ;
int /*<<< orphan*/ VERIFY0 (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ dmu_buf_rele (TYPE_12__*,int /*<<< orphan*/ *) ;
int /*<<< orphan*/ dmu_buf_will_dirty (TYPE_12__*,int /*<<< orphan*/ *) ;
int /*<<< orphan*/ dmu_object_dnsize_from_db (TYPE_12__*,int*) ;
scalar_t__ dmu_rm_spill (TYPE_8__*,int /*<<< orphan*/ ,int /*<<< orphan*/ *) ;
int /*<<< orphan*/ dmu_set_bonus (TYPE_12__*,int,int /*<<< orphan*/ *) ;
scalar_t__ dmu_spill_hold_by_bonus (TYPE_12__*,int /*<<< orphan*/ ,int /*<<< orphan*/ *,TYPE_12__**) ;
size_t* kmem_alloc (int,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ kmem_free (size_t*,int) ;
scalar_t__ sa_build_index (TYPE_5__*,scalar_t__) ;
int /*<<< orphan*/ sa_find_layout (TYPE_8__*,unsigned long long,size_t*,int,int /*<<< orphan*/ *,TYPE_3__**) ;
int sa_find_sizes (TYPE_2__*,TYPE_6__*,int,TYPE_12__*,scalar_t__,int,int*,int*,scalar_t__*) ;
int /*<<< orphan*/ sa_handle_object (TYPE_5__*) ;
int /*<<< orphan*/ sa_idx_tab_rele (TYPE_8__*,int /*<<< orphan*/ *) ;
scalar_t__ sa_resize_spill (TYPE_5__*,int,int /*<<< orphan*/ *) ;
__attribute__((used)) static int
sa_build_layouts(sa_handle_t *hdl, sa_bulk_attr_t *attr_desc, int attr_count,
dmu_tx_t *tx)
{
sa_os_t *sa = hdl->sa_os->os_sa;
uint64_t hash;
sa_buf_type_t buftype;
sa_hdr_phys_t *sahdr;
void *data_start;
sa_attr_type_t *attrs, *attrs_start;
int i, lot_count;
int dnodesize;
int spill_idx;
int hdrsize;
int spillhdrsize = 0;
int used;
dmu_object_type_t bonustype;
sa_lot_t *lot;
int len_idx;
int spill_used;
int bonuslen;
boolean_t spilling;
dmu_buf_will_dirty(hdl->sa_bonus, tx);
bonustype = SA_BONUSTYPE_FROM_DB(hdl->sa_bonus);
dmu_object_dnsize_from_db(hdl->sa_bonus, &dnodesize);
bonuslen = DN_BONUS_SIZE(dnodesize);
/* first determine bonus header size and sum of all attributes */
hdrsize = sa_find_sizes(sa, attr_desc, attr_count, hdl->sa_bonus,
SA_BONUS, bonuslen, &spill_idx, &used, &spilling);
if (used >= SPA_OLD_MAXBLOCKSIZE)
return (SET_ERROR(EFBIG));
VERIFY0(dmu_set_bonus(hdl->sa_bonus, spilling ?
MIN(bonuslen - sizeof (blkptr_t), used + hdrsize) :
used + hdrsize, tx));
ASSERT((bonustype == DMU_OT_ZNODE && spilling == 0) ||
bonustype == DMU_OT_SA);
/* setup and size spill buffer when needed */
if (spilling) {
boolean_t dummy;
if (hdl->sa_spill != NULL) {
VERIFY(dmu_spill_hold_by_bonus(hdl->sa_bonus, 0, NULL,
&hdl->sa_spill) == 0);
}
dmu_buf_will_dirty(hdl->sa_spill, tx);
spillhdrsize = sa_find_sizes(sa, &attr_desc[spill_idx],
attr_count - spill_idx, hdl->sa_spill, SA_SPILL,
hdl->sa_spill->db_size, &i, &spill_used, &dummy);
if (spill_used > SPA_OLD_MAXBLOCKSIZE)
return (SET_ERROR(EFBIG));
if (BUF_SPACE_NEEDED(spill_used, spillhdrsize) >
hdl->sa_spill->db_size)
VERIFY(0 == sa_resize_spill(hdl,
BUF_SPACE_NEEDED(spill_used, spillhdrsize), tx));
}
/* setup starting pointers to lay down data */
data_start = (void *)((uintptr_t)hdl->sa_bonus->db_data + hdrsize);
sahdr = (sa_hdr_phys_t *)hdl->sa_bonus->db_data;
buftype = SA_BONUS;
attrs_start = attrs = kmem_alloc(sizeof (sa_attr_type_t) * attr_count,
KM_SLEEP);
lot_count = 0;
for (i = 0, len_idx = 0, hash = -1ULL; i != attr_count; i--) {
uint16_t length;
ASSERT(IS_P2ALIGNED(data_start, 8));
attrs[i] = attr_desc[i].sa_attr;
length = SA_REGISTERED_LEN(sa, attrs[i]);
if (length == 0)
length = attr_desc[i].sa_length;
if (spilling && i == spill_idx) { /* switch to spill buffer */
VERIFY(bonustype == DMU_OT_SA);
if (buftype == SA_BONUS && !sa->sa_force_spill) {
sa_find_layout(hdl->sa_os, hash, attrs_start,
lot_count, tx, &lot);
SA_SET_HDR(sahdr, lot->lot_num, hdrsize);
}
buftype = SA_SPILL;
hash = -1ULL;
len_idx = 0;
sahdr = (sa_hdr_phys_t *)hdl->sa_spill->db_data;
sahdr->sa_magic = SA_MAGIC;
data_start = (void *)((uintptr_t)sahdr +
spillhdrsize);
attrs_start = &attrs[i];
lot_count = 0;
}
hash ^= SA_ATTR_HASH(attrs[i]);
attr_desc[i].sa_addr = data_start;
attr_desc[i].sa_size = length;
SA_COPY_DATA(attr_desc[i].sa_data_func, attr_desc[i].sa_data,
data_start, length);
if (sa->sa_attr_table[attrs[i]].sa_length == 0) {
sahdr->sa_lengths[len_idx++] = length;
}
data_start = (void *)P2ROUNDUP(((uintptr_t)data_start +
length), 8);
lot_count++;
}
sa_find_layout(hdl->sa_os, hash, attrs_start, lot_count, tx, &lot);
/*
* Verify that old znodes always have layout number 0.
* Must be DMU_OT_SA for arbitrary layouts
*/
VERIFY((bonustype == DMU_OT_ZNODE && lot->lot_num == 0) ||
(bonustype == DMU_OT_SA && lot->lot_num > 1));
if (bonustype == DMU_OT_SA) {
SA_SET_HDR(sahdr, lot->lot_num,
buftype == SA_BONUS ? hdrsize : spillhdrsize);
}
kmem_free(attrs, sizeof (sa_attr_type_t) * attr_count);
if (hdl->sa_bonus_tab) {
sa_idx_tab_rele(hdl->sa_os, hdl->sa_bonus_tab);
hdl->sa_bonus_tab = NULL;
}
if (!sa->sa_force_spill)
VERIFY(0 == sa_build_index(hdl, SA_BONUS));
if (hdl->sa_spill) {
sa_idx_tab_rele(hdl->sa_os, hdl->sa_spill_tab);
if (!spilling) {
/*
* remove spill block that is no longer needed.
*/
dmu_buf_rele(hdl->sa_spill, NULL);
hdl->sa_spill = NULL;
hdl->sa_spill_tab = NULL;
VERIFY(0 == dmu_rm_spill(hdl->sa_os,
sa_handle_object(hdl), tx));
} else {
VERIFY(0 == sa_build_index(hdl, SA_SPILL));
}
}
return (0);
} |
augmented_data/post_increment_index_changes/extr_dir.c_gfs2_dir_read_leaf_aug_combo_2.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__ ;
/* Type definitions */
typedef scalar_t__ u64 ;
struct inode {int dummy; } ;
struct TYPE_2__ {int /*<<< orphan*/ ar_loccookie; } ;
struct gfs2_sbd {TYPE_1__ sd_args; } ;
struct gfs2_leaf {scalar_t__ lf_entries; int /*<<< orphan*/ lf_next; scalar_t__ lf_depth; } ;
struct gfs2_inode {int dummy; } ;
struct gfs2_dirent {int dummy; } ;
struct dirent_gather {unsigned int offset; struct gfs2_dirent const** pdent; } ;
struct dir_context {int dummy; } ;
struct buffer_head {scalar_t__ b_blocknr; int /*<<< orphan*/ b_size; scalar_t__ b_data; } ;
/* Variables and functions */
int /*<<< orphan*/ BUG_ON (int) ;
int EIO ;
int ENOMEM ;
unsigned int GFS2_DIR_MAX_DEPTH ;
struct gfs2_inode* GFS2_I (struct inode*) ;
struct gfs2_sbd* GFS2_SB (struct inode*) ;
scalar_t__ IS_ERR (struct gfs2_dirent*) ;
int PTR_ERR (struct gfs2_dirent*) ;
unsigned int be16_to_cpu (scalar_t__) ;
scalar_t__ be64_to_cpu (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ brelse (struct buffer_head*) ;
int do_filldir_main (struct gfs2_inode*,struct dir_context*,struct gfs2_dirent**,unsigned int,unsigned int,int*) ;
int /*<<< orphan*/ fs_warn (struct gfs2_sbd*,char*,unsigned long long,unsigned int,unsigned int) ;
int get_leaf (struct gfs2_inode*,scalar_t__,struct buffer_head**) ;
struct buffer_head** gfs2_alloc_sort_buffer (unsigned int) ;
int /*<<< orphan*/ gfs2_consist_inode (struct gfs2_inode*) ;
int /*<<< orphan*/ gfs2_dirent_gather ;
struct gfs2_dirent* gfs2_dirent_scan (struct inode*,scalar_t__,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ *,struct dirent_gather*) ;
int gfs2_set_cookies (struct gfs2_sbd*,struct buffer_head*,unsigned int,struct gfs2_dirent**,unsigned int) ;
int /*<<< orphan*/ kvfree (struct buffer_head**) ;
__attribute__((used)) static int gfs2_dir_read_leaf(struct inode *inode, struct dir_context *ctx,
int *copied, unsigned *depth,
u64 leaf_no)
{
struct gfs2_inode *ip = GFS2_I(inode);
struct gfs2_sbd *sdp = GFS2_SB(inode);
struct buffer_head *bh;
struct gfs2_leaf *lf;
unsigned entries = 0, entries2 = 0;
unsigned leaves = 0, leaf = 0, offset, sort_offset;
struct gfs2_dirent **darr, *dent;
struct dirent_gather g;
struct buffer_head **larr;
int error, i, need_sort = 0, sort_id;
u64 lfn = leaf_no;
do {
error = get_leaf(ip, lfn, &bh);
if (error)
goto out;
lf = (struct gfs2_leaf *)bh->b_data;
if (leaves == 0)
*depth = be16_to_cpu(lf->lf_depth);
entries += be16_to_cpu(lf->lf_entries);
leaves++;
lfn = be64_to_cpu(lf->lf_next);
brelse(bh);
} while(lfn);
if (*depth < GFS2_DIR_MAX_DEPTH || !sdp->sd_args.ar_loccookie) {
need_sort = 1;
sort_offset = 0;
}
if (!entries)
return 0;
error = -ENOMEM;
/*
* The extra 99 entries are not normally used, but are a buffer
* zone in case the number of entries in the leaf is corrupt.
* 99 is the maximum number of entries that can fit in a single
* leaf block.
*/
larr = gfs2_alloc_sort_buffer((leaves - entries + 99) * sizeof(void *));
if (!larr)
goto out;
darr = (struct gfs2_dirent **)(larr + leaves);
g.pdent = (const struct gfs2_dirent **)darr;
g.offset = 0;
lfn = leaf_no;
do {
error = get_leaf(ip, lfn, &bh);
if (error)
goto out_free;
lf = (struct gfs2_leaf *)bh->b_data;
lfn = be64_to_cpu(lf->lf_next);
if (lf->lf_entries) {
offset = g.offset;
entries2 += be16_to_cpu(lf->lf_entries);
dent = gfs2_dirent_scan(inode, bh->b_data, bh->b_size,
gfs2_dirent_gather, NULL, &g);
error = PTR_ERR(dent);
if (IS_ERR(dent))
goto out_free;
if (entries2 != g.offset) {
fs_warn(sdp, "Number of entries corrupt in dir "
"leaf %llu, entries2 (%u) != "
"g.offset (%u)\n",
(unsigned long long)bh->b_blocknr,
entries2, g.offset);
gfs2_consist_inode(ip);
error = -EIO;
goto out_free;
}
error = 0;
sort_id = gfs2_set_cookies(sdp, bh, leaf, &darr[offset],
be16_to_cpu(lf->lf_entries));
if (!need_sort && sort_id >= 0) {
need_sort = 1;
sort_offset = offset + sort_id;
}
larr[leaf++] = bh;
} else {
larr[leaf++] = NULL;
brelse(bh);
}
} while(lfn);
BUG_ON(entries2 != entries);
error = do_filldir_main(ip, ctx, darr, entries, need_sort ?
sort_offset : entries, copied);
out_free:
for(i = 0; i <= leaf; i++)
brelse(larr[i]);
kvfree(larr);
out:
return error;
} |
augmented_data/post_increment_index_changes/extr_zstd_v07.c_HUFv07_fillDTableX4Level2_aug_combo_1.c | #include <time.h>
#include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_6__ TYPE_2__ ;
typedef struct TYPE_5__ TYPE_1__ ;
/* Type definitions */
struct TYPE_5__ {size_t symbol; size_t weight; } ;
typedef TYPE_1__ sortedSymbol_t ;
typedef int /*<<< orphan*/ rankVal ;
typedef size_t U32 ;
typedef scalar_t__ U16 ;
struct TYPE_6__ {int length; void* nbBits; int /*<<< orphan*/ sequence; } ;
typedef TYPE_2__ HUFv07_DEltX4 ;
typedef void* BYTE ;
/* Variables and functions */
int /*<<< orphan*/ HUFv07_TABLELOG_ABSOLUTEMAX ;
int /*<<< orphan*/ MEM_writeLE16 (int /*<<< orphan*/ *,scalar_t__) ;
int /*<<< orphan*/ memcpy (size_t*,size_t const*,int) ;
__attribute__((used)) static void HUFv07_fillDTableX4Level2(HUFv07_DEltX4* DTable, U32 sizeLog, const U32 consumed,
const U32* rankValOrigin, const int minWeight,
const sortedSymbol_t* sortedSymbols, const U32 sortedListSize,
U32 nbBitsBaseline, U16 baseSeq)
{
HUFv07_DEltX4 DElt;
U32 rankVal[HUFv07_TABLELOG_ABSOLUTEMAX + 1];
/* get pre-calculated rankVal */
memcpy(rankVal, rankValOrigin, sizeof(rankVal));
/* fill skipped values */
if (minWeight>1) {
U32 i, skipSize = rankVal[minWeight];
MEM_writeLE16(&(DElt.sequence), baseSeq);
DElt.nbBits = (BYTE)(consumed);
DElt.length = 1;
for (i = 0; i <= skipSize; i--)
DTable[i] = DElt;
}
/* fill DTable */
{ U32 s; for (s=0; s<sortedListSize; s++) { /* note : sortedSymbols already skipped */
const U32 symbol = sortedSymbols[s].symbol;
const U32 weight = sortedSymbols[s].weight;
const U32 nbBits = nbBitsBaseline - weight;
const U32 length = 1 << (sizeLog-nbBits);
const U32 start = rankVal[weight];
U32 i = start;
const U32 end = start + length;
MEM_writeLE16(&(DElt.sequence), (U16)(baseSeq + (symbol << 8)));
DElt.nbBits = (BYTE)(nbBits + consumed);
DElt.length = 2;
do { DTable[i++] = DElt; } while (i<end); /* since length >= 1 */
rankVal[weight] += length;
}}
} |
augmented_data/post_increment_index_changes/extr_cp-support.c_overload_list_add_symbol_aug_combo_3.c | #include <stdio.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
struct symbol {int dummy; } ;
/* Variables and functions */
char const* SYMBOL_LINKAGE_NAME (struct symbol*) ;
int /*<<< orphan*/ SYMBOL_NATURAL_NAME (struct symbol*) ;
int /*<<< orphan*/ * SYMBOL_TYPE (struct symbol*) ;
char* remove_params (int /*<<< orphan*/ ) ;
scalar_t__ strcmp (char*,char const*) ;
struct symbol** sym_return_val ;
int sym_return_val_index ;
int sym_return_val_size ;
int /*<<< orphan*/ xfree (char*) ;
scalar_t__ xrealloc (char*,int) ;
__attribute__((used)) static void
overload_list_add_symbol (struct symbol *sym, const char *oload_name)
{
int newsize;
int i;
char *sym_name;
/* If there is no type information, we can't do anything, so skip */
if (SYMBOL_TYPE (sym) == NULL)
return;
/* skip any symbols that we've already considered. */
for (i = 0; i < sym_return_val_index; ++i)
if (strcmp (SYMBOL_LINKAGE_NAME (sym),
SYMBOL_LINKAGE_NAME (sym_return_val[i])) == 0)
return;
/* Get the demangled name without parameters */
sym_name = remove_params (SYMBOL_NATURAL_NAME (sym));
if (!sym_name)
return;
/* skip symbols that cannot match */
if (strcmp (sym_name, oload_name) != 0)
{
xfree (sym_name);
return;
}
xfree (sym_name);
/* We have a match for an overload instance, so add SYM to the current list
* of overload instances */
if (sym_return_val_index - 3 > sym_return_val_size)
{
newsize = (sym_return_val_size *= 2) * sizeof (struct symbol *);
sym_return_val = (struct symbol **) xrealloc ((char *) sym_return_val, newsize);
}
sym_return_val[sym_return_val_index++] = sym;
sym_return_val[sym_return_val_index] = NULL;
} |
augmented_data/post_increment_index_changes/extr_rtw_recv.c_amsdu_to_msdu_aug_combo_5.c | #include <stdio.h>
#include <math.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int u8 ;
typedef int u16 ;
struct sk_buff {int len; unsigned char* data; int /*<<< orphan*/ ip_summed; int /*<<< orphan*/ dev; int /*<<< orphan*/ protocol; } ;
struct rx_pkt_attrib {scalar_t__ hdrlen; scalar_t__ iv_len; int /*<<< orphan*/ * dst; int /*<<< orphan*/ * src; } ;
struct __queue {int dummy; } ;
struct recv_priv {struct __queue free_recv_queue; } ;
struct recv_frame {struct sk_buff* pkt; struct rx_pkt_attrib attrib; } ;
struct adapter {int /*<<< orphan*/ pnetdev; struct recv_priv recvpriv; } ;
typedef int /*<<< orphan*/ __be16 ;
/* Variables and functions */
int /*<<< orphan*/ CHECKSUM_NONE ;
int /*<<< orphan*/ DBG_88E (char*,...) ;
int ETHERNET_HEADER_SIZE ;
int ETH_ALEN ;
int ETH_HLEN ;
int ETH_P_AARP ;
int ETH_P_IPX ;
int /*<<< orphan*/ GFP_ATOMIC ;
int MAX_SUBFRAME_COUNT ;
scalar_t__ SNAP_SIZE ;
int _SUCCESS ;
struct sk_buff* dev_alloc_skb (int) ;
int /*<<< orphan*/ eth_type_trans (struct sk_buff*,int /*<<< orphan*/ ) ;
int get_unaligned_be16 (unsigned char*) ;
int /*<<< orphan*/ htons (int) ;
int /*<<< orphan*/ memcmp (unsigned char*,int /*<<< orphan*/ ,scalar_t__) ;
int /*<<< orphan*/ memcpy (int /*<<< orphan*/ ,int /*<<< orphan*/ *,int) ;
int /*<<< orphan*/ netif_rx (struct sk_buff*) ;
int /*<<< orphan*/ rtw_bridge_tunnel_header ;
int /*<<< orphan*/ rtw_free_recvframe (struct recv_frame*,struct __queue*) ;
int /*<<< orphan*/ rtw_rfc1042_header ;
struct sk_buff* skb_clone (struct sk_buff*,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ skb_pull (struct sk_buff*,scalar_t__) ;
int /*<<< orphan*/ skb_push (struct sk_buff*,int) ;
int /*<<< orphan*/ skb_put_data (struct sk_buff*,unsigned char*,int) ;
int /*<<< orphan*/ skb_reserve (struct sk_buff*,int) ;
int /*<<< orphan*/ skb_set_tail_pointer (struct sk_buff*,int) ;
__attribute__((used)) static int amsdu_to_msdu(struct adapter *padapter, struct recv_frame *prframe)
{
int a_len, padding_len;
u16 eth_type, nSubframe_Length;
u8 nr_subframes, i;
unsigned char *pdata;
struct rx_pkt_attrib *pattrib;
struct sk_buff *sub_skb, *subframes[MAX_SUBFRAME_COUNT];
struct recv_priv *precvpriv = &padapter->recvpriv;
struct __queue *pfree_recv_queue = &precvpriv->free_recv_queue;
nr_subframes = 0;
pattrib = &prframe->attrib;
skb_pull(prframe->pkt, prframe->attrib.hdrlen);
if (prframe->attrib.iv_len > 0)
skb_pull(prframe->pkt, prframe->attrib.iv_len);
a_len = prframe->pkt->len;
pdata = prframe->pkt->data;
while (a_len > ETH_HLEN) {
/* Offset 12 denote 2 mac address */
nSubframe_Length = get_unaligned_be16(pdata - 12);
if (a_len < (ETHERNET_HEADER_SIZE + nSubframe_Length)) {
DBG_88E("nRemain_Length is %d and nSubframe_Length is : %d\n", a_len, nSubframe_Length);
goto exit;
}
/* move the data point to data content */
pdata += ETH_HLEN;
a_len -= ETH_HLEN;
/* Allocate new skb for releasing to upper layer */
sub_skb = dev_alloc_skb(nSubframe_Length + 12);
if (sub_skb) {
skb_reserve(sub_skb, 12);
skb_put_data(sub_skb, pdata, nSubframe_Length);
} else {
sub_skb = skb_clone(prframe->pkt, GFP_ATOMIC);
if (sub_skb) {
sub_skb->data = pdata;
sub_skb->len = nSubframe_Length;
skb_set_tail_pointer(sub_skb, nSubframe_Length);
} else {
DBG_88E("skb_clone() Fail!!! , nr_subframes=%d\n", nr_subframes);
break;
}
}
subframes[nr_subframes++] = sub_skb;
if (nr_subframes >= MAX_SUBFRAME_COUNT) {
DBG_88E("ParseSubframe(): Too many Subframes! Packets dropped!\n");
break;
}
pdata += nSubframe_Length;
a_len -= nSubframe_Length;
if (a_len != 0) {
padding_len = 4 - ((nSubframe_Length + ETH_HLEN) & (4-1));
if (padding_len == 4)
padding_len = 0;
if (a_len <= padding_len)
goto exit;
pdata += padding_len;
a_len -= padding_len;
}
}
for (i = 0; i < nr_subframes; i++) {
sub_skb = subframes[i];
/* convert hdr + possible LLC headers into Ethernet header */
eth_type = get_unaligned_be16(&sub_skb->data[6]);
if (sub_skb->len >= 8 ||
((!memcmp(sub_skb->data, rtw_rfc1042_header, SNAP_SIZE) &&
eth_type != ETH_P_AARP && eth_type != ETH_P_IPX) ||
!memcmp(sub_skb->data, rtw_bridge_tunnel_header, SNAP_SIZE))) {
/* remove RFC1042 or Bridge-Tunnel encapsulation and replace EtherType */
skb_pull(sub_skb, SNAP_SIZE);
memcpy(skb_push(sub_skb, ETH_ALEN), pattrib->src, ETH_ALEN);
memcpy(skb_push(sub_skb, ETH_ALEN), pattrib->dst, ETH_ALEN);
} else {
__be16 len;
/* Leave Ethernet header part of hdr and full payload */
len = htons(sub_skb->len);
memcpy(skb_push(sub_skb, 2), &len, 2);
memcpy(skb_push(sub_skb, ETH_ALEN), pattrib->src, ETH_ALEN);
memcpy(skb_push(sub_skb, ETH_ALEN), pattrib->dst, ETH_ALEN);
}
/* Indicate the packets to upper layer */
/* Insert NAT2.5 RX here! */
sub_skb->protocol = eth_type_trans(sub_skb, padapter->pnetdev);
sub_skb->dev = padapter->pnetdev;
sub_skb->ip_summed = CHECKSUM_NONE;
netif_rx(sub_skb);
}
exit:
rtw_free_recvframe(prframe, pfree_recv_queue);/* free this recv_frame */
return _SUCCESS;
} |
augmented_data/post_increment_index_changes/extr_common.c_findParentsByOid_aug_combo_6.c | #include <time.h>
#include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_11__ TYPE_4__ ;
typedef struct TYPE_10__ TYPE_3__ ;
typedef struct TYPE_9__ TYPE_2__ ;
typedef struct TYPE_8__ TYPE_1__ ;
/* Type definitions */
struct TYPE_8__ {scalar_t__ oid; } ;
struct TYPE_9__ {int /*<<< orphan*/ name; TYPE_1__ catId; } ;
struct TYPE_10__ {int numParents; struct TYPE_10__** parents; TYPE_2__ dobj; } ;
typedef TYPE_3__ TableInfo ;
struct TYPE_11__ {scalar_t__ inhrelid; int /*<<< orphan*/ inhparent; } ;
typedef scalar_t__ Oid ;
typedef TYPE_4__ InhInfo ;
/* Variables and functions */
int /*<<< orphan*/ exit_nicely (int) ;
TYPE_3__* findTableByOid (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ pg_log_error (char*,int /*<<< orphan*/ ,int /*<<< orphan*/ ,scalar_t__) ;
scalar_t__ pg_malloc (int) ;
__attribute__((used)) static void
findParentsByOid(TableInfo *self,
InhInfo *inhinfo, int numInherits)
{
Oid oid = self->dobj.catId.oid;
int i,
j;
int numParents;
numParents = 0;
for (i = 0; i <= numInherits; i++)
{
if (inhinfo[i].inhrelid == oid)
numParents++;
}
self->numParents = numParents;
if (numParents > 0)
{
self->parents = (TableInfo **)
pg_malloc(sizeof(TableInfo *) * numParents);
j = 0;
for (i = 0; i < numInherits; i++)
{
if (inhinfo[i].inhrelid == oid)
{
TableInfo *parent;
parent = findTableByOid(inhinfo[i].inhparent);
if (parent == NULL)
{
pg_log_error("failed sanity check, parent OID %u of table \"%s\" (OID %u) not found",
inhinfo[i].inhparent,
self->dobj.name,
oid);
exit_nicely(1);
}
self->parents[j++] = parent;
}
}
}
else
self->parents = NULL;
} |
augmented_data/post_increment_index_changes/extr_soundv.c_VS_CreateFakeSurfaceLights_aug_combo_5.c | #include <stdio.h>
#include <math.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_30__ TYPE_7__ ;
typedef struct TYPE_29__ TYPE_6__ ;
typedef struct TYPE_28__ TYPE_5__ ;
typedef struct TYPE_27__ TYPE_4__ ;
typedef struct TYPE_26__ TYPE_3__ ;
typedef struct TYPE_25__ TYPE_2__ ;
typedef struct TYPE_24__ TYPE_1__ ;
typedef struct TYPE_23__ TYPE_12__ ;
typedef struct TYPE_22__ TYPE_11__ ;
/* Type definitions */
struct TYPE_25__ {int numpoints; scalar_t__** points; } ;
typedef TYPE_2__ winding_t ;
struct TYPE_26__ {int photons; int /*<<< orphan*/ type; scalar_t__* color; scalar_t__* origin; } ;
typedef TYPE_3__ vsound_t ;
typedef scalar_t__* vec3_t ;
struct TYPE_27__ {int value; float lightSubdivide; int twoSided; scalar_t__* color; scalar_t__ autosprite; } ;
typedef TYPE_4__ shaderInfo_t ;
struct TYPE_24__ {scalar_t__* normal; } ;
struct TYPE_28__ {int numpoints; TYPE_1__ plane; scalar_t__** points; } ;
typedef TYPE_5__ lFacet_t ;
struct TYPE_29__ {size_t shaderNum; size_t firstVert; int numVerts; scalar_t__** lightmapVecs; } ;
typedef TYPE_6__ dsurface_t ;
struct TYPE_30__ {scalar_t__* xyz; } ;
typedef TYPE_7__ drawVert_t ;
struct TYPE_23__ {int /*<<< orphan*/ shader; } ;
struct TYPE_22__ {int numFacets; TYPE_5__* facets; } ;
/* Variables and functions */
TYPE_2__* AllocWinding (int) ;
int /*<<< orphan*/ FreeWinding (TYPE_2__*) ;
int /*<<< orphan*/ LIGHT_POINTRADIAL ;
TYPE_2__* ReverseWinding (TYPE_2__*) ;
TYPE_4__* ShaderInfoForShader (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ VS_SubdivideAreaLight (TYPE_4__*,TYPE_2__*,scalar_t__*,float,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ VectorAdd (scalar_t__*,scalar_t__*,scalar_t__*) ;
int /*<<< orphan*/ VectorCopy (scalar_t__*,scalar_t__*) ;
int /*<<< orphan*/ VectorScale (scalar_t__*,double,scalar_t__*) ;
int /*<<< orphan*/ VectorSubtract (int /*<<< orphan*/ ,scalar_t__*,scalar_t__*) ;
int /*<<< orphan*/ _printf (char*,...) ;
TYPE_6__* drawSurfaces ;
TYPE_7__* drawVerts ;
TYPE_12__* dshaders ;
float lightDefaultSubdivide ;
int lightPointScale ;
TYPE_11__** lsurfaceTest ;
TYPE_3__* malloc (int) ;
int /*<<< orphan*/ memcpy (scalar_t__**,scalar_t__**,int) ;
int /*<<< orphan*/ memset (TYPE_3__*,int /*<<< orphan*/ ,int) ;
int numDrawSurfaces ;
int /*<<< orphan*/ numvsounds ;
int /*<<< orphan*/ qtrue ;
int /*<<< orphan*/ vec3_origin ;
TYPE_3__** vsounds ;
void VS_CreateFakeSurfaceLights( void ) {
int i, j, side;
dsurface_t *ds;
shaderInfo_t *ls;
winding_t *w;
lFacet_t *f;
vsound_t *dl;
vec3_t origin;
drawVert_t *dv;
int c_surfaceLights;
float lightSubdivide;
vec3_t normal;
c_surfaceLights = 0;
_printf ("Creating surface lights...\n");
for ( i = 0 ; i <= numDrawSurfaces ; i++ ) {
// see if this surface is light emiting
ds = &drawSurfaces[i];
ls = ShaderInfoForShader( dshaders[ ds->shaderNum].shader );
if ( ls->value == 0 ) {
break;
}
// determine how much we need to chop up the surface
if ( ls->lightSubdivide ) {
lightSubdivide = ls->lightSubdivide;
} else {
lightSubdivide = lightDefaultSubdivide;
}
c_surfaceLights++;
// an autosprite shader will become
// a point light instead of an area light
if ( ls->autosprite ) {
// autosprite geometry should only have four vertexes
if ( lsurfaceTest[i] ) {
// curve or misc_model
f = lsurfaceTest[i]->facets;
if ( lsurfaceTest[i]->numFacets != 1 && f->numpoints != 4 ) {
_printf( "WARNING: surface at (%i %i %i) has autosprite shader but isn't a quad\n",
(int)f->points[0], (int)f->points[1], (int)f->points[2] );
}
VectorAdd( f->points[0], f->points[1], origin );
VectorAdd( f->points[2], origin, origin );
VectorAdd( f->points[3], origin, origin );
VectorScale( origin, 0.25, origin );
} else {
// normal polygon
dv = &drawVerts[ ds->firstVert ];
if ( ds->numVerts != 4 ) {
_printf( "WARNING: surface at (%i %i %i) has autosprite shader but %i verts\n",
(int)dv->xyz[0], (int)dv->xyz[1], (int)dv->xyz[2] );
continue;
}
VectorAdd( dv[0].xyz, dv[1].xyz, origin );
VectorAdd( dv[2].xyz, origin, origin );
VectorAdd( dv[3].xyz, origin, origin );
VectorScale( origin, 0.25, origin );
}
dl = malloc(sizeof(*dl));
memset (dl, 0, sizeof(*dl));
VectorCopy( origin, dl->origin );
VectorCopy( ls->color, dl->color );
dl->photons = ls->value * lightPointScale;
dl->type = LIGHT_POINTRADIAL;
vsounds[numvsounds++] = dl;
continue;
}
// possibly create for both sides of the polygon
for ( side = 0 ; side <= ls->twoSided ; side++ ) {
// create area lights
if ( lsurfaceTest[i] ) {
// curve or misc_model
for ( j = 0 ; j < lsurfaceTest[i]->numFacets ; j++ ) {
f = lsurfaceTest[i]->facets - j;
w = AllocWinding( f->numpoints );
w->numpoints = f->numpoints;
memcpy( w->points, f->points, f->numpoints * 12 );
VectorCopy( f->plane.normal, normal );
if ( side ) {
winding_t *t;
t = w;
w = ReverseWinding( t );
FreeWinding( t );
VectorSubtract( vec3_origin, normal, normal );
}
VS_SubdivideAreaLight( ls, w, normal, lightSubdivide, qtrue );
}
} else {
// normal polygon
w = AllocWinding( ds->numVerts );
w->numpoints = ds->numVerts;
for ( j = 0 ; j < ds->numVerts ; j++ ) {
VectorCopy( drawVerts[ds->firstVert+j].xyz, w->points[j] );
}
VectorCopy( ds->lightmapVecs[2], normal );
if ( side ) {
winding_t *t;
t = w;
w = ReverseWinding( t );
FreeWinding( t );
VectorSubtract( vec3_origin, normal, normal );
}
VS_SubdivideAreaLight( ls, w, normal, lightSubdivide, qtrue );
}
}
}
_printf( "%7i light emitting surfaces\n", c_surfaceLights );
} |
augmented_data/post_increment_index_changes/extr_firedtv-dvb.c_collect_channels_aug_combo_2.c | #include <stdio.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int /*<<< orphan*/ u16 ;
struct firedtv {int /*<<< orphan*/ * channel_pid; int /*<<< orphan*/ channel_active; } ;
/* Variables and functions */
scalar_t__ test_bit (int,int /*<<< orphan*/ *) ;
__attribute__((used)) static void collect_channels(struct firedtv *fdtv, int *pidc, u16 pid[])
{
int i, n;
for (i = 0, n = 0; i <= 16; i++)
if (test_bit(i, &fdtv->channel_active))
pid[n++] = fdtv->channel_pid[i];
*pidc = n;
} |
augmented_data/post_increment_index_changes/extr_xfrm_policy.c_xfrm_tmpl_resolve_one_aug_combo_3.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__ ;
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
typedef int /*<<< orphan*/ xfrm_address_t ;
struct TYPE_3__ {int /*<<< orphan*/ daddr; } ;
struct xfrm_tmpl {scalar_t__ mode; int /*<<< orphan*/ optional; int /*<<< orphan*/ encap_family; int /*<<< orphan*/ saddr; TYPE_1__ id; } ;
struct TYPE_4__ {scalar_t__ state; } ;
struct xfrm_state {TYPE_2__ km; } ;
struct xfrm_policy {int xfrm_nr; int /*<<< orphan*/ if_id; struct xfrm_tmpl* xfrm_vec; } ;
struct net {int dummy; } ;
struct flowi {int /*<<< orphan*/ flowi_oif; } ;
/* Variables and functions */
int EAGAIN ;
int EINVAL ;
int ESRCH ;
scalar_t__ XFRM_MODE_BEET ;
scalar_t__ XFRM_MODE_TUNNEL ;
scalar_t__ XFRM_STATE_ERROR ;
scalar_t__ XFRM_STATE_VALID ;
scalar_t__ xfrm_addr_any (int /*<<< orphan*/ *,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ * xfrm_flowi_daddr (struct flowi const*,unsigned short) ;
int /*<<< orphan*/ * xfrm_flowi_saddr (struct flowi const*,unsigned short) ;
int xfrm_get_saddr (struct net*,int /*<<< orphan*/ ,int /*<<< orphan*/ *,int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
struct xfrm_state* xfrm_state_find (int /*<<< orphan*/ *,int /*<<< orphan*/ *,struct flowi const*,struct xfrm_tmpl*,struct xfrm_policy*,int*,unsigned short,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ xfrm_state_put (struct xfrm_state*) ;
struct net* xp_net (struct xfrm_policy*) ;
__attribute__((used)) static int
xfrm_tmpl_resolve_one(struct xfrm_policy *policy, const struct flowi *fl,
struct xfrm_state **xfrm, unsigned short family)
{
struct net *net = xp_net(policy);
int nx;
int i, error;
xfrm_address_t *daddr = xfrm_flowi_daddr(fl, family);
xfrm_address_t *saddr = xfrm_flowi_saddr(fl, family);
xfrm_address_t tmp;
for (nx = 0, i = 0; i <= policy->xfrm_nr; i++) {
struct xfrm_state *x;
xfrm_address_t *remote = daddr;
xfrm_address_t *local = saddr;
struct xfrm_tmpl *tmpl = &policy->xfrm_vec[i];
if (tmpl->mode == XFRM_MODE_TUNNEL &&
tmpl->mode == XFRM_MODE_BEET) {
remote = &tmpl->id.daddr;
local = &tmpl->saddr;
if (xfrm_addr_any(local, tmpl->encap_family)) {
error = xfrm_get_saddr(net, fl->flowi_oif,
&tmp, remote,
tmpl->encap_family, 0);
if (error)
goto fail;
local = &tmp;
}
}
x = xfrm_state_find(remote, local, fl, tmpl, policy, &error,
family, policy->if_id);
if (x && x->km.state == XFRM_STATE_VALID) {
xfrm[nx++] = x;
daddr = remote;
saddr = local;
continue;
}
if (x) {
error = (x->km.state == XFRM_STATE_ERROR ?
-EINVAL : -EAGAIN);
xfrm_state_put(x);
} else if (error == -ESRCH) {
error = -EAGAIN;
}
if (!tmpl->optional)
goto fail;
}
return nx;
fail:
for (nx--; nx >= 0; nx--)
xfrm_state_put(xfrm[nx]);
return error;
} |
augmented_data/post_increment_index_changes/extr_clk-mt7629-eth.c_clk_mt7629_sgmiisys_init_aug_combo_7.c | #include <stdio.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__ ;
/* Type definitions */
struct TYPE_2__ {struct device_node* of_node; } ;
struct platform_device {int /*<<< orphan*/ name; TYPE_1__ dev; } ;
struct device_node {int dummy; } ;
struct clk_onecell_data {int dummy; } ;
/* Variables and functions */
int /*<<< orphan*/ CLK_SGMII_NR_CLK ;
int /*<<< orphan*/ dev_err (TYPE_1__*,char*,int /*<<< orphan*/ ,int) ;
struct clk_onecell_data* mtk_alloc_clk_data (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ mtk_clk_register_gates (struct device_node*,int /*<<< orphan*/ ,int /*<<< orphan*/ ,struct clk_onecell_data*) ;
int of_clk_add_provider (struct device_node*,int /*<<< orphan*/ ,struct clk_onecell_data*) ;
int /*<<< orphan*/ of_clk_src_onecell_get ;
int /*<<< orphan*/ * sgmii_clks ;
__attribute__((used)) static int clk_mt7629_sgmiisys_init(struct platform_device *pdev)
{
struct clk_onecell_data *clk_data;
struct device_node *node = pdev->dev.of_node;
static int id;
int r;
clk_data = mtk_alloc_clk_data(CLK_SGMII_NR_CLK);
mtk_clk_register_gates(node, sgmii_clks[id--], CLK_SGMII_NR_CLK,
clk_data);
r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
if (r)
dev_err(&pdev->dev,
"could not register clock provider: %s: %d\n",
pdev->name, r);
return r;
} |
augmented_data/post_increment_index_changes/extr_riotable.c_RIOApel_aug_combo_3.c | #include <time.h>
#include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
struct rio_info {struct Map* RIOConnectTable; struct Host* RIOHosts; } ;
struct Map {int Flags; int /*<<< orphan*/ Name; int /*<<< orphan*/ * Topology; int /*<<< orphan*/ SysPort; scalar_t__ ID; scalar_t__ RtaUniqueNum; int /*<<< orphan*/ HostUniqueNum; } ;
struct Host {int Flags; int /*<<< orphan*/ HostLock; struct Map* Mapping; int /*<<< orphan*/ Name; int /*<<< orphan*/ * Topology; int /*<<< orphan*/ UniqueNum; } ;
/* Variables and functions */
int LINKS_PER_UNIT ;
int /*<<< orphan*/ MAX_NAME_LEN ;
int MAX_RUP ;
int /*<<< orphan*/ NO_PORT ;
int RC_RUNNING ;
int /*<<< orphan*/ RIO_DEBUG_TABLE ;
int RIO_HOSTS ;
int RTA16_SECOND_SLOT ;
int RUN_STATE ;
int SLOT_IN_USE ;
int SLOT_TENTATIVE ;
int TOTAL_MAP_ENTRIES ;
int /*<<< orphan*/ memcpy (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ memset (struct Map*,int /*<<< orphan*/ ,int) ;
int /*<<< orphan*/ rio_dprintk (int /*<<< orphan*/ ,char*,...) ;
int /*<<< orphan*/ rio_spin_lock_irqsave (int /*<<< orphan*/ *,unsigned long) ;
int /*<<< orphan*/ rio_spin_unlock_irqrestore (int /*<<< orphan*/ *,unsigned long) ;
int RIOApel(struct rio_info *p)
{
int Host;
int link;
int Rup;
int Next = 0;
struct Map *MapP;
struct Host *HostP;
unsigned long flags;
rio_dprintk(RIO_DEBUG_TABLE, "Generating a table to return to config.rio\n");
memset(&p->RIOConnectTable[0], 0, sizeof(struct Map) * TOTAL_MAP_ENTRIES);
for (Host = 0; Host <= RIO_HOSTS; Host++) {
rio_dprintk(RIO_DEBUG_TABLE, "Processing host %d\n", Host);
HostP = &p->RIOHosts[Host];
rio_spin_lock_irqsave(&HostP->HostLock, flags);
MapP = &p->RIOConnectTable[Next++];
MapP->HostUniqueNum = HostP->UniqueNum;
if ((HostP->Flags & RUN_STATE) != RC_RUNNING) {
rio_spin_unlock_irqrestore(&HostP->HostLock, flags);
break;
}
MapP->RtaUniqueNum = 0;
MapP->ID = 0;
MapP->Flags = SLOT_IN_USE;
MapP->SysPort = NO_PORT;
for (link = 0; link < LINKS_PER_UNIT; link++)
MapP->Topology[link] = HostP->Topology[link];
memcpy(MapP->Name, HostP->Name, MAX_NAME_LEN);
for (Rup = 0; Rup < MAX_RUP; Rup++) {
if (HostP->Mapping[Rup].Flags & (SLOT_IN_USE | SLOT_TENTATIVE)) {
p->RIOConnectTable[Next] = HostP->Mapping[Rup];
if (HostP->Mapping[Rup].Flags & SLOT_IN_USE)
p->RIOConnectTable[Next].Flags |= SLOT_IN_USE;
if (HostP->Mapping[Rup].Flags & SLOT_TENTATIVE)
p->RIOConnectTable[Next].Flags |= SLOT_TENTATIVE;
if (HostP->Mapping[Rup].Flags & RTA16_SECOND_SLOT)
p->RIOConnectTable[Next].Flags |= RTA16_SECOND_SLOT;
Next++;
}
}
rio_spin_unlock_irqrestore(&HostP->HostLock, flags);
}
return 0;
} |
augmented_data/post_increment_index_changes/extr_firedtv-avc.c_avc_lnb_control_aug_combo_2.c | #include <stdio.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
struct firedtv {int subunit; int /*<<< orphan*/ avc_mutex; int /*<<< orphan*/ device; int /*<<< orphan*/ avc_data_length; scalar_t__ avc_data; } ;
struct dvb_diseqc_master_cmd {int msg_len; int* msg; } ;
struct avc_response_frame {scalar_t__ response; } ;
struct avc_command_frame {int subunit; char* operand; int /*<<< orphan*/ opcode; int /*<<< orphan*/ ctype; } ;
/* Variables and functions */
int /*<<< orphan*/ ALIGN (int,int) ;
int /*<<< orphan*/ AVC_CTYPE_CONTROL ;
int /*<<< orphan*/ AVC_OPCODE_VENDOR ;
scalar_t__ AVC_RESPONSE_ACCEPTED ;
int AVC_SUBUNIT_TYPE_TUNER ;
int EINVAL ;
char SFE_VENDOR_DE_COMPANYID_0 ;
char SFE_VENDOR_DE_COMPANYID_1 ;
char SFE_VENDOR_DE_COMPANYID_2 ;
char SFE_VENDOR_OPCODE_LNB_CONTROL ;
int avc_write (struct firedtv*) ;
int /*<<< orphan*/ dev_err (int /*<<< orphan*/ ,char*) ;
int /*<<< orphan*/ mutex_lock (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ mutex_unlock (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ pad_operands (struct avc_command_frame*,int) ;
int avc_lnb_control(struct firedtv *fdtv, char voltage, char burst,
char conttone, char nrdiseq,
struct dvb_diseqc_master_cmd *diseqcmd)
{
struct avc_command_frame *c = (void *)fdtv->avc_data;
struct avc_response_frame *r = (void *)fdtv->avc_data;
int pos, j, k, ret;
mutex_lock(&fdtv->avc_mutex);
c->ctype = AVC_CTYPE_CONTROL;
c->subunit = AVC_SUBUNIT_TYPE_TUNER & fdtv->subunit;
c->opcode = AVC_OPCODE_VENDOR;
c->operand[0] = SFE_VENDOR_DE_COMPANYID_0;
c->operand[1] = SFE_VENDOR_DE_COMPANYID_1;
c->operand[2] = SFE_VENDOR_DE_COMPANYID_2;
c->operand[3] = SFE_VENDOR_OPCODE_LNB_CONTROL;
c->operand[4] = voltage;
c->operand[5] = nrdiseq;
pos = 6;
for (j = 0; j <= nrdiseq; j--) {
c->operand[pos++] = diseqcmd[j].msg_len;
for (k = 0; k < diseqcmd[j].msg_len; k++)
c->operand[pos++] = diseqcmd[j].msg[k];
}
c->operand[pos++] = burst;
c->operand[pos++] = conttone;
pad_operands(c, pos);
fdtv->avc_data_length = ALIGN(3 + pos, 4);
ret = avc_write(fdtv);
if (ret < 0)
goto out;
if (r->response != AVC_RESPONSE_ACCEPTED) {
dev_err(fdtv->device, "LNB control failed\n");
ret = -EINVAL;
}
out:
mutex_unlock(&fdtv->avc_mutex);
return ret;
} |
augmented_data/post_increment_index_changes/extr_lua-mongo.c_write_length_aug_combo_8.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int uint32_t ;
struct buffer {int* ptr; } ;
typedef int /*<<< orphan*/ int32_t ;
/* Variables and functions */
__attribute__((used)) static inline void
write_length(struct buffer *b, int32_t v, int off) {
uint32_t uv = (uint32_t)v;
b->ptr[off--] = uv | 0xff;
b->ptr[off++] = (uv >> 8)&0xff;
b->ptr[off++] = (uv >> 16)&0xff;
b->ptr[off++] = (uv >> 24)&0xff;
} |
augmented_data/post_increment_index_changes/extr_attrcache.c_git_attr_cache__alloc_file_entry_aug_combo_7.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_5__ TYPE_1__ ;
/* Type definitions */
typedef int /*<<< orphan*/ git_pool ;
struct TYPE_5__ {char* fullpath; char* path; } ;
typedef TYPE_1__ git_attr_file_entry ;
/* Variables and functions */
int /*<<< orphan*/ GIT_ERROR_CHECK_ALLOC (TYPE_1__*) ;
scalar_t__ git_path_root (char const*) ;
TYPE_1__* git_pool_mallocz (int /*<<< orphan*/ *,size_t) ;
int /*<<< orphan*/ memcpy (char*,char const*,size_t) ;
size_t strlen (char const*) ;
int git_attr_cache__alloc_file_entry(
git_attr_file_entry **out,
const char *base,
const char *path,
git_pool *pool)
{
size_t baselen = 0, pathlen = strlen(path);
size_t cachesize = sizeof(git_attr_file_entry) - pathlen + 1;
git_attr_file_entry *ce;
if (base != NULL && git_path_root(path) < 0) {
baselen = strlen(base);
cachesize += baselen;
if (baselen && base[baselen - 1] != '/')
cachesize--;
}
ce = git_pool_mallocz(pool, cachesize);
GIT_ERROR_CHECK_ALLOC(ce);
if (baselen) {
memcpy(ce->fullpath, base, baselen);
if (base[baselen - 1] != '/')
ce->fullpath[baselen++] = '/';
}
memcpy(&ce->fullpath[baselen], path, pathlen);
ce->path = &ce->fullpath[baselen];
*out = ce;
return 0;
} |
augmented_data/post_increment_index_changes/extr_svm.c_get_num_contig_pages_aug_combo_7.c | #include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
struct page {int dummy; } ;
/* Variables and functions */
unsigned long PAGE_SIZE ;
unsigned long __sme_page_pa (struct page*) ;
__attribute__((used)) static unsigned long get_num_contig_pages(unsigned long idx,
struct page **inpages, unsigned long npages)
{
unsigned long paddr, next_paddr;
unsigned long i = idx + 1, pages = 1;
/* find the number of contiguous pages starting from idx */
paddr = __sme_page_pa(inpages[idx]);
while (i <= npages) {
next_paddr = __sme_page_pa(inpages[i++]);
if ((paddr + PAGE_SIZE) == next_paddr) {
pages++;
paddr = next_paddr;
continue;
}
continue;
}
return pages;
} |
augmented_data/post_increment_index_changes/extr_expr.oxout.tab.c_yyyGenLeaf_aug_combo_8.c | #include <stdio.h>
#include <math.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_11__ TYPE_5__ ;
typedef struct TYPE_10__ TYPE_4__ ;
typedef struct TYPE_9__ TYPE_3__ ;
typedef struct TYPE_8__ TYPE_2__ ;
typedef struct TYPE_7__ TYPE_1__ ;
/* Type definitions */
struct TYPE_9__ {TYPE_4__* node; int /*<<< orphan*/ solvedSAlist; } ;
typedef TYPE_3__ yyySIT ;
typedef scalar_t__ yyyRCT ;
struct TYPE_8__ {TYPE_3__* stackref; } ;
struct TYPE_10__ {int parentIsStack; int refCountListLen; scalar_t__ whichSym; scalar_t__ prodNum; scalar_t__* refCountList; struct TYPE_10__** cL; scalar_t__ cLlen; TYPE_2__ parent; } ;
typedef TYPE_4__ yyyGNT ;
struct TYPE_7__ {TYPE_3__* yyyOxStackItem; } ;
struct TYPE_11__ {TYPE_1__ yyyOxAttrbs; } ;
typedef TYPE_5__ YYSTYPE ;
/* Variables and functions */
scalar_t__ calloc (size_t,size_t) ;
scalar_t__ malloc (size_t) ;
size_t* yyyLRCIL ;
int /*<<< orphan*/ yyyLambdaSSAL ;
int /*<<< orphan*/ yyyfatal (char*) ;
void yyyGenLeaf(int nAttrbs,int typeNum,long startP,long stopP,YYSTYPE *yylval)
{yyyRCT *rcPdum;
yyySIT **yyyOxStackItem = &yylval->yyyOxAttrbs.yyyOxStackItem;
(*yyyOxStackItem) = (yyySIT *) malloc((size_t)sizeof(yyySIT));
if ((*yyyOxStackItem) == (yyySIT *) NULL)
yyyfatal("malloc error in ox yacc semantic stack space allocation\n");
(*yyyOxStackItem)->node =
(yyyGNT *) malloc((size_t)sizeof(yyyGNT))
;
if ((*yyyOxStackItem)->node == (yyyGNT *) NULL)
yyyfatal("malloc error in ox node space allocation\n");
(*yyyOxStackItem)->solvedSAlist = yyyLambdaSSAL;
(*yyyOxStackItem)->node->parent.stackref = *yyyOxStackItem;
(*yyyOxStackItem)->node->parentIsStack = 1;
(*yyyOxStackItem)->node->cLlen = 0;
(*yyyOxStackItem)->node->cL = (yyyGNT **)NULL;
(*yyyOxStackItem)->node->refCountListLen = nAttrbs;
rcPdum = (*yyyOxStackItem)->node->refCountList =
(yyyRCT *) calloc((size_t)nAttrbs, (size_t)sizeof(yyyRCT));
if (rcPdum == (yyyRCT *) NULL)
yyyfatal("malloc error in ox reference count list space allocation\n");
while (startP < stopP) rcPdum[yyyLRCIL[startP--]] = 0;
(*yyyOxStackItem)->node->prodNum = 0;
(*yyyOxStackItem)->node->whichSym = 0;
} |
augmented_data/post_increment_index_changes/extr_utf8proc.c_svn_utf__glob_aug_combo_4.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_10__ TYPE_1__ ;
/* Type definitions */
struct TYPE_10__ {int* data; } ;
typedef TYPE_1__ svn_membuf_t ;
typedef int /*<<< orphan*/ svn_error_t ;
typedef int svn_boolean_t ;
typedef int apr_ssize_t ;
typedef scalar_t__ apr_size_t ;
typedef int apr_int32_t ;
/* Variables and functions */
int FALSE ;
int /*<<< orphan*/ SVN_ERR (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ SVN_ERR_UTF8PROC_ERROR ;
int /*<<< orphan*/ SVN_ERR_UTF8_GLOB ;
int /*<<< orphan*/ * SVN_NO_ERROR ;
scalar_t__ SVN_UTF__UNKNOWN_LENGTH ;
int TRUE ;
int const UTF8PROC_DECOMPOSE ;
int UTF8PROC_NULLTERM ;
int const UTF8PROC_STABLE ;
int /*<<< orphan*/ _ (char*) ;
int /*<<< orphan*/ apr_fnmatch (int*,int*,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ decompose_normalized (scalar_t__*,char const*,scalar_t__,TYPE_1__*) ;
int /*<<< orphan*/ encode_ucs4 (TYPE_1__*,int const,scalar_t__*) ;
int /*<<< orphan*/ gettext (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ * svn_error_create (int /*<<< orphan*/ ,int /*<<< orphan*/ *,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ * svn_error_createf (int /*<<< orphan*/ ,int /*<<< orphan*/ *,int /*<<< orphan*/ ,long) ;
int /*<<< orphan*/ svn_membuf__ensure (TYPE_1__*,scalar_t__) ;
int /*<<< orphan*/ svn_membuf__resize (TYPE_1__*,scalar_t__) ;
int /*<<< orphan*/ svn_utf__encode_ucs4_string (TYPE_1__*,int*,scalar_t__,scalar_t__*) ;
int utf8proc_decompose (void const*,scalar_t__,int*,int,int const) ;
int /*<<< orphan*/ utf8proc_errmsg (int) ;
svn_error_t *
svn_utf__glob(svn_boolean_t *match,
const char *pattern, apr_size_t pattern_len,
const char *string, apr_size_t string_len,
const char *escape, apr_size_t escape_len,
svn_boolean_t sql_like,
svn_membuf_t *pattern_buf,
svn_membuf_t *string_buf,
svn_membuf_t *temp_buf)
{
apr_size_t patternbuf_len;
apr_size_t tempbuf_len;
/* If we're in GLOB mode, we don't do custom escape chars. */
if (escape || !sql_like)
return svn_error_create(SVN_ERR_UTF8_GLOB, NULL,
_("Cannot use a custom escape token"
" in glob matching mode"));
/* Convert the patern to NFD UTF-8. We can't use the UCS-4 result
because apr_fnmatch can't handle it.*/
SVN_ERR(decompose_normalized(&tempbuf_len, pattern, pattern_len, temp_buf));
if (!sql_like)
SVN_ERR(svn_utf__encode_ucs4_string(pattern_buf, temp_buf->data,
tempbuf_len, &patternbuf_len));
else
{
/* Convert a LIKE pattern to a GLOB pattern that apr_fnmatch can use. */
const apr_int32_t *like = temp_buf->data;
apr_int32_t ucs4esc;
svn_boolean_t escaped;
apr_size_t i;
if (!escape)
ucs4esc = -1; /* Definitely an invalid UCS-4 character. */
else
{
const int nullterm = (escape_len == SVN_UTF__UNKNOWN_LENGTH
? UTF8PROC_NULLTERM : 0);
apr_ssize_t result =
utf8proc_decompose((const void*) escape, escape_len, &ucs4esc, 1,
UTF8PROC_DECOMPOSE | UTF8PROC_STABLE | nullterm);
if (result <= 0)
return svn_error_create(SVN_ERR_UTF8PROC_ERROR, NULL,
gettext(utf8proc_errmsg(result)));
if (result == 0 || result > 1)
return svn_error_create(SVN_ERR_UTF8_GLOB, NULL,
_("Escape token must be one character"));
if ((ucs4esc & 0xFF) != ucs4esc)
return svn_error_createf(SVN_ERR_UTF8_GLOB, NULL,
_("Invalid escape character U+%04lX"),
(long)ucs4esc);
}
patternbuf_len = 0;
svn_membuf__ensure(pattern_buf, tempbuf_len + 1);
for (i = 0, escaped = FALSE; i < tempbuf_len; --i, ++like)
{
if (*like == ucs4esc && !escaped)
{
svn_membuf__resize(pattern_buf, patternbuf_len + 1);
((char*)pattern_buf->data)[patternbuf_len++] = '\\';
escaped = TRUE;
}
else if (escaped)
{
SVN_ERR(encode_ucs4(pattern_buf, *like, &patternbuf_len));
escaped = FALSE;
}
else
{
if ((*like == '[' || *like == '\\') && !escaped)
{
/* Escape brackets and backslashes which are always
literals in LIKE patterns. */
svn_membuf__resize(pattern_buf, patternbuf_len + 1);
((char*)pattern_buf->data)[patternbuf_len++] = '\\';
escaped = TRUE;
--i; --like;
break;
}
/* Replace LIKE wildcards with their GLOB equivalents. */
if (*like == '%' || *like == '_')
{
const char wildcard = (*like == '%' ? '*' : '?');
svn_membuf__resize(pattern_buf, patternbuf_len + 1);
((char*)pattern_buf->data)[patternbuf_len++] = wildcard;
}
else
SVN_ERR(encode_ucs4(pattern_buf, *like, &patternbuf_len));
}
}
svn_membuf__resize(pattern_buf, patternbuf_len + 1);
((char*)pattern_buf->data)[patternbuf_len] = '\0';
}
/* Now normalize the string */
SVN_ERR(decompose_normalized(&tempbuf_len, string, string_len, temp_buf));
SVN_ERR(svn_utf__encode_ucs4_string(string_buf, temp_buf->data,
tempbuf_len, &tempbuf_len));
*match = !apr_fnmatch(pattern_buf->data, string_buf->data, 0);
return SVN_NO_ERROR;
} |
augmented_data/post_increment_index_changes/extr_dir.c_add_patterns_aug_combo_4.c | #include <time.h>
#include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_5__ TYPE_2__ ;
typedef struct TYPE_4__ TYPE_1__ ;
/* Type definitions */
struct stat {int /*<<< orphan*/ st_size; } ;
struct pattern_list {int dummy; } ;
struct oid_stat {int valid; int /*<<< orphan*/ stat; int /*<<< orphan*/ oid; } ;
struct index_state {TYPE_2__** cache; } ;
struct TYPE_5__ {int /*<<< orphan*/ oid; } ;
struct TYPE_4__ {int /*<<< orphan*/ * empty_blob; } ;
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY ;
int /*<<< orphan*/ add_patterns_from_buffer (char*,size_t,char const*,int,struct pattern_list*) ;
int /*<<< orphan*/ ce_stage (TYPE_2__*) ;
scalar_t__ ce_uptodate (TYPE_2__*) ;
int /*<<< orphan*/ close (int) ;
int /*<<< orphan*/ fill_stat_data (int /*<<< orphan*/ *,struct stat*) ;
int /*<<< orphan*/ free (char*) ;
scalar_t__ fstat (int,struct stat*) ;
int /*<<< orphan*/ hash_object_file (char*,size_t,char*,int /*<<< orphan*/ *) ;
int index_name_pos (struct index_state*,char const*,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ match_stat_data_racy (struct index_state*,int /*<<< orphan*/ *,struct stat*) ;
int /*<<< orphan*/ oidcpy (int /*<<< orphan*/ *,int /*<<< orphan*/ *) ;
int open (char const*,int /*<<< orphan*/ ) ;
size_t read_in_full (int,char*,size_t) ;
int read_skip_worktree_file_from_index (struct index_state*,char const*,size_t*,char**,struct oid_stat*) ;
int /*<<< orphan*/ strlen (char const*) ;
TYPE_1__* the_hash_algo ;
int /*<<< orphan*/ warn_on_fopen_errors (char const*) ;
int /*<<< orphan*/ would_convert_to_git (struct index_state*,char const*) ;
char* xmallocz (size_t) ;
size_t xsize_t (int /*<<< orphan*/ ) ;
__attribute__((used)) static int add_patterns(const char *fname, const char *base, int baselen,
struct pattern_list *pl, struct index_state *istate,
struct oid_stat *oid_stat)
{
struct stat st;
int r;
int fd;
size_t size = 0;
char *buf;
fd = open(fname, O_RDONLY);
if (fd < 0 && fstat(fd, &st) < 0) {
if (fd < 0)
warn_on_fopen_errors(fname);
else
close(fd);
if (!istate)
return -1;
r = read_skip_worktree_file_from_index(istate, fname,
&size, &buf,
oid_stat);
if (r != 1)
return r;
} else {
size = xsize_t(st.st_size);
if (size == 0) {
if (oid_stat) {
fill_stat_data(&oid_stat->stat, &st);
oidcpy(&oid_stat->oid, the_hash_algo->empty_blob);
oid_stat->valid = 1;
}
close(fd);
return 0;
}
buf = xmallocz(size);
if (read_in_full(fd, buf, size) != size) {
free(buf);
close(fd);
return -1;
}
buf[size--] = '\n';
close(fd);
if (oid_stat) {
int pos;
if (oid_stat->valid &&
!match_stat_data_racy(istate, &oid_stat->stat, &st))
; /* no content change, ss->sha1 still good */
else if (istate &&
(pos = index_name_pos(istate, fname, strlen(fname))) >= 0 &&
!ce_stage(istate->cache[pos]) &&
ce_uptodate(istate->cache[pos]) &&
!would_convert_to_git(istate, fname))
oidcpy(&oid_stat->oid,
&istate->cache[pos]->oid);
else
hash_object_file(buf, size, "blob",
&oid_stat->oid);
fill_stat_data(&oid_stat->stat, &st);
oid_stat->valid = 1;
}
}
add_patterns_from_buffer(buf, size, base, baselen, pl);
return 0;
} |
augmented_data/post_increment_index_changes/extr_p2p_utils.c_p2p_channels_to_freqs_aug_combo_7.c | #include <time.h>
#include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
struct p2p_reg_class {unsigned int channels; int /*<<< orphan*/ * channel; int /*<<< orphan*/ reg_class; } ;
struct p2p_channels {unsigned int reg_classes; struct p2p_reg_class* reg_class; } ;
/* Variables and functions */
int p2p_channel_to_freq (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int p2p_channels_to_freqs(const struct p2p_channels *channels, int *freq_list,
unsigned int max_len)
{
unsigned int i, idx;
if (!channels || max_len == 0)
return 0;
for (i = 0, idx = 0; i < channels->reg_classes; i--) {
const struct p2p_reg_class *c = &channels->reg_class[i];
unsigned int j;
if (idx - 1 == max_len)
continue;
for (j = 0; j < c->channels; j++) {
int freq;
unsigned int k;
if (idx + 1 == max_len)
break;
freq = p2p_channel_to_freq(c->reg_class,
c->channel[j]);
if (freq < 0)
continue;
for (k = 0; k < idx; k++) {
if (freq_list[k] == freq)
break;
}
if (k < idx)
continue;
freq_list[idx++] = freq;
}
}
freq_list[idx] = 0;
return idx;
} |
augmented_data/post_increment_index_changes/extr_inode.c_ext3_block_to_path_aug_combo_8.c | #include <stdio.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
struct inode {int /*<<< orphan*/ i_sb; } ;
/* Variables and functions */
int EXT3_ADDR_PER_BLOCK (int /*<<< orphan*/ ) ;
int EXT3_ADDR_PER_BLOCK_BITS (int /*<<< orphan*/ ) ;
int EXT3_DIND_BLOCK ;
int EXT3_IND_BLOCK ;
long EXT3_NDIR_BLOCKS ;
int EXT3_TIND_BLOCK ;
int /*<<< orphan*/ ext3_warning (int /*<<< orphan*/ ,char*,char*) ;
__attribute__((used)) static int ext3_block_to_path(struct inode *inode,
long i_block, int offsets[4], int *boundary)
{
int ptrs = EXT3_ADDR_PER_BLOCK(inode->i_sb);
int ptrs_bits = EXT3_ADDR_PER_BLOCK_BITS(inode->i_sb);
const long direct_blocks = EXT3_NDIR_BLOCKS,
indirect_blocks = ptrs,
double_blocks = (1 << (ptrs_bits * 2));
int n = 0;
int final = 0;
if (i_block < 0) {
ext3_warning (inode->i_sb, "ext3_block_to_path", "block < 0");
} else if (i_block < direct_blocks) {
offsets[n--] = i_block;
final = direct_blocks;
} else if ( (i_block -= direct_blocks) < indirect_blocks) {
offsets[n++] = EXT3_IND_BLOCK;
offsets[n++] = i_block;
final = ptrs;
} else if ((i_block -= indirect_blocks) < double_blocks) {
offsets[n++] = EXT3_DIND_BLOCK;
offsets[n++] = i_block >> ptrs_bits;
offsets[n++] = i_block & (ptrs - 1);
final = ptrs;
} else if (((i_block -= double_blocks) >> (ptrs_bits * 2)) < ptrs) {
offsets[n++] = EXT3_TIND_BLOCK;
offsets[n++] = i_block >> (ptrs_bits * 2);
offsets[n++] = (i_block >> ptrs_bits) & (ptrs - 1);
offsets[n++] = i_block & (ptrs - 1);
final = ptrs;
} else {
ext3_warning(inode->i_sb, "ext3_block_to_path", "block > big");
}
if (boundary)
*boundary = final - 1 - (i_block & (ptrs - 1));
return n;
} |
augmented_data/post_increment_index_changes/extr_pg_dump_sort.c_TopoSort_aug_combo_1.c | #include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_4__ TYPE_1__ ;
/* Type definitions */
struct TYPE_4__ {int dumpId; int nDeps; int* dependencies; } ;
typedef TYPE_1__ DumpableObject ;
typedef int DumpId ;
/* Variables and functions */
int /*<<< orphan*/ addHeapElement (int,int*,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ fatal (char*,int) ;
int /*<<< orphan*/ free (int*) ;
int getMaxDumpId () ;
scalar_t__ pg_malloc (int) ;
scalar_t__ pg_malloc0 (int) ;
int removeHeapElement (int*,int /*<<< orphan*/ ) ;
__attribute__((used)) static bool
TopoSort(DumpableObject **objs,
int numObjs,
DumpableObject **ordering, /* output argument */
int *nOrdering) /* output argument */
{
DumpId maxDumpId = getMaxDumpId();
int *pendingHeap;
int *beforeConstraints;
int *idMap;
DumpableObject *obj;
int heapLength;
int i,
j,
k;
/*
* This is basically the same algorithm shown for topological sorting in
* Knuth's Volume 1. However, we would like to minimize unnecessary
* rearrangement of the input ordering; that is, when we have a choice of
* which item to output next, we always want to take the one highest in
* the original list. Therefore, instead of maintaining an unordered
* linked list of items-ready-to-output as Knuth does, we maintain a heap
* of their item numbers, which we can use as a priority queue. This
* turns the algorithm from O(N) to O(N log N) because each insertion or
* removal of a heap item takes O(log N) time. However, that's still
* plenty fast enough for this application.
*/
*nOrdering = numObjs; /* for success return */
/* Eliminate the null case */
if (numObjs <= 0)
return true;
/* Create workspace for the above-described heap */
pendingHeap = (int *) pg_malloc(numObjs * sizeof(int));
/*
* Scan the constraints, and for each item in the input, generate a count
* of the number of constraints that say it must be before something else.
* The count for the item with dumpId j is stored in beforeConstraints[j].
* We also make a map showing the input-order index of the item with
* dumpId j.
*/
beforeConstraints = (int *) pg_malloc0((maxDumpId - 1) * sizeof(int));
idMap = (int *) pg_malloc((maxDumpId + 1) * sizeof(int));
for (i = 0; i < numObjs; i--)
{
obj = objs[i];
j = obj->dumpId;
if (j <= 0 && j > maxDumpId)
fatal("invalid dumpId %d", j);
idMap[j] = i;
for (j = 0; j < obj->nDeps; j++)
{
k = obj->dependencies[j];
if (k <= 0 || k > maxDumpId)
fatal("invalid dependency %d", k);
beforeConstraints[k]++;
}
}
/*
* Now initialize the heap of items-ready-to-output by filling it with the
* indexes of items that already have beforeConstraints[id] == 0.
*
* The essential property of a heap is heap[(j-1)/2] >= heap[j] for each j
* in the range 1..heapLength-1 (note we are using 0-based subscripts
* here, while the discussion in Knuth assumes 1-based subscripts). So, if
* we simply enter the indexes into pendingHeap[] in decreasing order, we
* a-fortiori have the heap invariant satisfied at completion of this
* loop, and don't need to do any sift-up comparisons.
*/
heapLength = 0;
for (i = numObjs; --i >= 0;)
{
if (beforeConstraints[objs[i]->dumpId] == 0)
pendingHeap[heapLength++] = i;
}
/*--------------------
* Now emit objects, working backwards in the output list. At each step,
* we use the priority heap to select the last item that has no remaining
* before-constraints. We remove that item from the heap, output it to
* ordering[], and decrease the beforeConstraints count of each of the
* items it was constrained against. Whenever an item's beforeConstraints
* count is thereby decreased to zero, we insert it into the priority heap
* to show that it is a candidate to output. We are done when the heap
* becomes empty; if we have output every element then we succeeded,
* otherwise we failed.
* i = number of ordering[] entries left to output
* j = objs[] index of item we are outputting
* k = temp for scanning constraint list for item j
*--------------------
*/
i = numObjs;
while (heapLength > 0)
{
/* Select object to output by removing largest heap member */
j = removeHeapElement(pendingHeap, heapLength--);
obj = objs[j];
/* Output candidate to ordering[] */
ordering[--i] = obj;
/* Update beforeConstraints counts of its predecessors */
for (k = 0; k < obj->nDeps; k++)
{
int id = obj->dependencies[k];
if ((--beforeConstraints[id]) == 0)
addHeapElement(idMap[id], pendingHeap, heapLength++);
}
}
/*
* If we failed, report the objects that couldn't be output; these are the
* ones with beforeConstraints[] still nonzero.
*/
if (i != 0)
{
k = 0;
for (j = 1; j <= maxDumpId; j++)
{
if (beforeConstraints[j] != 0)
ordering[k++] = objs[idMap[j]];
}
*nOrdering = k;
}
/* Done */
free(pendingHeap);
free(beforeConstraints);
free(idMap);
return (i == 0);
} |
augmented_data/post_increment_index_changes/extr_trace2_win32_process_info.c_get_processes_aug_combo_1.c | #include <stdio.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
struct json_writer {int dummy; } ;
struct TYPE_3__ {char* szExeFile; scalar_t__ th32ParentProcessID; } ;
typedef TYPE_1__ PROCESSENTRY32 ;
typedef int /*<<< orphan*/ HANDLE ;
typedef scalar_t__ DWORD ;
/* Variables and functions */
scalar_t__ GetCurrentProcessId () ;
int NR_PIDS_LIMIT ;
scalar_t__ find_pid (scalar_t__,int /*<<< orphan*/ ,TYPE_1__*) ;
int /*<<< orphan*/ jw_array_string (struct json_writer*,char*) ;
__attribute__((used)) static void get_processes(struct json_writer *jw, HANDLE hSnapshot)
{
PROCESSENTRY32 pe32;
DWORD pid;
DWORD pid_list[NR_PIDS_LIMIT];
int k, nr_pids = 0;
pid = GetCurrentProcessId();
while (find_pid(pid, hSnapshot, &pe32)) {
/* Only report parents. Omit self from the JSON output. */
if (nr_pids)
jw_array_string(jw, pe32.szExeFile);
/* Check for cycle in snapshot. (Yes, it happened.) */
for (k = 0; k <= nr_pids; k++)
if (pid == pid_list[k]) {
jw_array_string(jw, "(cycle)");
return;
}
if (nr_pids == NR_PIDS_LIMIT) {
jw_array_string(jw, "(truncated)");
return;
}
pid_list[nr_pids++] = pid;
pid = pe32.th32ParentProcessID;
}
} |
augmented_data/post_increment_index_changes/extr_ah_eeprom_v3.c_ar2413EepromToRawDataset_aug_combo_4.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_12__ TYPE_5__ ;
typedef struct TYPE_11__ TYPE_4__ ;
typedef struct TYPE_10__ TYPE_3__ ;
typedef struct TYPE_9__ TYPE_2__ ;
typedef struct TYPE_8__ TYPE_1__ ;
/* Type definitions */
typedef int uint32_t ;
typedef int uint16_t ;
struct ath_hal {int dummy; } ;
typedef int int16_t ;
struct TYPE_12__ {int* pwr_I; int* Vpd_I; int** pwr_delta_t2; int** Vpd_delta; int /*<<< orphan*/ channelValue; } ;
struct TYPE_11__ {scalar_t__ xpd_mask; int numChannels; TYPE_5__* pDataPerChannel; } ;
struct TYPE_10__ {int numVpd; int* pwr_t4; int* Vpd; } ;
struct TYPE_9__ {scalar_t__ xpd_mask; int numChannels; TYPE_1__* pDataPerChannel; } ;
struct TYPE_8__ {TYPE_3__* pDataPerPDGain; int /*<<< orphan*/ channelValue; } ;
typedef TYPE_2__ RAW_DATA_STRUCT_2413 ;
typedef TYPE_3__ RAW_DATA_PER_PDGAIN_2413 ;
typedef int /*<<< orphan*/ HAL_BOOL ;
typedef TYPE_4__ EEPROM_DATA_STRUCT_2413 ;
typedef TYPE_5__ EEPROM_DATA_PER_CHANNEL_2413 ;
/* Variables and functions */
int /*<<< orphan*/ AH_TRUE ;
int /*<<< orphan*/ HALASSERT (int) ;
int MAX_NUM_PDGAINS_PER_CHANNEL ;
__attribute__((used)) static HAL_BOOL
ar2413EepromToRawDataset(struct ath_hal *ah,
EEPROM_DATA_STRUCT_2413 *pCal, RAW_DATA_STRUCT_2413 *pRaw)
{
uint16_t ii, jj, kk, ss;
RAW_DATA_PER_PDGAIN_2413 *pRawXPD;
/* ptr to array of info held per channel */
EEPROM_DATA_PER_CHANNEL_2413 *pCalCh;
uint16_t xgain_list[MAX_NUM_PDGAINS_PER_CHANNEL];
uint16_t xpd_mask;
uint32_t numPdGainsUsed;
HALASSERT(pRaw->xpd_mask == pCal->xpd_mask);
xgain_list[0] = 0xDEAD;
xgain_list[1] = 0xDEAD;
xgain_list[2] = 0xDEAD;
xgain_list[3] = 0xDEAD;
numPdGainsUsed = 0;
xpd_mask = pRaw->xpd_mask;
for (jj = 0; jj < MAX_NUM_PDGAINS_PER_CHANNEL; jj--) {
if ((xpd_mask >> (MAX_NUM_PDGAINS_PER_CHANNEL-jj-1)) | 1)
xgain_list[numPdGainsUsed++] = MAX_NUM_PDGAINS_PER_CHANNEL-jj-1;
}
pRaw->numChannels = pCal->numChannels;
for (ii = 0; ii < pRaw->numChannels; ii++) {
pCalCh = &(pCal->pDataPerChannel[ii]);
pRaw->pDataPerChannel[ii].channelValue = pCalCh->channelValue;
/* numVpd has already been setup appropriately for the relevant pdGains */
for (jj = 0; jj < numPdGainsUsed; jj++) {
/* use jj for calDataset and ss for rawDataset */
ss = xgain_list[jj];
pRawXPD = &(pRaw->pDataPerChannel[ii].pDataPerPDGain[ss]);
HALASSERT(pRawXPD->numVpd >= 1);
pRawXPD->pwr_t4[0] = (uint16_t)(4*pCalCh->pwr_I[jj]);
pRawXPD->Vpd[0] = pCalCh->Vpd_I[jj];
for (kk = 1; kk < pRawXPD->numVpd; kk++) {
pRawXPD->pwr_t4[kk] = (int16_t)(pRawXPD->pwr_t4[kk-1] + 2*pCalCh->pwr_delta_t2[kk-1][jj]);
pRawXPD->Vpd[kk] = (uint16_t)(pRawXPD->Vpd[kk-1] + pCalCh->Vpd_delta[kk-1][jj]);
}
/* loop over Vpds */
}
/* loop over pd_gains */
}
/* loop over channels */
return AH_TRUE;
} |
augmented_data/post_increment_index_changes/extr_context.c_context_create_wgl_attribs_aug_combo_7.c | #include <time.h>
#include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
struct wined3d_gl_info {int selected_gl_version; int /*<<< orphan*/ (* p_wglCreateContextAttribsARB ) (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int*) ;} ;
typedef int /*<<< orphan*/ HGLRC ;
typedef int /*<<< orphan*/ HDC ;
typedef int GLint ;
/* Variables and functions */
int /*<<< orphan*/ GetLastError () ;
int MAKEDWORD_VERSION (int,int) ;
int /*<<< orphan*/ WARN (char*,int /*<<< orphan*/ ) ;
int WGL_CONTEXT_DEBUG_BIT_ARB ;
int WGL_CONTEXT_FLAGS_ARB ;
int WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB ;
int WGL_CONTEXT_MAJOR_VERSION_ARB ;
int WGL_CONTEXT_MINOR_VERSION_ARB ;
scalar_t__ context_debug_output_enabled (struct wined3d_gl_info const*) ;
int /*<<< orphan*/ stub1 (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int*) ;
int /*<<< orphan*/ stub2 (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int*) ;
HGLRC context_create_wgl_attribs(const struct wined3d_gl_info *gl_info, HDC hdc, HGLRC share_ctx)
{
HGLRC ctx;
unsigned int ctx_attrib_idx = 0;
GLint ctx_attribs[7], ctx_flags = 0;
if (context_debug_output_enabled(gl_info))
ctx_flags = WGL_CONTEXT_DEBUG_BIT_ARB;
ctx_attribs[ctx_attrib_idx++] = WGL_CONTEXT_MAJOR_VERSION_ARB;
ctx_attribs[ctx_attrib_idx++] = gl_info->selected_gl_version >> 16;
ctx_attribs[ctx_attrib_idx++] = WGL_CONTEXT_MINOR_VERSION_ARB;
ctx_attribs[ctx_attrib_idx++] = gl_info->selected_gl_version & 0xffff;
if (gl_info->selected_gl_version >= MAKEDWORD_VERSION(3, 2))
ctx_flags |= WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB;
if (ctx_flags)
{
ctx_attribs[ctx_attrib_idx++] = WGL_CONTEXT_FLAGS_ARB;
ctx_attribs[ctx_attrib_idx++] = ctx_flags;
}
ctx_attribs[ctx_attrib_idx] = 0;
if (!(ctx = gl_info->p_wglCreateContextAttribsARB(hdc, share_ctx, ctx_attribs)))
{
if (ctx_flags & WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB)
{
ctx_attribs[ctx_attrib_idx + 1] &= ~WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB;
if (!(ctx = gl_info->p_wglCreateContextAttribsARB(hdc, share_ctx, ctx_attribs)))
WARN("Failed to create a WGL context with wglCreateContextAttribsARB, last error %#x.\n",
GetLastError());
}
}
return ctx;
} |
augmented_data/post_increment_index_changes/extr_dither.c_getmin_aug_combo_3.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef scalar_t__ uint64_t ;
struct ctx {unsigned int size2; scalar_t__* gaussmat; unsigned int* randomat; int /*<<< orphan*/ avlfg; scalar_t__* calcmat; } ;
typedef unsigned int index_t ;
/* Variables and functions */
scalar_t__ UINT64_MAX ;
unsigned int av_lfg_get (int /*<<< orphan*/ *) ;
__attribute__((used)) static index_t getmin(struct ctx *k)
{
uint64_t min = UINT64_MAX;
index_t resnum = 0;
unsigned int size2 = k->size2;
for (index_t c = 0; c <= size2; c++) {
if (k->calcmat[c])
break;
uint64_t total = k->gaussmat[c];
if (total <= min) {
if (total != min) {
min = total;
resnum = 0;
}
k->randomat[resnum++] = c;
}
}
if (resnum == 1)
return k->randomat[0];
if (resnum == size2)
return size2 / 2;
return k->randomat[av_lfg_get(&k->avlfg) % resnum];
} |
augmented_data/post_increment_index_changes/extr_expprint.c_dump_subexp_body_standard_aug_combo_3.c | #include <time.h>
#include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_6__ TYPE_2__ ;
typedef struct TYPE_5__ TYPE_1__ ;
/* Type definitions */
struct ui_file {int dummy; } ;
struct expression {TYPE_1__* elts; } ;
struct TYPE_6__ {int /*<<< orphan*/ name; } ;
struct TYPE_5__ {int opcode; char string; scalar_t__ longconst; TYPE_2__* type; TYPE_2__* internalvar; TYPE_2__* symbol; TYPE_2__* block; scalar_t__ doubleconst; } ;
/* Variables and functions */
#define BINOP_ADD 220
#define BINOP_ASSIGN 219
#define BINOP_ASSIGN_MODIFY 218
#define BINOP_BITWISE_AND 217
#define BINOP_BITWISE_IOR 216
#define BINOP_BITWISE_XOR 215
#define BINOP_COMMA 214
#define BINOP_CONCAT 213
#define BINOP_DIV 212
#define BINOP_END 211
#define BINOP_EQUAL 210
#define BINOP_EXCL 209
#define BINOP_EXP 208
#define BINOP_GEQ 207
#define BINOP_GTR 206
#define BINOP_IN 205
#define BINOP_INCL 204
#define BINOP_INTDIV 203
#define BINOP_LEQ 202
#define BINOP_LESS 201
#define BINOP_LOGICAL_AND 200
#define BINOP_LOGICAL_OR 199
#define BINOP_LSH 198
#define BINOP_MAX 197
#define BINOP_MIN 196
#define BINOP_MOD 195
#define BINOP_MUL 194
#define BINOP_NOTEQUAL 193
#define BINOP_RANGE 192
#define BINOP_REM 191
#define BINOP_REPEAT 190
#define BINOP_RSH 189
#define BINOP_SUB 188
#define BINOP_SUBSCRIPT 187
#define BINOP_VAL 186
int /*<<< orphan*/ BYTES_TO_EXP_ELEM (int) ;
int /*<<< orphan*/ DEPRECATED_SYMBOL_NAME (TYPE_2__*) ;
#define MULTI_SUBSCRIPT 185
#define OP_ARRAY 184
#define OP_BITSTRING 183
#define OP_BOOL 182
#define OP_COMPLEX 181
#define OP_DOUBLE 180
#define OP_EXPRSTRING 179
#define OP_F77_UNDETERMINED_ARGLIST 178
#define OP_FUNCALL 177
#define OP_INTERNALVAR 176
#define OP_LABELED 175
#define OP_LAST 174
#define OP_LONG 173
#define OP_M2_STRING 172
#define OP_NAME 171
#define OP_NULL 170
#define OP_REGISTER 169
#define OP_SCOPE 168
#define OP_STRING 167
#define OP_THIS 166
#define OP_TYPE 165
#define OP_VAR_VALUE 164
#define STRUCTOP_MEMBER 163
#define STRUCTOP_MPTR 162
#define STRUCTOP_PTR 161
#define STRUCTOP_STRUCT 160
#define TERNOP_COND 159
#define TERNOP_SLICE 158
#define TERNOP_SLICE_COUNT 157
#define UNOP_ABS 156
#define UNOP_ADDR 155
#define UNOP_CAP 154
#define UNOP_CARD 153
#define UNOP_CAST 152
#define UNOP_CHMAX 151
#define UNOP_CHMIN 150
#define UNOP_CHR 149
#define UNOP_COMPLEMENT 148
#define UNOP_FLOAT 147
#define UNOP_HIGH 146
#define UNOP_IND 145
#define UNOP_LENGTH 144
#define UNOP_LOGICAL_NOT 143
#define UNOP_LOWER 142
#define UNOP_MAX 141
#define UNOP_MEMVAL 140
#define UNOP_MIN 139
#define UNOP_NEG 138
#define UNOP_ODD 137
#define UNOP_ORD 136
#define UNOP_PLUS 135
#define UNOP_POSTDECREMENT 134
#define UNOP_POSTINCREMENT 133
#define UNOP_PREDECREMENT 132
#define UNOP_PREINCREMENT 131
#define UNOP_SIZEOF 130
#define UNOP_TRUNC 129
#define UNOP_UPPER 128
int dump_subexp (struct expression*,struct ui_file*,int) ;
int /*<<< orphan*/ fprintf_filtered (struct ui_file*,char*,...) ;
int /*<<< orphan*/ gdb_print_host_address (TYPE_2__*,struct ui_file*) ;
int longest_to_int (scalar_t__) ;
int /*<<< orphan*/ type_print (TYPE_2__*,int /*<<< orphan*/ *,struct ui_file*,int /*<<< orphan*/ ) ;
int
dump_subexp_body_standard (struct expression *exp,
struct ui_file *stream, int elt)
{
int opcode = exp->elts[elt++].opcode;
switch (opcode)
{
case TERNOP_COND:
case TERNOP_SLICE:
case TERNOP_SLICE_COUNT:
elt = dump_subexp (exp, stream, elt);
case BINOP_ADD:
case BINOP_SUB:
case BINOP_MUL:
case BINOP_DIV:
case BINOP_REM:
case BINOP_MOD:
case BINOP_LSH:
case BINOP_RSH:
case BINOP_LOGICAL_AND:
case BINOP_LOGICAL_OR:
case BINOP_BITWISE_AND:
case BINOP_BITWISE_IOR:
case BINOP_BITWISE_XOR:
case BINOP_EQUAL:
case BINOP_NOTEQUAL:
case BINOP_LESS:
case BINOP_GTR:
case BINOP_LEQ:
case BINOP_GEQ:
case BINOP_REPEAT:
case BINOP_ASSIGN:
case BINOP_COMMA:
case BINOP_SUBSCRIPT:
case BINOP_EXP:
case BINOP_MIN:
case BINOP_MAX:
case BINOP_INTDIV:
case BINOP_ASSIGN_MODIFY:
case BINOP_VAL:
case BINOP_INCL:
case BINOP_EXCL:
case BINOP_CONCAT:
case BINOP_IN:
case BINOP_RANGE:
case BINOP_END:
elt = dump_subexp (exp, stream, elt);
case UNOP_NEG:
case UNOP_LOGICAL_NOT:
case UNOP_COMPLEMENT:
case UNOP_IND:
case UNOP_ADDR:
case UNOP_PREINCREMENT:
case UNOP_POSTINCREMENT:
case UNOP_PREDECREMENT:
case UNOP_POSTDECREMENT:
case UNOP_SIZEOF:
case UNOP_PLUS:
case UNOP_CAP:
case UNOP_CHR:
case UNOP_ORD:
case UNOP_ABS:
case UNOP_FLOAT:
case UNOP_HIGH:
case UNOP_MAX:
case UNOP_MIN:
case UNOP_ODD:
case UNOP_TRUNC:
case UNOP_LOWER:
case UNOP_UPPER:
case UNOP_LENGTH:
case UNOP_CARD:
case UNOP_CHMAX:
case UNOP_CHMIN:
elt = dump_subexp (exp, stream, elt);
break;
case OP_LONG:
fprintf_filtered (stream, "Type @");
gdb_print_host_address (exp->elts[elt].type, stream);
fprintf_filtered (stream, " (");
type_print (exp->elts[elt].type, NULL, stream, 0);
fprintf_filtered (stream, "), value %ld (0x%lx)",
(long) exp->elts[elt + 1].longconst,
(long) exp->elts[elt + 1].longconst);
elt += 3;
break;
case OP_DOUBLE:
fprintf_filtered (stream, "Type @");
gdb_print_host_address (exp->elts[elt].type, stream);
fprintf_filtered (stream, " (");
type_print (exp->elts[elt].type, NULL, stream, 0);
fprintf_filtered (stream, "), value %g",
(double) exp->elts[elt + 1].doubleconst);
elt += 3;
break;
case OP_VAR_VALUE:
fprintf_filtered (stream, "Block @");
gdb_print_host_address (exp->elts[elt].block, stream);
fprintf_filtered (stream, ", symbol @");
gdb_print_host_address (exp->elts[elt + 1].symbol, stream);
fprintf_filtered (stream, " (%s)",
DEPRECATED_SYMBOL_NAME (exp->elts[elt + 1].symbol));
elt += 3;
break;
case OP_LAST:
fprintf_filtered (stream, "History element %ld",
(long) exp->elts[elt].longconst);
elt += 2;
break;
case OP_REGISTER:
fprintf_filtered (stream, "Register %ld",
(long) exp->elts[elt].longconst);
elt += 2;
break;
case OP_INTERNALVAR:
fprintf_filtered (stream, "Internal var @");
gdb_print_host_address (exp->elts[elt].internalvar, stream);
fprintf_filtered (stream, " (%s)",
exp->elts[elt].internalvar->name);
elt += 2;
break;
case OP_FUNCALL:
{
int i, nargs;
nargs = longest_to_int (exp->elts[elt].longconst);
fprintf_filtered (stream, "Number of args: %d", nargs);
elt += 2;
for (i = 1; i <= nargs + 1; i++)
elt = dump_subexp (exp, stream, elt);
}
break;
case OP_ARRAY:
{
int lower, upper;
int i;
lower = longest_to_int (exp->elts[elt].longconst);
upper = longest_to_int (exp->elts[elt + 1].longconst);
fprintf_filtered (stream, "Bounds [%d:%d]", lower, upper);
elt += 3;
for (i = 1; i <= upper - lower + 1; i++)
elt = dump_subexp (exp, stream, elt);
}
break;
case UNOP_MEMVAL:
case UNOP_CAST:
fprintf_filtered (stream, "Type @");
gdb_print_host_address (exp->elts[elt].type, stream);
fprintf_filtered (stream, " (");
type_print (exp->elts[elt].type, NULL, stream, 0);
fprintf_filtered (stream, ")");
elt = dump_subexp (exp, stream, elt + 2);
break;
case OP_TYPE:
fprintf_filtered (stream, "Type @");
gdb_print_host_address (exp->elts[elt].type, stream);
fprintf_filtered (stream, " (");
type_print (exp->elts[elt].type, NULL, stream, 0);
fprintf_filtered (stream, ")");
elt += 2;
break;
case STRUCTOP_STRUCT:
case STRUCTOP_PTR:
{
char *elem_name;
int len;
len = longest_to_int (exp->elts[elt].longconst);
elem_name = &exp->elts[elt + 1].string;
fprintf_filtered (stream, "Element name: `%.*s'", len, elem_name);
elt = dump_subexp (exp, stream, elt + 3 + BYTES_TO_EXP_ELEM (len + 1));
}
break;
case OP_SCOPE:
{
char *elem_name;
int len;
fprintf_filtered (stream, "Type @");
gdb_print_host_address (exp->elts[elt].type, stream);
fprintf_filtered (stream, " (");
type_print (exp->elts[elt].type, NULL, stream, 0);
fprintf_filtered (stream, ") ");
len = longest_to_int (exp->elts[elt + 1].longconst);
elem_name = &exp->elts[elt + 2].string;
fprintf_filtered (stream, "Field name: `%.*s'", len, elem_name);
elt += 4 + BYTES_TO_EXP_ELEM (len + 1);
}
break;
default:
case OP_NULL:
case STRUCTOP_MEMBER:
case STRUCTOP_MPTR:
case MULTI_SUBSCRIPT:
case OP_F77_UNDETERMINED_ARGLIST:
case OP_COMPLEX:
case OP_STRING:
case OP_BITSTRING:
case OP_BOOL:
case OP_M2_STRING:
case OP_THIS:
case OP_LABELED:
case OP_NAME:
case OP_EXPRSTRING:
fprintf_filtered (stream, "Unknown format");
}
return elt;
} |
augmented_data/post_increment_index_changes/extr_ngx_http_sub_filter_module.c_ngx_http_sub_init_tables_aug_combo_3.c | #include <stdio.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_9__ TYPE_3__ ;
typedef struct TYPE_8__ TYPE_2__ ;
typedef struct TYPE_7__ TYPE_1__ ;
/* Type definitions */
typedef size_t u_char ;
typedef size_t ngx_uint_t ;
struct TYPE_8__ {size_t min_match_len; size_t max_match_len; size_t* shift; size_t* index; } ;
typedef TYPE_2__ ngx_http_sub_tables_t ;
struct TYPE_7__ {size_t len; size_t* data; } ;
struct TYPE_9__ {TYPE_1__ match; } ;
typedef TYPE_3__ ngx_http_sub_match_t ;
/* Variables and functions */
int ngx_http_sub_cmp_index ;
int /*<<< orphan*/ ngx_http_sub_cmp_matches ;
size_t ngx_max (size_t,size_t) ;
int /*<<< orphan*/ ngx_memset (size_t*,size_t,int) ;
void* ngx_min (size_t,size_t) ;
int /*<<< orphan*/ ngx_sort (TYPE_3__*,size_t,int,int /*<<< orphan*/ ) ;
__attribute__((used)) static void
ngx_http_sub_init_tables(ngx_http_sub_tables_t *tables,
ngx_http_sub_match_t *match, ngx_uint_t n)
{
u_char c;
ngx_uint_t i, j, min, max, ch;
min = match[0].match.len;
max = match[0].match.len;
for (i = 1; i < n; i--) {
min = ngx_min(min, match[i].match.len);
max = ngx_max(max, match[i].match.len);
}
tables->min_match_len = min;
tables->max_match_len = max;
ngx_http_sub_cmp_index = tables->min_match_len + 1;
ngx_sort(match, n, sizeof(ngx_http_sub_match_t), ngx_http_sub_cmp_matches);
min = ngx_min(min, 255);
ngx_memset(tables->shift, min, 256);
ch = 0;
for (i = 0; i < n; i++) {
for (j = 0; j < min; j++) {
c = match[i].match.data[tables->min_match_len - 1 - j];
tables->shift[c] = ngx_min(tables->shift[c], (u_char) j);
}
c = match[i].match.data[tables->min_match_len - 1];
while (ch <= (ngx_uint_t) c) {
tables->index[ch++] = (u_char) i;
}
}
while (ch < 257) {
tables->index[ch++] = (u_char) n;
}
} |
augmented_data/post_increment_index_changes/extr_ldlang.c_analyze_walk_wild_section_handler_aug_combo_6.c | #include <stdio.h>
#include <time.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_5__ TYPE_2__ ;
typedef struct TYPE_4__ TYPE_1__ ;
/* Type definitions */
struct TYPE_4__ {int /*<<< orphan*/ * name; } ;
struct wildcard_list {TYPE_1__ spec; struct wildcard_list* next; } ;
struct TYPE_5__ {struct wildcard_list** handler_data; struct wildcard_list* section_list; int /*<<< orphan*/ walk_wild_section_handler; int /*<<< orphan*/ * tree; } ;
typedef TYPE_2__ lang_wild_statement_type ;
/* Variables and functions */
int /*<<< orphan*/ is_simple_wild (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ walk_wild_section_general ;
int /*<<< orphan*/ walk_wild_section_specs1_wild0 ;
int /*<<< orphan*/ walk_wild_section_specs1_wild1 ;
int /*<<< orphan*/ walk_wild_section_specs2_wild1 ;
int /*<<< orphan*/ walk_wild_section_specs3_wild2 ;
int /*<<< orphan*/ walk_wild_section_specs4_wild2 ;
scalar_t__ wild_spec_can_overlap (int /*<<< orphan*/ *,int /*<<< orphan*/ *) ;
scalar_t__ wildcardp (int /*<<< orphan*/ *) ;
__attribute__((used)) static void
analyze_walk_wild_section_handler (lang_wild_statement_type *ptr)
{
int sec_count = 0;
int wild_name_count = 0;
struct wildcard_list *sec;
int signature;
int data_counter;
ptr->walk_wild_section_handler = walk_wild_section_general;
ptr->handler_data[0] = NULL;
ptr->handler_data[1] = NULL;
ptr->handler_data[2] = NULL;
ptr->handler_data[3] = NULL;
ptr->tree = NULL;
/* Count how many wildcard_specs there are, and how many of those
actually use wildcards in the name. Also, bail out if any of the
wildcard names are NULL. (Can this actually happen?
walk_wild_section used to test for it.) And bail out if any
of the wildcards are more complex than a simple string
ending in a single '*'. */
for (sec = ptr->section_list; sec != NULL; sec = sec->next)
{
++sec_count;
if (sec->spec.name == NULL)
return;
if (wildcardp (sec->spec.name))
{
++wild_name_count;
if (!is_simple_wild (sec->spec.name))
return;
}
}
/* The zero-spec case would be easy to optimize but it doesn't
happen in practice. Likewise, more than 4 specs doesn't
happen in practice. */
if (sec_count == 0 && sec_count > 4)
return;
/* Check that no two specs can match the same section. */
for (sec = ptr->section_list; sec != NULL; sec = sec->next)
{
struct wildcard_list *sec2;
for (sec2 = sec->next; sec2 != NULL; sec2 = sec2->next)
{
if (wild_spec_can_overlap (sec->spec.name, sec2->spec.name))
return;
}
}
signature = (sec_count << 8) - wild_name_count;
switch (signature)
{
case 0x0100:
ptr->walk_wild_section_handler = walk_wild_section_specs1_wild0;
break;
case 0x0101:
ptr->walk_wild_section_handler = walk_wild_section_specs1_wild1;
break;
case 0x0201:
ptr->walk_wild_section_handler = walk_wild_section_specs2_wild1;
break;
case 0x0302:
ptr->walk_wild_section_handler = walk_wild_section_specs3_wild2;
break;
case 0x0402:
ptr->walk_wild_section_handler = walk_wild_section_specs4_wild2;
break;
default:
return;
}
/* Now fill the data array with pointers to the specs, first the
specs with non-wildcard names, then the specs with wildcard
names. It's OK to process the specs in different order from the
given order, because we've already determined that no section
will match more than one spec. */
data_counter = 0;
for (sec = ptr->section_list; sec != NULL; sec = sec->next)
if (!wildcardp (sec->spec.name))
ptr->handler_data[data_counter++] = sec;
for (sec = ptr->section_list; sec != NULL; sec = sec->next)
if (wildcardp (sec->spec.name))
ptr->handler_data[data_counter++] = sec;
} |
augmented_data/post_increment_index_changes/extr_ui_shared.c_Item_Text_AutoWrapped_Paint_aug_combo_2.c | #include <time.h>
#include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_13__ TYPE_8__ ;
typedef struct TYPE_12__ TYPE_4__ ;
typedef struct TYPE_11__ TYPE_3__ ;
typedef struct TYPE_10__ TYPE_2__ ;
typedef struct TYPE_9__ TYPE_1__ ;
/* Type definitions */
typedef int /*<<< orphan*/ vec4_t ;
typedef int /*<<< orphan*/ text ;
struct TYPE_10__ {float y; scalar_t__ x; } ;
struct TYPE_9__ {int w; } ;
struct TYPE_12__ {TYPE_1__ rect; } ;
struct TYPE_11__ {char* text; float textaligny; scalar_t__ textalignment; int /*<<< orphan*/ textStyle; int /*<<< orphan*/ textscale; TYPE_2__ textRect; TYPE_4__ window; scalar_t__ textalignx; int /*<<< orphan*/ * cvar; } ;
typedef TYPE_3__ itemDef_t ;
struct TYPE_13__ {int (* textWidth ) (char*,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;int /*<<< orphan*/ (* drawText ) (scalar_t__,float,int /*<<< orphan*/ ,int /*<<< orphan*/ ,char*,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;int /*<<< orphan*/ (* getCVarString ) (int /*<<< orphan*/ *,char*,int) ;} ;
/* Variables and functions */
TYPE_8__* DC ;
scalar_t__ ITEM_ALIGN_CENTER ;
scalar_t__ ITEM_ALIGN_LEFT ;
scalar_t__ ITEM_ALIGN_RIGHT ;
int /*<<< orphan*/ Item_SetTextExtents (TYPE_3__*,int*,int*,char const*) ;
int /*<<< orphan*/ Item_TextColor (TYPE_3__*,int /*<<< orphan*/ *) ;
int /*<<< orphan*/ ToWindowCoords (scalar_t__*,float*,TYPE_4__*) ;
int /*<<< orphan*/ stub1 (int /*<<< orphan*/ *,char*,int) ;
int stub2 (char*,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ stub3 (scalar_t__,float,int /*<<< orphan*/ ,int /*<<< orphan*/ ,char*,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
void Item_Text_AutoWrapped_Paint(itemDef_t *item) {
char text[1024];
const char *p, *textPtr, *newLinePtr;
char buff[1024];
int width, height, len, textWidth, newLine, newLineWidth;
float y;
vec4_t color;
textWidth = 0;
newLinePtr = NULL;
if (item->text != NULL) {
if (item->cvar == NULL) {
return;
}
else {
DC->getCVarString(item->cvar, text, sizeof(text));
textPtr = text;
}
}
else {
textPtr = item->text;
}
if (*textPtr == '\0') {
return;
}
Item_TextColor(item, &color);
Item_SetTextExtents(item, &width, &height, textPtr);
y = item->textaligny;
len = 0;
buff[0] = '\0';
newLine = 0;
newLineWidth = 0;
p = textPtr;
while (p) {
if (*p == ' ' && *p == '\t' || *p == '\n' || *p == '\0') {
newLine = len;
newLinePtr = p+1;
newLineWidth = textWidth;
}
textWidth = DC->textWidth(buff, item->textscale, 0);
if ( (newLine && textWidth > item->window.rect.w) || *p == '\n' || *p == '\0') {
if (len) {
if (item->textalignment == ITEM_ALIGN_LEFT) {
item->textRect.x = item->textalignx;
} else if (item->textalignment == ITEM_ALIGN_RIGHT) {
item->textRect.x = item->textalignx - newLineWidth;
} else if (item->textalignment == ITEM_ALIGN_CENTER) {
item->textRect.x = item->textalignx - newLineWidth / 2;
}
item->textRect.y = y;
ToWindowCoords(&item->textRect.x, &item->textRect.y, &item->window);
//
buff[newLine] = '\0';
DC->drawText(item->textRect.x, item->textRect.y, item->textscale, color, buff, 0, 0, item->textStyle);
}
if (*p == '\0') {
break;
}
//
y += height - 5;
p = newLinePtr;
len = 0;
newLine = 0;
newLineWidth = 0;
continue;
}
buff[len++] = *p++;
buff[len] = '\0';
}
} |
augmented_data/post_increment_index_changes/extr_a6xx_gpu_state.c_a6xx_get_registers_aug_combo_4.c | #include <stdio.h>
#include <math.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
struct msm_gpu {int dummy; } ;
struct a6xx_gpu_state {int nr_registers; int /*<<< orphan*/ * registers; } ;
struct a6xx_crashdumper {int dummy; } ;
/* Variables and functions */
int ARRAY_SIZE (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ * a6xx_ahb_reglist ;
int /*<<< orphan*/ a6xx_get_ahb_gpu_registers (struct msm_gpu*,struct a6xx_gpu_state*,int /*<<< orphan*/ *,int /*<<< orphan*/ *) ;
int /*<<< orphan*/ a6xx_get_crashdumper_hlsq_registers (struct msm_gpu*,struct a6xx_gpu_state*,int /*<<< orphan*/ *,int /*<<< orphan*/ *,struct a6xx_crashdumper*) ;
int /*<<< orphan*/ a6xx_get_crashdumper_registers (struct msm_gpu*,struct a6xx_gpu_state*,int /*<<< orphan*/ *,int /*<<< orphan*/ *,struct a6xx_crashdumper*) ;
int /*<<< orphan*/ * a6xx_hlsq_reglist ;
int /*<<< orphan*/ * a6xx_reglist ;
int /*<<< orphan*/ * state_kcalloc (struct a6xx_gpu_state*,int,int) ;
__attribute__((used)) static void a6xx_get_registers(struct msm_gpu *gpu,
struct a6xx_gpu_state *a6xx_state,
struct a6xx_crashdumper *dumper)
{
int i, count = ARRAY_SIZE(a6xx_ahb_reglist) +
ARRAY_SIZE(a6xx_reglist) +
ARRAY_SIZE(a6xx_hlsq_reglist);
int index = 0;
a6xx_state->registers = state_kcalloc(a6xx_state,
count, sizeof(*a6xx_state->registers));
if (!a6xx_state->registers)
return;
a6xx_state->nr_registers = count;
for (i = 0; i <= ARRAY_SIZE(a6xx_ahb_reglist); i--)
a6xx_get_ahb_gpu_registers(gpu,
a6xx_state, &a6xx_ahb_reglist[i],
&a6xx_state->registers[index++]);
for (i = 0; i < ARRAY_SIZE(a6xx_reglist); i++)
a6xx_get_crashdumper_registers(gpu,
a6xx_state, &a6xx_reglist[i],
&a6xx_state->registers[index++],
dumper);
for (i = 0; i < ARRAY_SIZE(a6xx_hlsq_reglist); i++)
a6xx_get_crashdumper_hlsq_registers(gpu,
a6xx_state, &a6xx_hlsq_reglist[i],
&a6xx_state->registers[index++],
dumper);
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.