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 |
|---|---|---|---|---|---|---|
SetDefinition(const std::vector<int>& m, const std::vector<VertexLink>& l)
{
this->m_Vertices.resize(m.size());
this->m_Edges.resize(l.size());
this->m_Faces.clear();
this->SetGeometryPartially(m,l);
// Build faces
// - List the connectivity of each vertex
std::vector< std::list<... | false | false | false | false | false | 0 |
PushValue(int iFirstIndex, int iCurrentIndex,
Value *pValue,
vector<string> &asIndexes, vector<string> &asValue) {
ostringstream sIndex;
if(m_iAddressRadix == 16) {
sIndex << hex;
}
sIndex << Value::name() << "[" << m_szPrefix << iFirstI... | false | false | false | false | false | 0 |
jshGetDevicePath(IOEventFlags device, char *buf, size_t bufSize) {
JsVar *obj = jshGetDeviceObject(device);
if (!obj) return false;
bool success = false;
JsVar *str = jsvObjectGetChild(obj, "path", 0);
if (jsvIsString(str)) {
jsvGetString(str, buf, bufSize);
success = true;
}
jsvUnLock(str);
js... | false | false | false | false | false | 0 |
model_object_throw(Model_object *o) {
/* Set flag for action. This flag is automatically set to FALSE
* when action is handled. */
o->action = TRUE;
MDEBUG("Player does action.");
} | false | false | false | false | false | 0 |
findOuterBoundary()
{
if ( !(modelData->status & (BE_INCLUDES_OUTER)) ||
modelData->status & BE_INNER
)
return 0;
BodyElementList* oe_list = new BodyElementList;
// If bodyelement itself is an outer boundary ...
if ( modelData->status & BE_OUTER ) {
oe_list->push_front(this);
return oe_... | false | false | false | false | false | 0 |
mapi_table_create(void)
{
const struct mapi_table *noop = table_get_noop();
struct mapi_table *tbl;
tbl = malloc(MAPI_TABLE_SIZE);
if (tbl)
memcpy(tbl, noop, MAPI_TABLE_SIZE);
return tbl;
} | false | false | false | false | true | 1 |
skip_sed_expr (const char *command, size_t i, size_t len)
{
int state;
do
{
int delim;
if (command[i] == ';')
i++;
if (!(command[i] == 's' && i + 3 < len && ISPUNCT (command[i + 1])))
break;
delim = command[++i];
state = 1;
for (i++; i < len; i++)
{
if (state == 3)
... | false | false | false | false | false | 0 |
quick_open_plugin_setup_document_handling(QuickOpenPlugin* self)
{
GList* documents, *l;
self->docman = anjuta_shell_get_interface(ANJUTA_PLUGIN(self)->shell,
IAnjutaDocumentManager, NULL);
g_return_if_fail(self->docman);
g_object_add_weak_pointer(G_OBJECT(self->docman), (void**)&self->docman)... | false | false | false | false | false | 0 |
mcs_setup_transceiver_sharp(struct mcs_cb *mcs)
{
net_warn_ratelimited("This transceiver type is not supported yet\n");
return 1;
} | false | false | false | false | false | 0 |
inv_knob_set_value(InvKnob *knob, float num)
{
if(num < knob->min)
knob->value = knob->min;
else if(num > knob->max)
knob->value = knob->min;
else
knob->value = num;
if(knob->value != knob->lastvalue) {
if(GTK_WIDGET_REALIZED(knob))
inv_knob_paint(GTK_WIDGET(knob),INV_KNOB_DRAW_DATA);
}
} | false | false | false | false | false | 0 |
setStatusText( QListWidgetItem *item )
{
#define item static_cast<CoverViewItem *>( item )
if ( !item )
return;
const QString artist = item->albumPtr()->isCompilation() ? i18n( "Various Artists" ) : item->artist();
const QString tipContent = i18n( "%1 - %2", artist , item->album() );
CoverM... | false | false | false | false | false | 0 |
GraphLabelTitle(const char *title, const char *subtitle)
{
float fold;
AjPStr tmpstr = NULL;
tmpstr = ajStrNewC(title);
if(ajStrGetLen(tmpstr) > 55)
{
ajStrKeepRange(&tmpstr, 0, 55);
ajStrAppendC(&tmpstr, "...");
}
#if GRAPH_DEBUG
ajDebug("=g= plmtex('t', 2.5, 0.5, 0.5, '%S') [title]\n",... | false | false | false | false | false | 0 |
mthca_MAP_ICM_page(struct mthca_dev *dev, u64 dma_addr, u64 virt)
{
struct mthca_mailbox *mailbox;
__be64 *inbox;
int err;
mailbox = mthca_alloc_mailbox(dev, GFP_KERNEL);
if (IS_ERR(mailbox))
return PTR_ERR(mailbox);
inbox = mailbox->buf;
inbox[0] = cpu_to_be64(virt);
inbox[1] = cpu_to_be64(dma_addr);
err... | false | false | false | false | false | 0 |
fscache_mark_pages_cached(struct fscache_retrieval *op,
struct pagevec *pagevec)
{
unsigned long loop;
for (loop = 0; loop < pagevec->nr; loop++)
fscache_mark_page_cached(op, pagevec->pages[loop]);
pagevec_reinit(pagevec);
} | false | false | false | false | false | 0 |
rewriteDeclarators(void)
{
for (DeclaratorDeclSet::const_iterator I = TheDeclaratorSet->begin(),
E = TheDeclaratorSet->end(); I != E; ++I) {
if (const FieldDecl *FD = dyn_cast<FieldDecl>(*I)) {
rewriteOneFieldDecl(FD);
continue;
}
if (const FunctionDecl *FunD = dyn_cast<FunctionDecl>(*... | false | false | false | false | false | 0 |
create(int type, bool a_bShowTypicalError)
{
if(m_bSocketIsClosed)
{
if(m_bIsReservedSocket||m_u32NormalSocketsOpen<m_u32MaxNormalSockets)
{
m_Socket=socket(type,SOCK_STREAM,0);
}
else
{
CAMsg::printMsg(LOG_CRIT,"Could not create a new normal Socket -- allowed number of normal sockets exeded... | false | false | false | false | false | 0 |
updateFormatting()
{
QString tmp = prescriptionFormatting->textEdit()->toHtml();
formatingSample->setHtml(getFullPrescription(drug, true, tmp));
} | false | false | false | false | false | 0 |
IoObject_if(IoObject *self, IoObject *locals, IoMessage *m)
{
/*doc Object if(<condition>, <trueMessage>, <optionalFalseMessage>)
Evaluates trueMessage if condition evaluates to a non-Nil.
Otherwise evaluates optionalFalseMessage if it is present.
Returns the result of the evaluated message or Nil if none was evalu... | false | false | false | false | false | 0 |
test_perform_cancel (Test *test,
gconstpointer unused)
{
SecretPrompt *prompt;
GError *error = NULL;
GAsyncResult *result = NULL;
GCancellable *cancellable;
GVariant *retval;
prompt = _secret_prompt_instance (test->service, "/org/freedesktop/secrets/prompts/delay");
g_object_add_weak_pointe... | false | false | false | false | false | 0 |
caml_extunix_crtscts(value mlfd)
{
CAMLparam1(mlfd);
struct termios t;
int r, fd = Int_val(mlfd);
r = tcgetattr(fd, &t);
if (0 == r) {
t.c_cflag |= CRTSCTS;
r = tcsetattr(fd, TCSANOW, &t);
}
if (0 != r) uerror("crtscts",Nothing);
CAMLreturn(Val_unit);
} | false | false | false | false | false | 0 |
writeFinalBlocks()
{
bool generate = false;
for ( DefList::Iter prod = prodList; prod.lte(); prod++ ) {
if ( prod->finalBlock != 0 ) {
generate = true;
break;
}
}
if ( generate ) {
out << "switch ( lel->reduction ) {\n";
for ( DefList::Iter prod = prodList; prod.lte(); prod++ ) {
/* If there is re... | false | false | false | false | false | 0 |
force_single_succ_latches (struct loops *loops)
{
unsigned i;
struct loop *loop;
edge e;
for (i = 1; i < loops->num; i++)
{
loop = loops->parray[i];
if (loop->latch != loop->header
&& !loop->latch->succ->succ_next)
continue;
for (e = loop->header->pred; e->src != loop->latch; e = e->... | false | false | false | false | false | 0 |
wakeup_timer_fn(unsigned long data)
{
struct mwifiex_adapter *adapter = (struct mwifiex_adapter *)data;
mwifiex_dbg(adapter, ERROR, "Firmware wakeup failed\n");
adapter->hw_status = MWIFIEX_HW_STATUS_RESET;
mwifiex_cancel_all_pending_cmd(adapter);
if (adapter->if_ops.card_reset)
adapter->if_ops.card_reset(adap... | false | false | false | false | false | 0 |
get_custom_plugin_path(const gchar *plugin_path_config,
const gchar *plugin_path_system)
{
gchar *plugin_path_custom;
if (!NZV(prefs.custom_plugin_path))
return NULL;
plugin_path_custom = utils_get_locale_from_utf8(prefs.custom_plugin_path);
utils_tidy_path(plugin_path_custom);
/* check whether the ... | false | false | false | false | false | 0 |
__rmap_write_protect(struct kvm *kvm, unsigned long *rmapp,
bool pt_protect)
{
u64 *sptep;
struct rmap_iterator iter;
bool flush = false;
for_each_rmap_spte(rmapp, &iter, sptep)
flush |= spte_write_protect(kvm, sptep, pt_protect);
return flush;
} | false | false | false | false | false | 0 |
Recur()
{
Buffer *b = curbuf;
Mark *m;
m = MakeMark(curline, curchar);
RecDepth += 1;
UpdModLine = YES;
DoKeys(NO); /* NO means not first time */
UpdModLine = YES;
RecDepth -= 1;
if (!valid_bp(b))
complain("Buffer gone!");
tiewind(curwind, b);
SetBuf(b);
if (!is_an_arg())
ToMark(m);
DelMark(m);
} | false | false | false | false | false | 0 |
count(char *name, pairlist attribs)
{
/* Count element name */
countstring(name);
/* Count attribute names (or rather, the strings "elem/attrib") */
for (; attribs != NULL; attribs = attribs->next) {
char *s = malloc(strlen(name) + strlen(attribs->name) + 2);
if (s == NULL) {fprintf(stderr, "Out of mem... | false | false | false | false | false | 0 |
subs_dump(GF_Box *a, FILE * trace)
{
u32 entry_count, i, j;
u16 subsample_count;
GF_SubSampleInfoEntry *pSamp;
GF_SubSampleEntry *pSubSamp;
GF_SubSampleInformationBox *ptr = (GF_SubSampleInformationBox *) a;
if (!a) return GF_BAD_PARAM;
entry_count = gf_list_count(ptr->Samples);
fprintf(trace, "<SubSampleInfo... | false | false | false | false | false | 0 |
es_fopencookie (void *ES__RESTRICT cookie,
const char *ES__RESTRICT mode,
es_cookie_io_functions_t functions)
{
unsigned int modeflags;
estream_t stream;
int err;
stream = NULL;
modeflags = 0;
err = es_convert_mode (mode, &modeflags);
if (err)
goto out;
err = es_create (&stream, cookie, -1, f... | false | false | false | false | false | 0 |
isNotMinSignedValue() const {
// Check for INT_MIN integers
if (const ConstantInt *CI = dyn_cast<ConstantInt>(this))
return !CI->isMinValue(/*isSigned=*/true);
// Check for FP which are bitcasted from INT_MIN integers
if (const ConstantFP *CFP = dyn_cast<ConstantFP>(this))
return !CFP->getValueAPF().bi... | false | false | false | false | false | 0 |
register_region(uint32_t tid, HashNode* hn) {
uint32_t fid = VT_NO_ID;
uint32_t lno = VT_NO_LNO;
/* -- register file if available -- */
if (hn->fname != NULL)
{
fid = vt_def_scl_file(tid, hn->fname);
lno = hn->lno;
}
/* -- register region and store region identifier -- */
hn->vtid = vt_def_reg... | false | false | false | false | false | 0 |
generateCuts(const OsiSolverInterface& si, OsiCuts & cs,
const CglTreeInfo info)
{
int i;
bool has_petol_set = petol != -1.0;
if (! has_petol_set)
si.getDblParam(OsiPrimalTolerance, petol);
int numberOriginalRows = si.getNumRows();
if (info.inTree&&justOriginalRows_)
numberOriginalRows = i... | false | false | false | false | false | 0 |
fserve_add_client_callback (client_t *client, fserve_callback_t callback, void *arg)
{
fserve_t *fclient = calloc (1, sizeof(fserve_t));
DEBUG0 ("Adding client to file serving engine");
if (fclient == NULL)
{
client_send_404 (client, "memory exhausted");
return;
}
fclient->file ... | false | false | false | false | false | 0 |
set_click_policy_property (GeditFileBrowserView *obj,
GeditFileBrowserViewClickPolicy click_policy)
{
GtkTreeIter iter;
GdkDisplay *display;
GdkWindow *win;
obj->priv->click_policy = click_policy;
if (click_policy == GEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE)
{
if (obj->priv->hand_cursor =... | false | false | false | false | false | 0 |
lirc_has_data_cb(GIOChannel *source, GIOCondition condition, gpointer data)
{
char *code, *cmd;
int ret = -1;
while (lirc_nextcode (&code) == 0 && code != NULL)
{
ret = 0;
if (config)
{
while (lirc_code2char (config, code, &cmd) == 0 && cmd != NULL)
{
execute_lirc_command(cmd);
}
}
else
... | false | false | false | false | false | 0 |
_make_all_resv(void)
{
struct job_record *job_ptr;
struct step_record *step_ptr;
ListIterator job_iterator, step_iterator;
job_iterator = list_iterator_create(job_list);
while ((job_ptr = (struct job_record *) list_next(job_iterator))) {
step_iterator = list_iterator_create(job_ptr->step_list);
while ((step_p... | false | false | false | false | false | 0 |
model_find_dock_name_index( int modelnum, char *name )
{
int i;
polymodel *pm;
// get model and make sure it has dockpoints
pm = model_get(modelnum);
if ( pm->n_docks <= 0 )
return -1;
// check the generic names and call previous function to find first dock point of
// the specified type
for(i = 0; i < Num_... | false | false | false | false | false | 0 |
cp_fix_function_decl_p (tree decl)
{
/* Skip if DECL is not externally visible. */
if (!TREE_PUBLIC (decl))
return false;
/* We need to fix DECL if it a appears to be exported but with no
function body. Thunks do not have CFGs and we may need to
handle them specially later. */
if (!gimple_has... | false | false | false | false | false | 0 |
myfree(void *p, size_t sz) {
if(p==NULL) return(NULL);
free(p);
mymallocUsed -= sz;
return(NULL);
} | false | false | false | false | false | 0 |
parse_logformat_var(char *arg, int arg_len, char *var, int var_len, struct proxy *curproxy, struct list *list_format, int *defoptions)
{
int j;
struct logformat_node *node;
for (j = 0; logformat_keywords[j].name; j++) { // search a log type
if (strlen(logformat_keywords[j].name) == var_len &&
strncmp(var, l... | false | false | false | false | false | 0 |
ib_set_port_info ( struct ib_device *ibdev, union ib_mad *mad ) {
int rc;
/* Adapters with embedded SMAs do not need to support this method */
if ( ! ibdev->op->set_port_info ) {
DBGC ( ibdev, "IBDEV %p does not support setting port "
"information\n", ibdev );
return -ENOTSUP;
}
if ( ( rc = ibdev->o... | false | false | false | false | false | 0 |
dvb_usb_adapter_dvb_exit(struct dvb_usb_adapter *adap)
{
if (adap->state & DVB_USB_ADAP_STATE_DVB) {
deb_info("unregistering DVB part\n");
dvb_net_release(&adap->dvb_net);
adap->demux.dmx.close(&adap->demux.dmx);
dvb_dmxdev_release(&adap->dmxdev);
dvb_dmx_release(&adap->demux);
dvb_usb_media_device_unregis... | false | false | false | false | false | 0 |
gui_list_scrollbar_handler(
GuiWidget *widget, GuiEvent *event )
{
/* update the listbox */
if ( event->type == GUI_CHANGED )
gui_widget_draw( widget->parent );
/* call event handler */
gui_widget_call_user_event_handler( widget->parent, event );
} | false | false | false | false | false | 0 |
read_ext_cb (GObject *source_object, GAsyncResult *res, gpointer user_data)
{
GVfsAfpConnection *conn = G_VFS_AFP_CONNECTION (source_object);
GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (user_data);
GVfsAfpReply *reply;
GError *err = NULL;
AfpResultCode res_code;
reply = g_vfs_afp_connection_send_c... | false | false | false | false | false | 0 |
readahead(PyFileObject *f, int bufsize)
{
Py_ssize_t chunksize;
if (f->f_buf != NULL) {
if( (f->f_bufend - f->f_bufptr) >= 1)
return 0;
else
drop_readahead(f);
}
if ((f->f_buf = (char *)PyMem_Malloc(bufsize)) == NULL) {
PyErr_NoMemory();
return -1... | false | true | false | false | false | 1 |
Curl_conncache_find_first_connection(struct conncache *connc)
{
struct curl_hash_iterator iter;
struct curl_llist_element *curr;
struct curl_hash_element *he;
struct connectbundle *bundle;
Curl_hash_start_iterate(connc->hash, &iter);
he = Curl_hash_next_element(&iter);
while(he) {
bundle = he->ptr;
... | false | false | false | false | false | 0 |
mavlinkAnnounceHome(void) {
mavlink_msg_gps_global_origin_send(MAVLINK_COMM_0, navData.homeLeg.targetLat*(double)1e7f, navData.homeLeg.targetLon*(double)1e7,
(navData.homeLeg.targetAlt + navData.presAltOffset)*1e3);
// announce ceiling altitude if any
float ca = navData.ceilingAlt;
if (ca)
// convert ... | false | false | false | false | false | 0 |
OTF_Reader_readFileOperation( OTF_RBuffer* buffer,
OTF_HandlerArray* handlers ) {
uint32_t ret= 1;
uint32_t fileid;
uint64_t handleid;
uint32_t operation;
uint64_t bytes;
uint64_t duration;
uint32_t source;
if ( handlers->pointer[OTF_FILEOPERATION_RECORD] == NULL ) {
return OTF_RBuffer_readNewline( buff... | false | false | false | false | false | 0 |
send_message(SERVER_REC *server, const char *target, const char *msg,
int target_type)
{
LmMessage *lmsg;
char *str, *recoded;
char *encrypt_to = NULL;
if (!IS_XMPP_SERVER(server))
return;
g_return_if_fail(target != NULL);
g_return_if_fail(msg != NULL);
if (target_type == SEND_TARGET_CHANNEL) {
recoded ... | true | true | false | false | false | 1 |
startHook(void* arg)
{
//
// Ensure that the thread doesn't go away until run() has
// completed.
//
IceUtil::ThreadPtr thread;
try
{
IceUtil::Thread* rawThread = static_cast<IceUtil::Thread*>(arg);
thread = rawThread;
//
// See the comment in IceUtil::Thread::start() for details.
//... | false | false | false | false | false | 0 |
on_spinbutton_value_changed( SPINBUTTON spinbutton )
{
if ( ! GRIP )
{
before_value = fixed_start ? MIN_SPACE_BEFORE_MB : spinbutton_before .get_value() ;
//Balance the spinbuttons
switch ( spinbutton )
{
case BEFORE :
spinbutton_after .set_value( TOTAL_MB - spinbutton_size .get_value() - before_... | false | false | false | false | false | 0 |
continue_or_pop_level(void)
{if(cur_repl->text_link!=NULL)
{cur_repl=next_sec(cur_repl);
cur_byte=tok_begin(cur_repl);cur_end=tok_end(cur_repl);
}
else if(--stack_ptr> &stack[0])cur_state= *stack_ptr;
ind_i=cur_ind;
} | false | false | false | false | false | 0 |
img_hash_xmit_dma(struct img_hash_dev *hdev, struct scatterlist *sg)
{
struct dma_async_tx_descriptor *desc;
struct img_hash_request_ctx *ctx = ahash_request_ctx(hdev->req);
ctx->dma_ct = dma_map_sg(hdev->dev, sg, 1, DMA_MEM_TO_DEV);
if (ctx->dma_ct == 0) {
dev_err(hdev->dev, "Invalid DMA sg\n");
hdev->err = -... | false | false | false | false | false | 0 |
ctpl_lexer_read_token_tpl (CtplInputStream *stream,
LexerState *state,
GError **error)
{
gint c;
CtplToken *token = NULL;
GError *err = NULL;
/* ensure the first character is a start character */
c = ctpl_input_stream_get_c (str... | false | false | false | false | false | 0 |
qed_get_qm_pq(struct qed_hwfn *p_hwfn,
enum protocol_type proto,
union qed_qm_pq_params *p_params)
{
u16 pq_id = 0;
if ((proto == PROTOCOLID_CORE || proto == PROTOCOLID_ETH) &&
!p_params) {
DP_NOTICE(p_hwfn,
"Protocol %d received NULL PQ params\n",
proto);
return 0;
}
switch (proto) {
... | false | false | false | false | false | 0 |
main(int argc,char *argv[])
{
// turn off slow sync with C-style output (we don't use it anyway).
std::ios::sync_with_stdio(false);
if (argc != 1)
{
cout << "Usage: data" << endl;
cout << " Unit tests for Open Babel data tables " << endl;
return(-1);
}
cout << "# Unit tests for data ... | false | false | false | false | false | 0 |
update_buttons() {
int i; // Looping var
const char *start, // Start of path component
*end; // End of path component
// puts("update_buttons()");
// Set the current font & size...
fl_font(textfont(), textsize());
// Loop through the value string, setting widths...
for (i = 0, start = value... | false | false | false | false | false | 0 |
MatchFinder_Init(CMatchFinder *p)
{
UInt32 i;
for (i = 0; i < p->hashSizeSum; i++)
p->hash[i] = kEmptyHashValue;
p->cyclicBufferPos = 0;
p->buffer = p->bufferBase;
p->pos = p->streamPos = p->cyclicBufferSize;
p->result = SZ_OK;
p->streamEndWasReached = 0;
MatchFinder_ReadBlock(p);
Match... | false | false | false | false | false | 0 |
ipv4ll_announce_timeout(gpointer dhcp_data)
{
GDHCPClient *dhcp_client = dhcp_data;
uint32_t ip;
debug(dhcp_client, "request timeout (retries %d)",
dhcp_client->retry_times);
if (dhcp_client->retry_times != ANNOUNCE_NUM){
dhcp_client->retry_times++;
send_announce_packet(dhcp_client);
return FALSE;
... | false | false | false | false | false | 0 |
stop_typefinding (GstTypeFindElement * typefind)
{
GstState state;
gboolean push_cached_buffers;
gsize avail;
GstBuffer *buffer;
gst_element_get_state (GST_ELEMENT (typefind), &state, NULL, 0);
push_cached_buffers = (state >= GST_STATE_PAUSED && typefind->caps);
GST_DEBUG_OBJECT (typefind, "stopping ty... | false | false | false | false | false | 0 |
gayle_wget (uaecptr addr)
{
int ide_reg;
uae_u16 v;
#ifdef JIT
special_mem |= S_READ;
#endif
if (isa4000t (addr)) {
addr -= NCR_OFFSET;
return (ncr_bget2 (addr) << 8) | ncr_bget2 (addr + 1);
}
ide_reg = get_gayle_ide_reg (addr);
if (ide_reg == IDE_DATA)
return ide_get_data ();
v = gayle_bget (addr) << 8;
... | false | false | false | false | false | 0 |
lookup_commit(const unsigned char *sha1)
{
struct object *obj = lookup_object(sha1);
if (!obj)
return create_object(sha1, OBJ_COMMIT, alloc_commit_node());
if (!obj->type)
obj->type = OBJ_COMMIT;
return check_commit(obj, sha1, 0);
} | false | false | false | false | false | 0 |
pl_readv_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int32_t op_ret, int32_t op_errno,
struct iovec *vector, int32_t count, struct iatt *stbuf,
struct iobref *iobref)
{
STACK_UNWIND_STRICT (readv, frame, op_ret, op_errno,
vector,... | false | false | false | false | false | 0 |
gretl_cmd_clear (CMD *cmd)
{
cmd->ci = 0;
cmd->err = 0;
*cmd->word = '\0';
cmd_unset_nolist(cmd);
if (cmd->list == NULL || cmd->param == NULL || cmd->parm2 == NULL) {
cmd->err = E_ALLOC;
} else {
cmd->list[0] = 0;
*cmd->param = '\0';
*cmd->parm2 = '\0';
}
free(cmd->auxlist);
c... | false | false | false | false | false | 0 |
account_read_config_all(void)
{
GSList *ac_label_list = NULL, *cur;
gchar *rcpath;
FILE *fp;
gchar buf[PREFSBUFSIZE];
PrefsAccount *ac_prefs;
debug_print("Reading all config for each account...\n");
rcpath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, ACCOUNT_RC, NULL);
if ((fp = g_fopen(rcpath, "rb")) == NU... | false | false | false | false | false | 0 |
SkipMatchesSpec(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son,
UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue)
{
CLzRef *ptr0 = son + (_cyclicBufferPos << 1) + 1;
CLzRef *ptr1 = son + (_cyclicBufferPos << 1);
UInt32 len0 = 0, len1 = 0;
for (;;)
{
... | false | false | false | false | false | 0 |
gst_timed_value_control_source_unset (GstTimedValueControlSource * self,
GstClockTime timestamp)
{
GSequenceIter *iter;
gboolean res = FALSE;
g_return_val_if_fail (GST_IS_TIMED_VALUE_CONTROL_SOURCE (self), FALSE);
g_return_val_if_fail (GST_CLOCK_TIME_IS_VALID (timestamp), FALSE);
g_mutex_lock (&self->lo... | false | false | false | false | false | 0 |
free_compressed_color_list(compressed_color_list_t * pcomp_list)
{
int i;
if (pcomp_list == NULL)
return;
/* Discard the sub levels. */
/* Allocation for this object is done in stable memory. Make sure
that is done here too */
for (i = 0; i < pcomp_list->num_sub_level_ptrs; i++) {
... | false | false | false | false | false | 0 |
find_client(Window w)
{
Client *c;
for (c = head_client; c; c = c->next)
if (w == c->parent || w == c->window)
return(c);
return(NULL);
} | false | false | false | false | false | 0 |
src_pad_added_cb (FsStream *stream, GstPad *pad, FsCodec *codec,
gpointer user_data)
{
GstElement *pipeline = GST_ELEMENT_CAST (user_data);
GstElement *sink = NULL;
GError *error = NULL;
GstPad *pad2;
g_print ("Adding receive pipeline\n");
if (g_getenv ("AUDIOSINK"))
sink = gst_parse_bin_from_desc... | false | false | false | false | false | 0 |
LinesSplit(int pixelWidth) {
if (!RangeContainsProtected(targetStart, targetEnd)) {
if (pixelWidth == 0) {
PRectangle rcText = GetTextRectangle();
pixelWidth = rcText.Width();
}
int lineStart = pdoc->LineFromPosition(targetStart);
int lineEnd = pdoc->LineFromPosition(targetEnd);
const char *eol = Strin... | false | false | false | false | false | 0 |
gst_audio_frame_length (GstPad * pad, GstBuffer * buf)
{
/* FIXME: this should be moved closer to the gstreamer core
* and be implemented for every mime type IMO
*/
int frame_byte_size = 0;
frame_byte_size = gst_audio_frame_byte_size (pad);
if (frame_byte_size == 0)
/* error */
return 0;
/* FIX... | false | false | false | false | false | 0 |
vGet8DopInfo(FILE *pFile, const pps_type *pTable,
const ULONG *aulBBD, size_t tBBDLen,
const ULONG *aulSBD, size_t tSBDLen,
const UCHAR *aucHeader)
{
document_block_type tDocument;
UCHAR *aucBuffer;
ULONG ulBeginDocpInfo, ulTmp;
size_t tDocpInfoLen;
USHORT usTmp;
fail(pFile == NULL || pTable == NULL || aucHea... | false | false | false | false | false | 0 |
SetMapFormat(EMITTER_MANIP value)
{
bool ok = false;
if(m_pState->SetFlowType(GT_MAP, value, GLOBAL))
ok = true;
if(m_pState->SetMapKeyFormat(value, GLOBAL))
ok = true;
return ok;
} | false | false | false | false | false | 0 |
gom_info_block(enum gom_info_types std_verb,
int indent, char * text)
{
char line[GOM_INFO_BLOCK_LINE_SIZE];
int i;
char * string = text;
int block_width = GOM_INFO_BLOCK_LINE_SIZE-1-indent;
do
{
/* avoid leading spaces */
while (*string == ' ') string++;
/* indent */
strcpy(line, "");
for (i... | false | false | false | false | true | 1 |
read_stdi(struct v4l2_subdev *sd, struct stdi_readback *stdi)
{
u32 status;
adv7842_g_input_status(sd, &status);
if (status & V4L2_IN_ST_NO_SIGNAL) {
v4l2_dbg(2, debug, sd, "%s: no signal\n", __func__);
return -ENOLINK;
}
stdi->bl = ((cp_read(sd, 0xb1) & 0x3f) << 8) | cp_read(sd, 0xb2);
stdi->lcf = ((cp_rea... | false | false | false | false | false | 0 |
apply_preselect(GtkEditable *editable, const gchar *name, RenamePreselect mode)
{
gpointer dot_ptr;
gulong dot_pos;
switch(mode)
{
case PRESELECT_NONE:
/* Rather unexpectedly, we must do this or else GTK+ selects all. */
gtk_editable_select_region(editable, 0, 0);
break;
case PRESELECT_FULL:
gtk_e... | false | false | false | false | false | 0 |
mv_u3d_resume(struct device *dev)
{
struct mv_u3d *u3d = dev_get_drvdata(dev);
int retval;
if (!u3d->clock_gating) {
retval = mv_u3d_enable(u3d);
if (retval)
return retval;
if (u3d->driver && u3d->softconnect) {
mv_u3d_controller_reset(u3d);
mv_u3d_ep0_reset(u3d);
mv_u3d_controller_start(u3d);
... | false | false | false | false | false | 0 |
type_arrays()
{
if (atom->mass) {
int flag = MASS;
fwrite(&flag,sizeof(int),1,fp);
fwrite(&atom->mass[1],sizeof(double),atom->ntypes,fp);
}
// -1 flag signals end of type arrays
int flag = -1;
fwrite(&flag,sizeof(int),1,fp);
} | false | false | false | false | false | 0 |
udf_link(struct dentry *old_dentry, struct inode *dir,
struct dentry *dentry)
{
struct inode *inode = d_inode(old_dentry);
struct udf_fileident_bh fibh;
struct fileIdentDesc cfi, *fi;
int err;
fi = udf_add_entry(dir, dentry, &fibh, &cfi, &err);
if (!fi) {
return err;
}
cfi.icb.extLength = cpu_to_le32(i... | false | false | false | false | false | 0 |
max8997_haptic_enable(struct max8997_haptic *chip)
{
int error;
mutex_lock(&chip->mutex);
error = max8997_haptic_set_duty_cycle(chip);
if (error) {
dev_err(chip->dev, "set_pwm_cycle failed, error: %d\n", error);
goto out;
}
if (!chip->enabled) {
error = regulator_enable(chip->regulator);
if (error) {
... | false | false | false | false | false | 0 |
gd_styled_text_renderer_add_class (GdStyledTextRenderer *self,
const gchar *class)
{
if (g_list_find_custom (self->priv->style_classes, class, (GCompareFunc) g_strcmp0))
return;
self->priv->style_classes = g_list_append (self->priv->style_classes, g_strdup (class));
} | false | false | false | false | false | 0 |
getOwnPropertySlot(ExecState *exec, const Identifier &propertyName, PropertySlot& slot)
{
#ifdef KJS_VERBOSE
kDebug(6070) << "Plugins::getOwnPropertySlot " << propertyName.qstring();
#endif
if (getStaticOwnPropertySlot<PluginsFunc, Plugins>(&PluginsTable, this, propertyName, slot))
return true;
if (plugins... | false | false | false | false | false | 0 |
valueChanged(qreal value)
{
foreach(KBlocksSvgItem * pItem, mItemList)
{
pItem->setOpacity(value);
}
} | false | false | false | false | false | 0 |
sdma_v2_4_ring_insert_nop(struct amdgpu_ring *ring, uint32_t count)
{
struct amdgpu_sdma_instance *sdma = amdgpu_get_sdma_instance(ring);
int i;
for (i = 0; i < count; i++)
if (sdma && sdma->burst_nop && (i == 0))
amdgpu_ring_write(ring, ring->nop |
SDMA_PKT_NOP_HEADER_COUNT(count - 1));
else
amdgpu_r... | false | false | false | false | false | 0 |
GUISelect(w, closure, x, y, button)
Widget w;
void *closure;
int x, y;
int button;
{
ChimeraGUI wd = (ChimeraGUI)closure;
char *action;
if (wd->wn != NULL)
{
if (button == 1) action = "open";
else if (button == 2) action = "download";
else if (button == 3) action = "external";
else action = "op... | false | false | false | false | false | 0 |
intern_cleanup(void)
{
if (intern_input_malloced) caml_stat_free(intern_input);
if (intern_obj_table != NULL) caml_stat_free(intern_obj_table);
if (intern_extra_block != NULL) {
/* free newly allocated heap chunk */
caml_free_for_heap(intern_extra_block);
} else if (intern_block != 0) {
/* restore o... | false | false | false | false | false | 0 |
realpath_cache_clean(TSRMLS_D) /* {{{ */
{
int i;
for (i = 0; i < sizeof(CWDG(realpath_cache))/sizeof(CWDG(realpath_cache)[0]); i++) {
realpath_cache_bucket *p = CWDG(realpath_cache)[i];
while (p != NULL) {
realpath_cache_bucket *r = p;
p = p->next;
free(r);
}
CWDG(realpath_cache)[i] = NULL;
}
CWD... | false | false | false | false | false | 0 |
qib7322_open ( struct ib_device *ibdev ) {
struct qib7322 *qib7322 = ib_get_drvdata ( ibdev );
struct QIB_7322_IBCCtrlA_0 ibcctrla;
unsigned int port = ( ibdev->port - QIB7322_PORT_BASE );
/* Enable link */
qib7322_readq_port ( qib7322, &ibcctrla,
QIB_7322_IBCCtrlA_0_offset, port );
BIT_SET ( &ibcctrla, ... | false | false | false | false | false | 0 |
update_average(
double now,
double work_start_time, // when new work was started
// (or zero if no new work)
double work, // amount of new work
double half_life,
double& avg, // average work per day (in and out)
doub... | false | false | false | false | false | 0 |
mpxdied(MPX *m)
{
if (!--nmpx)
mpxend();
while (wait(NULL) < 0 && errno == EINTR)
/* do nothing */;
if (m->die)
m->die(m->dieobj);
m->func = NULL;
edupd(1);
} | false | false | false | false | false | 0 |
split_by_place(double *place, int *nodes, int first, int last, int *middle)
{
unsigned int splitter=((unsigned int)rand()|((unsigned int)rand())<<16)%(unsigned int)(last-first+1)+(unsigned int)first;
int val;
double place_val;
int left = first + 1;
int right = last;
int temp;
val = nodes[sp... | false | false | false | false | false | 0 |
updateEventMask()
{
static int event_mask;
XWindowAttributes attr;
gtk_widget_realize(border);
if (!enabled())
{
XGetWindowAttributes(gdk_display, GDK_WINDOW_XID(border->window), &attr);
event_mask = attr.your_event_mask;
XSelectInput(gdk_display, GDK_WINDOW_XID(border->window), ExposureMask);
}
else
... | false | false | false | false | false | 0 |
jshPushIOWatchEvent(IOEventFlags channel) {
bool state = jshGetWatchedPinState(channel);
if (jshEventCallbacks[channel-EV_EXTI0]) {
jshEventCallbacks[channel-EV_EXTI0](state);
return;
}
JsSysTime time = jshGetSystemTime();
#ifdef USE_TRIGGER
// TODO: move to using jshSetEventCallback
if (trigHand... | false | false | false | false | false | 0 |
doc_ecc_bch_fix_data(struct docg3 *docg3, void *buf, u8 *hwecc)
{
u8 ecc[DOC_ECC_BCH_SIZE];
int errorpos[DOC_ECC_BCH_T], i, numerrs;
for (i = 0; i < DOC_ECC_BCH_SIZE; i++)
ecc[i] = bitrev8(hwecc[i]);
numerrs = decode_bch(docg3->cascade->bch, NULL,
DOC_ECC_BCH_COVERED_BYTES,
NULL, ecc, NULL, error... | false | false | false | false | false | 0 |
make(CdlNode node_arg, std::string name_arg, std::string value_arg, int argc_arg, const char* argv_arg[],
std::vector<std::pair<std::string,std::string> >& options_arg)
{
return new CdlProperty_StringBody(node_arg, name_arg, value_arg, argc_arg, argv_arg, options_arg);
} | false | false | false | false | false | 0 |
e_sys_con_extra_action_unregister(E_Sys_Con_Action *sca)
{
extra_actions = eina_list_remove(extra_actions, sca);
if (sca->label) eina_stringshare_del(sca->label);
if (sca->icon_group) eina_stringshare_del(sca->icon_group);
if (sca->button_name) eina_stringshare_del(sca->button_name);
free(sca);
} | false | false | false | false | false | 0 |
setup_alarm(int fd, time_t *wakeup, time_t rtc_time)
{
struct tm *ptm;
struct linux_rtc_wkalrm wake;
/* The wakeup time is in POSIX time (more or less UTC).
* Ideally RTCs use that same time; but PCs can't do that
* if they need to boot MS-Windows. Messy...
*
* When running in utc mode this process's timez... | false | false | false | false | false | 0 |
StatusChanged(std::string PackageName,
unsigned int StepsDone,
unsigned int TotalSteps,
std::string HumanReadableAction)
{
if (!PackageManager::StatusChanged(PackageName, StepsDone, TotalSteps,
... | false | false | false | false | true | 1 |
selfinfo(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx,
aim_modsnac_t *snac, aim_bstream_t *bs)
{
int ret = 0;
aim_rxcallback_t userfunc;
aim_userinfo_t userinfo;
aim_info_extract(sess, bs, &userinfo);
if ((userfunc = aim_callhandler(sess, rx->conn, snac->family,
snac->subtype)))
ret = userfunc(... | 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.