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 |
|---|---|---|---|---|---|---|
py_gc_bonus_display(PyObject* self, PyObject* args)
{
int gamewon;
int bonus_id;
/* Parse arguments */
if(!PyArg_ParseTuple(args, "ii:gc_bonus_display", &gamewon, &bonus_id))
return NULL;
/* Call the corresponding C function */
gc_bonus_display(gamewon, bonus_id);
/* Create and return the result */
... | false | false | false | false | false | 0 |
agmtlist_delete_callback(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *entryAfter,
int *returncode, char *returntext, void *arg)
{
Repl_Agmt *ra;
Object *ro;
slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "agmt_delete: begin\n");
ro = objset_find(agmt_set, agmt_dn_cmp, (const void *)slapi_entry_get_sdn_const... | false | false | false | false | false | 0 |
tolua_isnumberarray
(lua_State* L, int lo, int dim, int def, tolua_Error* err)
{
if (!tolua_istable(L,lo,def,err))
return 0;
else
{
int i;
for (i=1; i<=dim; ++i)
{
lua_pushnumber(L,i);
lua_gettable(L,lo);
if (!lua_isnumber(L,-1) &&
!(def && lua_isnil(L,-1))
)
{
err->index = lo;
... | false | false | false | false | false | 0 |
Print_filename(void)
{
word max_size;
word string_size;
char display_string[256];
// Determine maximum size, in characters
max_size = 12 + (Screen_width / Menu_factor_X - 320) / 8;
string_size = strlen(Main_backups->Pages->Filename);
// Partial copy of the name
strncpy(display_string, Main_backup... | false | false | false | false | false | 0 |
gog_chart_set_property (GObject *obj, guint param_id,
GValue const *value, GParamSpec *pspec)
{
GogChart *chart = GOG_CHART (obj);
char **str_doubles;
char const *str;
gboolean changed = FALSE;
switch (param_id) {
case CHART_PROP_PLOT_AREA:
str = g_value_get_string (value);
str_doubles = g_strsplit (str,... | false | false | false | false | false | 0 |
maple(MapleStream & os) const
{
if (nuc().size())
os << nuc();
if (hasDown() && down().size())
os << '[' << down() << ']';
if (hasUp() && up().size())
os << "^(" << up() << ')';
} | false | false | false | false | false | 0 |
exec_wait_kill_children (List exec_wait_list)
{
int rc = 0;
int count;
struct exec_wait_info *e;
ListIterator i;
if ((count = list_count (exec_wait_list)) == 0)
return (0);
verbose ("Killing %d remaining child%s",
count, (count > 1 ? "ren" : ""));
i = list_iterator_create (exec_wait_list);
if (i == NULL... | false | false | false | false | false | 0 |
rhash_gost_update(gost_ctx *ctx, const unsigned char* msg, size_t size)
{
unsigned index = (unsigned)ctx->length & 31;
ctx->length += size;
/* fill partial block */
if(index) {
unsigned left = gost_block_size - index;
memcpy(ctx->message + index, msg, (size < left ? size : left));
if(size < left) return;
... | false | true | false | false | false | 1 |
copy_string15(unpack_data_t *unpack_data, unsigned int distance,
unsigned int length)
{
unpack_data->dest_unp_size -= length;
while (length--) {
unpack_data->window[unpack_data->unp_ptr] =
unpack_data->window[(unpack_data->unp_ptr - distance) & MAXWINMASK];
unpack_data->unp_ptr = (unpack_data->unp_ptr + 1)... | false | false | false | false | false | 0 |
outblank()
{
/* note that we've displayed something */
outcnt = 1;
/* check to see if we're hiding output */
if (out_is_hidden())
return;
/* generate the newline to the standard display */
outblank_stream(&G_std_disp);
/* if we're logging, generate the newline to the l... | false | false | false | false | false | 0 |
SetPlotData(const wxPlotData& plotData)
{
s_clipboardwxPlotData_data = wxNow();
SetText(s_clipboardwxPlotData_data);
if (plotData.Ok())
s_clipboardwxPlotData.Copy(plotData, true);
else
s_clipboardwxPlotData.Destroy();
} | false | false | false | false | false | 0 |
ownership_strings_func (NautilusFileUndoInfo *info,
gchar **undo_label,
gchar **undo_description,
gchar **redo_label,
gchar **redo_description)
{
NautilusFileUndoInfoOwnership *self = NAUTILUS_FILE_UNDO_INFO_OWNERSHIP (info);
NautilusFileUndoOp op_type = nautilus_file_undo_info_get_op_type (info);
gchar ... | false | false | false | false | false | 0 |
getAllNonCoreParts() {
QList<ModelPart*> retval;
QList<QObject *>::const_iterator i;
for (i = children().constBegin(); i != children().constEnd(); ++i) {
ModelPart* mp = qobject_cast<ModelPart *>(*i);
if (mp == NULL) continue;
if(!mp->isCore()) {
retval << mp;
}
}
return retval;
} | false | false | false | false | false | 0 |
m_expand_body (const SCM forms, const SCM env)
{
/* The first body form can be skipped since it is known to be the ISYM that
* was prepended to the body by m_body. */
SCM cdr_forms = SCM_CDR (forms);
SCM form_idx = cdr_forms;
SCM definitions = SCM_EOL;
SCM sequence = SCM_EOL;
/* According to R5RS, the ... | false | false | false | false | false | 0 |
add_cut(int apos, int bpos, int move)
{
gg_assert(board[apos] == board[bpos]);
if (num_cuts == MAX_CUTS)
return;
if (apos > bpos) {
int tmp = apos;
apos = bpos;
bpos = tmp;
}
if (move == NO_MOVE)
return;
cut_list[num_cuts].apos = apos;
cut_list[num_cuts].bpos = bpos;
cut_list[num_cut... | false | false | false | false | false | 0 |
_tnl_get_attr( struct gl_context *ctx, const void *vin,
GLenum attr, GLfloat *dest )
{
struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
const struct tnl_clipspace_attr *a = vtx->attr;
const GLuint attr_count = vtx->attr_count;
GLuint j;
for (j = 0; j < attr_count; j++) {
if (a[j].attrib... | false | false | false | false | false | 0 |
gf_isom_has_sync_shadows(GF_ISOFile *the_file, u32 trackNumber)
{
GF_TrackBox *trak = gf_isom_get_track_from_file(the_file, trackNumber);
if (!trak) return 0;
if (!trak->Media->information->sampleTable->ShadowSync) return 0;
if (gf_list_count(trak->Media->information->sampleTable->ShadowSync->entries) ) return 1;
... | false | false | false | false | false | 0 |
gfs_simulation_set_timestep (GfsSimulation * sim)
{
gdouble t, cfl;
g_return_if_fail (sim != NULL);
t = sim->time.t;
if ((cfl = min_cfl (sim)) < G_MAXDOUBLE)
sim->advection_params.dt = cfl*(* GFS_SIMULATION_CLASS (GTS_OBJECT (sim)->klass)->cfl) (sim);
else
sim->advection_params.dt = G_MAXINT;
if (... | false | false | false | false | false | 0 |
Cblacs_gridmap(int *ConTxt, int *umap, int ldumap, int nprow, int npcol) {
int i, j, np_me, npall, npwho, myrow, mycol, color, key, rv;
MPI_Comm comm, newComm, rowComm, colComm;
if (CblacsGridNew( nprow, npcol, ConTxt, &comm )) {
CblacsWarn();
goto gmapErr;
}
Cblacs_pinfo( &np_me, &npall );
myrow... | false | false | false | false | false | 0 |
vty_kill_line(vty_t *vty)
{
int i, size;
size = vty->length - vty->cp;
if (size == 0)
return;
for (i = 0; i < size; i++)
vty_write(vty, &telnet_space_char, 1);
for (i = 0; i < size; i++)
vty_write(vty, &telnet_backward_char, 1);
memset (&vty->buf[vty->cp], 0, size);
vty->length = vty->cp;
} | false | false | false | false | false | 0 |
zxid_wsc_prepare_call(zxid_conf* cf, zxid_ses* ses, zxid_epr* epr, const char* az_cred, const char* enve)
{
struct zx_str* ret;
struct zx_e_Envelope_s* env;
if (!cf || !ses || !enve) {
ERR("Missing mandatory arguments ses=%p (programmer error)", ses);
return 0;
}
D_INDENT("prep: ");
env = zxid_add_... | false | false | false | false | false | 0 |
qsfp_2_read(struct file *file, char __user *buf,
size_t count, loff_t *ppos)
{
struct qib_devdata *dd = private2dd(file);
char *tmp;
int ret;
if (dd->num_pports < 2)
return -ENODEV;
tmp = kmalloc(PAGE_SIZE, GFP_KERNEL);
if (!tmp)
return -ENOMEM;
ret = qib_qsfp_dump(dd->pport + 1, tmp, PAGE_SIZE);
i... | false | false | false | false | false | 0 |
HandleLearnAllRecipesCommand(char* args)
{
// Learns all recipes of specified profession and sets skill to max
// Example: .learn all_recipes enchanting
Player* target = getSelectedPlayer();
if (!target)
{
SendSysMessage(LANG_PLAYER_NOT_FOUND);
return false;
}
if (!*args)... | false | false | false | false | false | 0 |
toPrimitive(ExecState *exec, JSType) const
{
if (m_frame) {
Window* window = Window::retrieveWindow( m_frame->m_part );
if ( window && window->isSafeScript(exec) )
return jsString(toString(exec));
}
return jsUndefined();
} | false | false | false | false | false | 0 |
migrate_parse_gconf_xml_end_element (GMarkupParseContext *context,
const gchar *element_name,
gpointer user_data,
GError **error)
{
ParseData *parse_data = user_data;
if (g_strcmp0 (element_name, "gconf") =... | false | false | false | false | false | 0 |
didl_res_get_protocol_info (xmlNode* res_node, gint field)
{
gchar* pinfo;
gchar* value;
gchar** array;
pinfo = (gchar *) xmlGetProp (res_node, (const xmlChar *) "protocolInfo");
if (pinfo == NULL) {
return NULL;
}
/* 0:protocol, 1:network, 2:mime-type and 3:additional info. */
array = g_strsplit ... | false | false | false | false | false | 0 |
force_range_for_rox (const char *var, wordsizes size)
{
/* Could do a modulo operation here... which one is faster? */
switch (size) {
case sz_long:
printf ("\tif (%s >= 33) %s -= 33;\n", var, var);
break;
case sz_word:
printf ("\tif (%s >= 34) %s -= 34;\n", var, var);
printf ("\tif (%s >= 17) %s ... | false | false | false | false | false | 0 |
setCellElement(const int p_row, const int p_column, Element * p_element) {
if (p_row < 0 || p_row >= m_nbRows || p_column < 0 || p_column >= m_nbColumns) {
kError() << "Bad maze coordinates";
}
m_cells[p_row][p_column].setElement(p_element);
if (p_element != NULL) {
m_totalNbElem++;
m_nbElem++;
}
} | false | false | false | false | false | 0 |
isunsuccessfulalignment(GthSA *sa,
bool comments,
GtFile *outfp)
{
if (gth_sa_score(sa) <= UNSUCCESSFULALIGNMENTSCORE) {
if (comments)
gt_file_xprintf(outfp, "%c discard alignment\n", COMMENTCHAR);
return true;
}
return false;
} | false | false | false | false | false | 0 |
write_marker_address(uchar *p, int size,
int zmachine_area, int32 offset, int32 value)
{
/* Similar, but to write to it. */
int32 addr = 0;
switch(zmachine_area)
{
case DYNAMIC_ARRAY_ZA:
addr = m_vars_offset; break;
case ZCODE_ZA... | false | false | false | false | false | 0 |
options_remain() const {
bool remain = false;
ShortOptions::const_iterator it = _shortOps.begin();
while (it != _shortOps.end() && !remain) {
remain = (it->second.flags == OptionData::CmdLine_NotExtracted);
++it;
}
if (!remain) {
LongOptions::const_iterator it2 = _longOps.begin();
while (it2 ... | false | false | false | false | false | 0 |
ossl_ec_group_to_text(VALUE self)
{
EC_GROUP *group;
BIO *out;
VALUE str;
Require_EC_GROUP(self, group);
if (!(out = BIO_new(BIO_s_mem()))) {
ossl_raise(eEC_GROUP, "BIO_new(BIO_s_mem())");
}
if (!ECPKParameters_print(out, group, 0)) {
BIO_free(out);
ossl_raise(eEC_GROUP, NULL);
}
... | false | false | false | false | false | 0 |
b2n_lshift(b2n_ptr d, b2n_ptr n, unsigned int s)
{
int i, maj, min, chunks;
u_int16_t bits = b2n_sigbit(n), add;
CHUNK_TYPE *p, *op;
if (!s)
return b2n_set(d, n);
maj = s >> CHUNK_SHIFTS;
min = s & CHUNK_MASK;
add = (!(bits & CHUNK_MASK) ||
((bits & CHUNK_MASK) + min) > CHUNK_MASK... | false | false | false | false | false | 0 |
getvalue(struct magic_set *ms, struct magic *m, const char **p, int action)
{
switch (m->type) {
case FILE_BESTRING16:
case FILE_LESTRING16:
case FILE_STRING:
case FILE_PSTRING:
case FILE_REGEX:
case FILE_SEARCH:
*p = getstr(ms, m, *p, action == FILE_COMPILE);
if (*p == NULL) {
if (ms->flags & MAGIC_CHECK... | false | false | false | false | false | 0 |
progress_dialog_task_progress_cb (GthTask *task,
const char *description,
const char *details,
gboolean pulse,
double fraction,
gpointer user_data)
{
GthProgressDialog *self = user_data;
GString *title;
/* set the task description as dialog title if the main win... | false | false | false | false | false | 0 |
interval_initial_state (TestConformSimpleFixture *fixture G_GNUC_UNUSED,
gconstpointer dummy G_GNUC_UNUSED)
{
ClutterInterval *interval;
int initial, final;
const GValue *value;
interval = clutter_interval_new (G_TYPE_INT, 0, 100);
g_assert (CLUTTER_IS_INTERVAL (interval));
g_assert... | false | false | false | false | false | 0 |
slotOk()
{
if (mNameEdit->text().isEmpty()) {
KMessageBox::error(this, i18n("Please put in a name."));
//return;
reject(); // FIXME - huh? return should work here but it accept()s!
}
QString language = m_languages.value(mLanguageCombo->currentText());
Author author;
author.... | false | false | false | false | false | 0 |
mboxlist_read(const char *name, const char **dataptr, int *datalenptr,
struct txn **tid, int wrlock)
{
int namelen = strlen(name);
int r;
if (namelen == 0) {
return IMAP_MAILBOX_NONEXISTENT;
}
if (wrlock) {
r = DB->fetchlock(mbdb, name, namelen, dataptr, datalenptr, tid);
} else {
r = DB... | false | false | false | false | false | 0 |
Terminate(int sd)
{ char buffer[CF_BUFSIZE];
memset(buffer,0,CF_BUFSIZE);
strcpy(buffer,CFD_TERMINATOR);
if (SendTransaction(sd,buffer,strlen(buffer)+1,CF_DONE) == -1)
{
CfOut(cf_verbose,"send","Unable to reply with terminator");
CfOut(cf_verbose,"","Unable to reply with terminator...\n");
}
} | true | true | false | false | false | 1 |
parse_php_error(logerror *err, lineparser *p) {
lineparser_skip_past(p, "PHP ");
char *typestring = lineparser_read_until(p, ":");
if ( strcmp(typestring, "Catchable fatal error") == 0
|| strcmp(typestring, "Fatal error") == 0)
{
err->type = E_ERROR;
} else if (strcmp(typestring, "Parse error"... | false | false | false | false | false | 0 |
Perl_pad_leavemy(pTHX)
{
dVAR;
I32 off;
OP *o = NULL;
SV * const * const svp = AvARRAY(PL_comppad_name);
PL_pad_reset_pending = FALSE;
ASSERT_CURPAD_ACTIVE("pad_leavemy");
if (PL_min_intro_pending && PL_comppad_name_fill < PL_min_intro_pending) {
for (off = PL_max_intro_pending; off >= PL... | false | false | false | true | false | 1 |
lcd_probe(struct usb_interface *interface,
const struct usb_device_id *id)
{
struct usb_lcd *dev = NULL;
struct usb_host_interface *iface_desc;
struct usb_endpoint_descriptor *endpoint;
size_t buffer_size;
int i;
int retval = -ENOMEM;
/* allocate memory for our device state and initialize it */
dev = kz... | false | false | false | false | false | 0 |
__ibv_ack_async_event_1_0(struct ibv_async_event *event)
{
struct ibv_async_event real_event = *event;
switch (event->event_type) {
case IBV_EVENT_CQ_ERR:
real_event.element.cq =
((struct ibv_cq_1_0 *) event->element.cq)->real_cq;
break;
case IBV_EVENT_QP_FATAL:
case IBV_EVENT_QP_REQ_ERR:
case IBV_EVENT_... | false | false | false | false | false | 0 |
simple_cs_is_full(CHARSET_INFO *cs)
{
return ((cs->csname && cs->tab_to_uni && cs->ctype && cs->to_upper &&
cs->to_lower) &&
(cs->number && cs->name &&
(cs->sort_order || (cs->state & MY_CS_BINSORT) )));
} | false | false | false | false | false | 0 |
interfaces_setup_multicast(struct lldpd *cfg, const char *name,
int remove)
{
int i, rc;
for (i=0; cfg->g_protocols[i].mode != 0; i++) {
if (!cfg->g_protocols[i].enabled) continue;
if ((rc = priv_iface_multicast(name,
cfg->g_protocols[i].mac, !remove)) != 0) {
errno = rc;
if (errno != ENOENT)
... | false | false | false | false | false | 0 |
labviewer_do_render(float frametime)
{
int w, h;
if ( (Lab_model_num < 0) && (Lab_bitmap_id < 0) ) {
gr_get_string_size(&w, &h, "Viewer off");
gr_set_color_fast(&Color_white);
gr_string(gr_screen.clip_right - w, gr_screen.clip_bottom - h, "Viewer off", false);
return;
}
// render our particular thing
if... | false | false | false | false | false | 0 |
smb347_start_stop_charging(struct smb347_charger *smb)
{
int ret;
/*
* Depending on whether valid power source is connected or not, we
* disable or enable the charging. We do it manually because it
* depends on how the platform has configured the valid inputs.
*/
if (smb347_is_ps_online(smb)) {
ret = smb3... | false | false | false | false | false | 0 |
exo_icon_view_unselect_all_internal (ExoIconView *icon_view)
{
ExoIconViewItem *item;
gboolean dirty = FALSE;
GList *lp;
if (G_LIKELY (icon_view->priv->selection_mode != GTK_SELECTION_NONE))
{
for (lp = icon_view->priv->items; lp != NULL; lp = lp->next)
{
item = E... | false | false | false | false | false | 0 |
cma_listen_on_all(struct rdma_id_private *id_priv)
{
struct cma_device *cma_dev;
mutex_lock(&lock);
list_add_tail(&id_priv->list, &listen_any_list);
list_for_each_entry(cma_dev, &dev_list, list)
cma_listen_on_dev(id_priv, cma_dev);
mutex_unlock(&lock);
} | false | false | false | false | false | 0 |
putBack(const char * const string)
{
int n = strlen(string);
if (n <= readbufIndex && backBufIndex < 0)
readbufIndex -= n;
else {
for (int i = n - 1; i >= 0; i--)
backBuf[++backBufIndex] = string[i];
}
} | false | false | false | false | false | 0 |
pinCodePoint(UChar32& c) {
if (c < UNICODESET_LOW) {
c = UNICODESET_LOW;
} else if (c > (UNICODESET_HIGH-1)) {
c = (UNICODESET_HIGH-1);
}
return c;
} | false | false | false | false | false | 0 |
gudev_remove_device (GMtpVolumeMonitor *monitor, GUdevDevice *device)
{
GList *l, *ll;
const gchar* sysfs_path;
sysfs_path = g_udev_device_get_sysfs_path (device);
g_debug ("gudev_remove_device: %s", g_udev_device_get_device_file (device));
for (l = monitor->device_volumes; l != NULL; l = ll) {
GMtpVol... | false | false | false | false | false | 0 |
nma_bt_device_new (const char *bdaddr,
const char *alias,
const char *object_path,
gboolean has_pan,
gboolean has_dun)
{
NmaBtDevice *self;
GError *error = NULL;
g_return_val_if_fail (bdaddr != NULL, NULL);
g_return_val_if_fail (object_pat... | false | false | false | false | false | 0 |
AlphaPaletteSplit(CxImage *dest)
{
if (!AlphaPaletteIsValid() || !dest) return false;
CxImage tmp(head.biWidth,head.biHeight,8);
if (!tmp.IsValid()){
strcpy(info.szLastError,tmp.GetLastError());
return false;
}
for(long y=0; y<head.biHeight; y++){
for(long x=0; x<head.biWidth; x++){
tmp.BlindSetPixelInd... | false | false | false | false | false | 0 |
draw_at(int absBaseX, int absBaseY)
{
int absX1 = absBaseX - bitmap_width/2;
int absY1 = absBaseY - bitmap_height;
int absX2 = absX1 + bitmap_width - 1;
int absY2 = absY1 + bitmap_height - 1;
//-------- check if the firm is within the view area --------//
int x1 = absX1 - World::view_top_x;
if( x1 <= -bitmap... | false | false | false | false | false | 0 |
minolta_naval(struct exifprop *props, struct exiftag *tags, int16_t tag)
{
struct exifprop *prop;
const char *na = "n/a";
if (!(prop = findprop(props, tags, tag)))
return;
free(prop->str);
prop->str = NULL;
exifstralloc(&prop->str, strlen(na) + 1);
strcpy(prop->str, na);
if (!(prop->lvl & ED_UNK))
prop->l... | false | true | false | false | false | 1 |
key_press_event(GtkWidget *text_view, GdkEventKey *event)
{
GtkTextIter iter;
GtkTextBuffer *buffer;
switch (event->keyval) {
case GDK_Return:
case GDK_KP_Enter:
buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text_view));
gtk_text_buffer_get_iter_at_mark(buffer, &iter,
gtk_text_buffer_get_insert(buffer)... | false | false | false | false | false | 0 |
removeRows(int row, int count, const QModelIndex &parent)
{
if (parent.isValid())
return false;
int lastRow = row + count - 1;
for (int i = lastRow; i >= row; --i) {
if (m_downloadManager->m_downloads.at(i)->downloadedSuccessfully()
|| m_downloadManager->m_downloads.at(i)->tryAg... | false | false | false | false | false | 0 |
ipv6_active_pkt(pkt, len)
u_char *pkt;
int len;
{
u_char *tcp;
len -= PPP_HDRLEN;
pkt += PPP_HDRLEN;
if (len < IP6_HDRLEN)
return 0;
if (get_ip6nh(pkt) == IP6_NHDR_FRAG)
return 0;
if (get_ip6nh(pkt) != IPPROTO_TCP)
return 1;
if (len < IP6_HDRLEN + TCP_HDRLEN)
return 0;
tcp =... | false | false | false | false | false | 0 |
recv_req(s, req)
int s;
struct sockd_request_t *req;
{
const char *function = "recv_req()";
int fdexpect, fdreceived, r;
struct iovec iovec[1];
struct msghdr msg;
CMSG_AALLOC(cmsg, sizeof(int));
iovec[0].iov_base = req;
iovec[0].iov_len = sizeof(*req);
msg.msg_iov = iovec;
msg.msg_iovlen = ELEMENTS(... | false | false | false | false | false | 0 |
_compare_entry_fuzzy(const TabEntry *a, const TabEntry *b) {
const gchar *ka, *kb;
ka = a->name_fuzzy_sortkey ? a->name_fuzzy_sortkey : a->name_sortkey;
kb = b->name_fuzzy_sortkey ? b->name_fuzzy_sortkey : b->name_sortkey;
return strcmp(ka, kb);
} | false | false | false | false | false | 0 |
confhelp(const char * cmd, FILE* stream, const char * devtype)
{
char ** typelist;
char ** this;
Stonith * s;
int devfound = 0;
/* non-NULL devtype indicates help for specific device, so no header */
if (devtype == NULL) {
fprintf(stream
, "\nSTONITH -t device types and"
" associated configuration... | false | false | false | false | false | 0 |
Exif2tm(struct tm * timeptr, char * ExifTime)
{
int a;
timeptr->tm_wday = -1;
// Check for format: YYYY:MM:DD HH:MM:SS format.
// Date and time normally separated by a space, but also seen a ':' there, so
// skip the middle space with '%*c' so it can be any character.
timeptr->tm_sec = 0;
... | false | false | false | false | false | 0 |
m920x_init(struct dvb_usb_device *d, struct m920x_inits *rc_seq)
{
int ret, i, epi, flags = 0;
int adap_enabled[M9206_MAX_ADAPTERS] = { 0 };
/* Remote controller init. */
if (d->props.rc.legacy.rc_query || d->props.rc.core.rc_query) {
deb("Initialising remote control\n");
ret = m920x_write_seq(d->udev, M9206_C... | false | false | false | false | false | 0 |
occurs_in(struct term *t1,
struct term *t2)
{
struct rel *r;
if (term_ident(t1, t2))
return(1);
else if (t2->type != COMPLEX)
return(0);
else {
r = t2->farg;
while (r && occurs_in(t1, r->argval) == 0)
r = r->narg;
return(r != NULL);
}
} | false | false | false | false | false | 0 |
gth_image_navigator_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
{
GthImageNavigator *self = (GthImageNavigator *) widget;
gboolean hscrollbar_visible;
gboolean vscrollbar_visible;
GtkAllocation viewer_allocation;
gtk_widget_set_allocation (widget, allocation);
... | false | false | false | false | false | 0 |
DeleteSubcommandResult(int prevResult)
{
LogMessage(Debug_Verbose, _T("CFtpControlSocket::DeleteSubcommandResult()"));
if (!m_pCurOpData)
{
LogMessage(__TFILE__, __LINE__, this, Debug_Info, _T("Empty m_pCurOpData"));
ResetOperation(FZ_REPLY_INTERNALERROR);
return FZ_REPLY_ERROR;
}
CFtpDeleteOpData *pData =... | false | false | false | false | false | 0 |
dvb_media_server2_device_groups_media_container2_on_device_removed (DVBMediaServer2DeviceGroupsMediaContainer2* self, guint group_id) {
GeeHashMap* _tmp0_ = NULL;
guint _tmp1_ = 0U;
g_return_if_fail (self != NULL);
_tmp0_ = self->priv->containers;
_tmp1_ = group_id;
gee_abstract_map_unset ((GeeAbstractMap*) _tmp0... | false | false | false | false | false | 0 |
seqTypeTestI(AjPSeq thys, ajint itype)
{
/*
** We have a known type, now we need to either show the sequence
** matches it, or fix it so it does (or, of course, give up)
*/
/*
** First we test the type - predefined by a database,
** or by checking the sequence characters
*/
... | false | false | false | false | false | 0 |
avahi_string_list_length(const AvahiStringList *l) {
unsigned n = 0;
for (; l; l = l->next)
n++;
return n;
} | false | true | false | false | true | 1 |
GS_setlight_position(int num, float xpos, float ypos, float zpos,
int local)
{
if (num) {
num -= 1;
if (num < Numlights) {
Gv.lights[num].position[X] = xpos;
Gv.lights[num].position[Y] = ypos;
Gv.lights[num].position[Z] = zpos;
Gv.lights[num].position[W] = (float)local;
gsd_deflight... | false | false | false | false | false | 0 |
printOptionInfo(const Option &O,
size_t GlobalWidth) const {
outs() << " -" << O.ArgStr;
if (const char *ValName = getValueName())
outs() << "=<" << getValueStr(O, ValName) << '>';
printHelpStr(O.HelpStr, GlobalWidth, getOptionWidth(O));
} | false | false | false | false | false | 0 |
iommu_flush_irt_all(struct amd_iommu *iommu)
{
u32 devid;
for (devid = 0; devid <= MAX_DEV_TABLE_ENTRIES; devid++)
iommu_flush_irt(iommu, devid);
iommu_completion_wait(iommu);
} | false | false | false | false | false | 0 |
alloc_nic_library_handle()
{
nic_lib_handle_t *handle;
handle = malloc(sizeof(*handle));
if (handle == NULL) {
LOG_ERR("Could not allocate memory for library handle");
return NULL;
}
memset(handle, 0, sizeof(*handle));
handle->ops = NULL;
pthread_mutex_init(&handle->mutex, NULL);
return handle;
} | false | false | false | false | false | 0 |
mt9t031_runtime_resume(struct device *dev)
{
struct video_device *vdev = to_video_device(dev);
struct v4l2_subdev *sd = soc_camera_vdev_to_subdev(vdev);
struct i2c_client *client = v4l2_get_subdevdata(sd);
struct mt9t031 *mt9t031 = to_mt9t031(client);
int ret;
u16 xbin, ybin;
xbin = min(mt9t031->xskip, (u16)3)... | false | false | false | false | false | 0 |
hasLoadListener(SVGElement* node)
{
Node* currentNode = node;
while (currentNode && currentNode->isElementNode()) {
QList<RegisteredEventListener> *list = static_cast<Element*>(currentNode)->localEventListeners();
if (list) {
QList<RegisteredEventListener>::Iterator end = list->end()... | false | false | false | false | false | 0 |
date_interval_write_property(zval *object, zval *member, zval *value TSRMLS_DC)
{
php_interval_obj *obj;
zval tmp_member, tmp_value;
if (member->type != IS_STRING) {
tmp_member = *member;
zval_copy_ctor(&tmp_member);
convert_to_string(&tmp_member);
member = &tmp_member;
}
obj = (php_interval_obj *)zend_... | false | false | false | false | false | 0 |
uv__work_cancel(uv_loop_t* loop, uv_req_t* req, struct uv__work* w) {
int cancelled;
uv_mutex_lock(&mutex);
uv_mutex_lock(&w->loop->wq_mutex);
cancelled = !ngx_queue_empty(&w->wq) && w->work != NULL;
if (cancelled)
ngx_queue_remove(&w->wq);
uv_mutex_unlock(&w->loop->wq_mutex);
uv_mutex_unlock(&mute... | false | false | false | false | false | 0 |
KfwumMain(struct ipmi_intf * intf, tKFWUM_Task task)
{
tKFWUM_Status status = KFWUM_STATUS_OK;
tKFWUM_BoardInfo boardInfo;
tKFWUM_InFirmwareInfo firmInfo = { 0 };
unsigned long fileSize = 0;
static unsigned short padding;
if((status == KFWUM_STATUS_OK) && (task == KFWUM_TASK_INFO))
{
... | false | false | false | false | false | 0 |
gst_rtp_sbc_pay_flush_buffers (GstRtpSBCPay * sbcpay)
{
GstRTPBuffer rtp = GST_RTP_BUFFER_INIT;
guint available;
guint max_payload;
GstBuffer *outbuf;
guint8 *payload_data;
guint frame_count;
guint payload_length;
struct rtp_payload *payload;
if (sbcpay->frame_length == 0) {
GST_ERROR_OBJECT (sbc... | false | false | false | false | false | 0 |
getValueProperty(ExecState *, int token) const
{
DOM::EntityImpl& entity = *static_cast<DOM::EntityImpl*>(m_impl.get());
switch (token) {
case PublicId:
return jsString(entity.publicId());
case SystemId:
return jsString(entity.systemId());
case NotationName:
return jsString(entity.notationName());... | false | false | false | false | false | 0 |
IsLocal() const
{
if( GetRoot() == NULL )
return FALSE;
return EQUAL(GetRoot()->GetValue(),"LOCAL_CS");
} | false | false | false | false | false | 0 |
move_block_to_reg (int regno, rtx x, int nregs, enum machine_mode mode)
{
int i;
#ifdef HAVE_load_multiple
rtx pat;
rtx last;
#endif
if (nregs == 0)
return;
if (CONSTANT_P (x) && ! LEGITIMATE_CONSTANT_P (x))
x = validize_mem (force_const_mem (mode, x));
/* See if the machine can do this with a lo... | false | false | false | false | false | 0 |
gl646_init_regs_for_shading (Genesys_Device * dev)
{
SANE_Status status = SANE_STATUS_GOOD;
Genesys_Settings settings;
/* 1: no half_ccd, 2: use half number of pixels */
int half_ccd = 1;
int cksel = 1;
DBG (DBG_proc, "gl646_init_register_for_shading: start\n");
/* when shading all (full width) line, we... | false | true | false | false | false | 1 |
radeon_audio_interface_init(struct radeon_device *rdev)
{
if (ASIC_IS_DCE6(rdev)) {
rdev->audio.funcs = &dce6_funcs;
rdev->audio.hdmi_funcs = &dce6_hdmi_funcs;
rdev->audio.dp_funcs = &dce6_dp_funcs;
} else if (ASIC_IS_DCE4(rdev)) {
rdev->audio.funcs = &dce4_funcs;
rdev->audio.hdmi_funcs = &dce4_hdmi_funcs;
... | false | false | false | false | false | 0 |
gfs_cell_corner_value (FttCell * cell,
FttDirection d[FTT_DIMENSION],
GfsVariable * v,
gint max_level)
{
GfsInterpolator inter;
gdouble val = 0.;
guint i;
g_return_val_if_fail (cell != NULL, 0.);
g_return_val_if_fail (v != NULL, 0.);
gfs_cell_corner_interpolator (cell, d, max... | false | false | false | false | false | 0 |
zInitGTFVec (zGTFVec *vec, size_t limit) {
vec->size = 0;
vec->limit = limit;
vec->elem = (vec->limit > 0) ? zMalloc(limit*sizeof(zGTFfeature), "GTFVec")
: NULL;
vec->last = NULL;
} | false | false | false | false | false | 0 |
eventFilter(QObject *o, QEvent *e)
{
QWidget *w = qobject_cast<QWidget*>(o);
if (w && d->_alertWidget.values().contains(w)) {
if (e->type()==QEvent::Paint || e->type()==QEvent::Show || e->type()==QEvent::Hide) {
if (d->_lastVisibleWidget == w) {
// nothing to do
... | false | false | false | false | false | 0 |
showTipsChanged( bool e )
{
PsiOptions::instance()->setOption("options.ui.tip.show", e);
} | false | false | false | false | false | 0 |
init_themedict(FXStringList & basedirs,FXStringDict & themedict){
FXString * dirs=NULL;
for (FXint i=0;i<basedirs.no();i++) {
FXint no = FXDir::listFiles(dirs,basedirs[i],"*",FXDir::AllDirs|FXDir::NoParent|FXDir::NoFiles);
if (no) {
for (FXint j=0;j<no;j++) {
if (themedict.find(dirs[j].text())... | false | false | false | false | false | 0 |
line_begin(size_t quote_level)
{
if (quote_level)
{
std::vector<unicode_char> vec;
vec.reserve(quote_level+1);
vec.insert(vec.end(), quote_level, '>');
vec.push_back(' ');
line_contents(&vec[0], vec.size());
}
} | false | false | false | false | false | 0 |
index_build(Relation heapRelation,
Relation indexRelation,
IndexInfo *indexInfo,
bool isprimary)
{
RegProcedure procedure;
IndexBuildResult *stats;
Oid save_userid;
int save_sec_context;
int save_nestlevel;
/*
* sanity checks
*/
Assert(RelationIsValid(indexRelation));
Assert(PointerIsValid(i... | false | false | false | true | false | 1 |
crmf_get_public_value(SECKEYPublicKey *pubKey, SECItem *dest)
{
SECItem *src;
switch(pubKey->keyType) {
case dsaKey:
src = &pubKey->u.dsa.publicValue;
break;
case rsaKey:
src = &pubKey->u.rsa.modulus;
break;
case dhKey:
src = &pubKey->u.dh.publicValue;
break;
default:
src = NULL;
bre... | false | false | false | false | false | 0 |
MeanPop(WiggleIterator * wi) {
MeanData * data = (MeanData *) wi->data;
if (data->source->done) {
if (data->span > 0)
data->res = data->sum / data->span;
wi->done = true;
return;
}
wi->chrom = data->source->chrom;
wi->start = data->source->start;
wi->finish = data->source->finish;
wi->value = data->so... | false | false | false | false | false | 0 |
rtl_lps_change_work_callback(struct work_struct *work)
{
struct rtl_works *rtlworks =
container_of(work, struct rtl_works, lps_change_work);
struct ieee80211_hw *hw = rtlworks->hw;
struct rtl_priv *rtlpriv = rtl_priv(hw);
if (rtlpriv->enter_ps)
rtl_lps_enter_core(hw);
else
rtl_lps_leave_core(hw);
} | false | false | false | false | false | 0 |
transparencyChanged(void)
{
bool bTrans = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(m_checkTransparency));
if(bTrans)
{
addOrReplaceVecProp("bgcolor","transparent");
m_currentBGColorTransparent = true;
}
updatePreview();
} | false | false | false | false | false | 0 |
vxge_poll_inta(struct napi_struct *napi, int budget)
{
struct vxgedev *vdev = container_of(napi, struct vxgedev, napi);
int pkts_processed = 0;
int i;
int budget_org = budget;
struct vxge_ring *ring;
struct __vxge_hw_device *hldev = pci_get_drvdata(vdev->pdev);
for (i = 0; i < vdev->no_of_vpath; i++) {
ring ... | false | false | false | false | false | 0 |
clearSelection()
{
if (d->itemsCheckable) {
// Un-select all items
const int rowCount = model()->rowCount(QModelIndex());
for (int row = 0; row < rowCount; ++row) {
const QModelIndex index = model()->index(row, 0);
QTreeWidgetItem* listItem = itemFromIndex(index);
... | false | false | false | false | false | 0 |
imapdriver_cached_uninitialize(mailsession * session)
{
struct imap_cached_session_state_data * data;
unsigned int i;
data = get_cached_data(session);
for(i = 0 ; i < carray_count(data->imap_uid_list) ; i ++) {
struct uid_cache_item * cache_item;
cache_item = carray_get(data->imap_uid_list, i);... | false | false | false | false | false | 0 |
rtl8723au_load_firmware(struct rtl8xxxu_priv *priv)
{
char *fw_name;
int ret;
switch (priv->chip_cut) {
case 0:
fw_name = "rtlwifi/rtl8723aufw_A.bin";
break;
case 1:
if (priv->enable_bluetooth)
fw_name = "rtlwifi/rtl8723aufw_B.bin";
else
fw_name = "rtlwifi/rtl8723aufw_B_NoBT.bin";
break;
default... | 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.