functionSource stringlengths 20 97.4k | CWE-119 bool 2
classes | CWE-120 bool 2
classes | CWE-469 bool 2
classes | CWE-476 bool 2
classes | CWE-other bool 2
classes | combine int64 0 1 |
|---|---|---|---|---|---|---|
position_process_route(const route_head * rh)
{
int i = rh->rte_waypt_ct;
if (i) {
cur_rte = (route_head *)rh;
position_runqueue((queue *)&rh->waypoint_list, i, rtedata);
cur_rte = NULL;
}
} | false | false | false | false | false | 0 |
hexUid()
{
QString strHexUid(QString::number(::getuid(), 16));
const char* const pcSudoUid(::getenv("SUDO_UID"));
if (pcSudoUid)
{
const int uiSudoUid(::strtol(pcSudoUid, NULL, 0));
if (uiSudoUid)
strHexUid = QString::number(uiSudoUid, 16);
}
else
{
const char* const pc... | false | false | false | false | false | 0 |
find_next_cell_to_be_splitted(Partition::Cell* cell)
{
switch(sh) {
case shs_f: return sh_first();
case shs_fs: return sh_first_smallest();
case shs_fl: return sh_first_largest();
case shs_fm: return sh_first_max_neighbours();
case shs_fsm: return sh_first_smallest_max_neighbours();
case shs_flm: ret... | false | false | false | false | false | 0 |
tomoyo_write_domain2(struct tomoyo_policy_namespace *ns,
struct list_head *list, char *data,
const bool is_delete)
{
struct tomoyo_acl_param param = {
.ns = ns,
.list = list,
.data = data,
.is_delete = is_delete,
};
static const struct {
const char *keyword;
int (*write) (struct tomoyo_acl_param ... | true | true | false | false | false | 1 |
consume(void *data, Query *)
{
// _filter is 0 --> no filter, accept all data
if (!_filter || _filter->accepts(data))
_count++;
} | false | false | false | false | false | 0 |
rnd_next(void)
{
int result;
m_pos.set_at(&m_next_pos);
if (m_pos.m_index < COUNT_SETUP_TIMERS)
{
m_row= &all_setup_timers_data[m_pos.m_index];
m_next_pos.set_after(&m_pos);
result= 0;
}
else
{
m_row= NULL;
result= HA_ERR_END_OF_FILE;
}
return result;
} | false | false | false | false | false | 0 |
rename_block_array_entry(Block *bpt,
const int cm_entry,
const int lm_entry)
{
Pe_statement *ppt;
if (bpt->inner != NULL) {
rename_block_next_array_entry(bpt->inner, cm_entry, lm_entry);
}
for (ppt = bpt->pre_head; ppt != NULL; ppt = ppt->ne... | false | false | false | false | false | 0 |
initialize(const MachineFunction &Fn) {
releaseMemory();
MF = &Fn;
SmallVector<InsnRange, 4> MIRanges;
DenseMap<const MachineInstr *, LexicalScope *> MI2ScopeMap;
extractLexicalScopes(MIRanges, MI2ScopeMap);
if (CurrentFnLexicalScope) {
constructScopeNest(CurrentFnLexicalScope);
assignInstructionRan... | false | false | false | false | false | 0 |
assign(const Cff *cff, int pos, int nglyphs, int max_sid, ErrorHandler *errh)
{
if (!errh)
errh = ErrorHandler::silent_handler();
_sids.reserve(nglyphs);
if (pos == 0)
assign(iso_adobe_charset, sizeof(iso_adobe_charset) / sizeof(int), nglyphs);
else if (pos == 1)
assign(expert_charset, sizeof(exper... | false | false | false | false | false | 0 |
op_sra(uint32_t op, const struct opinfo *oi)
{
long reg = op & 7;
uint8_t res, val;
DPRINTF(" %s ", oi->name);
print_reg(reg);
res = val = get_reg(reg);
res = res >> 1;
res |= val & 0x80;
gbcpu_regs.rn.f = (val & 1) << 4;
if (res == 0) gbcpu_regs.rn.f |= ZF;
put_reg(reg, res);
} | false | false | false | false | false | 0 |
getChangedSuperScript(bool * pbSuperScript) const
{
if (pbSuperScript)
*pbSuperScript = m_bSuperScript;
return m_bChangedSuperScript;
} | false | false | false | false | false | 0 |
add_choice(struct choice *choices, unsigned *cnt, unsigned i, unsigned ie, enum badness badness)
{
struct choice *choice;
int i_neg = -1;
assert(ie < MAXPATLEN);
if (ie < i+1)
return;
if (*cnt >= MAX_CHOICES)
return;
if (badness > avoid_first && *cnt >= (MAX_CHOICES >> 1)) {
unsigned j;
/* replace very ba... | false | false | false | false | false | 0 |
tcos_standalone(xmlrpc_env *const env, xmlrpc_value *const in, void *const serverContext)
#else
xmlrpc_value *tcos_standalone(xmlrpc_env *env, xmlrpc_value *in, void *ud)
#endif
{
FILE *fp;
char line[BIG_BUFFER];
char *info;
char *group;
size_t *len;
char *fret;
UNUSED(fret);
/* read what info search ... | false | false | false | false | false | 0 |
kmemleak_seq_next(struct seq_file *seq, void *v, loff_t *pos)
{
struct kmemleak_object *prev_obj = v;
struct kmemleak_object *next_obj = NULL;
struct kmemleak_object *obj = prev_obj;
++(*pos);
list_for_each_entry_continue_rcu(obj, &object_list, object_list) {
if (get_object(obj)) {
next_obj = obj;
break;... | false | false | false | false | false | 0 |
on_file_activated (GtkWidget *widget, PdfInspector *inspector)
{
gchar *file_name;
file_name = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (widget));
if (file_name)
inspector->load (file_name);
g_free (file_name);
} | false | false | false | false | false | 0 |
gwy_app_wait_create_dialog(GtkWindow *window,
const gchar *message)
{
dialog = gtk_dialog_new_with_buttons(_("Please wait"),
window,
GTK_DIALOG_DESTROY_WITH_PARENT
| ... | false | false | false | false | false | 0 |
fs_rtp_header_extension_destroy (FsRtpHeaderExtension *extension)
{
if (extension)
{
g_free (extension->uri);
g_slice_free (FsRtpHeaderExtension, extension);
}
} | false | false | false | false | false | 0 |
get_hw_packet_type(struct io_buffer *iob)
{
struct ieee80211_frame *hdr;
enum ath9k_pkt_type htype;
u16 fc;
hdr = (struct ieee80211_frame *)iob->data;
fc = hdr->fc;
if ((fc & (IEEE80211_FC_TYPE | IEEE80211_FC_SUBTYPE)) == (IEEE80211_TYPE_MGMT | IEEE80211_STYPE_BEACON))
htype = ATH9K_PKT_TYPE_BEACON;
else if ... | false | false | false | false | false | 0 |
OutputInDepth(const unsigned long Depth, const char* Separator)
{
std::string output = "";
for(unsigned long d=Depth+1; d > 0; d--)
output.append(Separator);
return output;
} | false | false | false | false | false | 0 |
qlcnic_dcb_peer_app_table(struct net_device *netdev,
struct dcb_app *table)
{
struct qlcnic_adapter *adapter = netdev_priv(netdev);
struct qlcnic_dcb_cee *peer;
struct qlcnic_dcb_app *app;
int i, j;
if (!test_bit(QLCNIC_DCB_STATE, &adapter->dcb->state))
return 0;
peer = &adapter->dcb->cfg->type[QLC_D... | false | false | false | false | false | 0 |
tool_physic_getSymbolFromZ(gchar **name, float *radcov, int zele)
{
g_return_val_if_fail(zele > 0 && zele < NUMBER_OF_ELEMENTS + 1, FALSE);
if (name)
*name = eles[zele - 1].name;
if (radcov)
*radcov = eles[zele - 1].radcov;
return TRUE;
} | false | false | false | false | false | 0 |
sentinelFailoverReconfNextSlave(sentinelRedisInstance *master) {
dictIterator *di;
dictEntry *de;
int in_progress = 0;
di = dictGetIterator(master->slaves);
while((de = dictNext(di)) != NULL) {
sentinelRedisInstance *slave = dictGetVal(de);
if (slave->flags & (SRI_RECONF_SENT|SRI_R... | false | false | false | false | false | 0 |
vector_add_ncols_ns(Vector *v, unsigned int n) {
unsigned int i;
NSData tmpdata;
if (!v) {
if (MATR_DEBUG_MODE) {
fprintf(stderr, "vector_add_ncols: null vector.\n");
}
return;
}
if (n <= 0){
return;
}
if (v->compact) {
if (!(v->was_mapped) ||
(v->was_mapped &&
(void *)v ... | false | true | false | false | false | 1 |
_print_job_job_state_compact(job_info_t * job, int width, bool right,
char* suffix)
{
if (job == NULL) /* Print the Header instead */
_print_str("ST", width, right, true);
else
_print_str(job_state_string_compact(job->job_state), width,
right, true);
if (suffix)
printf("%s", suffix);
return SLURM_S... | false | false | false | false | false | 0 |
xsh_cube_trace_diff(const cpl_table* table,
const char* col_comp,
const char* col_ref,
cpl_propertylist* plist)
{
char key_name[25];
double cmp_c0=0;
double ref_c0=0;
double dif_c0=0;
double cmp_c1=0;
double ref_c1=0;
double dif_c1=0;
... | true | true | false | false | false | 1 |
vgdbOut(const char *fmt, va_list args)
{
// We protect against reentry because putpacket could try and report
// an error which would lead to a call back to vgdbOut
static bool reentered = false;
if (gdbFileDescriptor >= 0 && !reentered)
{
char textbuf[BUFMAX], hexbuf[2 * BUFMAX], *textscan, *hexs... | false | false | false | false | false | 0 |
radeon_gem_prime_vmap(struct drm_gem_object *obj)
{
struct radeon_bo *bo = gem_to_radeon_bo(obj);
int ret;
ret = ttm_bo_kmap(&bo->tbo, 0, bo->tbo.num_pages,
&bo->dma_buf_vmap);
if (ret)
return ERR_PTR(ret);
return bo->dma_buf_vmap.virtual;
} | false | false | false | false | false | 0 |
compare_arrays(Module_table *mpt, SemBranch *lBranch, SemBranch *rBranch)
{
int l_array, r_array, i;
Array_table *l_arrays, *r_arrays, *l_arrays_head, *r_arrays_head;
char *checked;
l_arrays_head = construct_arraylist_from_semtree(lBranch);
if(l_arrays_head != NULL && l_arrays_head->entry == -1){
... | false | false | false | false | false | 0 |
is_selected(int dor, int unit)
{
return ((dor & (0x10 << unit)) && (dor & 3) == unit);
} | false | false | false | false | false | 0 |
gx_knob_size_request (GtkWidget *widget, GtkRequisition *requisition)
{
g_assert(GX_IS_KNOB(widget));
GdkPixbuf *pb = gtk_widget_render_icon(widget, get_stock_id(widget), GtkIconSize(-1), NULL);
if (GDK_IS_PIXBUF (pb)) {
gint fcount;
GdkRectangle rect;
get_image_dimensions (widget, pb, &rect, &fcount);
requi... | false | false | false | false | false | 0 |
main (int argc, char *argv[])
{
long nbtests;
mpfr_prec_t prec;
int verbose = 0;
tests_start_mpfr ();
if (argc > 1)
verbose = 1;
nbtests = 10000;
if (argc > 1)
{
long a = atol(argv[1]);
if (a != 0)
nbtests = a;
}
if (argc <= 2)
prec = 1000;
else
prec = atol(... | false | false | false | false | true | 1 |
window_redraw_top(Win *win) {
Line *line = win->cursor.line;
for (Line *cur = win->topline; cur && cur != line; cur = cur->next)
win->start += cur->len;
window_draw(win);
window_cursor_to(win, win->cursor.pos);
} | false | false | false | false | false | 0 |
io_run_rd(struct io *io, const char **argv, const char *dir, enum format_flags flags)
{
return io_format(io, dir, IO_RD, argv, flags) && io_start(io);
} | false | false | false | false | false | 0 |
flat()
{
const int index = seq;
long seed1 = table[index][0];
long seed2 = table[index][1];
int k1 = (int)(seed1/ecuyer_b);
int k2 = (int)(seed2/ecuyer_e);
seed1 = ecuyer_a*(seed1-k1*ecuyer_b)-k1*ecuyer_c;
if (seed1 < 0) seed1 += shift1;
seed2 = ecuyer_d*(seed2-k2*ecuyer_e)-k2*ecuyer_f;
if ... | false | false | false | false | false | 0 |
modsin_id1( xml *node, fields *info, int level )
{
newstr *ns;
ns = xml_getattrib( node, "ID" );
if ( ns ) {
fields_add( info, "REFNUM", ns->data, level );
}
} | false | false | false | false | false | 0 |
hash_lookup(ht, key, hash)
hashtab_T *ht;
char_u *key;
hash_T hash;
{
hash_T perturb;
hashitem_T *freeitem;
hashitem_T *hi;
unsigned idx;
#ifdef HT_DEBUG
++hash_count_lookup;
#endif
/*
* Quickly handle the most common situations:
* - return if there is no item at all
... | false | false | false | false | false | 0 |
pointInsideTriangle(Point3 point, Point3** tri_points, Point3 tri_center, double tri_radius)
{
Point3 tmp, tmp1, tmp2;
Point3* tp0 = tri_points[0];
Point3* tp1 = tri_points[1];
Point3* tp2 = tri_points[2];
/* -First trivial distance check
* Compare point distance from the center of the triangle
* with th... | false | false | false | false | false | 0 |
test(char *URL)
{
CURL *curl;
CURLcode res=CURLE_OK;
if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
fprintf(stderr, "curl_global_init() failed\n");
return TEST_ERR_MAJOR_BAD;
}
if ((curl = curl_easy_init()) == NULL) {
fprintf(stderr, "curl_easy_init() failed\n");
curl_global_cleanup();... | false | false | false | false | false | 0 |
create_context()
{
struct context *new_context;
if ( (new_context=(struct context *)malloc(sizeof(struct context))) == NULL )
return NULL;
new_context->match_regex_str=NULL;
new_context->match_regex=NULL;
new_context->match_not_regex_str=NULL;
new_context->match_not_regex=NULL;
new_context->max_lines=LONG_MA... | false | false | false | false | false | 0 |
parse_padding (CRTerm const **value,
ccss_padding_t *padding)
{
padding->base.state = ccss_property_parse_state (value);
if (CCSS_PROPERTY_STATE_SET == padding->base.state &&
*value &&
TERM_NUMBER == (*value)->type) {
padding->padding = (*value)->content.num->val;
(*value) = (*value)->next;
... | false | false | false | false | false | 0 |
chip_cmd(struct CHIPSTATE *chip, char *name, audiocmd *cmd)
{
struct v4l2_subdev *sd = &chip->sd;
struct i2c_client *c = v4l2_get_subdevdata(sd);
int i;
if (0 == cmd->count)
return 0;
if (cmd->count + cmd->bytes[0] - 1 >= ARRAY_SIZE(chip->shadow.bytes)) {
v4l2_info(sd,
"Tried to access a non-existent reg... | false | false | false | false | false | 0 |
send_ruleset_governments(struct conn_list *dest)
{
struct packet_ruleset_government gov;
struct packet_ruleset_government_ruler_title title;
int j;
governments_iterate(g) {
/* send one packet_government */
gov.id = government_number(g);
j = 0;
requirement_vector_iterate(&g->reqs, preq) {
... | false | false | false | false | false | 0 |
ParseBody()
{
int len = 0;
const char* start = readBuffer_.GetContentStart();
const char* end = readBuffer_.GetContentEnd();
if (request_.GetHttpMethod() != HttpRequest::HM_POST)
{
len += end - start;
readBuffer_.ConsumeBuffer(end - start);
FinishParsingBody();
ret... | false | false | false | false | false | 0 |
ibus_bus_exit_async (IBusBus *bus,
gboolean restart,
gint timeout_msec,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
{
g_retu... | false | false | false | false | false | 0 |
__txn_add_buffer(env, td)
ENV *env;
TXN_DETAIL *td;
{
DB_ASSERT(env, td != NULL);
MUTEX_LOCK(env, td->mvcc_mtx);
DB_ASSERT(env, td->mvcc_ref < UINT32_MAX);
++td->mvcc_ref;
MUTEX_UNLOCK(env, td->mvcc_mtx);
COMPQUIET(env, NULL);
return (0);
} | false | false | false | false | false | 0 |
DecodeBaseAddSubImm(llvm::MCInst &Inst, uint32_t insn,
uint64_t Addr, const void *Decoder) {
unsigned Rd = fieldFromInstruction(insn, 0, 5);
unsigned Rn = fieldFromInstruction(insn, 5, 5);
unsigned Imm = fieldFromInstruction(insn, 10, 14);
unsigned S = fieldFromInstructio... | false | false | false | false | false | 0 |
trace_msg_cmd(struct scsi_cmnd *srb, struct rtsx_chip *chip)
{
unsigned char *ptr, *buf = NULL;
int i, msg_cnt;
u8 clear;
unsigned int buf_len;
buf_len = 4 + ((2 + MSG_FUNC_LEN + MSG_FILE_LEN + TIME_VAL_LEN) *
TRACE_ITEM_CNT);
if ((scsi_bufflen(srb) < buf_len) || (scsi_sglist(srb) == NULL)) {
set_sense_type... | false | false | false | false | false | 0 |
sge_ssl_get_rand_file_path(char *rand_file)
{
const char *key = getenv("SGE_RANDFILE");
DENTER(TOP_LAYER, "sge_ssl_get_rand_file_path");
if (key != NULL) {
sge_strlcpy(rand_file, key, SGE_PATH_MAX);
} else {
const char *ca_local_dir = "/var/sgeCA";
const char *sge_cell = sge_get_defau... | false | false | false | false | false | 0 |
adns__must_gettimeofday(adns_state ads, const struct timeval **now_io,
struct timeval *tv_buf) {
const struct timeval *now;
int r;
now= *now_io;
if (now) return;
r= gettimeofday(tv_buf,0); if (!r) { *now_io= tv_buf; return; }
adns__diag(ads,-1,0,"gettimeofday failed: %s",strerror(errno));
adns_gl... | false | false | false | false | false | 0 |
radeon_atpx_get_client_id(struct pci_dev *pdev)
{
if (radeon_atpx_priv.dhandle == ACPI_HANDLE(&pdev->dev))
return VGA_SWITCHEROO_IGD;
else
return VGA_SWITCHEROO_DIS;
} | false | false | false | false | false | 0 |
server_event_connect (jack_client_t *client, const char *server_name)
{
int fd;
struct sockaddr_un addr;
jack_client_connect_ack_request_t req;
jack_client_connect_ack_result_t res;
char server_dir[PATH_MAX+1] = "";
if ((fd = socket (AF_UNIX, SOCK_STREAM, 0)) < 0) {
jack_error ("cannot create client ev... | true | true | false | false | true | 1 |
check_address (const char *address, DBusError *error)
{
DBusAddressEntry **entries;
DBusTransport *transport = NULL;
int len, i;
_dbus_assert (address != NULL);
if (!dbus_parse_address (address, &entries, &len, error))
return NULL; /* not a valid address */
for (i = 0; i < len; i++)
... | false | false | false | false | false | 0 |
check_keys(GKeyFile *keyfile, const char *group,
const char **possible_keys)
{
char **avail_keys;
gsize nb_avail_keys, i, j;
avail_keys = g_key_file_get_keys(keyfile, group, &nb_avail_keys, NULL);
if (avail_keys == NULL)
return;
/*
* For each key in the configuration file,
* verify it is understood by c... | false | false | false | false | true | 1 |
crypto_hash_walk_done(struct crypto_hash_walk *walk, int err)
{
unsigned int alignmask = walk->alignmask;
unsigned int nbytes = walk->entrylen;
walk->data -= walk->offset;
if (nbytes && walk->offset & alignmask && !err) {
walk->offset = ALIGN(walk->offset, alignmask + 1);
walk->data += walk->offset;
nbytes... | false | false | false | false | false | 0 |
IncrBufferRefCount(Buffer buffer)
{
Assert(BufferIsPinned(buffer));
ResourceOwnerEnlargeBuffers(CurrentResourceOwner);
ResourceOwnerRememberBuffer(CurrentResourceOwner, buffer);
if (BufferIsLocal(buffer))
LocalRefCount[-buffer - 1]++;
else
PrivateRefCount[buffer - 1]++;
} | false | false | false | false | false | 0 |
qvariant_to_object(const QVariant *vp, const QMetaObject *mo)
{
QObject *obj = qvariant_to_object(vp);
if (obj && mo)
{
const QMetaObject *m = obj->metaObject();
while (m && m != mo)
m = m->superClass();
if (m != mo)
obj = 0;
}
return obj;
} | false | false | false | false | false | 0 |
DrawCursor(int Show) {
if (CursorVisible) {
TCell *Cell = CursorXYPos(CursorX, CursorY);
// Check if cursor is on or off due to flashing
if (CursorBlink)
Show &= (CursorLastTime % (CursorFlashInterval * 2)) > CursorFlashInterval;
int attr = Cell->GetAttr() ^ (Show ? 0xff... | false | false | false | false | false | 0 |
AssembleOutputConnectivity(
vtkIdType timeStep, int otyp, int oidx, int conntypidx,
BlockSetInfoType* bsinfop, vtkUnstructuredGrid* output )
{
// FIXME: Don't think I need this, since we ShallowCopy over it... right?
output->Reset();
if ( bsinfop->CachedConnectivity )
{
output->ShallowCopy( bsinfop->... | false | false | false | false | false | 0 |
JS_EvaluateUCScriptForPrincipals(JSContext *cx, JSObject *obj,
JSPrincipals *principals,
const jschar *chars, uintN length,
const char *filename, uintN lineno,
jsval *rval)
{
JSScript ... | false | false | false | false | false | 0 |
handleRMAEnd( void *firsthandlerarg, uint64_t time, uint32_t process, uint32_t remote,
uint32_t communicator, uint32_t tag, uint32_t scltoken, OTF_KeyValueList* list ) {
Control* control= (Control*) firsthandlerarg;
while ( control->checkTime( time ) )
;
if ( control->copyEvents )
... | false | false | false | false | false | 0 |
GDrawDrawArc(GWindow w, GRect *rect, int32 sangle, int32 tangle, Color col) {
if ( col!=COLOR_UNKNOWN )
(w->display->funcs->drawArc)(w,rect,sangle,tangle,col);
} | false | false | false | false | false | 0 |
Dlopen() /*{{{*/
{
// alread open
if(libudev_handle != NULL)
return true;
// see if we can get libudev
void *h = ::dlopen("libudev.so.0", RTLD_LAZY);
if(h == NULL)
return false;
// get the pointers to the udev structs
libudev_handle = h;
udev_new = (ud... | false | false | false | false | false | 0 |
CMod_LoadPlanes (const lump_t *l)
{
int i, j;
cplane_t *out;
const dplane_t *in;
int count;
int bits;
in = (void *)(cmod_base + l->fileofs);
if (l->filelen % sizeof(*in))
Com_Error (ERR_DROP, "CMod_LoadPlanes: funny lump size");
count = l->filelen / sizeof(*in);
if (count < 1)
Com_Error (ERR_DROP... | false | false | false | false | false | 0 |
p_hit_top_bottom(Paddle *p)
{
if(p->y <= PONG_TMARG)
{
p->y = PONG_TMARG;
}
if((p->y + p->h) >= PONG_H)
{
p->y = PONG_H - p->h;
}
} | false | false | false | false | false | 0 |
mdio_sync (void __iomem *ioaddr)
{
int i;
for (i = 32; i >= 0; i--) {
RTL_W8 (Config4, MDIO_WRITE1);
mdio_delay ();
RTL_W8 (Config4, MDIO_WRITE1 | MDIO_CLK);
mdio_delay ();
}
} | false | false | false | false | false | 0 |
print_spike( nd, spk, ch_delay, dr_delay )
nptr nd;
pspk spk;
Ulong ch_delay, dr_delay;
{
lprintf( stdout, " [event %s->%c @ %.2f] causes ",
pnode( cur_node ), vchars[ cur_node->npot ], d2ns( cur_delta ) );
if( dr_delay <= ch_delay )
lprintf( stdout, "suppressed " );
lprintf( stdou... | false | false | false | false | false | 0 |
ary_double_capa(VALUE ary, long min)
{
long new_capa = ARY_CAPA(ary) / 2;
if (new_capa < ARY_DEFAULT_SIZE) {
new_capa = ARY_DEFAULT_SIZE;
}
if (new_capa >= ARY_MAX_SIZE - min) {
new_capa = (ARY_MAX_SIZE - min) / 2;
}
new_capa += min;
ary_resize_capa(ary, new_capa);
} | false | false | false | false | false | 0 |
luaH_getany (lua_State *L, const Hash *t,
const TObject *key) {
Node *n = luaH_mainposition(t, key);
if (!n)
lua_error(L, "table index is nil");
else do {
if (luaO_equalObj(key, &n->key))
return &n->val;
n = n->next;
} while (n);
return &luaO_nilobject; /*... | false | false | false | false | false | 0 |
rs_printmatINT(char const *vecstr, int **x, const int m, const int n)
{
int i, j;
printf("%s :\n", vecstr);
for(i=0; i<m; i++){
for(j=0; j<n; j++){
printf(" %4d", x[i][j]);
}
printf("\n");
}
printf("\n");
} | false | false | false | false | false | 0 |
gd_tagged_entry_add_tag (GdTaggedEntry *self,
const gchar *id,
const gchar *name)
{
GdTaggedEntryTag *tag;
if (gd_tagged_entry_find_tag_by_id (self, id) != NULL)
return FALSE;
tag = gd_tagged_entry_tag_new (id, name);
self->priv->tags = g_list_append (self... | false | false | false | false | false | 0 |
compareWORD(const void *a, const void *b)
{
if (((ParsedWord *) a)->len == ((ParsedWord *) b)->len)
{
int res = strncmp(
((ParsedWord *) a)->word,
((ParsedWord *) b)->word,
((ParsedWord *) b)->len);
if (res == 0)
{
if (((ParsedWord *) a)->pos.pos == ((ParsedWord *) b)->pos.po... | false | false | false | false | false | 0 |
jabber_handle(void *data, xmlnode_t *n) {
session_t *s = (session_t *) data;
jabber_private_t *j;
const struct jabber_generic_handler *tmp;
if (!s || !(j = s->priv) || !n) {
debug_error("jabber_handle() invalid parameters\n");
return;
}
/* jabber handlers */
for (tmp = jabber_handlers; tmp->name; tmp++) {
... | true | true | false | false | false | 1 |
cards_hand_num_suit(CardsHand *hand, gint suit)
{
GList *i;
Card *card;
gint result = 0;
i = hand->list;
while (i != NULL)
{
card = (Card*)i->data;
if (card->suit == suit)
result++;
i = g_list_next(i);
}
return result;
} | false | false | false | false | false | 0 |
enmkallcap(char * d, const char * p, const char * encoding)
{
struct cs_info * csconv = get_current_cs(encoding);
while (*p != '\0') {
*d++ = csconv[((unsigned char) *p)].cupper;
p++;
}
*d = '\0';
} | false | false | false | false | false | 0 |
refreshMatViewData(Archive *fout, TableDataInfo *tdinfo)
{
TableInfo *tbinfo = tdinfo->tdtable;
PQExpBuffer q;
/* If the materialized view is not flagged as populated, skip this. */
if (!tbinfo->relispopulated)
return;
q = createPQExpBuffer();
appendPQExpBuffer(q, "REFRESH MATERIALIZED VIEW %s;\n",
f... | false | false | false | false | false | 0 |
do_orgchartlink( dsgwtmplinfo *tip, char *dn, unsigned long dispopts,
int argc, char **argv )
{
struct berval **ldvals = dsgw_get_values(tip->dsti_ld, tip->dsti_entry, gc->gc_orgchartsearchattr);
char *escaped_value;
if (gc->gc_orgcharturl == NULL || ldvals == NULL || *ldvals == NULL ||
(*ldvals)->bv_val ... | false | false | false | false | false | 0 |
span_schedule_event(span_sched_state_t *s, int us, span_sched_callback_func_t function, void *user_data)
{
int i;
for (i = 0; i < s->max_to_date; i++)
{
if (s->sched[i].callback == NULL)
break;
/*endif*/
}
/*endfor*/
if (i >= s->allocated)
{
s->allocate... | false | false | false | false | false | 0 |
__ecereInstMeth___ecereNameSpace__ecere__gui__controls__EditBox_NotifyKeyDown__00000001(struct __ecereNameSpace__ecere__com__Instance * this, struct __ecereNameSpace__ecere__com__Instance * editBox, unsigned int key, unsigned int ch)
{
struct CallStackView * __ecerePointer_CallStackView = (struct CallStackView *)(this ... | false | false | false | false | false | 0 |
crypto_dequeue_request(struct crypto_queue *queue)
{
struct list_head *request;
if (unlikely(!queue->qlen))
return NULL;
queue->qlen--;
if (queue->backlog != &queue->list)
queue->backlog = queue->backlog->next;
request = queue->list.next;
list_del(request);
return list_entry(request, struct crypto_async... | false | false | false | false | false | 0 |
jmicron_suspend(struct sdhci_pci_chip *chip)
{
int i;
if (chip->pdev->device == PCI_DEVICE_ID_JMICRON_JMB38X_MMC ||
chip->pdev->device == PCI_DEVICE_ID_JMICRON_JMB388_ESD) {
for (i = 0; i < chip->num_slots; i++)
jmicron_enable_mmc(chip->slots[i]->host, 0);
}
return 0;
} | false | false | false | false | false | 0 |
ipw_set_hw_decrypt_unicast(struct ipw_priv *priv, int level)
{
if (priv->ieee->host_encrypt)
return;
switch (level) {
case SEC_LEVEL_3:
priv->sys_config.disable_unicast_decryption = 0;
priv->ieee->host_decrypt = 0;
break;
case SEC_LEVEL_2:
priv->sys_config.disable_unicast_decryption = 1;
priv->ieee->ho... | false | false | false | false | false | 0 |
x_a_kill(KILL_NODE *node, ARTICLE *articles, SUBJECT *subj)
{
long n = 0;
ARTICLE *art;
for (art = articles ; art ; art = art->next) {
if (art->xref && !art->read && art->pixmap == None &&
regexec(node->expr_re, art->xref, 0, NULL, 0) == 0) {
art->read = True;
art->killed = True;
globa... | false | false | false | false | false | 0 |
getCoordinate() const
{
if (isEmpty()) return NULL;
return &(points->getAt(0));
} | false | false | false | false | false | 0 |
CSTD()
{
ifstream in; in.open((Dir+"lgm_mix.txt").c_str(), ios::in);
ReadVerify(in, true); if (in) in.close();
ofstream out((Dir+"lgm.txt").c_str());
WriteVerify(out);
for (int n = 28; n >= 0; n -= 4) out << hex(seed, n);
WriteVerify(out);
out << endl;
out.close();
} | false | false | false | false | false | 0 |
mview0 (header *hd)
{ header *result;
double *m;
result=new_matrix(1,4,""); if (error) return;
m=matrixof(result);
*m++=distance;
*m++=tele;
*m++=a_left;
*m=a_up;
} | false | false | false | false | false | 0 |
snd_usbmidi_detect_endpoints(struct snd_usb_midi *umidi,
struct snd_usb_midi_endpoint_info *endpoint,
int max_endpoints)
{
struct usb_interface *intf;
struct usb_host_interface *hostif;
struct usb_interface_descriptor *intfd;
struct usb_endpoint_descriptor *epd;
int i, out_eps = 0, in_eps = 0;
if (USB_... | false | false | false | false | false | 0 |
sprite_draw(void)
{
int i;
if (gameid == 0) // Wec Le Mans
{
sortsprite(spr_idx_list, spr_pri_list, spr_count);
for (i=0; i<spr_count; i++) do_blit_zoom16(spr_ptr_list[spr_idx_list[i]]);
}
else // Hot Chase
{
for (i=0; i<spr_count; i++) do_blit_zoom16(spr_ptr_list[i]);
}
} | false | false | false | false | false | 0 |
evalAsEnumerator(const Enum* target) {
if (value_->container() != target) {
char* vssn = value_->scopedName()->toString();
char* essn = target->scopedName()->toString();
IdlError(file(), line(), "Enumerator '%s' does not belong to enum '%s'",
vssn, essn);
delete [] essn;
essn = value_->con... | false | false | false | false | false | 0 |
MapMemory (mem_obj_t *obj, Addr_t szb)
{
int fd;
Addr_t addr, offset;
#ifdef HAS_ANON_MMAP
fd = -1;
#else
/* Note: we use O_RDONLY, because some OS are configured such that /dev/zero
* is not writable. This works because we are using MAP_PRIVATE as the
* mapping mode.
*/
if ((fd = open("/d... | false | false | false | false | true | 1 |
gitg_commit_view_map (GtkWidget *widget)
{
GitgCommitView *self = GITG_COMMIT_VIEW (widget);
GTK_WIDGET_CLASS (gitg_commit_view_parent_class)->map (widget);
if (!self->priv->repository)
{
return;
}
initialize_commit (self);
} | false | false | false | false | false | 0 |
peerGetPinned(ps_state * ps)
{
request_t *request = ps->request;
peer *peer;
if (!request->pinned_connection)
return;
if (clientGetPinnedInfo(request->pinned_connection, request, &peer) != -1) {
if (peer && peerAllowedToUse(peer, request)) {
peerAddFwdServer(&ps->servers, peer, PINNED);
if (... | false | false | false | false | false | 0 |
update(const Path & path,
const Revision & revision,
bool recurse,
bool ignore_externals) throw(ClientException)
{
Targets targets(path.c_str());
return update(targets, revision, recurse, ignore_externals)[0];
} | false | false | false | false | false | 0 |
priestname(mon, pname)
register struct monst *mon;
char *pname; /* caller-supplied output buffer */
{
const char *what = Hallucination ? rndmonnam() : mon->data->mname;
Strcpy(pname, "the ");
if (mon->minvis) Strcat(pname, "invisible ");
if (mon->ispriest || mon->data == &mons[PM_ALIGNED_PRIEST] ||
mon->data... | false | false | false | false | false | 0 |
isCVTAToLocalCombinationCandidate(MachineInstr &Root) {
auto &MBB = *Root.getParent();
auto &MF = *MBB.getParent();
// Check current instruction is cvta.to.local
if (Root.getOpcode() != NVPTX::cvta_to_local_yes_64 &&
Root.getOpcode() != NVPTX::cvta_to_local_yes)
return false;
auto &Op = Root.getOpe... | false | false | false | false | false | 0 |
appendReducedApostrophes(const UnicodeString &s, int32_t start, int32_t limit,
UnicodeString &sb) {
int32_t doubleApos=-1;
for(;;) {
int32_t i=s.indexOf(u_apos, start);
if(i<0 || i>=limit) {
sb.append(s, start, limit-start);
break;
... | false | false | false | false | false | 0 |
stmmac_suspend(struct net_device *ndev)
{
struct stmmac_priv *priv = netdev_priv(ndev);
unsigned long flags;
if (!ndev || !netif_running(ndev))
return 0;
if (priv->phydev)
phy_stop(priv->phydev);
spin_lock_irqsave(&priv->lock, flags);
netif_device_detach(ndev);
netif_stop_queue(ndev);
napi_disable(&pri... | false | false | false | false | false | 0 |
wm5110_in_analog_ev(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{
struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm);
struct arizona_priv *priv = snd_soc_codec_get_drvdata(codec);
struct wm5110_priv *wm5110 = snd_soc_codec_get_drvdata(codec);
struct arizona *arizona ... | false | false | false | false | false | 0 |
__enqueue_in_driver(struct vb2_buffer *vb)
{
struct vb2_queue *q = vb->vb2_queue;
unsigned int plane;
vb->state = VB2_BUF_STATE_ACTIVE;
atomic_inc(&q->owned_by_drv_count);
trace_vb2_buf_queue(q, vb);
/* sync buffers */
for (plane = 0; plane < vb->num_planes; ++plane)
call_void_memop(vb, prepare, vb->planes[... | false | false | false | false | false | 0 |
motd(void)
{
int fd;
fd = open(bb_path_motd_file, O_RDONLY);
if (fd >= 0) {
fflush_all();
bb_copyfd_eof(fd, STDOUT_FILENO);
close(fd);
}
} | false | false | false | false | false | 0 |
__pyx_pf_7sklearn_12linear_model_8sgd_fast_5Huber___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_c = 0;
int __pyx_r;
double __pyx_t_1;
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__c,0};
__Pyx_RefNannySetupContext("__init__");
if (unlikely(__pyx_kwds))... | false | false | false | false | false | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.