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 |
|---|---|---|---|---|---|---|
save_ea_block(struct metafd *mfd, struct gfs2_buffer_head *metabh)
{
int i, e, ea_len = sbd.bsize;
struct gfs2_ea_header ea;
for (e = sizeof(struct gfs2_meta_header); e < sbd.bsize; e += ea_len) {
uint64_t blk, *b;
int charoff;
gfs2_ea_header_in(&ea, metabh->b_data + e);
for (i = 0; i < ea.ea_num_ptrs; i++... | false | false | false | false | false | 0 |
http_PutField(struct worker *w, unsigned vsl_id, const struct http *to,
int field, const char *string)
{
char *p;
unsigned l;
CHECK_OBJ_NOTNULL(to, HTTP_MAGIC);
l = strlen(string);
p = WS_Alloc(to->ws, l + 1);
if (p == NULL) {
WSL(w, SLT_LostHeader, vsl_id, "%s", string);
to->hd[field].b = NULL;
to->hd... | false | false | false | true | false | 1 |
ixgb_update_eeprom_checksum(struct ixgb_hw *hw)
{
u16 checksum = 0;
u16 i;
for (i = 0; i < EEPROM_CHECKSUM_REG; i++)
checksum += ixgb_read_eeprom(hw, i);
checksum = (u16) EEPROM_SUM - checksum;
ixgb_write_eeprom(hw, EEPROM_CHECKSUM_REG, checksum);
} | false | false | false | false | false | 0 |
kcm_ccache_resolve_client(krb5_context context,
kcm_client *client,
kcm_operation opcode,
const char *name,
kcm_ccache *ccache)
{
krb5_error_code ret;
const char *estr;
ret = kcm_ccache_resolve(context, name, ccache);
if (ret) {
estr = krb5_get_error_message(context, ret);
kcm_log... | false | false | false | false | false | 0 |
qinstance_message_trash_all_of_type_X(lListElem *this_elem, u_long32 type)
{
bool ret = true;
DENTER(TOP_LAYER, "qinstance_message_trash_all_of_type_X");
object_message_trash_all_of_type_X(this_elem, QU_message_list, type);
DRETURN(ret);
} | false | false | false | false | false | 0 |
getBuckets(unsigned char *s,
unsigned int *bkt, unsigned int n,
unsigned int K, bool end) {
unsigned int i, sum=0;
// clear all buckets .
for(i=0; i<K; i++) bkt[i]=0;
// compute the size of each bucket .
for(i=0; i<n; i++) bkt[s[i]]++;
for(i=0; i<K; i++) {
sum+=bkt[i];
bkt[i]=end ... | false | false | false | false | false | 0 |
onMouseButtonUp(MouseEventArgs& e)
{
if ((e.button == LeftButton) && isPushed())
{
Window* sheet = System::getSingleton().getGUISheet();
if (sheet)
{
// if mouse was released over this widget
// (use mouse position, as e.position has been unprojected)
if (this == sheet->getTargetChildAtPositi... | false | false | false | false | false | 0 |
seaudit_message_to_string(const seaudit_message_t * msg)
{
char date[DATE_STR_SIZE];
if (msg == NULL) {
errno = EINVAL;
return NULL;
}
strftime(date, DATE_STR_SIZE, "%b %d %H:%M:%S", msg->date_stamp);
switch (msg->type) {
case SEAUDIT_MESSAGE_TYPE_AVC:
return avc_message_to_string(msg, date);
case SEAUDIT_... | false | false | false | false | false | 0 |
get()
{
if (_pCurrent == _pEnd)
refill();
if (_pCurrent < _pEnd)
return *_pCurrent++;
else
return std::char_traits<char>::eof();
} | false | false | false | false | false | 0 |
intel_compute_pipe_wm(struct intel_crtc_state *cstate,
struct intel_pipe_wm *pipe_wm)
{
struct drm_crtc *crtc = cstate->base.crtc;
struct drm_device *dev = crtc->dev;
const struct drm_i915_private *dev_priv = dev->dev_private;
struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
struct intel_plane *intel_pla... | false | false | false | false | false | 0 |
erase_xpath_callback(xmlNode * msg, int call_id, int rc, xmlNode * output, void *user_data)
{
char *xpath = user_data;
do_crm_log_unlikely(rc == 0 ? LOG_DEBUG : LOG_NOTICE,
"Deletion of \"%s\": %s (rc=%d)", xpath, pcmk_strerror(rc), rc);
free(xpath);
} | false | false | false | false | false | 0 |
RIFF_CheckFormat ( XMP_FileFormat format,
XMP_StringPtr filePath,
LFA_FileRef file,
XMPFiles* parent )
{
IgnoreParam(format); IgnoreParam(parent);
XMP_Assert ( (format == kXMP_AVIFile) || (format == kXMP_WAVFile) );
LFA_Rewind( file );
XMP_Uns8 chunkID[12];
LFA_... | false | false | false | false | false | 0 |
on_gm_worlds_view_world_option_changed(GmOptions *options,
gchar const *key, GmWorldsView *view) {
GtkTreeIter iter;
GtkListStore *store = GTK_LIST_STORE(view->priv->model);
gchar *text;
gchar const *logo;
GdkPixbuf *pix_logo;
GmWorld *world;
if (!gm_worlds_view_find_by_options(view, options, &iter, &world)... | false | false | false | false | false | 0 |
list_element(FILE * out,
const char *element, const char *desc,
const char *mapset, int (*lister) (const char *,
const char *,
const char *))
{
char path[GPATH_MAX];
int count = 0;
char **list;
int i;
/*
* convert . to current mapset
*/
if (strcmp(mapset, "."... | false | false | false | false | false | 0 |
parseCondition(const Token &tok, std::list<ExecutionPath *> &checks) {
for (const Token *tok2 = &tok; tok2; tok2 = tok2->next()) {
if (tok2->str() == "(" || tok2->str() == ")" || tok2->str() == "&&" || tok2->str() == "||" || tok2->str() == "?")
break;
bool unknown = owner... | false | false | false | false | false | 0 |
mono_domain_set_config (MonoDomain *domain, const char *base_dir, const char *config_file_name)
{
MONO_OBJECT_SETREF (domain->setup, application_base, mono_string_new (domain, base_dir));
MONO_OBJECT_SETREF (domain->setup, configuration_file, mono_string_new (domain, config_file_name));
} | false | false | false | false | false | 0 |
get_size(const Lsymtab *symt, int type) /* ARGSUSED1 */
#else /* K&R style */
get_size(symt,type) /* ARGSUSED1 */
#endif /* HAVE_STDC */
/* Returns size of symbol if explicitly declared
or declared using IMPLICIT type*size statement.
Otherwise returns size_DEFAULT. */
#if HAVE_STDC
... | false | false | false | false | false | 0 |
keys_get(const kuid_t *id, dht_value_type_t type,
kuid_t **secondary, int secondary_count, dht_value_t **valvec, int valcnt,
float *loadptr, bool *cached)
{
struct keyinfo *ki;
struct keydata *kd;
int i;
int vcnt = valcnt;
dht_value_t **vvec = valvec;
g_assert(secondary_count == 0 || secondary != NULL);
g_ass... | false | false | false | false | false | 0 |
_clutter_meta_group_get_meta (ClutterMetaGroup *group,
const gchar *name)
{
GList *l;
for (l = group->meta; l != NULL; l = l->next)
{
ClutterActorMeta *meta = l->data;
if (g_strcmp0 (meta->priv->name, name) == 0)
return meta;
}
return NULL;
} | false | false | false | false | false | 0 |
gf_m4a_get_profile_name(u8 audio_pl)
{
switch (audio_pl) {
case 0x00: return "ISO Reserved (0x00)";
case 0x01: return "Main Audio Profile @ Level 1";
case 0x02: return "Main Audio Profile @ Level 2";
case 0x03: return "Main Audio Profile @ Level 3";
case 0x04: return "Main Audio Profile @ Level 4";
case 0x05: re... | false | false | false | false | false | 0 |
cmd_vdump (int interactive, struct cmdarg **args)
{
char *input;
struct cmdarg *arg;
int which = ARG(0, number);
rp_virtual *cur;
rp_screen *screen = current_screen();
arg = xmalloc (sizeof(struct cmdarg));
PRINT_DEBUG (("virtual workspace config:\n"));
list_for_each_entry (cur, &rp_virtuals, node) ... | false | false | false | false | false | 0 |
visitFABS(SDNode *N) {
SDValue N0 = N->getOperand(0);
ConstantFPSDNode *N0CFP = dyn_cast<ConstantFPSDNode>(N0);
EVT VT = N->getValueType(0);
// fold (fabs c1) -> fabs(c1)
if (N0CFP && VT != MVT::ppcf128)
return DAG.getNode(ISD::FABS, N->getDebugLoc(), VT, N0);
// fold (fabs (fabs x)) -> (fabs x)
if (... | false | false | false | false | false | 0 |
cz_dpm_debugfs_print_current_performance_level(struct amdgpu_device *adev,
struct seq_file *m)
{
struct cz_power_info *pi = cz_get_pi(adev);
struct amdgpu_clock_voltage_dependency_table *table =
&adev->pm.dpm.dyn_state.vddc_dependency_on_sclk;
struct amdgpu_uvd_clock_voltage_dependency_table *uvd_table... | false | false | false | false | false | 0 |
setFavoriteDatabase(QString fname)
{
QUrl url = QUrl::fromUserInput(fname);
if((url.scheme() == "http") || (url.scheme() == "ftp"))
{
m_databaseList->setFileFavorite(fname, true, 0);
}
else
{
m_databaseList->setFileFavorite(url.toLocalFile(), true, 0);
}
} | false | false | false | false | false | 0 |
commSetTcpKeepalive(int fd, int idle, int interval, int timeout)
{
int on = 1;
#ifdef TCP_KEEPCNT
if (timeout && interval) {
int count = (timeout + interval - 1) / interval;
if (setsockopt(fd, IPPROTO_TCP, TCP_KEEPCNT, &count, sizeof(on)) < 0)
debug(5, 1) ("commSetTcpKeepalive: FD %d: %s\n", fd, xstrerro... | false | false | false | false | false | 0 |
callLoadCallbacks(LoadState &state, Node node,
QList<LoadCallback *> &callbacks) {
QObject *o = state.map.value(node);
DEBUG << "callLoadCallbacks: " << node << " -> " << o << endl;
if (!o) return;
foreach (LoadCallback *cb, callbacks) {
cb->loa... | false | false | false | false | false | 0 |
bfa_rport_sm_deleting(struct bfa_rport_s *rp, enum bfa_rport_event event)
{
bfa_trc(rp->bfa, rp->rport_tag);
bfa_trc(rp->bfa, event);
switch (event) {
case BFA_RPORT_SM_FWRSP:
bfa_stats(rp, sm_del_fwrsp);
bfa_sm_set_state(rp, bfa_rport_sm_uninit);
bfa_rport_free(rp);
break;
case BFA_RPORT_SM_HWFAIL:
bf... | false | false | false | false | false | 0 |
ata_pio_sectors(struct ata_queued_cmd *qc)
{
if (is_multi_taskfile(&qc->tf)) {
/* READ/WRITE MULTIPLE */
unsigned int nsect;
WARN_ON_ONCE(qc->dev->multi_count == 0);
nsect = min((qc->nbytes - qc->curbytes) / qc->sect_size,
qc->dev->multi_count);
while (nsect--)
ata_pio_sector(qc);
} else
ata_p... | false | false | false | false | false | 0 |
build_rand_pad(unsigned char *buf, ssize_t len)
{
long tmp;
for (tmp = ast_random(); len > 0; tmp = ast_random()) {
memcpy(buf, (unsigned char *) &tmp, (len > sizeof(tmp)) ? sizeof(tmp) : len);
buf += sizeof(tmp);
len -= sizeof(tmp);
}
} | false | true | false | false | false | 1 |
addtab (head, key_str, field, valu)
struct entry **head ;
char *key_str;
int field ;
int valu ;
{
int found = 0;
int index ;
struct entry *entry_pnt;
index = ((unsigned long) key_str) % PAT_HSZDFN;
entry_pnt = head [index];
while (entry... | false | false | false | false | false | 0 |
_dbus_watch_list_add_watch (DBusWatchList *watch_list,
DBusWatch *watch)
{
if (!_dbus_list_append (&watch_list->watches, watch))
return FALSE;
_dbus_watch_ref (watch);
if (watch_list->add_watch_function != NULL)
{
_dbus_verbose ("Adding watch on fd %d\n",
... | false | false | false | false | false | 0 |
events_generator(const char *text, int len)
{
int i;
for (i = 0; events_all && events_all[i]; i++)
if (!xstrncasecmp(text, events_all[i], len))
array_add_check(&completions, xstrdup(events_all[i]), 1);
} | false | false | false | false | false | 0 |
right()
{
std::vector<unicode_char> line;
getText(cursorRow, line);
std::vector<unicode_char>::iterator
cursorPos=getIndexOfCol(line, cursorCol), end(line.end());
if (cursorPos == line.end())
{
if (cursorRow + 1 < numLines())
{
cursorCol=0;
cursorLineHorizShift=0;
++cursorRow;
drawLine(cursorR... | false | false | false | false | false | 0 |
__logfs_write_anchor(struct super_block *sb, void *_da,
u16 *type, size_t *len)
{
struct logfs_super *super = logfs_super(sb);
struct logfs_je_anchor *da = _da;
struct inode *inode = super->s_master_inode;
struct logfs_inode *li = logfs_inode(inode);
int i;
da->da_height = li->li_height;
da->da_last_ino = cpu... | false | false | false | false | false | 0 |
mpopulate ( void *start, size_t len ) {
/* Prevent free_memblock() from rounding up len beyond the end
* of what we were actually given...
*/
free_memblock ( start, ( len & ~( MIN_MEMBLOCK_SIZE - 1 ) ) );
} | false | false | false | false | false | 0 |
ms_biff_query_destroy (BiffQuery *q)
{
if (q) {
if (q->data_malloced) {
g_free (q->data);
q->data = NULL;
q->data_malloced = FALSE;
}
if (q->non_decrypted_data_malloced) {
g_free (q->non_decrypted_data);
q->non_decrypted_data = NULL;
q->non_decrypted_data_malloced = FALSE;
}
/* Paranoia: *... | false | false | false | false | false | 0 |
compile(Interpreter &interp, const Environment &env,
int stackPos, const InsnPtr &next)
{
return test1_->compile(interp, env, stackPos,
new OrInsn(optimizeCompile(test2_, interp, env,
stackPos, next),
next));
} | false | false | false | false | false | 0 |
ifuSetZeroLevel(cpl_image *extracted)
{
float *data = cpl_image_get_data(extracted);
int nx = cpl_image_get_size_x(extracted);
int ny = cpl_image_get_size_y(extracted);
int count;
int i, j;
double ratio;
for (j = 0; j < ny; j++) {
count = 0;
for (i = 0; ... | false | false | false | false | false | 0 |
metafix(request_rec *r, const char *buf)
{
meta *ret = NULL;
size_t offs = 0;
const char *p;
const char *q;
char *header;
char *content;
ap_regmatch_t pmatch[2];
char delim;
while (!ap_regexec(seek_meta, buf+offs, 2, pmatch, 0)) {
header = NULL;
content = NULL;
... | false | false | false | false | false | 0 |
find_obj(PDATA p, int num, OBJ *result) {
PMAP curr = p->table[num % TABLE_SIZE];
while (curr != NULL) {
if (curr->n == num) {
*result = curr->o;
return 1;
}
curr = curr->next;
}
return 0;
} | false | false | false | false | false | 0 |
copy_message(object *op, const char *msg) {
char *temp;
int size;
if (!msg)
return;
/* need to reset parsed dialog information */
free_dialog_information(op);
size = strlen(msg);
if (msg[0] != 0 && msg[size-1] == '\n') {
object_set_msg(op, msg);
return;
}
... | false | false | false | false | false | 0 |
filter_data_get(DBusConnection *connection,
DBusHandleMessageFunction filter,
const char *sender,
const char *path,
const char *interface,
const char *member,
const char *argument)
{
struct filter_data *data;
const char *name = NULL, *owner = NULL;
if (filter_data_find(connection) == N... | false | false | false | false | false | 0 |
isprime(size_t p)
{
size_t q, i;
for(i = 2 ; i < p; i++) {
q = p / i;
if (i * q == p)
return 0;
if (i * i > p)
return 1;
}
return 1;
} | false | false | false | false | false | 0 |
XmtDestroyPixmapIcon(Widget w)
#else
void XmtDestroyPixmapIcon(w)
Widget w;
#endif
{
Widget shell = XmtGetShell(w);
Display *dpy = XtDisplay(shell);
Window win;
XtVaGetValues(shell, XtNiconWindow, &win, NULL);
if (win == None) return;
XtVaSetValues(shell, XtNiconWindow, None, NULL);
XtRemo... | false | false | false | false | false | 0 |
scsi_eh_abort_cmds(struct list_head *work_q,
struct list_head *done_q)
{
struct scsi_cmnd *scmd, *next;
LIST_HEAD(check_list);
int rtn;
struct Scsi_Host *shost;
list_for_each_entry_safe(scmd, next, work_q, eh_entry) {
if (!(scmd->eh_eflags & SCSI_EH_CANCEL_CMD))
continue;
shost = scmd->device->hos... | false | false | false | false | false | 0 |
solviEliminateReal(const_diag_iter di, KronVector& d,
const KronVector& y, double divisor) const
{
for (const_row_iter ri = matrixF->row_begin(*di);
ri != matrixF->row_end(*di);
++ri) {
KronVector dk(d, ri.getCol());
dk.add(-(*ri)/divisor, y);
}
} | false | false | false | false | false | 0 |
int3400_thermal_get_uuids(struct int3400_thermal_priv *priv)
{
struct acpi_buffer buf = { ACPI_ALLOCATE_BUFFER, NULL};
union acpi_object *obja, *objb;
int i, j;
int result = 0;
acpi_status status;
status = acpi_evaluate_object(priv->adev->handle, "IDSP", NULL, &buf);
if (ACPI_FAILURE(status))
return -ENODEV;
... | false | false | false | false | false | 0 |
writeToFile(HFSPlusCatalogFile* file, AbstractFile* output, Volume* volume) {
unsigned char* buffer;
io_func* io;
off_t curPosition;
size_t bytesLeft;
buffer = (unsigned char*) malloc(BUFSIZE);
if(file->permissions.ownerFlags & UF_COMPRESSED) {
io = openHFSPlusCompressed(volume, file);
if(io == NULL) {
... | false | false | false | false | false | 0 |
toutf8(buf, s, max)
char *buf;
CONST u_char *s;
int max;
{
u_int c;
int i, j, len;
i = j = 0;
while (s[i] && j < max) {
c = toucs2(s, &i);
len = 1;
if (c >= 0x80) len++;
if (c >= 0x800) len++;
if (j + len > max) break;
j = ucs2toutf8(buf, j, c);
}
cnvunicode(0, -1);
if (kanjierrno) kanjierrno = DEFC... | false | false | false | false | false | 0 |
FCEU_fgetsize(FCEUFILE *fp)
{
if(fp->type==1)
{
int x,t;
t=gztell(fp->fp);
gzrewind(fp->fp);
for(x=0; gzgetc((gzFile)fp->fp) != EOF; x++);
gzseek(fp->fp,t,SEEK_SET);
return(x);
}
else if(fp->type>=2)
return ((MEMWRAP*)(fp->fp))->size;
else
{
long t,r;
t=ftell((FILE *)fp->fp);
fseek((FILE *)fp-... | false | false | false | false | false | 0 |
gst_rtsp_media_factory_uri_class_init (GstRTSPMediaFactoryURIClass * klass)
{
GObjectClass *gobject_class;
GstRTSPMediaFactoryClass *mediafactory_class;
gobject_class = G_OBJECT_CLASS (klass);
mediafactory_class = GST_RTSP_MEDIA_FACTORY_CLASS (klass);
gobject_class->get_property = gst_rtsp_media_factory_uri... | false | false | false | false | false | 0 |
hcr_base_qual_distr_new_from_file(FILE *fp,
GtAlphabet *alpha)
{
GtBaseQualDistr *bqd;
char read_char_code;
GtUchar cur_char_code;
unsigned char cur_qual;
unsigned alpha_size,
min_qual = HCR_HIGHESTQUALVALUE,
max_qual = HCR_LOWEST... | false | true | false | false | true | 1 |
collate()
{
datachunk *chunk = malloc(BYTE*sizeof(datachunk));
datachunk *collated = malloc(BYTE*sizeof(datachunk));
unsigned char *size, *type, *body, *crc;
unsigned int fullsize = 0, currtype = 0, deposit = 0;
unsigned int x;
size = (unsigned char *)malloc(BYTE*CH_SIZE);
type = (unsigned char *)malloc(BYTE*... | false | true | false | false | true | 1 |
lookup_path(struct fuse *f, fuse_ino_t nodeid,
const char *name, const char *path,
struct fuse_entry_param *e, struct fuse_file_info *fi)
{
int res;
memset(e, 0, sizeof(struct fuse_entry_param));
if (fi)
res = fuse_fs_fgetattr(f->fs, path, &e->attr, fi);
else
res = fuse_fs_getattr(f->fs, path... | false | false | false | false | false | 0 |
makeCacheKey(HttpConn *conn)
{
HttpRx *rx;
rx = conn->rx;
if (conn->tx->cache->flags & (HTTP_CACHE_ONLY | HTTP_CACHE_UNIQUE)) {
return sfmt("http::response-%s?%s", rx->pathInfo, httpGetParamsString(conn));
} else {
return sfmt("http::response-%s", rx->pathInfo);
}
} | false | false | false | false | false | 0 |
matrix_invert(const fn_call& fn)
{
// Doesn't have to be a Matrix
as_object* ptr = ensure<ValidThis>(fn);
MatrixType currentMatrix;
// This just saves repeating code to get doubles for each
// value.
fillMatrix(currentMatrix, *ptr);
const double determinant = getMinorDeterminant(curr... | false | false | false | false | false | 0 |
gkrellm_alert_get_alert_state(GkrellmAlert *alert, gboolean *alarm_state,
gboolean *warn_state)
{
if (!alert)
return;
if (warn_state)
*warn_state = (alert->high.warn_on || alert->low.warn_on);
if (alarm_state)
*alarm_state = (alert->high.alarm_on || alert->low.alarm_on);
} | false | false | false | false | false | 0 |
cache_entry_list_destructively (GConfClient *client,
GSList *entries)
{
GSList *tmp;
tmp = entries;
while (tmp != NULL)
{
GConfEntry* entry = tmp->data;
gconf_client_cache (client, TRUE, entry, FALSE);
tmp = g_slist_next (tmp);
}
... | false | false | false | false | false | 0 |
e_cal_backend_sync_get_object (ECalBackendSync *backend,
EDataCal *cal,
GCancellable *cancellable,
const gchar *uid,
const gchar *rid,
gchar **calobj,
... | false | false | false | true | false | 1 |
isNextGood(int bytes)
{
if (bytes <= 0)
return false;
// make sure it comes in before the header
if (myReadLength + bytes <= myLength - myFooterLength)
return true;
myIsValid = false;
return false;
} | false | false | false | false | false | 0 |
SSL_VersionRangeGet(PRFileDesc *fd, SSLVersionRange *vrange)
{
sslSocket *ss = ssl_FindSocket(fd);
if (!ss) {
SSL_DBG(("%d: SSL[%d]: bad socket in SSL3_VersionRangeGet",
SSL_GETPID(), fd));
return SECFailure;
}
if (!vrange) {
PORT_SetError(SEC_ERROR_INVALID_ARGS... | false | false | false | false | false | 0 |
get_plugin_active (Plugin *plugin)
{
gphpedit_debug(DEBUG_PLUGINS);
g_return_val_if_fail (plugin != NULL, FALSE);
PluginDetails *plugdet = PLUGIN_GET_PRIVATE(plugin);
return plugdet->active;
} | false | false | false | false | false | 0 |
EmitDwarfAdvanceFrameAddr(const MCSymbol *LastLabel,
const MCSymbol *Label) {
const MCExpr *AddrDelta = BuildSymbolDiff(getContext(), Label, LastLabel);
int64_t Res;
if (AddrDelta->EvaluateAsAbsolute(Res, getAssembler())) {
MCDwarfFrameEmitter::EmitAdvanceLoc(*... | false | false | false | false | false | 0 |
query_bool(const char *mes, ...)
{
// Translate the printf flags
va_list ap;
va_start(ap, mes);
char buff[6000];
vsprintf(buff, mes, ap);
va_end(ap);
// Append with (Y/N/Q)
std::string full_line = buff;
full_line += " (Y/N/Q)";
// Print the resulting text
print_line(full_line.c_str());
char ret;
do
ret = ge... | false | false | false | false | false | 0 |
ipr_read_trace(struct file *filp, struct kobject *kobj,
struct bin_attribute *bin_attr,
char *buf, loff_t off, size_t count)
{
struct device *dev = container_of(kobj, struct device, kobj);
struct Scsi_Host *shost = class_to_shost(dev);
struct ipr_ioa_cfg *ioa_cfg = (struct ipr_ioa_cfg *)shost->host... | false | false | false | false | false | 0 |
setMoveLock(bool moveLock)
{
m_moveLock = moveLock;
if (moveLock) {
if (m_moveLockItem == NULL) {
if (!MoveLockRenderer.isValid()) {
QString fn(":resources/images/part_lock.svg");
bool success = MoveLockRenderer.load(fn);
DebugDialog::debug(QString("movelock load success %1").arg(s... | false | false | false | false | false | 0 |
printable(const unsigned char *string, size_t size) {
char *result;
char *r;
const unsigned char *cp;
size_t outlen;
unsigned i;
/*
* If the input string is NULL, return an empty string.
*/
if (string == NULL) {
result = Malloc(1);
result[0] = '\0';
return result;
}
/*
* Determ... | false | true | false | false | false | 1 |
vxge_hw_vpath_poll_rx(struct __vxge_hw_ring *ring)
{
u8 t_code;
enum vxge_hw_status status = VXGE_HW_OK;
void *first_rxdh;
u64 val64 = 0;
int new_count = 0;
ring->cmpl_cnt = 0;
status = vxge_hw_ring_rxd_next_completed(ring, &first_rxdh, &t_code);
if (status == VXGE_HW_OK)
ring->callback(ring, first_rxdh,
... | false | false | false | false | false | 0 |
CreateMarkovStateVariable_File(FILE *f, char *filename)
{
FILE *f_in;
char *str, *str_old;
int err;
TMarkovStateVariable *sv=(TMarkovStateVariable*)NULL;
// Open file if necessary
if (f)
f_in=f;
else
if (!(f_in=fopen(filename,"rt")))
{
err=SWITCHIO_FILE_ERROR;
return (TMarko... | false | false | false | false | true | 1 |
nfsctl_transaction_read(struct file *file, char __user *buf, size_t size, loff_t *pos)
{
if (! file->private_data) {
/* An attempt to read a transaction file without writing
* causes a 0-byte write so that the file can return
* state information
*/
ssize_t rv = nfsctl_transaction_write(file, buf, 0, pos);... | false | false | false | false | false | 0 |
isWritable() const
{
if (!filePath().isEmpty()) {
if (KStandardDirs::checkAccess(filePath(), W_OK)) {
return true;
}
// The check might have failed because any of the containing dirs
// did not exist. If the file does not exist, check if the deepest
// existing di... | false | false | false | false | false | 0 |
DAC960_CheckStatusBuffer(DAC960_Controller_T *Controller,
unsigned int ByteCount)
{
unsigned char *NewStatusBuffer;
if (Controller->InitialStatusLength + 1 +
Controller->CurrentStatusLength + ByteCount + 1 <=
Controller->CombinedStatusBufferLength)
return true;
if (Controller->CombinedStatusB... | false | true | false | false | false | 1 |
on_rename_cb (GeditFileBrowserStore *store,
GFile *oldfile,
GFile *newfile,
GeditWindow *window)
{
GList *documents;
GList *item;
GeditDocument *doc;
GFile *docfile;
/* Find all documents and set its uri to newuri where it matches olduri */
documents... | false | false | false | false | false | 0 |
RequestDataObject(
vtkInformation*,
vtkInformationVector** inputVector ,
vtkInformationVector* outputVector)
{
vtkInformation* inInfo = inputVector[0]->GetInformationObject(0);
if (!inInfo)
{
return 0;
}
vtkGraph *input = vtkGraph::SafeDownCast(
inInfo->Get(vtkDataObject::DATA_OBJECT()));
... | false | false | false | false | false | 0 |
setlocap(lofig_list *ptfig, const char *cname,double capa)
{
locap_list *ptcap = NULL ;
locap_list *cap = NULL ;
char *name = namealloc(cname) ;
for(ptcap = ptfig -> LOCAP ; ptcap != NULL ; ptcap = ptcap -> NEXT)
{
if(ptcap -> NAME == name)
{
cap = ptcap ;
break ;
}
... | false | false | false | true | false | 1 |
iiport (pglobal, argc, argv, pvar, pinfo)
pointer pglobal;
int argc;
char **argv;
pointer pvar ATTRIBUTE_UNUSED;
pointer pinfo;
{
struct sglobal *qglobal = (struct sglobal *) pglobal;
struct sinfo *qinfo = (struct sinfo *) pinfo;
if (argc < 2)
return UUCONF_SYNTAX_ERROR | UUCONF_CMDT... | false | false | false | false | false | 0 |
VisitWhileStatement(WhileStatement* stmt) {
ASSERT(current_block() != NULL);
PreProcessOsrEntry(stmt);
HBasicBlock* loop_entry = CreateLoopHeader();
current_block()->Goto(loop_entry, false);
set_current_block(loop_entry);
// If the condition is constant true, do not generate a branch.
HBasicBlock* cond_f... | false | false | false | false | false | 0 |
alert_joiners(void)
{
struct threadinfo *threadinfo;
pthread_cond_t *joiner_cond;
threadinfo = getthreadinfo();
if (!threadinfo->joiners)
return;
while ((joiner_cond = gwlist_extract_first(threadinfo->joiners))) {
pthread_cond_broadcast(joiner_cond);
}
} | false | false | false | false | false | 0 |
gst_collect_pads_clip_time (GstCollectPads * pads, GstCollectData * data,
GstClockTime time)
{
GstClockTime otime = time;
GstBuffer *in, *out = NULL;
if (pads->priv->clip_func) {
in = gst_buffer_new ();
GST_BUFFER_PTS (in) = time;
GST_BUFFER_DTS (in) = time;
pads->priv->clip_func (pads, data,... | false | false | false | false | false | 0 |
sendnodecmdgetdocattr(int clsock, REQUEST *req, NODE *node){
CBDATUM *datum;
const char *tmp, *uri, *attr;
char *value;
int id;
id = (tmp = cbmapget(req->params, "id", -1, NULL)) ? atoi(tmp) : 0;
if(!(uri = cbmapget(req->params, "uri", -1, NULL))) uri = "";
if(!(attr = cbmapget(req->params, "attr", -1, NU... | false | false | false | false | true | 1 |
xnode_prop_ns_get(const xnode_t *element, const char *uri, const char *name)
{
xnode_check(element);
g_assert(name != NULL);
g_assert(XNODE_T_ELEMENT == element->type);
if (NULL == element->u.e.attrs)
return NULL;
return xattr_table_lookup(element->u.e.attrs, uri, name);
} | false | false | false | false | false | 0 |
atmel_shutdown(struct uart_port *port)
{
struct atmel_uart_port *atmel_port = to_atmel_uart_port(port);
/*
* Prevent any tasklets being scheduled during
* cleanup
*/
del_timer_sync(&atmel_port->uart_timer);
/*
* Clear out any scheduled tasklets before
* we destroy the buffers
*/
tasklet_disable(&atme... | false | false | false | false | false | 0 |
gkbd_layout_get_group_names (GkbdLayout* self, int* result_length1) {
gchar** result = NULL;
gchar** _tmp0_ = NULL;
gchar** _tmp1_ = NULL;
gint _tmp1__length1 = 0;
g_return_val_if_fail (self != NULL, NULL);
_tmp0_ = g_new0 (gchar*, 0 + 1);
_tmp1_ = _tmp0_;
_tmp1__length1 = 0;
if (result_length1) {
*result_le... | false | false | false | false | false | 0 |
debug_blowfish()
{
int i,tot = 0;
for(i=0; i<BOXES; i++)
if(box[i].P != NULL)
tot++;
debug("%d of %d boxes in use: \n",tot,BOXES);
for(i=0; i<BOXES; i++)
if (box[i].P != NULL)
debug("Box %d: (age: %d)",i+1,time(NULL)-box[i].lastuse);
} | false | false | false | false | false | 0 |
xfs_trans_mod_dquot(
xfs_trans_t *tp,
xfs_dquot_t *dqp,
uint field,
long delta)
{
xfs_dqtrx_t *qtrx;
ASSERT(tp);
ASSERT(XFS_IS_QUOTA_RUNNING(tp->t_mountp));
qtrx = NULL;
if (tp->t_dqinfo == NULL)
xfs_trans_alloc_dqinfo(tp);
/*
* Find either the first free slot or the slot that belongs
* to this dquo... | false | false | false | false | false | 0 |
processStart(Process* process)
{
strstream strm;
int process_nbr = process->ID();
(*processTable)[process_nbr] = process;
if ( NULL == getProcess(process_nbr) ) {
strm << "Process: " << process_nbr << " NOT started!" << ends;
theUI->showMsg(strm.str());
return false;
}
bool success = proces... | false | false | false | false | false | 0 |
__absname(env, pref, name, newnamep)
ENV *env;
char *pref, *name, **newnamep;
{
size_t l_pref, l_name;
int isabspath, ret;
char *newname;
l_name = strlen(name);
isabspath = __os_abspath(name);
l_pref = isabspath ? 0 : strlen(pref);
/* Malloc space for concatenating the two. */
if ((ret = __os_malloc(env,
... | false | false | false | false | false | 0 |
btreeSeccacheNodenew(AjPBtcache cache)
{
AjPBtpage ret = NULL;
unsigned char *p;
ajuint nodetype;
ajulong newsize;
#if AJINDEX_DEBUG
ajDebug("btreeSeccacheNodenew pagepos:%Lu\n", cache->totsize);
#endif
ret = btreeSeccacheControl(cache,cache->totsize,BT_WRITE);
p = ret->buf;
AJCSET0(p,... | false | false | false | false | false | 0 |
handle_control (unsigned char *argbuf, size_t arglen)
{
long err;
pcsc_dword_t ioctl_code;
pcsc_dword_t recv_len = 1024;
unsigned char buffer[1024];
if (arglen < 4)
bad_request ("CONTROL");
ioctl_code = (((pcsc_dword_t)argbuf[0] << 24)
| (argbuf[1] << 16) | (argbuf[2] << 8) | argbuf[3]... | false | false | false | false | false | 0 |
jpc_decode(jas_stream_t *in, char *optstr)
{
jpc_dec_importopts_t opts;
jpc_dec_t *dec;
jas_image_t *image;
unsigned int i;
dec = 0;
if (jpc_dec_parseopts(optstr, &opts)) {
goto error;
}
jpc_initluts();
if (!(dec = jpc_dec_create(&opts, in))) {
goto error;
}
/* Do most of the work. */
if (jpc_dec_... | false | false | false | false | false | 0 |
rsvg_xinclude_handler_start (RsvgSaxHandler * self, const char *name, RsvgPropertyBag * atts)
{
RsvgSaxHandlerXinclude *z = (RsvgSaxHandlerXinclude *) self;
if (!z->success) {
if (z->in_fallback) {
if (!strcmp (name, "xi:include"))
rsvg_start_xinclude (z->ctx, atts);
... | false | false | false | false | false | 0 |
init_constants(void)
{
PyObject *module;
/* happing of characters to replace */
escaped_chars_repl['"'] = UNICHR(""");
escaped_chars_repl['\''] = UNICHR("'");
escaped_chars_repl['&'] = UNICHR("&");
escaped_chars_repl['<'] = UNICHR("<");
escaped_chars_repl['>'] = UNICHR(">");
/* lengths of tho... | false | false | false | false | false | 0 |
value(Fl_Widget *kid)
{
int num_kids;
Fl_Widget * const *kids;
if ((num_kids = children()) == 0)
return;
for (kids = array(); num_kids > 0; kids ++, num_kids --)
{
if (*kids == kid)
{
if (!kid->visible())
kid->show();
}
else
(*kids)->hide();
}
// This will res... | false | false | false | false | false | 0 |
taggedRichText( const QString &text, int flags )
{
QString richText = text;
// By default QSimpleRichText is Qt::AlignLeft
if ( flags & Qt::AlignJustify )
{
richText.prepend( QString::fromLatin1( "<div align=\"justify\">" ) );
richText.append( QString::fromLatin1( "</div>" ) );
}
... | false | false | false | false | false | 0 |
makeBlk( Graph g1, int approx, char * pFirstSetSymbol )
#else
makeBlk( g1, approx, pFirstSetSymbol )
Graph g1;
int approx;
char * pFirstSetSymbol;
#endif
{
Junction *j,*j2;
Graph g;
require(g1.left != NULL && g1.right != NULL, "makeBlk: invalid graph");
j = newJunction();
j2 = newJunction();
((Junction *)g1.righ... | false | false | false | true | false | 1 |
CreateScheduler() {
RegisterScheduler::FunctionPassCtor Ctor = RegisterScheduler::getDefault();
if (!Ctor) {
Ctor = ISHeuristic;
RegisterScheduler::setDefault(Ctor);
}
return Ctor(this, OptLevel);
} | false | false | false | false | false | 0 |
plugin_return_print (const int msglevel, const char *prefix, const struct plugin_return *pr)
{
int i;
msg (msglevel, "PLUGIN_RETURN_PRINT %s", prefix);
for (i = 0; i < pr->n; ++i)
{
struct openvpn_plugin_string_list *l = pr->list[i];
int count = 0;
msg (msglevel, "PLUGIN #%d (%s)", i, prefi... | false | false | false | false | false | 0 |
profile_set_relation_value(struct profile_node *node,
const char *new_value)
{
char *cp;
CHECK_MAGIC(node);
if (!node->value)
return PROF_SET_SECTION_VALUE;
cp = strdup(new_value);
if (!cp)
return ENOMEM;
free(node->value);
node->va... | false | false | false | false | false | 0 |
initEnds(const ViewGeometry & vg, QRectF defaultRect, InfoGraphicsView * infoGraphicsView) {
bool gotOne = false;
bool gotTwo = false;
double penWidth = 1;
foreach (ConnectorItem * item, cachedConnectorItems()) {
// check the name or is order good enough?
if (gotOne) {
gotTwo = true;
m_connector1 = item;... | false | false | false | false | false | 0 |
move_path(piece_info_t *obj)
{
if (obj->loc == obj->func)
obj->func = NOFUNC;
else move_to_dest (obj, obj->func);
} | 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.