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 |
|---|---|---|---|---|---|---|
read_frame( cli_pic_t *pic, hnd_t handle, int frame )
{
timecode_hnd_t *h = handle;
if( h->input.read_frame( pic, h->p_handle, frame ) )
return -1;
pic->pts = get_frame_pts( h, frame, 1 );
pic->duration = get_frame_pts( h, frame + 1, 0 ) - pic->pts;
return 0;
} | false | false | false | false | false | 0 |
ifp_download_file(struct ifp_device * dev,
const char * remotefile, const char * localfile,
ifp_progress fn, void * fn_context)
{
int i = 0;
struct ifp_transfer_status progress;
struct ifp_transfer_status * p = NULL;
p = init_progress(&progress, fn, fn_context);
i = _download_file(dev, remotefile, localfile, p)... | false | false | false | false | false | 0 |
setLanguage(const char *locale) {
if (strlen(locale) >= 2) {
Lang[0] = locale[0];
Lang[1] = locale[1];
Lang[2] = 0;
} else
strcpy(Lang, locale);
SubLang[0]=0;
if (strlen(locale) >= 5)
if (locale[2] == '_') {
SubLang[0] = locale[3];
SubLang[1] = locale[4];
SubLang[2] = 0;
... | false | false | false | false | false | 0 |
teardown (Test *test, gconstpointer unused)
{
g_hash_table_destroy (test->keys);
if (test->result)
g_object_unref (test->result);
g_object_unref (test->collection);
g_free (test->directory);
} | false | false | false | false | false | 0 |
tunnel_tun(int tun_fd, int dns_fd)
{
unsigned long outlen;
unsigned long inlen;
char out[64*1024];
char in[64*1024];
ssize_t read;
if ((read = read_tun(tun_fd, in, sizeof(in))) <= 0)
return -1;
/* We may be here only to empty the tun device; then return -1
to force continue in select loop. */
if (is_sen... | true | true | false | false | true | 1 |
Debug (level, fmt, arg1, arg2, arg3, arg4, arg5, arg6)
int level;
char *fmt;
char *arg1, *arg2, *arg3, *arg4, *arg5, *arg6;
{
fprintf (stderr, fmt, arg1, arg2, arg3, arg4, arg5, arg6);
if (level < 0)
{
exit (0);
}
return (0);
} | false | false | false | false | false | 0 |
ossl_ssl_get_state(VALUE self)
{
SSL *ssl;
VALUE ret;
Data_Get_Struct(self, SSL, ssl);
if (!ssl) {
rb_warning("SSL session is not started yet.");
return Qnil;
}
ret = rb_str_new2(SSL_state_string(ssl));
if (ruby_verbose) {
rb_str_cat2(ret, ": ");
rb_str_cat2(... | false | false | false | false | false | 0 |
_slurm_rpc_job_step_create(slurm_msg_t * msg)
{
static int active_rpc_cnt = 0;
int error_code = SLURM_SUCCESS;
DEF_TIMERS;
slurm_msg_t resp;
struct step_record *step_rec;
job_step_create_response_msg_t job_step_resp;
job_step_create_request_msg_t *req_step_msg =
(job_step_create_request_msg_t *) msg->data;
sl... | false | false | false | false | false | 0 |
create_firmware_file(pin_configs_t* pins, int entries, int card, int device,
const char* model, GError** err)
{
gboolean ok;
gchar destbuf[40*40] = "";
gchar* s = destbuf;
gchar* filename = g_strdup_printf("%s/hda-jack-retask.fw", tempdir);
unsigned int address, codec_vendorid, codec_ssid;
... | false | false | false | false | false | 0 |
main(int argc,char *argv[]) {
char screen[64][100];
char *name = NULL;
char *file = NULL;
int format = NXT_PNG;
int transparency = 0;
int c,x,y,newfmt;
while ((c = getopt(argc,argv,":hn:f:o:t"))!=-1) {
switch(c) {
case 'h':
usage(argv[0],0);
break;
case 'n':
name =... | true | true | false | false | true | 1 |
folder_search_match_all (CamelSExp *sexp,
gint argc,
CamelSExpTerm **argv,
CamelFolderSearch *search)
{
gint i;
CamelSExpResult *r, *r1;
gchar *error_msg;
GPtrArray *v;
if (argc > 1) {
g_warning ("match-all only takes a single argument, ... | false | false | false | false | false | 0 |
wstring_list_equal(wstring_list_ty *a, wstring_list_ty *b)
{
size_t j, k;
for (j = 0; j < a->nitems; ++j)
{
for (k = 0; k < b->nitems; ++k)
if (wstr_equal(a->item[j], b->item[k]))
break;
if (k >= b-... | false | false | false | false | false | 0 |
bonobo_dock_item_grip_expose (GtkWidget *widget,
GdkEventExpose *event)
{
GdkRectangle *clip = &event->area;
GdkRectangle *rect = &widget->allocation;
BonoboDockItemGrip *grip = (BonoboDockItemGrip *) widget;
GtkShadowType shadow = GTK_SHADOW_OUT;
gtk_paint_handle (widget->style,
widget->window... | false | false | false | false | false | 0 |
jpeg_InputSource_src (j_decompress_ptr cinfo, CL_JPEGProvider_Generic* provider)
{
InputSource_src_ptr src;
if (cinfo->src == NULL) /* first time for this JPEG object? */
{
cinfo->src = (struct jpeg_source_mgr*)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
sizeof(InputSource_so... | false | false | false | false | false | 0 |
clutter_backend_real_init_events (ClutterBackend *backend)
{
const char *input_backend = NULL;
input_backend = g_getenv ("CLUTTER_INPUT_BACKEND");
if (input_backend != NULL)
input_backend = g_intern_string (input_backend);
#ifdef CLUTTER_INPUT_OSX
if (clutter_check_windowing_backend (CLUTTER_WINDOWING_OSX... | false | false | false | false | false | 0 |
set_preferred_lft(interface_defn * ifd, char **pparam, int argc UNUSED, char **argv UNUSED)
{
if (!ifd->real_iface)
return;
if (iface_has(":")) {
char s[] = "0";
*pparam = realloc(*pparam, sizeof(s));
if (*pparam == NULL)
return;
strcpy(*pparam, s);
}
} | false | false | false | false | false | 0 |
Validate()
{
wxTextCtrl* pRetries = XRCCTRL(*this, "ID_RETRIES", wxTextCtrl);
long retries;
if (!pRetries->GetValue().ToLong(&retries) || retries < 0 || retries > 99)
return DisplayError(pRetries, _("Number of retries has to be between 0 and 99."));
wxTextCtrl* pDelay = XRCCTRL(*this, "ID_RETRYDELAY", wxTextCtr... | false | false | false | false | false | 0 |
arizona_of_get_type(struct device *dev)
{
const struct of_device_id *id = of_match_device(arizona_of_match, dev);
if (id)
return (unsigned long)id->data;
else
return 0;
} | false | false | false | false | false | 0 |
CloseReports(char *agents)
{ char name[CF_BUFSIZE];
#ifndef HAVE_NOVA
if (SHOWREPORTS)
{
CfOut(cf_verbose,"","Wrote compilation report %s%creports%cpromise_output_%s.txt",CFWORKDIR,FILE_SEPARATOR,FILE_SEPARATOR,agents);
CfOut(cf_verbose,"","Wrote compilation report %s%creports%cpromise_output_%s.html",CFWOR... | true | true | false | false | true | 1 |
addResolvent(uint32 id, const Clause& lhs, const Clause& rhs) {
resolvent_.clear();
Solver* s = ctx_->master();
assert(lhs[0] == ~rhs[0]);
uint32 i, end;
Literal l;
for (i = 1, end = lhs.size(); i != end; ++i) {
l = lhs[i];
if (!s->isFalse(l)) {
if (s->isTrue(l)) goto unmark;
occurs_[l.var()].mark(l.sig... | false | false | false | false | false | 0 |
LowerOperation(SDValue Op,
SelectionDAG &DAG) const {
switch (Op.getOpcode()) {
case ISD::BR_CC: return LowerBR_CC(Op, DAG);
case ISD::SELECT_CC: return LowerSELECT_CC(Op, DAG);
case ISD::GlobalAddress: return LowerGlobalAddress(Op, DAG);
case... | false | false | false | false | false | 0 |
Custom600Headers()
{
string Final = _config->FindDir("Dir::State::lists");
Final += URItoFileName(Desc.URI);
struct stat Buf;
if (stat(Final.c_str(),&Buf) != 0)
return "\nIndex-File: true\nFail-Ignore: true\n";
return "\nIndex-File: true\nFail-Ignore: true\nLast-Modified: " + TimeRFC1123(Buf.st_mt... | false | false | false | false | false | 0 |
excel_read_SELECTION (BiffQuery *q, ExcelReadSheet *esheet)
{
GnmCellPos edit_pos;
unsigned pane_number, i, j, num_refs;
SheetView *sv = sheet_get_view (esheet->sheet, esheet->container.importer->wbv);
GnmRange r;
XL_CHECK_CONDITION (q->length >= 9);
pane_number = GSF_LE_GET_GUINT8 (q->data);
edit_pos.row = GSF... | false | false | false | false | false | 0 |
append_nt_elem_in_nt_elem(Module_table *mpt, Nt_elem *add_elem)
{
Boolean is_same;
Nt_elem *nt_elem, *ret_elem;
is_same = FALSE;
if(mpt->nt_elem_head == NULL) {
mpt->nt_elem_head = add_elem;
return add_elem;
}
else {
for(nt_elem = mpt->nt_elem_head;
nt_elem ... | false | false | false | false | false | 0 |
wiring_open(PROGRAMMER * pgm, char * port)
{
int timetosnooze;
void *mycookie = STK500V2PDATA(pgm)->chained_pdata;
strcpy(pgm->port, port);
serial_open(port, pgm->baudrate ? pgm->baudrate: 115200, &pgm->fd);
/* If we have a snoozetime, then we wait and do NOT toggle DTR/RTS */
if (WIRINGPDATA(mycookie)->... | false | false | false | false | false | 0 |
addVarIdx(const string& name) {
int idx = getFreeID();
int type = str_var(name) ? 2 : 1;
if (idx != -1) {
m_Names[idx] = name;
m_Types[idx] = type;
} else {
idx = m_Names.size();
m_Names.push_back(name);
m_Types.push_back(type);
}
return idx;
} | false | false | false | false | false | 0 |
gst_live_adder_src_event (GstPad * pad, GstObject * parent, GstEvent * event)
{
GstLiveAdder *adder = GST_LIVE_ADDER (parent);
gboolean result;
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_QOS:
/* TODO : QoS might be tricky */
result = FALSE;
break;
case GST_EVENT_NAVIGATION:
... | false | false | false | false | false | 0 |
_fill_hostent (const char *name, int af, struct hostent *result)
{
result->h_name = malloc((strlen(name) + 1) * sizeof(char));
strcpy(result->h_name, name);
result->h_aliases = malloc(sizeof(char *));
*result->h_aliases = NULL;
switch (af)
{
case AF_INET:
result->h_addr... | false | false | false | false | false | 0 |
HPCC_ra_Heapify(int node)
{
/* assumes that the key of a given node can only be increased */
int parent;
int child;
int done;
Heap_Record_Ptr tmp;
done = 0;
child = node;
while (!done && child > 0) {
parent = PARENT(child);
if (parent >= 0 && heap[parent]->key < heap[child]->key) {
tmp =... | false | false | false | false | false | 0 |
Realloc(void *ptr, int size)
{
struct MemInfo *point;
void *new;
/* `point' points to the MemInfo structure: */
point=(struct MemInfo *)((char *)ptr-sizeof(struct MemInfo));
if(size<=point->size)
/*
* To increase performance, don't care about reallocing
* to smaller sizes!
*/
return(p... | false | false | false | false | false | 0 |
endTurn()
{
next_turn( actmap, NextTurnStrategy_OnlyCampaign(), &getDefaultMapDisplay() );
} | false | false | false | false | false | 0 |
mpegts_write_end(AVFormatContext *s)
{
MpegTSWrite *ts = s->priv_data;
MpegTSWriteStream *ts_st;
MpegTSService *service;
AVStream *st;
int i;
/* flush current packets */
for(i = 0; i < s->nb_streams; i++) {
st = s->streams[i];
ts_st = st->priv_data;
if (ts_st->payloa... | false | false | false | false | false | 0 |
raise()
{
if (!isTopLevel()) { gControl::raise(); return; }
gtk_window_present(GTK_WINDOW(border));
} | false | false | false | false | false | 0 |
qca_enqueue(struct hci_uart *hu, struct sk_buff *skb)
{
unsigned long flags = 0, idle_delay;
struct qca_data *qca = hu->priv;
BT_DBG("hu %p qca enq skb %p tx_ibs_state %d", hu, skb,
qca->tx_ibs_state);
/* Prepend skb with frame type */
memcpy(skb_push(skb, 1), &bt_cb(skb)->pkt_type, 1);
/* Don't go to ... | false | true | false | false | false | 1 |
gth_organize_task_set_singletons_catalog (GthOrganizeTask *self,
const char *catalog_name)
{
GFile *file;
_g_object_unref (self->priv->singletons_catalog);
self->priv->singletons_catalog = NULL;
if (catalog_name == NULL)
return;
self->priv->singletons_catalog = gth_catalog_new ();
file = _g_file_n... | false | false | false | false | false | 0 |
do_toplevel_using_decl (tree decl, tree scope, tree name)
{
tree oldval, oldtype, newval, newtype;
cxx_binding *binding;
decl = validate_nonmember_using_decl (decl, scope, name);
if (decl == NULL_TREE)
return;
binding = binding_for_name (NAMESPACE_LEVEL (current_namespace), name);
oldval = binding-... | false | false | false | false | false | 0 |
rememberInstruction(Value *I) {
if (!PostIncLoops.empty())
InsertedPostIncValues.insert(I);
else
InsertedValues.insert(I);
} | false | false | false | false | false | 0 |
dodiscovered() /* free after Robert Viduya */
{
register int i, dis;
int ct = 0;
char *s, oclass, prev_class, classes[MAXOCLASSES];
winid tmpwin;
char buf[BUFSZ];
tmpwin = create_nhwindow(NHW_MENU);
putstr(tmpwin, 0, "Discoveries");
putstr(tmpwin, 0, "");
/* gather "unique objects"... | false | false | false | false | false | 0 |
eaxreverb_SetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals)
{
switch(param)
{
case AL_EAXREVERB_REFLECTIONS_PAN:
if(isfinite(vals[0]) && isfinite(vals[1]) && isfinite(vals[2]))
{
LockContext(context);
effect->Reve... | false | false | false | false | false | 0 |
_GTIFGetField (tiff_t *tif, pinfo_t tag, int *count, void *val )
{
int item_size, data_type;
void *internal_value, *ret_value;
if( !ST_GetKey( (ST_TIFF*) tif, (int) tag, count, &data_type,
&internal_value ) )
return 0;
if( data_type != ST_TagType( tag ) )
return 0;... | false | false | false | false | false | 0 |
slotEditRedo()
{
slotStatusNormalMsg(QString(tr("Redoing action...")));
DigitDoc* doc = activeDocument();
if (doc)
doc->redo();
toggleActions();
slotStatusNormalMsg(QString(tr("Ready.")));
} | false | false | false | false | false | 0 |
tracker_thumbnailer_init (void)
{
TrackerThumbnailerPrivate *private;
GError *error = NULL;
GVariant *v;
private = g_new0 (TrackerThumbnailerPrivate, 1);
/* Don't start at 0, start at 1. */
private->request_id = 1;
#if GLIB_CHECK_VERSION (2,31,0)
g_private_replace (&private_key, private);
#else
g_static_priv... | false | false | false | false | false | 0 |
send_status_direct (ctrl_t ctrl, const char *keyword, const char *args)
{
char buf[950];
if (strchr (args, '\n'))
log_error ("error: LF detected in status line - not sending\n");
else
{
snprintf (buf, sizeof buf, "%s%s%s",
keyword, args? " ":"", args? args:"");
if (ctrl && ctr... | false | false | false | false | false | 0 |
cl_com_ssl_log_ssl_errors(const char* function_name) {
const char* func_name = "n.a.";
unsigned long ssl_error;
unsigned long ret_val;
char* transformed_ssl_error = NULL;
char buffer[512];
char help_buf[1024];
cl_bool_t had_errors = CL_FALSE;
if (function_name != NULL) {
func_name = funct... | false | false | false | false | false | 0 |
free_tok(next_token)
Tok_node next_token;
{
if (next_token == NULL) return;
switch (tok_type(next_token)) {
case LITERAL:
free_re(tok_val(next_token));
case EOS:
case RPAREN:
case LPAREN:
case OPSTAR:
case OPALT:
case OPOPT:
default:
free(next_token);
break;
}
} | false | false | false | false | false | 0 |
cqueue_add_qinstances(sge_gdi_ctx_class_t *ctx, lListElem *cqueue, lList **answer_list, lList *add_hosts, monitoring_t *monitor)
{
bool ret = true;
DENTER(TOP_LAYER, "cqueue_add_qinstances");
if (cqueue != NULL && add_hosts != NULL) {
lListElem *href = NULL;
for_each(href, add_hosts) {
c... | false | false | false | false | false | 0 |
SetCostFunctionAdaptor(CostFunctionAdaptorType *adaptor)
{
if ( this->m_CostFunctionAdaptor == adaptor )
{
return;
}
if ( this->m_CostFunctionAdaptor )
{
delete this->m_CostFunctionAdaptor;
}
this->m_CostFunctionAdaptor = adaptor;
this->m_CostFunctionAdaptor->AddObserver(IterationEven... | false | false | false | false | false | 0 |
ParseSkeletonElement(const char* szCurrent,
const char** szCurrentOut,int iTime)
{
aiVector3D vPos;
aiVector3D vRot;
unsigned int iBone = 0;
if(!ParseUnsignedInt(szCurrent,&szCurrent,iBone))
{
DefaultLogger::get()->error("Unexpected EOF/EOL while parsing bone index");
SMDI_PARSE_RETURN;
}
if (iBone >= asB... | false | false | false | false | false | 0 |
print_to(const format& fmt,
const std::string& len) const
{
if (is_empty())
return "";
// else
return fmt.print_line(m_border, pair(0,0), m_line, m_base, m_style, len);
} | false | false | false | false | false | 0 |
saveConfig() {
appsettings->setValue(GC_DPFS_MAX, max->value());
appsettings->setValue(GC_DPFS_VARIANCE, variance->value());
} | false | false | false | false | false | 0 |
gst_interlace_change_state (GstElement * element, GstStateChange transition)
{
//GstInterlace *interlace = GST_INTERLACE (element);
switch (transition) {
case GST_STATE_CHANGE_PAUSED_TO_READY:
//gst_interlace_reset (interlace);
break;
default:
break;
}
return GST_ELEMENT_CLASS (paren... | false | false | false | false | false | 0 |
signal_dict_transfer_complete_cb(bool st, const std::string& str, std::string word) {
if (!st) {
katoob_error(str);
return;
}
std::vector<std::string> defs;
if (!Dict::parse_defs(str, defs)) {
if (defs.size() == 0) {
katoob_error(_("Failed to get any definitions."));
}
else if (defs[... | false | false | false | false | false | 0 |
initialize()
{
if (m_nmeaReader)
return true;
if (!openSourceDevice())
return false;
if (m_updateMode == QNmeaPositionInfoSource::RealTimeMode)
m_nmeaReader = new QNmeaRealTimeReader(this);
else
m_nmeaReader = new QNmeaSimulatedReader(this);
return true;
} | false | false | false | false | false | 0 |
propagate_pseudo_copies (void)
{
bitmap queue, propagate;
queue = BITMAP_ALLOC (NULL);
propagate = BITMAP_ALLOC (NULL);
bitmap_copy (queue, decomposable_context);
do
{
bitmap_iterator iter;
unsigned int i;
bitmap_clear (propagate);
EXECUTE_IF_SET_IN_BITMAP (queue, 0, i, iter)
... | false | false | false | false | false | 0 |
input_cfg (struct lto_input_block *ib, struct function *fn,
int count_materialization_scale)
{
unsigned int bb_count;
basic_block p_bb;
unsigned int i;
int index;
init_empty_tree_cfg_for_function (fn);
init_ssa_operands (fn);
profile_status_for_function (fn) = streamer_read_enum (ib, profile_status_... | false | false | false | false | false | 0 |
wm8985_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai)
{
int i;
struct snd_soc_codec *codec;
struct wm8985_priv *wm8985;
u16 blen, srate_idx;
unsigned int tmp;
int srate_best;
codec = dai->codec;
wm8985 = snd_soc_codec_get_drvdata(codec);
... | false | false | false | false | false | 0 |
davPropFind( const KUrl& url, const QDomDocument& properties, const QString &depth, JobFlags flags )
{
DavJob *job = DavJobPrivate::newJob(url, (int) KIO::DAV_PROPFIND, properties.toString(), flags);
job->addMetaData( "davDepth", depth );
return job;
} | false | false | false | false | false | 0 |
ecpg_strndup(const char *str, size_t len)
{
size_t real_len = strlen(str);
int use_len = (int) ((real_len > len) ? len : real_len);
char *new = malloc(use_len + 1);
if (new)
{
memcpy(new, str, use_len);
new[use_len] = '\0';
}
else
errno = ENOMEM;
return new;
} | false | false | false | false | false | 0 |
ck_shrink(ckhunk_t *ck, size_t size)
{
size_t nsize, used;
sigset_t set;
ckhunk_check(ck);
if (NULL == ck)
return FALSE;
size = MAX(1, size); /* round_pagesize(0) returns 0 */
nsize = round_pagesize(size); /* VMM rounds up to the next page size */
if (ck->size <= nsize)
return FALSE;
used = round_pages... | false | false | false | false | false | 0 |
__pyx_pf_9xmmsvalue_16CollectionIDList_1__len__(PyObject *__pyx_v_self) {
Py_ssize_t __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__len__");
/* "xmmsvalue.pyx":610
*
* def __len__(self):
* return xmmsv_coll_idlist_get_size(self.coll) # <<<<<<<<<<<<<<
*
* cpdef list(sel... | false | false | false | false | false | 0 |
histogram_view_set_imager(HistogramView *self, HistogramImager *imager) {
if (self->imager) {
/* Remove the old imager */
g_signal_handlers_disconnect_by_func(self->imager, G_CALLBACK(on_resize_notify), self);
g_object_unref(self->imager);
}
self->imager = g_object_ref(imager);
/* Do the first resi... | false | false | false | false | false | 0 |
sge_unparse_queue_list_dstring(dstring *category_str, lListElem *job_elem,
int nm, const char *option)
{
bool first = true;
lList *print_list = NULL;
const lListElem *sub_elem = NULL;
DENTER(TOP_LAYER, "sge_unparse_queue_list_dstring");
if ((print_list = lGe... | false | false | false | false | false | 0 |
endsWith(const String& s)
{
if (s.length() > this->length()) {
return false;
}
if (!strncmp((this->c_str() + this->length() - s.length()), s.c_str(), s.length())) {
return true;
}
return false;
} | false | false | false | false | false | 0 |
eog_image_get_supported_mime_types (void)
{
GSList *format_list, *it;
gchar **mime_types;
int i;
if (!supported_mime_types) {
format_list = gdk_pixbuf_get_formats ();
for (it = format_list; it != NULL; it = it->next) {
mime_types =
gdk_pixbuf_format_get_mime_types ((GdkPixbufFormat *) it->data);
fo... | false | false | false | false | false | 0 |
jpc_ppm_getparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *in)
{
jpc_ppm_t *ppm = &ms->parms.ppm;
/* Eliminate compiler warning about unused variables. */
cstate = 0;
ppm->data = 0;
if (ms->len < 1) {
goto error;
}
if (jpc_getuint8(in, &ppm->ind)) {
goto error;
}
ppm->len = ms->len - 1;
if (pp... | false | false | false | false | false | 0 |
end_undup_stream(struct undup *und)
{
int r;
struct timeval endtime;
double t;
debug("end undup len %lld\n", (long long)und->logoff);
und_flush(und);
und_trailer(und);
r = close(und->fd);
if (r != 0)
die("close: %s\n", strerror(errno));
gettimeofday(&endtime, 0);
t = e... | false | false | false | false | false | 0 |
nsc_ircc_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
{
struct if_irda_req *irq = (struct if_irda_req *) rq;
struct nsc_ircc_cb *self;
unsigned long flags;
int ret = 0;
IRDA_ASSERT(dev != NULL, return -1;);
self = netdev_priv(dev);
IRDA_ASSERT(self != NULL, return -1;);
pr_debug("%s(), %s, (... | false | false | false | false | false | 0 |
do_cmd_wizard(void)
{
/* Verify first time */
if (!(p_ptr->noscore & NOSCORE_WIZARD))
{
/* Mention effects */
msg("You are about to enter 'wizard' mode for the very first time!");
msg("This is a form of cheating, and your game will not be scored!");
message_flush();
/* Verify request */
if (!get_check("... | false | false | false | false | false | 0 |
stpi_unpack_2_2(int length,
const unsigned char *in,
unsigned char **outs)
{
if (length <= 0)
return;
for (;length;length --)
{
unsigned char ti0, ti1;
ti0 = in[0];
ti1 = in[1];
*outs[0]++ = (ti0 & 0xc0) << 0
| (ti0 & 0x0c) << 2
| (ti1 & 0xc0) >> 4
| (ti1 & 0x0c) >> 2;
... | false | false | false | false | false | 0 |
gap_base_strdup_del_underscore(char *name)
{
int l_len;
char *l_str;
if(name == NULL)
{
return(g_strdup("\0"));
}
l_len = strlen(name);
l_str = g_strdup(name);
if(l_len > 0)
{
if (l_str[l_len-1] == '_')
{
l_str[l_len -1 ] = '\0';
}
}
return(l_str);
} | false | false | false | false | false | 0 |
ui_dorender_params(void)
{
if (defrender != NULL) {
int imagetype = TRUECOLOR24;
int width = 640, height = 480;
#ifdef DESTICKY
seteuid(getuid()); /* Don't need supervisor rights anymore. */
setegid(getgid());
#endif
#ifndef STRUECOLOR24
if (imagetype == TRUECOLOR24)
imagetype = TRUECOLOR;
#endif
if (img... | false | false | false | false | false | 0 |
makeSierpinski(int depth, edgefn ef)
{
vtx_data* graph;
int* edges;
int n;
int nedges;
int i, j;
depth--;
n = 3 * (1 + ((int) (pow(3.0, (double) depth) + 0.5) - 1) / 2);
nedges = (int) (pow(3.0, depth + 1.0) + 0.5);
graph = N_NEW(n + 1, vtx_data);
edges = N_NEW(4 * n, int);
... | false | false | false | false | false | 0 |
defaults_display (ipmi_locate_ctx_t ctx)
{
struct ipmi_locate_info info;
assert (ctx);
printf ("KCS device default values: ");
if (!ipmi_locate_defaults_get_device_info (ctx,
IPMI_INTERFACE_KCS,
&info))
{
print... | false | false | false | false | false | 0 |
SelectVOP3Mods(SDValue In, SDValue &Src,
SDValue &SrcMods) const {
unsigned Mods = 0;
Src = In;
if (Src.getOpcode() == ISD::FNEG) {
Mods |= SISrcMods::NEG;
Src = Src.getOperand(0);
}
if (Src.getOpcode() == ISD::FABS) {
Mods |= SISrcMods::ABS;
Src = S... | false | false | false | false | false | 0 |
drop_finished_cb (TotemPlaylist *playlist, GAsyncResult *result, gpointer user_data)
{
totem_playlist_add_mrls_finish (playlist, result, NULL);
g_clear_pointer (&playlist->priv->tree_path, gtk_tree_path_free);
/* Emit the "changed" signal once the last dropped MRL has been added to the playlist */
g_signal_emit (... | false | false | false | false | false | 0 |
aes_icm_alloc_ismacryp(cipher_t **c, int key_len, int forIsmacryp) {
extern cipher_type_t aes_icm;
uint8_t *pointer;
int tmp;
debug_print(mod_aes_icm,
"allocating cipher with key length %d", key_len);
/*
* Ismacryp, for example, uses 16 byte key + 8 byte
* salt so this function is calle... | false | false | false | false | false | 0 |
dump(byte* data, int len)
{
int i=0;
while(i<len)
{
printf("%02X ", data[i++]);
if(i%8==0) printf(" ");
if(i%16==0) printf("\n");
}
if(i%16) printf("\n");
} | false | false | false | false | false | 0 |
SHReduceRinging(Spectrum *c, int lmax, float lambda) {
for (int l = 0; l <= lmax; ++l) {
float scale = 1.f / (1.f + lambda * l * l * (l + 1) * (l + 1));
for (int m = -l; m <= l; ++m)
c[SHIndex(l, m)] *= scale;
}
} | false | false | false | false | false | 0 |
SetViewPort( const Rect &viewport ) {
if ( magnify > 0 ) {
vp.x = viewport.x * magnify;
vp.y = viewport.y * magnify;
vp.w = viewport.w * magnify;
vp.h = viewport.h * magnify + magnify/2;
mp.x = mp.y = 0;
mp.w = MIN( w - 2, mapsize.x * magnify );
mp.h = MIN( h - 2, mapsize.y * magnify + ma... | false | false | false | false | false | 0 |
update_reschedule_unknown_timeout(lListElem *host)
{
DENTER(TOP_LAYER, "update_reschedule_unknown_timeout");
if (host != NULL) {
lListElem *conf_entry = NULL; /* CF_Type */
const char *hostname = lGetHost(host, EH_name);
u_long32 timeout = lGetUlong(host, EH_reschedule_unknown);
... | false | false | false | false | false | 0 |
Sync(void) {
uint32 i;
for (i = 0; i < 8; i++)
setchr1(i << 10, chrlo[i] | (chrhi[i] << 8));
setprg8r(0x10, 0x6000, 0);
setprg16(0x8000, prg);
setprg16(0xC000, ~0);
if (mirrisused)
setmirror(mirr ^ 1);
else
setmirror(MI_0);
} | false | false | false | false | false | 0 |
llc_test_driver (const char *parm, const int *list,
DATASET *dset, gretlopt opt, PRN *prn)
{
gretl_matrix *m = NULL;
int *plist = NULL;
int p0 = -1;
int err = 0;
if (*parm == '{') {
m = generate_matrix(parm, dset, &err);
if (!err) {
plist = gretl_list_from_vector(m, &err);
}
gretl_... | false | false | false | false | true | 1 |
broken_fill_client_types (
GObject *object,
const GArray *contacts,
GHashTable *attributes)
{
guint i;
for (i = 0; i < contacts->len; i++)
{
TpHandle handle = g_array_index (contacts, guint, i);
/* Muahaha. Actually we add SimplePresence information. */
GValueArray *presence = tp_... | false | false | false | false | false | 0 |
inc_month(timelib_sll *y, timelib_sll *m)
{
(*m)++;
if (*m > 12) {
*m -= 12;
(*y)++;
}
} | false | false | false | false | false | 0 |
fat_time_fat2unix (uae_u16 time, uae_u16 date, int fat12)
{
time_t second, day, leap_day, month, year;
if (0 && fat12) {
year = date & 0x7f;
month = (date >> 7) & 0x0f;
day = (date >> 11);
} else {
year = date >> 9;
month = max(1, (date >> 5) & 0xf);
day = max(1, date & 0x1f) - 1;
}
leap_day = (... | false | false | false | false | false | 0 |
esatmat_isort_rows(satmat_row_t* tab, satmat_t* sat)
{
size_t i,j;
for (i=1; i<sat->nbrows; i++){
satmat_row_t row = tab[i];
j = i;
while (j > 0 && bitstring_cmp(tab[j-1].p, row.p, sat->nbcolumns) > 0){
tab[j] = tab[j-1];
j--;
}
tab[j] = row;
}
} | false | false | false | false | false | 0 |
elemalloc(void)
{
LISTELEM *ep;
ep = (LISTELEM *) malloc(sizeof(LISTELEM));
if (ep == NULL) {
math_error("Cannot allocate list element");
/*NOTREACHED*/
}
ep->e_next = NULL;
ep->e_prev = NULL;
ep->e_value.v_type = V_NULL;
ep->e_value.v_subtype = V_NOSUBTYPE;
return ep;
} | false | false | false | true | false | 1 |
gost_setkey (void *c, const byte *key, unsigned keylen)
{
int i;
GOST28147_context *ctx = c;
if (keylen != 256 / 8)
return GPG_ERR_INV_KEYLEN;
for (i = 0; i < 8; i++)
{
ctx->key[i] = (key[4 * i + 3] << 24) |
(key[4 * i + 2] << 16) |
(key[4 * i + 1] << 8) ... | false | false | false | false | false | 0 |
wchar2char(char *to, const wchar_t *from, size_t tolen)
{
size_t result;
if (tolen == 0)
return 0;
#ifdef WIN32
/*
* On Windows, the "Unicode" locales assume UTF16 not UTF8 encoding, and
* for some reason mbstowcs and wcstombs won't do this for us, so we use
* MultiByteToWideChar().
*/
if (GetDatabase... | false | false | false | false | false | 0 |
bfa_fcs_lport_ns_process_gidft_pids(struct bfa_fcs_lport_s *port, u32 *pid_buf,
u32 n_pids)
{
struct fcgs_gidft_resp_s *gidft_entry;
struct bfa_fcs_rport_s *rport;
u32 ii;
struct bfa_fcs_fabric_s *fabric = port->fabric;
struct bfa_fcs_vport_s *vport;
struct list_head *qe;
u8 found = 0;
for (ii = ... | false | false | false | false | false | 0 |
LC34(base0)
register object *base0;
{ register object *base=vs_base;
register object *sup=base+VM41; VC41
vs_reserve(VM41);
ihs_check;
{object V156;
check_arg(1);
V156=(base[0]);
vs_top=sup;
(base0[1]->c.c_car)= (V156);
{frame_ptr fr;
fr=frs_sch((base0[0]->c.c_car));
if(fr==NULL)FEerror("The GO tag ~s is mis... | false | false | false | false | false | 0 |
pcnet32_irq_disable ( struct pcnet32_private *priv )
{
unsigned long ioaddr = priv->pci_dev->ioaddr;
DBGP ( "pcnet32_irq_disable\n" );
priv->a->write_csr ( ioaddr, 0, 0x0000 );
priv->irq_enabled = 0;
} | false | false | false | false | false | 0 |
xfs_dir2_block_compact(
struct xfs_da_args *args,
struct xfs_buf *bp,
struct xfs_dir2_data_hdr *hdr,
struct xfs_dir2_block_tail *btp,
struct xfs_dir2_leaf_entry *blp,
int *needlog,
int *lfloghigh,
int *lfloglow)
{
int fromidx; /* source leaf index */
int toidx; /* target leaf index */
int ... | false | false | false | false | false | 0 |
gst_property_probe_get_values_name (GstPropertyProbe * probe,
const gchar * name)
{
const GParamSpec *pspec;
g_return_val_if_fail (probe != NULL, NULL);
g_return_val_if_fail (GST_IS_PROPERTY_PROBE (probe), NULL);
g_return_val_if_fail (name != NULL, NULL);
pspec = g_object_class_find_property (G_OBJECT_G... | false | false | false | false | false | 0 |
getTavernLord( GenericBase * base, uint /* numLord */ )
{
GenericLord * ret = 0;
GenericLord * tempLord;
uint nbBase, nbLord, num, cpt;
nbBase = _data->getBaseNumber();
nbLord = _data->getLordNumber();
num = nbBase;
for( uint i = 0; i < nbBase; i++ ) {
if( base == _data->getBase( i ) ) {
num = i;
b... | false | false | false | false | false | 0 |
_basic_auto_lock_cb_changed(void *data, Evas_Object *o __UNUSED__)
{
E_Config_Dialog_Data *cfdata;
int disable;
if (!(cfdata = data)) return;
disable = ((!cfdata->use_xscreensaver) || (!cfdata->auto_lock));
e_widget_disabled_set(cfdata->gui.auto_lock_slider, disable);
} | false | false | false | false | false | 0 |
cfq_rq_enqueued(struct cfq_data *cfqd, struct cfq_queue *cfqq,
struct request *rq)
{
struct cfq_io_cq *cic = RQ_CIC(rq);
cfqd->rq_queued++;
if (rq->cmd_flags & REQ_PRIO)
cfqq->prio_pending++;
cfq_update_io_thinktime(cfqd, cfqq, cic);
cfq_update_io_seektime(cfqd, cfqq, rq);
cfq_update_idle_window(cfqd, cfqq,... | false | false | false | false | false | 0 |
fileName() const
{
Q_D(const QLandmarkImportRequest);
QMutexLocker ml(&d->mutex);
QFile *file = qobject_cast<QFile *>(d->device);
return file ? file->fileName() : QString();
} | false | false | false | false | false | 0 |
gdata_download_stream_new (GDataService *service, GDataAuthorizationDomain *domain, const gchar *download_uri, GCancellable *cancellable)
{
g_return_val_if_fail (GDATA_IS_SERVICE (service), NULL);
g_return_val_if_fail (domain == NULL || GDATA_IS_AUTHORIZATION_DOMAIN (domain), NULL);
g_return_val_if_fail (download_ur... | false | false | false | false | false | 0 |
PT_GetType(const char *filename) {
char *dot = strrchr(filename, '.');
if (dot != NULL) {
if (strcasecmp(dot, ".zip") == 0) {
return PT_CACHE__NEW;
} else if (strcasecmp(dot, ".ndx") == 0 || strcasecmp(dot, ".dat") == 0) {
return PT_CACHE__OLD;
} else if (strcasecmp(dot, ".arc") == 0) {
... | 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.