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 |
|---|---|---|---|---|---|---|
_mteEvent_fire_notify( struct mteEvent *entry, /* The event to fire */
struct mteTrigger *trigger, /* Trigger that fired */
oid *suffix, size_t sfx_len ) /* Matching instance */
{
netsnmp_variable_list *var, *v2;
extern const oid snmptrap_oid[];
... | false | false | false | false | false | 0 |
item_set_info_3_reply (GkrOperation *op, GkrSession *session, gpointer user_data)
{
item_set_info_args *args = user_data;
DBusMessageIter iter;
DBusMessage *req;
g_assert (args);
g_assert (args->info);
g_assert (args->info->secret);
/* Sending a secret */
req = dbus_message_new_method_call (gkr_service_name, ... | false | false | false | false | false | 0 |
pm_run_in_xterm_toggled(GtkToggleButton * button, gpointer userdata)
{
GtkWidget *preferences_dialog = GTK_WIDGET(userdata);
PanelApplet *applet = PANEL_APPLET(g_object_get_data(G_OBJECT(preferences_dialog), "applet"));
GtkComboBox *menu = GTK_COMBO_BOX(g_object_get_data(G_OBJECT(preferences_dialog), "packa... | false | false | false | false | false | 0 |
dispose (GObject *object)
{
SCPluginKeyfilePrivate *priv = SC_PLUGIN_KEYFILE_GET_PRIVATE (object);
if (priv->disposed)
return;
priv->disposed = TRUE;
if (priv->monitor) {
if (priv->monitor_id)
g_signal_handler_disconnect (priv->monitor, priv->monitor_id);
g_file_monitor_cancel (priv->monitor);
g_obje... | false | false | false | false | false | 0 |
ftp_write_curl(void *buffer, size_t size, size_t nmemb, void *_object)
{
THIS_STATUS = NET_RECEIVING_DATA;
nmemb *= size;
if (THIS_FILE)
{
return fwrite(buffer,size,nmemb,THIS_FILE);
}
else
{
THIS->data = GB.AddString(THIS->data, buffer, nmemb);
}
if (THIS->async)
{
GB.Ref(THIS);
GB.Post(CURL_raise_... | false | false | false | false | false | 0 |
create_character_window_show()
{
int reset_needed = 0;
/* If we don't have race/class/stat_point values, get them now.
* those values are reset if we switch between servers, so there
* should never be any danger of them being wrong.
* In theory, if one of these is true, all of them should be tru... | false | false | false | false | false | 0 |
print_80860001_ebx_ecx(unsigned int val_ebx,
unsigned int val_ecx)
{
printf(" Transmeta processor revision (0x80000001/edx)"
" = %u.%u-%u.%u-%u ",
(val_ebx >> 24) & 0xff,
(val_ebx >> 16) & 0xff,
(val_ebx >> 8) & 0xff,
(val_ebx >> 0) & 0x... | false | false | false | false | false | 0 |
main(int argc, char **argv)
{
int k, w, m;
int *matrix;
if (argc != 4) usage(NULL);
if (sscanf(argv[1], "%d", &k) == 0 || k <= 0) usage("Bad k");
if (sscanf(argv[2], "%d", &m) == 0 || m <= 0) usage("Bad m");
if (sscanf(argv[3], "%d", &w) == 0 || w <= 0 || w > 32) usage("Bad w");
if (w <= 30 && k + m > ... | false | false | false | false | false | 0 |
set_nickname_cb (GObject *source,
GAsyncResult *result,
gpointer user_data)
{
TpAccount *account = (TpAccount *) source;
GSimpleAsyncResult *my_result = user_data;
GError *error = NULL;
if (!tp_account_set_nickname_finish (account, result, &error))
g_simple_async_result_take_error (my_result, error... | false | false | false | false | false | 0 |
process_generic(unsigned char *cp, size_t len, unsigned next) {
struct isakmp_generic *hdr = (struct isakmp_generic *) cp;
char *msg;
if (len < sizeof(struct isakmp_generic) ||
ntohs(hdr->isag_length) < sizeof(struct isakmp_generic)) {
msg = make_message("%s (packet too short to decode)",
... | false | true | false | false | false | 1 |
smb_errstr(int class, int num)
{
static char ret[128];
int i, j;
ret[0] = 0;
for (i = 0; err_classes[i].class; i++)
if (err_classes[i].code == class) {
if (err_classes[i].err_msgs) {
const err_code_struct *err = err_classes[i].err_msgs;
for (j = 0; err[j].name; j++)
if (num == err[j].c... | false | false | false | false | false | 0 |
FslGetDataType(FSLIO *fslio, short *t)
{
/* returns bits per pixel */
int nbytepix=32, ss=0;
if (fslio==NULL) FSLIOERR("FslGetDataType: Null pointer passed for FSLIO");
if (fslio->niftiptr!=NULL) {
*t = fslio->niftiptr->datatype;
nifti_datatype_sizes(*t,&nbytepix,&ss);
}
if (fslio->mincptr!=NULL)... | false | false | false | false | false | 0 |
eaxreverb_GetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint *val)
{
switch(param)
{
case AL_EAXREVERB_DECAY_HFLIMIT:
*val = effect->Reverb.DecayHFLimit;
break;
default:
alSetError(context, AL_INVALID_ENUM);
break;
}
} | false | false | false | false | false | 0 |
compute_bits_in_16bits (void)
{
unsigned int i ;
for (i = 0; i < (0x1u<<16); i++)
bits_in_16bits [i] = iterated_bitcount (i) ;
return ;
} | false | false | false | false | false | 0 |
operator()(const Point &p,
const Photon &photon, float distSquared, float &maxDistSquared) {
if (nFound < nLookup) {
// Add photon to unordered array of photons
photons[nFound++] = ClosePhoton(&photon, distSquared);
if (nFound == nLookup) {
std::make_heap(&photons[0], &ph... | false | false | false | false | false | 0 |
telepathy_observer_observe_call_channel (TelepathyObserver* self, TpSimpleObserver* observer, TpAccount* account, TpConnection* connection, TpChannel* b_channel, TpChannelDispatchOperation* dispatch_operation, GList* requests, TpObserveChannelsContext* context) {
Block4Data* _data4_;
TpAccount* _tmp0_ = NULL;
TpAcco... | false | false | false | false | false | 0 |
explain_buffer_sockaddr_af_unix(explain_string_buffer_t *sb,
const struct sockaddr_un *sa, size_t sa_len)
{
if (sa_len > sizeof(sa->sun_family))
{
explain_string_buffer_puts(sb, ", sun_path = ");
explain_string_buffer_puts_quoted(sb, sa->sun_path);
}
} | false | false | false | false | false | 0 |
free_migration(struct dm_cache_migration *mg)
{
struct cache *cache = mg->cache;
if (atomic_dec_and_test(&cache->nr_allocated_migrations))
wake_up(&cache->migration_wait);
mempool_free(mg, cache->migration_pool);
} | false | false | false | false | false | 0 |
TIFFMergeFieldInfo(TIFF* tif, const TIFFFieldInfo info[], uint32 n)
{
static const char module[] = "TIFFMergeFieldInfo";
static const char reason[] = "for fields array";
TIFFField *tp;
size_t nfields;
uint32 i;
if (tif->tif_nfieldscompat > 0) {
tif->tif_fieldscompat = (TIFFFieldArray *)
_TIFFCheckRealloc(ti... | false | false | false | false | false | 0 |
innobase_active_small(void)
/*=======================*/
{
innobase_active_counter++;
if ((innobase_active_counter % INNOBASE_WAKE_INTERVAL) == 0) {
srv_active_wake_master_thread();
}
} | false | false | false | false | false | 0 |
sys_fgets_compiletf(PLI_BYTE8*name)
{
vpiHandle callh = vpi_handle(vpiSysTfCall, 0);
vpiHandle argv = vpi_iterate(vpiArgument, callh);
vpiHandle arg;
/*
* Check that there are two arguments and that the first is a
* register and that the second is numeric.
*/
if (argv == 0) {
vpi_pr... | false | false | false | false | false | 0 |
absolutePosition(int &xPos, int &yPos, bool f) const
{
if ( f && m_pagedMode) {
xPos = 0;
yPos = m_pageTop;
}
else if ( f && m_view) {
xPos = m_view->contentsX();
yPos = m_view->contentsY();
}
else {
xPos = yPos = 0;
}
return true;
} | false | false | false | false | false | 0 |
addLanguageMap (const langType language, char* map)
{
char* p = NULL;
const char first = *map;
if (first == EXTENSION_SEPARATOR) /* extension map */
{
++map;
p = skipPastMap (map);
if (*p == '\0')
{
verbose (" .%s", map);
addLanguageExtensionMap (language, map);
p = map + strlen (map);
}
else
... | false | false | false | false | false | 0 |
getPacket(HttpConn *conn, ssize *size)
{
HttpPacket *packet;
MprBuf *content;
if ((packet = conn->input) == NULL) {
conn->input = packet = httpCreatePacket(HTTP_BUFSIZE);
} else {
content = packet->content;
mprResetBufIfEmpty(content);
mprAddNullToBuf(content);
... | false | false | false | false | false | 0 |
x2sys_strerror (int err)
{
/* Returns the error string for a given error code "err"
Passes "err" on to nc_strerror if the error code is not one we defined */
switch (err) {
case X2SYS_FCLOSE_ERR:
return "Error from fclose";
case X2SYS_BAD_DEF:
return "Cannot find format definition file in either current o... | false | false | false | false | false | 0 |
scanForPlugins()
{
if (d->mPluginInfoPrefix.isEmpty() || d->mPluginInfoPrefix.isNull()) {
qWarning() << Q_FUNC_INFO << "Prefix undefined"
<< " try running PluginLoader::getInstanceWithPrefix with the correct path first";
}
QDir dir(d->mPluginInfoPrefix);
dir.setFilter(QDir::F... | false | false | false | false | false | 0 |
opj_dwt_interleave_v(opj_dwt_t* v, OPJ_INT32 *a, OPJ_INT32 x) {
OPJ_INT32 *ai = a;
OPJ_INT32 *bi = v->mem + v->cas;
OPJ_INT32 i = v->sn;
while( i-- ) {
*bi = *ai;
bi += 2;
ai += x;
}
ai = a + (v->sn * x);
bi = v->mem + 1 - v->cas;
i = v->dn ;
while( i-- ) {
*bi = *... | false | false | false | false | false | 0 |
contains(int a, int b)
{
return (b == 0) || (a/b > 0);
} | false | false | false | false | false | 0 |
HandleEvent(uint32 eventId, GameObject* go)
{
// If we are not using the lighthouse return
if (go->GetEntry() != GO_VENTURE_BAY_LIGHTHOUSE)
return false;
bool eventHandled = true;
switch (eventId)
{
case EVENT_LIGHTHOUSE_WIN_ALLIANCE:
// Ignore the event if the zone is ... | false | false | false | false | false | 0 |
slashsub(Program *prog, String *dest)
{
if (*ip == '/' && oldslash)
while (*ip == '/') Stringadd(dest, *ip++);
else
Stringadd(dest, '/');
return 1;
} | false | false | false | false | false | 0 |
open_editor(bool from_root, const char *file)
{
const char *editor_argv[] = { "vi", file, NULL };
const char *editor;
editor = getenv("GIT_EDITOR");
if (!editor && *opt_editor)
editor = opt_editor;
if (!editor)
editor = getenv("VISUAL");
if (!editor)
editor = getenv("EDITOR");
if (!editor)
editor = "vi"... | false | false | false | false | false | 0 |
get_generic_virtual_entries (MonoDomain *domain, gpointer *vtable_slot)
{
MONO_REQ_GC_NEUTRAL_MODE;
GenericVirtualCase *list;
MonoImtBuilderEntry *entries;
mono_domain_lock (domain);
if (!domain->generic_virtual_cases)
domain->generic_virtual_cases = g_hash_table_new (mono_aligned_addr_hash, NULL);
... | false | false | false | false | false | 0 |
getDecodedChar() {
int ch = getChar();
switch (ch) {
case EOF: return 0;
case 'a': return '\a';
case 'b': return '\b';
case 'f': return '\f';
case 'n': return '\n';
case 'r': return '\r';
case 't': return '\t';
case 'v': return '\v';
case 'c':
ch = getChar();
return ch != EOF ? ch & 0x1f : 0;
case 'x... | false | false | false | false | false | 0 |
get_num_keys_in_file(int fd)
{
UINT32 num_keys;
int rc;
/* go to the number of keys */
rc = lseek(fd, TSSPS_NUM_KEYS_OFFSET, SEEK_SET);
if (rc == ((off_t) - 1)) {
LogError("lseek: %s", strerror(errno));
return 0;
}
rc = read(fd, &num_keys, sizeof(UINT32));
if (rc < 0) {
LogError("read of %zd bytes: %s",... | false | true | false | false | true | 1 |
qla81xx_set_loopback_mode(scsi_qla_host_t *vha, uint16_t *config,
uint16_t *new_config, uint16_t mode)
{
int ret = 0;
int rval = 0;
unsigned long rem_tmo = 0, current_tmo = 0;
struct qla_hw_data *ha = vha->hw;
if (!IS_QLA81XX(ha) && !IS_QLA8031(ha) && !IS_QLA8044(ha))
goto done_set_internal;
if (mode == INTE... | false | false | false | false | false | 0 |
Sha256Final(Sha256* sha256, byte* hash)
{
byte* local = (byte*)sha256->buffer;
AddLength(sha256, sha256->buffLen); /* before adding pads */
local[sha256->buffLen++] = 0x80; /* add 1 */
/* pad with zeros */
if (sha256->buffLen > SHA256_PAD_SIZE) {
XMEMSET(&local[sha256->buffLen], 0, SHA2... | false | false | false | false | false | 0 |
gotRemoveKey(const QString &_key)
{
QString key = _key.trimmed();
if (key.isEmpty()) {
logFileError() << "RemoveKey specifies invalid key" << endl;
return;
}
if (!m_oldConfig1) {
logFileError() << "Key without previous File specification" << endl;
return;
}
KCo... | false | false | false | false | false | 0 |
brcmf_usbdev_qinit(struct list_head *q, int qsize)
{
int i;
struct brcmf_usbreq *req, *reqs;
reqs = kcalloc(qsize, sizeof(struct brcmf_usbreq), GFP_ATOMIC);
if (reqs == NULL)
return NULL;
req = reqs;
for (i = 0; i < qsize; i++) {
req->urb = usb_alloc_urb(0, GFP_ATOMIC);
if (!req->urb)
goto fail;
IN... | false | false | false | false | false | 0 |
is_global(const lListElem *rule, int nm)
{
lListElem *filter = lGetObject(rule, nm);
if (!filter)
return true;
if (lGetSubStr(filter, ST_name, "*", RQRF_scope) && lGetNumberOfElem(lGetList(filter, RQRF_xscope))==0)
return true;
return false;
} | false | false | false | false | false | 0 |
draw_space(int i, gdouble g)
{
int k;
V4d Specular = {1.0f,1.0f,1.0f,1.0f};
V4d Diffuse = {0.0f,0.0f,0.0f,1.0f};
V4d Ambiant = {0.2f,0.2f,0.2f,1.0f};
OpenGLOptions openGLOptions = get_opengl_options();
Specular[0] = GeomOrb[i].Prop.color.red/(gdouble)65535;
Specular[1] = GeomOrb[i].Prop.color.green/(gdoubl... | false | false | false | false | false | 0 |
vt_plugin_cntr_write_callback_data(uint64_t *time, uint32_t tid) {
uint32_t i, k;
struct vt_plugin_single_counter * current_counter;
vt_plugin_cntr_timevalue * values;
struct vt_plugin_cntr_defines * plugin_cntr_defines =
(struct vt_plugin_cntr_defines *) VTThrdv[tid]->plugin_cntr_defines;
if (plugin_c... | false | false | false | false | false | 0 |
connect_to_server()
{
int s;
s = socket(AF_INET, SOCK_STREAM, 0);
if (s < 0) {
perror("creating socket");
return -1;
}
if (connect(s, (struct sockaddr *)&saddr, sizeof(saddr)) < 0) {
perror("connecting to server");
(void)closesocket(s);
return -1;
}
r... | false | false | false | false | false | 0 |
check_edid(unsigned char *edid)
{
unsigned char *block = edid + ID_MANUFACTURER_NAME, manufacturer[4];
unsigned char *b;
u32 model;
int i, fix = 0, ret = 0;
manufacturer[0] = ((block[0] & 0x7c) >> 2) + '@';
manufacturer[1] = ((block[0] & 0x03) << 3) +
((block[1] & 0xe0) >> 5) + '@';
manufacturer[2] = (block[1... | false | false | false | false | false | 0 |
xstrndup_internal(const char *str, size_t n, bool plain)
{
size_t len;
char *res, *p;
if G_UNLIKELY(NULL == str)
return NULL;
len = clamp_strlen(str, n);
res = plain ? xpmalloc(len + 1) : xmalloc(len + 1);
p = mempcpy(res, str, len);
*p = '\0';
return res;
} | false | false | false | false | false | 0 |
decode_newarray_type (int atype)
{
switch (atype)
{
case 4: return boolean_type_node;
case 5: return char_type_node;
case 6: return float_type_node;
case 7: return double_type_node;
case 8: return byte_type_node;
case 9: return short_type_node;
case 10: return int_type_node;
... | false | false | false | false | false | 0 |
MPI_Gather(CONST void* sendbuf, VT_MPI_INT sendcount,
MPI_Datatype sendtype, void* recvbuf,
VT_MPI_INT recvcount, MPI_Datatype recvtype,
VT_MPI_INT root, MPI_Comm comm)
{
VT_MPI_INT result;
uint32_t tid;
GET_THREAD_ID(tid);
if (IS_MPI_TRACE_ON(... | false | false | false | false | false | 0 |
e2p_string2os(char *str)
{
const char **cpp;
int i = 0;
for (cpp = os_tab; *cpp; cpp++, i++) {
if (!strcasecmp(str, *cpp))
return i;
}
return -1;
} | false | false | false | false | false | 0 |
get_default_cred(const char *keytab_name, gss_OID_set mechs,
gss_cred_id_t *impersonator_cred_handle)
{
OM_uint32 major = GSS_S_FAILURE, minor;
krb5_error_code ret;
krb5_context context = NULL;
krb5_keytab keytab = NULL;
krb5_principal keytab_principal = NULL;
krb5_ccache ccache... | false | false | false | false | false | 0 |
readFile(FILE* fd, char** buffer) {
int length = 0;
int cap = BUF_SIZE;
char buf[BUF_SIZE];
int r;
*buffer = malloc(BUF_SIZE * sizeof(char));
while((r = fread(buf, sizeof(char), BUF_SIZE, fd)) > 0) {
if(length + r >= cap) {
cap *= 2;
*buffer = realloc(*buffer,cap);
}
memcpy(&(*buffer)[length],buf,r);
... | false | false | false | false | true | 1 |
nextWord(char **p)
{
char *word;
char *s, *q;
unsigned len;
q = *p;
while (*q && isspace((int)*q))
q++;
if (!(*q))
{
*p = q;
return NULL;
}
s = q;
while (*s && !isspace((int)*s))
s++;
len = (unsigned) (s - q);
word = (ch... | false | false | false | false | false | 0 |
load(nor_utils::StreamTokenizer& st)
{
// Calling the super-class method
FeaturewiseLearner::load(st);
// load phiArray data
UnSerialization::seekAndParseVectorTag(st, "uArray", _pTrainingData->getEnumMap(_selectedColumn),
"idx", _u);
} | false | false | false | false | false | 0 |
bus_input_context_set_engine_by_desc (BusInputContext *context,
IBusEngineDesc *desc,
gint timeout,
GCancellable *cancellable,
GAsyncReadyCa... | false | false | false | false | false | 0 |
next_hex(void) {
int ch = text_ch;
next_ch();
if (ch >= '0' && ch <= '9') return ch - '0';
if (ch >= 'A' && ch <= 'F') return ch - 'A' + 10;
if (ch >= 'a' && ch <= 'f') return ch - 'a' + 10;
error(ERR_INV_EXPRESSION, "Invalid hexadecimal number");
return 0;
} | false | false | false | false | false | 0 |
lexer_keyword_sys_1995_code(
const char* str,
int length
) { PROFILE(LEXER_KEYWORD_SYS_1995_CODE);
const struct keyword_sys_1995* rc = check_identifier_sys_1995(str, length);
int type = S_ignore;
if( rc != 0 ) {
type = rc->type;
if( type == S_dumpfile ) {
#ifdef ... | false | false | false | false | false | 0 |
pr_pe0_statement(FILE *fp, Pe_statement *pe_head, int level)
{
if (pe_head != NULL) {
pr_dt_init(fp, pe_head->dt_init, level+1);
pr_dt(fp, pe_head->dt_head, level+1, FALSE);
pr_statement(fp, pe_head->stm_head, level+1);
}
} | false | false | false | false | false | 0 |
update_labels() {
if(!m_startdate.empty()) {
std::string year = m_startdate.substr(0,4).c_str();
std::string month = m_startdate.substr(4,2).c_str();
std::string day = m_startdate.substr(6,2).c_str();
m_filter_popup_from->set_label(day+"."+month+"."+year);
}
if(!m_enddate.empty()) {
std::string year = m_... | false | false | false | false | false | 0 |
putstr_inp(char *p)
{
#if WIN32
if (test_mode)
return;
#endif
clear_page_label();
// dbg("gtab_hide_row2 %d\n", gtab_hide_row2);
hide_row2_if_necessary();
char_play(p);
int to_tsin = (cur_inmd->flag & FLAG_GTAB_SYM_KBM) && inmd[default_input_method].method_type==method_type_TSIN && tss.c_len;
if (... | false | false | false | false | false | 0 |
GSgetBlock(GopherObj *gs, int bnum)
{
if (gs->gplus == NULL || bnum < 0)
return(NULL);
return(BLAgetEntry(gs->gplus->OtherBlocks, bnum));
} | false | false | false | false | false | 0 |
gst_base_src_default_negotiate (GstBaseSrc * basesrc)
{
GstCaps *thiscaps;
GstCaps *caps = NULL;
GstCaps *peercaps = NULL;
gboolean result = FALSE;
/* first see what is possible on our source pad */
thiscaps = gst_pad_get_caps_reffed (GST_BASE_SRC_PAD (basesrc));
GST_DEBUG_OBJECT (basesrc, "caps of src: ... | false | false | false | false | false | 0 |
addObject( QObject *obj, KJS::JSObject *parent, const KJS::UString &name ) const
{
KJS::ExecState *exec = dptr->m_interpreter->globalExec();
KJS::JSObject *returnObject = KJSEmbed::createQObject(exec , obj, KJSEmbed::ObjectBinding::CPPOwned );
KJS::Identifier jsName( !name.isEmpty() ? name : toUString(obj->... | false | false | false | false | false | 0 |
initializeSystemDefaultCentury()
{
// initialize systemDefaultCentury and systemDefaultCenturyYear based
// on the current time. They'll be set to 80 years before
// the current time.
UErrorCode status = U_ZERO_ERROR;
GregorianCalendar calendar(status);
if (U_SUCCESS(status)) {
calendar... | false | false | false | false | false | 0 |
Gif_ReleaseCompressedImage(Gif_Image *gfi)
{
if (gfi->compressed && gfi->free_compressed)
(*gfi->free_compressed)(gfi->compressed);
gfi->compressed = 0;
gfi->compressed_len = 0;
gfi->free_compressed = 0;
} | false | false | false | false | false | 0 |
r_mark_yU(struct SN_env * z) {
{ int ret = r_check_vowel_harmony(z);
if (ret == 0) return 0; /* call check_vowel_harmony, line 183 */
if (ret < 0) return ret;
}
if (in_grouping_b_U(z, g_U, 105, 305, 0)) return 0;
{ int ret = r_mark_suffix_with_optional_y_consonant(z);
if (ret... | false | false | false | false | false | 0 |
load_config (char * file)
{
if (!conf)
conf = alloc_config();
if (!conf)
return 1;
/*
* internal defaults
*/
if (!conf->verbosity)
conf->verbosity = DEFAULT_VERBOSITY;
conf->dev_type = DEV_NONE;
conf->minio = 1000;
conf->max_fds = 0;
conf->bindings_file = DEFAULT_BINDINGS_FILE;
conf->multipath_dir... | false | false | false | false | false | 0 |
tunnel_read_request (Tunnel *tunnel, enum tunnel_request *request,
unsigned char *buf, size_t *length)
{
Request req;
Length len;
ssize_t n;
log_annoying ("read (%d, %p, %d) ...", tunnel->in_fd, &req, 1);
n = read (tunnel->in_fd, &req, 1);
log_annoying ("... = %d", n);
if (n == -1)
{
if ... | false | false | false | false | false | 0 |
lua_newuserdata (lua_State *L, size_t size) {
TString *ts = luaS_newudata(L, size, NULL);
tsvalue(L->top) = ts;
ttype(L->top) = LUA_TUSERDATA;
api_incr_top(L);
return ts->u.d.value;
} | false | false | false | false | false | 0 |
fdisk_unref_script(struct fdisk_script *dp)
{
if (!dp)
return;
dp->refcount--;
if (dp->refcount <= 0) {
fdisk_reset_script(dp);
fdisk_unref_context(dp->cxt);
DBG(SCRIPT, ul_debugobj(dp, "free script"));
free(dp);
}
} | false | false | false | false | false | 0 |
lola_set_granularity(struct lola *chip, unsigned int val, bool force)
{
int err;
if (!force) {
if (val == chip->granularity)
return 0;
#if 0
/* change Gran only if there are no streams allocated ! */
if (chip->audio_in_alloc_mask || chip->audio_out_alloc_mask)
return -EBUSY;
#endif
if (!check_gran_cloc... | false | false | false | false | false | 0 |
drawBackground( QPainter* painter, const QRectF& _rect )
{
QRectF scn( sceneRect() );
QRectF rect( _rect );
if ( d->isPrinting ) {
QRectF headerRect( scn.topLeft()+QPointF( d->labelsWidth, 0 ),
QSizeF( scn.width()-d->labelsWidth, d->rowController->headerHeight() ));
... | false | false | false | false | false | 0 |
sync_child(__this__, itk_component* child)
{
if (this->parent == NULL)
return NULL;
itk_graphics* g = this->parent->sync_child(this->parent, this);
if (g == NULL)
return NULL;
rectangle_t rect = this->locate_child(this, child);
if ((rect.defined == false) && (rect.width | rect.height) < 0)
r... | false | false | false | false | false | 0 |
haveOverestimate() const {
assert(!wrapping());
assert(prepared);
return
generatedSplitting.splittingKinematics()->haveOverestimate() &&
splittingKernel()->haveOverestimate(generatedSplitting);
} | false | false | false | false | false | 0 |
srv2dns_node(struct rdata *head, struct dns_node **dn)
{
unsigned int mem;
unsigned int l;
struct rdata *r;
struct dns_node *n;
char *p;
/* calculate how much mem is required */
mem = sizeof(struct dns_node);
for( r=head,l=0 ; r ; r=r->next,l++ )
mem +=sizeof(struct dns_val) + get_naptr(r)->repl_len + 1;
n... | false | false | false | false | false | 0 |
gst_qtdemux_handle_src_event (GstPad * pad, GstObject * parent,
GstEvent * event)
{
gboolean res = TRUE;
GstQTDemux *qtdemux = GST_QTDEMUX (parent);
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_SEEK:
{
#ifndef GST_DISABLE_GST_DEBUG
GstClockTime ts = gst_util_get_timestamp ();
#endif
... | false | false | false | false | false | 0 |
fimc_md_unregister_clk_provider(struct fimc_md *fmd)
{
struct cam_clk_provider *cp = &fmd->clk_provider;
unsigned int i;
if (cp->of_node)
of_clk_del_provider(cp->of_node);
for (i = 0; i < cp->num_clocks; i++)
clk_unregister(cp->clks[i]);
} | false | false | false | false | false | 0 |
H5MF_aggr_try_extend(H5F_t *f, H5F_blk_aggr_t *aggr, H5FD_mem_t type,
haddr_t blk_end, hsize_t extra_requested)
{
htri_t ret_value = FALSE; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Check args */
HDassert(f);
HDassert(aggr);
HDassert(aggr->feature_flag == H5FD_FEAT_AGGREGATE_M... | false | false | false | false | false | 0 |
apply_frame_disposal(uint16_t *into_data, uint16_t *from_data,
uint16_t *previous_data, Gif_Image *gfi)
{
int screen_size = screen_width * screen_height;
if (gfi->disposal == GIF_DISPOSAL_PREVIOUS)
memcpy(into_data, previous_data, sizeof(uint16_t) * screen_size);
else {
memcpy(into_data, from_data,... | false | true | false | false | false | 1 |
circuit_testing_failed(origin_circuit_t *circ, int at_last_hop)
{
if (server_mode(get_options()) && check_whether_orport_reachable())
return;
log_info(LD_GENERAL,
"Our testing circuit (to see if your ORPort is reachable) "
"has failed. I'll try again later.");
/* These aren't used yet.... | false | false | false | false | false | 0 |
ecal_test_utils_cal_receive_objects (ECal *cal,
icalcomponent *component)
{
GError *error = NULL;
if (!e_cal_receive_objects (cal, component, &error)) {
g_error ("receiving objects: %s\n", error->message);
}
test_print ("successfully received the objects\n");
} | false | false | false | false | false | 0 |
R_LoadGLSLProgram (const char *name, char *vertex, char *fragment, int attributes, GLhandleARB *program)
{
char str[4096];
const char *shaderStrings[1];
int nResult;
int i;
*program = glCreateProgramObjectARB();
g_vertexShader = glCreateShaderObjectARB( GL_VERTEX_SHADER_ARB );
shaderStrings[0]... | false | false | false | false | false | 0 |
jack_port_name(const jack_port_t* port)
{
JackGlobals::CheckContext("jack_port_name");
uintptr_t port_aux = (uintptr_t)port;
jack_port_id_t myport = (jack_port_id_t)port_aux;
if (!CheckPort(myport)) {
jack_error("jack_port_name called with an incorrect port %ld", myport);
return NULL;
... | false | false | false | false | false | 0 |
sirdev_receive(struct sir_dev *dev, const unsigned char *cp, size_t count)
{
if (!dev || !dev->netdev) {
net_warn_ratelimited("%s(), not ready yet!\n", __func__);
return -1;
}
if (!dev->irlap) {
net_warn_ratelimited("%s - too early: %p / %zd!\n",
__func__, cp, count);
return -1;
}
if (cp==NULL)... | false | false | false | false | false | 0 |
tjp_result_type () const {
stringstream out;
CTypeInfo *type = _type;
if (type->isVoid () || type->isUndefined ())
out << "void";
else if (type->isAddress ()) {
if (_use_typedef) {
if (type->BaseType()->isConst())
out << "const ";
out << "TResult";
}
else
type->BaseType... | false | false | false | false | false | 0 |
gearman_set_identifier(gearman_universal_st& universal,
const char *id, size_t id_size)
{
if (id == NULL)
{
return gearman_error(universal, GEARMAN_INVALID_ARGUMENT, "id was NULL");
}
if (id_size == 0)
{
return gearman_error(universal, GEARMAN_INVALID_ARGUMENT,... | false | false | false | false | false | 0 |
save_CompressedTexSubImage2DARB(GLenum target, GLint level, GLint xoffset,
GLint yoffset, GLsizei width, GLsizei height,
GLenum format, GLsizei imageSize,
const GLvoid * data)
{
Node *n;
GET_CURRENT_CONTEXT(ctx);
AS... | false | false | false | false | false | 0 |
blip_eq_generate( blip_eq_t * eq, float *out, int count )
{
/* lower cutoff freq for narrow kernels with their wider transition band
(8 points->1.49, 16 points->1.15) */
int i;
double to_fraction, cutoff;
double oversample = BLIP_RES * 2.25 / count + 0.85;
double half_rate = eq->sample_rate * 0.5;
... | false | false | false | false | false | 0 |
GuessParameters(
SizeValueType numberOfGradientEstimates,
double initialStepSize)
{
/** Guess A */
this->SetA(static_cast< double >( this->GetMaximumNumberOfIterations() ) / 10.0);
if ( !m_CostFunction )
{
itkExceptionMacro(<< "No objective function defined! ");
}
/** The number of parameters:... | false | false | false | false | false | 0 |
put_tagged_oid( char *outp, const char *tag, const char *oid,
const char *suffix, int enquote )
{
int count = 0;
if ( NULL == suffix ) {
suffix = "";
}
if ( NULL != oid ) {
if ( enquote ) {
count = sprintf( outp, "%s'%s%s' ", tag, oid, suffix );
} else {
count = sprintf( outp, "%s%s%s ", tag, oid,... | false | true | false | false | false | 1 |
format_lvm_uuid(char *dst_uuid, char *src_uuid)
{
unsigned int i, b;
for (i = 0, b = 1; i < LVM2_ID_LEN; i++, b <<= 1) {
if (b & 0x4444440)
*dst_uuid++ = '-';
*dst_uuid++ = *src_uuid++;
}
*dst_uuid = '\0';
} | false | false | false | false | false | 0 |
be_mcc_event_process(struct be_adapter *adapter,
struct be_mcc_compl *compl)
{
if (is_link_state_evt(compl->flags))
be_async_link_state_process(adapter, compl);
else if (is_grp5_evt(compl->flags))
be_async_grp5_evt_process(adapter, compl);
else if (is_dbg_evt(compl->flags))
be_async_dbg_evt_process(adapte... | false | false | false | false | false | 0 |
print_aligned_vertical_line(const printTableContent *cont,
unsigned long record,
unsigned int hwidth,
unsigned int dwidth,
printTextRule pos,
FILE *fout)
{
const printTextFormat *format = get_line_style(cont->opt);
const printTextLineFormat *lformat = &format->lrule[pos];
unsigned ... | false | false | false | false | false | 0 |
__pyx_f_7sklearn_12linear_model_15sgd_fast_sparse_min(double __pyx_v_a, double __pyx_v_b) {
double __pyx_r;
__Pyx_RefNannyDeclarations
double __pyx_t_1;
__Pyx_RefNannySetupContext("min");
/* "sklearn/linear_model/sgd_fast_sparse.pyx":222
*
* cdef inline double min(double a, double b):
* return a if a... | false | false | false | false | false | 0 |
gnc_sql_execute_nonselect_sql( GncSqlBackend* be, const gchar* sql )
{
GncSqlStatement* stmt;
gint result;
g_return_val_if_fail( be != NULL, 0 );
g_return_val_if_fail( sql != NULL, 0 );
stmt = gnc_sql_create_statement_from_sql( be, sql );
if ( stmt == NULL )
{
return -1;
}
... | false | false | false | false | false | 0 |
writeFile(Agraph_t * g, char *f, Agiodisc_t* io)
{
int rv;
Sfio_t *fp;
if (!f) {
exerror("NULL string passed to writeG");
return 1;
}
fp = sfopen(0, f, "w");
if (!fp) {
exwarn("Could not open %s for writing in writeG", f);
return 1;
}
rv = sfioWrite(g, fp, io);
sfclose(fp);
... | false | false | false | false | false | 0 |
get_string_block (gconstpointer data_ptr,
const gunichar2 *string_key,
gpointer *string_value,
guint32 *string_value_len,
version_data *block)
{
guint16 data_len = block->data_len;
guint16 string_len = 28; /* Length of the StringTable block */
char *orig_data_ptr = (char *)data_ptr - 28;
/* data_p... | false | false | false | false | false | 0 |
clear_subcollection(CSUBCOLLECTION *_object)
{
void *value;
HASH_ENUM iter;
CLEAR(&iter);
for(;;)
{
value = HASH_TABLE_next(THIS->hash_table, &iter);
if (value == NULL)
break;
if (THIS->desc->release)
(*THIS->desc->release)(THIS->container, *((void **)value));
GB_Unref(valu... | false | false | false | false | false | 0 |
L46()
{register object *base=vs_base;
register object *sup=base+VM46; VC46
vs_check;
{register object V151;
object V152;
V151=(base[0]);
V152=(base[1]);
vs_top=sup;
goto TTL;
TTL:;
{register object V153;
register object V154;
V153= Cnil;
V154= Cnil;
base[2]= (V151);
vs_top=(vs_base=base+2)+1;
(void) (*Ln... | false | false | false | false | false | 0 |
partialWidth(PMPair inpart, PMPair outa,
PMPair outb) const {
if( inpart.second < outa.second + outb.second ) return ZERO;
if(_perturbativeVertex) {
Energy2 scale(sqr(inpart.second));
tcPDPtr in = inpart.first->CC() ? tcPDPtr(inpart.first->CC()) : inpart.first;
_perturbativeVertex->setCoupling(sca... | false | false | false | false | false | 0 |
__get_meta_page(struct f2fs_sb_info *sbi, pgoff_t index,
bool is_meta)
{
struct address_space *mapping = META_MAPPING(sbi);
struct page *page;
struct f2fs_io_info fio = {
.sbi = sbi,
.type = META,
.rw = READ_SYNC | REQ_META | REQ_PRIO,
.blk_addr = index,
.encrypted_page = NULL,
};
if (unlikely(!i... | false | false | false | false | false | 0 |
fp_subdir_read(fp_subdir_ty *this)
{
string_ty *fn;
if (!this->need_to_read)
return;
this->need_to_read = 0;
trace(("fp_subdir_read(this = %p)\n{\n", this));
fn = os_path_cat(this->path, fp_filename());
fp_gram(this, fn);
str_free(fn);
trace(("}\n"));
} | false | false | false | false | false | 0 |
array_get_by_key(PHP_VALUE_NODE *array, PHP_VALUE_NODE *key)
{
if ( array->type != PHP_VAL_ARRAY ) {
return 0;
}
PHP_VALUE_NODE s_key = *key;
cast_value_str(&s_key);
return array_get_by_str_key(array, s_key.str_val);
} | 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.