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 |
|---|---|---|---|---|---|---|
gth_file_list_set_mode (GthFileList *file_list,
GthFileListMode list_type)
{
g_return_if_fail (GTH_IS_FILE_LIST (file_list));
file_list->priv->type = list_type;
if ((file_list->priv->type == GTH_FILE_LIST_MODE_SELECTOR) || (file_list->priv->type == GTH_FILE_LIST_MODE_NO_SELECTION))
gth_file_selection_set... | false | false | false | false | false | 0 |
getXferSyntax(DCM_OBJECT** iod, char* fileXferSyntax)
{
CONDITION cond;
DCM_ELEMENT elements[] = {
{DCM_METATRANSFERSYNTAX, DCM_UI, "", 1, 65, 0}
};
elements[0].d.string = fileXferSyntax;
cond = DCM_ParseObject(iod, elements, DIM_OF(elements), NULL, 0, NULL);
if (cond != DCM_NORMAL) {
printf("Unable... | false | false | false | false | false | 0 |
doGet(const void* target) const
{
const Font* f = static_cast<const Font*>(target);
if (f->getType() == FT_TRUETYPE)
{
return "truetype";
}
else
{
return "image";
}
} | false | false | false | false | false | 0 |
compliance_option_string(void)
{
char *ver="???";
switch(opt.compliance)
{
case CO_GNUPG: return "--gnupg";
case CO_RFC4880: return "--openpgp";
case CO_RFC2440: return "--rfc2440";
case CO_RFC1991: return "--rfc1991";
case CO_PGP2: return "--pgp2";
case CO_PGP6: return "--pgp6"... | false | false | false | false | false | 0 |
fli_read_lc(FILE *f, s_fli_header *fli_header, unsigned char *old_framebuf, unsigned char *framebuf)
{
unsigned short yc, firstline, numline;
unsigned char *pos;
memcpy(framebuf, old_framebuf, fli_header->width * fli_header->height);
firstline = fli_read_short(f);
numline = fli_read_short(f);
for (yc=0; yc < numl... | false | false | false | false | false | 0 |
mx_icon_theme_load_icon (MxIconTheme *theme,
const gchar *icon_name,
GIcon *store_icon)
{
GList *data, *f;
MxIconThemePrivate *priv = theme->priv;
/* Try the set theme */
if (priv->theme_file &&
(data = mx_icon_theme_theme_load_icon (theme, priv->th... | false | false | false | false | false | 0 |
x509write_crt_set_key_usage( x509write_cert *ctx, unsigned char key_usage )
{
unsigned char buf[4];
unsigned char *c;
int ret;
c = buf + 4;
if( ( ret = asn1_write_bitstring( &c, buf, &key_usage, 7 ) ) != 4 )
return( ret );
ret = x509write_crt_set_extension( ctx, OID_KEY_USAGE,
... | true | true | false | false | false | 1 |
addressToFileofs(Address *Addr)
{
if (validAddress(Addr, scinitialized)) {
uint32 ofs;
PEFAddress ea;
if (!convertAddressToPEFAddress(Addr, &ea)) return INVALID_FILE_OFS;
if (!pef_addr_to_ofs(&pef_shared->sheaders, ea, &ofs)) return INVALID_FILE_OFS;
return ofs;
} else {
return INVALID_FILE_OFS;
}
} | false | false | false | false | false | 0 |
InsertChildAfter(XmlChild* predecessor, XmlChild* next) {
if (predecessor == NULL) {
next->next_child_ = first_child_;
first_child_ = next;
}
else {
next->next_child_ = predecessor->next_child_;
predecessor->next_child_ = next;
}
} | false | false | false | false | false | 0 |
m68k_setstopped (void)
{
regs.stopped = 1;
/* A traced STOP instruction drops through immediately without
actually stopping. */
if ((regs.spcflags & SPCFLAG_DOTRACE) == 0)
set_special (SPCFLAG_STOP);
else
m68k_resumestopped ();
} | false | false | false | false | false | 0 |
perl_get_package(void)
{
return SvPV(perl_eval_pv("caller", TRUE), PL_na);
} | false | false | false | false | false | 0 |
initcausal(double* c, int step, int n, double z)
{
double zk,z2k,iz,sum;
zk = z; iz = 1./z;
z2k = pow(z,(double)n-1.);
sum = c[0] + z2k * c[step*(n-1)];
z2k = z2k*z2k*iz;
for(int k = 1; k <= n-2; k++) {
sum += (zk+z2k)*c[step*k];
zk *= z;
z2k *= iz;
}
return (sum... | false | false | false | false | false | 0 |
mel2hz(float mel)
{
float f_0 = 0;
float f_sp = 200 / 3;
float brkfrq = 1000;
float brkpt = (brkfrq - f_0)/f_sp;
float z;
float logstep = exp(log(6.4)/27);
if (mel < brkpt)
{
z = f_0 + f_sp * mel;
}
else
{
z = brkfrq * exp(log(logstep) * (mel - brkpt));
}
return z;
} | false | false | false | false | false | 0 |
tp_client_channel_factory_create_channel (TpClientChannelFactory *self,
TpConnection *conn,
const gchar *path,
GHashTable *properties,
GError **error)
{
TpClientChannelFactoryInterface *iface = TP_CLIENT_CHANNEL_FACTORY_GET_IFACE (
self);
g_return_val_if_fail (TP_IS_CLIENT_CHANNEL_FACTORY (se... | false | false | false | false | false | 0 |
intel_runtime_pm_disable(struct drm_i915_private *dev_priv)
{
struct drm_device *dev = dev_priv->dev;
struct device *device = &dev->pdev->dev;
if (!HAS_RUNTIME_PM(dev))
return;
if (!intel_enable_rc6(dev))
return;
/* Make sure we're not suspended first. */
pm_runtime_get_sync(device);
} | false | false | false | false | false | 0 |
need_connect(struct network *n)
{
if (n->n_crypto == CRYPTO_WPA)
return 0;
switch (n->n_astate) {
case ASTATE_READY:
case ASTATE_WEP_PRGA_GET:
case ASTATE_WEP_FLOOD:
return 1;
default:
return 0;
}
} | false | false | false | false | false | 0 |
default_goto(int symbol)
{
register int i;
register int m;
register int n;
register int default_state;
register int max;
m = goto_map[symbol];
n = goto_map[symbol + 1];
if (m == n) return (0);
for (i = 0; i < nstates; i++)
state_count[i] = 0;
for (i = m; i < n; i++)
... | false | false | false | false | false | 0 |
update_hw_stats(AFPacket_Context_t *afpc)
{
AFPacketInstance *instance;
struct tpacket_stats kstats;
socklen_t len = sizeof (struct tpacket_stats);
if (afpc->state != DAQ_STATE_STARTED)
return;
for (instance = afpc->instances; instance; instance = instance->next)
{
memset(&ksta... | false | false | false | false | false | 0 |
gtkwindow_gtk_window_begin_move_drag(ScmObj *SCM_FP, int SCM_ARGCNT, void *data_)
{
ScmObj window_scm;
GtkWindow* window;
ScmObj button_scm;
int button;
ScmObj root_x_scm;
int root_x;
ScmObj root_y_scm;
int root_y;
ScmObj timestamp_scm;
u_int timestamp;
ScmObj SCM_SUBRARGS[5];
int SCM_i;
SCM_E... | false | false | false | false | false | 0 |
GdipTranslateWorldTransform (GpGraphics *graphics, float dx, float dy, GpMatrixOrder order)
{
GpStatus s;
if (!graphics)
return InvalidParameter;
s = GdipTranslateMatrix (graphics->copy_of_ctm, dx, dy, order);
if (s != Ok)
return s;
s = GdipTranslateMatrix (graphics->clip_matrix... | false | false | false | false | false | 0 |
net_rawout(unsigned const char *buf, int len)
{
int nw;
trace_netdata('>', buf, len);
while (len) {
#if defined(OMTU) /*[*/
int n2w = len;
int pause = 0;
if (n2w > OMTU) {
n2w = OMTU;
pause = 1;
}
#else
# define n2w len
#endif
#if defined(HAVE_LIBSSL) /*[*/
if (ssl_con != NULL)
n... | true | true | false | false | false | 1 |
delta_hash(PyDateTime_Delta *self)
{
if (self->hashcode == -1) {
PyObject *temp = delta_getstate(self);
if (temp != NULL) {
self->hashcode = PyObject_Hash(temp);
Py_DECREF(temp);
}
}
return self->hashcode;
} | false | false | false | false | false | 0 |
AuSoundPlayFromData(
AuServer *aud,
Sound s,
AuPointer data,
AuDeviceID device,
AuFixedPoint volume,
AuSoundCallback callback,
AuPointer callbac... | false | false | false | false | false | 0 |
usbmisc_imx25_post(struct imx_usbmisc_data *data)
{
struct imx_usbmisc *usbmisc = dev_get_drvdata(data->dev);
void __iomem *reg;
unsigned long flags;
u32 val;
if (data->index > 2)
return -EINVAL;
if (data->evdo) {
spin_lock_irqsave(&usbmisc->lock, flags);
reg = usbmisc->base + MX25_USB_PHY_CTRL_OFFSET;
... | false | false | false | false | false | 0 |
tripleDESEncrypt(char *ciphertext, char *plaintext, char *key1, char *key2, char *key3)
{
//Make sure the size of the output buffer is long enough
if (plaintext == NULL || ciphertext == NULL || key1 == NULL || key2 == NULL || key3 == NULL || ((strlen(plaintext) % 8) != 0))
return;
KeySet keyset1[16... | false | false | false | false | true | 1 |
delete_node(void *data, struct node_rec *rec)
{
if (iscsi_check_for_running_session(rec)) {
/*
* We could log out the session for the user, but if
* the session is being used the user may get something
* they were not expecting (FS errors and a read only
* remount).
*/
log_error("This command wi... | false | false | false | false | false | 0 |
normalise_history(plc_state_t *s)
{
int16_t tmp[PLC_HISTORY_LEN];
if (s->buf_ptr == 0)
return;
memcpy(tmp, s->history, sizeof(int16_t)*s->buf_ptr);
memcpy(s->history, s->history + s->buf_ptr, sizeof(int16_t) * (PLC_HISTORY_LEN - s->buf_ptr));
memcpy(s->history + PLC_HISTORY_LEN - s->buf_ptr, tmp, sizeof(int16_t... | false | true | false | false | false | 1 |
_giraffe_subslit_range(const cpl_table *subslit, const cpl_image *locy,
const cpl_image *locw, cxdouble *ymin, cxdouble *ymax)
{
const cxchar *idx = NULL;
cxint i;
cxint ns = 0;
cxint nx = 0;
const cxdouble *_locy = NULL;
const cxdouble *_locw = NULL;
cxdouble _ymi... | false | false | false | false | false | 0 |
snippets_db_close (SnippetsDB *snippets_db)
{
GList *iter = NULL;
AnjutaSnippetsGroup *cur_snippets_group = NULL;
SnippetsDBPrivate *priv = NULL;
GtkTreePath *path = NULL;
/* Assertions */
g_return_if_fail (ANJUTA_IS_SNIPPETS_DB (snippets_db));
g_return_if_fail (snippets_db->priv != NULL);
priv = ANJUTA_SNIPPE... | false | false | false | false | false | 0 |
tridentfb_sync(struct fb_info *info)
{
struct tridentfb_par *par = info->par;
if (!(info->flags & FBINFO_HWACCEL_DISABLED))
par->wait_engine(par);
return 0;
} | false | false | false | false | false | 0 |
gfs2_update_stats(struct gfs2_lkstats *s, unsigned index,
s64 sample)
{
s64 delta = sample - s->stats[index];
s->stats[index] += (delta >> 3);
index++;
s->stats[index] += ((abs(delta) - s->stats[index]) >> 2);
} | false | false | false | false | false | 0 |
Nsite_highlight_set_default_value_cmd(Nv_data * data, Tcl_Interp * interp,
int argc, char **argv)
{
/* argv[1] = what (color/size/marker) / argv[2] = value */
if (argc < 3)
return (TCL_ERROR);
if (!strcmp(argv[1], "size")) {
default_highlight_size_value = atof(argv[2]);
}
else if (!strcmp... | false | false | false | false | false | 0 |
_elm_hover_smart_sub_object_add(Evas_Object *obj,
Evas_Object *sobj)
{
ELM_HOVER_DATA_GET(obj, sd);
if (evas_object_data_get(sobj, "elm-parent") == obj)
return EINA_TRUE;
if (!ELM_WIDGET_CLASS(_elm_hover_parent_sc)->sub_object_add(obj, sobj))
return EINA_FALSE;
i... | false | false | false | false | false | 0 |
mp_add_d (mp_int * a, mp_digit b, mp_int * c)
{
int res, ix, oldused;
mp_digit *tmpa, *tmpc, mu;
/* grow c as required */
if (c->alloc < a->used + 1) {
if ((res = mp_grow(c, a->used + 1)) != MP_OKAY) {
return res;
}
}
/* if a is negative and |a| >= b, call c = |a| - b */
if (a->sig... | false | false | false | false | false | 0 |
gvplugin_activate(GVC_t * gvc, api_t api,
const char *typestr, char *name, char *path, gvplugin_installed_t * typeptr)
{
gvplugin_available_t **pnext;
/* point to the beginning of the linked list of plugins for this api */
pnext = &(gvc->apis[api]);
while (*pnext) {
... | false | false | false | false | false | 0 |
_policy_zone_layout_app_single(E_Border *bd, E_Illume_Config_Zone *cz)
{
if (!_policy_layout_app_check(bd)) return;
ZONE_GEOMETRY;
_policy_keyboard_restrict(bd, &h);
_policy_indicator_restrict(cz, &y, &h);
_policy_softkey_restrict(cz, &y, &h);
_border_geometry_set(bd, x, y, w, h, POL_APP_LAYER);
} | false | false | false | false | false | 0 |
orte_ess_base_register(mca_base_register_flag_t flags)
{
mca_base_var_enum_t *new_enum;
int ret;
orte_ess_base_std_buffering = -1;
(void) mca_base_var_enum_create("ess_base_stream_buffering", stream_buffering_values, &new_enum);
(void) mca_base_var_register("orte", "ess", "base", "stream_buffering"... | false | false | false | false | false | 0 |
pick_data_bucket(struct cache_set *c,
const struct bkey *search,
unsigned write_point,
struct bkey *alloc)
{
struct open_bucket *ret, *ret_task = NULL;
list_for_each_entry_reverse(ret, &c->data_buckets, list)
if (!bkey_cmp(&ret->key, search))
goto found;
else if (ret->last_write_poi... | false | false | false | false | false | 0 |
lalr1AddFollow2( TransAp *trans, long followKey, long prior )
{
for ( ExpandToSet::Iter ets = trans->expandTo; ets.lte(); ets++ ) {
int prodId = ets->prodId;
StateAp *expandTo = ets->state;
TransMapEl *transEl = expandTo->transMap.find( followKey );
if ( transEl != 0 ) {
/* Add in the reductions, or in the... | false | false | false | false | false | 0 |
GetMem(uint16 A) {
if ((A >= 0x2000) && (A < 0x4000)) {
switch (A&7) {
case 0: return PPU[0];
case 1: return PPU[1];
case 2: return PPU[2]|(PPUGenLatch&0x1F);
case 3: return PPU[3];
case 4: return SPRAM[PPU[3]];
case 5: return XOffset;
case 6: return RefreshAddr&0xFF;
case 7: return... | false | false | false | false | false | 0 |
spc_set_authUsername(const Q3CString &user, const Q3CString &pass)
{
int len1 = user.length();
int len2 = pass.length();
if(len1 > 255)
len1 = 255;
if(len2 > 255)
len2 = 255;
QByteArray a(1+1+len1+1+len2);
a[0] = 0x01; // username auth version 1
a[1] = len1;
memcpy(a.data() + 2, user.data(), len1);
a[2+len... | false | false | false | false | false | 0 |
account_widget_build_irc (TpawAccountWidget *self,
const char *filename)
{
GtkWidget *box;
tpaw_account_settings_set_regex (self->priv->settings, "account",
ACCOUNT_REGEX_IRC);
if (self->priv->simple)
{
self->priv->irc_network_chooser = tpaw_account_widget_irc_build_simple
(self, filen... | false | false | false | false | false | 0 |
gt_simplesuffixprefixmatchoutput(GT_UNUSED void *info,
const GtEncseq *encseq,
unsigned long matchlen,
unsigned long pos1,
unsigned long pos2,
... | false | false | false | false | false | 0 |
fso_gsm_at_result_iter_reset (FsoGsmAtResultIter* self) {
gchar* _tmp0_ = NULL;
g_return_if_fail (self != NULL);
self->priv->_line_pos = 0;
self->priv->_line_num = 0;
_tmp0_ = g_strdup ("");
_g_free0 (self->priv->_line);
self->priv->_line = _tmp0_;
} | false | false | false | false | false | 0 |
zmaxlength(i_ctx_t *i_ctx_p)
{
os_ptr op = osp;
check_type(*op, t_dictionary);
check_dict_read(*op);
make_int(op, dict_maxlength(op));
return 0;
} | false | false | false | false | false | 0 |
makejob(/*union node *node,*/ int nprocs)
{
int i;
struct job *jp;
for (i = njobs, jp = jobtab; ; jp++) {
if (--i < 0) {
jp = growjobtab();
break;
}
if (jp->used == 0)
break;
if (jp->state != JOBDONE || !jp->waited)
continue;
#if JOBS
if (doing_jobctl)
continue;
#endif
freejob(jp);
brea... | false | false | false | false | false | 0 |
gst_stream_audio_information_to_string (GstDiscovererStreamInfo * info,
gint depth)
{
GstDiscovererAudioInfo *audio_info;
GString *s;
gchar *tmp;
const gchar *ctmp;
int len = 400;
const GstTagList *tags;
GstCaps *caps;
g_return_val_if_fail (info != NULL, NULL);
s = g_string_sized_new (len);
m... | false | false | false | false | false | 0 |
UnloadBlob_PCR_EVENT(UINT64 *offset, BYTE *blob, TSS_PCR_EVENT *event)
{
if (!event) {
UINT32 ulPcrValueLength, ulEventLength;
UnloadBlob_VERSION(offset, blob, NULL);
UnloadBlob_UINT32(offset, NULL, blob);
UnloadBlob_UINT32(offset, NULL, blob);
UnloadBlob_UINT32(offset, &ulPcrValueLength, blob);
(*offset... | false | false | false | false | false | 0 |
draw_clock(pixelfield_t &pf, bool seconds=true)
{
int cw, ch;
get_clock_dimensions(cw, ch, seconds);
int x = (pf.width - cw) / 2;
int y = (pf.height - ch) / 2 + 1;
int hour[2];
int minute[2];
int second[2];
time_t ti = time(NULL);
struct tm* tt = localtime(&ti);
hour[0] = tt->tm_hour / 10;
hour[1] = tt->tm... | false | false | false | false | false | 0 |
calculate_bases (tree type)
{
vec<tree, va_gc> *vector = make_tree_vector();
tree bases_vec = NULL_TREE;
unsigned i;
vec<tree, va_gc> *vbases;
vec<tree, va_gc> *nonvbases;
tree binfo;
complete_type (type);
if (!NON_UNION_CLASS_TYPE_P (type))
return make_tree_vec (0);
/* First go through virtual... | false | false | false | false | false | 0 |
__clocksource_watchdog_kthread(void)
{
struct clocksource *cs, *tmp;
unsigned long flags;
LIST_HEAD(unstable);
int select = 0;
spin_lock_irqsave(&watchdog_lock, flags);
list_for_each_entry_safe(cs, tmp, &watchdog_list, wd_list) {
if (cs->flags & CLOCK_SOURCE_UNSTABLE) {
list_del_init(&cs->wd_list);
list_... | false | false | false | false | false | 0 |
max14577_i2c_init(void)
{
BUILD_BUG_ON(ARRAY_SIZE(max14577_i2c_id) != MAXIM_DEVICE_TYPE_NUM);
BUILD_BUG_ON(ARRAY_SIZE(max14577_dt_match) != MAXIM_DEVICE_TYPE_NUM);
/* Valid charger current values must be provided for each chipset */
BUILD_BUG_ON(ARRAY_SIZE(maxim_charger_currents) != MAXIM_DEVICE_TYPE_NUM);
/* Ch... | false | false | false | false | false | 0 |
find_timeout( Window win )
{
CurStruct *c = cursors;
for ( ; c->name; c++ )
if ( c->win == win && c->timeout_id )
return c;
return 0;
} | false | false | false | false | false | 0 |
nfs3_xdr_dec_remove3res(struct rpc_rqst *req,
struct xdr_stream *xdr,
struct nfs_removeres *result)
{
enum nfs_stat status;
int error;
error = decode_nfsstat3(xdr, &status);
if (unlikely(error))
goto out;
error = decode_wcc_data(xdr, result->dir_attr);
if (unlikely(error))
goto out;
if (status... | false | false | false | false | false | 0 |
profile_set_speed(profile_t* profile, const gchar* s) {
if (profile) {
if (profile->speed)
g_free(profile->speed);
profile->speed = g_strdup(s);
} else g_print("profile_set_speed(): profile==NULL\n");
} | false | false | false | false | false | 0 |
snd_make_fmfbv(time_type t0, double hz, rate_type sr, sound_type index)
{
register fmfbv_susp_type susp;
/* sr specified as input parameter */
/* t0 specified as input parameter */
int interp_desc = 0;
sample_type scale_factor = 1.0F;
time_type t0_min = t0;
falloc_generic(susp, fmfbv_susp_no... | false | false | false | false | false | 0 |
notify_remove_clicked (GtkWidget * igad)
{
GtkTreeView *view;
GtkTreeModel *model;
GtkTreeIter iter;
GtkTreePath *path = NULL;
gboolean found = FALSE;
char *name;
view = g_object_get_data (G_OBJECT (notify_window), "view");
if (gtkutil_treeview_get_selected (view, &iter, USER_COLUMN, &name, -1))
{
model = g... | false | false | false | false | false | 0 |
_dbus_connection_send_and_unlock (DBusConnection *connection,
DBusMessage *message,
dbus_uint32_t *client_serial)
{
DBusPreallocatedSend *preallocated;
_dbus_assert (connection != NULL);
_dbus_assert (message != NULL);
preallocated = _dbus_connection_preallocate_send_unlocked (connection);
... | false | false | false | false | false | 0 |
decode_gin(char *c, PLGraphicsIn *gin)
{
int x, y, lc = strlen(c);
if (lc == 4) {
x = ((c[0] & 0x1f) << 5) +
((c[1] & 0x1f) );
y = ((c[2] & 0x1f) << 5) +
((c[3] & 0x1f) );
gin->pX = x;
gin->pY = y;
gin->dX = x / (double) TEKX;
gin->dY = y / (double) TEKY;
}
else if (lc == 5) {... | false | false | false | false | true | 1 |
text_array_load(struct text_array *t, const char *filename)
{
int count = 0;
int x, y;
char value[4096];
FILE *file;
file = fopen(filename, "r");
if(!file)
return 0;
while(fscanf(file, "%d %d %[^\n]\n", &x, &y, value) == 3) {
text_array_set(t, x, y, value);
count++;
}
fclose(file);
return count;
} | true | true | false | false | true | 1 |
mlx4_status_to_errno(u8 status)
{
static const int trans_table[] = {
[CMD_STAT_INTERNAL_ERR] = -EIO,
[CMD_STAT_BAD_OP] = -EPERM,
[CMD_STAT_BAD_PARAM] = -EINVAL,
[CMD_STAT_BAD_SYS_STATE] = -ENXIO,
[CMD_STAT_BAD_RESOURCE] = -EBADF,
[CMD_STAT_RESOURCE_BUSY] = -EBUSY,
[CMD_STAT_EXCEED_LIM] = -ENO... | false | false | false | false | false | 0 |
showRequestedOptions(SPtr<TSrvOptOptionRequest> oro) {
ostringstream x;
int i = oro->count();
x << i << " opts";
if (i)
x << ":";
for (i=0;i<oro->count();i++) {
x << " " << oro->getReqOpt(i);
}
return x.str();
} | false | false | false | false | false | 0 |
dispatchMessage(const Message &msg)
{
eh_->message(new MessageEvent(msg));
} | false | false | false | false | false | 0 |
mongo_disconnect( mongo *conn ) {
if( ! conn->connected )
return;
if( conn->replica_set ) {
conn->replica_set->primary_connected = 0;
mongo_replica_set_free_list( &conn->replica_set->hosts );
conn->replica_set->hosts = NULL;
}
mongo_env_close_socket( conn->sock );
... | false | false | false | false | false | 0 |
parsejunk(Logfile *lf, void *arg, char c) { /* NB allow empty strings */
register char *p = pos;
if (c == WHITESPACE) {
termchar[(unsigned char)' '] = TRUE;
termchar[(unsigned char)'\t'] = TRUE;
*block_end = ' ';
}
else {
termchar[(unsigned char)c] = TRUE;
*block_end = c;
}
while (!term... | false | false | false | false | false | 0 |
m_hess_hash_init()
{ int i;
int me = GET_THREAD_ID;
if ( m_hash_per_row[me] < 1 ) m_hash_per_row[me] = 1;
m_table_size[me] = m_hash_per_row[me]*SDIM*web.skel[VERTEX].max_ord/nprocs;
m_max_fill[me] = 4*m_table_size[me]/5;
if ( !hessian_quiet_flag )
{ sprintf(msg,"m_Hess init alloc: %d\n",m_table_size[me]);
... | false | false | false | false | false | 0 |
shift_codebook(elbg_data *elbg, int *indexes,
int *newcentroid[3])
{
cell *tempdata;
cell **pp = &elbg->cells[indexes[2]];
while(*pp)
pp= &(*pp)->next;
*pp = elbg->cells[indexes[0]];
elbg->cells[indexes[0]] = NULL;
tempdata = elbg->cells[indexes[1]];
elb... | false | false | false | false | false | 0 |
init_comp_ctx(struct comp_ctx **comp_ctx)
{
#ifdef USE_ZLIB
z_stream *strm;
if (global.maxzlibmem > 0 && (global.maxzlibmem - zlib_used_memory) < sizeof(struct comp_ctx))
return -1;
#endif
if (unlikely(pool_comp_ctx == NULL))
pool_comp_ctx = create_pool("comp_ctx", sizeof(struct comp_ctx), MEM_F_SHARED);
*co... | false | false | false | false | false | 0 |
pm_unselect_playlist(Playlist *playlist) {
GtkTreeIter iter;
g_return_if_fail (playlist_treeview);
g_return_if_fail (playlist);
if (pm_get_iter_for_playlist(playlist, &iter)) {
GtkTreeSelection *ts;
ts = gtk_tree_view_get_selection(playlist_treeview);
gtk_tree_selection_unselec... | false | false | false | false | false | 0 |
GPS_Math_UTM_EN_To_WGS84(double* lat, double* lon, double E,
double N, int32 zone, char zc)
{
double lambda0;
double N0;
double E0;
double F0;
if (!GPS_Math_UTM_Param_To_Mc(zone,zc,&lambda0,&E0,&N0,&F0)) {
return 0;
}
GPS_Math_UTM_EN_to_LatLon(GPS_Datum[118].ellipse, N... | false | false | false | false | false | 0 |
mio_free (MIO *mio)
{
if (mio) {
mio->v_free (mio);
g_slice_free1 (sizeof *mio, mio);
}
} | false | false | false | false | false | 0 |
fr_command_7z_extract (FrCommand *command,
const char *from_file,
GList *file_list,
const char *dest_dir,
gboolean overwrite,
gboolean skip_older,
gboolean junk_paths)
{
FrArchive *archive = FR_ARCHIVE (command);
GList *scan;
fr_process_use_st... | false | false | false | false | false | 0 |
jamstrsub(buf, str, bufsz)
char *buf;
size_t bufsz;
const char *str;
{
if (strlen(str) < bufsz)
strcpy(buf, str);
else
complain("string too long");
} | false | false | false | false | false | 0 |
ceph_alloc_readdir_reply_buffer(struct ceph_mds_request *req,
struct inode *dir)
{
struct ceph_inode_info *ci = ceph_inode(dir);
struct ceph_mds_reply_info_parsed *rinfo = &req->r_reply_info;
struct ceph_mount_options *opt = req->r_mdsc->fsc->mount_options;
size_t size = sizeof(*rinfo->dir_in) + sizeof(*rin... | false | false | false | false | false | 0 |
constantWrapper(Node *n) {
String *name = Getattr(n, "name");
String *iname = Getattr(n, "sym:name");
SwigType *type = Getattr(n, "type");
String *rawval = Getattr(n, "rawval");
String *value = rawval ? rawval : Getattr(n, "value");
String *tm;
if (!addSymbol(iname, n))
return SWIG_ER... | false | false | false | false | false | 0 |
savetty(argc, argv)
int argc;
char *CONST argv[];
{
int n;
n = 0;
if (argc > 1 && argv[1][0] == '-'
&& argv[1][1] == 'n' && !(argv[1][2]))
n++;
return(savestdio(n));
} | false | false | false | false | false | 0 |
glusterd_validate_brickreconf (glusterd_volinfo_t *volinfo,
dict_t *val_dict,
char **op_errstr)
{
glusterd_brickinfo_t *brickinfo = NULL;
int ret = -1;
list_for_each_entry (brickinfo, &volinfo->bricks, brick_list) {... | false | false | false | false | false | 0 |
gfm_mkdir_request(struct gfm_connection *gfm_server, void *closure,
const char *base)
{
struct gfm_mkdir_closure *c = closure;
gfarm_error_t e;
if ((e = gfm_client_mkdir_request(gfm_server, base, c->mode))
!= GFARM_ERR_NO_ERROR) {
gflog_warning(GFARM_MSG_1000133, "mkdir(%s) request: %s",
base, gfarm_e... | false | false | false | false | false | 0 |
GGadgetGetTitle(GGadget *g) {
if ( g->funcs->get_title!=NULL )
return( (g->funcs->get_title)(g) );
else if ( g->funcs->_get_title!=NULL )
return( u_copy( (g->funcs->_get_title)(g) ));
return( NULL );
} | false | false | false | false | false | 0 |
Check(bool check_meta) {
PayloadRaw request;
PayloadRawInterface *inbuf = NULL;
HTTPClientInfo info;
AutoPointer<ClientHTTP> client(acquire_client(url));
if (!client) return DataStatus::CheckError;
MCC_Status r = client->process("GET", url.FullPathURIEncoded(), 0, 15,
... | false | false | false | false | false | 0 |
savelevchn(fd, mode)
register int fd, mode;
{
s_level *tmplev, *tmplev2;
int cnt = 0;
for (tmplev = sp_levchn; tmplev; tmplev = tmplev->next) cnt++;
if (perform_bwrite(mode))
bwrite(fd, (genericptr_t) &cnt, sizeof(int));
for (tmplev = sp_levchn; tmplev; tmplev = tmplev2) {
tmplev2 = tmplev->next;
... | false | false | false | false | false | 0 |
_midgard_workspace_manager_set_property (GObject *object, guint property_id,
const GValue *value, GParamSpec *pspec)
{
MidgardWorkspaceManager *self = (MidgardWorkspaceManager *) (object);
GObject *mgd;
switch (property_id) {
case PROPERTY_CONNECTION:
if (!G_VALUE_HOLDS_OBJECT (value))
return;
self-... | false | false | false | false | false | 0 |
sanitize (GnomeDesktopItem *item, const char *uri)
{
const char *type;
type = lookup (item, GNOME_DESKTOP_ITEM_TYPE);
/* understand old gnome style url exec thingies */
if (type != NULL && strcmp (type, "URL") == 0) {
const char *exec = lookup (item, GNOME_DESKTOP_ITEM_EXEC);
set (item, GNOME_DESKTOP_ITEM_TYP... | false | false | false | false | false | 0 |
get_display_name(char *display_name, int screen_num)
{
char *msg;
char *new_dn;
char *cp;
char string_screen_num[32];
CopyString(&msg, display_name);
cp = strchr(msg, ':');
if (cp != NULL)
{
cp = strchr(cp, '.');
if (cp != NULL)
{
/* truncate at display part */
*cp = '\0';
}
}
sprintf(string_sc... | false | false | false | false | false | 0 |
deferred_emit_carrier_state (gpointer user_data)
{
NMNetlinkMonitor *self = NM_NETLINK_MONITOR (user_data);
NMNetlinkMonitorPrivate *priv = NM_NETLINK_MONITOR_GET_PRIVATE (self);
int err;
priv->request_status_id = 0;
/* Update the link cache with latest state, and if there are no errors
* emit the link states ... | false | false | false | false | false | 0 |
read_socket_data(int sock, struct socket_packet_buffer *buffer)
{
int didget;
if (!buffer_ensure_free_extra_space(buffer, MAX_LEN_PACKET)) {
log_error("can't grow buffer");
return -1;
}
log_debug("try reading %d bytes", buffer->nsize - buffer->ndata);
didget = fc_readsocket(sock, (char *) (buffer->d... | false | false | false | false | false | 0 |
GetPDVs(const std::vector<BasePDU*> & inDataPDUs)
{
std::vector<BasePDU*>::const_iterator itor;
std::vector<PresentationDataValue> outPDVs;
for (itor = inDataPDUs.begin(); itor < inDataPDUs.end(); itor++)
{
PDataTFPDU* thePDataTFPDU = dynamic_cast<PDataTFPDU*>(*itor);
if (thePDataTFPDU == NULL)
... | false | false | false | false | false | 0 |
gnc_combo_cell_set_autosize (ComboCell *cell, gboolean autosize)
{
PopBox *box;
if (!cell)
return;
box = cell->cell.gui_private;
if (!box)
return;
box->autosize = autosize;
} | false | false | false | false | false | 0 |
do_grow(struct inode *inode, u64 size)
{
struct gfs2_inode *ip = GFS2_I(inode);
struct gfs2_sbd *sdp = GFS2_SB(inode);
struct gfs2_alloc_parms ap = { .target = 1, };
struct buffer_head *dibh;
int error;
int unstuff = 0;
if (gfs2_is_stuffed(ip) &&
(size > (sdp->sd_sb.sb_bsize - sizeof(struct gfs2_dinode))))... | false | false | false | false | false | 0 |
delegate_typing(CTX ctx, kStmtExpr *stmt)
{
if(DP(stmt)->size == 4) {
kTerm *tkMN = tkNN(stmt, 3);
TYPING_UntypedExpr(ctx, stmt, 2);
kclass_t cid = Tn_cid(stmt, 2), this_cid = DP(ctx->gma)->this_cid;
if(Tn_isCID(stmt, 2)) { /* delegate(Class, f) */
kTerm *tkC = tkNN(stmt, 2);
kMethod *mtd = knh_NameSpace... | false | false | false | false | false | 0 |
sf_byte_compare(void *index, Hit *hit1, Hit *hit2)
{
int val1 = ((int *)index)[hit1->doc];
int val2 = ((int *)index)[hit2->doc];
if (val1 > val2) return 1;
else if (val1 < val2) return -1;
else return 0;
} | false | false | false | false | false | 0 |
gt_bwtrangesplitwithoutspecial(GtArrayBoundswithchar *bwci,
unsigned long *rangeOccs,
const FMindex *fmindex,
unsigned long lbound,
unsigned long ubound)
{
const BWTSeq *bwts... | false | false | false | false | false | 0 |
c4iw_qp_rem_ref(struct ib_qp *qp)
{
PDBG("%s ib_qp %p\n", __func__, qp);
if (atomic_dec_and_test(&(to_c4iw_qp(qp)->refcnt)))
wake_up(&(to_c4iw_qp(qp)->wait));
} | false | false | false | false | false | 0 |
dag_gc_ref_incr(struct dag *d, const char *file, int increment)
{
/* Increment the garbage file by specified amount */
PTRINT_T ref_count = (PTRINT_T) hash_table_remove(d->collect_table, file);
if(ref_count) {
ref_count = ref_count + increment;
hash_table_insert(d->collect_table, file, (void *) ref_count);
deb... | false | false | false | false | false | 0 |
test_scenario_1_test3 (InterestTestFixture *fixture, gconstpointer user_data)
{
unity_webapps_window_tracker_mock_set_active_window (UNITY_WEBAPPS_WINDOW_TRACKER_MOCK (fixture->window_tracker), 7);
unity_webapps_interest_manager_set_interest_is_active (fixture->interest_manager,
fixture->id2, TRUE);
unity... | false | false | false | false | false | 0 |
slotDisableY(int index)
{
ASSERT_ENGAUGE(gridSettings != 0);
if ((GridSet) index != gridSettings->gridSetY)
{
gridSettings->gridSetY = (GridSet) index;
toggleActions();
}
} | false | false | false | true | false | 1 |
on_prefs_close_clicked (GtkWidget* widget, void* user) {
GtkTextIter start, end;
gchar* text = NULL;
if (gtk_text_buffer_get_modified (gui->prefsgui->default_buffer)) {
gtk_text_buffer_get_start_iter (gui->prefsgui->default_buffer, &start);
gtk_text_buffer_get_end_iter (gui->prefsgui->defau... | false | false | false | false | false | 0 |
tsi721_advance_work(struct tsi721_bdma_chan *bdma_chan)
{
struct tsi721_tx_desc *desc;
int err;
dev_dbg(bdma_chan->dchan.device->dev, "%s: Enter\n", __func__);
/*
* If there are any new transactions in the queue add them
* into the processing list
*/
if (!list_empty(&bdma_chan->queue))
list_splice_init(&... | false | false | false | false | false | 0 |
CMN_load_from_file(CMNWork *c, char *filename)
{
FILE *fp;
int veclen;
jlog("Stat: wav2mfcc-pipe: reading initial CMN from file \"%s\"\n", filename);
if ((fp = fopen_readfile(filename)) == NULL) {
jlog("Error: wav2mfcc-pipe: failed to open\n");
return(FALSE);
}
/* read header */
if (myread(&vecle... | false | false | false | false | false | 0 |
ecdh_data_free(void *data)
{
ECDH_DATA *r = (ECDH_DATA *)data;
#ifndef OPENSSL_NO_ENGINE
if (r->engine)
ENGINE_finish(r->engine);
#endif
CRYPTO_free_ex_data(CRYPTO_EX_INDEX_ECDH, r, &r->ex_data);
OPENSSL_cleanse((void *)r, sizeof(ECDH_DATA));
OPENSSL_free(r);
} | 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.