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 |
|---|---|---|---|---|---|---|
get_allocated_undo_memory_size(void)
{
int i = 0;
size_t dynamic_memory_size = (size_t)(
active_z_story->dynamic_memory_end - z_mem + 1 );
size_t result
= ( sizeof(struct undo_frame*) * max_undo_steps )
+ ( undo_index * (sizeof(struct undo_frame) + dynamic_memory_size) );
while (i < undo_index)
... | false | false | false | false | false | 0 |
callAsFunction(ExecState *exec, JSObject * /*thisObj*/, const List &args)
{
fprintf(stderr,"--> %s\n",args[0]->toString(exec).ascii());
return jsUndefined();
} | false | false | false | false | false | 0 |
gst_mss_stream_get_current_bitrate (GstMssStream * stream)
{
GstMssStreamQuality *q;
if (stream->current_quality == NULL)
return 0;
q = stream->current_quality->data;
return q->bitrate;
} | false | false | false | false | false | 0 |
io_open(struct io *io, const char *name)
{
init_io(io, NULL, IO_FD);
io->pipe = *name ? open(name, O_RDONLY) : STDIN_FILENO;
return io->pipe != -1;
} | false | false | false | false | false | 0 |
get_generic_param (VerifyContext *ctx, MonoType *param)
{
guint16 param_num = mono_type_get_generic_param_num (param);
if (param->type == MONO_TYPE_VAR) {
if (!ctx->generic_context->class_inst || ctx->generic_context->class_inst->type_argc <= param_num) {
ADD_VERIFY_ERROR (ctx, g_strdup_printf ("Invalid generic... | false | false | false | false | false | 0 |
KernAdvance(unsigned int index1, unsigned int index2)
{
float x, y;
if(!hasKerningTable || !index1 || !index2)
{
return FTPoint(0.0f, 0.0f);
}
if(kerningCache && index1 < FTFace::MAX_PRECOMPUTED
&& index2 < FTFace::MAX_PRECOMPUTED)
{
x = kerningCache[2 * (index2 * FTFac... | false | false | false | false | false | 0 |
requestSuggestions(const QString &searchTerm)
{
if (searchTerm.isEmpty() || !providesSuggestions())
return;
Q_ASSERT(m_networkAccessManager);
if (!m_networkAccessManager)
return;
if (m_suggestionsReply) {
m_suggestionsReply->disconnect(this);
m_suggestionsReply->abort(... | false | false | false | false | false | 0 |
event_music_start_default()
{
int next_pattern;
if ( Event_Music_battle_started == TRUE ) {
if ( hostile_ships_present() ) {
next_pattern = SONG_BTTL_1;
}
else {
Event_Music_battle_started = FALSE;
next_pattern = SONG_NRML_1;
}
}
else
{
next_pattern = SONG_NRML_1;
}
// switch now
if ( Cur... | false | false | false | false | false | 0 |
event_area_paint (GthImageSelector *self,
EventArea *event_area,
cairo_t *cr)
{
Sides sides = SIDE_NONE;
switch (event_area->id) {
case C_SELECTION_AREA:
break;
case C_TOP_AREA:
sides = SIDE_RIGHT | SIDE_BOTTOM | SIDE_LEFT;
break;
case C_BOTTOM_AREA:
sides = SIDE_TOP | SIDE_RIGHT |... | false | false | false | false | false | 0 |
pg_detoast_datum_copy(struct varlena * datum)
{
if (VARATT_IS_EXTENDED(datum))
return heap_tuple_untoast_attr(datum);
else
{
/* Make a modifiable copy of the varlena object */
Size len = VARSIZE(datum);
struct varlena *result = (struct varlena *) palloc(len);
memcpy(result, datum, len);
return result;
... | false | false | false | false | false | 0 |
atp_on_editor_input_variable_show (GtkButton *button, gpointer user_data)
{
ATPToolEditor* this = (ATPToolEditor*)user_data;
switch (get_combo_box_value (this->input_com))
{
case ATP_TIN_FILE:
atp_variable_dialog_show (&this->input_file_var, ATP_FILE_VARIABLE);
break;
case ATP_TIN_STRING:
atp_variable_dialo... | false | false | false | false | false | 0 |
ToUpperStr (char *str)
{ static char buffer[CF_BUFSIZE];
int i;
memset(buffer,0,CF_BUFSIZE);
if (strlen(str) >= CF_BUFSIZE)
{
char *tmp;
tmp = malloc(40+strlen(str));
sprintf(tmp,"String too long in ToUpperStr: %s",str);
FatalError(tmp);
}
for (i = 0; (str[i] != '\0') && (i < CF_BUFSIZE-1); i... | false | false | false | false | false | 0 |
word_get_index(const char *str, int pos)
{
bool in_word = false;
int words = 0;
int c;
for (c = 0; str[c] != '\0' && c < pos; c++) {
if (!in_word && !isspace(str[c])) {
in_word = true;
}
if (in_word && isspace(str[c])) {
in_word = false;
words++;
}
}
return words;
} | false | false | false | false | false | 0 |
http_GetHdr(const struct http *hp, const char *hdr, char **ptr)
{
unsigned u, l;
char *p;
l = hdr[0];
diagnostic(l == strlen(hdr + 1));
assert(hdr[l] == ':');
hdr++;
u = http_findhdr(hp, l - 1, hdr);
if (u == 0) {
if (ptr != NULL)
*ptr = NULL;
return (0);
}
if (ptr != NULL) {
p = hp->hd[u].b + l;
... | false | false | false | false | false | 0 |
Java_magick_MagickImage_convolveImage
(JNIEnv *env, jobject self, jint order, jdoubleArray kernel)
{
Image *image = NULL, *convolvedImage = NULL;
jobject newObj;
ExceptionInfo exception;
double *karray;
image = (Image*) getHandle(env, self, "magickImageHandle", NULL);
if (image == NULL) {
th... | false | false | false | false | false | 0 |
get( const char *key, void *data, const void *defaultValue, int defaultSize, int maxSize )
{
const char *v = node->get( key );
if ( v )
{
int dsize;
void *w = decodeHex( v, dsize );
memmove( data, w, dsize>maxSize?maxSize:dsize );
free( w );
return 1;
}
if ( defaultValue )
memmove(... | false | false | false | false | false | 0 |
language_cobol_trigger_completion (Language_Provider *lgcobol, guint ch)
{
g_return_if_fail(lgcobol);
Language_COBOLDetails *lgcoboldet = LANGUAGE_COBOL_GET_PRIVATE(lgcobol);
gint current_pos;
gchar *member_function_buffer = NULL;
current_pos = gtk_scintilla_get_current_pos(lgcoboldet->sci);
gboolean auto_... | false | false | false | false | false | 0 |
ExChildProcess ()
{
/*
* Wait for all the children to appear and the parent to signal OK to
* start processing.
*/
_dxf_ExInitTaskPerProc();
/* don't send out worker messages for slaves */
if(!_dxd_exRemoteSlave)
DXMessage ("#1060", getpid ());
while ((nprocs > 1) && (! *exR... | false | false | false | false | false | 0 |
xmms_diskwrite_flush (xmms_output_t *output)
{
xmms_diskwrite_data_t *data;
g_return_if_fail (output);
data = xmms_output_private_data_get (output);
g_return_if_fail (data);
g_return_if_fail (data->fp);
fflush (data->fp);
} | false | false | false | false | false | 0 |
add_exclude_hpb(char *input, unsigned char mode)
{
struct parser_options *excluded_this;
struct in_addr ip;
excluded_this = xmalloc(sizeof(struct parser_options));
excluded_this->mode = mode;
excluded_this->svalue = NULL;
if (mode & PARSER_MODE_HOST) {
struct parser_options *excluded_test;
excluded... | false | false | false | false | false | 0 |
uncompress_bcd(unsigned char *bcd)
{
char *out = calloc(INLINE_STR_LEN*2 + 1, sizeof(char));
for (int inpos = 0; inpos < INLINE_STR_LEN*2; inpos++) {
unsigned int code = bcd[inpos/2];
if (inpos % 2 == 0) {
code &= 15;
} else {
code >>= 4;
}
if (co... | false | false | false | false | false | 0 |
handle_content_base64(struct ntb_mail_parser *parser,
const uint8_t *data,
size_t length_in,
struct ntb_error **error)
{
size_t length = length_in;
size_t chunk_size;
ssize_t got;
uint8_t buf[512];
while (length >... | false | false | false | false | false | 0 |
readFromStream(mrpt::utils::CStream &in,int version)
{
switch(version)
{
case 0:
{
int32_t n;
in >> n;
gaps_ini.resize(n);
gaps_end.resize(n);
in.ReadBuffer( &(*gaps_ini.begin()), sizeof(gaps_ini[0]) * n );
in.ReadBuffer( &(*gaps_end.begin()), sizeof(gaps_end[0]) * n );
in >> n;
gaps_eval... | false | false | false | false | false | 0 |
intel_miptree_set_level_info(struct intel_mipmap_tree *mt,
GLuint level,
GLuint x, GLuint y,
GLuint w, GLuint h, GLuint d)
{
mt->level[level].width = w;
mt->level[level].height = h;
mt->level[level].depth = d;
mt->level[level].level_x = x;
mt->level[level].level_y = y;
DBG("%s... | false | false | false | false | false | 0 |
ftp_disconnect(struct connectdata *conn, bool dead_connection)
{
struct ftp_conn *ftpc= &conn->proto.ftpc;
struct pingpong *pp = &ftpc->pp;
/* We cannot send quit unconditionally. If this connection is stale or
bad in any way, sending quit and waiting around here will make the
disconnect wait in vain a... | false | false | false | false | false | 0 |
v4l2_fh_init(struct v4l2_fh *fh, struct video_device *vdev)
{
fh->vdev = vdev;
/* Inherit from video_device. May be overridden by the driver. */
fh->ctrl_handler = vdev->ctrl_handler;
INIT_LIST_HEAD(&fh->list);
set_bit(V4L2_FL_USES_V4L2_FH, &fh->vdev->flags);
/*
* determine_valid_ioctls() does not know if struc... | false | false | false | false | false | 0 |
caml_sha3_wipe(value ctx)
{
if (Context_val(ctx) != NULL) {
memset(Context_val(ctx), 0, sizeof(struct SHA3Context));
caml_stat_free(Context_val(ctx));
Context_val(ctx) = NULL;
}
return Val_unit;
} | false | false | false | false | false | 0 |
append_avrule_to_subject_vector(const apol_policy_t * p,
apol_relabel_analysis_t * r, const qpol_avrule_t * avrule, apol_vector_t * results)
{
const qpol_type_t *target;
apol_vector_t *target_v = NULL, *result_list = NULL;
size_t i;
apol_relabel_result_t *result;
apol_relabel_result_pair_t *pair = NULL;
i... | false | false | false | false | false | 0 |
alt_size_entry_set_unit (AltSizeEntry *gse,
GimpUnit unit)
{
g_return_if_fail (ALT_IS_SIZE_ENTRY (gse));
g_return_if_fail (gse->menu_show_pixels || (unit != GIMP_UNIT_PIXEL));
g_return_if_fail (gse->menu_show_percent || (unit != GIMP_UNIT_PERCENT));
gimp_unit_menu_set_unit (GIMP... | false | false | false | false | false | 0 |
SingleDefgenericToCode(
void *theEnv,
FILE *theFile,
int imageID,
int maxIndices,
DEFGENERIC *theDefgeneric,
int moduleCount,
int methodArrayVersion,
int methodArrayCount)
{
/* ==================
Defgeneric Header
================== */
fprintf(theFile,"{");
ConstructHeaderToCode(t... | false | false | false | false | false | 0 |
viewfsmtrans( Trans )
fsmtrans_list *Trans;
{
fprintf( stdout, "\n--> Transition" );
fprintf( stdout, "\n\t\tFLAGS : %lx", Trans->FLAGS );
fprintf( stdout, "\n\t\tUSER : %lx", (long)Trans->USER );
fprintf( stdout, "\n\t\tFROM : " );
if ( Trans->FROM != (fsmstate_list *)0 )
{
fprintf( stdout, "%s", ... | false | false | false | false | false | 0 |
gtk_xtext_find_char (GtkXText * xtext, int x, int y, int *off,
int *out_of_bounds)
{
textentry *ent;
int line;
int subline;
line = (y + xtext->pixel_offset) / xtext->fontsize;
ent = gtk_xtext_nth (xtext, line + (int)xtext->adj->value, &subline);
if (!ent)
return 0;
if (off)
*off = gtk_xtext_find_x (... | false | false | false | false | false | 0 |
lua_init_specials(struct hid_device *hdev)
{
struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
struct usb_device *usb_dev = interface_to_usbdev(intf);
struct lua_device *lua;
int retval;
lua = kzalloc(sizeof(*lua), GFP_KERNEL);
if (!lua) {
hid_err(hdev, "can't alloc device descriptor\n");
retu... | false | false | false | false | false | 0 |
HandleDown(wxDC &dc, int x, int y)
{
HandleMotion(dc, x, y);
if( m_current ) {
m_current->Push(dc);
}
} | false | false | false | false | false | 0 |
_st_pgsql_count(st_driver_t drv, const char *type, const char *owner, const char *filter, int *count) {
drvdata_t data = (drvdata_t) drv->private;
char *cond, *buf = NULL;
int buflen = 0;
PGresult *res;
int ntuples, nfields;
char tbuf[128];
if(data->prefix != NULL) {
snprintf(tbuf, ... | false | false | false | false | false | 0 |
convert_hline_Y444 (paintinfo * p, int y)
{
int i;
guint8 *Y = p->yp + y * p->ystride;
guint8 *U = p->up + y * p->ustride;
guint8 *V = p->vp + y * p->vstride;
guint8 *ayuv = p->tmpline;
for (i = 0; i < p->width; i++) {
Y[i] = ayuv[4 * i + 1];
U[i] = ayuv[4 * i + 2];
V[i] = ayuv[4 * i + 3];
}
... | false | false | false | false | false | 0 |
omapi_io_signal_handler (omapi_object_t *h,
const char *name, va_list ap)
{
if (h -> type != omapi_type_io_object)
return DHCP_R_INVALIDARG;
if (h -> inner && h -> inner -> type -> signal_handler)
return (*(h -> inner -> type -> signal_handler)) (h -> inner,
name, ap);
return ISC_R_NOTFOUND... | false | false | false | false | false | 0 |
slot_actionDelCondition()
{
if( _contextItem ) {
QuestConditionItem * parentItem = dynamic_cast<QuestConditionItem*> ( _contextItem->parent() );
QuestCondition * parentCondition = parentItem->getCondition();
if( parentCondition->getType() == QuestCondition::COMPOSITE ) {
( ( QuestConditionComposite * )parentC... | false | false | false | false | false | 0 |
sget(struct file_system_type *type,
int (*test)(struct super_block *,void *),
int (*set)(struct super_block *,void *),
int flags,
void *data)
{
struct user_namespace *user_ns = current_user_ns();
/* We don't yet pass the user namespace of the parent
* mount through to here so always use &init_user_ns
... | false | false | false | false | false | 0 |
possible_selection(GtkAllocation area, gint x, gint y)
{
GtkPlotCanvasPos return_value = GTK_PLOT_CANVAS_OUT;
if(x >= area.x - DEFAULT_MARKER_SIZE / 2 &&
x <= area.x + DEFAULT_MARKER_SIZE / 2){
if(y >= area.y - DEFAULT_MARKER_SIZE / 2. &&
y <= area.y + DEFAULT_MARKER_SIZE / 2.)
... | false | false | false | false | false | 0 |
mkdir_minus_p(char *path)
{
char *slash;
slash = strrchr(path, '/');
if (slash && slash > path)
{
string_ty *tmp;
tmp = str_n_from_c(path, slash - path);
mkdir_minus_p(tmp->str_text);
str_free(tmp);
}
/*
* Ignore any error codes coming bac... | false | false | false | false | false | 0 |
SegCompare(const void *p1, const void *p2)
{
const seg_t *A = ((const seg_t **) p1)[0];
const seg_t *B = ((const seg_t **) p2)[0];
if (A->index < 0)
InternalError("Seg %p never reached a subsector !", A);
if (B->index < 0)
InternalError("Seg %p never reached a subsector !", B);
return (A->index - B... | false | false | false | false | false | 0 |
__ecereProp___ecereNameSpace__ecere__gui__controls__DropBox_Get_firstRow(struct __ecereNameSpace__ecere__com__Instance * this)
{
struct __ecereNameSpace__ecere__gui__controls__DropBox * __ecerePointer___ecereNameSpace__ecere__gui__controls__DropBox = (struct __ecereNameSpace__ecere__gui__controls__DropBox *)(this ? (((... | false | false | false | false | false | 0 |
ssl_print_cb(BIO *bio,int cmd,const char *argp,int argi,long argl,long ret)
{
BIO *out;
out=(BIO *)BIO_get_callback_arg(bio);
if (out == NULL) return(ret);
if (cmd == (BIO_CB_READ|BIO_CB_RETURN)) {
BIO_printf(out,"read from %p [%p] (%d bytes => %ld (0x%lX))\n",
bio, argp, ar... | false | false | false | false | false | 0 |
is_crashkernel_mem_reserved(void)
{
uint64_t start, end;
return parse_iomem_single("Crash kernel\n", &start, &end) == 0 ?
(start != end) : 0;
} | false | false | false | false | false | 0 |
set_origin(struct vc_data *vc)
{
WARN_CONSOLE_UNLOCKED();
if (!CON_IS_VISIBLE(vc) ||
!vc->vc_sw->con_set_origin ||
!vc->vc_sw->con_set_origin(vc))
vc->vc_origin = (unsigned long)vc->vc_screenbuf;
vc->vc_visible_origin = vc->vc_origin;
vc->vc_scr_end = vc->vc_origin + vc->vc_screenbuf_size;
vc->vc_pos ... | false | false | false | false | false | 0 |
processHeapForDead( bdescr *bd )
{
StgPtr p;
while (bd != NULL) {
p = bd->start;
while (p < bd->free) {
p += processHeapClosureForDead((StgClosure *)p);
while (p < bd->free && !*p) // skip slop
p++;
}
ASSERT(p == bd->free);
bd = bd->link;
}
} | false | false | false | false | false | 0 |
pcm1681_i2c_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
int ret;
struct pcm1681_private *priv;
priv = devm_kzalloc(&client->dev, sizeof(*priv), GFP_KERNEL);
if (!priv)
return -ENOMEM;
priv->regmap = devm_regmap_init_i2c(client, &pcm1681_regmap);
if (IS_ERR(priv->regmap)) {
re... | false | false | false | false | false | 0 |
keyPressEvent(QKeyEvent* event)
{
if (event->key() == Qt::Key_Up) {
emit previousHistory();
}
if (event->key() == Qt::Key_Down) {
emit nextHistory();
}
QGraphicsWidget::keyPressEvent(event);
} | false | false | false | false | false | 0 |
addPositionCalculations(Function* vsMain, int& funcCounter)
{
FunctionInvocation* curFuncInvocation = NULL;
if (mDoBoneCalculations == true)
{
//set functions to calculate world position
for(int i = 0 ; i < getWeightCount() ; ++i)
{
addIndexedPositionWeight(vsMain, i, fu... | false | false | false | false | false | 0 |
pend_type (type)
tree type;
{
if (pending_types == pending_types_allocated)
{
pending_types_allocated += PENDING_TYPES_INCREMENT;
pending_types_list
= (tree *) xrealloc (pending_types_list,
sizeof (tree) * pending_types_allocated);
}
pending_types_list[pending_types++] = type;
/... | false | false | false | false | false | 0 |
spell_suggest_file(su, fname)
suginfo_T *su;
char_u *fname;
{
FILE *fd;
char_u line[MAXWLEN * 2];
char_u *p;
int len;
char_u cword[MAXWLEN];
/* Open the file. */
fd = mch_fopen((char *)fname, "r");
if (fd == NULL)
{
EMSG2(_(e_notopen), fname);
return;
}
/* Read i... | false | false | false | false | false | 0 |
freeAlarms(SingleList* chain)
{
listSingleFullFree((chain ? chain : _alarmList), destroyAlarm);
if (!chain) {
_alarmList = NULL;
}
} | false | false | false | false | false | 0 |
knot_rrset_find_rr_pos(const knot_rrset_t *rr_search_in,
const knot_rrset_t *rr_reference, size_t pos,
size_t *pos_out)
{
int found = 0;
for (uint16_t i = 0; i < rr_search_in->rdata_count && !found; ++i) {
if (rrset_rdata_compare_one(rr_search_in,
... | false | false | false | false | false | 0 |
Update() {
void* v;
subject->GetValue(v);
if (!chosen && value == v) {
Choose();
} else if (chosen && value != v) {
UnChoose();
}
} | false | false | false | false | false | 0 |
create_iv (tree base, tree step, tree var, struct loop *loop,
gimple_stmt_iterator *incr_pos, bool after,
tree *var_before, tree *var_after)
{
gimple stmt;
tree initial, step1;
gimple_seq stmts;
tree vb, va;
enum tree_code incr_op = PLUS_EXPR;
edge pe = loop_preheader_edge (loop);
if (var != NULL... | false | false | false | false | false | 0 |
map_new_zchar(int32 unicode)
{ /* Attempts to enter the given Unicode character into the "alphabet[]"
array, in place of one which has not so far been used in the
compilation of the current file. This may of course fail. */
int i, j; int zscii;
zscii = unicode_to_zscii(unicode);
... | false | false | false | false | false | 0 |
SetWidgetRepresentation(vtkWidgetRepresentation *r)
{
if ( r != this->WidgetRep )
{
int enabled=0;
if ( this->Enabled )
{
enabled = 1;
this->SetEnabled(0);
}
if ( this->WidgetRep )
{
this->WidgetRep->Delete();
}
this->WidgetRep = r;
if ( this->WidgetR... | false | false | false | false | false | 0 |
AddAddress(const char *rfc_type, const Barry::PostalAddress &address)
{
// add label first
vAttrPtr label = NewAttr("LABEL");
AddParam(label, "TYPE", rfc_type);
AddValue(label, address.GetLabel().c_str());
AddAttr(label);
// add breakout address form
vAttrPtr adr = NewAttr("ADR"); // RFC 2426, 3.2.1
AddParam... | false | false | false | false | false | 0 |
r128_emit_masks(drm_r128_private_t *dev_priv)
{
drm_r128_sarea_t *sarea_priv = dev_priv->sarea_priv;
drm_r128_context_regs_t *ctx = &sarea_priv->context_state;
RING_LOCALS;
DRM_DEBUG("\n");
BEGIN_RING(5);
OUT_RING(CCE_PACKET0(R128_DP_WRITE_MASK, 0));
OUT_RING(ctx->dp_write_mask);
OUT_RING(CCE_PACKET0(R128_ST... | false | false | false | false | false | 0 |
aarch64_print_extension (void)
{
const struct aarch64_option_extension *opt = NULL;
for (opt = all_extensions; opt->name != NULL; opt++)
if ((aarch64_isa_flags & opt->flags_on) == opt->flags_on)
asm_fprintf (asm_out_file, "+%s", opt->name);
asm_fprintf (asm_out_file, "\n");
} | false | false | false | false | false | 0 |
adlibemu_init_lists(void)
{
int i;
int j;
for (i = 0 ; i < 16 ; i++) {
for (j = 0; j < 64 ; j++) {
sci_adlib_vol_tables[i][j] = ((guint16)sci_adlib_vol_base[i]) * j / 63;
}
}
for (i = 0; i < MIDI_CHANNELS ; i++) {
pitch[i] = 8192; /* center the pitch wheel */
}
free_voices = ADLIB_VOICES;
memset(... | false | false | false | false | false | 0 |
set_parameter(int param,
std::string value)
{
switch (param) {
case 1:
label(value);
break;
case 2:
device_name_rep = value;
break;
}
} | false | false | false | false | false | 0 |
gg_image_infos_create (int pixel_format, int width, int height,
int bits_per_sample, int samples_per_pixel,
int sample_format, const char *srs_name,
const char *proj4text)
{
/* creating an image infos struct */
gGraphImageInfosPtr img;
int len;
char *SrsName = NULL;
char *Proj... | false | false | false | false | true | 1 |
wi_tmpfile(void) {
char path[WI_PATH_SIZE];
int fd;
#ifdef _PATH_TMP
snprintf(path, sizeof(path), "%s/%s", _PATH_TMP, "tmp.XXXXXXXXXX");
#else
snprintf(path, sizeof(path), "/tmp/%s", "tmp.XXXXXXXXXX");
#endif
fd = mkstemp(path);
unlink(path);
return (fd < 0) ? NULL : fdopen(fd, "w+");
} | false | false | false | false | false | 0 |
pvr2_stream_create(void)
{
struct pvr2_stream *sp;
sp = kzalloc(sizeof(*sp),GFP_KERNEL);
if (!sp) return sp;
pvr2_trace(PVR2_TRACE_INIT,"pvr2_stream_create: sp=%p",sp);
pvr2_stream_init(sp);
return sp;
} | false | false | false | false | false | 0 |
search_easter_egg( Slapi_PBlock *pb, Slapi_Entry *entryBefore, Slapi_Entry *entryAfter, int *returncode, char *returntext, void *arg)
{
char *fstr= NULL;
char eggfilter[64];
PR_snprintf(eggfilter,sizeof(eggfilter),"(objectclass=%s)",EGG_OBJECT_CLASS);
slapi_pblock_get( pb, SLAPI_SEARCH_STRFILTER, &fstr );
... | false | false | false | false | false | 0 |
PushIncidence (Shape * a, int cb, int pt, double theta)
{
if (theta < 0 || theta > 1)
return -1;
if (nbInc >= maxInc)
{
maxInc = 2 * nbInc + 1;
iData =
(incidenceData *) g_realloc(iData, maxInc * sizeof (incidenceData));
}
int n = nbInc++;
iData[n].nextInc = a->swsData[cb].firstLinkedP... | false | false | false | false | false | 0 |
post_process_2pass (j_decompress_ptr cinfo,
JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
JDIMENSION in_row_groups_avail,
JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
JDIMENSION out_rows_avail)
{
my_post_ptr post = (my_post_ptr) cinfo->post;
JDIMENSION num_rows, max_rows;
/* Repo... | false | false | false | false | false | 0 |
task_get_sizepos(task *t)
{
Window root, junkwin;
int rx, ry;
guint dummy;
XWindowAttributes win_attributes;
ENTER;
if (!XGetWindowAttributes(GDK_DISPLAY(), t->win, &win_attributes)) {
if (!XGetGeometry (GDK_DISPLAY(), t->win, &root, &t->x, &t->y, &t->w, &t->h,
&dummy,... | false | false | false | false | false | 0 |
ADIOI_NFS_Open(ADIO_File fd, int *error_code)
{
int perm, amode;
unsigned int old_mask;
#ifndef PRINT_ERR_MSG
static char myname[] = "ADIOI_NFS_OPEN";
#endif
if (fd->perm == ADIO_PERM_NULL) {
old_mask = umask(022);
umask(old_mask);
perm = old_mask ^ 0666;
}
else perm = fd->perm;
amo... | false | false | false | false | true | 1 |
fw_fill_request(struct fw_packet *packet, int tcode, int tlabel,
int destination_id, int source_id, int generation, int speed,
unsigned long long offset, void *payload, size_t length)
{
int ext_tcode;
if (tcode == TCODE_STREAM_DATA) {
packet->header[0] =
HEADER_DATA_LENGTH(length) |
destination_id |
H... | false | false | false | false | false | 0 |
CatalogCacheComputeHashValue(CatCache *cache, int nkeys, ScanKey cur_skey)
{
uint32 hashValue = 0;
uint32 oneHash;
CACHE4_elog(DEBUG2, "CatalogCacheComputeHashValue %s %d %p",
cache->cc_relname,
nkeys,
cache);
switch (nkeys)
{
case 4:
oneHash =
DatumGetUInt32(DirectFunctionCall1(cache->cc_... | false | false | false | false | false | 0 |
indexReadsByID()
{
m_pIndex = new ReadIndex;
for(size_t i = 0; i < m_table.size(); ++i)
{
std::pair<ReadIndex::iterator, bool> result =
m_pIndex->insert(std::make_pair(m_table[i].id, &m_table[i]));
if(!result.second)
{
std::cerr << "Error: Attempted to insert... | false | false | false | false | false | 0 |
daemon_pidfile(const char *name)
{
int rc;
ptry(pthread_mutex_lock(&g.lock))
rc = daemon_pidfile_unlocked(name);
ptry(pthread_mutex_unlock(&g.lock))
return rc;
} | false | false | false | false | false | 0 |
Distance2ToBounds(double x[3], double bounds[6])
{
double distance;
double deltas[3];
// Are we within the bounds?
if (x[0] >= bounds[0] && x[0] <= bounds[1]
&& x[1] >= bounds[2] && x[1] <= bounds[3]
&& x[2] >= bounds[4] && x[2] <= bounds[5])
{
return 0.0;
}
deltas[0] = deltas[1] = delta... | false | false | false | false | false | 0 |
write_optvar() {
// *** process UUID (hidden option)
if (jack_uuid != NULL) {
optvar[JACK_UUID] = jack_uuid; // leads to no automatic connection
g_free(jack_uuid);
} else if (!optvar[JACK_UUID].empty()) {
optvar[JACK_UUID] = "";
}
// *** process ENGINE options
if (pitch... | false | false | false | false | false | 0 |
aisc_delete(aisc_com *link,int objekt_type,long source)
{
int len,mes_cnt;
mes_cnt = 2;
link->aisc_mes_buffer[mes_cnt++] = objekt_type;
link->aisc_mes_buffer[mes_cnt++] = source;
link->aisc_mes_buffer[0] = mes_cnt - 2;
link->aisc_mes_buffer[1] = AISC_DELETE+link->magic;
len = aisc_c_write(l... | false | false | false | false | false | 0 |
s_macro (int ignore ATTRIBUTE_UNUSED)
{
char *file, *eol;
unsigned int line;
sb s;
const char *err;
const char *name;
as_where (&file, &line);
eol = find_end_of_line (input_line_pointer, 0);
sb_build (&s, eol - input_line_pointer);
sb_add_buffer (&s, input_line_pointer, eol - input_line_pointer);
... | false | false | false | false | false | 0 |
graph_object_destructor(graph_object *object)
{
graph_edge *edge, *tmp_edge;
graph_node *node, *tmp_node;
if (object->edge_list_head) {
edge = object->edge_list_head;
while (edge) {
tmp_edge = edge->next_edge;
graph_edge_destructor(edge);
edge = tmp_edge;... | false | false | false | false | false | 0 |
qed_int_cau_conf_sb(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
dma_addr_t sb_phys,
u16 igu_sb_id,
u16 vf_number,
u8 vf_valid)
{
struct cau_sb_entry sb_entry;
u32 val;
qed_init_cau_sb_entry(p_hwfn, &sb_entry, p_hwfn->rel_pf_id,
vf_number, vf_valid);
if (p_hwfn->hw_init_done) {
v... | false | false | false | false | false | 0 |
bet_transfert_take_data ( struct_transfert_data *transfert, GtkWidget *dialog )
{
GtkWidget *widget;
GtkTreeView *tree_view;
GtkTreeModel *model;
GtkTreeIter iter;
gint replace_account;
gint type;
tree_view = g_object_get_data ( G_OBJECT ( dialog ), "tree_view" );
gtk_tree_selection_ge... | false | false | false | false | false | 0 |
ColToInd( const wxColour& colour ) const
{
size_t i;
size_t i_max = m_choices.GetCount();
if ( !(m_flags & wxPG_PROP_HIDE_CUSTOM_COLOUR) )
i_max -= 1;
for ( i=0; i<i_max; i++ )
{
int ind = m_choices[i].GetValue();
if ( colour == GetColour(ind) )
{
/*wxL... | false | false | false | false | false | 0 |
checkOverride (Variable *var) {
if (var->flags & VAR_PRIVATE) { // defining a private block? No override
return NULL ;
}
Scope *scope ;
Variable *v = NULL ;
string tagname = "." + var->name ;
Tag *tag = (Tag*)Scope::findVariable (tagname, scope, VAR_ACCESSFULL, NULL, NULL) ;
if ... | false | false | false | false | false | 0 |
next_marker (void)
{
int c;
int discarded_bytes = 0;
/* Find 0xFF byte; count and skip any non-FFs. */
c = read_1_byte();
while (c != 0xFF) {
discarded_bytes++;
c = read_1_byte();
}
/* Get marker code byte, swallowing any duplicate FF bytes. Extra FFs
* are legal as pad bytes, so don't count ... | false | false | false | false | false | 0 |
rb_ary_resize(VALUE ary, long len)
{
long olen;
rb_ary_modify(ary);
olen = RARRAY_LEN(ary);
if (len == olen) return ary;
if (len > ARY_MAX_SIZE) {
rb_raise(rb_eIndexError, "index %ld too big", len);
}
if (len > olen) {
if (len >= ARY_CAPA(ary)) {
ary_double_capa(ary, len);
}
rb_mem... | false | false | false | false | false | 0 |
gcr_certificate_compare (GcrComparable *first, GcrComparable *other)
{
gconstpointer data1, data2;
gsize size1, size2;
if (!GCR_IS_CERTIFICATE (first))
first = NULL;
if (!GCR_IS_CERTIFICATE (other))
other = NULL;
if (first == other)
return TRUE;
if (!first)
return 1;
if (!other)
return -1;
data1 = ... | false | false | false | false | false | 0 |
mpegts_base_apply_sdt (MpegTSBase * base,
guint16 pmt_pid, GstStructure * sdt_info)
{
GST_DEBUG_OBJECT (base, "SDT %" GST_PTR_FORMAT, sdt_info);
mpegts_base_get_tags_from_sdt (base, sdt_info);
gst_element_post_message (GST_ELEMENT_CAST (base),
gst_message_new_element (GST_OBJECT (base),
gst_... | false | false | false | false | false | 0 |
latexMarkChange(otexstream & os, BufferParams const & bparams,
Change const & oldChange, Change const & change,
OutputParams const & runparams)
{
if (!bparams.outputChanges || oldChange == change)
return 0;
int column = 0;
if (oldChange.type != Change::UNCHANGED) {
// close \lyxadded or \lyxdel... | false | false | false | false | false | 0 |
renderer_change_view_impl (GtkSourceGutterRenderer *renderer,
GtkTextView *old_view)
{
if (old_view)
{
g_signal_handlers_disconnect_by_func (old_view,
G_CALLBACK (on_buffer_changed),
renderer);
}
... | false | false | false | false | false | 0 |
pinbo_get_bg_tile_info(int tile_index)
{
int code = lasso_videoram[tile_index];
int color = lasso_colorram[tile_index];
SET_TILE_INFO(0,
code + ((color & 0x30) << 4),
color & 0x0f,
0)
} | false | false | false | false | false | 0 |
read_from_stdin(struct path_list *list)
{
char buffer[1024];
while (fgets(buffer, sizeof(buffer), stdin) != NULL) {
char *bob;
if ((buffer[0] == 'A' || buffer[0] == 'a') &&
!prefixcmp(buffer + 1, "uthor: ") &&
(bob = strchr(buffer + 7, '<')) != NULL) {
char buffer2[1024], offset = 0;
if (map_email... | false | false | false | false | false | 0 |
possibleBufferOverrunError(const Token *tok, const std::string &src, const std::string &dst, bool cat)
{
if (cat)
reportError(tok, Severity::warning, "possibleBufferAccessOutOfBounds",
"Possible buffer overflow if strlen(" + src + ") is larger than sizeof(" + dst + ")-strlen(" + dst +").... | false | false | false | false | false | 0 |
ews_decode_binary (EwsOabDecoder *eod,
GCancellable *cancellable,
GError **error)
{
EwsOabDecoderPrivate *priv = GET_PRIVATE (eod);
guint32 len;
gchar *binary;
GBytes *val = NULL;
len = ews_decode_uint32 (eod, cancellable, error);
if (*error)
return NULL;
binary = g_mallo... | false | false | false | false | false | 0 |
OutputFeatureValuesForHypergraph(const Hypothesis* hypo, std::ostream &outputSearchGraphStream) const
{
outputSearchGraphStream.setf(std::ios::fixed);
outputSearchGraphStream.precision(6);
const StaticData& staticData = StaticData::Instance();
const TranslationSystem& system = staticData.GetTranslationSystem(T... | false | false | false | false | false | 0 |
SD_PowerON(void) {
SDIO_InitTypeDef SDIO_InitStructure;
SDIO_CmdInitTypeDef SDIO_CmdInitStructure;
__IO SD_Error errorstatus = SD_OK;
uint32_t response = 0, count = 0, validvoltage = 0;
uint32_t SDType = SD_STD_CAPACITY;
// Power ON Sequence
// Configure the SDIO peripheral
// SDIOCLK = HCLK, SDIO_CK = HCLK/(2... | false | false | false | false | false | 0 |
strnpointerid(char *dest, const void *pointer, size_t len)
{
*dest=0;
if (pointer)
snprintf(dest, len, ".x%lx", (unsigned long)pointer);
return dest;
} | false | false | false | false | false | 0 |
processMap(void)
{
std::list<ArMapObject *>::const_iterator it;
ArMapObject *obj;
myDataMutex.lock();
ArUtil::deleteSet(mySegments.begin(), mySegments.end());
mySegments.clear();
for (it = myMap->getMapObjects()->begin();
it != myMap->getMapObjects()->end();
it++)
{
obj = (*it);
if... | false | false | false | false | false | 0 |
find_induction_variables (struct ivopts_data *data)
{
unsigned i;
bitmap_iterator bi;
if (!find_bivs (data))
return false;
find_givs (data);
mark_bivs (data);
if (dump_file && (dump_flags & TDF_DETAILS))
{
struct tree_niter_desc *niter = niter_for_single_dom_exit (data);
if (niter)
... | false | false | false | false | false | 0 |
_elm_layout_smart_table_unpack(Evas_Object *obj,
const char *part,
Evas_Object *child)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(part, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(child, NULL);
ELM_LAYOUT_DATA_GET(obj, sd);
const Eina_List *l;
Elm_Layout_Su... | 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.