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 |
|---|---|---|---|---|---|---|
next_node_name(char **path)
{
char *res;
do {
res = strsep(path, "/");
} while (res && ast_strlen_zero(res));
return res;
} | false | false | false | false | false | 0 |
stocklist_savepgn (GtkWidget * w, gpointer data)
{
StockListDialog *me;
FileDialog *fd;
ChessGame *cg;
me=(StockListDialog *)data;
fd=new FileDialog(_("Save as PGN"));
if (fd->run()) {
cg=global.getGame(me->SelectedRow);
if (cg)
cg->savePGN(fd->FileName, true);
}
delete fd;
} | false | false | false | false | false | 0 |
typeToString(const TypePtr& type)
{
if(!type)
{
return "";
}
static const char* builtinTable[] =
{
"Byte",
"Boolean",
"Short",
"Integer",
"Long",
"Single",
"Double",
"String",
"Ice.Object",
"Ice.ObjectPrx",
... | false | false | false | false | false | 0 |
tryExtractPart(QString *s)
{
int size = in.size() - at;
if(size == 0)
return false;
uchar *p = (uchar *)in.data() + at;
QString nextChars;
while(1) {
nextChars = dec->toUnicode((const char *)p, 1);
++p;
++at;
if(!nextChars.isEmpty())
break;
if(at == (int)in.size())
return false;
}... | false | false | false | false | false | 0 |
usage(void)
{
static const char *tbl[] =
{
""
,"Options:"
," -c set control characters"
," -e ch erase character"
," -I no initialization strings"
," -i ch interrupt character"
," -k ch kill character"
," -m mapping map identifier to type"
," -Q do n... | false | false | false | false | false | 0 |
parse_geometry_from_array (JsonArray *array,
ClutterGeometry *geometry)
{
if (json_array_get_length (array) != 4)
return FALSE;
geometry->x = json_array_get_int_element (array, 0);
geometry->y = json_array_get_int_element (array, 1);
geometry->width = json_array_get_int_ele... | false | false | false | false | false | 0 |
free_list(char **list)
{
int i;
if (list == NULL)
return;
for (i = 0; list[i] != NULL; i++)
free(list[i]);
free(list);
} | false | false | false | false | false | 0 |
bus_match_rule_new (DBusConnection *matches_go_to)
{
BusMatchRule *rule;
rule = dbus_new0 (BusMatchRule, 1);
if (rule == NULL)
return NULL;
rule->refcount = 1;
rule->matches_go_to = matches_go_to;
#ifndef DBUS_BUILD_TESTS
_dbus_assert (rule->matches_go_to != NULL);
#endif
return rule;
} | false | false | false | false | false | 0 |
hash ( double value) const
{
union {
double d;
char c[8];
} v1;
assert (sizeof(double) == 8);
v1.d = value;
int n = 0;
int j;
for ( j = 0; j < 8; ++j ) {
int ichar = v1.c[j];
n += mmult_for_hash[j] * ichar;
}
return ( abs ( n ) ... | false | false | false | false | false | 0 |
_first_bt_clicked(void *data, Evas_Object *obj __UNUSED__,
void *event_info __UNUSED__)
{
char str[128];
Evas_Object *li = data, *lb;
Elm_Object_Item *lit = elm_list_first_item_get(li);
if (!lit) return;
sprintf(str, "%s is selected", elm_object_item_text_get(lit));
elm_list_item_br... | false | false | false | false | false | 0 |
IsToastNamespace(Oid namespaceId)
{
return (namespaceId == PG_TOAST_NAMESPACE) ||
isTempToastNamespace(namespaceId);
} | false | false | false | false | false | 0 |
exec_check_process (struct session *sess)
{
int val;
if (sess->running_exec == NULL)
return;
val = waitpid (sess->running_exec->childpid, NULL, WNOHANG);
if (val == -1 || val > 0)
{
close (sess->running_exec->myfd);
fe_input_remove (sess->running_exec->iotag);
free (sess->running_exec);
sess->running_ex... | false | false | false | false | false | 0 |
vhost_work_queue(struct vhost_dev *dev, struct vhost_work *work)
{
unsigned long flags;
spin_lock_irqsave(&dev->work_lock, flags);
if (list_empty(&work->node)) {
list_add_tail(&work->node, &dev->work_list);
work->queue_seq++;
spin_unlock_irqrestore(&dev->work_lock, flags);
wake_up_process(dev->worker);
} e... | false | false | false | false | false | 0 |
store_time(void) {
char **line;
char *sql;
int nrow, ncolumn;
char date[50];
time_t now;
timeofday_t tod;
cf_get_time(&tod);
now = time(NULL);
if (tod.day == last_stored_day)
return 0;
last_stored_day = tod.day;
snprintf(date, 50, "%10d-%2d-%2d %2d:%2d", tod.year, ... | true | true | false | false | false | 1 |
ath5k_setup_channels(struct ath5k_hw *ah, struct ieee80211_channel *channels,
unsigned int mode, unsigned int max)
{
unsigned int count, size, freq, ch;
enum ieee80211_band band;
switch (mode) {
case AR5K_MODE_11A:
/* 1..220, but 2GHz frequencies are filtered by check_channel */
size = 220;
band = IEEE8021... | false | false | false | false | false | 0 |
defineOptions(OptionSet& options)
{
Application::defineOptions(options);
options.addOption(
Option("daemon", "", "Run application as a daemon.")
.required(false)
.repeatable(false)
.callback(OptionCallback<ServerApplication>(this, &ServerApplication::handleDaemon)));
options.addOption(
Option("pidfile... | false | false | false | false | false | 0 |
niu_n2_divide_channels(struct niu_parent *parent)
{
int num_ports = parent->num_ports;
int i;
for (i = 0; i < num_ports; i++) {
parent->rxchan_per_port[i] = (16 / num_ports);
parent->txchan_per_port[i] = (16 / num_ports);
pr_info("niu%d: Port %u [%u RX chans] [%u TX chans]\n",
parent->index, i,
parent-... | false | false | false | false | false | 0 |
getMirror(const UBiDiProps *bdp, UChar32 c, uint16_t props) {
int32_t delta=UBIDI_GET_MIRROR_DELTA(props);
if(delta!=UBIDI_ESC_MIRROR_DELTA) {
return c+delta;
} else {
/* look for mirror code point in the mirrors[] table */
const uint32_t *mirrors;
uint32_t m;
int32_t... | false | false | false | false | false | 0 |
print_object(FILE *fd, struct tcf_meta_val *obj, struct rtattr *rta)
{
int id = TCF_META_ID(obj->kind);
int type = TCF_META_TYPE(obj->kind);
struct meta_entry *entry;
if (id == TCF_META_ID_VALUE)
return print_value(fd, type, rta);
entry = lookup_meta_entry_byid(id);
if (entry == NULL)
fprintf(fd, "[unknown... | false | false | false | false | false | 0 |
filter_data_find_match(DBusConnection *connection,
const char *name,
const char *owner,
const char *path,
const char *interface,
const char *member,
const char *argument)
{
GSList *current;
for (current = listeners;
current != NULL; current = current->next) {
struct fil... | false | false | false | false | false | 0 |
Load(const std::string& filename, size_t iTargetSize) {
if (!Load(filename)) {
T_ERROR("Load from %s failed", filename.c_str());
return false;
} else {
Resample(iTargetSize);
return true;
}
} | false | false | false | false | false | 0 |
putPsicodeKeywordsInfoInTextEditor()
{
putPsicodeGuessInfoInTextEditor();
if(!strstr(selectedTypeMethod,"SemiEmp")) putPsicodeBasisInfoInTextEditor();
if(strstr(selectedMethod,"RI")) putPsicodeAuxBasisInTextEditor();
if(!strcmp(selectedExcited,"CIS(D)")) putPsicodeAuxBasisInTextEditor();
putPsicodeSCFKeywordsInfoI... | false | false | false | false | false | 0 |
hkl_geometry_list_multiply_from_range(HklGeometryList *self)
{
size_t i, j;
size_t len;
if(!self)
return;
len = HKL_LIST_LEN(self->items);
for(i=0; i<len; ++i){
HklGeometry *geometry;
HklGeometry *ref;
int *perm;
ref = self->items[i]->geometry;
geometry = hkl_geometry_new_copy(ref);
perm = alloca(H... | false | false | false | false | false | 0 |
path_extname(VALUE self)
{
VALUE str = get_strpath(self);
return rb_funcall(rb_cFile, rb_intern("extname"), 1, str);
} | false | false | false | false | false | 0 |
store(MYSQL_TIME *tm)
{
#ifndef DBUG_OFF
DBUG_ASSERT(field_types == 0 ||
field_types[field_pos] == MYSQL_TYPE_DATETIME ||
field_types[field_pos] == MYSQL_TYPE_TIMESTAMP);
field_pos++;
#endif
char buff[40];
uint length;
length= sprintf(buff, "%04d-%02d-%02d %02d:%02d:%02d",
(int... | false | false | false | false | false | 0 |
wv_dcma(p_dc)
/* Weaves a macro definition. */
p_dc_t p_dc;
{
p_bp_t p_bp;
p_ma_t p_ma = p_dc->dc_p_ma;
ulong level = p_dc->dc_mlev;
p_md_t p_md = &p_ma->ma_defn[level];
/* Get a pointer to the body part. */
ls_loo(p_md->md_body,p_dc->dc_part,PPV &p_bp);
/* Macro definition (except for content) is in red. *... | false | false | false | false | false | 0 |
saa7134_ts_buffer_prepare(struct vb2_buffer *vb2)
{
struct vb2_v4l2_buffer *vbuf = to_vb2_v4l2_buffer(vb2);
struct saa7134_dmaqueue *dmaq = vb2->vb2_queue->drv_priv;
struct saa7134_dev *dev = dmaq->dev;
struct saa7134_buf *buf = container_of(vbuf, struct saa7134_buf, vb2);
struct sg_table *dma = vb2_dma_sg_plane_d... | false | false | false | false | false | 0 |
note_tree_free(struct int_node *tree)
{
unsigned int i;
for (i = 0; i < 16; i++) {
void *p = tree->a[i];
switch (GET_PTR_TYPE(p)) {
case PTR_TYPE_INTERNAL:
note_tree_free(CLR_PTR_TYPE(p));
/* fall through */
case PTR_TYPE_NOTE:
case PTR_TYPE_SUBTREE:
free(CLR_PTR_TYPE(p));
}
}
} | false | false | false | false | false | 0 |
vconfigError(const char* fmt0, va_list ap)
{
vlogError(file |
fxStr::format(": line %u: %s", getConfigLineNumber(), fmt0), ap);
} | false | false | false | false | false | 0 |
pm_notification(struct notifier_block *this,
unsigned long event, void *ptr)
{
switch (event) {
case PM_SUSPEND_PREPARE:
return pm_suspend_prep_cb();
case PM_POST_SUSPEND:
return pm_suspend_exit_cb();
}
return NOTIFY_DONE;
} | false | false | false | false | false | 0 |
gt_orffinder_arguments_check(GT_UNUSED int rest_argc,
void *tool_arguments, GtError *err)
{
GtOrffinderArguments *arguments = tool_arguments;
int had_err = 0;
int diff;
gt_error_check(err);
gt_assert(arguments);
diff = (arguments->max - arguments->min);
if (diff < ... | false | false | false | false | false | 0 |
update()
{
const uint8_t *src1 = reinterpret_cast<const uint8_t*>(in1);
const uint8_t *src2 = reinterpret_cast<const uint8_t*>(in2);
uint8_t *dst = reinterpret_cast<uint8_t*>(out);
uint32_t sizeCounter = size;
int r1, g1, b1;
int r2, g2, b2;
/* assumes inputs are only 4 byte RGBA pix... | false | false | false | false | false | 0 |
_connection_ibus_signal_cb (GDBusConnection *connection,
const gchar *sender_name,
const gchar *object_path,
const gchar *interface_name,
const gchar *signal_name,
GVariant *parame... | false | false | false | false | false | 0 |
restore(VMG_ CVmFile *fp)
{
char buf[128];
int err;
unsigned long datasize;
unsigned long old_crcval;
unsigned long new_crcval;
long startpos;
int old_gc_enabled;
CVmObjFixup *fixups;
/* we don't have a fixup table yet (the object loader will create one) */
fixups = ... | false | false | false | false | false | 0 |
ssl_write_encrypted_pms( ssl_context *ssl,
size_t offset, size_t *olen,
size_t pms_offset )
{
int ret;
size_t len_bytes = ssl->minor_ver == SSL_MINOR_VERSION_0 ? 0 : 2;
unsigned char *p = ssl->handshake->premaster + pms_offset;
/*
... | false | false | false | false | false | 0 |
g_vfs_channel_send_reply (GVfsChannel *channel,
GVfsDaemonSocketProtocolReply *reply,
const void *data,
gsize data_len)
{
channel->priv->output_data = data;
channel->priv->output_data_size = data_len;
channel->priv->output_data_pos = 0;
if (reply != NULL)
{
memcpy (channel->priv->re... | false | false | false | false | false | 0 |
ovl_dir_read(struct path *realpath,
struct ovl_readdir_data *rdd)
{
struct file *realfile;
int err;
realfile = ovl_path_open(realpath, O_RDONLY | O_DIRECTORY);
if (IS_ERR(realfile))
return PTR_ERR(realfile);
rdd->first_maybe_whiteout = NULL;
rdd->ctx.pos = 0;
do {
rdd->count = 0;
rdd->err = 0;
... | false | false | false | false | false | 0 |
ni_init_driver_calculated_leakage_table(struct radeon_device *rdev,
PP_NIslands_CACTABLES *cac_tables)
{
struct ni_power_info *ni_pi = ni_get_pi(rdev);
struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev);
u32 leakage = 0;
unsigned int i, j, table_size;
s32 t;
u32 smc_leakage, max_leakage = 0;
u3... | false | false | false | false | false | 0 |
ptInRect(int x, int y, SDL_Rect *r)
{
return ( (x>=r->x) && (y>=r->y) && (x<=r->x+r->w) && (y<=r->y+r->h) );
} | false | false | false | false | false | 0 |
nack_recv(struct ib_mad_agent_private *agent,
struct ib_mad_recv_wc *recv_wc, u8 rmpp_status)
{
struct ib_mad_send_buf *msg;
struct ib_rmpp_mad *rmpp_mad;
int ret;
msg = alloc_response_msg(&agent->agent, recv_wc);
if (IS_ERR(msg))
return;
rmpp_mad = msg->mad;
memcpy(rmpp_mad, recv_wc->recv_buf.mad, m... | false | true | false | false | false | 1 |
init_emit (void)
{
struct function *f = cfun;
f->emit = ggc_alloc (sizeof (struct emit_status));
first_insn = NULL;
last_insn = NULL;
seq_rtl_expr = NULL;
cur_insn_uid = 1;
reg_rtx_no = LAST_VIRTUAL_REGISTER + 1;
last_location.line = 0;
last_location.file = 0;
first_label_num = label_num;
last_la... | false | false | false | false | false | 0 |
_dbus_unity_protocol_scope_service_get_hints (UnityProtocolScopeService* self) {
GHashTable* result;
GVariantBuilder _tmp131_;
GHashTableIter _tmp132_;
gpointer _tmp133_;
gpointer _tmp134_;
GVariant* _reply;
result = unity_protocol_scope_service_get_hints (self);
g_hash_table_iter_init (&_tmp132_, result);
g_v... | false | false | false | false | false | 0 |
FC_GetObjectSize(CK_SESSION_HANDLE hSession,
CK_OBJECT_HANDLE hObject, CK_ULONG_PTR pulSize) {
CK_RV rv;
CK_OBJECT_CLASS objClass = CKO_NOT_A_KEY;
CHECK_FORK();
SFTK_FIPSFATALCHECK();
rv = sftk_get_object_class_and_fipsCheck(hSession, hObject, &objClass);
if (rv == CKR_OK) {
rv = NSC_G... | false | false | false | false | false | 0 |
check_init_bracket (level, walk, buf)
int *level;
struct internal_type *walk;
char *buf;
{
/* Trying to reconstruct the initializer in the case of an error. */
if (STRUCT_P(walk) &&
(strlen (walk->input->field_name) + strlen (buf) < BUFSIZ - 1))
{
strcat (buf, ".");
strcat (buf, walk->i... | false | false | false | false | false | 0 |
on_key_press(GtkWidget *widget, GdkEventKey *evt)
{
GtkTreeModel *model;
GtkTreeSelection *sel;
GtkTreeIter it;
int modifier = (evt->state & gtk_accelerator_get_default_mod_mask());
if((evt->keyval == GDK_KEY_Menu && !modifier) ||
(evt->keyval == GDK_KEY_F10 && modifier == GDK_SHIFT_MASK))
... | false | false | false | false | false | 0 |
mailbox_cb(char *name,
int matchlen __attribute__((unused)),
int maycreate __attribute__((unused)),
void *rock)
{
struct sync_name_list *qrl = (struct sync_name_list *)rock;
struct mailbox *mailbox = NULL;
struct dlist *kl = dlist_kvlist(NULL, "MAILBOX");
int r;
r = mailbox_... | false | false | false | false | false | 0 |
decode_morse_code(T_BOOL key,double ticklen,int cwcodeset,
T_BOOL reset_decoder)
{
static double evtlen=0;
static double beeplenprev=0,lastshortbeeplen=0,lastlongbeeplen=0;
static double lastbeep_too_short_by=0; /* in ms */
static double ditlen=0;
static T_BOOL keyprev=0;
static char cwbuf[CW_BUF_MAX_SIZ... | true | true | false | false | false | 1 |
store_shost_eh_deadline(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{
struct Scsi_Host *shost = class_to_shost(dev);
int ret = -EINVAL;
unsigned long deadline, flags;
if (shost->transportt &&
(shost->transportt->eh_strategy_handler ||
!shost->hostt->eh_host_reset_... | false | false | false | false | false | 0 |
gw_check_calloc(int nmemb, size_t size, const char *filename, long lineno,
const char *function)
{
unsigned char *p;
gw_assert(initialized);
/* ANSI C89 says malloc(0) is implementation-defined. Avoid it. */
gw_assert(size > 0);
gw_assert(nmemb > 0);
p = calloc(1, (nmem... | false | false | false | false | false | 0 |
KServerSocket(const QString& node, const QString& service,
QObject* parent)
: QObject(parent), d(new KServerSocketPrivate)
{
QObject::connect(&d->resolver, SIGNAL(finished(KNetwork::KResolverResults)),
this, SLOT(lookupFinishedSlot()));
setAddress(node, service);
} | false | false | false | false | false | 0 |
_browse(Evry_Plugin *plugin, const Evry_Item *it)
{
Evry_Action *act;
Plugin *p;
if (!CHECK_TYPE(it, EVRY_TYPE_ACTION))
return NULL;
act = EVRY_ACTN(it);
EVRY_PLUGIN_INSTANCE(p, plugin);
p->actions = act->fetch(act);
p->parent = EINA_TRUE;
p->action = act;
return EVRY_PLUGIN(p);
} | false | false | false | false | false | 0 |
from_hex( byte const* in )
{
unsigned result = 0;
for ( int n = 4; n--; )
{
int h = from_hex_char( *in++ );
if ( h > 15 )
return -1;
result = result * 0x10 + h;
}
return result;
} | false | false | false | false | false | 0 |
requiresExternRelocation(MachObjectWriter *Writer,
const MCAssembler &Asm,
const MCFragment &Fragment,
unsigned RelocType,
... | false | false | false | false | false | 0 |
paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget)
{
if (m_hybrid) return;
if (doNotPaint()) return;
if (m_legPolygon.count() > 1) {
paintLeg(painter);
return;
}
if (m_effectively == EffectivelyUnknown) {
if (!m_circular && m_shape.isEmpty()) {
if (this->attachedTo()->... | false | false | false | false | false | 0 |
mlx5_core_modify_rqt(struct mlx5_core_dev *dev, u32 rqtn, u32 *in,
int inlen)
{
u32 out[MLX5_ST_SZ_DW(modify_rqt_out)];
MLX5_SET(modify_rqt_in, in, rqtn, rqtn);
MLX5_SET(modify_rqt_in, in, opcode, MLX5_CMD_OP_MODIFY_RQT);
memset(out, 0, sizeof(out));
return mlx5_cmd_exec_check_status(dev, in, inlen, out, siz... | false | false | false | false | false | 0 |
on_signal_button_press_event( GdkEventButton * event )
{
//right-click
if ( event ->button == 3 )
{
menu_popup .items()[0] .set_sensitive( liststore_operations ->children() .size() > 0 ) ;
menu_popup .items()[1] .set_sensitive( liststore_operations ->children() .size() > 0 ) ;
menu_popup .items()[2] .set_sensi... | false | false | false | false | false | 0 |
calculateValue(void)
{
UT_UTF8String szFieldValue ("?");
FV_View *pView = _getView();
if(pView)
{
FV_DocCount cnt = pView->countWords(true);
UT_UTF8String_sprintf(szFieldValue, "%d", cnt.ch_no);
}
if (getField())
getField()->setValue(static_cast<const gchar*>(szFieldValue.utf8_str()));
return _setVal... | false | false | false | false | false | 0 |
intel_hdmi_set_gcp_infoframe(struct drm_encoder *encoder)
{
struct drm_i915_private *dev_priv = encoder->dev->dev_private;
struct intel_crtc *crtc = to_intel_crtc(encoder->crtc);
u32 reg, val = 0;
if (HAS_DDI(dev_priv))
reg = HSW_TVIDEO_DIP_GCP(crtc->config->cpu_transcoder);
else if (IS_VALLEYVIEW(dev_priv))
... | false | false | false | false | false | 0 |
InsChrMouseUp(GWindow gw, GEvent *event) {
if ( !inschr.mouse_down )
return;
InsChrMouseMove(gw,event);
inschr.mouse_down = false;
if ( inschr.mouse_in ) {
InsChrXorChar(inschr.icw,inschr.x,inschr.y);
if ( !(event->u.mouse.state&ksm_control) )
InsChrInsert();
}
} | false | false | false | false | false | 0 |
is_tsls_style_instrument (equation_system *sys, int v)
{
int i, j, pos;
for (i=0; i<sys->neqns; i++) {
pos = gretl_list_separator_position(sys->lists[i]);
if (pos > 0) {
for (j=pos+1; j<=sys->lists[i][0]; j++) {
if (sys->lists[i][j] == v) {
return 1;
}
}
}
}
return 0;
} | false | false | false | false | false | 0 |
unmap()
{
if (d->data != 0) {
d->mappedBytes = 0;
d->bytesPerLine = 0;
d->data = 0;
d->buffer->unmap();
}
} | false | false | false | false | false | 0 |
pnok_call_divert(gn_data *data, struct gn_statemachine *state)
{
unsigned short length = 0x09;
char req[55] = { FBUS_FRAME_HEADER, 0x01, 0x00, /* operation */
0x00,
0x00, /* divert type */
0x00, /* call type */
0x00 };
if (!data->call_divert) return GN_ERR_UNKNOWN;
switch (data->call_divert-... | false | false | false | false | false | 0 |
Scm_GdkPropertyDataFromUVector(ScmObj uvec,
int *format, /* out */
int *nelements) /* out */
{
if (SCM_U8VECTORP(uvec)) {
*nelements = SCM_U8VECTOR_SIZE(uvec);
*format = 8;
return (guchar*)SCM_U8VECTOR_ELEMENTS(... | false | false | false | false | false | 0 |
qlcnic_83xx_reset_template_checksum(struct qlcnic_adapter *p_dev)
{
u32 sum = 0;
u16 *buff = (u16 *)p_dev->ahw->reset.buff;
int count = p_dev->ahw->reset.hdr->size / sizeof(u16);
while (count-- > 0)
sum += *buff++;
while (sum >> 16)
sum = (sum & 0xFFFF) + (sum >> 16);
if (~sum) {
return 0;
} else {
de... | false | false | false | false | false | 0 |
main(int argc, char **argv) {
if (argc != 3) return usage(argv[0]);
struct in_addr inaddr;
if (inet_aton(argv[1], &inaddr) == 0) return usage(argv[0]);
return client(inaddr.s_addr, argv[2]);
} | false | false | false | false | false | 0 |
draw_box(GtkStyle * style, GdkWindow * window, GtkStateType state_type, GtkShadowType shadow_type, GdkRectangle * area, GtkWidget * widget, const gchar * detail, gint x, gint y, gint width, gint height)
{
CHECK_ARGS;
SANITIZE_SIZE;
if (!style->bg_pixmap[state_type])
{
xfce_fill_background(style... | false | false | false | false | false | 0 |
run()
{
CHECK_NOT_NIL_SHUTDOWN_OR_DESTROYED();
omni_thread* self = omni_thread::self();
if (self && self->id() == omni::mainThreadId) {
orbAsyncInvoker->perform();
}
else {
orb_lock.lock();
orb_n_blocked_in_run++;
while( !pd_shutdown ) orb_signal.wait();
orb_n_blocked_in_run--;
or... | false | false | false | false | false | 0 |
ialloc_solo(gs_memory_t * parent, gs_memory_type_ptr_t pstype,
chunk_t ** pcp)
{ /*
* We can't assume that the parent uses the same object header
* that we do, but the GC requires that allocators have
* such a header. Therefore, we prepend one explicitly.
*/
chunk_t ... | false | false | false | false | false | 0 |
ecc_export(unsigned char *out, unsigned long *outlen, int type, ecc_key *key)
{
int err;
unsigned char flags[1];
unsigned long key_size;
LTC_ARGCHK(out != NULL);
LTC_ARGCHK(outlen != NULL);
LTC_ARGCHK(key != NULL);
/* type valid? */
if (key->type != PK_PRIVATE && type == PK_... | true | true | false | true | false | 1 |
fors_qc_keyword_to_paf(cpl_propertylist *header,
const char *name, const char *unit,
const char *comment,
const char *instrument)
{
const char func[] = "fors_qc_keyword_to_paf";
char *keyNa... | false | false | false | false | true | 1 |
test_vltypes_alloc_custom(size_t size, void *mem_used)
{
void *ret_value; /* Pointer to return */
const size_t extra = MAX(sizeof(void *), sizeof(size_t)); /* Extra space needed */
/* (This weird contortion is required on the
* DEC... | false | false | false | false | false | 0 |
G_zlib_read(int fd, int rbytes, unsigned char *dst, int nbytes)
{
int bsize, nread, err;
unsigned char *b;
if (dst == NULL || nbytes < 0)
return -2;
bsize = rbytes;
/* Our temporary input buffer for read */
if (NULL == (b = (unsigned char *)
G_calloc(bsize, sizeof(unsigned char))))
retur... | false | true | false | false | true | 1 |
PRMJ_DSTOffset(JSInt64 local_time)
{
JSInt64 us2s;
time_t local;
JSInt32 diff;
JSInt64 maxtimet;
struct tm tm;
PRMJTime prtm;
#ifndef HAVE_LOCALTIME_R
struct tm *ptm;
#endif
JSLL_UI2L(us2s, PRMJ_USEC_PER_SEC);
JSLL_DIV(local_time, local_time, us2s);
/* get the maximum of time... | false | false | false | false | false | 0 |
setDefaultLumaCoefs(const float * c3)
{
memcpy(&getImpl()->defaultLumaCoefs_[0], c3, 3*sizeof(float));
AutoMutex lock(getImpl()->cacheidMutex_);
getImpl()->resetCacheIDs();
} | false | false | false | false | false | 0 |
dma_plugin_debugger_stopped (DebugManagerPlugin *self, GError *err)
{
GtkAction *action;
AnjutaStatus* state;
DEBUG_PRINT ("%s", "DMA: dma_plugin_debugger_stopped");
dma_plugin_program_unload (self);
/* Update ui */
gtk_action_group_set_visible (self->start_group, TRUE);
gtk_action_group_set_sensitive (self->... | false | false | false | false | false | 0 |
vivid_is_in_use(struct video_device *vdev)
{
unsigned long flags;
bool res;
spin_lock_irqsave(&vdev->fh_lock, flags);
res = !list_empty(&vdev->fh_list);
spin_unlock_irqrestore(&vdev->fh_lock, flags);
return res;
} | false | false | false | false | false | 0 |
saystr(char *str)
#else
void saystr(str)
char *str;
#endif
{
if (isHere(HERO))
output(str);
free(str);
} | false | false | false | false | false | 0 |
_parse_encode(instance_t *instance,xmlDocPtr doc, xmlNodePtr node)
{
instance->encode = 1;
do {
if (node == NULL) break;
if (xmlIsBlankNode(node)) continue;
if (strcmp(node->name, "nominal-bitrate") == 0)
SET_INT(instance->nom_br);
else if (strcmp(node->name, "minimu... | false | false | false | false | false | 0 |
process_mads(smp_engine_t * engine)
{
int rc;
while (!cl_is_qmap_empty(&engine->smps_on_wire))
if ((rc = process_one_recv(engine)) != 0)
return rc;
return 0;
} | false | false | false | false | false | 0 |
PyvtkBiQuadraticQuadraticWedge_Triangulate(PyObject *self, PyObject *args)
{
vtkPythonArgs ap(self, args, "Triangulate");
vtkObjectBase *vp = ap.GetSelfPointer(self, args);
vtkBiQuadraticQuadraticWedge *op = static_cast<vtkBiQuadraticQuadraticWedge *>(vp);
int temp0;
vtkIdList *temp1 = NULL;
vtkPoints *tem... | false | false | false | false | false | 0 |
remove_contact_by_uid_cb (GObject *source_object,
GAsyncResult *result,
gpointer user_data)
{
RemoveData *data = (RemoveData *) user_data;
GError *error = NULL;
EContact *contact = NULL;
if (!e_book_client_remove_contact_by_uid_finish (E_BOOK_CLIENT (source_objec... | false | false | false | false | false | 0 |
add_sink_pad (GnlOperation * operation)
{
GstPad *gpad = NULL;
GstPad *ret = NULL;
if (!operation->element)
return NULL;
/* FIXME : implement */
GST_LOG_OBJECT (operation, "element:%s , dynamicsinks:%d",
GST_ELEMENT_NAME (operation->element), operation->dynamicsinks);
if (!operation->dynamicsi... | false | false | false | false | false | 0 |
cxnDead (Connection cxn)
{
ASSERT (cxn != NULL) ;
VALIDATE_CONNECTION (cxn) ;
abortConnection (cxn) ;
cxn->state = cxnDeadS ;
} | false | false | false | false | false | 0 |
write_cmd(char *buf, int len)
{
byte hd[2];
enc_int16(len, hd);
if (write_buf(1, (char *)hd, 2) != 2)
return 0;
if (write_buf(1, buf, len) != len)
return 0;
return 1;
} | false | false | false | false | false | 0 |
max2820_rf_init(struct ieee80211_hw *dev)
{
struct rtl8180_priv *priv = dev->priv;
/* MAXIM from netbsd driver */
write_max2820(dev, 0, 0x007); /* test mode as indicated in datasheet */
write_max2820(dev, 1, 0x01e); /* enable register */
write_max2820(dev, 2, 0x001); /* synt register */
max2820_rf_set_channel(d... | false | false | false | false | false | 0 |
getStepFlag(GridPoint & gp1, GridPoint & gp2) {
if (gp1.y == gp2.y) {
double avg = (gp1.x + gp2.x) / 2.0;
return (avg > gp1.x) ? GridPointStepXPlus : GridPointStepXMinus;
}
double avg = (gp1.y + gp2.y) / 2.0;
return (avg > gp1.y) ? GridPointStepYPlus : GridPointStepYMinus;
} | false | false | false | false | false | 0 |
parse_tagdate (char **tag, char **date, const char *input)
{
char *p;
TRACE (TRACE_FUNCTION, "parse_tagdate (%s, %s, %s)",
*tag ? *tag : "(null)", *date ? *date : "(null)",
input);
if ((p = strchr (input, ':')))
{
/* Parse the tag. */
if (p - input)
{
/* The tag has > 0 length. */
... | false | true | true | false | false | 1 |
get_filename(const gchar * label, gboolean save)
{
GtkFileChooserAction action;
const gchar *stock_button;
GtkFileChooser *chooser;
gint response;
gchar *filename = NULL;
if (save) {
action = GTK_FILE_CHOOSER_ACTION_SAVE;
stock_button = GTK_STOCK_SAVE;
} else {
actio... | false | false | false | false | false | 0 |
octstr_hex_to_binary(Octstr *ostr)
{
long len, i;
unsigned char *p;
seems_valid(ostr);
gw_assert(!ostr->immutable);
if (ostr->len == 0)
return 0;
/* Check if it's in the right format */
if (!octstr_check_range(ostr, 0, ostr->len, gw_isxdigit))
return -1;
len = ostr->l... | false | false | false | false | false | 0 |
popSubQueue() {
if (Clause* c = clauses_[ queue_[qFront_++] ]) {
c->setInSQ(false);
return c;
}
return 0;
} | false | false | false | false | false | 0 |
shadowText(QString text, const QFont &font, QColor textColor, QColor shadowColor, QPoint offset, int radius)
{
//don't try to paint stuff on a future null pixmap because the text is empty
if (text.isEmpty()) {
return QPixmap();
}
// Draw text
QFontMetrics fm(font);
QRect textRect = fm.b... | false | false | false | false | false | 0 |
devm_iio_device_register(struct device *dev, struct iio_dev *indio_dev)
{
struct iio_dev **ptr;
int ret;
ptr = devres_alloc(devm_iio_device_unreg, sizeof(*ptr), GFP_KERNEL);
if (!ptr)
return -ENOMEM;
*ptr = indio_dev;
ret = iio_device_register(indio_dev);
if (!ret)
devres_add(dev, ptr);
else
devres_free... | false | false | false | false | false | 0 |
ooGkClientREGTimerExpired(void *pdata)
{
int ret=0;
ooGkClientTimerCb *cbData = (ooGkClientTimerCb*)pdata;
ooGkClient *pGkClient = cbData->pGkClient;
OOTRACEDBGA1("Gatekeeper client additive registration timer expired\n");
memFreePtr(&pGkClient->ctxt, cbData);
ret = ooGkClientSendRRQ(pGkClient, TRU... | false | false | false | false | false | 0 |
gather_tasks_in_path(Path *path,
Dim_vector *blk_vector)
{
List *li;
for (li = path_get_term_list(path);
li != NULL;
li = li->next) {
Term *t = list_first_data(li);
if (term_get_kind(t) == SINGLE) {
dim_vector_set_one(blk_vector,
... | false | false | false | false | false | 0 |
fl_get_real_object_window( FL_OBJECT * obj )
{
FL_pixmap *objp = obj->flpixmap;
FL_pixmap *formp = obj->form->flpixmap;
if ( objp && objp->win )
return objp->win;
else if ( ( obj->objclass == FL_CANVAS
|| obj->objclass == FL_GLCANVAS )
&& fl_get_canvas_id... | false | false | false | false | false | 0 |
role_config_init_disp(struct pine *ps, CONF_S **first_line, long int rflags, PAT_STATE *pstate)
{
PAT_LINE_S *patline;
CONF_S *ctmp = NULL;
int inherit = 0, added_fake = 0;
if(first_line)
*first_line = NULL;
/*
* Set cur_pat_h and manipulate directly.
*/
se... | false | false | false | false | false | 0 |
cap_ok (word, hit, len)
register ichar_t * word;
register struct success * hit;
int len;
{
register ichar_t * dword;
register ichar_t * w;
register struct dent * dent;
ichar_t dentword[INPUTWORDLEN + MAXAFFIXLEN];
int preadd;
int prestrip;
int sufadd;
ich... | false | false | false | false | true | 1 |
sidtab_set(struct sidtab *dst, struct sidtab *src)
{
unsigned long flags;
int i;
spin_lock_irqsave(&src->lock, flags);
dst->htable = src->htable;
dst->nel = src->nel;
dst->next_sid = src->next_sid;
dst->shutdown = 0;
for (i = 0; i < SIDTAB_CACHE_LEN; i++)
dst->cache[i] = NULL;
spin_unlock_irqrestore(&src->l... | false | false | false | false | false | 0 |
vboxrc_return_time(time_t timenow, char *timestr, int mode)
{
struct tm *locala;
struct tm localb;
char timestring[5 + 1];
char *hourstr;
char *minsstr;
int hourint;
int minsint;
int secsint;
xstrncpy(timestring, timestr, 5);
hourstr = timestring;
minsstr = index(hourstr, ':');
if (!minsstr)
{
if (m... | false | false | false | false | false | 0 |
undocumented_pci_fix(struct pci_dev *pdev)
{
u32 tint;
/* The Windows driver says: */
/* Switch off FireStream Retry Limit Threshold
*/
/* The register at 0x28 is documented as "reserved", no further
comments. */
pci_read_config_dword (pdev, 0x28, &tint);
if (tint != 0x80) {
tint = 0x80;
pci_write_c... | 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.