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 |
|---|---|---|---|---|---|---|
category_model_visible_func (GtkTreeModel *model,
GtkTreeIter *iter,
gpointer user_data)
{
BrowserData *data = user_data;
GthExtensionDescription *description;
gboolean original_status_is_active;
gboolean visible;
if (strcmp (data->current_category... | false | false | false | false | false | 0 |
Initialize(const char* name, cmMakefile* mf)
{
this->MakefileMap = mf;
this->Name = name;
if ( !this->SetCMakeRoot() )
{
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Cannot initialize the generator" << std::endl);
return 0;
}
// set the running generator name
this->SetOption("CPACK_GENERATOR", ... | false | false | false | false | false | 0 |
uwepgone(void)
{
if (uwep)
{
if (artifact_light(uwep) && uwep->lamplit)
{
end_burn(uwep, false);
if (!Blind)
{
pline("%s glowing.", Tobjnam(uwep, "stop"));
}
}
setworn(NULL, W_WEP);
unweapon = true;
u... | false | false | false | false | false | 0 |
lazily_declare_fn (special_function_kind sfk, tree type)
{
tree fn;
/* Whether or not the argument has a const reference type. */
bool const_p = false;
switch (sfk)
{
case sfk_constructor:
CLASSTYPE_LAZY_DEFAULT_CTOR (type) = 0;
break;
case sfk_copy_constructor:
const_p = TYPE_HA... | false | false | false | false | false | 0 |
paint_vertical_lines (GooCanvasItemSimple *simple,
cairo_t *cr,
const GooCanvasBounds *bounds)
{
GooCanvasItemSimpleData *simple_data = simple->simple_data;
GooCanvasGrid *grid = (GooCanvasGrid*) simple;
GooCanvasGridData *grid_data = grid->grid_data;
double x, max_x, max_y, max_... | false | false | false | false | false | 0 |
open_query (server *serv, char *nick, gboolean focus_existing)
{
session *sess;
sess = find_dialog (serv, nick);
if (!sess)
new_ircwindow (serv, nick, SESS_DIALOG, focus_existing);
else if (focus_existing)
fe_ctrl_gui (sess, 2, 0); /* bring-to-front */
} | false | false | false | false | false | 0 |
cli_cmd_volume_reset_parse (const char **words, int wordcount, dict_t **options)
{
dict_t *dict = NULL;
char *volname = NULL;
int ret = -1;
GF_ASSERT (words);
GF_ASSERT (options);
dict = dict_new ();
if (!dict)
goto out;
if (wor... | true | true | true | true | false | 1 |
lns_make_union(struct info *info,
struct lens *l1, struct lens *l2, int check) {
struct lens *lens = NULL;
int consumes_value = l1->consumes_value && l2->consumes_value;
int recursive = l1->recursive || l2->recursive;
int ctype_nullable = l1->ctype_nullable || l2->ctype_null... | false | false | false | false | false | 0 |
setup_entered_from_non_parent_p (void)
{
unsigned int i;
loop_p loop;
ira_assert (current_loops != NULL);
FOR_EACH_VEC_SAFE_ELT (get_loops (), i, loop)
if (ira_loop_nodes[i].regno_allocno_map != NULL)
ira_loop_nodes[i].entered_from_non_parent_p
= entered_from_non_parent_p (&ira_loop_nodes[i]);
} | false | false | false | false | false | 0 |
clk_is_match(const struct clk *p, const struct clk *q)
{
/* trivial case: identical struct clk's or both NULL */
if (p == q)
return true;
/* true if clk->core pointers match. Avoid derefing garbage */
if (!IS_ERR_OR_NULL(p) && !IS_ERR_OR_NULL(q))
if (p->core == q->core)
return true;
return false;
} | false | false | false | false | false | 0 |
get_d(DBusMessage *rep, int msgid)
{
int ret, i, k;
struct cm_tdbusm_dict **d;
ret = cm_tdbusm_get_d(rep, NULL, &d);
if (ret == 0) {
printf("Message %d - [", msgid);
for (i = 0; (d != NULL) && (d[i] != NULL); i++) {
printf("%s{%s=", i > 0 ? "," : "", d[i]->key);
switch (d[i]->value_type) {
case cm_tdbu... | false | false | false | false | false | 0 |
ath5k_ani_set_spur_immunity_level(struct ath5k_hw *ah, int level)
{
static const int val[] = { 2, 4, 6, 8, 10, 12, 14, 16 };
if (level < 0 || level >= ARRAY_SIZE(val) ||
level > ah->ani_state.max_spur_level) {
ATH5K_ERR(ah, "spur immunity level %d out of range",
level);
return;
}
AR5K_REG_WRITE_BITS... | false | false | false | false | false | 0 |
draw_arc(GB_DRAW *d, int x, int y, int w, int h, double start, double end)
{
int as, al;
FIX_RECT(d, w, h);
if (start == end)
{
as = 0;
al = 360 * 16;
}
else
{
if (end < start)
end += M_PI * 2 * (1 + (int)((start - end) / 2 / M_PI));
as = (int)(start * 180 / M_PI * 16 + 0.5);
al = (int)((end - ... | false | false | false | false | false | 0 |
process_interrupt() {
byteptr isr = 0;
if(pending_interrupts & INT_CLK) {
clear_interrupt(INT_CLK);
isr = ISR_CLK;
} else if(pending_interrupts & INT_KBD) {
isr = ISR_KBD;
}
if(isr) {
regs[XP] = PC + 4;
PC = isr;
}
} | false | false | false | false | false | 0 |
Print( FILE* cfile, int depth ) const
{
assert( cfile );
if ( cdata )
{
int i;
fprintf( cfile, "\n" );
for ( i=0; i<depth; i++ ) {
fprintf( cfile, " " );
}
fprintf( cfile, "<![CDATA[%s]]>\n", value.c_str() ); // unformatted output
}
else
{
TIXML_STRING buffer;
EncodeString( value, &buffer );
... | false | false | false | false | false | 0 |
readPrefs() {
// read all preferences and refresh the GUI
{
Fl_Preferences prefs(Fl_Preferences::SYSTEM, "fltk.org", "fltk");
Fl_Preferences opt_prefs(prefs, "options");
opt_prefs.get("ArrowFocus", opt[Fl::OPTION_ARROW_FOCUS][1], 2);
opt_prefs.get("VisibleFocus", opt[Fl::OPTION_VISIBLE_FOCUS][1], 2)... | false | false | false | false | false | 0 |
SunIRQHook(int a)
{
if(IRQa)
{
IRQCount-=a;
if(IRQCount<=0)
{
X6502_IRQBegin(FCEU_IQEXT);
IRQa=0;
IRQCount=0xFFFF;
}
}
} | false | false | false | false | false | 0 |
flags2namespace (struct hv *flags)
{
const char *NAMESPACE_DEFAULT = NAMESPACE_USER;
const size_t NAMESPACE_KEYLEN = strlen(NAMESPACE_KEY);
SV **psv_ns;
char *ns = NULL;
if (flags && (psv_ns = hv_fetch(flags, NAMESPACE_KEY, NAMESPACE_KEYLEN, 0)))
{
char *s;
STRLEN len;
s = SvPV(*psv_ns, len);
... | false | false | false | false | false | 0 |
star_index_destruct(star_index* pindex)
{
if(pindex)
{
if (pindex->cache)
{
int i = 0;
for ( i = 0; i < pindex->cache_size; i++)
{
cpl_table_delete(pindex->cache[i]);
}
cpl_free(pindex->cache);
pindex->cache = 0;
pindex->cache_size = 0;
}
cpl_table_delete(pindex->index_table);
if(pi... | false | false | false | false | false | 0 |
assert_device_not_suspended(struct drm_i915_private *dev_priv)
{
WARN_ONCE(HAS_RUNTIME_PM(dev_priv->dev) && dev_priv->pm.suspended,
"Device suspended\n");
} | false | false | false | false | false | 0 |
rb_equal(obj1, obj2)
VALUE obj1, obj2;
{
VALUE result;
if (obj1 == obj2) return Qtrue;
result = rb_funcall(obj1, id_eq, 1, obj2);
if (RTEST(result)) return Qtrue;
return Qfalse;
} | false | false | false | false | false | 0 |
tp_strv_contains (const gchar * const *strv,
const gchar *str)
{
g_return_val_if_fail (str != NULL, FALSE);
if (strv == NULL)
return FALSE;
while (*strv != NULL)
{
if (!tp_strdiff (str, *strv))
return TRUE;
strv++;
}
return FALSE;
} | false | false | false | false | false | 0 |
contact_record_new (ECalBackendContacts *cbc,
EBookClient *book_client,
EContact *contact)
{
ContactRecord *cr = g_new0 (ContactRecord, 1);
cr->cbc = cbc;
cr->book_client = book_client;
cr->contact = contact;
cr->comp_birthday = create_birthday (cbc, contact);
cr->comp_ann... | false | false | false | false | false | 0 |
client3_3_open (call_frame_t *frame, xlator_t *this,
void *data)
{
clnt_local_t *local = NULL;
clnt_conf_t *conf = NULL;
clnt_args_t *args = NULL;
gfs3_open_req req = {{0,},};
int ret = 0;
int op_errno = EST... | false | true | false | true | true | 1 |
wp_dopath (char *path, wp_dopath_func func, void *data)
{
struct stat statbuf;
struct dirent *dirp;
DIR *dp;
char *ptr;
if (wp_lstat (path, &statbuf) == -1)
return;
if (S_ISDIR (statbuf.st_mode) == 0)
func (path, data);
ptr = path + strlen (path);
*ptr++ = '/';
*ptr = 0;
if ((dp = wp_opendir (path)) ==... | false | true | true | false | false | 1 |
gst_discoverer_container_info_get_streams (GstDiscovererContainerInfo * info)
{
GList *res = NULL, *tmp;
g_return_val_if_fail (GST_IS_DISCOVERER_CONTAINER_INFO (info), NULL);
for (tmp = info->streams; tmp; tmp = tmp->next)
res =
g_list_append (res,
gst_discoverer_stream_info_ref ((GstDiscove... | false | false | false | false | false | 0 |
complete_operation2(const struct calculator_operator_descriptor *desc, struct double_stack *stack_operand)
{
int ret;
double left_operand;
double right_operand;
double result;
ret = double_stack_pop(stack_operand, &right_operand);
if (ret < 0)
{
pr_red_info("Too a few operand");
return ret;
}
ret = doubl... | false | false | false | false | false | 0 |
cardPositions() const
{
QList<QPointF> positions;
for ( int i = 0; i < count(); ++i )
positions << i * spread();
return positions;
} | false | false | false | false | false | 0 |
_glist_to_pylist_objs (GList *source)
{
GList *iter;
PyObject *dest = PyList_New (0);
for (iter = source; iter != NULL; iter = iter->next)
{
PyObject *item = pygobject_new ((GObject *)iter->data);
PyList_Append (dest, item);
Py_DECREF (item);
}
return dest;
} | false | false | false | false | false | 0 |
main(int argc, char *argv[]) {
Color color(255, 255, 0);
const char *bdf_font_file = NULL;
int rows = 32;
int chain = 1;
int x_orig = 0;
int y_orig = -1;
int opt;
while ((opt = getopt(argc, argv, "r:c:x:y:f:C:")) != -1) {
switch (opt) {
case 'r': rows = atoi(optarg); break;
case 'c': chain ... | false | false | false | false | false | 0 |
encodeStrictArray(const cygnal::Element &data)
{
// GNASH_REPORT_FUNCTION;
boost::uint32_t items;
items = data.propertySize();
// log_debug("Encoded data size has %d properties", items);
boost::shared_ptr<cygnal::Buffer> buf(new cygnal::Buffer);
if (items) {
buf.reset(new cygnal::Buffer);
... | false | false | false | false | false | 0 |
store_runscript_bool(LEX *lc, RES_ITEM *item, int index, int pass)
{
lex_get_token(lc, T_NAME);
if (strcasecmp(lc->str, "yes") == 0 || strcasecmp(lc->str, "true") == 0) {
*(bool *)(item->value) = true;
} else if (strcasecmp(lc->str, "no") == 0 || strcasecmp(lc->str, "false") == 0) {
*(bool *)(item-... | false | false | false | false | false | 0 |
unregisterfd(int *fdp) {
int i;
assert(reserved != NULL);
assert(rescount > 0);
for (i = 0; i < rescount; i++)
if (reserved[i].fdp == fdp) {
reserved[i] = reserved[--rescount];
return;
}
panic("%x not on file descriptor reserved list", fdp);
} | false | false | false | false | false | 0 |
ths7303_log_channel_status(struct v4l2_subdev *sd, u8 reg)
{
u8 val = ths7303_read(sd, reg);
if ((val & 0x7) == 0) {
v4l2_info(sd, "Channel %d Off\n", reg);
return;
}
v4l2_info(sd, "Channel %d On\n", reg);
v4l2_info(sd, " value 0x%x\n", val);
v4l2_info(sd, " %s\n", stc_lpf_sel_txt[(val >> 6) & 0x3]);
v4l... | false | false | false | false | false | 0 |
host_is_nearby(const host_addr_t addr)
{
uint i;
if (host_addr_is_ipv4(addr)) {
for (i = 0; i < number_local_networks; i++) {
uint32 m_mask = local_networks[i].mask;
uint32 m_ip = local_networks[i].net;
if ((host_addr_ipv4(addr) & m_mask) == (m_ip & m_mask))
return TRUE;
}
} else if (host_addr_is_... | false | false | false | false | false | 0 |
verify_envelope(char *env)
{
lcase(env);
if (!config_getswitch(IMAPOPT_RFC3028_STRICT) ||
!strcmp(env, "from") || !strcmp(env, "to") || !strcmp(env, "auth")) {
return 1;
}
snprintf(errbuf, ERR_BUF_SIZE,
"env-part '%s': not a valid part for an envelope test", env);
yyerror(errbuf);
retur... | false | false | false | false | false | 0 |
gphpedit_session_clear_section (GphpeditSession *session,
const gchar *section)
{
g_return_if_fail (GPHPEDIT_IS_SESSION (session));
g_return_if_fail (section != NULL);
GphpeditSessionPriv *priv = GPHPEDIT_SESSION_GET_PRIVATE(session);
g_key_file_remove_group (priv->key_file, section, NULL);
} | false | false | false | false | false | 0 |
charset_from_codepage(unsigned int codepage) {
static char buffer[7];
struct cp_map *cp;
if (codepage==1200||codepage==1201) {
/* For UCS2 */
return "";
} else
if (codepage<10000) {
sprintf(buffer,"cp%d",codepage);
return buffer;
} else {
for (cp = cp_to_charset;cp->codepage!=0&& cp->codepage!=codepa... | false | false | false | false | false | 0 |
sisusbcon_deinit(struct vc_data *c)
{
struct sisusb_usb_data *sisusb;
int i;
/* This is called by do_take_over_console()
* and others, ie not under our control.
*/
sisusb = sisusb_get_sisusb(c->vc_num);
if (!sisusb)
return;
mutex_lock(&sisusb->lock);
/* Clear ourselves in mysisusbs */
mysisusbs[c->vc_... | false | false | false | false | false | 0 |
constructArrayFromAxistags(python::object type, ArrayVector<npy_intp> const & shape,
NPY_TYPES typeCode, AxisTags const & axistags, bool init)
{
PyAxisTags pyaxistags(python_ptr(python::object(axistags).ptr()));
ArrayVector<npy_intp> norm_shape(shape);
if(pyaxistags.size() >... | false | false | false | false | false | 0 |
getAsPointCloud( mrpt::maps::CSimplePointsMap &pm, const float occup_threshold ) const
{
pm.clear();
pm.reserve(1000);
// for all rows in the gridmap
for (size_t i=1; i+1<size_x; i++)
{
// for all columns in the gridmap
for (size_t j=1; j+1<size_y; j++)
{
//if there is an obstacle and *it is a borderlin... | false | false | false | false | false | 0 |
bvw_update_tags_dispatcher (BaconVideoWidget *self)
{
UpdateTagsDelayedData *data;
/* If we take the queue's lock for the entire function call, we can use it to protect tag_update_id too */
g_async_queue_lock (self->priv->tag_update_queue);
while ((data = g_async_queue_try_pop_unlocked (self->priv->tag_update... | false | false | false | false | false | 0 |
ocfs2_init(void)
{
int status;
status = init_ocfs2_uptodate_cache();
if (status < 0)
goto out1;
status = ocfs2_initialize_mem_caches();
if (status < 0)
goto out2;
ocfs2_wq = create_singlethread_workqueue("ocfs2_wq");
if (!ocfs2_wq) {
status = -ENOMEM;
goto out3;
}
ocfs2_debugfs_root = debugfs_creat... | false | false | false | false | false | 0 |
update(const vec2& pos1, const vec4& col1, const vec2& pos2, const vec4& col2, const vec2& spos) {
vec2 pt_last;
vec4 col_last;
vec2 mid = (pos1 - pos2) * 0.5f;
vec2 to = vec2(pos1 - spos);
//TODO: not sure this makes any sense
//float dp = std::min(1.0f, to.normal().dot(mid.normal()));
... | false | false | false | false | false | 0 |
_addto_name_char_list(List char_list, char *names, bool gid)
{
int i=0, start=0;
char *name = NULL, *tmp_char = NULL;
ListIterator itr = NULL;
char quote_c = '\0';
int quote = 0;
int count = 0;
if (!char_list) {
error("No list was given to fill in");
return 0;
}
itr = list_iterator_create(char_list);
if... | false | false | false | false | false | 0 |
p_open(li_object *args) {
li_object *p;
char *mode;
if (has_2_args(args)) {
assert_nargs(2, args);
assert_string(li_cadr(args));
mode = li_to_string(li_cadr(args));
} else {
assert_nargs(1, args);
mode = "r";
}
assert_string(li_car(args));
if (!(p = l... | false | false | false | false | false | 0 |
InitializeDataSet(const EQueryLevel& inQueryLevel)
{
switch (inQueryLevel)
{
case ePatient:
{
Attribute<0x8,0x52> at1 = { "PATIENT " };
mDataSet.Insert( at1.GetAsDataElement() );
}
break;
case eStudy:
{
Attribute<0x8,0x52> at1 = { "STUDY " };
mDataSet.Insert( at1.... | false | false | false | false | false | 0 |
write(dap_connection &c)
{
send_header(c, true);
keymenu.write(c);
if (keymenu.get_bit(4)) ref.write(c);
if (keymenu.get_bit(5)) knm.write(c);
return c.write();
} | false | false | false | false | false | 0 |
target_stat_lu_vend_show(struct config_item *item, char *page)
{
struct se_device *dev = to_stat_lu_dev(item);
int i;
char str[sizeof(dev->t10_wwn.vendor)+1];
/* scsiLuVendorId */
for (i = 0; i < sizeof(dev->t10_wwn.vendor); i++)
str[i] = ISPRINT(dev->t10_wwn.vendor[i]) ?
dev->t10_wwn.vendor[i] : ' ';
str[i... | true | true | false | false | false | 1 |
var_set(char *id, interface_defn * ifd)
{
char *varvalue;
varvalue = get_var(id, strlen(id), ifd);
if (varvalue) {
free(varvalue);
return 1;
} else {
return 0;
}
} | false | false | false | false | false | 0 |
adp5520_irq_thread(int irq, void *data)
{
struct adp5520_chip *chip = data;
unsigned int events;
uint8_t reg_val;
int ret;
ret = __adp5520_read(chip->client, ADP5520_MODE_STATUS, ®_val);
if (ret)
goto out;
events = reg_val & (ADP5520_OVP_INT | ADP5520_CMPR_INT |
ADP5520_GPI_INT | ADP5520_KR_INT | ADP55... | false | false | false | false | false | 0 |
putbit(FILE * f, h_val bitnum)
{
long int bytenum = 0L;
short int bit_in_byte = 0;
unsigned char read_byte = 0x00;
unsigned char test_byte = 0x01;
int i = 0;
bit_in_byte = bitnum % 8;
bytenum = APGBFHDRSIZE + (bitnum/8);
if (fseek (f, bytenum, SEEK_SET) == -1)
return(-1);
if (fread ((void*)&read_byte,1,1,... | false | false | false | false | false | 0 |
decode_layer( elem, fname, mal_line )
char *elem;
char *fname;
int mal_line;
{
if( strcmp( elem, "X" ) == 0 ) return RCN_WIRE_UNKNOW;
if( strcmp( elem, "PY" ) == 0 ) return RCN_WIRE_POLY;
if( strcmp( elem, "A1" ) == 0 ) return RCN_WIRE_ALU1;
if( strcmp( elem, "A2" ) == 0 ) return RCN_WIRE_ALU2;
if( strcm... | false | false | false | false | false | 0 |
flmRcaUnlinkFromFile(
RCACHE * pRCache)
{
if( RCA_IS_LINKED_TO_FILE( pRCache->uiFlags))
{
if( pRCache->pNextInFile)
{
pRCache->pNextInFile->pPrevInFile = pRCache->pPrevInFile;
}
else
{
pRCache->pFile->pLastRecord = pRCache->pPrevInFile;
}
if( pRCache->pPrevInFile)
{
pRCache->pPrevInFile-... | false | false | false | false | false | 0 |
indxld1(int i, char reg, char idx)
{
char *cptr;
int v;
doopcode("ld ");
if (upperflag)
{
reg = toupper(reg);
idx = toupper(idx);
}
if (upperflag)
kcnt += fprintf(fp, "%c,(I%c+", reg, idx);
else
kcnt += fprintf(fp, "%c,(i%c+", reg, idx);
v = (int) pgmmem[i + 2] & 0xff;
if ... | false | false | false | false | false | 0 |
pixDisplayWithTitle(PIX *pixs,
l_int32 x,
l_int32 y,
const char *title,
l_int32 dispflag)
{
char *tempname;
char buffer[L_BUF_SIZE];
static l_int32 index = 0; /* caution: not .so or thread safe... | true | true | false | false | true | 1 |
add_new_pl_user_name(iTunesDB *itdb, gchar *dflt, gint32 position) {
ExtraiTunesDBData *eitdb;
Playlist *result = NULL;
gchar *name;
g_return_val_if_fail (itdb, NULL);
eitdb = itdb->userdata;
g_return_val_if_fail (eitdb, NULL);
if (!eitdb->itdb_imported) {
gtkpod_warning_simple(_(... | false | false | false | false | false | 0 |
barracks_draw_squad_pic()
{
char buf[40];
// draw pilot pic
if (Cur_pilot->callsign[0] && (Pic_squad_number >= 0) && (Pic_squad_number < Num_pilot_squad_images)) {
if (Pilot_squad_images[Pic_squad_number] >= 0) {
// JAS: This code is hacked to allow the animation to use all 256 colors
extern int Palman_allo... | false | false | false | false | false | 0 |
literal(const Text &text)
{
TextIter iter(text);
TextItem::Type type;
const Char *p;
size_t n;
const Location *loc;
StringC delim;
Boolean lita;
if (!text.delimType(lita))
CANNOT_HAPPEN();
delim = syntax_->delimGeneral(lita ? Syntax::dLITA : Syntax::dLIT);
os() << delim;
int level = 0;
while... | false | false | false | false | false | 0 |
getAssumptions(vector<Expr>& assumptions)
{
CDList<Theorem>::const_iterator iU=d_userAssumptions.begin(),
iUend=d_userAssumptions.end(), iI = d_intAssumptions.begin(),
iIend=d_intAssumptions.end();
while (true) {
if (iI == iIend) {
if (iU == iUend) break;
assumptions.push_back((*iU).getExpr(... | false | false | false | false | false | 0 |
arm_shift_nmem(enum rtx_code code)
{
switch (code)
{
case ASHIFT:
return ARM_LSL_NAME;
case ASHIFTRT:
return "asr";
case LSHIFTRT:
return "lsr";
case ROTATERT:
return "ror";
default:
abort();
}
} | false | false | false | false | false | 0 |
clone(MachineBasicBlock *MBB) {
MachineFunction *Func = MBB->getParent();
MachineBasicBlock *NewMBB = Func->CreateMachineBasicBlock();
Func->push_back(NewMBB); //insert to function
for (MachineBasicBlock::iterator It = MBB->begin(), E = MBB->end();
It != E; ++It) {
MachineInstr *MI = Func->CloneMachi... | false | false | false | false | false | 0 |
sftp_pkt_getattrs(struct sftp_packet *pkt, struct fxp_attrs *ret)
{
if (!sftp_pkt_getuint32(pkt, &ret->flags))
return 0;
if (ret->flags & SSH_FILEXFER_ATTR_SIZE) {
unsigned long hi, lo;
if (!sftp_pkt_getuint32(pkt, &hi) ||
!sftp_pkt_getuint32(pkt, &lo))
return 0;
ret->size = uint64_make(hi, lo);
... | false | false | false | false | false | 0 |
any_method_to_alias(Class *c)
{
GList *li;
for(li=c->nodes;li;li=g_list_next(li)) {
Node *node = li->data;
if(node->type == METHOD_NODE) {
Method *m = (Method *)node;
if(m->method == INIT_METHOD ||
m->method == CLASS_INIT_METHOD ||
m->method == CONSTRUCTOR_METHOD ||
m->method == DISP... | false | false | false | false | false | 0 |
patchAreaDistributionSD(int fd, char **par, area_des ad, double *result)
{
char *mapset;
double indice = 0;
struct Cell_head hd;
int ris = RLI_OK;
mapset = G_find_cell(ad->raster, "");
if (G_get_cellhd(ad->raster, mapset, &hd) == -1)
return RLI_ERRORE;
switch (ad->data_type) {
case CEL... | false | false | false | false | false | 0 |
app_chooser_response_cb (GtkDialog *dialog,
int response_id,
gpointer user_data)
{
OpenData *o_data = user_data;
GAppInfo *app_info;
switch (response_id) {
case GTK_RESPONSE_OK:
app_info = gtk_app_chooser_get_app_info (GTK_APP_CHOOSER (dialog));
if (app_info != NULL) {
fr_window_open_files_... | false | false | false | false | false | 0 |
moveToLayer(LayerItem &item, int layernum) {
// get the layer it is in
Layer &curr_layer = item.getLayer();
// do nothing if the item already is in the requested layer
if (curr_layer.getLayerNum() == layernum)
return;
layernum = FbTk::Util::clamp(layernum, 0, static_cast<signed>(m_layers.s... | false | false | false | false | false | 0 |
equip_item(item *new_item)
{
item *old_item;
itemspec *new_itemspec;
new_itemspec = &ItemMap[new_item->type];
// If we're equipping a two-handed weapon, we need to unequip the shield
// as well. We drop the shield to the inventory or to the floor.
if (new_itemspec->item_gun_requires_both_hands && Me.shield_ite... | false | false | false | false | false | 0 |
borg_wear_recharge(void)
{
int i, b_i = -1;
int slot = -1;
int b_slot = -1;
/* No resting in danger */
if (!borg_check_rest(c_y, c_x)) return (FALSE);
/* Not if hungry */
if (borg_skill[BI_ISWEAK]) return (FALSE);
/* Look for an (wearable- non rod) item to recharge */
for (i = 0; i < I... | false | false | false | false | false | 0 |
verify_mesh_index(struct state *st, int x, int y)
/* check to see if (x,y) is in the mesh */
{
if ((x < 0) || (y < 0) || (x >= st->mesh_width) || (y >= st->mesh_height))
return (-1);
return (cell_to_mesh(st, x, y));
} | false | false | false | false | false | 0 |
FCEUI_SetRenderDisable(int sprites, int bg)
{
//printf("%d, %d\n",sprites,bg);
if(sprites >= 0)
{
if(sprites == 2) rendis ^= 1;
else rendis = (rendis &~1) | sprites?1:0;
}
if(bg >= 0)
{
if(bg == 2) rendis ^= 2;
else rendis = (rendis &~2) | bg?2:0;
}
} | false | false | false | false | false | 0 |
create_first_triangle(const PointList *pointlist,
Triangulator *triangulator,
WorkSpace *wspace)
{
NeighbourBlock *nb;
guint i, j, n3;
n3 = MIN(pointlist->npoints, 3);
for (i = 0; i < n3; i++) {
wspace->len = 0;
wspace->origin = pointlist->poi... | false | false | false | false | false | 0 |
aesOpen(USBDeviceLocation dl)
{
struct AES *aes;
USBDevice *usb;
aes = (struct AES *) calloc(1, sizeof(*aes));
if (!aes)
return NULL;
aes->usb = usbGetDevice(dl);
if (!aes->usb)
goto rollback;
usb = aes->usb;
aes->epOut = 2;
aes->epIn = 0x81;
aes->fingerTh1 = 20;
aes->fing... | false | false | false | false | false | 0 |
nntp_address_encode (CamelAddress *address)
{
gint i;
GString *out;
gchar *ret;
if (address->addresses->len == 0)
return NULL;
out = g_string_new ("");
for (i = 0; i < address->addresses->len; i++) {
if (i != 0)
g_string_append (out, ", ");
g_string_append (out, g_ptr_array_index (address->addresses,... | false | false | false | false | false | 0 |
DetectLatitudeColumn(const char* pszLine)
{
int nLen = strlen(pszLine);
if (nLen >= 45 && pszLine[0] == ' ' &&
(pszLine[35-1] == 'N' || pszLine[35-1] == 'S') &&
(pszLine[45-1] == 'E' || pszLine[45-1] == 'W'))
return 27;
for(int i=8;i<nLen-10;i++)
{
if ((pszLine[i] == 'N'... | false | false | false | false | false | 0 |
BWTOccValue(const BWT *bwt, unsigned int index, const unsigned int character) {
unsigned int occValue;
unsigned int occExplicitIndex, occIndex;
// $ is supposed to be positioned at inverseSa0 but it is not encoded
// therefore index is subtracted by 1 for adjustment
if (index > bwt->inverseSa0) {
index--;
}
... | false | false | false | false | false | 0 |
maggeo_read(void)
{
char* buff;
while ((buff = gbfgetstr(maggeofile_in))) {
waypoint* wpt_tmp;
geocache_data* gcdata;
char* s = NULL;
int fld;
buff = lrtrim(buff);
if (*buff == '\0') {
continue;
}
if (strncmp(buff, "$PMGNGEO,", 9)) {
continue;
}
buff += 9; /* s... | false | false | false | false | false | 0 |
load_embedded_profiler (const char *desc, const char *name)
{
char *err = NULL;
char *symbol;
MonoDl *pmodule = NULL;
gboolean result;
pmodule = mono_dl_open (NULL, MONO_DL_LAZY, &err);
if (!pmodule) {
g_warning ("Could not open main executable (%s)", err);
g_free (err);
return FALSE;
}
symbol = g_strdu... | false | false | false | false | false | 0 |
timerEvent( QTimerEvent * )
{
const double inc = step();
switch ( d_data->scrollMode )
{
case ScrMouse:
{
if ( d_data->mass > 0.0 )
{
d_data->speed *= qExp( - double( d_data->updTime ) * 0.001 / d_data->mass );
const double newval =
... | false | false | false | false | false | 0 |
ui_mainwindow_addtransactions(GtkWidget *widget, gpointer user_data)
{
struct hbfile_data *data;
GtkWidget *window;
gint result = 1;
guint32 date;
gint account = 1, count;
DB( g_print("\n[ui-mainwindow] add transactions\n") );
data = g_object_get_data(G_OBJECT(gtk_widget_get_ancestor(widget, GTK_TYPE_WINDOW)), "ins... | false | false | false | false | false | 0 |
useQFSWatch(Entry* e)
{
e->m_mode = QFSWatchMode;
e->dirty = false;
if ( e->m_status == NonExistent ) {
addEntry(0, e->parentDirectory(), e, true /*isDir*/);
return true;
}
kDebug(7001) << "fsWatcher->addPath" << e->path;
if (!fsWatcher) {
fsWatcher = new KFileSystemWatcher();
connect(... | false | false | false | false | false | 0 |
slotShowOnlyMatches( bool onlyMatches )
{
DEBUG_BLOCK
if( onlyMatches )
{
m_toolBar->removeAction( m_previousAction );
m_toolBar->removeAction( m_nextAction );
}
else
{
m_toolBar->insertAction( m_menu->menuAction(), m_nextAction );
m_toolBar->insertAction( m_next... | false | false | false | false | false | 0 |
sendCommandToGui(Tcl_Interp* interp, const char* cmd, const char* arg)
{
int i, len, rc;
Tcl_ResetResult(interp);
char* exec = "gui_exec ";
{
Tcl_DString dstring;
char *buf;
ostrstream strm;
strm << exec;
strm << "\"";
strm << cmd;
if ( arg != NULL ) {
if ( arg[0] != '\0' )... | false | false | false | false | false | 0 |
fft_long(lame_internal_flags const *const gfc,
FLOAT x[BLKSIZE], int chn, const sample_t *const buffer[2])
{
int i;
int jj = BLKSIZE / 8 - 1;
x += BLKSIZE / 2;
do {
FLOAT f0, f1, f2, f3, w;
i = rv_tbl[jj];
f0 = ml00(ch01);
w = ml10(ch01);
f1 =... | false | false | false | false | false | 0 |
rb_path2class(path)
const char *path;
{
const char *pbeg, *p;
ID id;
VALUE c = rb_cObject;
if (path[0] == '#') {
rb_raise(rb_eArgError, "can't retrieve anonymous class %s", path);
}
pbeg = p = path;
while (*p) {
VALUE str;
while (*p && *p != ':') p++;
str = rb_str_new(pbeg, p-pbeg)... | false | false | false | false | false | 0 |
mpg123_icy(mpg123_handle *mh, char **icy_meta)
{
ALIGNCHECK(mh);
if(mh == NULL) return MPG123_ERR;
#ifndef NO_ICY
if(icy_meta == NULL)
{
mh->err = MPG123_NULL_POINTER;
return MPG123_ERR;
}
*icy_meta = NULL;
if(mh->metaflags & MPG123_ICY)
{
*icy_meta = mh->icy.data;
mh->metaflags |= MPG123_ICY;
mh->me... | false | false | false | false | false | 0 |
qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
Q_ASSERT(staticMetaObject.cast(_o));
Connection *_t = static_cast<Connection *>(_o);
switch (_id) {
case 0: _t->transactionCommitted((*reinterpret_cast< const Change... | false | false | false | false | false | 0 |
click_user_get_package_names (ClickUser* self, GError** error) {
GList* result = NULL;
GError * _inner_error_ = NULL;
g_return_val_if_fail (self != NULL, NULL);
click_user_drop_privileges (self, &_inner_error_);
if (_inner_error_ != NULL) {
g_propagate_error (error, _inner_error_);
return NULL;
}
{
GList* ... | false | false | false | false | false | 0 |
abstime2tm(AbsoluteTime _time, int *tzp, struct tm * tm, char **tzn)
{
time_t time = (time_t) _time;
struct tm *tx;
errno = 0;
if (tzp != NULL)
tx = localtime((time_t *) &time);
else
tx = gmtime((time_t *) &time);
if (!tx)
{
errno = PGTYPES_TS_BAD_TIMESTAMP;
return;
}
tm->tm_year = tx->tm_year + 1... | false | true | false | false | false | 1 |
carl9170_check_queue_stop_timeout(struct ar9170 *ar)
{
int i;
struct sk_buff *skb;
struct ieee80211_tx_info *txinfo;
struct carl9170_tx_info *arinfo;
bool restart = false;
for (i = 0; i < ar->hw->queues; i++) {
spin_lock_bh(&ar->tx_status[i].lock);
skb = skb_peek(&ar->tx_status[i]);
if (!skb)
goto nex... | false | false | false | false | false | 0 |
qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
Q_ASSERT(staticMetaObject.cast(_o));
CWebView *_t = static_cast<CWebView *>(_o);
switch (_id) {
case 0: _t->iconChanged(); break;
case 1: _t->loadFinished((*... | false | false | false | false | false | 0 |
getAttribute( const DOMString &name )
{
LocalName localname;
PrefixName prefixname;
splitPrefixLocalName(name, prefixname, localname, m_htmlCompat);
if (!localname.id()) return DOMString();
return getAttribute(makeId(emptyNamespace, localname.id()), prefixname, false /*nsAware*/);
} | false | false | false | false | false | 0 |
brcms_c_tx(struct brcms_c_info *wlc, struct sk_buff *skb)
{
struct dma_pub *dma;
int fifo, ret = -ENOSPC;
struct d11txh *txh;
u16 frameid = INVALIDFID;
fifo = brcms_ac_to_fifo(skb_get_queue_mapping(skb));
dma = wlc->hw->di[fifo];
txh = (struct d11txh *)(skb->data);
if (dma->txavail == 0) {
/*
* We someti... | false | false | false | false | false | 0 |
parse_other (packetinfo *pi)
{
update_asset(pi);
if (pi->cxt->check == 0x00) {
if (IS_COSET(&config,CO_OTHER)) {
pi->cxt->check = 0x01; // no more checks
// service_other(*pi->ip4,*transporth);
// fp_other(pi->ipX, ttl, ipopts, len, id, ipflags, df);
} else {... | false | false | false | false | false | 0 |
unzClose (unzFile file)
{
unz_s* s;
if (file==NULL)
return UNZ_PARAMERROR;
s=(unz_s*)file;
if (s->pfile_in_zip_read!=NULL)
unzCloseCurrentFile(file);
TRYFREE(s);
return UNZ_OK;
} | false | false | false | false | false | 0 |
s_rename_add(char *src, char *dest)
{
int flag;
int i;
if (src == NULL || dest == NULL) {
return;
}
flag = s_rename_search(src, dest, FALSE);
if (flag) {
// Rename_counter may be incremented within this loop, so it cannot
// be used in the loop exit condition. Just iterate over the... | false | false | false | false | false | 0 |
intel_vbtn_probe(struct platform_device *device)
{
acpi_handle handle = ACPI_HANDLE(&device->dev);
struct intel_vbtn_priv *priv;
acpi_status status;
int err;
status = acpi_evaluate_object(handle, "VBDL", NULL, NULL);
if (!ACPI_SUCCESS(status)) {
dev_warn(&device->dev, "failed to read Intel Virtual Button drive... | false | false | false | false | false | 0 |
any_slab_objects(struct kmem_cache *s)
{
int node;
struct kmem_cache_node *n;
for_each_kmem_cache_node(s, node, n)
if (atomic_long_read(&n->total_objects))
return 1;
return 0;
} | false | false | false | false | false | 0 |
update_disk(GkrellmdMonitor *mon, gboolean first_update)
{
GList *list;
DiskData *disk = NULL;
gkrellm_sys_disk_read_data();
for (list = disk_list; list; list = list->next)
{
disk = (DiskData * ) list->data;
if (disk->changed)
{
gkrellmd_need_serve(mon);
break;
}
}
} | false | false | false | false | false | 0 |
swrite(Sock *sock,char *buf,int buf_size,char *msg)
{
int ret_val;
char err_msg[256];
errno = 0;
socket_closed = 0;
ret_val = write(sock->socket, buf, buf_size);
if (ret_val == -1) {
if (socket_closed) {
FD_CLR(sock->socket, &socket_mask);
purpose_table[sock->purpose] = NULL;
/* p... | 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.