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 |
|---|---|---|---|---|---|---|
merge_lists(struct ilist *alist, struct ilist *blist)
{
int i;
struct ilist *list_del;
list_del = Vect_new_list();
for (i = 0; i < alist->n_values; i++) {
if (!Vect_val_in_list(blist, alist->value[i]))
Vect_list_append(list_del, alist->value[i]);
}
Vect_list_delete_list(alist, list_del... | false | false | false | false | false | 0 |
string_equal_char(string *s, char *c) {
if(s == NULL ||
s->str == NULL ||
c == NULL) {
return 0;
}
return( strcmp(s->str, c) == 0 );
} | false | false | false | false | false | 0 |
HandleCalendarEventRemoveInvite(WorldPacket& recv_data)
{
ObjectGuid guid = _player->GetObjectGuid();
DEBUG_LOG("WORLD: Received opcode CMSG_CALENDAR_EVENT_REMOVE_INVITE [%s]", guid.GetString().c_str());
ObjectGuid invitee;
uint64 eventId;
uint64 ownerInviteId; // isn't it sender's inviteId? TODO: ... | false | false | false | false | false | 0 |
pkix_pl_oidBytes2Ascii(
SECItem *secItem,
char **pAscii,
void *plContext)
{
char *data = NULL;
PKIX_UInt32 *tokens = NULL;
PKIX_UInt32 token = 0;
PKIX_UInt32 numBytes = 0;
PKIX_UInt32 numTokens = 0;
PKIX_UInt32 i = 0, x = 0, y = 0;
PKIX_UIn... | false | false | false | false | false | 0 |
evas_object_bottom_get(const Evas *e)
{
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
return NULL;
MAGIC_CHECK_END();
if (e->layers)
{
Evas_Object *obj;
obj = e->layers->objects;
while (obj)
{
if (!obj->delete_me) return obj;
obj = evas_object_above_get_... | false | false | false | false | false | 0 |
socket_set_linger(int fd)
{
g_assert(fd >= 0);
if (!GNET_PROPERTY(use_so_linger))
return;
#ifdef TCP_LINGER2
{
int timeout = 20; /* timeout in seconds for FIN_WAIT_2 */
if (setsockopt(fd, sol_tcp(), TCP_LINGER2, &timeout, sizeof timeout))
g_warning("setsockopt() for TCP_LINGER2 failed: %m");
}
#else
{
... | false | false | false | false | false | 0 |
remove_pointing_invblock_V2(MINUTIAE *minutiae,
int *direction_map, const int mw, const int mh,
const LFSPARMS *lfsparms)
{
int i, ret;
int delta_x, delta_y, dmapval;
int nx, ny, bx, by;
MINUTIA *minutia;
double pi_factor, theta;
double dx, dy;... | false | false | false | false | false | 0 |
fc_lun_reset_send(unsigned long data)
{
struct fc_fcp_pkt *fsp = (struct fc_fcp_pkt *)data;
struct fc_lport *lport = fsp->lp;
if (lport->tt.fcp_cmd_send(lport, fsp, fc_tm_done)) {
if (fsp->recov_retry++ >= FC_MAX_RECOV_RETRY)
return;
if (fc_fcp_lock_pkt(fsp))
return;
setup_timer(&fsp->timer, fc_lun_rese... | false | false | false | false | false | 0 |
set_ioaccel2_tmf_performant_mode(struct ctlr_info *h,
struct CommandList *c,
int reply_queue)
{
struct hpsa_tmf_struct *cp = (struct hpsa_tmf_struct *)
&h->ioaccel2_cmd_pool[c->cmdindex];
/* Tell the controller to post the reply to the queue for this
* processor. This seems to give the best I/O thro... | false | false | false | false | false | 0 |
_frogr_settings_dialog_dispose (GObject *object)
{
FrogrSettingsDialogPrivate *priv = FROGR_SETTINGS_DIALOG_GET_PRIVATE (object);
if (priv->controller)
{
g_object_unref (priv->controller);
priv->controller = NULL;
}
if (priv->config)
{
g_object_unref (priv->config);
priv->con... | false | false | false | false | false | 0 |
AdjustLastAlloc(void *last_alloc, const size_t newsize) {
// It's only legal to call this on the last thing you alloced.
if (last_alloc == NULL || last_alloc != last_alloc_) return false;
// last_alloc_ should never point into a "big" block, w/ size >= block_size_
assert(freestart_ >= last_alloc_ && freestart_... | false | false | false | false | false | 0 |
ajMartGetMartqueryPtr(const AjPSeqin seqin)
{
AjPQuery qry = NULL;
AjPMartquery mq = NULL;
if(!seqin)
return NULL;
qry = seqin->Input->Query;
if(!qry)
return NULL;
mq = (AjPMartquery) qry->QryData;
return mq;
} | false | false | false | false | false | 0 |
capi_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
{
struct capidev *cdev = file->private_data;
struct sk_buff *skb;
u16 mlen;
if (!cdev->ap.applid)
return -ENODEV;
skb = alloc_skb(count, GFP_USER);
if (!skb)
return -ENOMEM;
if (copy_from_user(skb_put(skb, count), buf, count... | false | false | false | false | false | 0 |
reverseComplement()
{
this->reverse();
for(size_t idx = 0; idx < m_len; ++idx) m_data[idx] = complement(m_data[idx]);
} | false | false | false | false | false | 0 |
SlowMCAllocateRaw(int size_in_bytes) {
Page* current_page = TopPageOf(mc_forwarding_info_);
if (!current_page->next_page()->is_valid()) {
if (!Expand(current_page)) {
return NULL;
}
}
// There are surely more pages in the space now.
ASSERT(current_page->next_page()->is_valid());
// We do not ... | false | false | false | false | false | 0 |
__exif_tag_image_orientation_from_exif_value (gint value)
{
switch (value) {
case 1:
return "rotate-0";
case 2:
return "flip-rotate-0";
case 3:
return "rotate-180";
case 4:
return "flip-rotate-180";
case 5:
return "flip-rotate-270";
case 6:
return "rotate-90... | false | false | false | false | false | 0 |
sysfs_open(struct sysfs_cxt *cxt, const char *attr)
{
int fd = open_at(cxt->dir_fd, cxt->dir_path, attr, O_RDONLY);
if (fd == -1 && errno == ENOENT &&
strncmp(attr, "queue/", 6) == 0 && cxt->parent) {
/* Exception for "queue/<attr>". These attributes are available
* for parental devices only
*/
fd = ... | false | false | false | false | false | 0 |
save_area(int x1, int y1, int x2, int y2, char* saveScr )
{
err_when( x1>x2 || y1>y2 || x1<0 || y1<0 || x2>=VGA_WIDTH || y2>=VGA_HEIGHT );
long newSize = sizeof(short)*6 + (x2-x1+1) * (y2-y1+1);
saveScr = mem_resize( saveScr, newSize );
short* shortPtr = (short*) saveScr;
*shortPtr++ = x1;
*shortPtr++ = y1;
... | false | false | false | false | false | 0 |
PickBestUV(VP8EncIterator* const it, VP8ModeScore* const rd) {
const int kNumBlocks = 8;
const VP8SegmentInfo* const dqm = &it->enc_->dqm_[it->mb_->segment_];
const int lambda = dqm->lambda_uv_;
const uint8_t* const src = it->yuv_in_ + U_OFF_ENC;
uint8_t* tmp_dst = it->yuv_out2_ + U_OFF_ENC; // scratch buffe... | false | true | false | false | false | 1 |
MSG_ReadString (sizebuf_t *msg_read)
{
static char string[2048];
int l = 0, c;
do
{
c = MSG_ReadByte (msg_read);
if (c == -1 || c == 0)
break;
if (c == 0xFF)
c = '.';
string[l++] = c;
} while (l < sizeof(string)-1);
string[l] = 0;
return string;
} | false | false | false | false | false | 0 |
domark()
{
register struct filed *f;
#ifdef SYSV
int lognum;
#endif
if (MarkInterval > 0) {
now = time(0);
MarkSeq += LastAlarm;
if (MarkSeq >= MarkInterval) {
logmsg(LOG_MARK|LOG_INFO, "-- MARK --", LocalHostName, ADDDATE|MARK);
MarkSeq -= MarkInterval;
}
}
#ifdef SYSV
for (lognum = 0; lognum <= n... | false | false | false | false | false | 0 |
report_finalizer_roots_from_queue (SgenPointerQueue *queue)
{
GCRootReport report;
size_t i;
report.count = 0;
for (i = 0; i < queue->next_slot; ++i) {
void *obj = queue->data [i];
if (!obj)
continue;
add_profile_gc_root (&report, obj, MONO_PROFILE_GC_ROOT_FINALIZER, 0);
}
notify_gc_roots (&report);
} | false | false | false | false | false | 0 |
radio_clicked()
{
/* deselect others */
Kaptain * brother;
for (brother=parent->children.first();
brother!=0;
brother=parent->children.next())
if (brother)
{
brother->radio_select(false);
}
/* select this */
radio_select(true);
} | false | false | false | false | false | 0 |
xstack_pop(stack, data)
xstack_t *stack;
void *data;
{
if (stack->point == 0)
return NULL;
memcpy(data,
((char *)stack->data) + --stack->point * stack->esize,
stack->esize);
stack->data = (void *)xrealloc(stack->data, stack->point * stack->esize);
return data;
} | false | false | false | false | false | 0 |
patch_nvhdmi(struct hda_codec *codec)
{
struct hdmi_spec *spec;
int err;
err = patch_generic_hdmi(codec);
if (err)
return err;
spec = codec->spec;
spec->dyn_pin_out = true;
spec->ops.chmap_cea_alloc_validate_get_type =
nvhdmi_chmap_cea_alloc_validate_get_type;
spec->ops.chmap_validate = nvhdmi_chmap_vali... | false | false | false | false | false | 0 |
SSRegenerateFromSpiros(SplineSet *spl) {
SplineSet *temp;
if ( spl->spiro_cnt<=1 )
return;
if ( !has_spiro && !hasspiro())
return;
SplineSetBeziersClear(spl);
temp = SpiroCP2SplineSet(spl->spiros);
if ( temp!=NULL ) {
spl->first = temp->first;
spl->last = temp->last;
chunkfree(temp,sizeof(S... | false | false | false | false | false | 0 |
set_picture_sequence(double*params)
{
unsigned short picture_nr=1, last_picture_p=1, ready_out_p=1;
if(params){ // override default parameters
picture_nr=(unsigned short)params[0];
last_picture_p=(unsigned short)params[1];
ready_out_p=(unsigned short)params[2];
}
RETURN_TIME(
if(0!=SLM_Set... | false | false | false | false | false | 0 |
main()
{ EventProxy e(SOAP_IO_KEEPALIVE | SOAP_XML_INDENT);
// Events A to C do not generate a response from the server
fprintf(stderr, "Client Sends Event: A\n");
if (e.send_handle(EVENT_A))
e.soap_print_fault(stderr);
else if (synchronous && e.recv_handle_empty_response())
e.soap_print_fault(stderr);
... | false | false | false | false | false | 0 |
heap_shot_resolve_reverse_refs (HeapShot *hs)
{
uintptr_t i;
for (i = 0; i < hs->objects_hash_size; ++i) {
uintptr_t r;
HeapObjectDesc *ho = hs->objects_hash [i];
if (!ho)
continue;
for (r = 0; r < ho->num_refs; ++r) {
uintptr_t oi = heap_shot_find_obj_slot (hs, ho->refs [r]);
add_heap_class_rev (ho-... | false | false | false | true | false | 1 |
fclose(FILE *f)
{
if (!f) THROW_EXCEPTION("Trying to close a NULL 'FILE*' descriptor")
::fclose(f);
} | false | false | false | false | false | 0 |
clear() {
QList<QGraphicsLayoutItem*> itemsToRemove;
for(int i=0; i < count(); i++) {
itemsToRemove << itemAt(i);
}
foreach(QGraphicsLayoutItem* iToR, itemsToRemove) {
removeItem(iToR);
}
} | false | false | false | false | false | 0 |
_tpl_event_queue_insert_sorted_after (GQueue *events,
GList *index,
TplEvent *event)
{
if (g_queue_is_empty (events))
{
g_queue_push_tail (events, event);
return events->tail;
}
/* The initial index might go before the first one */
if (index == NULL)
{
index = events->head;
... | false | false | false | false | false | 0 |
coral_init (Display *dpy, Window window)
{
struct state *st = (struct state *) calloc (1, sizeof(*st));
st->dpy = dpy;
st->window = window;
st->max_points = 200;
st->pointbuf = (XPoint *) calloc(sizeof(XPoint), st->max_points+2);
if (!st->pointbuf) exit(-1);
st->delay = get_integer_resource (st->dpy, "de... | false | false | false | false | false | 0 |
write_row_callback(png_structp png_ptr, png_uint_32 row_number, int pass)
{
if (png_ptr == NULL || row_number > PNG_UINT_31_MAX || pass > 7)
return;
fprintf(stdout, "w");
} | false | false | false | false | false | 0 |
vtkWrap_IsTypeOf(
HierarchyInfo *hinfo, const char *classname, const char *superclass)
{
HierarchyEntry *entry;
if (strcmp(classname, superclass) == 0)
{
return 1;
}
if (hinfo)
{
entry = vtkParseHierarchy_FindEntry(hinfo, classname);
if (entry && vtkParseHierarchy_IsTypeOf(hinfo, entry... | false | false | false | false | false | 0 |
use(game *g)
{
if (w_terminal == NULL)
w_terminal = newwin(25, 80, 0, 0);
wborder(w_terminal, LINE_XOXO, LINE_XOXO, LINE_OXOX, LINE_OXOX,
LINE_OXXO, LINE_OOXX, LINE_XXOO, LINE_XOOX );
print_line("Logging into %s...", name.c_str());
if (security > 0) {
print_error("ERROR! Access denied!"... | false | false | false | false | false | 0 |
plpgsql_build_record(const char *refname, int lineno, bool add2namespace)
{
PLpgSQL_rec *rec;
rec = palloc0(sizeof(PLpgSQL_rec));
rec->dtype = PLPGSQL_DTYPE_REC;
rec->refname = pstrdup(refname);
rec->lineno = lineno;
rec->tup = NULL;
rec->tupdesc = NULL;
rec->freetup = false;
rec->freetupdesc = false;
plpgsq... | false | false | false | false | false | 0 |
__find_thrdtsk(struct thread_t *cur_thp)
{
struct thread_t *thdp;
for (thdp = cur_thp; thdp != NULL; thdp = thdp->thpar)
{
if (thdp->assoc_tsk != NULL) return(thdp->assoc_tsk);
}
return(NULL);
} | false | false | false | false | false | 0 |
epr_set_bm_expr_error(EPR_SParseInfo* parse_info, const char* message) {
static char msg_buf[2048];
epr_push_back_bm_expr_token(parse_info);
if (message != NULL) {
if (!epr_is_bm_EOS_token(parse_info)) {
sprintf(msg_buf, "%s, but found token '%s'", message, parse_info->token);
... | false | false | false | false | false | 0 |
gst_rtp_celt_pay_flush_queued (GstRtpCELTPay * rtpceltpay)
{
GstFlowReturn ret;
GstBuffer *buf, *outbuf;
guint8 *payload, *spayload;
guint payload_len;
GstClockTime duration;
payload_len = rtpceltpay->bytes + rtpceltpay->sbytes;
duration = rtpceltpay->qduration;
GST_DEBUG_OBJECT (rtpceltpay, "flushing... | false | false | false | false | false | 0 |
drawChecker()
{
GLdouble x, y, z;
GLint i,j;
V4d Diffuse1 = {0.0,0.0,0.0,0.8};
V4d Diffuse2 = {0.8,0.8,0.8,0.8};
V4d Specular = {0.8,0.8,0.8,0.8 };
V4d Ambiant = {0.1,0.1,0.1,0.8};
static GLdouble w = 4;
static GLint n = 50;
static GLdouble x0 = -100;
static GLdouble y0 = 0;
static GLdouble z0 = -100;
GL... | false | false | false | false | false | 0 |
value_inc( Value *value )
{
*value->val_int += value->step;
if ( *value->val_int > value->max ) *value->val_int = value->min;
value_update_str( value );
} | false | false | false | false | false | 0 |
refresh_devices_list_cb (G_GNUC_UNUSED GtkWidget *widget,
gpointer data)
{
g_return_if_fail (data != NULL);
GtkWidget *prefs_window = GTK_WIDGET (data);
gm_prefs_window_update_devices_list(prefs_window);
} | false | false | false | false | false | 0 |
valid_short_opt (int ci, char c)
{
gretlopt opt = 0;
int i, ok;
for (i=0; flag_matches[i].c != '\0'; i++) {
if (c == flag_matches[i].c) {
opt = flag_matches[i].o;
break;
}
}
if (opt) {
ok = opt_is_valid(opt, ci, c);
if (!ok) {
opt = 0;
}
}
return opt;
} | false | false | false | false | false | 0 |
print_device (AuServer *aud, AuDeviceAttributes *d)
{
AuMask vmask = AuDeviceValueMask (d);
if (AuDeviceChangableMask(d))
_print_names (aud, _nt_devicechangables,
NENTRIES(_nt_devicechangables),
" Changable:", 32,
_get_devicechangables, (AuPointer) d, AuTrue);
print_comp (au... | false | false | false | false | false | 0 |
mem_cgroup_reset(struct kernfs_open_file *of, char *buf,
size_t nbytes, loff_t off)
{
struct mem_cgroup *memcg = mem_cgroup_from_css(of_css(of));
struct page_counter *counter;
switch (MEMFILE_TYPE(of_cft(of)->private)) {
case _MEM:
counter = &memcg->memory;
break;
case _MEMSWAP:
counter = &memcg->memsw;... | false | false | false | true | false | 1 |
hilight_match(SERVER_REC *server, const char *channel,
const char *nick, const char *address,
int level, const char *str,
int *match_beg, int *match_end)
{
GSList *tmp;
CHANNEL_REC *chanrec;
NICK_REC *nickrec;
g_return_val_if_fail(str != NULL, NULL);
if ((never_hilig... | false | false | false | false | false | 0 |
is_ansi_end(ch)
LWCHAR ch;
{
if (!is_ascii_char(ch))
return (0);
return (strchr(end_ansi_chars, (char) ch) != NULL);
} | false | false | false | false | false | 0 |
rgbe_file_new (const gchar *path)
{
rgbe_file *file;
g_return_val_if_fail (path, NULL);
file = g_new (rgbe_file, 1);
if (!rgbe_file_init (file, path))
{
rgbe_file_free (file);
file = NULL;
}
return file;
} | false | false | false | false | false | 0 |
__ecereMethod_CodeObject_OnCompare(struct __ecereNameSpace__ecere__com__Class * class, struct CodeObject * this, struct CodeObject * b)
{
int result = 0;
if(this->type == 3 && b->type == 2)
result = this->eventsUp ? -1 : 1;
else if(this->type == 2 && b->type == 3)
result = this->eventsUp ? 1 : -1;
else if(this->name &... | false | false | false | false | false | 0 |
conf_service_aliases(config_entry_t *ce)
{
service_t *sptr;
config_entry_t *subce;
sptr = service_find(ce->ce_prevlevel->ce_varname);
if (!sptr)
return -1;
if (sptr->aliases)
mowgli_patricia_destroy(sptr->aliases, free_alias_string, NULL);
sptr->aliases = NULL;
if (!ce->ce_entries)
return 0;
sptr->alias... | false | false | false | false | false | 0 |
clear_node_page_dirty(struct page *page)
{
struct address_space *mapping = page->mapping;
unsigned int long flags;
if (PageDirty(page)) {
spin_lock_irqsave(&mapping->tree_lock, flags);
radix_tree_tag_clear(&mapping->page_tree,
page_index(page),
PAGECACHE_TAG_DIRTY);
spin_unlock_irqrestore(&mapping->tr... | false | false | false | false | false | 0 |
ve_config_save (VeConfig *config, gboolean force)
{
FILE *fp;
GList *li;
g_return_val_if_fail (config != NULL, FALSE);
if ( ! force && ! config->dirty)
return TRUE;
VE_IGNORE_EINTR (fp = fopen (config->file, "w"));
if (fp == NULL)
return FALSE;
save_section (config->root, fp);
for (li = config->section... | false | false | false | false | true | 1 |
gigas_draw_sprites( struct mame_bitmap *bitmap, const struct rectangle *cliprect )
{
int offs;
for (offs = 0;offs < spriteram_size;offs += 4)
{
int xpos = spriteram[offs + 3];
int ypos = spriteram[offs + 2];
int code = spriteram[offs + 0]|( (spriteram[offs + 1]&0x20) <<3 );
int flipx = 0;
int ... | false | false | false | false | false | 0 |
gos_update_width(void)
{
glui32 width;
if (gos_upper)
{
glk_window_get_size(gos_upper, &width, NULL);
h_screen_cols = width;
SET_BYTE(H_SCREEN_COLS, width);
if (curx > width)
{
glk_window_move_cursor(gos_upper, 0, cury-1);
curx = 1;
}
}
} | false | false | false | false | false | 0 |
gw_properties_box_get_disk_category_ref ( GtkWidget *w) {
GtkWidget *cmb_box_categories = NULL;
GWDBCategory *category = NULL;
GWDBCategoryPK ref = NULL;
#ifdef GW_DEBUG_GUI_COMPONENT
g_print ( "*** GW - %s (%d) :: %s()\n", __FILE__, __LINE__, __PRETTY_FUNCTION__);
#endif
if ( w != NULL ) {
if ( (cmb_box_cate... | false | false | false | false | false | 0 |
gk104_pll_calc_hiclk(int target_khz, int crystal,
int *N1, int *fN1, int *M1, int *P1,
int *N2, int *M2, int *P2)
{
int best_clk = 0, best_err = target_khz, p_ref, n_ref;
bool upper = false;
*M1 = 1;
/* M has to be 1, otherwise it gets unstable */
*M2 = 1;
/* can be 1 or 2, sticking with 1 for simplicity */
... | false | false | false | false | false | 0 |
qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
Q_ASSERT(staticMetaObject.cast(_o));
BoardScene *_t = static_cast<BoardScene *>(_o);
switch (_id) {
case 0: _t->humanMove((*reinterpret_cast< const Chess::GenericMov... | false | false | false | false | false | 0 |
OpNull()
{
char hostname[100] ;
struct hostent *host ;
u_long pmd_host ;
u_short port ;
system("clear") ;
printf("PMD_OP_NULL") ;
printf("\n-----------\n") ;
printf("\nEnter host-name : ") ;
scanf("%s", hostname) ;
if (isdigit(hostname[0]))
pmd_host = inet_addr(hostname) ;
... | false | false | false | false | true | 1 |
parse_command_line_pvs (void)
{
char *out, *err;
char *p, *pend;
int r, i;
guestfs_int_lvm_pv_list *ret;
void *newp;
ret = malloc (sizeof *ret);
if (!ret) {
reply_with_perror ("malloc");
return NULL;
}
ret->guestfs_int_lvm_pv_list_len = 0;
ret->guestfs_int_lvm_pv_list_val = NULL;
r = co... | false | false | false | false | false | 0 |
_put_button_as_up(grid_button_t *grid_button)
{
if (GTK_IS_BUTTON(grid_button->button)) {
return;
}
gtk_widget_destroy(grid_button->button);
grid_button->button = gtk_button_new();
gtk_widget_set_size_request(grid_button->button,
working_sview_config.button_size,
working_sview_config.button_size)... | false | false | false | false | false | 0 |
_k_slotAllVisibleColumns()
{
if ( searchColumns.isEmpty() )
searchColumns.append( 0 );
else
searchColumns.clear();
q->updateSearch();
} | false | false | false | false | false | 0 |
mapLookup(char* map[], const char* key, char** value) {
int i;
for (i = 0; strcmp(map[i], ""); i += 2){
if (!strcmp(key, map[i])){
*value = map[i + 1];
return 1;
}
}
return 0;
} | false | false | false | false | false | 0 |
mapvue_read_string(const guchar **p, gsize size, gchar *str, GError **error)
{
guint strsize;
if (size < 1) {
g_set_error(error, GWY_MODULE_FILE_ERROR, GWY_MODULE_FILE_ERROR_DATA,
_("Character array does not fit into the file."));
return 0;
}
strsize = **p;
/* g... | false | true | false | false | false | 1 |
PyThread_ReInitTLS(void)
{
long id = PyThread_get_thread_ident();
struct key *p, **q;
if (!keymutex)
return;
/* As with interpreter_lock in PyEval_ReInitThreads()
we just create a new lock without freeing the old one */
keymutex = PyThread_allocate_lock();
/* Delete all keys wh... | false | false | false | false | false | 0 |
set_fifo_mode(struct net2280 *dev, int mode)
{
/* keeping high bits preserves BAR2 */
writel((0xffff << PCI_BASE2_RANGE) | mode, &dev->regs->fifoctl);
/* always ep-{a,b,e,f} ... maybe not ep-c or ep-d */
INIT_LIST_HEAD(&dev->gadget.ep_list);
list_add_tail(&dev->ep[1].ep.ep_list, &dev->gadget.ep_list);
list_add_t... | false | false | false | false | false | 0 |
f_winsaveview(argvars, rettv)
typval_T *argvars;
typval_T *rettv;
{
dict_T *dict;
dict = dict_alloc();
if (dict == NULL)
return;
rettv->v_type = VAR_DICT;
rettv->vval.v_dict = dict;
++dict->dv_refcount;
dict_add_nr_str(dict, "lnum", (long)curwin->w_cursor.lnum, NULL);
dict_add... | false | false | false | false | false | 0 |
set_free_pos(unsigned long *free_until_pos, enum machine_reg reg,
unsigned long pos)
{
/*
* If reg is greater than or equal to NR_REGISTERS, it's
* not a general purpose register and thus not available for
* allocation so it's safe to just ignore it.
*/
if (reg >= NR_REGISTERS)
return;
/*
* If the p... | false | false | false | false | false | 0 |
extend_dependency_caches (int n, bool create_p)
{
if (create_p || true_dependency_cache)
{
int i, luid = cache_size + n;
true_dependency_cache = XRESIZEVEC (bitmap_head, true_dependency_cache,
luid);
output_dependency_cache = XRESIZEVEC (bitmap_head,
output_dependency_cache, lui... | false | false | false | false | false | 0 |
listindex(PyListObject *self, PyObject *args)
{
Py_ssize_t i, start=0, stop=Py_SIZE(self);
PyObject *v;
if (!PyArg_ParseTuple(args, "O|O&O&:index", &v,
_PyEval_SliceIndex, &start,
_PyEval_SliceIndex, &stop))
return NULL;
if (start ... | false | false | false | false | false | 0 |
FindOffset(HashTable ht, Object object, uint *offset)
{
HashElement eltPtr;
eltPtr = (HashElement)DXQueryHashElement(ht, (Key)&object);
if (eltPtr)
*offset = (uint)eltPtr->data;
else
*offset = HASH_EMPTY; /* 0 -- an illegal offset for objects */
return ht;
} | false | false | false | false | false | 0 |
HA_CountColumnsInHAlign(char **lines, int n)
{
int i, max_col =0;
for (i=0; i<n; i++) {
int col = 1;
char *s = lines[i];
while ( (s=NextAmpersand(s)) && *s != '\0') {
col++;
s++;
}
diagnostics(5,"line[%d] has %d columns",i,col);
if (co... | false | false | false | false | false | 0 |
spv_sub (spv_t r, spv_t x, spv_t y, spv_size_t len, sp_t m)
{
spv_size_t i;
ASSERT (r >= x + len || x >= r);
ASSERT (r >= y + len || y >= r);
for (i = 0; i < len; i++)
r[i] = sp_sub (x[i], y[i], m);
} | false | false | false | false | false | 0 |
kstub(state_t *s, int funct_nr, int argc, reg_t *argv)
{
int i;
SCIkwarn(SCIkWARNING, "Unimplemented syscall: %s[%x](",
s->kernel_names[funct_nr], funct_nr);
for (i = 0; i < argc; i++) {
sciprintf(PREG, PRINT_REG(argv[i]));
if (i+1 < argc) sciprintf(", ");
}
sciprintf(")\n");
return NULL_REG;
} | false | false | false | false | false | 0 |
parse_line_mode(char *buf, struct hda_bus *bus)
{
int i;
for (i = 0; i < ARRAY_SIZE(patch_items); i++) {
if (!patch_items[i].tag)
continue;
if (strmatch(buf, patch_items[i].tag))
return i;
if (patch_items[i].alias && strmatch(buf, patch_items[i].alias))
return i;
}
return LINE_MODE_NONE;
} | false | false | false | false | false | 0 |
get_str_from_var_sci(NumericVar *var, int rscale)
{
int32 exponent;
NumericVar denominator;
NumericVar significand;
int denom_scale;
size_t len;
char *str;
char *sig_out;
if (rscale < 0)
rscale = 0;
/*
* Determine the exponent of this number in normalised form.
*
* This is the exponent requ... | false | false | false | false | false | 0 |
make_changes_string(LDAPMod **ldm, const char **includeattrs)
{
lenstr *l;
int i, j, len;
int skip;
l = lenstr_new();
for ( i = 0; ldm[ i ] != NULL; i++ ) {
/* If a list of explicit attributes was given, only add those */
if ( NULL != includeattrs ) {
skip = 1;
for ( j = 0; includ... | false | false | false | false | false | 0 |
vnc_screenshot(GtkWidget *window G_GNUC_UNUSED,
GdkEvent *ev, GtkWidget *vncdisplay)
{
if (ev->key.keyval == GDK_F11) {
GdkPixbuf *pix = vnc_display_get_pixbuf(VNC_DISPLAY(vncdisplay));
gdk_pixbuf_save(pix, "gvncviewer.png", "png", NULL, "tEXt::Generator App", "gvncvie... | false | false | false | false | false | 0 |
ladish_save_jack_client_end(
void * context,
ladish_graph_handle graph_handle,
bool hidden,
ladish_client_handle client_handle,
const char * client_name,
void * client_iteration_context_ptr)
{
if (!ctx_ptr->client_visible)
{
return true;
}
if (!ladish_write_indented_string(fd, indent + 1, "</po... | false | false | false | false | false | 0 |
getDisplayNames(UVector& result,
const Locale& locale,
const UnicodeString* matchID,
UErrorCode& status) const
{
result.removeAllElements();
result.setDeleter(userv_deleteStringPair);
if (U_SUCCESS(status)) {
ICU... | false | false | false | false | false | 0 |
strop_splitfields(PyObject *self, PyObject *args)
{
Py_ssize_t len, n, i, j, err;
Py_ssize_t splitcount, maxsplit;
char *s, *sub;
PyObject *list, *item;
WARN;
sub = NULL;
n = 0;
splitcount = 0;
maxsplit = 0;
if (!PyArg_ParseTuple(args, "t#|z#n:split", &s, &len, &sub, &n, &maxspl... | false | false | false | false | false | 0 |
nCorrectGrad(double **N, double lambda, int xNum, int yNum,
double deltaX, double deltaY)
{
int i;
int parNum;
double alpha[3];
double lambdaX, lambdaY;
lambdaX = lambda * (deltaY / deltaX);
lambdaY = lambda * (deltaX / deltaY);
parNum = xNum * yNum;
alpha[0] = 2 * lambdaX + 2 *... | false | false | false | false | false | 0 |
_ecore_evas_buffer_free(Ecore_Evas *ee)
{
if (ee->engine.buffer.image)
{
Ecore_Evas *ee2;
ee2 = evas_object_data_get(ee->engine.buffer.image, "Ecore_Evas_Parent");
evas_object_del(ee->engine.buffer.image);
ee2->sub_ecore_evas = eina_list_remove(ee2->sub_ecore_evas, ee);
}
... | false | false | false | false | false | 0 |
pem_task_get_2D_performance_state_id(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data)
{
int result;
if (eventmgr->features[PP_Feature_PowerPlay].supported &&
!(eventmgr->features[PP_Feature_PowerPlay].enabled))
result = psm_get_state_by_classification(eventmgr,
PP_StateClassificationFlag_Bo... | false | false | false | false | false | 0 |
colrow_compute_pixels_from_pts (ColRowInfo *cri, Sheet const *sheet,
gboolean horizontal, double scale)
{
int const margin = horizontal ? 2*GNM_COL_MARGIN : 2*GNM_ROW_MARGIN;
if (scale == -1)
scale = colrow_compute_pixel_scale (sheet, horizontal);
if (horizontal && sheet->display_formulas)
scale *= 2;
cr... | false | false | false | false | false | 0 |
show_longdoc (i)
int i;
{
register int j;
char * const *doc;
int fd;
doc = shell_builtins[i].long_doc;
if (doc && doc[0] && *doc[0] == '/' && doc[1] == (char *)NULL)
{
fd = open_helpfile (doc[0]);
if (fd < 0)
return;
zcatfd (fd, 1, doc[0]);
close (fd);
}
else
for ... | false | false | false | true | false | 1 |
getFirstDateByRandomDate(ViewType viewType, const QDate &randomDate)
{
if (randomDate.isNull())
return randomDate;
switch (viewType) {
case View_Day:
return randomDate;
case View_Week:
return randomDate.addDays(-randomDate.dayOfWeek() + 1);
case View_Month:
return ran... | false | false | false | false | false | 0 |
assertLower(const Expr& x_i, const EpsRational& c, const Theorem& thm) {
// Check if the given expression is actually a variable
DebugAssert(isLeaf(x_i), "TheoryArithNew::assertLower wrong kind, expected an arithmetic leaf (variable) got " + x_i.toString());
// If trace is on for the simplex, print it out
TRACE("... | false | false | false | false | false | 0 |
getCurrentOption(OFCmdString &opt)
{
if (OptionPosIterator != OptionPosList.end())
return (opt = **OptionPosIterator).length() > 0;
return OFFalse;
} | false | false | false | false | false | 0 |
adjustHLayout(){
FXWindow *child,*stretcher;
FXint w,h,pos;
FXASSERT(window);
if(options&SPLITTER_REVERSED){
pos=window->getX()+window->getWidth();
window->position(split,0,pos-split,height);
pos=split-barsize;
for(stretcher=getFirst(); stretcher && !stretcher->shown(); stretcher=stretcher->getN... | false | false | false | false | false | 0 |
event_RadioWholePageClicked(void)
{
_enablePercentSpin(false);
if ( m_pFrame )
_updatePreviewZoomPercent(m_pFrame->getCurrentView ()->calculateZoomPercentForWholePage ());
} | false | false | false | false | false | 0 |
_e_fm2_file_fm2_find(const char *file)
{
char *dir;
Eina_List *l;
Evas_Object *obj;
dir = ecore_file_dir_get(file);
if (!dir) return NULL;
EINA_LIST_FOREACH(_e_fm2_list, l, obj)
{
if ((_e_fm2_list_walking > 0) &&
(eina_list_data_find(_e_fm2_list_remove, obj))) continue;
... | false | false | false | false | false | 0 |
dlm_do_migrate_request(struct dlm_ctxt *dlm,
struct dlm_lock_resource *res,
u8 master, u8 new_master,
struct dlm_node_iter *iter)
{
struct dlm_migrate_request migrate;
int ret, skip, status = 0;
int nodenum;
memset(&migrate, 0, sizeof(migrate));
migrate.namelen = res->lockname.len;
memcpy(migra... | false | true | false | false | false | 1 |
print_ascii (size_t fields, size_t blank, void const *block,
const char *unused_fmt_string ATTRIBUTE_UNUSED, int width,
int pad)
{
unsigned char const *p = block;
size_t i;
int pad_remaining = pad;
for (i = fields; blank < i; i--)
{
int next_pad = pad * (i - 1) / fields;
... | false | false | false | false | false | 0 |
_threshold_event_enable_verify (ipmi_sensors_config_state_data_t *state_data,
const char *section_name)
{
uint8_t sdr_record[IPMI_SDR_CACHE_MAX_SDR_RECORD_LENGTH];
unsigned int sdr_record_len = IPMI_SDR_CACHE_MAX_SDR_RECORD_LENGTH;
config_err_t rv = CONFIG_ERR_FATAL_ERROR;
config... | false | false | false | false | false | 0 |
ri__gth_browser_update_sensitivity_cb (GthBrowser *browser)
{
BrowserData *data;
GtkAction *action;
int n_selected;
gboolean sensitive;
data = g_object_get_data (G_OBJECT (browser), BROWSER_DATA_KEY);
g_return_if_fail (data != NULL);
n_selected = gth_file_selection_get_n_selected (GTH_FILE_SELEC... | false | false | false | false | false | 0 |
extension () {
for (unsigned i = _project.config ().Options (); i > 0; i--) {
const ConfOption *o = _project.config ().Option (i-1);
if (! strcmp (o->Name (), "-e") || ! strcmp (o->Name (), "--extension")) {
if (! o->Arguments ())
continue;
return o->Argument (0);
}
}
return "cc";
} | false | false | false | false | false | 0 |
sFlushRxFIFO(CHANNEL_T * ChP)
{
int i;
Byte_t Ch; /* channel number within AIOP */
int RxFIFOEnabled; /* 1 if Rx FIFO enabled */
if (sGetRxCnt(ChP) == 0) /* Rx FIFO empty */
return; /* don't need to flush */
RxFIFOEnabled = 0;
if (ChP->R[0x32] == 0x08) { /* Rx FIFO is enabled */
RxFIFOEnabled = 1;
sDisR... | false | false | false | false | false | 0 |
atomic_write_file_contents(const char *filename, const lcdf::String &contents,
mode_t mode)
{
lcdf::String tmp_filename = lcdf::String(filename) + ".tmp";
int r = sync_write_file_contents(tmp_filename.c_str(), contents, mode);
if (r != 0)
return -1;
return rename(tmp_filename.c_str(), filena... | false | false | false | false | false | 0 |
mpfr_gamma_alpha (mpfr_t s, mpfr_prec_t p)
{
if (p <= 100)
mpfr_set_ui_2exp (s, 614, -10, MPFR_RNDN); /* about 0.6 */
else if (p <= 500)
mpfr_set_ui_2exp (s, 819, -10, MPFR_RNDN); /* about 0.8 */
else if (p <= 1000)
mpfr_set_ui_2exp (s, 1331, -10, MPFR_RNDN); /* about 1.3 */
else if (p <= 2000)
... | 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.