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 |
|---|---|---|---|---|---|---|
on_clear_data (GtkClipboard *clipboard, Object *obj)
{
if (ClipboardData) {
xmlFree (ClipboardData);
ClipboardData = NULL;
}
g_free (ClipboardTextData);
ClipboardTextData = NULL;
Application *app = dynamic_cast <Application *> (obj);
if (!app) {
// the object might be a tool
Tool *tool = dynamic_cast <Too... | false | false | false | false | false | 0 |
set(string mapKey, string mapValue) {
//char ** result, * errorMsg;
sqlite3_stmt *stmt;
string sql;
if (dns2IpPortMap.find(mapKey) != dns2IpPortMap.end()) {
dns2IpPortMap.erase(mapKey);
dns2IpPortMap[mapKey] = mapValue;
sql = "Update KeyValuePair set value_element " + mapValue + " where key_ele... | false | false | false | false | false | 0 |
swf_def_edit_text(SWFReader *read)
{
GF_Err e;
SWFEditText txt;
char *var_name;
Bool has_text, has_text_color, has_max_length, has_font;
memset(&txt, 0, sizeof(SWFEditText));
txt.color = 0xFF000000;
txt.ID = swf_get_16(read);
swf_get_rec(read, &txt.bounds);
swf_align(read);
has_text = swf_read_int(read, 1)... | false | true | false | false | true | 1 |
qof_log_shutdown (void)
{
if (fout && fout != stderr && fout != stdout)
{
fclose(fout);
fout = NULL;
}
if (function_buffer)
{
g_free(function_buffer);
function_buffer = NULL;
}
if (log_table != NULL)
{
g_hash_table_destroy(log_table);
log... | false | false | false | false | false | 0 |
___device_select_add_relative_timeout
___P((___device_select_state *state,
int i,
___F64 seconds),
(state,
i,
seconds)
___device_select_state *state;
int i;
___F64 seconds;)
{
if (seconds < state->relative_timeout)
state->relative_timeout = seconds;
} | false | false | false | false | false | 0 |
retstat (LexState *ls) {
/* stat -> RETURN explist */
FuncState *fs = ls->fs;
next(ls); /* skip RETURN */
if (!block_follow(ls->t.token) && ls->t.token != ';')
explist1(ls); /* optional return values */
luaK_code1(fs, OP_RETURN, ls->fs->nactloc);
fs->stacklevel = fs->nactloc; /* removes all temp valu... | false | false | false | false | false | 0 |
PR_extract(CORBA::TypeCode_ptr tc,
pr_unmarshal_fn unmarshal,
pr_marshal_fn marshal,
pr_destructor_fn destructor,
void*& data) const
{
if (!tc->equivalent(get(pd_tc)))
return 0;
if (pd_data) {
data = pd_data;
return 1;
}
else if (pd_mbuf) {
{... | false | false | false | false | false | 0 |
attach_engine(
string engine_name,
string category,
TreeHandler* config,
bool override)
{
//cout << "!! attach engine " << engine_name << " to " << category << endl; // debugging, heh ;-)
Engine *engine = engines;
while(engine != NULL)
{
if(engine->name == engine_name)
{
co... | false | false | false | false | false | 0 |
complex_class (enum mode_class c)
{
switch (c)
{
case MODE_INT: return MODE_COMPLEX_INT;
case MODE_FLOAT: return MODE_COMPLEX_FLOAT;
default:
error ("no complex class for class %s", mode_class_names[c]);
return MODE_RANDOM;
}
} | false | false | false | false | false | 0 |
lzo_set_method(header_t *h)
{
int level = 1;
if (option_mask32 & OPT_1) {
h->method = M_LZO1X_1_15;
} else if (option_mask32 & OPT_789) {
#if ENABLE_LZOP_COMPR_HIGH
h->method = M_LZO1X_999;
if (option_mask32 & OPT_7)
level = 7;
else if (option_mask32 & OPT_8)
level = 8;
else
level = 9;
#else
bb... | false | false | false | false | false | 0 |
handle_boundary(void)
{
struct strbuf newline = STRBUF_INIT;
strbuf_addch(&newline, '\n');
again:
if (line.len >= (*content_top)->len + 2 &&
!memcmp(line.buf + (*content_top)->len, "--", 2)) {
/* we hit an end boundary */
/* pop the current boundary off the stack */
strbuf_release(*content_top);
free(*... | false | false | false | false | false | 0 |
on_collection_added (GcrCollection *collection,
GObject *object,
gpointer user_data)
{
GcrUnionCollection *self = GCR_UNION_COLLECTION (user_data);
gint *count;
g_object_ref (object);
count = g_hash_table_lookup (self->pv->items, object);
if (count == NULL) {
count = g... | false | false | false | false | false | 0 |
close1(nfa_node *node, int o, set *b)
#else
void close1(node,o,b)
nfa_node *node;
int o; /* marker to avoid cycles */
set *b;
#endif
{
register nfa_node *n; /* current node being examined */
/* mark it done */
node->nfa_set = o;
if ((n=node->trans[0]) != NIL_INDEX && set_nil(node->label) &&
(n->nfa_set != o)){
... | false | false | false | false | false | 0 |
substringCompletion( const QString& string ) const
{
// get all items in the tree, eventually in sorted order
KCompletionMatchesWrapper allItems( d->myOrder );
extractStringsFromNode( d->myTreeRoot, QString(), &allItems, false );
QStringList list = allItems.list();
// subStringMatches is invoked m... | false | false | false | false | false | 0 |
example_contact_list_unpublish_async (TpBaseContactList *contact_list,
TpHandleSet *contacts,
GAsyncReadyCallback callback,
gpointer user_data)
{
ExampleContactList *self = EXAMPLE_CONTACT_LIST (contact_list);
TpHandleSet *changed = tp_handle_set_new (self->priv->contact_repo);
TpHandleSet *removed = ... | false | false | false | false | false | 0 |
can_remove_node_now_p (struct cgraph_node *node, struct cgraph_edge *e)
{
struct cgraph_node *next;
if (!can_remove_node_now_p_1 (node))
return false;
/* When we see same comdat group, we need to be sure that all
items can be removed. */
if (!node->same_comdat_group)
return true;
for (next = no... | false | false | false | false | false | 0 |
hauppauge_eeprom(struct cx23885_dev *dev, u8 *eeprom_data)
{
struct tveeprom tv;
tveeprom_hauppauge_analog(&dev->i2c_bus[0].i2c_client, &tv,
eeprom_data);
/* Make sure we support the board model */
switch (tv.model) {
case 22001:
/* WinTV-HVR1270 (PCIe, Retail, half height)
* ATSC/QAM and basic analog, IR... | false | false | false | false | false | 0 |
gda_sql_expr_take_select (GdaSqlExpr *expr, GdaSqlStatement *stmt)
{
if (stmt) {
GdaSqlAnyPart *part;
part = GDA_SQL_ANY_PART (stmt->contents);
stmt->contents = NULL;
gda_sql_statement_free (stmt);
expr->select = _gda_sql_statement_compound_reduce (part);
gda_sql_any_part_set_parent (expr->select, expr);
... | false | false | false | false | false | 0 |
pcm512x_resume(struct device *dev)
{
struct pcm512x_priv *pcm512x = dev_get_drvdata(dev);
int ret;
if (!IS_ERR(pcm512x->sclk)) {
ret = clk_prepare_enable(pcm512x->sclk);
if (ret != 0) {
dev_err(dev, "Failed to enable SCLK: %d\n", ret);
return ret;
}
}
ret = regulator_bulk_enable(ARRAY_SIZE(pcm512x->s... | false | false | false | false | false | 0 |
show_this_item(struct vcd_info*info)
{
s_vpi_value value;
PLI_INT32 type = vpi_get(vpiType, info->item);
if (type == vpiRealVar) {
value.format = vpiRealVal;
vpi_get_value(info->item, &value);
fstWriterEmitValueChange(dump_file, info->handle, &value.value.real);
} else {
val... | false | false | false | false | false | 0 |
gui_list_stack_add (guint16 addr, const char *sym_name, guint16 val)
{
GtkTreeIter iter;
gchar str[] = "XXXXh";
gchar add_str[5] = "XXXX";
guint8 s1, s2;
g_assert (store);
g_assert (sym_name);
gtk_tree_store_append (store, &iter,
(child_position) ? &mark_iter : NULL);
/* address */
eef_split1... | false | false | false | false | false | 0 |
CreateIterator() {
ASSERT(iterator_ == NULL);
switch (current_space_) {
case NEW_SPACE:
iterator_ = new SemiSpaceIterator(Heap::new_space(), size_func_);
break;
case OLD_POINTER_SPACE:
iterator_ = new HeapObjectIterator(Heap::old_pointer_space(), size_func_);
break;
case OLD_DAT... | false | false | false | false | false | 0 |
ResolveNew_mutator(Node *node, ResolveNew_context *context)
{
if (node == NULL)
return NULL;
if (IsA(node, Var))
{
Var *var = (Var *) node;
int this_varno = (int) var->varno;
int this_varlevelsup = (int) var->varlevelsup;
if (this_varno == context->target_varno &&
this_varlevelsup == context->s... | false | false | false | false | false | 0 |
sug_mode(SpellerImpl * m, const char * mode) {
RET_ON_ERR(m->suggest_->set_mode(mode));
RET_ON_ERR(m->intr_suggest_->set_mode(mode));
return no_err;
} | false | false | false | false | false | 0 |
putvalue(U32B val, int len) {
unsigned char buf[4];
int i;
for (i=0;i<len;++i,val>>=8) buf[i]=(unsigned char) val&0xff;
if (write(arcfile,&buf,len)!=len) error(1,ERR_WRITE,arcname);
} | false | false | false | false | false | 0 |
clear_page_presence(struct kmmio_fault_page *f, bool clear)
{
unsigned int level;
pte_t *pte = lookup_address(f->addr, &level);
if (!pte) {
pr_err("no pte for addr 0x%08lx\n", f->addr);
return -1;
}
switch (level) {
case PG_LEVEL_2M:
clear_pmd_presence((pmd_t *)pte, clear, &f->old_presence);
break;
cas... | false | false | false | false | false | 0 |
start()
{
if (!m_prepared) {
init();
m_prepared = true;
}
checkStopped();
m_ctx = mg_start(LocalMongooseEventHandler, (void *) this, prepareOptions());
m_statusRunning = (m_ctx != NULL);
} | false | false | false | false | false | 0 |
GetMyBoundAddress(const int socketIndex)
{
DataStructures::List<RakNetSocket2* > sockets;
GetSockets( sockets );
if (sockets.Size()>0)
return sockets[socketIndex]->GetBoundAddress();
else
return UNASSIGNED_SYSTEM_ADDRESS;
} | false | false | false | false | false | 0 |
test_odb_streamwrite__initialize(void)
{
repo = cl_git_sandbox_init("testrepo.git");
cl_git_pass(git_repository_odb(&odb, repo));
cl_git_pass(git_odb_open_wstream(&stream, odb, 14, GIT_OBJ_BLOB));
cl_assert_equal_sz(14, stream->declared_size);
} | false | false | false | false | false | 0 |
_e_configure_category_cb(void *data, void *data2 __UNUSED__)
{
E_Configure_Category *cat;
E_Configure *eco;
Eina_List *l;
Evas_Coord w, h;
if (!(cat = data)) return;
eco = cat->eco;
evas_event_freeze(evas_object_evas_get(eco->item_list));
edje_freeze();
e_widget_ilist_freeze(eco->item_list)... | false | false | false | false | false | 0 |
qos_set_session(request_rec *r, qos_srv_config *sconf) {
qos_session_t *s = (qos_session_t *)apr_pcalloc(r->pool, sizeof(qos_session_t));
char *cookie;
char *session;
/* payload */
strcpy(s->magic, qs_magic);
s->magic[QOS_MAGIC_LEN-1] = '\0';
s->time = time(NULL);
RAND_bytes(s->ran, sizeof(s->ran));
s... | false | true | false | false | false | 1 |
__mmu_notifier_invalidate_range_end(struct mm_struct *mm,
unsigned long start, unsigned long end)
{
struct mmu_notifier *mn;
int id;
id = srcu_read_lock(&srcu);
hlist_for_each_entry_rcu(mn, &mm->mmu_notifier_mm->list, hlist) {
/*
* Call invalidate_range here too to avoid the need for the
* subsystem ... | false | false | false | false | false | 0 |
stdb_copy_value(void *db, heim_string_t table, heim_data_t key,
heim_error_t *error)
{
bsearch_file_handle bfh = db;
const char *k;
char *v;
heim_data_t value;
int ret;
if (error)
*error = NULL;
if (table == NULL)
table = HSTR("");
if (table != HSTR(""))
return NULL;
i... | false | false | false | false | false | 0 |
InsertView(GView *prev, GView *view) {
if (!view)
return;
if (prev) {
view->Prev = prev;
view->Next = prev->Next;
prev->Next = view;
view->Next->Prev = view;
} else {
view->Prev = view->Next = view;
Top = view;
}
if (Active == 0) {
Active = ... | false | false | false | false | false | 0 |
uint_filter_cb (GtkEntry * entry,
const gchar *text,
gint length,
gint * position,
gpointer user_data)
{
GtkWidget *ok_button = user_data;
GtkEditable *editable = GTK_EDITABLE (entry);
int i, count = 0;
gchar *result = g_new (gchar,... | false | false | false | false | false | 0 |
C_string2(C_word **ptr, C_char *str)
{
C_word strblock = (C_word)(*ptr);
int len;
if(str == NULL) return C_SCHEME_FALSE;
len = C_strlen(str);
*ptr = (C_word *)((C_word)(*ptr) + sizeof(C_header) + C_align(len));
((C_SCHEME_BLOCK *)strblock)->header = C_STRING_TYPE | len;
C_memcpy(((C_SCHEME_BLOCK *)strbl... | false | false | false | false | true | 1 |
tracker_ontologies_add_property (TrackerProperty *field)
{
const gchar *uri;
g_return_if_fail (TRACKER_IS_PROPERTY (field));
uri = tracker_property_get_uri (field);
if (g_strcmp0 (uri, TRACKER_RDF_PREFIX "type") == 0) {
if (rdf_type) {
g_object_unref (rdf_type);
}
rdf_type = g_object_ref (field);
}
g... | false | false | false | false | false | 0 |
Convert(const void* in_data, size_t in_size,
void* out_data, size_t out_size,
size_t* size_read, size_t* size_written)
{
#warning FIXME 8-bit?
int result;
//printf("LAMEGETBUG %d\n", p_lame_get_size_mp3buffer(gf));
if (in_fmt.nChannels == 1)
result = p_lame_encode_buffer(gf, (short*)in_data,
(... | false | false | false | false | false | 0 |
endAllElements()
{
while (tagLevel() > 0) {
if (!currentElement().isFinished())
message(ParserMessages::elementNotFinishedDocumentEnd,
StringMessageArg(currentElement().type()->name()));
implyCurrentElementEnd(currentLocation());
}
if (!currentElement().isFinished() && validate())
message... | false | false | false | false | false | 0 |
FC_InitPIN(CK_SESSION_HANDLE hSession,
CK_CHAR_PTR pPin, CK_ULONG ulPinLen) {
CK_RV rv;
CHECK_FORK();
if (sftk_fatalError) return CKR_DEVICE_ERROR;
if ((rv = sftk_newPinCheck(pPin,ulPinLen)) == CKR_OK) {
rv = NSC_InitPIN(hSession,pPin,ulPinLen);
}
if (sftk_audit_enabled) {
char msg[... | true | true | false | false | false | 1 |
buildDefaultACLCommands(const char *type, const char *nspname,
const char *acls, const char *owner,
int remoteVersion,
PQExpBuffer sql)
{
bool result;
PQExpBuffer prefix;
prefix = createPQExpBuffer();
/*
* We incorporate the target role directly into the command, rather than
* playing aroun... | false | false | false | false | false | 0 |
_refreshString() const
{
// char buf[30];
m_sXMLstring.clear();
UT_uint32 iCount = m_vRev.getItemCount();
for(UT_uint32 i = 0; i < iCount; i++)
{
PP_Revision * r = (PP_Revision *)m_vRev.getNthItem(i);
if( !m_sXMLstring.empty() )
m_sXMLstring += ",";
m_sXMLstring += r->toSt... | false | false | false | false | false | 0 |
socksDnsHandler(int status, GethostbynameRequestPtr grequest)
{
SocksRequestPtr request = grequest->data;
if(status <= 0) {
request->handler(status, request);
destroySocksRequest(request);
return 1;
}
if(grequest->addr->string[0] == DNS_CNAME) {
if(grequest->count > 10) ... | false | false | false | false | false | 0 |
artifact_exists(struct obj *otmp, const char *name, bool mod)
{
const struct artifact *a;
if (otmp && *name)
{
for (a = artilist+1; a->otyp; a++)
{
if (a->otyp == otmp->otyp && !strcmp(a->name, name))
{
int m = a - artilist;
otmp->oart... | false | false | false | false | false | 0 |
GetNextPoint()
{
DDFRecord *poRecord;
/* -------------------------------------------------------------------- */
/* Read a record. */
/* -------------------------------------------------------------------- */
if( oDDFModule.GetFP() == NULL )
... | false | false | false | false | false | 0 |
gst_qt_mux_handle_buffer (GstCollectPads * pads, GstCollectData * cdata,
GstBuffer * buf, gpointer user_data)
{
GstFlowReturn ret = GST_FLOW_OK;
GstQTMux *qtmux = GST_QT_MUX_CAST (user_data);
GstQTPad *best_pad = NULL;
GstClockTime best_time = GST_CLOCK_TIME_NONE;
if (G_UNLIKELY (qtmux->state == GST_QT_M... | false | false | false | false | false | 0 |
on_port_disappeared(void * graph, DBusMessage * message_ptr)
{
dbus_uint64_t new_graph_version;
dbus_uint64_t client_id;
const char * client_name;
dbus_uint64_t port_id;
const char * port_name;
if (!dbus_message_get_args(
message_ptr,
&cdbus_g_dbus_error,
DBUS_TYPE_UINT64, &new_grap... | false | false | false | false | false | 0 |
SetStatementPosition(Statement* stmt) {
if (FLAG_debug_info) {
#ifdef ENABLE_DEBUGGER_SUPPORT
if (!Debugger::IsDebuggerActive()) {
CodeGenerator::RecordPositions(masm_, stmt->statement_pos());
} else {
// Check if the statement will be breakable without adding a debug break
// slot.
Br... | false | false | false | false | false | 0 |
up_backend_add_cb (UpBackend *backend)
{
gboolean ret;
guint timer_id;
/* coldplug */
ret = up_device_coldplug (backend->priv->device, backend->priv->daemon, backend->priv->native);
if (!ret) {
g_warning ("failed to coldplug");
goto out;
}
/* emit */
g_signal_emit (backend, signals[SIGNAL_DEVICE_ADDED], 0... | false | false | false | false | false | 0 |
do_pri_inode(aufs_bindex_t bindex, struct inode *inode, int hn,
struct dentry *wh)
{
char *n = NULL;
int l = 0;
if (!inode || IS_ERR(inode)) {
dpri("i%d: err %ld\n", bindex, PTR_ERR(inode));
return -1;
}
/* the type of i_blocks depends upon CONFIG_LBDAF */
BUILD_BUG_ON(sizeof(inode->i_blocks) != sizeof(u... | false | false | false | false | false | 0 |
diagnose_sb_1 (gimple_stmt_iterator *gsi_p, bool *handled_ops_p,
struct walk_stmt_info *wi)
{
gimple context = (gimple) wi->info;
gimple inner_context;
gimple stmt = gsi_stmt (*gsi_p);
*handled_ops_p = true;
switch (gimple_code (stmt))
{
WALK_SUBSTMTS;
case GIMPLE_OMP_PARALLEL:
c... | false | false | false | false | false | 0 |
ast_for_ifexpr(struct compiling *c, const node *n)
{
/* test: or_test 'if' or_test 'else' test */
expr_ty expression, body, orelse;
assert(NCH(n) == 5);
body = ast_for_expr(c, CHILD(n, 0));
if (!body)
return NULL;
expression = ast_for_expr(c, CHILD(n, 2));
if (!expression)
r... | false | false | false | false | false | 0 |
find_in_path (const char *progname)
{
#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__
/* Native Windows, Cygwin, OS/2, DOS */
/* The searching rules with .COM, .EXE, .BAT, .CMD etc. suffixes are
too complicated. Leave it to the OS. */
return progname;
#... | false | false | false | false | false | 0 |
qla83xx_initiating_reset(scsi_qla_host_t *vha)
{
struct qla_hw_data *ha = vha->hw;
uint32_t idc_control, dev_state;
__qla83xx_get_idc_control(vha, &idc_control);
if ((idc_control & QLA83XX_IDC_RESET_DISABLED)) {
ql_log(ql_log_info, vha, 0xb080,
"NIC Core reset has been disabled. idc-control=0x%x\n",
... | false | false | false | false | false | 0 |
abitset_unused_clear (bitset dst)
{
unsigned int last_bit;
last_bit = BITSET_SIZE_ (dst) % BITSET_WORD_BITS;
if (last_bit)
ABITSET_WORDS (dst)[dst->b.csize - 1] &=
((bitset_word) 1 << last_bit) - 1;
} | false | false | false | false | false | 0 |
gen_send_ex(PyGenObject *gen, PyObject *arg, int exc)
{
PyThreadState *tstate = PyThreadState_GET();
PyFrameObject *f = gen->gi_frame;
PyObject *result;
if (gen->gi_running) {
PyErr_SetString(PyExc_ValueError,
"generator already executing");
return NULL;
}
... | false | false | false | false | false | 0 |
ParseAnswerTXT(QueryArg *arg, unsigned char* abuf, int alen) {
HandleScope scope;
struct ares_txt_reply *txt_out;
int status = ares_parse_txt_reply(abuf, alen, &txt_out);
if (status != ARES_SUCCESS) {
ResolveError(arg->js_cb, status);
return;
}
Local<Array> txt_records = Array::New();
struct a... | false | false | false | false | false | 0 |
create_about_vbox (GtkBuilder *builder)
{
GtkWidget *about_dialog;
GtkWidget *about_vbox;
GtkWidget *content_area;
GtkWidget *vbox;
GtkWidget *widget;
GtkWidget *old_parent;
GList *list;
about_dialog = GTK_WIDGET (gtk_builder_get_object (builder, "about_dialog"));
about_vbox = GTK_W... | false | false | false | false | false | 0 |
nfs4_pnfs_ds_connect(struct nfs_server *mds_srv, struct nfs4_pnfs_ds *ds,
struct nfs4_deviceid_node *devid, unsigned int timeo,
unsigned int retrans, u32 version,
u32 minor_version, rpc_authflavor_t au_flavor)
{
if (test_and_set_bit(NFS4DS_CONNECTING, &ds->ds_state) == 0) {
int err = 0;
if (version... | false | false | false | false | false | 0 |
soap_char(struct soap *soap)
{ char tmp[8];
register int i;
register soap_wchar c;
register char *s = tmp;
for (i = 0; i < 7; i++)
{ c = soap_get1(soap);
if (c == ';' || (int)c == EOF)
break;
*s++ = (char)c;
}
*s = '\0';
if (*tmp == '#')
{ if (tmp[1] == 'x' || tmp[1] == 'X')
return... | false | false | false | false | false | 0 |
_midgard_workspace_list_children (MidgardWorkspaceStorage *wss, guint *n_objects)
{
g_return_val_if_fail (wss != NULL, NULL);
if (n_objects)
*n_objects = 0;
guint n_names;
gchar **names = midgard_workspace_storage_list_workspace_names (wss, &n_names);
if (names == NULL)
return NULL;
guint i;
Midgar... | false | false | false | false | false | 0 |
Redraw(IntCoord, IntCoord, IntCoord, IntCoord) {
IntCoord x = (xmax+1 - mask->Width())/2;
IntCoord y = (ymax+1 - mask->Height())/2;
if (highlighted) {
output->Stencil(canvas, x, y, hit, mask);
} else {
output->Stencil(canvas, x, y, plain, mask);
}
} | false | false | false | false | false | 0 |
gnome_canvas_item_grab_focus (GnomeCanvasItem *item)
{
GnomeCanvasItem *focused_item;
GdkEvent ev;
g_return_if_fail (GNOME_IS_CANVAS_ITEM (item));
g_return_if_fail (gtk_widget_get_can_focus (GTK_WIDGET (item->canvas)));
focused_item = item->canvas->focused_item;
if (focused_item) {
GtkLayout *layout;
GdkWi... | false | false | false | false | false | 0 |
zaxisResize(int zaxisID, int size)
{
zaxis_t *zaxisptr;
zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
zaxis_check_ptr(zaxisID, zaxisptr);
zaxisptr->size = size;
if ( zaxisptr->vals )
zaxisptr->vals = (double *) realloc(zaxisptr->vals, size*sizeof(double));
} | false | false | false | false | false | 0 |
property( const QString & key ) const
{
KPLUGININFO_ISVALID_ASSERTION;
if( d->service )
return d->service->property( key );
else
return QVariant();
} | false | false | false | false | false | 0 |
Initialize(CPLXMLNode *config) {
CPLErr ret = CE_None;
if (ret == CE_None) {
const char *version = CPLGetXMLValue(config, "Version", "1");
if (version[0] != '\0') {
m_version = version;
}
}
if (ret == CE_None) {
const char *base_url = CPLGetXMLValue(config, ... | false | false | false | false | false | 0 |
one_code(Gif_Context *gfc, Gif_Code code)
{
uint8_t *suffixes = gfc->suffix;
Gif_Code *prefixes = gfc->prefix;
uint8_t *ptr;
int lastsuffix;
uint16_t codelength = gfc->length[code];
gfc->decodepos += codelength;
ptr = gfc->image + gfc->decodepos;
if (ptr > gfc->maximage || !codelength) {
gif_read_e... | false | false | false | false | false | 0 |
performConvexcast (btTriangleCallback* callback, const btVector3& raySource, const btVector3& rayTarget, const btVector3& aabbMin, const btVector3& aabbMax)
{
struct MyNodeOverlapCallback : public btNodeOverlapCallback
{
btStridingMeshInterface* m_meshInterface;
btTriangleCallback* m_callback;
MyNodeOverlapCal... | false | false | false | false | false | 0 |
Initialize()
{
// Clear out any remaining memory.
this->PointIdMap->clear();
// We need to create a reverse map from the point ids to their canonical cell
// ids. This is a fancy way of saying that we have to be able to rapidly go
// from a PointId[i] to the location i in the cell.
vtkIdType i, id, numPo... | false | false | false | false | false | 0 |
WaitBW() const
{
struct timespec nowspec;
double rightnow, late;
double maxwait = 0, nextwake = 0;
double nextup = 0, nextdn = 0;
int use_up = 0, use_dn = 0;
if( cfg_max_bandwidth_up ){
nextup = Self.LastSendTime() +
(double)(Self.LastSizeSent()) / cfg_max_bandwidth_up;
}
if( cfg_max_b... | false | false | false | false | false | 0 |
static_box (int *box, gamgi_window *window)
{
GtkAllocation allocation;
int width, height;
/***********************************************
* box[0], box[1]: below left x,y coordinates *
* box[2], box[3]: above right x,y coordinates *
***********************************************/
/*****************************... | false | false | false | false | false | 0 |
dlm_callback_start(struct dlm_ls *ls)
{
ls->ls_callback_wq = alloc_workqueue("dlm_callback",
WQ_UNBOUND | WQ_MEM_RECLAIM, 0);
if (!ls->ls_callback_wq) {
log_print("can't start dlm_callback workqueue");
return -ENOMEM;
}
return 0;
} | false | false | false | false | false | 0 |
plugin_get_loader_if_needed (GOPlugin *plugin, GOErrorInfo **ret_error)
{
GType loader_type;
GOErrorInfo *error = NULL;
g_return_if_fail (GO_IS_PLUGIN (plugin));
GO_INIT_RET_ERROR_INFO (ret_error);
if (!go_plugin_read_full_info_if_needed_go_error_info_ (plugin, ret_error)) {
return;
}
if (plugin->loader != N... | false | false | false | false | false | 0 |
git_merge_config(const char *k, const char *v, void *cb)
{
if (branch && !prefixcmp(k, "branch.") &&
!prefixcmp(k + 7, branch) &&
!strcmp(k + 7 + strlen(branch), ".mergeoptions")) {
free(branch_mergeoptions);
branch_mergeoptions = xstrdup(v);
return 0;
}
if (!strcmp(k, "merge.diffstat") || !strcmp(k, "mer... | false | false | false | false | false | 0 |
ya_remake_module_template_module(Module_table *newmodule,
Module_table *oldmodule,
const int level)
{
int i;
if (newmodule->kind == MODULE_FUNC) {
for (i = 1; i <= _func_max_array_entry[newmodule->entry]; i++) {
_func_templ_a... | false | false | false | false | false | 0 |
expand_builtin_memcpy (tree exp, rtx target)
{
if (!validate_arglist (exp,
POINTER_TYPE, POINTER_TYPE, INTEGER_TYPE, VOID_TYPE))
return NULL_RTX;
else
{
tree dest = CALL_EXPR_ARG (exp, 0);
tree src = CALL_EXPR_ARG (exp, 1);
tree len = CALL_EXPR_ARG (exp, 2);
const char *src_str;... | false | false | false | false | true | 1 |
brasero_vob_start (BraseroJob *job,
GError **error)
{
BraseroVobPrivate *priv;
BraseroJobAction action;
BraseroTrackType *output = NULL;
brasero_job_get_action (job, &action);
if (action != BRASERO_JOB_ACTION_IMAGE)
return BRASERO_BURN_NOT_SUPPORTED;
priv = BRASERO_VOB_PRIVATE (job);
/* get destination... | false | false | false | false | false | 0 |
SolveRayBiCubic(
Geometry_t *Geometry,double RayPlanes[2][4],
double FX,double FY,double FZ,double DX,double DY,double DZ,double L,int SubLev
)
{
int T;
if ( Geometry->Flags & GEOMETRY_FLAG_PLANE )
{
T = SolveRayBiCubicNewton( RayPlanes,FX,FY,FZ,DX,DY,DZ,L... | false | false | false | false | false | 0 |
wm8900_set_fll(struct snd_soc_codec *codec,
int fll_id, unsigned int freq_in, unsigned int freq_out)
{
struct wm8900_priv *wm8900 = snd_soc_codec_get_drvdata(codec);
struct _fll_div fll_div;
if (wm8900->fll_in == freq_in && wm8900->fll_out == freq_out)
return 0;
/* The digital side should be disabled during an... | false | false | false | false | false | 0 |
is_value_stored( Quadruple *qr )
{
Quadruple *nqr;
for( nqr = qr->next; nqr != NULL; nqr = nqr->next ){
if( nqr != NULL && nqr->ope == OPE_STORE
&& qr->op[0]->kind == nqr->op[0]->kind
&& qr->op[0]->entry == nqr->op[0]->entry )
return TRUE;
}
return FALSE;
} | false | false | false | false | false | 0 |
nc4_find_dim_len(NC_GRP_INFO_T *grp, int dimid, size_t **len)
{
NC_GRP_INFO_T *g;
NC_VAR_INFO_T *var;
int d, ndims, dimids[NC_MAX_DIMS];
size_t dimlen[NC_MAX_DIMS];
int retval;
assert(grp && len);
LOG((3, "nc4_find_dim_len: grp->name %s dimid %d", grp->name, dimid));
/* If there are any groups... | false | false | false | false | false | 0 |
accept()
{
kDebug();
m_host = hostEdit->text();
m_port = hostEdit->text().toInt();
QDialog::accept();
} | false | false | false | false | false | 0 |
BERDecodeTextString(BufferedTransformation &bt, std::string &str, byte asnTag)
{
byte b;
if (!bt.Get(b) || b != asnTag)
BERDecodeError();
size_t bc;
if (!BERLengthDecode(bt, bc))
BERDecodeError();
SecByteBlock temp(bc);
if (bc != bt.Get(temp, bc))
BERDecodeError();
str.assign((char *)temp.begin(), bc);
... | false | false | false | false | false | 0 |
SetRawRingtone(gn_data *data, struct gn_statemachine *state)
{
unsigned char req[512] = {0x00, 0x01, 0xa0,
0x00, /* location */
0x00, 0x0c, 0x2c, 0x01, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x02, 0xfc, 0x09}; /* data */
gn_error error;
int len;
if ... | true | true | false | false | false | 1 |
mant_bits_set (const struct floatformat *fmt, const unsigned char *ufrom)
{
unsigned int mant_bits, mant_off;
int mant_bits_left;
mant_off = fmt->man_start;
mant_bits_left = fmt->man_len;
while (mant_bits_left > 0)
{
mant_bits = min (mant_bits_left, 32);
if (get_field (ufrom, fmt->byteorder,... | false | false | false | false | false | 0 |
i2d_ASN1_bio_stream(BIO *out, ASN1_VALUE *val, BIO *in, int flags,
const ASN1_ITEM *it)
{
/* If streaming create stream BIO and copy all content through it */
if (flags & SMIME_STREAM)
{
BIO *bio, *tbio;
bio = BIO_new_NDEF(out, val, it);
if (!bio)
{
ASN1err(ASN1_F_I2D_ASN1_BIO_STREAM,ERR_R_MALLOC_F... | false | false | false | false | false | 0 |
secret_PerformAuth_OIAP(TSS_HOBJECT hAuthorizedObject,
UINT32 ulPendingFn,
TSS_HPOLICY hPolicy,
TSS_BOOL cas, /* continue auth session */
TCPA_DIGEST *hashDigest,
TPM_AUTH *auth)
{
TSS_RESULT result;
TSS_BOOL bExpired;
UINT32 mode;
TCPA_SECRET secret;
TSS_HCONTEXT tspContext;
TSS_RESULT (*OIAP)(TSS... | false | false | false | false | false | 0 |
lib3ds_io_log_str(Lib3dsIo *io, Lib3dsLogLevel level, const char *str) {
if (!io || !io->log_func)
return;
(*io->log_func)(io->self, level, ((Lib3dsIoImpl*)io->impl)->log_indent, str);
} | false | false | false | false | false | 0 |
nm_connection_get_setting_by_name (NMConnection *connection, const char *name)
{
GType type;
g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL);
g_return_val_if_fail (name != NULL, NULL);
type = nm_connection_lookup_setting_type (name);
return type ? nm_connection_get_setting (connection, type) : NULL;
... | false | false | false | false | false | 0 |
gst_data_queue_push_force_unlocked (GstDataQueue * queue,
GstDataQueueItem * item)
{
GstDataQueuePrivate *priv = queue->priv;
gst_queue_array_push_tail (priv->queue, item);
if (item->visible)
priv->cur_level.visible++;
priv->cur_level.bytes += item->size;
priv->cur_level.time += item->duration;
} | false | false | false | false | false | 0 |
get_rp_filter()
{
FILE *f;
int value = -EINVAL, tmp;
f = fopen("/proc/sys/net/ipv4/conf/all/rp_filter", "r");
if (f != NULL) {
if (fscanf(f, "%d", &tmp) == 1)
value = tmp;
fclose(f);
}
return value;
} | false | false | false | false | true | 1 |
transport_open(void){
int rc = 0;
if( transport.isOpen==0 ){
if( g.urlIsSsh ){
Blob cmd;
blob_zero(&cmd);
shell_escape(&cmd, g.urlFossil);
blob_append(&cmd, " test-http ", -1);
shell_escape(&cmd, g.urlPath);
fprintf(sshOut, "%s || true\n", blob_str(&cmd));
fflush(sshOut... | false | false | false | false | false | 0 |
e_rule_context_find_rank_rule (ERuleContext *context,
gint rank,
const gchar *source)
{
GList *node;
gint i = 0;
g_return_val_if_fail (E_IS_RULE_CONTEXT (context), NULL);
node = context->rules;
while (node) {
EFilterRule *r = node->data;
if (sour... | false | false | false | false | false | 0 |
newsnntp_connect(newsnntp * f, mailstream * s)
{
char * response;
int r;
if (f->nntp_stream != NULL)
return NEWSNNTP_ERROR_BAD_STATE;
f->nntp_stream = s;
response = read_line(f);
if (response == NULL)
return NEWSNNTP_ERROR_STREAM;
r = parse_response(f, response);
switch (r) {
case 200:
... | false | false | false | false | false | 0 |
strong_search_predecessors(osi_set_t * l, setkey_t k, sh_node_pt * pa,
sh_node_pt * na)
{
sh_node_pt x, x_next, old_x_next, y, y_next;
setkey_t y_k;
int i;
retry:
RMB();
x = &l->head;
for (i = NUM_LEVELS - 1; i >= 0; i--) {
/* We start our search at previous level's unmarked predecess... | false | false | false | false | true | 1 |
ath6kl_wmi_data_hdr_add(struct wmi *wmi, struct sk_buff *skb,
u8 msg_type, u32 flags,
enum wmi_data_hdr_data_type data_type,
u8 meta_ver, void *tx_meta_info, u8 if_idx)
{
struct wmi_data_hdr *data_hdr;
int ret;
if (WARN_ON(skb == NULL || (if_idx > wmi->parent_dev->vif_max - 1)))
return -EINVA... | false | false | false | false | false | 0 |
reduce(a, b)
/* elimate common factors in fraction a/b */
int *a, *b;
{
int sign;
int t, n, m;
if (*a < 0) {
sign = -1;
*a = -*a;
} else {
sign = 1;
};
/* find HCF using Euclid's algorithm */
if (*a > *b) {
n = *a;
m = *b;
} else {
n = *b;
m = *a;
};
while (m != 0) {
... | false | false | false | false | false | 0 |
brcmf_fil_bsscfg_data_get(struct brcmf_if *ifp, char *name,
void *data, u32 len)
{
struct brcmf_pub *drvr = ifp->drvr;
s32 err;
u32 buflen;
mutex_lock(&drvr->proto_block);
buflen = brcmf_create_bsscfg(ifp->bssidx, name, data, len,
drvr->proto_buf, sizeof(drvr->proto_buf));
if (buflen) {
err = br... | false | true | false | false | false | 1 |
ad7816_store_channel(struct device *dev,
struct device_attribute *attr,
const char *buf,
size_t len)
{
struct iio_dev *indio_dev = dev_to_iio_dev(dev);
struct ad7816_chip_info *chip = iio_priv(indio_dev);
unsigned long data;
int ret;
ret = kstrtoul(buf, 10, &data);
if (ret)
return ret;
... | false | false | false | false | false | 0 |
rate_check(rate_t rt)
{
/* not tracking */
if(rt->time == 0)
return 1;
/* under the limit */
if(rt->count < rt->total)
return 1;
/* currently bad */
if(rt->bad != 0)
{
/* wait over, they're good again */
if(time(NULL) - rt->bad >= rt->wait)
{
... | 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.