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 |
|---|---|---|---|---|---|---|
bnx2x_get_warpcore_lane(struct bnx2x_phy *phy,
struct link_params *params)
{
u8 lane = 0;
struct bnx2x *bp = params->bp;
u32 path_swap, path_swap_ovr;
u8 path, port;
path = BP_PATH(bp);
port = params->port;
if (bnx2x_is_4_port_mode(bp)) {
u32 port_swap, port_swap_ovr;
/* Figure out path swap value *... | false | false | false | false | false | 0 |
session_write_data(Session *session)
{
gint write_len;
gint to_write_len;
cm_return_val_if_fail(session->write_data != NULL, -1);
cm_return_val_if_fail(session->write_data_p != NULL, -1);
cm_return_val_if_fail(session->write_data_len > 0, -1);
to_write_len = session->write_data_len -
(session->write_data_p - ... | false | false | false | false | false | 0 |
free_array_info_contents ( array_info input )
{
int i;
DXASSERTGOTO ( input != ERROR );
SUPERFREE ( input->shape )
if ( ( NULL != input->handle ) && !DXFreeArrayHandle ( input->handle ) )
goto error;
input->handle = NULL;
switch ( input->class )
{
case CLASS_ARRAY:
... | false | false | false | false | false | 0 |
png_set_sPLT(png_structp png_ptr,
png_infop info_ptr, png_sPLT_tp entries, int nentries)
/*
* entries - array of png_sPLT_t structures
* to be added to the list of palettes
* in the info structure.
* nentries - number of palette structures to be
... | false | false | false | false | false | 0 |
read_net_eicmp(struct stats_net_eicmp *st_net_eicmp)
{
FILE *fp;
char line[1024];
int sw = FALSE;
if ((fp = fopen(NET_SNMP, "r")) == NULL)
return;
while (fgets(line, 1024, fp) != NULL) {
if (!strncmp(line, "Icmp:", 5)) {
if (sw) {
sscanf(line + 5, "%*u %lu %lu %lu %lu %lu %lu %*u %*u "
"%... | true | true | false | false | true | 1 |
decode_PE_char(int c, PE_flags * fl)
{
if (fl->sbmode) {
c &= 0x7f;
return ((c > 94) ? (c - 95) : (c - 63));
} else {
return ((c > 190) ? (c - 191) : (c - 63));
}
} | false | false | false | false | false | 0 |
CountLines(wxFileName filename, const SLanguageDef &language,
long int &code_lines, long int &codecomments_lines,
long int &comment_lines, long int &empty_lines,
long int &total_lines)
{
wxTextFile file;
if (file.Open(filename.GetFullPath(), w... | false | false | false | false | false | 0 |
apply_check_personalized_blessings(object *who, const object *op) {
const char *owner;
const char *will;
long item_will;
long margin;
const char *msg;
int random_effect;
int damage_percentile;
if (!settings.personalized_blessings) {
return 1;
}
owner = object_get_value(... | false | false | false | false | true | 1 |
backend_bus_id(char bus_id[XEN_BUS_ID_SIZE], const char *nodename)
{
int domid, err;
const char *devid, *type, *frontend;
unsigned int typelen;
type = strchr(nodename, '/');
if (!type)
return -EINVAL;
type++;
typelen = strcspn(type, "/");
if (!typelen || type[typelen] != '/')
return -EINVAL;
devid = strr... | true | true | false | false | false | 1 |
extract_args(Pair* pp, List ls)
{
Sexp* sp = pp->cdr;
if (sp == (Sexp *) 0)
*ls = NULL;
else
ptol(sp->u.pair, ls);
} | false | false | false | false | false | 0 |
multiplexer_deliver_status (Multiplexer* self, gint channel, gint serial_status) {
gchar* status = NULL;
gint _tmp0_ = 0;
gchar* _tmp1_ = NULL;
FsoFrameworkLogger* _tmp2_ = NULL;
gint _tmp3_ = 0;
const gchar* _tmp4_ = NULL;
gint _tmp5_ = 0;
gchar* _tmp6_ = NULL;
gchar* _tmp7_ = NULL;
gboolean _tmp8_ = FALSE;
... | false | false | false | false | false | 0 |
_isAlphaString(const char* s, int32_t len) {
int32_t i;
for (i = 0; i < len; i++) {
if (!ISALPHA(*(s + i))) {
return FALSE;
}
}
return TRUE;
} | false | false | false | false | false | 0 |
check_incoming(uint32_t id, uint8_t type){
struct rqst_id *pid = search_by_id(id);
if( pid == NULL ){
printf("mpcd: id_list.c: no request sent with request_id %d\n",id);
return 0;
}
if( pid->type != type){
printf("mpcd: id_list.c: matching request_id found, but packet type is invalid %d\n",type);
... | false | false | false | false | false | 0 |
on_table_show_context(guint button, guint32 activate_time, Glib::RefPtr<CanvasGroupDbTable> table)
{
if(m_action_edit_fields)
{
// Disconnect the previous handler,
// and connect a new one, with the correct table as a bound parameter:
m_connection_edit_fields.disconnect();
m_connection_edit_fields =... | false | false | false | false | false | 0 |
PROJECT_get_home(void)
{
struct passwd *info;
uid_t uid = getuid();
if (!_home || _uid != uid)
{
STRING_free(&_home);
info = getpwuid(uid);
if (info)
_home = STRING_new_zero(info->pw_dir);
_uid = uid;
}
return _home;
} | false | false | false | false | false | 0 |
skfp_interrupt(int irq, void *dev_id)
{
struct net_device *dev = dev_id;
struct s_smc *smc; /* private board structure pointer */
skfddi_priv *bp;
smc = netdev_priv(dev);
bp = &smc->os;
// IRQs enabled or disabled ?
if (inpd(ADDR(B0_IMSK)) == 0) {
// IRQs are disabled: must be shared interrupt
return IRQ_N... | false | true | false | false | false | 1 |
gst_mpegts_demux_detect_packet_size (GstMpegTSDemux * demux, guint len)
{
guint i, packetsize = 0;
for (i = 1; i < len; i++) {
packetsize = demux->sync_lut[i] - demux->sync_lut[i - 1];
if (packetsize == MPEGTS_NORMAL_TS_PACKETSIZE ||
packetsize == MPEGTS_M2TS_TS_PACKETSIZE ||
packetsize == ... | false | false | false | false | false | 0 |
parse_sipc_verification(fetion_account *ac, const gchar *resp)
{
gchar *w;
gchar *start;
gchar *end;
ac->verification = fetion_verification_create();
w = sip_header_get_attr(resp, "W");
for (start = w; *start != '\0' && *start != '\"'; start ++);
if (!*start) {
g_free(w);
... | false | false | false | false | false | 0 |
gth_async_task_set_data (GthAsyncTask *self,
gboolean *terminated,
gboolean *cancelled,
double *progress)
{
g_mutex_lock (&self->priv->data_mutex);
if (terminated != NULL)
self->priv->terminated = *terminated;
if (cancelled != NULL)
self->priv->cancelled = *cancelled;
if (progress != N... | false | false | false | false | false | 0 |
save(YAML::Emitter& out, ConstColorSpaceTransformRcPtr t)
{
out << YAML::VerbatimTag("ColorSpaceTransform");
out << YAML::Flow << YAML::BeginMap;
out << YAML::Key << "src" << YAML::Value << t->getSrc();
out << YAML::Key << "dst" << YAML::Value << t->getDst();
... | false | false | false | false | false | 0 |
webx_crop_widget_reset (GtkButton *button,
WebxCropWidget *crop)
{
GdkRectangle rect;
g_return_if_fail (WEBX_IS_CROP_WIDGET (crop));
rect.x = 0;
rect.y = 0;
rect.width = crop->clip_width;
rect.height = crop->clip_height;
webx_crop_widget_update_target (crop, &rect);
} | false | false | false | false | false | 0 |
WriteCell()
{
char *TypeIn,NewName[64];
extern char *MenuSAVE;
MenuSelect(MenuSAVE);
if (Parameters.kpCellName[0] == '\0') {
ShowPrompt("There isn't anything to save.");
MenuDeselect(MenuSAVE);
return;
}
ShowPrompt("Cell name?");
TypeIn = FBEdit(Parameters.kpCellNam... | true | true | false | false | false | 1 |
comm_connect_callback(fde_t *fd, int status)
{
CNCB *hdl;
/* This check is gross..but probably necessary */
if (fd->connect.callback == NULL)
return;
/* Clear the connect flag + handler */
hdl = fd->connect.callback;
fd->connect.callback = NULL;
/* Clear the timeout handler */
comm_settimeout(fd,... | false | false | false | false | false | 0 |
file_or_dir_exists(const char *parent, const char *name)
{
SYS_DIR *dp;
SYS_DIRENT *d;
int ret = 0; /* default to false */
dp = dir_open(parent);
/* loop through all directory entries until we find the one that matches */
while (dp && name && !ret && (d = dir_read(dp))) {
const char *... | false | false | false | false | false | 0 |
create_bitmap_scan_plan(PlannerInfo *root,
BitmapHeapPath *best_path,
List *tlist,
List *scan_clauses)
{
Index baserelid = best_path->path.parent->relid;
Plan *bitmapqualplan;
List *bitmapqualorig;
List *indexquals;
List *indexECs;
List *qpqual;
ListCell *l;
BitmapHeapScan *s... | false | false | false | false | false | 0 |
Problem_5(const vector<string> &strVector, const string &str1, const string &str2){
int posStr1=-1, posStr2=-1, minDistance = INT_MAX;
for(size_t i=0; i<strVector.size(); ++i){
if(strVector[i]==str1){
posStr1 = i;
if(posStr2>=0)
minDistance = min(minDistance, posStr1-posStr2);
}
else if(strVector... | false | false | false | false | false | 0 |
unicode_aswidechar(PyObject *self, PyObject *args)
{
PyObject *unicode, *result;
Py_ssize_t buflen, size;
wchar_t *buffer;
if (!PyArg_ParseTuple(args, "Un", &unicode, &buflen))
return NULL;
buffer = PyMem_Malloc(buflen * sizeof(wchar_t));
if (buffer == NULL)
return PyErr_NoMemor... | false | false | false | false | false | 0 |
diffusion_stats_event (GfsEvent * event, GfsSimulation * sim)
{
if ((* GFS_EVENT_CLASS (gfs_output_class())->event) (event, sim)) {
FILE * fp = GFS_OUTPUT (event)->file->fp;
GSList * l = NULL, * i;
i = GFS_DOMAIN (sim)->variables;
while (i) {
GfsVariable * v = i->data;
if (v->sources... | false | false | false | false | false | 0 |
generate_internal_filename()
{
const time_t src1 = time(NULL);
const pid_t src2 = getpid();
const uid_t src3 = getuid();
unsigned char *dest = (unsigned char *)(&val);
unsigned char *src = (unsigned char *)(&src1);
U_I s1 = sizeof(src1) < LABEL_SIZE ? sizeof(src1) : LABEL_SIZE;
for(register U_I i = 0 ; i < ... | false | false | false | false | false | 0 |
match_fastboot_with_serial(usb_ifc_info *info, const char *local_serial)
{
if(!(vendor_id && (info->dev_vendor == vendor_id)) &&
(info->dev_vendor != 0x18d1) && // Google
(info->dev_vendor != 0x8087) && // Intel
(info->dev_vendor != 0x0451) &&
(info->dev_vendor != 0x0502) &&
(in... | false | false | false | false | false | 0 |
manager_path_unregister(void *data)
{
struct serial_adapter *adapter = data;
GSList *l;
/* Remove proxy objects */
for (l = adapter->proxies; l; l = l->next) {
struct serial_proxy *prx = l->data;
char *path = g_strdup(prx->path);
g_dbus_unregister_interface(adapter->conn, path,
SERIAL_PROXY_INTERFACE);... | false | false | false | false | false | 0 |
utils_str_reduce_exponant_from_string ( const gchar *amount_string,
gint exponent )
{
gchar *return_string;
gchar *p;
gchar *mon_decimal_point;
gunichar decimal_point = (gunichar )-2;
struct lconv *conv = localeconv ( );
if ( !amount_string )
return NULL;
mon_d... | false | false | false | false | false | 0 |
get_PC(void)
{
if(cpu && cpu->pc)
return cpu->pc->get_value();
return 0;
} | false | false | false | false | false | 0 |
t_dns_name_fullcompare(void) {
int line;
int cnt;
int result;
char *p;
FILE *fp;
dns_namereln_t reln;
t_assert("dns_name_fullcompare", 1, T_REQUIRED, "%s", a10);
result = T_UNRESOLVED;
fp = fopen("dns_name_fullcompare_data", "r");
if (fp != NULL) {
line = 0;
while ((p = t_fgetbs(fp)) != NULL) {
... | false | false | true | false | true | 1 |
draw_background(Canvas* c, const Allocation& a) const {
const Color* background;
if (state_->test(TelltaleState::is_active) ||
state_->test(TelltaleState::is_chosen)
) {
background = kit_->bg2();
} else {
background = kit_->bg1();
}
c->fill_rect(a.left(), a.bottom(), a.right(), a.top(), backg... | false | false | false | false | false | 0 |
wm_master_vol_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
struct aureon_spec *spec = ice->spec;
int ch, change = 0;
snd_ice1712_save_gpio_status(ice);
for (ch = 0; ch < 2; ch++) {
unsigned int vol = ucontrol->value.integer.valu... | false | false | false | false | false | 0 |
aggregate_handle_guint (CellData *cdata, guint val)
{
if (cdata->data_value) {
guint eval = 0;
if (G_VALUE_TYPE (cdata->data_value) == G_TYPE_UINT)
eval = g_value_get_uint (cdata->data_value);
switch (cdata->aggregate) {
case GDA_DATA_PIVOT_MIN:
if (eval > val)
g_value_set_uint (cdata->data_value, va... | false | false | false | false | false | 0 |
I_UpdateSoundParams(int channel, int vol, int sep)
{
if (sound_module != NULL)
{
CheckVolumeSeparation(&vol, &sep);
sound_module->UpdateSoundParams(channel, vol, sep);
}
} | false | false | false | false | false | 0 |
goc_arc_update_bounds (GocItem *item)
{
cairo_surface_t *surface;
cairo_t *cr;
GocArc *arc = GOC_ARC (item);
surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 1, 1);
cr = cairo_create (surface);
if (goc_arc_prepare_draw (item, cr, 0)) {
if (arc->start_arrow.typ != GO_ARROW_NONE)
prepare_draw_arrow... | false | false | false | false | false | 0 |
Oct6100ApiGetChannelsEchoSwSizes(
IN tPOCT6100_CHIP_OPEN f_pOpenChip,
OUT tPOCT6100_API_INSTANCE_SIZES f_pInstSizes )
{
UINT32 ulTempVar;
UINT32 ulResult;
UINT32 ulMaxChannels;
ulMaxChannels = f_pOpenChip->ulMaxChannels;
if ( f_pOpenChip->fEnableChannelRecording == TRUE && ulMaxChannels != 672 )
ulM... | false | false | false | false | false | 0 |
print_mac_table(void)
{
struct hash_iterator hi;
char buf[BUFSIZE];
unsigned int key;
struct mac_info *mi;
int i = 0;
printf("--- mac table ---\n");
hash_iter_set(&hi, &mac_table);
while ((mi = hash_iter_get(&hi, &key))) {
sprintf_eth_mac(buf, mi->mac);
printf("%-24s %s\n", host_lookup(key, hl_mode), buf)... | true | true | false | false | false | 1 |
isDBLAxis(const char *units, const char *longname)
{
int status = FALSE;
if ( strcmp(longname, "depth below land") == 0 ||
strcmp(longname, "depth_below_land") == 0 ||
strcmp(longname, "levels below the surface") == 0 )
{
/*
if ( strcmp(ncvars[ncvarid].units, "cm") == ... | false | false | false | false | false | 0 |
ParseServedUserNumberList(struct Aoc *chanp, u_char *p, u_char *end, char *str)
{
char partyNumber[30];
int i;
INIT;
for (i = 0; i < 9; i++) { // 99
partyNumber[0] = 0;
XSEQUENCE_OPT_1(ParsePartyNumber, ASN1_NOT_TAGGED, ASN1_NOT_TAGGED, partyNumber);
if (partyNumber[0]) {
str += sprintf(str, "%s ", partyN... | false | false | false | false | false | 0 |
ok()
{
if ( editor->Apply() ) {
myPlayer.setName( name );
myPlayer.stat = modes[playerMode->GetSelectedItemIndex()];
// myPlayer.setColor( colorSelector->
QuitModal();
}
return true;
} | false | false | false | false | false | 0 |
__posix_acl_chmod(struct posix_acl **acl, gfp_t gfp, umode_t mode)
{
struct posix_acl *clone = posix_acl_clone(*acl, gfp);
int err = -ENOMEM;
if (clone) {
err = __posix_acl_chmod_masq(clone, mode);
if (err) {
posix_acl_release(clone);
clone = NULL;
}
}
posix_acl_release(*acl);
*acl = clone;
return er... | false | false | false | false | false | 0 |
print(const Internal::ChequePrintFormat &format)
{
// try to use the default printer
QPrintDialog dlg;
if (dlg.exec()==QDialog::Rejected)
return false;
QPrinter *printer = dlg.printer();
printer->setFullPage(true);
printer->setPaperSize(QPrinter::A4);
printer->setResolution(150);
... | false | false | false | false | false | 0 |
fritzfonV1GetName( gchar *pnData, gint nPos, gchar **ppnName ) {
int nNameStart;
int nNameStop;
nPos = findString( pnData, nPos, "TrFonName(" );
if ( nPos == -1 ) {
//Debug( KERN_DEBUG, "'TrFonName(' Not found\n" );
return -1;
}
nNameStart = findString( pnData, nPos, "," );
if ( nNameStart == -1 ) {
Deb... | false | false | false | false | false | 0 |
_list_item_add_advanced(E_Config_Dialog_Data *cfdata, E_Gadcon_Client *gcc, E_Config_Gadcon_Client *cf_gcc)
{
Evas_Object *icon = NULL, *end;
Evas *evas;
if (gcc && (gcc->gadcon != cfdata->gc)) return;
if (!gcc)
{
Eina_List *l;
EINA_LIST_FOREACH(cfdata->gc->clients, l, gcc)
i... | false | false | false | false | false | 0 |
CanReadFile(const char* vtkNotUsed(filename))
{
if (this->Archetype == NULL)
{
return false;
}
std::string fileNameCollapsed = itksys::SystemTools::CollapseFullPath( this->Archetype);
// First see if the archetype exists
if (!itksys::SystemTools::FileExists (fileNameCollapsed.c_str()))
{
v... | false | false | false | false | false | 0 |
tdb_lock_and_recover(struct tdb_context *tdb)
{
enum TDB_ERROR ecode;
if (!check_lock_pid(tdb, "tdb_transaction_prepare_commit", true))
return TDB_ERR_LOCK;
ecode = tdb_allrecord_lock(tdb, F_WRLCK, TDB_LOCK_WAIT|TDB_LOCK_NOCHECK,
false);
if (ecode != TDB_SUCCESS) {
return ecode;
}
ecode = tdb_lock_o... | false | false | false | false | false | 0 |
icerAdf(tid,aobj)IDE tid;A aobj;
{
long len=3+(MAXR+1);
I *iceCube=ma(len);
I i,idx=0;
for(i=0;i<len;++i)iceCube[i]=0;
iceCube[idx++]=aobj->t;
iceCube[idx++]=aobj->n;
iceCube[idx++]=aobj->r;
for(i=0;i<aobj->r;++i)iceCube[idx+i]=icedAtom(aobj->d[i]);
tid->type=PK_ADF;tid->p=(I)aobj;
tid->ftell=packI... | false | false | false | false | false | 0 |
network_check_connection(void *data, void *user_data) {
Network_connection *c = (Network_connection *)data;
struct network_info *n = (struct network_info *)user_data;
if (FD_ISSET(c->fd,n->rfds)) {
network_connection_do_read(c);
}
if (c->fd != -1 && FD_ISSET(c->fd,n->wfds)) {
network_connection_d... | false | false | false | false | false | 0 |
hso_free_interface(struct usb_interface *interface)
{
struct hso_serial *serial;
int i;
for (i = 0; i < HSO_SERIAL_TTY_MINORS; i++) {
if (serial_table[i] &&
(serial_table[i]->interface == interface)) {
serial = dev2ser(serial_table[i]);
tty_port_tty_hangup(&serial->port, false);
mutex_lock(&serial-... | false | false | false | false | false | 0 |
mt7601u_rxdc_cal(struct mt7601u_dev *dev)
{
static const struct mt76_reg_pair intro[] = {
{ 158, 0x8d }, { 159, 0xfc },
{ 158, 0x8c }, { 159, 0x4c },
}, outro[] = {
{ 158, 0x8d }, { 159, 0xe0 },
};
u32 mac_ctrl;
int i, ret;
mac_ctrl = mt7601u_rr(dev, MT_MAC_SYS_CTRL);
mt7601u_wr(dev, MT_MAC_SYS_CTRL, MT_M... | false | false | false | false | false | 0 |
PyInit__lzma(void)
{
PyObject *m;
empty_tuple = PyTuple_New(0);
if (empty_tuple == NULL)
return NULL;
m = PyModule_Create(&_lzmamodule);
if (m == NULL)
return NULL;
if (PyModule_AddIntMacro(m, FORMAT_AUTO) == -1 ||
PyModule_AddIntMacro(m, FORMAT_XZ) == -1 ||
Py... | false | false | false | false | false | 0 |
_setSeparateSceneBlending(
SceneBlendFactor sourceFactor, SceneBlendFactor destFactor,
SceneBlendFactor sourceFactorAlpha, SceneBlendFactor destFactorAlpha,
SceneBlendOperation op, SceneBlendOperation alphaOp )
{
GLint sourceBlend = getBlendMode(sourceFactor);
GLint destBlend... | false | false | false | false | false | 0 |
GNUNET_SCHEDULER_add_delayed_with_priority (struct GNUNET_TIME_Relative delay,
enum GNUNET_SCHEDULER_Priority priority,
GNUNET_SCHEDULER_Task task, void *task_cls)
{
struct Task *t;
struct Task *pos;
struct Task *prev;
#if EXECINFO
void *backtrace_array[MAX_TRACE_DEPTH];
#endif
GNUNET_asse... | false | false | false | false | false | 0 |
count_changed_buffers(void)
{
buf_T *bufp;
int n;
n = 0;
for (bufp = firstbuf; bufp != NULL; bufp = bufp->b_next)
if (bufp->b_changed)
++n;
return n;
} | false | false | false | false | false | 0 |
parseYesNo2(const char *token, GBool *flag) {
if (!strcmp(token, "yes")) {
*flag = gTrue;
} else if (!strcmp(token, "no")) {
*flag = gFalse;
} else {
return gFalse;
}
return gTrue;
} | false | false | false | false | false | 0 |
remove_statusbar
(
char *name,
int context,
guint msgid
)
{
if (msgid == 0)
return;
GtkWidget *sbar = glade_xml_get_widget(app_xml, name);
if (sbar)
return gtk_statusbar_remove(GTK_STATUSBAR(sbar),context,msgid);
} | false | false | false | false | false | 0 |
PySSL_SSLdo_handshake(PySSLSocket *self)
{
int ret;
int err;
int sockstate, nonblocking;
PySocketSockObject *sock
= (PySocketSockObject *) PyWeakref_GetObject(self->Socket);
if (((PyObject*)sock) == Py_None) {
_setSSLError("Underlying socket connection gone",
PY_S... | false | false | false | false | false | 0 |
cmd_close (struct session *sess, char *tbuf, char *word[], char *word_eol[])
{
GSList *list;
if (strcmp (word[2], "-m") == 0)
{
list = sess_list;
while (list)
{
sess = list->data;
list = list->next;
if (sess->type == SESS_DIALOG)
fe_close_window (sess);
}
} else
{
if (*word_eol[2])
sess-... | false | false | false | false | false | 0 |
connect_port(bool isoutput, int port, Element* e, int e_port)
{
if (port_active(isoutput, port)) {
_ports[isoutput][port] = Port(this, e, e_port);
return 0;
} else
return -1;
} | false | false | false | false | false | 0 |
dragStart()
//
////////////////////////////////////////////////////////////////////////
{
currentDragger = getActiveChildDragger();
// If there is no active child dragger, then we should just return.
if ( currentDragger == NULL)
return;
shftDown = getEvent()->wasShiftDown();
// Save the starting... | false | false | false | false | false | 0 |
hardfile_do_disk_change (struct uaedev_config_info *uci, int insert)
{
int fsid = uci->configoffset;
int j;
int newstate = insert ? 0 : 1;
struct hardfiledata *hfd;
if (uci->controller == HD_CONTROLLER_PCMCIA_SRAM) {
gayle_modify_pcmcia_sram_unit (uci->rootdir, uci->readonly, insert);
return;
} else if (uci-... | false | false | false | false | false | 0 |
union_objects(struct var_object *var1, struct var_object *var2)
{
struct var_object *tmpvar1, *tmpvar2, *retvar = NULL;
int found_dupe = 0;
for (tmpvar1 = var1; tmpvar1; tmpvar1 = tmpvar1->prev) {
switch (tmpvar1->type) {
case VAR_FILE_OBJECT:
found_dupe = 0;
for (tmpvar2 = var2; tmpvar2; tmpvar2 = tmpvar... | false | false | false | false | false | 0 |
_PyGen_Finalize(PyObject *self)
{
PyGenObject *gen = (PyGenObject *)self;
PyObject *res;
PyObject *error_type, *error_value, *error_traceback;
if (gen->gi_frame == NULL || gen->gi_frame->f_stacktop == NULL)
/* Generator isn't paused, so no need to close */
return;
/* Save the curre... | false | false | false | false | false | 0 |
end_board () {
if (timer_id) {
g_source_remove (timer_id);
timer_id = 0;
}
if (gcomprisBoard != NULL) {
pause_board(TRUE);
crane_destroy_all_items();
}
gcomprisBoard = NULL;
} | false | false | false | false | false | 0 |
ToBinaryString(bool trim) const
{
wxString str;
str.Alloc(128);
int b;
for (int i = 0; i < 128; i++) {
b = GetBitNumber(i);
if ((!trim) || (b != 0)) {
str.Append(b ? wxT("1") : wxT("0"));
trim = false;
}
}
if (str.Len() == 0) {
str = wxT("0");
}
return str;
} | false | false | false | false | false | 0 |
xfs_ifree(
xfs_trans_t *tp,
xfs_inode_t *ip,
xfs_bmap_free_t *flist)
{
int error;
struct xfs_icluster xic = { 0 };
ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL));
ASSERT(ip->i_d.di_nlink == 0);
ASSERT(ip->i_d.di_nextents == 0);
ASSERT(ip->i_d.di_anextents == 0);
ASSERT(ip->i_d.di_size == 0 || !S_ISREG(ip->i_d.d... | false | false | false | false | false | 0 |
Master_Shutdown (void)
{
// pgm post3.19 change, cvar pointer not validated before dereferencing
if (!public_server || !public_server->integer)
return; // a private dedicated game
SV_HandleMasters ("shutdown", "shutdown");
} | false | false | false | false | false | 0 |
ServerWait(dpy, w, endCond, endData, localLoop, seconds)
Display *dpy;
Window w;
EndCond endCond;
void *endData;
int localLoop;
int seconds;
{
time_t start;
time_t now;
time_t lastChk = 0;
XEvent event;
XPropertyEvent *e = (XPropertyEvent *)&event;
# defin... | false | false | false | false | false | 0 |
stop()
{
disconnect(metaAlertIcon, SIGNAL(updateFrame(int)), this, SLOT(updateFrame(int)));
if ( isActivated ) {
disconnect(real, SIGNAL(pixmapChanged()), this, SLOT(pixmapChanged()));
real->stop();
isActivated = false;
}
} | false | false | false | false | false | 0 |
dcompare(const double *pos1, const double *pos2)
{
if (*pos1 < *pos2) {
return(-1);
}
else if (*pos1 > *pos2) {
return(1);
}
else {
return(0);
}
} | false | false | false | false | false | 0 |
u4c4(buf, offset)
char *buf;
u4_t offset;
{
int i;
#ifdef __AS386_16__
if( no_swap )
{
*((unsigned long*)buf) = offset; /* UNALIGNED ACCESS! */
return;
}
#endif
for(i=0; i<4; i++)
{
buf[long_off[i]] = offset;
offset >>= 8;
}
} | false | false | false | false | false | 0 |
addNull(const std::string& name, const std::string& type)
{
log_trace("addNull(\"" << name << "\", \"" << type << "\")");
*_out << static_cast<char>(name.empty() ? Serializer::TypePlainEmpty : Serializer::TypeEmpty);
if (!name.empty())
*_out << name << '\0';
*_out << '\xff';
} | false | false | false | false | false | 0 |
getEndClobberMask(const TargetRegisterInfo *TRI) const {
// If we see a return block with successors, this must be a funclet return,
// which does not preserve any registers. If there are no successors, we don't
// care what kind of return it is, putting a mask after it is a no-op.
return isReturnBlock() && !su... | false | false | false | false | false | 0 |
skl_tplg_pga_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *k, int event)
{
struct snd_soc_dapm_context *dapm = w->dapm;
struct skl *skl = get_skl_ctx(dapm->dev);
switch (event) {
case SND_SOC_DAPM_PRE_PMU:
return skl_tplg_pga_dapm_pre_pmu_event(w, skl);
case SND_SOC_DAPM_POST_PMD:
return skl_... | false | false | false | false | false | 0 |
i915_driver_postclose(struct drm_device *dev, struct drm_file *file)
{
struct drm_i915_file_private *file_priv = file->driver_priv;
if (file_priv && file_priv->bsd_ring)
file_priv->bsd_ring = NULL;
kfree(file_priv);
} | false | false | false | false | false | 0 |
writeClustersD3(t_Params *ptParams, int nN, int nM, int nK, int *anZ, short* asCentroids)
{
char *szClustFile = (char *) malloc(MAX_LINE_LENGTH*sizeof(char));
FILE *ofp = NULL;
int i = 0, j = 0, s = 0;
int* anT = (int * ) malloc(nK*sizeof(int));
sprintf(szClustFile, "%s_cd3%s", ptParams->szOutFileStub, FAST... | false | true | false | false | false | 1 |
readhexaesc (LexState *ls) {
int c[3], i; /* keep input for error message */
int r = 0; /* result accumulator */
c[0] = 'x'; /* for error message */
for (i = 1; i < 3; i++) { /* read two hexadecimal digits */
c[i] = next(ls);
if (!lisxdigit(c[i]))
escerror(ls, c, i + 1, "hexadecimal digit expe... | false | false | false | false | false | 0 |
main(int argc, char **argv)
{
std_list l;
std_list_iterator iter;
int i;
l = std_list_create(destroy);
if (!l) {
printf("creation failed\n");
return -1;
}
/* Add 1000 items */
for (i = 0; i < 1000; ++i) {
int *data = malloc(sizeof (int));
*data = i;
... | false | false | false | false | false | 0 |
open_story( const char *storyname )
{
char *path, *p;
char tmp[Z_FILENAME_MAX + Z_PATHNAME_MAX + 1];
path = p = 0;
if ( !STANDALONE_FLAG )
{
story_offset = 0;
}
else
{
/* standalone game; offset to story start is saved in low-endian */
/* format after magic string */
st... | false | false | false | false | false | 0 |
ensMarkermaplocationCalculateMemsize(const EnsPMarkermaplocation mml)
{
size_t size = 0;
if (!mml)
return 0;
size += sizeof (EnsOMarkermaplocation);
size += ensMarkersynonymCalculateMemsize(mml->Markersynonym);
if (mml->Mapname)
{
size += sizeof (AjOStr);
size += ajS... | false | false | false | false | false | 0 |
proc_watchdog_update(void)
{
int err = 0;
/*
* Watchdog threads won't be started if they are already active.
* The 'watchdog_running' variable in watchdog_*_all_cpus() takes
* care of this. If those threads are already active, the sample
* period will be updated and the lockup detectors will be enabled
* o... | false | false | false | false | false | 0 |
gst_mini_object_replace (GstMiniObject ** olddata, GstMiniObject * newdata)
{
GstMiniObject *olddata_val;
g_return_val_if_fail (olddata != NULL, FALSE);
GST_CAT_TRACE (GST_CAT_REFCOUNTING, "replace %p (%d) with %p (%d)",
*olddata, *olddata ? (*olddata)->refcount : 0,
newdata, newdata ? newdata->refc... | false | false | false | false | false | 0 |
create_callno_pools(void)
{
uint16_t i;
if (!(callno_pool = ao2_container_alloc(CALLNO_POOL_BUCKETS, callno_hash, NULL))) {
return -1;
}
if (!(callno_pool_trunk = ao2_container_alloc(CALLNO_POOL_BUCKETS, callno_hash, NULL))) {
return -1;
}
/* start at 2, 0 and 1 are reserved */
for (i = 2; i < IAX_MAX_CAL... | false | false | false | false | false | 0 |
_e_menu_active_call(void)
{
E_Menu_Item *mi;
mi = _e_menu_item_active_get();
if (mi)
{
if (mi->check)
e_menu_item_toggle_set(mi, !mi->toggle);
if ((mi->radio) && (!e_menu_item_toggle_get(mi)))
e_menu_item_toggle_set(mi, 1);
if (mi->cb.func)
mi->cb.fun... | false | false | false | false | false | 0 |
unpackHorizontalArray( const CompactTrieHeader *header, const CompactTrieHorizontalEntry *array,
int low, int high, UErrorCode &status ) {
if (U_FAILURE(status) || low > high) {
return NULL;
}
int middle = (low+high)/2;
TernaryNode *result = new TernaryNode(array[midd... | false | false | false | false | false | 0 |
_gnutls_get_cred (gnutls_key_st key, gnutls_credentials_type_t type, int *err)
{
const void *retval = NULL;
int _err = -1;
auth_cred_st *ccred;
if (key == NULL)
goto out;
ccred = key->cred;
while (ccred != NULL)
{
if (ccred->algorithm == type)
{
break;
}
ccred... | false | false | false | false | false | 0 |
vbox_pause(ClientData cd, Tcl_Interp *ip, int argc, char *argv[])
{
long p;
if (argc != 2)
{
log(L_ERROR, "[vbox_pause] usage: vbox_pause <ms>\n");
printstring(ip->result, "ERROR");
}
else
{
p = xstrtol(argv[1], 800);
log(L_JUNK, "[vbox_pause] waiting %lu ms...\n", p);
xpause(p);
printstring(ip->... | false | false | false | false | false | 0 |
c_split_parallel_clauses (tree clauses, tree *par_clauses, tree *ws_clauses)
{
tree next;
*par_clauses = NULL;
*ws_clauses = build_omp_clause (OMP_CLAUSE_NOWAIT);
for (; clauses ; clauses = next)
{
next = OMP_CLAUSE_CHAIN (clauses);
switch (OMP_CLAUSE_CODE (clauses))
{
case OMP_CLAUSE_PRIVA... | false | false | false | false | false | 0 |
plugin_db_catalog_save ( GWDBContext *context) {
_data *data = NULL;
gint result = -1;
if ( context != NULL) {
data = gw_db_context_get_data ( context);
if ( gw_db_catalog_is_modified ( data->catalog) ) {
result = csv_file_save ( context);
} else {}
} else {}
return result;
} | false | false | false | false | false | 0 |
checkHostname()
{
char buf[1024+1];
if (gethostname(buf, 1024) != 0)
return;
buf[sizeof(buf)-1] = '\0';
if (m_hostname.isEmpty())
{
m_hostname = buf;
return;
}
if (m_hostname == buf)
return;
QByteArray newHostname = buf;
runDontChangeHostname(m_hostnam... | false | false | false | false | false | 0 |
gvrender_begin_job(GVJ_t * job)
{
gvrender_engine_t *gvre = job->render.engine;
if (gvdevice_initialize(job))
return 1;
if (gvre) {
if (gvre->begin_job)
gvre->begin_job(job);
}
return 0;
} | false | false | false | false | false | 0 |
ast_pickup_find_by_group(struct ast_channel *chan)
{
struct ao2_container *candidates;/*!< Candidate channels found to pickup. */
struct ast_channel *target;/*!< Potential pickup target */
candidates = ao2_container_alloc_options(AO2_ALLOC_OPT_LOCK_NOLOCK, 1, NULL, NULL);
if (!candidates) {
return NULL;
}
/* ... | false | false | false | false | false | 0 |
Columbusday (int monthStartDOW)
{
if ((monthStartDOW == 0) || (monthStartDOW == 1)) {
return (9 - monthStartDOW);
} else {
return (16 - monthStartDOW);
}
} | false | false | false | false | false | 0 |
start_log_trans(struct btrfs_trans_handle *trans,
struct btrfs_root *root,
struct btrfs_log_ctx *ctx)
{
int ret = 0;
mutex_lock(&root->log_mutex);
if (root->log_root) {
if (btrfs_need_log_full_commit(root->fs_info, trans)) {
ret = -EAGAIN;
goto out;
}
if (!root->log_start_pid) {
clear_b... | false | false | false | false | false | 0 |
start_jobs(void)
{
CronFile *file;
CronLine *line;
for (file = G.cron_files; file; file = file->cf_next) {
if (!file->cf_wants_starting)
continue;
file->cf_wants_starting = 0;
for (line = file->cf_lines; line; line = line->cl_next) {
pid_t pid;
if (line->cl_pid >= 0)
continue;
start_one_job(... | false | false | false | false | false | 0 |
efuse_pg_packet_write(struct ieee80211_hw *hw,
u8 offset, u8 word_en, u8 *data)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct pgpkt_struct target_pkt;
u8 write_state = PG_STATE_HEADER;
int continual = true, dataempty = true, result = true;
u16 efuse_addr = 0;
u8 efuse_data;
u8 target_word_cnts = 0;
u8 ... | 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.