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 |
|---|---|---|---|---|---|---|
CanWriteFile(const char *name)
{
std::string filename = name;
if ( filename == "" )
{
itkDebugMacro(<< "No filename specified.");
}
bool extensionFound = false;
std::string::size_type BMPPos = filename.rfind(".bmp");
if ( ( BMPPos != std::string::npos )
&& ( BMPPos == fi... | false | false | false | false | false | 0 |
imull(Register dst, Register src, Immediate imm) {
EnsureSpace ensure_space(this);
last_pc_ = pc_;
emit_optional_rex_32(dst, src);
if (is_int8(imm.value_)) {
emit(0x6B);
emit_modrm(dst, src);
emit(imm.value_);
} else {
emit(0x69);
emit_modrm(dst, src);
emitl(imm.value_);
}
} | false | false | false | false | false | 0 |
local_notify_xroute_1(int s, struct xroute *xroute, int kind)
{
char buf[512];
int rc;
rc = snprintf(buf, 512, "%s xroute %s prefix %s metric %d\n",
local_kind(kind),
format_prefix(xroute->prefix, xroute->plen),
format_prefix(xroute->prefix, xroute->ple... | true | true | false | false | false | 1 |
FIFOAdd(FIFO * fifo, u32 v)
{
if(fifo->full)
{
fifo->error = TRUE;
return;
}
fifo->data[fifo->end] = v;
fifo->end = (fifo->end + 1)& 0x7FFF;
fifo->full = (fifo->end == fifo->begin);
fifo->empty = FALSE;
} | false | false | false | false | false | 0 |
luaL_optlstring(lua_State *L, int idx,
const char *def, size_t *len)
{
TValue *o = index2adr(L, idx);
GCstr *s;
if (LJ_LIKELY(tvisstr(o))) {
s = strV(o);
} else if (tvisnil(o)) {
if (len != NULL) *len = def ? strlen(def) : 0;
return def;
} else if (tvisnumber(o)) {
lj_gc_check(L);
... | false | false | false | false | false | 0 |
Read(trpgReadBuffer &buf)
{
try {
buf.Get(numChild);
if (numChild < 0) throw 1;
buf.Get(id);
if (id < 0) throw 1;
if ( !buf.isEmpty() ) {
char nm[1024] = {0};
buf.Get(nm,1024);
SetName(nm);
}
}
catch (...) {
return f... | false | false | false | false | false | 0 |
tokenize(const std::string& source, char delimiter,
std::vector<std::string>* fields) {
ASSERT(NULL != fields);
fields->clear();
size_t last = 0;
for (size_t i = 0; i < source.length(); ++i) {
if (source[i] == delimiter) {
if (i != last) {
fields->push_back(source.substr(last, ... | false | false | false | false | false | 0 |
getDeviceName(int device)
{
int i=0;
for(i=0; i<MAX_NUMBER_OF_SENSORS; i++)
{
if(sensor[i].name && (sensor[i].fd == device))
return (char*)sensor[i].name;
}
return "DEVICE";
} | false | false | false | false | false | 0 |
restore(char *gisbase, char *grass_version)
{
int num_restored;
char tmp[MAXSTR];
char *verstr;
char *grass_major;
char *grass_minor;
char *grass_revision;
int major, minor, revision;
/* extract GRASS major and minor version numbers */
verstr = strdup(grass_version);
grass_maj... | false | false | false | false | false | 0 |
gst_hls_sink_ghost_buffer_probe (GstPad * pad, GstPadProbeInfo * info,
gpointer data)
{
GstHlsSink *sink = GST_HLS_SINK_CAST (data);
GstBuffer *buffer = gst_pad_probe_info_get_buffer (info);
GstClockTime timestamp;
timestamp = GST_BUFFER_TIMESTAMP (buffer);
if (sink->target_duration == 0 || !GST_CLOCK_TI... | false | false | false | false | false | 0 |
cpl_column_logarithm(cpl_column *column, double base)
{
const char *fid = "cpl_column_logarithm";
cpl_type type = cpl_column_get_type(column);
if (column == 0x0)
return cpl_error_set(fid, CPL_ERROR_NULL_INPUT);
if (base <= 0.0)
return cpl_error_set(fid, CPL_ERROR_ILLEGAL_INPUT);... | false | false | false | false | false | 0 |
MaybeRecomputeCheckSum() const {
{
ReaderMutexLock check_sum_lock(&check_sum_mutex_);
if (check_sum_finalized_)
return;
}
// We'll aquire an exclusive lock to recompute the checksums.
MutexLock check_sum_lock(&check_sum_mutex_);
if (check_sum_finalized_) // Another thread (coming in around the... | false | false | false | false | false | 0 |
gth_search_finalize (GObject *object)
{
GthSearch *search;
search = GTH_SEARCH (object);
if (search->priv != NULL) {
if (search->priv->folder != NULL)
g_object_unref (search->priv->folder);
if (search->priv->test != NULL)
g_object_unref (search->priv->test);
g_free (search->priv);
search->priv = NULL... | false | false | false | false | false | 0 |
lrm_state_get_rsc_info(lrm_state_t * lrm_state, const char *rsc_id, enum lrmd_call_options options)
{
if (!lrm_state->conn) {
return NULL;
}
/* optimize this... this function is a synced round trip from client to daemon.
* It should be possible to cache the resource info in the lrmd client to p... | false | false | false | false | false | 0 |
tld_check_name(struct SessionHandle *data,
const char *ace_hostname)
{
size_t err_pos;
char *uc_name = NULL;
int rc;
#ifndef CURL_DISABLE_VERBOSE_STRINGS
const char *tld_errmsg = "<no msg>";
#else
(void)data;
#endif
/* Convert (and downcase) ACE-name back into locale's character ... | false | false | false | false | false | 0 |
gnc_tree_model_owner_iter_n_children (GtkTreeModel *tree_model,
GtkTreeIter *iter)
{
GncTreeModelOwner *model;
GncTreeModelOwnerPrivate *priv;
g_return_val_if_fail (GNC_IS_TREE_MODEL_OWNER (tree_model), -1);
model = GNC_TREE_MODEL_OWNER (tree_model);
priv = G... | false | false | false | false | false | 0 |
nautilus_path_bar_slider_drag_leave (GtkWidget *widget,
GdkDragContext *context,
unsigned int time,
gpointer user_data)
{
NautilusPathBar *path_bar;
path_bar = NAUTILUS_PATH_BAR (user_data);
if (path_bar->priv->drag_slider_timeout != 0) {
g_source_remove (path_bar->priv-... | false | false | false | false | false | 0 |
store_arg (VerifyContext *ctx, guint32 arg)
{
ILStackDesc *value;
if (arg >= ctx->max_args) {
CODE_NOT_VERIFIABLE (ctx, g_strdup_printf ("Method doesn't have argument %d at 0x%04x", arg + 1, ctx->ip_offset));
if (check_underflow (ctx, 1))
stack_pop (ctx);
return;
}
if (check_underflow (ctx, 1)) {
value... | false | false | false | false | false | 0 |
session_make_response(dns_sock_buf_t *sbuf, dns_session_t *session, dns_cache_rrset_t *rrset_an, dns_cache_rrset_t *rrset_ns)
{
int resmax, rcode, flags;
dns_msg_handle_t handle;
plog(LOG_DEBUG, "%s: send response", MODULE);
resmax = SOCK_MSGMAX(sbuf->sb_sock);
resmax = session_max_payload_size(s... | false | false | false | false | false | 0 |
qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QWidget::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 1)
qt_static_metacall(this, _c, _id, _a);
_id -= 1;
}
#ifndef QT_NO_PROPERTIES
else if ... | false | false | false | false | false | 0 |
_gal_a11y_e_cell_destroy_action_info (gpointer action_info,
gpointer user_data)
{
ActionInfo *info = (ActionInfo *) action_info;
g_return_if_fail (info != NULL);
g_free (info->name);
g_free (info->description);
g_free (info->keybinding);
g_free (info);
} | false | false | false | false | false | 0 |
replay_finish( struct copy_context *copy )
{
struct gl_context *ctx = copy->ctx;
GLuint i;
/* Free our vertex and index buffers:
*/
free(copy->translated_elt_buf);
free(copy->dstbuf);
free(copy->dstelt);
/* Unmap VBO's
*/
for (i = 0; i < copy->nr_varying; i++) {
struct gl_buffe... | false | false | false | false | false | 0 |
add_visibility(gboolean val)
{
stacksize++;
if (maxsize < stacksize) {
maxsize += 128;
visible = g_realloc(visible, maxsize * sizeof(gboolean));
if (visible == NULL)
maxsize = 0;
}
visible[stacksize - 1] = val;
} | false | false | false | true | false | 1 |
sumo_power_level_enable(struct radeon_device *rdev, u32 index, bool enable)
{
u32 reg_index = index / 4;
u32 field_index = index % 4;
if (field_index == 0)
WREG32_P(CG_SCLK_DPM_CTRL + (reg_index * 4),
enable ? SCLK_FSTATE_0_VLD : 0, ~SCLK_FSTATE_0_VLD);
else if (field_index == 1)
WREG32_P(CG_SCLK_DPM_CTRL ... | false | false | false | false | false | 0 |
check_bigc (void)
{
gmp_randstate_t r;
mpz_t a;
unsigned long c, m2exp, bits;
int i;
mpz_init_set_ui (a, 0L);
c = ULONG_MAX;
m2exp = 8;
gmp_randinit_lc_2exp (r, a, c, m2exp);
gmp_randseed_ui (r, 0L);
for (i = 0; i < 20; i++)
{
bits = 123L;
mpz_urandomb ... | false | false | false | false | false | 0 |
arg_endindex(struct arg_hdr **table)
{
int tabindex=0;
while (!(table[tabindex]->flag&ARG_TERMINATOR))
tabindex++;
return tabindex;
} | false | false | false | false | false | 0 |
asCalendarTime(MSTime::MSTimeZone zone_) const
{
time_t rc=-1;
if (date()!=nullDate())
{
struct tm aTimeStruct={0};
MSMonth m; MSDay d; MSYear y;
asMonthDayYear(m,d,y);
aTimeStruct.tm_mday=d;
aTimeStruct.tm_mon=m-1;
//Do not substruct 1900 from the year as greenwichMeanTime ... | false | false | false | false | false | 0 |
luaC_step (lua_State *L) {
global_State *g = G(L);
l_mem debt = getdebt(g); /* GC deficit (be paid now) */
if (!g->gcrunning) { /* not running? */
luaE_setdebt(g, -GCSTEPSIZE * 10); /* avoid being called too often */
return;
}
do { /* repeat until pause or enough "credit" (negative debt) */
lu... | false | false | false | false | false | 0 |
worker_sleep(unsigned int seconds)
{
pthread_mutex_lock(&m_worker_wakeup);
worker_wkup = false;
pthread_mutex_unlock(&m_worker_wakeup);
while (seconds-- && !worker_wkup && !(EXITING))
{
sleep(1);
}
} | false | false | false | false | false | 0 |
dispatch(TagService *obj, void*)
{
object_name = QString::fromUtf8(obj->getName().c_str());
type_name = obj->getTypeName().c_str();
tag = obj->getStr("tagcode").c_str();
return this;
} | false | false | false | false | false | 0 |
decode_sector_rle(teledisk_prop_t *prop, int track_idx, unsigned char *buf)
{
int a, c, code, b1, b2, len, idx;
idx = 0;
while (idx < prop->offset[track_idx].l)
{
code = fgetc(prop->f);
switch (code)
{
case 0:
len = fgetc(prop->f);
for (a = 0;a < len;a++)
{
c = fgetc(pro... | false | true | false | false | true | 1 |
iteration_finish_one(lame_internal_flags * gfc, int gr, int ch)
{
SessionConfig_t const *const cfg = &gfc->cfg;
III_side_info_t *const l3_side = &gfc->l3_side;
gr_info *const cod_info = &l3_side->tt[gr][ch];
/* try some better scalefac storage
*/
best_scalefac_store(gfc, gr, ch, l3_side);
... | false | false | false | false | false | 0 |
doushell(BW *bw, unsigned char *cmd, int *notify, int build)
{
#ifdef __MSDOS__
if (notify) {
*notify = 1;
}
varm(s);
msgnw(bw->parent, "Sorry, no sub-processes in DOS (yet)");
return -1;
#else
MPX *m;
unsigned char **s;
unsigned char *u;
const unsigned char *name;
name = getushell();
s = vamk(10);
u = v... | false | false | false | false | false | 0 |
watch_susp(snd_susp_type s)
{
if (!susp_to_watch) {
susp_to_watch = s;
nyquist_printf("watching susp %p\n", s);
}
} | false | false | false | false | false | 0 |
check_cr_read(struct x86_emulate_ctxt *ctxt)
{
if (!valid_cr(ctxt->modrm_reg))
return emulate_ud(ctxt);
return X86EMUL_CONTINUE;
} | false | false | false | false | false | 0 |
saa7127_set_output_type(struct v4l2_subdev *sd, int output)
{
struct saa7127_state *state = to_state(sd);
switch (output) {
case SAA7127_OUTPUT_TYPE_RGB:
state->reg_2d = 0x0f; /* RGB + CVBS (for sync) */
state->reg_3a = 0x13; /* by default switch YUV to RGB-matrix on */
break;
case SAA7127_OUTPUT_TYPE_COMPO... | false | false | false | false | false | 0 |
decode_sector(teledisk_prop_t *prop, int track_idx, unsigned char *buf)
{
int type;
char *name;
type = fgetc(prop->f);
switch (type)
{
case 0x00: name = "copy"; break;
case 0x01: name = "mult"; break;
case 0x02: name = "rle"; break;
default: name = "unknown"; break;
}
//printf... | false | true | false | false | true | 1 |
dump_module_list(void)
{
struct module *mp = module_head;
DEBUGMSGTL(("parse-mibs", "Module list:\n"));
while (mp) {
DEBUGMSGTL(("parse-mibs", " %s %d %s %d\n", mp->name, mp->modid,
mp->file, mp->no_imports));
mp = mp->next;
}
} | false | false | false | false | false | 0 |
jpc_ict(jas_matrix_t *c0, jas_matrix_t *c1, jas_matrix_t *c2)
{
int numrows;
int numcols;
int i;
int j;
jpc_fix_t r;
jpc_fix_t g;
jpc_fix_t b;
jpc_fix_t y;
jpc_fix_t u;
jpc_fix_t v;
jpc_fix_t *c0p;
jpc_fix_t *c1p;
jpc_fix_t *c2p;
numrows = jas_matrix_numrows(c0);
assert(jas_matrix_numrows(c1) == numrows... | false | false | false | false | false | 0 |
prune_tmp_object(const char *path, const char *filename)
{
const char *fullpath = mkpath("%s/%s", path, filename);
if (expire) {
struct stat st;
if (lstat(fullpath, &st))
return error("Could not stat '%s'", fullpath);
if (st.st_mtime > expire)
return 0;
}
printf("Removing stale temporary file %s\n", ful... | false | false | false | false | false | 0 |
dump_adb(dns_adb_t *adb, FILE *f, isc_boolean_t debug, isc_stdtime_t now) {
unsigned int i;
dns_adbname_t *name;
dns_adbentry_t *entry;
fprintf(f, ";\n; Address database dump\n;\n");
if (debug)
fprintf(f, "; addr %p, erefcnt %u, irefcnt %u, finds out %u\n",
adb, adb->erefcnt, adb->irefcnt,
isc_mempool_get... | false | false | false | false | false | 0 |
ParseError(BYTE status_reg)
{
DBG1("DJ850: parsing error info\n");
DRIVER_ERROR err = NO_ERROR;
BYTE DevIDBuffer[DevIDBuffSize];
if(IOMode.bDevID)
{
// If a bi-di cable was plugged in and everything was OK, let's see if it's still
// plugged in and everything is OK
err = pS... | false | false | false | false | false | 0 |
t509_wait_for_id_sequence ( void ) {
outb ( 0x00, t509_id_port );
} | false | false | false | false | false | 0 |
MaxPop(WiggleIterator * wi) {
StatData * data = (StatData *) wi->data;
if (data->source->done) {
wi->done = true;
return;
}
wi->chrom = data->source->chrom;
wi->start = data->source->start;
wi->finish = data->source->finish;
wi->value = data->source->value;
if (!isnan(wi->value) && (isnan(data->res) || w... | false | false | false | false | false | 0 |
eog_image_get_xmp_info (EogImage *img)
{
gpointer data = NULL;
g_return_val_if_fail (EOG_IS_IMAGE (img), NULL);
#ifdef HAVE_EXEMPI
EogImagePrivate *priv;
priv = img->priv;
g_mutex_lock (&priv->status_mutex);
data = (gpointer) xmp_copy (priv->xmp);
g_mutex_unlock (&priv->status_mutex);
#endif
return dat... | false | false | false | false | false | 0 |
Map(istream* s, bool memorymap,
const string& source, size_t size) {
std::streampos spos = s->tellg();
if (memorymap && spos >= 0 && spos % kArchAlignment == 0) {
size_t pos = spos;
int fd = open(source.c_str(), O_RDONLY);
if (fd != -1) {
int pagesize = sysconf(_SC_PAGE... | false | false | false | false | false | 0 |
obj_desc_combat(const object_type *o_ptr, char *buf, size_t max,
size_t end, bool spoil)
{
object_kind *k_ptr = &k_info[o_ptr->k_idx];
bitflag flags[OF_SIZE];
bitflag flags_known[OF_SIZE];
object_flags(o_ptr, flags);
object_flags_known(o_ptr, flags_known);
/* Dump base weapon info */
switch (o_ptr->tval)
{... | false | false | false | false | false | 0 |
runModeless (XAP_Frame * pFrame)
{
static std::pointer_to_unary_function<int, gboolean> s_update_fun = std::ptr_fun(s_update);
_constructWindow ();
UT_ASSERT (m_wMainWindow);
clearDirty();
abiSetupModelessDialog(GTK_DIALOG(m_wMainWindow), pFrame, this, BUTTON_APPLY);
connectFocusModelessOther (GTK_WIDGET (m_wMai... | false | false | false | false | false | 0 |
DCC_sendchat(char *nick, char *uh)
{
dccrec *d;
context;
/* Open server connection and wait for chat */
d = DCC_addnewconnection(nick,uh,0,0,Grufti->chat_port,DCC_SERVER|SERVER_IRC_CHAT);
if(d == NULL)
return NULL;
context;
/* Send the user a DCC CHAT request. */
Server_write(PRIORITY_HIGH,"PRIVMSG %s :\001... | false | false | false | false | false | 0 |
pilFitsHdrReadString(PilFitsFile *fitsFile,
const char *keyName, char **value)
{
int status = 0;
if (fitsFile)
*value = (char *)pil_malloc(FLEN_VALUE * sizeof(char));
if (*value)
if (!ffgky(fitsFile->fptr, TSTRING, (char *)keyName, *value,
NULL... | false | false | false | true | false | 1 |
ParseDCHubConfig( CXml * xml )
{
DCConfigHubItem * hubitem;
CString xml_name;
do
{
/* parse server entrys */
if ( (xml->Name() == XML_SERVER) && xml->FirstChild() )
{
do
{
// public hub list
if ( (xml->Name() == XML_PUBLIC) && xml->FirstChild() )
{
hubitem = new DCConfigHubItem();
... | false | false | false | false | false | 0 |
atmel_request_gpio_irq(struct uart_port *port)
{
struct atmel_uart_port *atmel_port = to_atmel_uart_port(port);
int *irq = atmel_port->gpio_irq;
enum mctrl_gpio_idx i;
int err = 0;
for (i = 0; (i < UART_GPIO_MAX) && !err; i++) {
if (irq[i] < 0)
continue;
irq_set_status_flags(irq[i], IRQ_NOAUTOEN);
err =... | false | false | false | false | false | 0 |
min_height(TerrainTypeCode tc, SubTerrainMask subtc)
{
int s, j;
for(s=0,j=1 ; s < 3 && !(subtc & j); ++s, j+=j);
return terrain_type_min_height_array[tc-1][s];
} | false | false | false | false | true | 1 |
ath_reg_apply_beaconing_flags(struct wiphy *wiphy,
struct ath_regulatory *reg,
enum nl80211_reg_initiator initiator)
{
enum ieee80211_band band;
struct ieee80211_supported_band *sband;
struct ieee80211_channel *ch;
unsigned int i;
for (band = 0; band < IEEE80211_NUM_BANDS; band++) {
if (!wiphy... | false | false | false | false | false | 0 |
hasIOResultType(ty) /* return TRUE if FFI/primitive type sig is an IO action. */
Type ty; {
Type t = ty;
if (isPolyType(t)) {
t = monotypeOf(t);
}
t = fullerExpand(t);
while (getHead(t) == typeArrow && argCount == 2) {
t = fullerExpand(arg(t));
}
return (getHead(t) == typeIO && argCount == 1... | false | false | false | false | false | 0 |
check_pubkey_sign (int n, gcry_sexp_t skey, gcry_sexp_t pkey, int algo)
{
gcry_error_t rc;
gcry_sexp_t sig, badhash, hash;
int dataidx;
static const char baddata[] =
"(data\n (flags pkcs1)\n"
" (hash sha1 #11223344556677889900AABBCCDDEEFF10203041#))\n";
static struct
{
const char *data;
int ... | false | false | false | false | false | 0 |
SetBox ( BoxRef theBox, const void* dataPtr, XMP_Uns32 size )
{
XMP_Enforce ( size < moovBoxSizeLimit );
BoxNode * node = (BoxNode*)theBox;
if ( node->contentSize == size ) {
XMP_Uns8 * oldContent = PickContentPtr ( *node );
if ( memcmp ( oldContent, dataPtr, size ) == 0 ) return; // No change.
memcpy ( ol... | false | false | false | false | false | 0 |
role_destroy(void *key, void *datum, void *p)
{
struct role_datum *role;
kfree(key);
if (datum) {
role = datum;
ebitmap_destroy(&role->dominates);
ebitmap_destroy(&role->types);
}
kfree(datum);
return 0;
} | false | false | false | false | false | 0 |
OpenSerial (char * port)
{
if((fd = open(port, O_RDWR|O_NOCTTY)) == -1) // tester avec O_NDELAY
{
perror("open failed");
return (-1);
}
return (InitSerialCfg());
} | false | false | false | false | false | 0 |
GMatrixEditEnableColumn(GGadget *g, int col, int enabled) {
GMatrixEdit *gme = (GMatrixEdit *) g;
/* User must do a refresh of the gadget. Don't want to do it always */
/* because multiple calls might cause a flicker */
if ( col<0 || col>=gme->cols )
return;
gme->col_data[col].disabled = !enabled;
... | false | false | false | false | false | 0 |
initDemoEventWiring(void)
{
using namespace CEGUI;
// Subscribe handler that quits the application
WindowManager::getSingleton().getWindow("Demo7/Window1/Quit")->
subscribeEvent(PushButton::EventClicked, Event::Subscriber(&Demo7Sample::handleQuit, this));
// Subscribe handler that processes ch... | false | false | false | false | false | 0 |
e1000_loopback_test(struct e1000_adapter *adapter, u64 *data)
{
*data = e1000_setup_desc_rings(adapter);
if (*data)
goto out;
*data = e1000_setup_loopback_test(adapter);
if (*data)
goto err_loopback;
*data = e1000_run_loopback_test(adapter);
e1000_loopback_cleanup(adapter);
err_loopback:
e1000_free_desc_rin... | false | false | false | false | false | 0 |
v_unpack_o_transform_pos_real64(const char *buf, size_t buffer_length)
{
unsigned int buffer_pos = 0;
void (* func_o_transform_pos_real64)(void *user_data, VNodeID node_id, uint32 time_s, uint32 time_f, const real64 *pos, const real64 *speed, const real64 *accelerate, const real64 *drag_normal, real64 drag);
VNodeID... | false | false | false | false | false | 0 |
vprintf(const char *format, va_list va)
{
switch (s_type) {
case TEXT:
if (vfprintf(text.s_fp, format, va) < 0)
goto fail;
break;
case GZIP: {
int len;
va_list va_save;
if (!gzip.s_aux_buf) {
gzip.s_aux_buf_sz = 128;
gzip.s_aux_buf = (char*)xmalloc(gzip.s_aux_buf_sz);
}
while (1) {
... | false | false | false | false | false | 0 |
sendto_channel_flags(struct Client *one, int type, struct Client *source_p,
struct Channel *chptr, const char *pattern, ...)
{
static char buf[BUFSIZE];
va_list args;
buf_head_t rb_linebuf_local;
buf_head_t rb_linebuf_name;
buf_head_t rb_linebuf_id;
struct Client *target_p;
struct membership *msptr;
rb_d... | true | true | false | false | false | 1 |
finishSession(QNetworkReply *reply)
{
progressBar->setValue(8);
TtbSessionParser handler;
QXmlInputSource source( reply );
QXmlSimpleReader reader;
reader.setContentHandler( &handler );
if( ! reader.parse( source ) ){
progressLabel->setText(tr("failed to parse Session response: ")
... | false | false | false | false | false | 0 |
dict_get_ptr (dict_t *this, char *key, void **ptr)
{
data_t * data = NULL;
int ret = 0;
if (!this || !key || !ptr) {
ret = -EINVAL;
goto err;
}
ret = dict_get_with_ref (this, key, &data);
if (ret != 0) {
goto err;
... | false | false | false | false | false | 0 |
bnx2x_848xx_pair_swap_cfg(struct bnx2x_phy *phy,
struct link_params *params,
struct link_vars *vars)
{
u32 pair_swap;
u16 data[PHY848xx_CMDHDLR_MAX_ARGS];
int status;
struct bnx2x *bp = params->bp;
/* Check for configuration. */
pair_swap = REG_RD(bp, params->shmem_base +
offsetof(struct ... | false | false | false | false | false | 0 |
SeExprpos()
{
return SeExpr_c_buf_p - SeExprYY_CURRENT_BUFFER->SeExpr_ch_buf - SeExprleng;
} | false | false | false | true | false | 1 |
pool_boundary(alloc_pool_t p, size_t len)
{
struct alloc_pool *pool = (struct alloc_pool *)p;
struct pool_extent *cur;
if (!pool || !pool->extents)
return NULL;
cur = pool->extents;
if (cur->free < len) {
cur->bound += cur->free;
cur->free = 0;
}
return PTR_ADD(cur->start, cur->free);
} | false | false | false | false | true | 1 |
ocaml_ao_stubs_shutdown(value unit)
{
CAMLparam0();
/* shut down libao */
ao_shutdown();
CAMLreturn(Val_unit);
} | false | false | false | false | false | 0 |
TestHugeThreadCache() {
fprintf(LOGSTREAM, "==== Testing huge thread cache\n");
// More than 2^16 to cause integer overflow of 16 bit counters.
static const int kNum = 70000;
char** array = new char*[kNum];
for (int i = 0; i < kNum; ++i) {
array[i] = new char[10];
}
for (int i = 0; i < kNum; ++i) {
... | false | false | false | false | false | 0 |
L9()
{register object *base=vs_base;
register object *sup=base+VM9; VC9
vs_check;vs_top=sup;
{object V10=base[0]->c.c_cdr;
base[2]= (V10->c.c_car);}
V11= list(2,((object)VV[8]),base[2]);
base[3]= list(3,((object)VV[7]),/* INLINE-ARGS */V11,list(3,((object)VV[9]),list(2,((object)VV[10]),base[2]),((object)VV[17])))... | false | false | false | false | false | 0 |
Aggro(Unit* /*who*/) override
{
// For an small probability the npc says something when he get aggro
switch (urand(0, 9))
{
case 0:
DoScriptText(SAY_OOX_AGGRO1, m_creature);
break;
case 1:
DoScriptText(SAY_OOX_AGGRO2, m_... | false | false | false | false | false | 0 |
gioparseipport (char *host, unsigned int *ip, unsigned short *port)
#else
static int gioparseipport(host, ip, port)
char *host;
unsigned int *ip;
unsigned short *port;
#endif
{
char *s1, *p1, *p2;
int got;
/* start out pessimistically */
*ip = 0;
*port = 0;
/* make sure we have something to... | false | false | false | false | false | 0 |
make_scalar_array_op(ParseState *pstate, List *opname,
bool useOr,
Node *ltree, Node *rtree,
int location)
{
Oid ltypeId,
rtypeId,
atypeId,
res_atypeId;
Operator tup;
Form_pg_operator opform;
Oid actual_arg_types[2];
Oid declared_arg_types[2];
List *args;
Oid rettype;
Sc... | false | false | false | false | false | 0 |
_copyAlterTableSpaceOptionsStmt(const AlterTableSpaceOptionsStmt *from)
{
AlterTableSpaceOptionsStmt *newnode = makeNode(AlterTableSpaceOptionsStmt);
COPY_STRING_FIELD(tablespacename);
COPY_NODE_FIELD(options);
COPY_SCALAR_FIELD(isReset);
return newnode;
} | false | false | false | false | false | 0 |
isspace_str(const gchar *str, int nomorethan)
{
const gchar *cursor = str;
while (*cursor && (nomorethan != 0))
{
if (!isspace(*cursor))
{
return(FALSE);
}
cursor++;
nomorethan--;
}
return(TRUE);
} | false | false | false | false | false | 0 |
xselect(void)
{
char c;
while (1) {
bb_putchar('\n');
c = 0x20 | read_nonempty("Expert command (m for help): ");
switch (c) {
case 'a':
if (LABEL_IS_SUN)
sun_set_alt_cyl();
break;
case 'b':
if (LABEL_IS_DOS)
move_begin(get_partition(0, g_partitions));
break;
case 'c':
user_cylinder... | false | false | false | false | false | 0 |
gee_map_iterator_real_fold (GeeMapIterator* self, GType a_type, GBoxedCopyFunc a_dup_func, GDestroyNotify a_destroy_func, GeeFoldMapFunc f, void* f_target, gpointer seed) {
gpointer result = NULL;
gboolean _tmp0_ = FALSE;
gboolean _tmp1_ = FALSE;
gpointer _tmp17_ = NULL;
_tmp0_ = gee_map_iterator_get_valid (self);... | false | false | false | false | false | 0 |
dma_debugger_activate_plugin (DmaDebuggerQueue* self, const gchar *mime_type)
{
AnjutaPluginManager *plugin_manager;
AnjutaPluginHandle *plugin;
GList *plugins = NULL;
gchar *value;
/* Get list of debugger plugins */
plugin_manager = anjuta_shell_get_plugin_manager (ANJUTA_PLUGIN(self->plugin)->shell, NULL);
if... | false | false | false | false | false | 0 |
set_subquery_pathlist(PlannerInfo *root, RelOptInfo *rel,
Index rti, RangeTblEntry *rte)
{
Query *parse = root->parse;
Query *subquery = rte->subquery;
bool *differentTypes;
double tuple_fraction;
PlannerInfo *subroot;
List *pathkeys;
/*
* Must copy the Query so that planning doesn't mess ... | false | false | false | false | false | 0 |
ProvidesExtendedResponse(void)
{
uint32_t iBuildDate(0);
if (m_commands)
iBuildDate = m_commands->GetPersistedBuildDate();
return iBuildDate >= CEC_FW_DATE_EXTENDED_RESPONSE;
} | false | false | false | false | false | 0 |
fetch_item(__u8 *start, __u8 *end, struct hid_item *item)
{
u8 b;
if ((end - start) <= 0)
return NULL;
b = *start++;
item->type = (b >> 2) & 3;
item->tag = (b >> 4) & 15;
if (item->tag == HID_ITEM_TAG_LONG) {
item->format = HID_ITEM_FORMAT_LONG;
if ((end - start) < 2)
return NULL;
item->size = ... | false | false | false | false | false | 0 |
esl_sq_Checksum(const ESL_SQ *sq, uint32_t *ret_checksum)
{
uint32_t val = 0;
uint64_t pos;
if (sq->seq != NULL)
{
for (pos = 0; pos < sq->n; pos++)
{
val += sq->seq[pos];
val += (val << 10);
val ^= (val >> 6);
}
}
#ifdef eslAUGMENT_ALPHABET
else
{
for (pos = 1; pos <= sq->n... | false | false | false | false | false | 0 |
CERT_GetCertTimes(const CERTCertificate *c, PRTime *notBefore, PRTime *notAfter)
{
SECStatus rv;
if (!c || !notBefore || !notAfter) {
PORT_SetError(SEC_ERROR_INVALID_ARGS);
return SECFailure;
}
/* convert DER not-before time */
rv = DER_DecodeTimeChoice(notBefore, &c->validity.... | false | false | false | false | false | 0 |
gretl_get_critval (int dist, const double *parm, double a)
{
double x = NADBL;
if (pdist_check_input(dist, parm, a) == E_MISSDATA) {
return x;
}
if (dist == D_NORMAL) {
x = normal_critval(a);
} else if (dist == D_STUDENT) {
x = student_critval(parm[0], a);
} else if (dist == D_CHISQ) {
x ... | false | false | false | false | false | 0 |
setTable(const QString table)
{
if (DEBUG) qDebug("setTable(%s) entered", qPrintable(table));
_table->setCurrentIndex(_table->findData(table, Qt::DisplayRole));
if (_table->currentIndex() < 0 && table.contains("."))
{
QString unqualrelname = table.right(table.length() -
... | false | false | false | false | false | 0 |
bthci_CmdEnableAMPReceiverReports(struct rtw_adapter *padapter,
struct packet_irp_hcicmd_data *pHciCmd)
{
enum hci_status status = HCI_STATUS_SUCCESS;
struct bt_30info *pBTInfo = GET_BT_INFO(padapter);
struct bt_hci_info *pBtHciInfo = &pBTInfo->BtHciInfo;
if (!pBtHciInfo->bInTestMode) {
status = HCI_STATUS... | false | false | false | false | false | 0 |
Term_mbstowcs(wchar_t *dest, const char *src, int n)
{
if (Term && Term->mbcs_hook)
return (*Term->mbcs_hook)(dest, src, n);
else
return mbstowcs(dest, src, n);
} | false | false | false | false | false | 0 |
sc_parse_let (ScParseState *state, char const *cmd, char const *str,
GnmCellPos const *pos)
{
GnmExprTop const *texpr;
GnmCell *cell;
GnmParsePos pp;
GnmValue const *v;
g_return_val_if_fail (cmd, FALSE);
g_return_val_if_fail (str, FALSE);
cell = sc_sheet_cell_fetch (state, pos->col, pos->row);
if (!cel... | false | false | false | false | false | 0 |
sizeOfNode(FrameDataNode const *node)
{
size_t n = 0;
if (node) {
n = 10; /* header size */
n += 1; /* text encoding flag */
switch (node->txt.enc) {
default:
case 0:
n += node->txt.dim;
break;
case 1:
n += node... | false | false | false | false | false | 0 |
string_insert(string *s, int n, char *in) {
int inlen;
s = string_check(s);
if(in == NULL) {
return s;
}
inlen = strlen(in);
if(s->n + inlen >= s->alloc) {
string_grow(s, s->n + inlen);
}
if(n < 0) {
n = 0;
}
if(n >= s->n) {
n = s->n;
}
memmove(s->str + n + inlen,
s->str + n... | false | false | false | false | false | 0 |
set_pte_vaddr(unsigned long vaddr, pte_t pteval)
{
pgd_t *pgd;
pud_t *pud_page;
pr_debug("set_pte_vaddr %lx to %lx\n", vaddr, native_pte_val(pteval));
pgd = pgd_offset_k(vaddr);
if (pgd_none(*pgd)) {
printk(KERN_ERR
"PGD FIXMAP MISSING, it should be setup in head.S!\n");
return;
}
pud_page = (pud_t*)pgd... | false | false | false | false | false | 0 |
gonzo_alias_to_actual_sub(gonzo_ty *gp, string_ty *name)
{
gstate_ty *gstate_data;
size_t j;
string_ty *result;
//
// find the project in the gstate
//
trace(("gonzo_alias_to_actual_sub(gp = %08lX, name = \"%s\")\n{\n",
(long)gp, name->str_text));
gstate_dat... | false | false | false | false | false | 0 |
fts_close(sp)
FTS *sp;
{
FTSENT *freep, *p;
int saved_errno;
/*
* This still works if we haven't read anything -- the dummy structure
* points to the root list, so we step through to the end of the root
* list which has a valid parent pointer.
*/
if (sp->fts_cur) {
for (p = sp->fts_cur; p->fts_level >= ... | false | false | false | false | false | 0 |
dev_init(void)
{
ListIterator i;
subsystem_t *sub;
int rc;
splatctl_fd = open(SPLAT_DEV, O_RDONLY);
if (splatctl_fd == -1) {
fprintf(stderr, "Unable to open %s: %d\n"
"Is the splat module loaded?\n", SPLAT_DEV, errno);
rc = errno;
goto error;
}
/* Determine kernel module version string */
mems... | false | false | false | false | false | 0 |
cpm2unix_time(int days, int hour, int min)
{
/* CP/M stores timestamps in local time. We don't know which */
/* timezone was used and if DST was in effect. Assuming it was */
/* the current offset from UTC is most sensible, but not perfect. */
int year,days_per_year;
static int days_per_month[]={31,0... | false | false | false | false | false | 0 |
real_event_table_destroy(struct event_table *t, bool cleanup)
{
if (cleanup)
event_table_remove_all(t);
hikset_free_null(&t->events);
} | false | false | false | false | false | 0 |
HandleStun(
const char* bytes, size_t size, const talk_base::SocketAddress& remote_addr,
talk_base::AsyncPacketSocket* socket, std::string* username,
StunMessage* msg) {
// Parse this into a stun message.
talk_base::ByteBuffer buf(bytes, size);
if (!msg->Read(&buf)) {
SendStunError(*msg, socket, ... | 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.