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 |
|---|---|---|---|---|---|---|
add_key_event(unsigned scanCode, unsigned long timeStamp)
{
if((head_ptr == tail_ptr-1) || // see if the buffer is full
(head_ptr == EVENT_BUFFER_SIZE-1 && tail_ptr == 0))
{
return;
}
MouseEvent *ev = event_buffer + head_ptr;
ev->event_type = KEY_PRESS;
ev->scan_code = scanCode;
ev->skey_stat... | false | false | false | false | false | 0 |
EffectDummyCreature_npc_kitten(Unit* /*pCaster*/, uint32 uiSpellId, SpellEffectIndex uiEffIndex, Creature* pCreatureTarget, ObjectGuid /*originalCasterGuid*/)
{
// always check spellid and effectindex
if (uiSpellId == SPELL_CORRUPT_SABER_VISUAL && uiEffIndex == EFFECT_INDEX_0)
{
// Not nice way, how... | false | false | false | false | false | 0 |
MakeAllStopping(JackClientInterface** table)
{
for (int i = GetEngineControl()->fDriverNum; i < CLIENT_NUM; i++) {
JackClientInterface* client = table[i];
if (client) {
JackClientControl* control = client->GetClientControl();
control->fTransportState = JackTransportStopped;
... | false | false | false | false | false | 0 |
hex_is_safe( int x, int y, void *_ctx )
{
MountCtx *ctx = _ctx;
if ( !mask[x][y].spot ) {
ctx->unsafe = 1;
return 0;
}
if ( map[x][y].g_unit )
if ( !player_is_ally( ctx->player, map[x][y].g_unit->player ) )
if ( map[x][y].g_unit->sel_prop->mov >= get_dist( ctx->unit_x, ctx->unit_... | false | false | false | false | false | 0 |
cgiEscape (char *string)
{
char *cp, *np;
char *buf;
size_t len;
for (cp=string, len=0; *cp; cp++) {
switch (*cp) {
case '&':
len+=5;
break;
case '<':
case '>':
len+=4;
break;
default:
len++;
break;
}
}
if (len == strlen(string))
return strdup(string);
... | false | false | false | false | true | 1 |
finish()
{
if(blends.empty()) return;
loopv(blends) blends[i].finalize();
while(eblends.length() < lastvert) eblends.add();
if(remap.length()) loopv(remap) eblends[firstvert + i] = blends[remap[i]];
else loopv(blends) eblends[firstvert + i] = blends[i];
} | false | false | false | false | false | 0 |
_display_info(struct dm_task *dmt)
{
struct dm_info info;
if (!dm_task_get_info(dmt, &info))
return 0;
if (!_switches[COLS_ARG])
_display_info_long(dmt, &info);
else
/* FIXME return code */
_display_info_cols(dmt, &info);
return info.exists ? 1 : 0;
} | false | false | false | false | false | 0 |
external_progressbar_params_parse(void *data __UNUSED__, Evas_Object *obj __UNUSED__, const Eina_List *params)
{
Elm_Params_Progressbar *mem;
Edje_External_Param *param;
const Eina_List *l;
mem = calloc(1, sizeof(Elm_Params_Progressbar));
if (!mem)
return NULL;
external_common_icon_param_parse(... | false | false | false | false | false | 0 |
bloomfilter_Create_Mmap(size_t max_num_elem, double error_rate,
const char * file, BTYPE num_bits, int oflags, int perms,
int *hash_seeds, int num_hashes)
{
BloomFilter * bf = (BloomFilter *)malloc(sizeof(BloomFilter));
MBArray * array;
if (!b... | false | false | false | false | false | 0 |
daemon_exists(char *daemon, char *path)
{
struct stat st;
if (stat(path, &st) != 0)
{
DBG1(DBG_APP, "Disabling %sstart option, '%s' not found", daemon, path);
return FALSE;
}
return TRUE;
} | false | false | false | false | false | 0 |
get_instruct_popup(){
if( get_confitem()->instruct_popup ) return get_confitem()->instruct_popup--;
return 0;
} | false | false | false | false | false | 0 |
regconfigout(PG_FUNCTION_ARGS)
{
Oid cfgid = PG_GETARG_OID(0);
char *result;
HeapTuple cfgtup;
if (cfgid == InvalidOid)
{
result = pstrdup("-");
PG_RETURN_CSTRING(result);
}
cfgtup = SearchSysCache1(TSCONFIGOID, ObjectIdGetDatum(cfgid));
if (HeapTupleIsValid(cfgtup))
{
Form_pg_ts_config cfgform =... | false | false | false | false | false | 0 |
cp_parser_check_for_definition_in_return_type (tree declarator, tree type)
{
/* [dcl.fct] forbids type definitions in return types.
Unfortunately, it's not easy to know whether or not we are
processing a return type until after the fact. */
while (declarator
&& (TREE_CODE (declarator) == INDIRECT_REF
... | false | false | false | false | false | 0 |
LLVMPositionBuilder(LLVMBuilderRef Builder, LLVMBasicBlockRef Block,
LLVMValueRef Instr) {
BasicBlock *BB = unwrap(Block);
Instruction *I = Instr? unwrap<Instruction>(Instr) : (Instruction*) BB->end();
unwrap(Builder)->SetInsertPoint(BB, I);
} | false | false | false | false | false | 0 |
img_s_string_ft(klass, fgcolor, fontname, ptsize, angle, x, y, string)
VALUE klass, fgcolor, fontname, ptsize, angle, x, y, string;
{
int brect[8], i;
char *msg;
VALUE ary = rb_ary_new2(8);
Check_Type(fontname, T_STRING);
Check_Type(string, T_STRING);
msg = gdImageStringFT(NULL,
... | false | false | false | false | false | 0 |
dump_assertion (GNode *asn)
{
gchar *purpose, *peer;
GQuark level;
purpose = egg_asn1x_get_string_as_utf8 (egg_asn1x_node (asn, "purpose", NULL), NULL);
g_return_if_fail (purpose);
level = egg_asn1x_get_enumerated (egg_asn1x_node (asn, "level", NULL));
g_return_if_fail (level);
if (egg_asn1x_have (egg_asn1x_n... | false | false | false | false | false | 0 |
karyotypebandadaptorFetchAllbyStatement(
EnsPBaseadaptor ba,
const AjPStr statement,
EnsPAssemblymapper am,
EnsPSlice slice,
AjPList kblist)
{
ajuint identifier = 0U;
ajuint srid = 0U;
ajuint srstart = 0U;
ajuint srend = 0U;
ajint srstrand = 1;
AjPStr name = NULL;... | false | false | false | false | false | 0 |
MorphologyImageChannel(const Image *image,
const ChannelType channel,const MorphologyMethod method,
const ssize_t iterations,const KernelInfo *kernel,ExceptionInfo *exception)
{
KernelInfo
*curr_kernel;
CompositeOperator
compose;
Image
*morphology_image;
/* Apply Convolve/Correlate Normaliza... | false | false | false | false | false | 0 |
bm_load_either(char *filename, int *nframes, int *fps, int *keyframe, int can_drop_frames, int dir_type)
{
if(nframes != NULL)
*nframes = 0;
if(fps != NULL)
*fps = 0;
int tidx = bm_load_animation(filename, nframes, fps, keyframe, can_drop_frames, dir_type);
if(tidx == -1)
{
tidx = bm_load(filename);
if(tid... | false | false | false | false | false | 0 |
Rename(const URL& newurl) {
// source can be specified by GUID, but destination must have path
std::string path = url.Path();
if (path.empty() || path == "/") path = ResolveGUIDToLFN();
if (path.empty()) return DataStatus(DataStatus::RenameError, lfc2errno(), "Error finding LFN from GUID");
if (ne... | false | false | false | false | false | 0 |
giggle_git_diff_tree_new (GiggleRevision *rev1, GiggleRevision *rev2)
{
g_return_val_if_fail (GIGGLE_IS_REVISION (rev1) || !rev1, NULL);
g_return_val_if_fail (GIGGLE_IS_REVISION (rev2) || !rev2, NULL);
return g_object_new (GIGGLE_TYPE_GIT_DIFF_TREE,
"revision-1", rev1,
"revision-2", rev2,
NU... | false | false | false | false | false | 0 |
dse_free_entry (void **data)
{
Slapi_Entry **e;
if (data)
{
e = (Slapi_Entry **)data;
if (*e)
slapi_entry_free (*e);
}
} | false | false | false | false | false | 0 |
GetMTime()
{
unsigned long mtime = this->Superclass::GetMTime();
for (unsigned int a = 0; a < this->GetNumberOfAnnotations(); ++a)
{
vtkAnnotation* ann = this->GetAnnotation(a);
if (ann)
{
unsigned long atime = ann->GetMTime();
if (atime > mtime)
{
mtime = atime;
... | false | false | false | false | false | 0 |
natural( int &naturalWidth_, int &naturalHeight_,
int &hiddenWidgets_,int &unconstrainedWidgets_)
{
MSNodeItem *hp=childListHead();
MSNodeItem *np;
np = hp;
MSCollapsibleEntry* entry;
int width =0 ,maxwidth =0;
int yNeeded = 0;
hiddenWidgets_ = 0;
// unconstrained_widgets is the number of widgets... | false | false | false | false | false | 0 |
drbd_adm_invalidate_peer(struct sk_buff *skb, struct genl_info *info)
{
struct drbd_config_context adm_ctx;
int retcode; /* drbd_ret_code, drbd_state_rv */
struct drbd_device *device;
retcode = drbd_adm_prepare(&adm_ctx, skb, info, DRBD_ADM_NEED_MINOR);
if (!adm_ctx.reply_skb)
return retcode;
if (retcode != NO... | false | false | false | false | false | 0 |
whlp_para_attr(WHLP h, int attr_id, int attr_param)
{
if (attr_id >= WHLP_PARA_SPACEABOVE &&
attr_id <= WHLP_PARA_FIRSTLINEINDENT) {
h->para_flags |= 1 << attr_id;
h->para_attrs[attr_id] = attr_param;
} else if (attr_id == WHLP_PARA_ALIGNMENT) {
h->para_flags &= ~0xC00;
if (attr_param == WHLP_ALIGN_RIGHT)
... | false | false | false | false | false | 0 |
define(const String &name, const String &value, bool override)
{
for (String *s = _names.begin(); s != _names.end(); s++)
if (*s == name) {
if (override)
_values[s - _names.begin()] = value;
return false;
}
_names.push_back(name);
_values.push_back(value);
return true;
} | false | false | false | false | false | 0 |
_e_smart_randr_monitor_find(E_Smart_Data *sd, Ecore_X_Randr_Crtc xid)
{
Eina_List *l;
Evas_Object *mon;
/* loop the monitor list */
EINA_LIST_FOREACH(sd->monitors, l, mon)
{
E_Randr_Output_Info *output;
/* try to grab this monitors output */
if ((output = e_smart_monitor_outpu... | false | false | false | false | false | 0 |
process_file()
{
tokens fields, terminate;
char *character;
char current_line[LINE_LENGTH];
buffer *next_buf;
fgets(current_line,LINE_LENGTH,stream);
if ((character = strrchr(current_line,'\n')) != NULL) *character = '\0';
/* Loop through all input lines for the current file */
while (!feof(stream))
{
/... | false | false | false | false | false | 0 |
update_pb4(int samplerate)
{
static int counter, level;
/* bit 4 of latch B: charge 10uF (C28/C68) through 10k (R19/R25) */
if( sound_latch_b & 0x10 )
{
if( level < VMAX )
{
counter -= (int)((VMAX - level) / pb4_charge_time);
if( counter <= 0 )
{
int n = (-counter / samplerate) + 1;
... | false | false | false | false | false | 0 |
find_tag(int pos,int posaftertag/*=1*/)
{
int i;
for(i=0;i<tags.size() && tagpos[i]<pos;i++);
if(i==tags.size()){return -1;}
if(!posaftertag){return i;}
for(;tagpos[i]>pos && i>=0;i--);
return(i);
} | false | false | false | false | false | 0 |
recomputeContextGuard(Predicate *pred)
#else
void recomputeContextGuard(pred)
Predicate *pred;
#endif
{
Tree * t=NULL;
set scontext;
set rk;
ActionNode * actionNode;
Junction * p;
actionNode=pred->source;
require (actionNode != NULL,"context predi... | false | false | false | true | false | 1 |
getParentEmfObject()
{
ModelObject* obj = model->getModelObjectById(parentId);
if ( obj == NULL ) return NULL;
BodyElementGroup* beg = (BodyElementGroup*)obj;
// For implicit groups we use the first element as the parent
//
if ( IMPLICIT_GROUP == beg->getGroupType() ) {
int be_id = beg->getElementI... | false | false | false | false | false | 0 |
menu_translate_tab_and_shift(arg_start)
char_u *arg_start;
{
char_u *arg = arg_start;
while (*arg && !vim_iswhite(*arg))
{
if ((*arg == '\\' || *arg == Ctrl_V) && arg[1] != NUL)
arg++;
else if (STRNICMP(arg, "<TAB>", 5) == 0)
{
*arg = TAB;
STRMOVE(arg + 1, arg + 5);
}
arg++;
}
... | false | false | false | false | false | 0 |
g_mount_spec_new_from_data (GArray *items,
char *mount_prefix)
{
GMountSpec *spec;
spec = g_new0 (GMountSpec, 1);
spec->ref_count = 1;
spec->items = items;
if (mount_prefix == NULL)
spec->mount_prefix = g_strdup ("/");
else
spec->mount_prefix = g_mount_spec_canonicalize_path (mount_prefix);
... | false | false | false | false | false | 0 |
bc_skip(struct bufferchain *bc, ssize_t count)
{
if(count >= 0)
{
if(bc->size - bc->pos < count) return bc_need_more(bc);
else return bc->pos += count;
}
else return READER_ERROR;
} | false | false | false | false | false | 0 |
WritePhysicsRigidBodyInstance(FCDObject* object, xmlNode* parentNode)
{
FCDPhysicsRigidBodyInstance* physicsRigidBodyInstance = (FCDPhysicsRigidBodyInstance*)object;
xmlNode* instanceNode = FArchiveXML::WriteEntityInstance(physicsRigidBodyInstance, parentNode);
AddAttribute(instanceNode, DAE_TARGET_ATTRIBUTE... | false | false | false | false | false | 0 |
cfapi_object_split(int *type, ...) {
va_list args;
int nr, size;
object *op;
char *buf;
object **split;
va_start(args, type);
op = va_arg(args, object *);
nr = va_arg(args, int);
buf = va_arg(args, char *);
size = va_arg(args, int);
split = va_arg(args, object **);
va_... | false | false | false | false | false | 0 |
str_replace(const vector<string>& find, const string replace, string str)
{
int replace_len = replace.length();
for(int i = 0; i < find.size(); ++i)
{
int len = find[i].length();
int pos = str.find(find[i]);
while(pos != string::npos)
{
str.replace(pos, len, replace);
... | false | false | false | false | false | 0 |
markRightEdgesFirst(int32_t edgeNumber) {
if(offset==0) {
firstEdgeNumber=edgeNumber;
edgeNumber=greaterOrEqual->markRightEdgesFirst(edgeNumber);
offset=edgeNumber=lessThan->markRightEdgesFirst(edgeNumber-1);
}
return edgeNumber;
} | false | false | false | false | false | 0 |
wb_view_set_attribute (WorkbookView *wbv, char const *name, char const *value)
{
gboolean res;
GObject *obj;
const char *tname;
g_return_if_fail (IS_WORKBOOK_VIEW (wbv));
g_return_if_fail (name != NULL);
g_return_if_fail (value != NULL);
obj = G_OBJECT (wbv);
res = !g_ascii_strcasecmp (value, "TRUE");
if (s... | false | false | false | false | false | 0 |
backup_file(char *tofile, const char *fromfile)
{
#if defined(MSDOS) || defined(VMS)
char *tmpn;
#endif
/* first attempt, for all o/s other than MSDOS */
#ifndef MSDOS
strcpy(tofile, fromfile);
#ifdef VMS
/* replace all dots with _, since we will be adding the only
* dot allowed in VMS names
*/
... | false | false | false | false | false | 0 |
jas_icclut16_destroy(jas_iccattrval_t *attrval)
{
jas_icclut16_t *lut16 = &attrval->data.lut16;
if (lut16->clut)
jas_free(lut16->clut);
if (lut16->intabs)
jas_free(lut16->intabs);
if (lut16->intabsbuf)
jas_free(lut16->intabsbuf);
if (lut16->outtabs)
jas_free(lut16->outtabs);
if (lut16->outtabsbuf)
jas_f... | false | false | false | false | false | 0 |
parse_def(struct line_parser *lp, struct ftxlate *ftxlate)
{
struct ftxlate_def *ftx;
NEXT_WORD(&lp->buf, lp->word);
if (!lp->word) {
fterr_warnx("%s line %d: Expecting name.", lp->fname, lp->lineno);
return -1;
}
/* check if it exists */
FT_SLIST_FOREACH(ftx, &ftxlate->defs, chain) {
if (!s... | false | true | false | false | false | 1 |
snd_pcm_rate_bit_to_rate(unsigned int rate_bit)
{
unsigned int i;
for (i = 0; i < snd_pcm_known_rates.count; i++)
if ((1u << i) == rate_bit)
return snd_pcm_known_rates.list[i];
return 0;
} | false | false | false | false | false | 0 |
record_ird_ord(struct nes_cm_node *cm_node,
u16 conn_ird, u16 conn_ord)
{
if (conn_ird > NES_MAX_IRD)
conn_ird = NES_MAX_IRD;
if (conn_ord > NES_MAX_ORD)
conn_ord = NES_MAX_ORD;
cm_node->ird_size = conn_ird;
cm_node->ord_size = conn_ord;
} | false | false | false | false | false | 0 |
new_packet_common_init (MpegTsMux * mux, GstBuffer * buf, guint8 * data,
guint len)
{
/* Packets should be at least 188 bytes, but check anyway */
g_return_if_fail (len >= 2 || !data);
if (!mux->streamheader_sent && data) {
guint pid = ((data[1] & 0x1f) << 8) | data[2];
/* if it's a PAT or a PMT */
... | false | false | false | false | false | 0 |
addr_spec_soon(const char *src) {
for(char c; (c=*src); src++)
if(c=='<')
return true;
else if(!(c==' ' || c=='\t'))
return false;
return false;
} | false | false | false | false | false | 0 |
hilight_remove(HILIGHT_REC *rec)
{
g_return_if_fail(rec != NULL);
hilight_remove_config(rec);
hilights = g_slist_remove(hilights, rec);
signal_emit("hilight destroyed", 1, rec);
hilight_destroy(rec);
} | false | false | false | false | false | 0 |
c6280_sh_start(const struct MachineSound *msound)
{
const struct C6280_interface *intf = msound->sound_interface;
char buf[2][64];
const char *name[2];
int volume[2];
int i;
for (i = 0; i < intf->num; i++)
{
/* Initialize PSG emulator */
c6280_init(i, intf->clock[i], Ma... | true | true | false | false | true | 1 |
egg_column_model_row_drop_possible (GtkTreeDragDest *drag_dest,
GtkTreePath *dest_path,
GtkSelectionData *selection_data)
{
gint *indices;
g_return_val_if_fail (EGG_IS_COLUMN_MODEL (drag_dest), FALSE);
if (gtk_tree_path_get_depth (dest_path) != 1)
return FALSE;
indices = gtk_tree_pa... | false | false | false | false | false | 0 |
frame_add_life()
{
if ( !game->extra_active[EX_DARKNESS] ) {
stk_surface_blit( lamps, 0, BRICK_HEIGHT,
BRICK_WIDTH, BRICK_HEIGHT,
stk_display, 0, new_life_y );
stk_display_store_drect();
}
new_life_y -= BRICK_HEIGHT;
#ifdef AUDIO_ENABLED
stk_sound_play_x( 20, wav_lif... | false | false | false | false | false | 0 |
ArgusReadSocket (struct ArgusSocketStruct *asock, ArgusHandler ArgusThisHandler, void *data)
{
int retn = 0, totalbyte = 0;
int len = 0;
if (asock->cnt == 0) {
asock->ptr = asock->buf;
asock->ahdr = (struct ArgusRecordHeader *) asock->ptr;
}
if (asock && (asock->fd >= 0)) {
if ((retn ... | true | true | false | false | true | 1 |
decref_and_unlock(struct bufferevent *b)
{
struct bufferevent_pair *bevp = upcast(b);
if (bevp->partner)
_bufferevent_decref_and_unlock(downcast(bevp->partner));
_bufferevent_decref_and_unlock(b);
} | false | false | false | false | false | 0 |
prepare_error_buf(const char *fmt, va_list args)
{
char *fmt1 = fmt_buf;
char *k;
char *p = error_buf;
int what;
spin_lock(&error_lock);
strcpy(fmt1, fmt);
while ((k = is_there_reiserfs_struct(fmt1, &what)) != NULL) {
*k = 0;
p += vsprintf(p, fmt1, args);
switch (what) {
case 'k':
sprintf_le_key(... | false | true | false | false | true | 1 |
rb_writev(rb_fde_t *F, struct rb_iovec * vector, int count)
{
if(F == NULL)
{
errno = EBADF;
return -1;
}
#ifdef HAVE_SSL
if(F->type & RB_FD_SSL)
{
return rb_fake_writev(F, vector, count);
}
#endif /* HAVE_SSL */
#ifdef HAVE_SENDMSG
if(F->type & RB_FD_SOCKET)
{
struct msghdr msg;
memset(&msg, 0, sizeo... | true | true | false | false | false | 1 |
ges_container_remove (GESContainer * container, GESTimelineElement * child)
{
GESContainerClass *klass;
GESContainerPrivate *priv;
g_return_val_if_fail (GES_IS_CONTAINER (container), FALSE);
g_return_val_if_fail (GES_IS_TIMELINE_ELEMENT (child), FALSE);
GST_DEBUG_OBJECT (container, "removing child: %" GST_P... | false | false | false | true | false | 1 |
murrine_scrollbar_get_junction (GtkWidget *widget)
{
GtkAdjustment *adj;
MurrineJunction junction = MRN_JUNCTION_NONE;
g_return_val_if_fail (GTK_IS_RANGE (widget), MRN_JUNCTION_NONE);
adj = GTK_RANGE (widget)->adjustment;
if (adj->value <= adj->lower &&
(GTK_RANGE (widget)->has_stepper_a || GTK_RANGE (widg... | false | false | false | false | false | 0 |
splot_add_plot_labels (splotd *sp, GdkDrawable *drawable, ggobid *gg)
{
displayd *display = (displayd *) sp->displayptr;
cpaneld *cpanel = &display->cpanel;
GGobiData *d = display->d;
colorschemed *scheme = gg->activeColorScheme;
gboolean proceed = (cpanel->pmode == XYPLOT ||
cpanel->p... | false | false | false | false | false | 0 |
mvl_fill (lofig_P, lofig_A)
struct lofig *lofig_P;
struct lofig *lofig_A;
{
struct locon *ptlocon_P, *ptlocon_A;
struct chain *ptchain;
struct lofig *ptlofig;
struct losig *ptlosig;
/* MODELCHAIN */
ptchain = lofig_P->MODELCHAIN;
lofig_P->MODELCHAIN = lofig_A->MODELCHAIN;
/* LOCON */
ptlocon_P... | false | false | false | false | false | 0 |
OnRectangle( wxCommandEvent &WXUNUSED(event) )
{
wxString imageDir = ExGlobals::GetImagePath();
switch (polygonType_)
{
case 1:
break;
case 2:
rectangle_->SetBitmapLabel(wxBitmap(imageDir+wxT("/rectangle.bmp"),wxBITMAP_TYPE_BMP));
regular_->SetBitmapLabel(wxBitmap(imageDir+wxT("/regularP... | false | false | false | false | false | 0 |
cut_test_result_set_diff (CutTestResult *result, const gchar *diff)
{
CutTestResultPrivate *priv;
priv = CUT_TEST_RESULT_GET_PRIVATE(result);
if (priv->diff) {
g_free(priv->diff);
priv->diff = NULL;
}
if (diff && diff[0]) {
priv->diff = g_strdup(diff);
priv->user_s... | false | false | false | false | false | 0 |
qla24xx_beacon_blink(struct scsi_qla_host *vha)
{
uint16_t led_color = 0;
uint32_t gpio_data;
unsigned long flags;
struct qla_hw_data *ha = vha->hw;
struct device_reg_24xx __iomem *reg = &ha->iobase->isp24;
/* Save the Original GPIOD. */
spin_lock_irqsave(&ha->hardware_lock, flags);
gpio_data = RD_REG_DWORD(&r... | false | false | false | false | false | 0 |
keyring_hash(const char *desc)
{
unsigned bucket = 0;
for (; *desc; desc++)
bucket += (unsigned char)*desc;
return bucket & (KEYRING_NAME_HASH_SIZE - 1);
} | false | false | false | false | false | 0 |
intvar_min_max (const char *s, int *min, int *max,
int **var)
{
*max = 100000;
if (!strcmp(s, BFGS_MAXITER)) {
*min = 0;
*var = &state->bfgs_maxiter;
} else if (!strcmp(s, BFGS_VERBSKIP)) {
*min = 1;
*var = &state->bfgs_verbskip;
} else if (!strcmp(s, BHHH_MAXITER)) {
*min = 1;
*var = &stat... | false | false | false | false | false | 0 |
module_load_dso(const CONF *cnf, char *name, char *value,
unsigned long flags)
{
DSO *dso = NULL;
conf_init_func *ifunc;
conf_finish_func *ffunc;
char *path = NULL;
int errcode = 0;
CONF_MODULE *md;
/* Look for alternative path in module section */
path = NCONF_get_string(cnf, value, "path");
if (!pat... | false | false | false | false | false | 0 |
operator<<(otexstream & ots, docstring const & s)
{
size_t const len = s.length();
// Check whether there's something to output
if (len == 0)
return ots;
if (ots.protectSpace()) {
if (!ots.canBreakLine() && s[0] == ' ')
ots.os() << "{}";
ots.protectSpace(false);
}
if (contains(s, 0xF0000)) {
// Some... | false | false | false | false | false | 0 |
FcConfigValues (FcPattern *p, FcPattern *p_pat, FcMatchKind kind, FcExpr *e, FcValueBinding binding)
{
FcValueList *l;
if (!e)
return 0;
l = (FcValueList *) malloc (sizeof (FcValueList));
if (!l)
return 0;
if (FC_OP_GET_OP (e->op) == FcOpComma)
{
l->value = FcConfigEvaluate (p, p_pat, kind, ... | false | false | false | false | false | 0 |
setBackgroundPrefix(const QString &string)
{
if (string.isEmpty() || m_background->hasElementPrefix(string)) {
m_background->setElementPrefix(string);
update();
}
} | false | false | false | false | false | 0 |
stktable_touch(struct stktable *t, struct stksess *ts, int local)
{
struct eb32_node * eb;
ts->expire = tick_add(now_ms, MS_TO_TICKS(t->expire));
if (t->expire) {
t->exp_task->expire = t->exp_next = tick_first(ts->expire, t->exp_next);
task_queue(t->exp_task);
}
if (t->sync_task && local) {
ts->upd.key = ++... | false | false | false | false | false | 0 |
OfflineReadyCheck()
{
for (member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr)
{
Player* pl = sObjectMgr.GetPlayer(citr->guid);
if (!pl || !pl->GetSession())
{
WorldPacket data(MSG_RAID_READY_CHECK_CONFIRM, 9);
data << citr->guid;
... | false | false | false | false | false | 0 |
quick_append ()
{
struct mapelt *map;
struct mapelt *after;
struct mapelt mapstart;
char **p;
mapstart.info.name = 0;
mapstart.next = 0;
map = &mapstart;
after = map;
lock_for_update ();
/* Insert the specified files into the "map",
but is a map of the inserted files only,
and starts ou... | false | false | false | false | false | 0 |
OnPacket(AsyncPacketSocket* socket, const char* buf,
size_t size, const SocketAddress& remote_addr) {
CritScope cs(&crit_);
packets_->push_back(new Packet(remote_addr, buf, size));
} | false | false | false | false | false | 0 |
writeString(FILE * fp, char * str, unsigned int length)
{
ASSERT(fp != NULL && str != NULL);
int result = 0;
while(length > 0)
{
result = putc(*str, fp);
str++;
length--;
}
return (result == EOF ? ERROR_FileWrite : OK);
} | false | false | false | false | false | 0 |
is_potential_cd_path(const wcstring &path, const wcstring &working_directory, path_flags_t flags, wcstring *out_path)
{
wcstring_list_t directories;
if (string_prefixes_string(L"./", path))
{
/* Ignore the CDPATH in this case; just use the working directory */
directories.push_back(working_... | false | false | false | false | false | 0 |
code_generate(stmt_ty *sp, opcode_list_ty *olp)
{
stmt_command_ty *this;
trace(("code_generate(sp = %08X)\n{\n", sp));
assert(sp);
this = (stmt_command_ty *)sp;
/*
* generate the command strings
*/
opcode_list_append(olp, opcode_push_new());
expr_list_code_generate(&this->args, o... | false | false | false | false | false | 0 |
reduce(a, b)
int *a, *b;
{
int t, n, m;
/* find HCF using Euclid's algorithm */
if (*a > *b) {
n = *a;
m = *b;
} else {
n = *b;
m = *a;
};
while (m != 0) {
t = n % m;
n = m;
m = t;
};
*a = *a/n;
*b = *b/n;
} | false | false | false | false | false | 0 |
__assuan_usleep (assuan_context_t ctx, unsigned int usec)
{
if (! usec)
return;
#ifdef HAVE_NANOSLEEP
{
struct timespec req;
struct timespec rem;
req.tv_sec = 0;
req.tv_nsec = usec * 1000;
while (nanosleep (&req, &rem) < 0 && errno == EINTR)
req = rem;
}
#else
{
struct timev... | false | false | false | false | false | 0 |
ocfs2_cow_align_start(struct super_block *sb,
unsigned int start,
unsigned int cpos)
{
BUG_ON(start > cpos);
return start + ((cpos - start) & ocfs2_cow_contig_mask(sb));
} | false | false | false | false | false | 0 |
decode_nd_coefficients (unsigned total, wfa_t *wfa, bitfile_t *input)
/*
* Read #'total' weights of nondeterministic part of 'wfa'
* of given 'input' stream.
* 'frame' gives the current frame number.
*
* No return value.
*
* Side effects:
* 'wfa->weights' is filled with the decoded values.
*/
{
unsig... | false | false | false | false | false | 0 |
popupMenu(void)
{
if (_applicationPopup!=0) return _applicationPopup;
else
{
if (_popupMenu==0)
{
_popupMenu=new MSStringPopupMenu(server(),titleVector());
_popupMenu->font(font());
_popupMenu->foreground(foreground());
_popupMenu->background(background());
_popupMenu->callback(MSWidgetCallback::... | false | false | false | false | false | 0 |
dglNodeGet_InDegree(dglGraph_s * pGraph, dglInt32_t * pnNode)
{
#ifdef DGL_V2
dglInt32_t *pinedgeset;
#endif
pGraph->iErrno = 0;
if (pnNode) {
switch (pGraph->Version) {
case 1:
pGraph->iErrno = DGL_ERR_NotSupported;
return 0;
#ifdef DGL_V2
case 2:
if (DGL_NODE_STATUS_v2(pnNode) & DGL_NS_... | false | false | false | false | false | 0 |
get_property(const String& aname) {
Property* result=ffields.get(aname);
if (result) {
if (!result->getter && !result->setter) {
// can occur in ^process
Value *v=result->value;
throw Exception("parser.compile",
&aname,
"property can not be created, already exists field (%s) with that name", v ? v-... | false | false | false | false | false | 0 |
html_generate_anchor_name (device_type dev_type, char *manufacturer_name)
{
char *name = malloc (strlen (manufacturer_name) + 1 + 2);
char *pointer = name;
char type_char;
if (!name)
{
DBG_ERR ("html_generate_anchor_name: couldn't malloc\n");
return 0;
}
switch (dev_type)
{
case ... | false | false | false | false | false | 0 |
embWordLength(ajint wordlen)
{
ajint *pint;
if(!wordLengthList)
wordLengthList = ajListNew();
/* store the wordlength in case we do recursive word stuff */
AJNEW0(pint);
*pint = wordlen;
ajListPush(wordLengthList, pint);
/* set the current wordlength as an easily accessible static ajint ... | false | false | false | false | false | 0 |
SetUserTransferInfo( CString nick, CDCMessage * msg )
{
int err;
bool res = false;
CMessageMyInfo myinfo,*mi;
if ( m_UserList.SetUserTransferInfo(nick,msg) )
{
if ( m_UserList.GetUserMyInfo( nick, &myinfo ) )
{
mi = new CMessageMyInfo();
*mi = myinfo;
if ( m_pCallback != 0 )
{
err = m_pCallba... | false | false | false | false | false | 0 |
mips64_add_breakpoint(cpu_gen_t *cpu,m_uint64_t pc)
{
cpu_mips_t *mcpu = CPU_MIPS64(cpu);
int i;
for(i=0;i<MIPS64_MAX_BREAKPOINTS;i++)
if (!mcpu->breakpoints[i])
break;
if (i == MIPS64_MAX_BREAKPOINTS)
return(-1);
mcpu->breakpoints[i] = pc;
mcpu->breakpoints_enabled = TRUE;
... | false | false | false | false | false | 0 |
isl_basic_map_print_internal(struct isl_basic_map *bmap,
FILE *out, int indent)
{
if (!bmap) {
fprintf(out, "null basic map\n");
return;
}
fprintf(out, "%*s", indent, "");
fprintf(out, "ref: %d, nparam: %d, in: %d, out: %d, extra: %d, "
"flags: %x, n_name: %d\n",
bmap->ref,
bmap->dim->nparam, bmap->dim... | false | false | false | false | false | 0 |
i915_gpu_busy(void)
{
struct drm_i915_private *dev_priv;
struct intel_engine_cs *ring;
bool ret = false;
int i;
spin_lock_irq(&mchdev_lock);
if (!i915_mch_dev)
goto out_unlock;
dev_priv = i915_mch_dev;
for_each_ring(ring, dev_priv, i)
ret |= !list_empty(&ring->request_list);
out_unlock:
spin_unlock_irq(... | false | false | false | false | false | 0 |
AddData(void* data, size_t size)
{
if (!m_astatus)
return -1;
size_t outsize = 2*size/srcfmt.nBlockAlign+7200;
char* buf = new char[outsize];
size_t written = 0;
int hr;
if (data)
{
hr = m_pAudioEnc->Convert((uint8_t*)data, size/(size_t)srcfmt.nBlockAlign, buf,
outsize, (size_t*)0, ... | false | false | false | false | false | 0 |
po_charset_ascii_compatible (const char *canon_charset)
{
/* There are only a few exceptions to ASCII compatibility. */
if (strcmp (canon_charset, "SHIFT_JIS") == 0
|| strcmp (canon_charset, "JOHAB") == 0
|| strcmp (canon_charset, "VISCII") == 0)
return false;
else
return true;
} | false | false | false | false | false | 0 |
SetInstValue( const char * pszFieldPath,
GByte *pabyData, GUInt32 nDataOffset, int nDataSize,
char chReqType, void *pValue )
{
int nArrayIndex = 0, nNameLen, iField, nByteOffset;
const char *pszRemainder;
/* -------------------------------------------------------... | false | false | false | false | false | 0 |
reset_oattached_mids(ghostly)
boolean ghostly;
{
struct obj *otmp;
unsigned oldid, nid;
for (otmp = fobj; otmp; otmp = otmp->nobj) {
if (ghostly && otmp->oattached == OATTACHED_MONST && otmp->oxlth) {
struct monst *mtmp = (struct monst *)otmp->oextra;
mtmp->m_id = 0;
mtmp->mpeaceful = mtmp-... | false | false | false | false | false | 0 |
findMaxInRrow(const int row,
FactorPointers &pointers)
{
double *rowMax=pointers.rowMax;
double largest=rowMax[row];
if ( largest >= 0.0 ) return largest;
const int rowBeg=UrowStarts_[row];
const int rowEnd=rowBeg+UrowLengths_[row];
for ( int i=rowBeg; i<rowEnd; ++i ) {
const double a... | false | false | false | false | false | 0 |
cleanup_seen_subfolders(const char *mbname)
{
const char *userid = mboxname_to_userid(mbname);
struct seen *seendb = NULL;
char buf[MAX_MAILBOX_NAME];
int r;
/* not owned by a user */
if (!userid) return 0;
/* no need to do inbox, it will have upgraded OK, just
* the subfolders */
... | true | true | false | false | false | 1 |
unscale()
{
if (rowScale_) {
int i;
// reverse scaling
for (i = 0; i < numberRows_; i++)
rowScale_[i] = 1.0 * inverseRowScale_[i];
for (i = 0; i < numberColumns_; i++)
columnScale_[i] = 1.0 * inverseColumnScale_[i];
gutsOfScaling();
... | false | false | false | false | false | 0 |
get_port(void)
{
char *env_port;
int port = 0;
env_port = getenv("TSS_TCSD_PORT");
if (env_port == NULL)
return TCSD_DEFAULT_PORT;
port = atoi(env_port);
if (port == 0 || port > 65535)
return TCSD_DEFAULT_PORT;
return (short)port;
} | false | false | false | false | false | 0 |
parse_address (char *address, char **host, int *port)
{
char *pos = strchr (address, ':');
if (pos == NULL || pos == address)
return 1;
*host = g_malloc (pos - address + 1);
strncpy (*host, address, pos - address);
(*host) [pos - address] = '\0';
*port = atoi (pos + 1);
return 0;
} | false | true | true | false | true | 1 |
bufferedwriter_init(buffered *self, PyObject *args, PyObject *kwds)
{
/* TODO: properly deprecate max_buffer_size */
char *kwlist[] = {"raw", "buffer_size", "max_buffer_size", NULL};
Py_ssize_t buffer_size = DEFAULT_BUFFER_SIZE;
Py_ssize_t max_buffer_size = -234;
PyObject *raw;
self->ok = 0;
... | false | false | false | false | false | 0 |
act_current_sche()
{
int i;
pthread_t tid;
tid = pthread_self();
for (i = 0; i < act_sche_num; i ++) {
act_sche_t *sche = act_sches[i];
if (sche != NULL && sche->tid == tid) {
return sche;
}
}
return NULL;
} | 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.