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 |
|---|---|---|---|---|---|---|
xfs_finish_rename(
struct xfs_trans *tp,
struct xfs_bmap_free *free_list)
{
int committed = 0;
int error;
/*
* If this is a synchronous mount, make sure that the rename transaction
* goes to disk before returning to the user.
*/
if (tp->t_mountp->m_flags & (XFS_MOUNT_WSYNC|XFS_MOUNT_DIRSYNC))
xfs_tra... | false | false | false | false | false | 0 |
my_malloc(unsigned int uSize, const char *pszFunc, unsigned int uLine)
{
void *pMem = NULL;
pMem = malloc(uSize);
++allocateCount;
if (IS_NOT_NULL(pMem))
{
//printf("MALLOC at %p, In func:%s, line:%d, allocated %d bytes.", pMem, pszFunc, uLine, uSize);
}
else
{
printf("Allocate memory failed!");
}
retur... | false | false | false | false | false | 0 |
init()
{
m_odd = m_known = false;
K3ListView *lv = static_cast<K3ListView *>(listView());
setDragEnabled( dragEnabled() || lv->dragEnabled() );
emit lv->itemAdded(this);
} | false | false | false | false | false | 0 |
prot_printstring(struct protstream *out, const char *s)
{
const char *p;
int len = 0;
if (!s) return prot_printf(out, "NIL");
/* Look for any non-QCHAR characters */
for (p = s; *p && len < 1024; p++) {
len++;
if (*p & 0x80 || *p == '\r' || *p == '\n'
|| *p == '\"' || *p == '%' || *p == '\\... | false | false | false | false | false | 0 |
dnd_album_drag_drop(GtkWidget *widget, GdkDragContext *drag_context, gint x, gint y, guint time, gpointer user_data) {
GdkAtom target;
target = gtk_drag_dest_find_target(widget, drag_context, NULL);
if (target != GDK_NONE) {
gboolean rowfound;
/* determine whether a row has been dropped ov... | false | false | false | false | false | 0 |
PR_GetConnectStatus(const PRPollDesc *pd)
{
/* Find the NSPR layer and invoke its connectcontinue method */
PRFileDesc *bottom = PR_GetIdentitiesLayer(pd->fd, PR_NSPR_IO_LAYER);
if (NULL == bottom)
{
PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0);
return PR_FAILURE;
}
return pt_Conne... | false | false | false | false | false | 0 |
state_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{
u32 state;
ssize_t ret = 0;
struct extcon_dev *edev = dev_get_drvdata(dev);
ret = sscanf(buf, "0x%x", &state);
if (ret == 0)
ret = -EINVAL;
else
ret = extcon_set_state(edev, state);
if (ret < 0)
return r... | false | false | false | false | false | 0 |
crcCalc(
HANDLE_FDK_CRCINFO hCrcInfo,
HANDLE_FDK_BITSTREAM hBs,
const INT reg
)
{
USHORT crc = hCrcInfo->crcValue;
CCrcRegData *rD = &hCrcInfo->crcRegData[reg];
FDK_BITSTREAM bsReader;
if (hBs->ConfigCache==BS_READER) {
bsReader ... | false | false | false | false | false | 0 |
_equalCommonTableExpr(CommonTableExpr *a, CommonTableExpr *b)
{
COMPARE_STRING_FIELD(ctename);
COMPARE_NODE_FIELD(aliascolnames);
COMPARE_NODE_FIELD(ctequery);
COMPARE_LOCATION_FIELD(location);
COMPARE_SCALAR_FIELD(cterecursive);
COMPARE_SCALAR_FIELD(cterefcount);
COMPARE_NODE_FIELD(ctecolnames);
COMPARE_NODE_F... | false | false | false | false | false | 0 |
cusexmp_write(fuse_req_t req, const char *buf, size_t size,
off_t off, struct fuse_file_info *fi)
{
(void)fi;
if (cusexmp_expand(off + size)) {
fuse_reply_err(req, ENOMEM);
return;
}
memcpy(cusexmp_buf + off, buf, size);
fuse_reply_write(req, size);
} | false | true | false | false | false | 1 |
ApplyTransform_Field(Field field, Matrix *matrix)
{
AT_field_args args;
field = (Field)DXCopy((Object)field, COPY_STRUCTURE);
if (! field)
return NULL;
if (! matrix)
return field;
args.field = field;
args.matrix = *matrix;
if (! DXAddTask(AT_field_task, (Pointer)&args, sizeof(args), 1... | false | false | false | false | false | 0 |
_endhtent (void)
{
if (hostf && !stayopen) {
(void) fclose(hostf);
hostf = NULL;
}
} | false | false | false | false | false | 0 |
playback_pcm_cleanup(struct hda_pcm_stream *hinfo,
struct hda_codec *codec,
struct snd_pcm_substream *substream)
{
struct hda_gen_spec *spec = codec->spec;
int err;
err = snd_hda_multi_out_analog_cleanup(codec, &spec->multiout);
if (!err)
call_pcm_playback_hook(hinfo, codec, substream,
HDA_GEN... | false | false | false | false | false | 0 |
em28xx_init_buttons(struct em28xx *dev)
{
u8 i = 0, j = 0;
bool addr_new = false;
dev->button_polling_interval = EM28XX_BUTTONS_DEBOUNCED_QUERY_INTERVAL;
while (dev->board.buttons[i].role >= 0 &&
dev->board.buttons[i].role < EM28XX_NUM_BUTTON_ROLES) {
struct em28xx_button *button = &dev->board.buttons[i... | false | false | false | false | false | 0 |
__mloop_handle_action_without_mi(
MenuParameters *pmp, MenuReturn *pmret, double_keypress *pdkp,
mloop_evh_input_t *in, mloop_evh_data_t *med, mloop_static_info_t *msi,
MenuOptions *pops, Bool *pdoes_submenu_overlap,
Bool *pdoes_popdown_submenu_overlap)
{
pmret->flags.do_unpost_submenu = 0;
/* moved off menu, des... | false | false | false | false | false | 0 |
read_proc_scsi_sg_devices_file(std::vector< std::vector<int> >& sg_entries)
{
std::string path;
if (!rconfig::get_data("system/linux_proc_scsi_sg_devices_path", path) || path.empty()) {
debug_out_warn("app", DBG_FUNC_MSG << "Sg devices file path is not set.\n");
return "Sg devices path is not set.";
}
hz::File... | false | false | false | false | false | 0 |
internal_code_pressed(InputCode code)
{
const struct KeyboardInfo *keyinfo;
const struct JoystickInfo *joyinfo;
assert( code < code_mac );
if (code < __code_max)
{
switch (code_map[code].type)
{
case CODE_TYPE_KEYBOARD :
keyinfo = internal_code_find_keyboard(code);
if (keyinfo)
... | false | false | false | false | false | 0 |
s5k5baf_set_fmt(struct v4l2_subdev *sd, struct v4l2_subdev_pad_config *cfg,
struct v4l2_subdev_format *fmt)
{
struct v4l2_mbus_framefmt *mf = &fmt->format;
struct s5k5baf *state = to_s5k5baf(sd);
const struct s5k5baf_pixfmt *pixfmt;
int ret = 0;
mf->field = V4L2_FIELD_NONE;
if (fmt->which == V4L2_SUBDEV_FO... | false | false | false | false | false | 0 |
gtr_xml_open_file (const gchar * filename)
{
xmlDocPtr doc;
g_return_val_if_fail (filename != NULL, NULL);
doc = xmlParseFile (filename);
return doc;
} | false | false | false | false | false | 0 |
AllocTempString(int len)
{
TEMPSTR * head;
char * cp;
if ((len <= 0) || (len > TEMPSTR_MAX_SIZE))
{
fprintf(stderr, "Allocating bad length %d\n", len);
exit(1);
}
if (len > tempStrAvail)
{
head = (TEMPSTR *) AllocMemory(sizeof(TEMPSTR));
head->next = tempStrList;
tempStrList = head;
tempStrAvai... | false | false | false | false | false | 0 |
sk_animate(struct s_skier *s, int state)
{
struct frame *f = s->current_frame;
if (state == NEXT_FRAME) {
for (; f; SWITCH(f))
if (f->state != s->current_frame->state)
break;
s->current_frame = f;
} else if (state == NEXT_GRASP) {
if (s->current_frame->next &&
s->current_frame->next->state ==
s->... | false | false | false | true | false | 1 |
SimpleJobTest() {
QString sequence;
AppendCharacterJob job( QChar( '1' ), &sequence, this );
ThreadWeaver::Weaver::instance()->enqueue ( &job );
ThreadWeaver::Weaver::instance()->finish();
QCOMPARE ( sequence, QString( "1" ) );
} | false | false | false | false | false | 0 |
get_book_at_row (EContactStore *contact_store,
gint row)
{
GArray *array;
ContactSource *source;
gint source_index;
source_index = find_contact_source_by_offset (contact_store, row);
if (source_index < 0)
return NULL;
array = contact_store->priv->contact_sources;
source = &g_array_index (arr... | false | false | false | false | false | 0 |
write( const TokenizerString &str, bool appendData )
{
if ( !m_noErrors && appendData )
return;
// check if we try to re-enter inside write()
// if so buffer the data
if (m_insideWrite) {
m_bufferedData.append(str.toString());
return;
}
m_insideWrite = true;
if ( a... | false | false | false | false | false | 0 |
karatsuba_size(u32bit z_size,
u32bit x_size, u32bit x_sw,
u32bit y_size, u32bit y_sw)
{
if(x_sw > x_size || x_sw > y_size || y_sw > x_size || y_sw > y_size)
return 0;
if(((x_size == x_sw) && (x_size % 2)) ||
((y_size == y_sw) && (y_size % 2)))
retu... | false | false | false | false | false | 0 |
createPage(
int index)
{
switch (index)
{
case 0:
{
m_page1 = new WizardSelectUpdatesPage(this);
return m_page1;
}
break;
case 1:
{
m_page2 = new WizardProgressPage(this, "", "");
// Hook up downloader signals ... | false | false | false | false | false | 0 |
rtc_valid_tm(struct rtc_time *tm)
{
if (tm->tm_year < 70
|| ((unsigned)tm->tm_mon) >= 12
|| tm->tm_mday < 1
|| tm->tm_mday > rtc_month_days(tm->tm_mon, tm->tm_year + 1900)
|| ((unsigned)tm->tm_hour) >= 24
|| ((unsigned)tm->tm_min) >= 60
|| ((unsigned)tm->tm_sec) >= 60)
return -EINVAL;
return 0;
} | false | false | false | false | false | 0 |
mono_method_full_name (MonoMethod *method, gboolean signature)
{
char *res;
char wrapper [64];
char *klass_desc = mono_type_full_name (&method->klass->byval_arg);
char *inst_desc = NULL;
if (method->is_inflated && ((MonoMethodInflated*)method)->context.method_inst) {
GString *str = g_string_new ("");
g_string... | true | true | false | false | false | 1 |
html_strlength_utf8(const char *s) {
/* This only knows about jp chars in the range 1110xxxx 10xxxxxx 10xxxxxx.
Other languages using UTF-8 would need new code. */
const unsigned char *t;
size_t i;
for (i = 0, t = (const unsigned char *)s; *t != '\0'; t++) {
if ((*t & 0xf0) == 0xe0 && (*(t + 1) & 0xc0... | false | false | false | false | false | 0 |
_packet_dump_hdr (ipmiconsole_ctx_t c,
ipmiconsole_packet_type_t p,
char *hdr,
unsigned int hdrlen)
{
uint8_t packet_type;
uint8_t packet_direction;
const char *str_cmd = NULL;
assert (c);
assert (c->magic == IPMICONSOLE_CTX_MAGIC);
assert (IPMICONSOLE_... | false | false | false | false | false | 0 |
sed1330_close(Driver * drvthis)
{
PrivateData *p = drvthis->private_data;
debug(RPT_DEBUG, "%s()", __FUNCTION__);
if (p != NULL) {
int i, j;
for (i = 0; i < KEYPAD_MAXX; i++) {
if (p->keyMapDirect[i] != NULL)
free(p->keyMapDirect[i]);
for (j = 0; j < KEYPAD_MAXY; j++) {
if (p->keyMapMatrix[i][j]... | false | false | false | false | false | 0 |
filesize(f)
int f;
{
#if HAVE_STAT
struct stat statbuf;
if (fstat(f, &statbuf) >= 0)
return ((POSITION) statbuf.st_size);
#else
#ifdef _OSK
long size;
if ((size = (long) _gs_size(f)) >= 0)
return ((POSITION) size);
#endif
#endif
return (seek_filesize(f));
} | false | false | false | false | false | 0 |
broadcast_from_server(char* Num, int Flag, int Message, char *String)
{
int Cnt;
for(Cnt = first_descr; Cnt < socket_size(sockets); Cnt++)
{
if (sockets[Cnt].fp == NULL &&
sockets[Cnt].waitstatus == WF_NOTHING &&
User_Get_Message(sockets[Cnt].f_username,sockets[Cnt].f_hostname,Num,Flag) ... | false | false | false | false | false | 0 |
xwcsdup(CHAR_T *str) {
if (!str) return NULL;
return xmemdup(str, (xwcslen(str)+1) * sizeof(CHAR_T));
} | false | false | false | false | false | 0 |
sh_eth_select_mii(struct net_device *ndev)
{
u32 value = 0x0;
struct sh_eth_private *mdp = netdev_priv(ndev);
switch (mdp->phy_interface) {
case PHY_INTERFACE_MODE_GMII:
value = 0x2;
break;
case PHY_INTERFACE_MODE_MII:
value = 0x1;
break;
case PHY_INTERFACE_MODE_RMII:
value = 0x0;
break;
default:
... | false | false | false | false | false | 0 |
real_print_obs_marker (int t, const DATASET *dset,
int len, int pad, PRN *prn)
{
char tmp[OBSLEN] = {0};
int thislen = len;
if (dataset_has_markers(dset)) {
strcpy(tmp, dset->S[t]);
thislen = get_utf_width(tmp, len);
} else {
ntodate(tmp, t, dset);
}
if (pad) {
pprintf(prn, "%*s ",... | false | false | false | false | false | 0 |
get_hexstr_from_byte_array(const uint8_t *bt, int length)
{
char *hex_str;
int i, j;
hex_str = g_try_malloc0(((length*2)+1) * sizeof(char));
if (hex_str == NULL)
return NULL;
for (i = 0, j = 0; i < length; i++, j += 2)
snprintf(hex_str+j, 3, "%02x", bt[i]);
return hex_str;
} | false | false | false | false | false | 0 |
rssyl_refresh_cb(GtkAction *action, gpointer data)
{
FolderView *folderview = (FolderView *)data;
FolderItem *item;
RSSylFolderItem *ritem;
item = folderview_get_selected_item(folderview);
g_return_if_fail(item != NULL);
g_return_if_fail(item->folder != NULL);
ritem = (RSSylFolderItem *)item;
if (prefs_commo... | false | false | false | false | false | 0 |
archoutdir(VOID_A)
{
char *cp, *file;
if (!*archivedir) return((char *)-1);
if (!(file = searcharchdir(NULL, 0))) return(NULL);
cp = &(file[(int)strlen(file) - 1]);
while (cp > file && *cp == _SC_) cp--;
#ifdef BSPATHDELIM
if (onkanji1(file, cp - file)) cp++;
#endif
cp = strrdelim2(file, 0, cp);
if (!cp) *arc... | false | false | false | false | false | 0 |
Convert(const void* in_data, size_t in_size,
void* out_data, size_t out_size,
size_t* size_read, size_t* size_written)
{
size_t written = 0;
size_t bread = 0;
//while ((written + (6 * 2 * 256 * 2)) < out_size && (bread + 2000) < in_size)
for (;;)
{
int len = p_a52_syncinfo((unsigned char*)in_data +... | false | false | false | false | false | 0 |
gfx_v8_0_init_compute_vmid(struct amdgpu_device *adev)
{
int i;
uint32_t sh_mem_config;
uint32_t sh_mem_bases;
/*
* Configure apertures:
* LDS: 0x60000000'00000000 - 0x60000001'00000000 (4GB)
* Scratch: 0x60000001'00000000 - 0x60000002'00000000 (4GB)
* GPUVM: 0x60010000'00000000 - 0x60020... | false | false | false | false | false | 0 |
GetNext(wxPoint2DInt &pt)
{
wxCHECK_MSG(m_type == wxBISI_POINT, false, wxT("wrong selection type"));
if ((m_blocks.GetCount() < 1u) || (m_block_index >= int(m_blocks.GetCount())))
return false;
// first time here
if (m_block_index < 0)
{
m_block_index = 0;
pt = m_pt = m_bloc... | false | false | false | false | false | 0 |
jack_controller_patchbay_find_port_by_names(
struct jack_controller_patchbay *patchbay_ptr,
const char *client_name,
const char *port_name)
{
struct jack_graph_client *client_ptr;
client_ptr = jack_controller_patchbay_find_client(patchbay_ptr, client_name, strlen(client_name));
if (client_ptr =... | false | false | false | false | false | 0 |
checkLibrary(const QString &path, const QString &name)
{
QString str =
//"#include <stdio.h>\n"
"int main()\n"
"{\n"
//" printf(\"library checker running\\n\");\n"
" return 0;\n"
"}\n";
QString libs;
if(!path.isEmpty())
libs += QString("-L") + path + ' ';
libs += QString("-l") + name;
if(!doCo... | false | false | false | false | false | 0 |
FillRaidOrPartyTargets(UnitList& targetUnitMap, Unit* member, Unit* center, float radius, bool raid, bool withPets, bool withcaster)
{
Player* pMember = member->GetCharmerOrOwnerPlayerOrPlayerItself();
Group* pGroup = pMember ? pMember->GetGroup() : NULL;
if (pGroup)
{
uint8 subgroup = pMember-... | false | false | false | false | false | 0 |
spot_cookie(request_rec *r)
{
cookie_dir_rec *dcfg = ap_get_module_config(r->per_dir_config,
&usertrack_module);
const char *cookie_header;
ap_regmatch_t regm[NUM_SUBS];
/* Do not run in subrequests */
if (!dcfg->enabled || r->main) {
return D... | false | false | false | false | false | 0 |
sdb_engine_execute_non_select_sql (SymbolDBEngine * dbe, const gchar *sql)
{
GdaStatement *stmt;
gint nrows;
SymbolDBEnginePriv *priv;
const gchar *remain;
priv = dbe->priv;
stmt = gda_sql_parser_parse_string (priv->sql_parser,
sql, &remain, NULL);
if (stmt == NULL)
return -1;
nrows = gda_... | false | false | false | false | false | 0 |
vqueue_print(vqueue_t * q)
{
cmph_uint32 i;
for (i = q->beg; i != q->end; i = (i + 1)%q->capacity)
fprintf(stderr, "%u\n", q->values[(i + 1)%q->capacity]);
} | false | false | false | false | false | 0 |
hasHazard_(const MachineInstr &MI) {
bool HasHazard = false;
SmallVector<ValueType, 4> Objs;
// Check underlying object list.
if (getUnderlyingObjects(MI, Objs)) {
for (SmallVectorImpl<ValueType>::const_iterator I = Objs.begin();
I != Objs.end(); ++I)
HasHazard |= updateDefsUses(*I, MI.maySt... | false | false | false | false | false | 0 |
on_file_parameter_changed(GtkFileChooser *const file_chooser, const void *const event_infos) {
const char *const s_value = gtk_file_chooser_get_filename(file_chooser);
char s_param[1024] = { 0 };
if (s_value && *s_value) cimg_snprintf(s_param,sizeof(s_param),"\"%s\"",s_value);
else std::strcpy(s_param,"\"\"");
... | false | false | false | false | false | 0 |
ban_check_object(struct object *o, const struct sess *sp, int has_req)
{
struct ban *b;
struct objcore *oc;
struct ban * volatile b0;
unsigned tests, skipped;
struct http *http;
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
CHECK_OBJ_NOTNULL(o, OBJECT_MAGIC);
oc = o->objcore;
CHECK_OBJ_NOTNULL(oc, OBJCORE_MAGIC);
CHECK... | false | false | false | true | false | 1 |
ipmi_mc_get_deviceid(struct ipmi_intf * intf)
{
struct ipmi_rs * rsp;
struct ipmi_rq req;
struct ipm_devid_rsp *devid;
int i;
const char *product=NULL;
memset(&req, 0, sizeof(req));
req.msg.netfn = IPMI_NETFN_APP;
req.msg.cmd = BMC_GET_DEVICE_ID;
req.msg.data_len = 0;
rsp = intf->sendrecv(intf, &req);
if (... | false | false | false | false | false | 0 |
findindex (lua_State *L, Table *t, StkId key) {
int i;
if (ttisnil(key)) return -1; /* first iteration */
i = arrayindex(key);
if (0 < i && i <= t->sizearray) /* is `key' inside array part? */
return i-1; /* yes; that's the index (corrected to C) */
else {
Node *n = mainposition(t, key);
for (;... | false | false | false | false | false | 0 |
writeEnterSnapshot( void* userData,
uint64_t snapshotTime,
uint64_t eventTime,
uint64_t processId,
uint32_t function,
uint32_t scl,
void* ev... | false | false | false | false | false | 0 |
load_iso_entries (int iso,
GFunc read_entry_func,
gpointer user_data)
{
xmlTextReaderPtr reader;
ParserState state = STATE_START;
xmlChar iso_entries[32], iso_entry[32];
char *filename;
int ret = -1;
gedit_debug_message (DEBUG_PLUGINS, "Loading ISO-%d codes", iso);
filename = get_iso_codes_xml_name (is... | true | true | false | false | false | 1 |
scan_entries (size_t n, const STRUCT_UTMP *utmp_buf)
{
char *ttyname_b IF_LINT ( = NULL);
time_t boottime = TYPE_MINIMUM (time_t);
if (include_heading)
print_heading ();
if (my_line_only)
{
ttyname_b = ttyname (STDIN_FILENO);
if (!ttyname_b)
return;
if (STRNCMP_LIT (ttyname_b... | false | false | false | false | false | 0 |
explode(const string e,string s, const bool check)
{
vector<string> ret;
int iPos = s.find(e, 0);
int iPit = e.length();
while(iPos > -1)
{
if(iPos != 0 || check)
{
ret.push_back(s.substr(0,iPos));
}
s.erase(0,iPos+iPit);
iPos = s.find(e, 0);
}
if(s != "" || check)
{
ret.p... | false | false | false | false | false | 0 |
think_build_market()
{
if( no_neighbor_space ) // if there is no space in the neighbor area for building a new firm.
return 0;
Nation* nationPtr = nation_array[nation_recno];
//--- check whether the AI can build a new firm next this firm ---//
if( !nationPtr->can_ai_build(FIRM_MARKET) )
return 0;
//------... | false | false | false | false | false | 0 |
gfarray(D *d, I n) { A z; D *zv;
z=ga(FLT,1,n,NULL);
zv=DAV(z);
DO(n, zv[i]=d[i]);
R z;
} | false | false | false | false | false | 0 |
gdev_pdf_fillpage(gx_device *dev, gs_imager_state * pis, gx_device_color *pdevc)
{
gx_device_pdf *pdev = (gx_device_pdf *) dev;
int bottom = (pdev->ResourcesBeforeUsage ? 1 : 0);
if (gx_dc_pure_color(pdevc) == pdev->white && !is_in_page(pdev) && pdev->sbstack_depth <= bottom) {
/* PDF doesn't need ... | false | false | false | false | false | 0 |
back_subsume(Topform c, Lindex idx)
{
int nc = number_of_literals(c->literals);
if (nc == 0)
return NULL;
else {
Plist subsumees = NULL;
Context subst = get_context();
Literals clit = c->literals;
/* We only have to consider the first literal of c, because when
c subsumes a clause d, ... | false | false | false | false | false | 0 |
FExp(float *vec, int n)
{
int x;
for (x = 0; x < n; x++) vec[x] = exp(vec[x]);
} | false | false | false | false | false | 0 |
AddressUsesRegister(Register reg) const {
int code = reg.code();
ASSERT((buf_[0] & 0xC0) != 0xC0); // Always a memory operand.
// Start with only low three bits of base register. Initial decoding doesn't
// distinguish on the REX.B bit.
int base_code = buf_[0] & 0x07;
if (base_code == rsp.code()) {
// ... | false | false | false | false | false | 0 |
get_hint(struct hda_codec *codec, const char *key)
{
int i;
for (i = 0; i < codec->hints.used; i++) {
struct hda_hint *hint = snd_array_elem(&codec->hints, i);
if (!strcmp(hint->key, key))
return hint;
}
return NULL;
} | false | false | false | false | false | 0 |
ginBuildCallback(Relation index, HeapTuple htup, Datum *values,
bool *isnull, bool tupleIsAlive, void *state)
{
GinBuildState *buildstate = (GinBuildState *) state;
MemoryContext oldCtx;
if (*isnull)
return;
oldCtx = MemoryContextSwitchTo(buildstate->tmpCtx);
buildstate->indtuples += ginHeapTupleBulkIns... | false | false | false | false | false | 0 |
got_users (GObject *object,
GAsyncResult *res,
gpointer data)
{
UmUserManager *manager = data;
GVariant *result;
GError *error = NULL;
result = g_dbus_proxy_call_finish (G_DBUS_PROXY (object), res, &error);
if (!result) {
man... | false | false | false | false | false | 0 |
strrcmp(const char *s, const char *sub)
{
int slen, sublen;
if (!s || !sub)
return 1;
slen = strlen(s);
sublen = strlen(sub);
if ((slen == 0) || (sublen == 0))
return 1;
if (sublen > slen)
return 1;
return memcmp(s + slen - sublen, sub, sublen);
} | false | false | false | false | false | 0 |
_mesa_PopMatrix( void )
{
GET_CURRENT_CONTEXT(ctx);
struct gl_matrix_stack *stack = ctx->CurrentStack;
FLUSH_VERTICES(ctx, 0);
if (MESA_VERBOSE&VERBOSE_API)
_mesa_debug(ctx, "glPopMatrix %s\n",
_mesa_lookup_enum_by_nr(ctx->Transform.MatrixMode));
if (stack->Depth == 0) {
... | false | false | false | false | false | 0 |
ResumeInternal()
{
if(input)
input->ResumeSlave();
if(output && input != output)
output->ResumeSlave();
super::ResumeInternal();
} | false | false | false | false | false | 0 |
cavan_route_table_init(struct cavan_route_table *table, size_t table_size)
{
struct cavan_route_node **pp, **pp_end;
pp = malloc(table_size * sizeof(void *));
if (pp == NULL)
{
return -ENOMEM;
}
table->route_table = pp;
for (pp_end = pp + table_size; pp < pp_end; pp++)
{
*pp = NULL;
}
table->table_siz... | false | true | false | false | true | 1 |
lynxfb_ops_copyarea(struct fb_info *info,
const struct fb_copyarea *region)
{
struct lynxfb_par *par;
struct sm750_dev *sm750_dev;
unsigned int base, pitch, Bpp;
par = info->par;
sm750_dev = par->dev;
/*
* each time 2d function begin to work,below three variable always need
* be set, seems we can put th... | false | false | false | false | false | 0 |
nv50_gr_construct_xfer_tex(struct nvkm_grctx *ctx)
{
struct nvkm_device *device = ctx->device;
xf_emit(ctx, 2, 0); /* 1 LINKED_TSC. yes, 2. */
if (device->chipset != 0x50)
xf_emit(ctx, 1, 0); /* 3 */
xf_emit(ctx, 1, 1); /* 1ffff BLIT_DU_DX_INT */
xf_emit(ctx, 1, 0); /* fffff BLIT_DU_DX_FRACT */
xf_emit(ctx, ... | false | false | false | false | false | 0 |
patsolve( int _max_positions, bool _debug )
{
max_positions = _max_positions;
debug = _debug;
/* Initialize the suitable() macro variables. */
init();
/* Go to it. */
doit();
if ( Status == SearchAborted ) // thread quit
{
firstMoves.clear();
winMoves.clear();
}
#i... | false | false | false | false | false | 0 |
required_string_3(char *str1, char *str2, char *str3)
{
int count = 0;
ignore_white_space();
while (count < RS_MAX_TRIES) {
if (strnicmp(str1, Mp, strlen(str1)) == 0) {
// Mp += strlen(str1);
diag_printf("Found required string [%s]\n", token_found = str1);
return 0;
} else if (strnicmp(str2, Mp, strle... | false | false | false | false | false | 0 |
sol_has_mergeable_solutions(struct isl_sol *sol)
{
if (sol->error)
return 0;
if (!sol->partial)
return 0;
if (!sol->partial->next)
return 0;
return sol->partial->level == sol->partial->next->level;
} | false | false | false | false | false | 0 |
ColumnIndex(const char *columnName) const
{
unsigned columnIndex;
for (columnIndex=0; columnIndex<columns.Size(); columnIndex++)
if (strcmp(columnName, columns[columnIndex].columnName)==0)
return columnIndex;
return (unsigned)-1;
} | false | false | false | false | false | 0 |
CopyWord(const double dfValueIn, short &nValueOut)
{
double dfMaxVal, dfMinVal;
GetDataLimits<double, short>(dfMaxVal, dfMinVal);
double dfValue = dfValueIn > 0.0 ? dfValueIn + 0.5 :
dfValueIn - 0.5;
nValueOut = static_cast<short>(
ClampValue(dfValue, dfMaxVal, dfMinVal));
} | false | false | false | false | false | 0 |
_uid64(Request& r, MethodParams& /*params*/) {
unsigned char id[64/8];
random(&id, sizeof(id));
r.write_pass_lang(*new String(hex_string(id, sizeof(id), true)));
} | false | false | false | false | false | 0 |
PGTYPESnumeric_to_decimal(numeric *src, decimal *dst)
{
int i;
if (src->ndigits > DECSIZE)
{
errno = PGTYPES_NUM_OVERFLOW;
return -1;
}
dst->weight = src->weight;
dst->rscale = src->rscale;
dst->dscale = src->dscale;
dst->sign = src->sign;
dst->ndigits = src->ndigits;
for (i = 0; i < src->ndigits; i+... | false | false | false | false | false | 0 |
newInstance()
{
if (!d->firstInstance) {
QList<KMainWindow*> allWindows = KMainWindow::memberList();
if (!allWindows.isEmpty()) {
// This method is documented to only work for applications
// with only one mainwindow.
KMainWindow* mainWindow = allWindows.first();
... | false | false | false | false | false | 0 |
phoney_im_channel_close (TpSvcChannel *iface,
DBusGMethodInvocation *context)
{
PhoneyIMChannel *self = PHONEY_IM_CHANNEL (iface);
PhoneyIMChannelPrivate *priv = PHONEY_IM_CHANNEL_GET_PRIVATE (self);
DEBUG ("Called with TpSvcChannel: %p", iface);
if (!priv->closed)
{
priv->closed = TRUE;
//FIXME this is ... | false | false | false | false | false | 0 |
example_contact_list_unblock_contacts_async (TpBaseContactList *contact_list,
TpHandleSet *contacts,
GAsyncReadyCallback callback,
gpointer user_data)
{
ExampleContactList *self = EXAMPLE_CONTACT_LIST (contact_list);
TpIntsetFastIter iter;
TpHandleSet *changed = tp_handle_set_new (self->priv->contact_... | false | false | false | false | false | 0 |
ValueAlreadyLiveAtInst(Value *Val,Value *KnownLive1,
Value *KnownLive2) {
// If Val is either of the known-live values, we know it is live!
if (Val == 0 || Val == KnownLive1 || Val == KnownLive2)
return true;
// All values other than instructions and argum... | false | false | false | false | false | 0 |
evas_object_focus_get(const Evas_Object *obj)
{
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
return 0;
MAGIC_CHECK_END();
return obj->focused;
} | false | false | false | false | false | 0 |
xdr_guestfs_md_create_args (XDR *xdrs, guestfs_md_create_args *objp)
{
register int32_t *buf;
if (!xdr_string (xdrs, &objp->name, ~0))
return FALSE;
if (!xdr_array (xdrs, (char **)&objp->devices.devices_val, (u_int *) &objp->devices.devices_len, ~0,
sizeof (guestfs_str), (xdrproc_t) xdr_guestfs_str))
retu... | false | false | false | false | false | 0 |
insert_interval(sbcell_t *data, int start, int stop, int *keys, int plus)
{
int center = start + ((stop - start) >> 1);
data->key = keys[center];
if (start == stop)
return;
if (center > start)
insert_interval(data + plus, start, center - 1, keys, plus << 1);
if (center < stop)
insert_interval(data + plus... | false | false | false | false | false | 0 |
ssd_init_chardev(struct ssd_device *dev)
{
int ret = 0;
if (dev->slave) {
return 0;
}
#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,12))
ret = devfs_mk_cdev(MKDEV((dev_t)dev->cmajor, (dev_t)dev->idx), S_IFCHR|S_IRUSR|S_IWUSR, "c%s", dev->name);
if (ret) {
goto out;
}
class_simple_device_add(ssd_class, MKDE... | false | false | false | false | false | 0 |
visichar(int ch)
{
static char temp[10];
ch = UChar(ch);
assert(ch >= 0 && ch < 256);
if (ch == '\\') {
strcpy(temp, "\\\\");
} else if (ch == '\033') {
strcpy(temp, "\\E");
} else if (ch < ' ') {
sprintf(temp, "\\%03o", ch);
} else if (ch >= 127) {
sprintf(temp, "\\%03o", ch);
} el... | false | false | false | false | false | 0 |
setBinWidthFromSlider()
{
binWidthLineEdit->setText(QString("%1").arg(binWidthSlider->value()));
setData(false);
} | false | false | false | false | false | 0 |
php_filter_validate_regexp(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
{
zval **option_val;
char *regexp;
int regexp_len;
long option_flags;
int regexp_set, option_flags_set;
pcre *re = NULL;
pcre_extra *pcre_extra = NULL;
int preg_options = 0;
int ovector[3];
int matches;
/* Parse ... | false | false | false | false | false | 0 |
setvalue(Widget w, XtPointer address, XrmQuark type, Cardinal size)
#else
static void setvalue(w, address, type, size)
Widget w;
XtPointer address;
XrmQuark type;
Cardinal size;
#endif
{
XmtChooserWidget cw = (XmtChooserWidget) w;
if (cw->chooser.values) {
if (XrmStringToQuark(cw->chooser.value_type) == type)... | false | false | false | false | false | 0 |
UpdateChroma(const fixed_y_t* src1,
const fixed_y_t* src2,
fixed_t* dst, fixed_y_t* tmp, int len) {
while (len--> 0) {
const float r = ScaleDown(src1[0], src1[3], src2[0], src2[3]);
const float g = ScaleDown(src1[1], src1[4], src2[1], s... | false | false | false | false | false | 0 |
album_model_get_index_with_album_item(AlbumModel *model, AlbumItem *item) {
g_return_val_if_fail(model, -1);
AlbumModelPrivate *priv = ALBUM_MODEL_GET_PRIVATE (model);
gchar *trk_key = _create_key(item->artist, item->albumname);
gint index = _get_index(priv, trk_key);
g_free(trk_key);
return i... | false | false | false | false | false | 0 |
storeGetPublicByRequest(request_t * req)
{
StoreEntry *e = storeGetPublicByRequestMethod(req, req->method);
if (e == NULL && req->method->code == METHOD_HEAD)
/* We can generate a HEAD reply from a cached GET object */
e = storeGetPublicByRequestMethodCode(req, METHOD_GET);
return e;
} | false | false | false | false | false | 0 |
pushch(char ch)
{
if (!ch)
{
phead = ptail = 0;
}
if (phead < BSIZE)
{
pushq[phead++] = ch;
}
return;
} | false | false | false | false | false | 0 |
main(int argc, char **argv)
{
uint32 i, seconds, fractions, port = VERSE_STD_CONNECT_PORT;
signal(SIGINT, cb_sigint_handler);
vs_master_set_address("master.uni-verse.org"); /* The default master address. */
vs_master_set_enabled(FALSE); /* Make sure master server support is disabled. */
for(i = 1; i < (uint... | false | false | false | false | false | 0 |
IsLoopback(void) const
{
if (GetIPVersion()==4)
{
// unsigned long l = htonl(address.addr4.sin_addr.s_addr);
if (htonl(address.addr4.sin_addr.s_addr)==2130706433)
return true;
if (address.addr4.sin_addr.s_addr==0)
return true;
}
#if RAKNET_SUPPORT_IPV6==1
else
{
const static char localho... | false | false | false | false | false | 0 |
loadFile(const OFFilename &fileName,
const E_TransferSyntax readXfer,
const E_GrpLenEncoding groupLength,
const Uint32 maxReadLength)
{
OFCondition l_error = EC_InvalidFilename;
/* check parameters first */
... | false | false | false | false | false | 0 |
bnx2x_mcast_hdl_add_e1h(struct bnx2x *bp,
struct bnx2x_mcast_obj *o,
struct bnx2x_mcast_ramrod_params *p,
u32 *mc_filter)
{
struct bnx2x_mcast_list_elem *mlist_pos;
int bit;
list_for_each_entry(mlist_pos, &p->mcast_list, link) {
bit = bnx2x_mcast_bin_from_mac(mlist_pos->mac);
BNX2X_57711... | false | false | false | false | false | 0 |
config() const
{
if (!d->extender->d->applet) {
return KConfigGroup();
}
KConfigGroup cg = d->extender->d->applet.data()->config("ExtenderItems");
KConfigGroup itemCg = KConfigGroup(&cg, QString::number(d->extenderItemId));
//we try to figure out if we are a transient ExtenderItem
//if... | 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.