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 |
|---|---|---|---|---|---|---|
recordTimeLoss(GmpPlay *l) {
Str timeMsg;
GoStone loser = l->game->whoseMove;
sgf_timeLeft(l->moves, loser, -1);
if ((l->game->time.type == goTime_ing) ||
((l->game->time.type == goTime_canadian) &&
l->goban->timers[loser].aux)) {
sgf_stonesLeft(l->moves, loser,
l->goban->timers[loser... | false | false | false | false | false | 0 |
do_solve(const struct options *opt, int want_solution)
{
struct cdok_puzzle puz;
uint8_t solution[CDOK_CELLS];
FILE *out;
int diff = 0;
int r;
if (read_puzzle(opt->in_file, &puz) < 0)
return -1;
r = cdok_solve(&puz, solution, &diff);
if (r < 0) {
fprintf(stderr, "Puzzle is not solvable\n");
return -1;
... | false | false | false | false | false | 0 |
camel_spool_summary_new (CamelFolder *folder,
const gchar *mbox_name)
{
CamelSpoolSummary *new;
new = g_object_new (CAMEL_TYPE_SPOOL_SUMMARY, "folder", folder, NULL);
if (folder) {
CamelStore *parent_store;
parent_store = camel_folder_get_parent_store (folder);
camel_db_set_collate (... | false | false | false | false | false | 0 |
do_utility(const char *monhost, const char *suffix)
{
char utility[64], lowxfer[64], highxfer[64];
int lowx, highx, util;
if (getupsvar (monhost, "utility", utility, sizeof(utility)) > 0) {
/* try to get low and high transfer points for color codes */
lowx = highx = 0;
if (getups... | false | false | false | false | false | 0 |
gcm_profile_store_find_directory (GcmProfileStore *profile_store, const gchar *path)
{
GcmProfileStoreDirHelper *tmp;
guint i;
GPtrArray *array = profile_store->priv->directory_array;
for (i=0; i<array->len; i++) {
tmp = g_ptr_array_index (array, i);
if (... | false | false | false | false | false | 0 |
rpz_rewrite_ip(ns_client_t *client, const isc_netaddr_t *netaddr,
dns_rdatatype_t qtype, dns_rpz_type_t rpz_type,
dns_rpz_zbits_t zbits, dns_rdataset_t **p_rdatasetp)
{
dns_rpz_zones_t *rpzs;
dns_rpz_st_t *st;
dns_rpz_zone_t *rpz;
dns_rpz_prefix_t prefix;
dns_rpz_num_t rpz_num;
dns_fixedname_t ip_... | false | false | false | false | false | 0 |
gr_seq_show(struct seq_file *seq, void *v)
{
struct gr_udc *dev = seq->private;
u32 control = gr_read32(&dev->regs->control);
u32 status = gr_read32(&dev->regs->status);
struct gr_ep *ep;
seq_printf(seq, "usb state = %s\n",
usb_state_string(dev->gadget.state));
seq_printf(seq, "address = %d\n",
(contro... | false | false | false | false | false | 0 |
traceRay(const mrpt::poses::CPose3D &o,double &dist) const {
CPose3D nueva=(CPose3D()-this->m_pose)+o;
bool found=false;
double tmp;
for (CListOpenGLObjects::const_iterator it=m_objects.begin();it!=m_objects.end();++it) if ((*it)->traceRay(nueva,tmp)) {
if (!found) {
found=true;
dist=tmp;
} else if (tmp<d... | false | false | false | false | false | 0 |
generateFixedStringsPdf(L_PDF_DATA *lpd)
{
char buf[L_SMALLBUF];
char *version, *datestr;
SARRAY *sa;
/* Accumulate data for the header and objects 1-3 */
lpd->id = stringNew("%PDF-1.2\n");
l_dnaAddNumber(lpd->objsize, strlen(lpd->id));
lpd->obj1 = stringNew("1 0 obj\n"
... | false | false | false | false | false | 0 |
print_compilation(struct vm_method *vmm)
{
char comp_char;
char sync_char;
if (vm_method_is_native(vmm))
comp_char = 'n';
else
comp_char = ' ';
if (method_is_synchronized(vmm))
sync_char = 's';
else
sync_char = ' ';
trace_printf("%c%c %s.%s (%d bytes)\n", comp_char, sync_char, vmm->class->name, vmm->n... | false | false | false | false | false | 0 |
HPDF_CIDFontDef_AddWidth (HPDF_FontDef fontdef,
const HPDF_CID_Width *widths)
{
HPDF_CIDFontDefAttr attr = (HPDF_CIDFontDefAttr)fontdef->attr;
HPDF_PTRACE ((" HPDF_CIDFontDef_AddWidth\n"));
while (widths->cid != 0xFFFF) {
HPDF_CID_Width *w = HPDF_GetMem (fo... | false | false | false | false | false | 0 |
h0(word32 x, const word32 *key, unsigned int kLen)
{
x = x | (x<<8) | (x<<16) | (x<<24);
switch(kLen)
{
#define Q(a, b, c, d, t) q[a][GETBYTE(t,0)] ^ (q[b][GETBYTE(t,1)] << 8) ^ (q[c][GETBYTE(t,2)] << 16) ^ (q[d][GETBYTE(t,3)] << 24)
case 4: x = Q(1, 0, 0, 1, x) ^ key[6];
case 3: x = Q(1, 1, 0, 0, x) ^ key[4];
ca... | false | false | false | false | false | 0 |
tty_ldisc_ref_wait(struct tty_struct *tty)
{
ldsem_down_read(&tty->ldisc_sem, MAX_SCHEDULE_TIMEOUT);
if (!tty->ldisc)
ldsem_up_read(&tty->ldisc_sem);
return tty->ldisc;
} | false | false | false | false | false | 0 |
gtr_message_table_navigate (GtrMessageTable * table,
GtrMessageTableNavigation navigation,
GtrMessageTableNavigationFunc func)
{
GtkTreeSelection *selection;
GtkTreeModel *model;
GtkTreePath *path;
GtkTreeIter iter;
GtrMsg *msg;
gboolean cont = TRUE;
... | false | false | false | false | false | 0 |
isBogus() const {
return displayName.isBogus() || id.isBogus();
} | false | false | false | false | false | 0 |
init_dbus(void)
{
dbus_error_init(&dbus_err);
dbus_conn = dbus_bus_get(DBUS_BUS_SYSTEM, &dbus_err);
if (dbus_error_is_set(&dbus_err))
{
BUG("dBus Connection Error (%s)!\n", dbus_err.message);
dbus_error_free(&dbus_err);
}
if (dbus_conn == NULL)
{
return 0;
}
ret... | false | false | false | false | false | 0 |
FlushAllMessageQueues(void)
{
fmodule_list_itr moditr;
fmodule *module;
module_list_itr_init(&moditr);
while ( (module = module_list_itr_next(&moditr)) != NULL)
{
FlushMessageQueue(module);
}
return;
} | false | false | false | false | false | 0 |
UpdateBackgroundTexture(GF_TextureHandler *txh)
{
gf_sc_texture_update_frame(txh, 0);
/*restart texture if needed (movie background controled by MediaControl)*/
if (txh->stream_finished && gf_mo_get_loop(txh->stream, 0))
gf_sc_texture_restart(txh);
} | false | false | false | false | false | 0 |
r8712_bb_reg_write(struct _adapter *pAdapter, u16 offset, u32 value)
{
u8 shift = offset & 0x0003; /* 4 byte access */
u16 bb_addr = offset & 0x0FFC; /* 4 byte access */
struct IOCMD_STRUCT iocmd;
iocmd.cmdclass = IOCMD_CLASS_BB_RF;
iocmd.value = bb_addr;
iocmd.index = IOCMD_BB_WRITE_IDX;
if (shift != 0) {
u3... | false | false | false | false | false | 0 |
GetPointAttributeArray(vtkIdType ptId, double *x)
{
int i;
this->Mesh->GetPoints()->GetPoint(ptId, x);
for (i = 0; i < this->NumberOfComponents; i++)
{
if (i < this->AttributeComponents[0])
{
x[3+i] = this->Mesh->GetPointData()->GetScalars()->
GetComponent(ptId, i) * this->Attri... | false | false | false | false | false | 0 |
F_mpz_poly_pack_bytes(F_mpz_poly_t res, F_mpz_poly_t poly, ulong n, ulong bytes)
{
// special case, poly is zero
if (poly->length == 0)
{
F_mpz_poly_zero(res);
return;
}
long i, j;
ulong max_bits = FLINT_ABS(F_mpz_poly_max_bits(poly));
// length after packing
ulong short_length = (poly->length - 1)... | false | false | false | false | false | 0 |
getCastedInt8PtrValue(Value *Ptr) {
PointerType *PT = cast<PointerType>(Ptr->getType());
if (PT->getElementType()->isIntegerTy(8))
return Ptr;
// Otherwise, we need to insert a bitcast.
PT = getInt8PtrTy(PT->getAddressSpace());
BitCastInst *BCI = new BitCastInst(Ptr, PT, "");
BB->getInstList().insert... | false | false | false | false | false | 0 |
ccss_color_convert (ccss_color_t const *property,
ccss_property_type_t target,
void *value)
{
g_return_val_if_fail (property && value, false);
if (CCSS_PROPERTY_TYPE_DOUBLE == target)
return false;
* (char **) value = g_strdup_printf ("#%02x%02x%02x%02x",
(int) (property->red * 255),
... | false | false | false | false | false | 0 |
moveSlow(){
if (!dead){
if (!moveslow){
moveslow = true;
speed = speed*0.01;
}
speed += acceleration;
// speed += constAcceleration;
Vector2 newSpeed = speed*0.01;
position += newSpeed;
this->acceleration.x = 0;
this->acceleration.y = 0;
notifyable::notify();
}
... | false | false | false | false | false | 0 |
fauhdli_destroy_signals(
struct slset *sigs,
const struct glue_vhdl_cb *callbacks
)
{
struct slset_entry *i;
for (i = sigs->first; i != NULL; i = i->next) {
signal_destroy((struct signal *)i->data, callbacks);
}
slset_destroy(sigs, callbacks->free);
} | false | false | false | false | false | 0 |
evas_common_rgba_image_scalecache_size_set(unsigned int size)
{
#ifdef SCALECACHE
LKL(cache_lock);
if (size != max_cache_size)
{
max_cache_size = size;
_cache_prune(NULL, 1);
}
LKU(cache_lock);
#endif
} | false | false | false | false | false | 0 |
printRelocations() {
ListScope D(W, "Relocations");
std::error_code EC;
for (const SectionRef &Section : Obj->sections()) {
StringRef Name;
error(Section.getName(Name));
bool PrintedGroup = false;
for (const RelocationRef &Reloc : Section.relocations()) {
if (!PrintedGroup) {
W.sta... | false | false | false | false | false | 0 |
input_files_available(
RESULT* rp, bool verify_contents, FILE_INFO** fipp
) {
WORKUNIT* wup = rp->wup;
FILE_INFO* fip;
unsigned int i;
APP_VERSION* avp;
FILE_REF fr;
PROJECT* project = rp->project;
int retval;
avp = rp->avp;
for (i=0; i<avp->app_files.size(); i++) {
fr =... | false | false | false | false | false | 0 |
notification_indicator_setup(void)
{
if(!mmapp) {
mmapp = messaging_menu_app_new (CLAWS_DESKTOP_FILE);
}
if(notify_config.indicator_enabled && !mmapp_registered) {
messaging_menu_app_register (MESSAGING_MENU_APP (mmapp));
g_signal_connect (mmapp, "activate-source", G_CALLBACK (show_claws_mail), NULL);... | false | false | false | false | false | 0 |
tracker_extract_module_manager_mimetype_is_handled (const gchar *mimetype)
{
GList *mimetype_rules;
if (!initialized &&
!tracker_extract_module_manager_init ()) {
return FALSE;
}
mimetype_rules = lookup_rules (mimetype);
return mimetype_rules != NULL;
} | false | false | false | false | false | 0 |
write_xml_dataset(FILE *f, GGobiData *d, ggobid *gg, XmlWriteInfo *xmlWriteInfo)
{
if (d->edge.n && !d->ncols) {
write_xml_edges(f, d, gg, xmlWriteInfo);
} else {
write_dataset_header (f, d, gg, xmlWriteInfo);
write_xml_description (f, gg, xmlWriteInfo);
write_xml_variables (f, d, gg, xmlWriteInfo);... | false | false | false | false | false | 0 |
wxt_enhanced_open(char* fontname, double fontsize, double base, TBOOLEAN widthflag, TBOOLEAN showflag, int overprint)
{
if (wxt_status != STATUS_OK)
return;
gp_command temp_command;
temp_command.command = command_enhanced_open;
temp_command.string = new char[strlen(fontname)+1];
strcpy(temp_command.string, font... | false | false | false | false | false | 0 |
generateCpp( FILE * fp)
{
fprintf(fp, "0#include \"CbcStrategy.hpp\"\n");
fprintf(fp, "3 CbcStrategyDefault strategy(%s,%d,%d,%d);\n",
cutsOnlyAtRoot_ ? "1" : "0",
numberStrong_,
numberBeforeTrust_,
printLevel_);
fprintf(fp, "3 strategy.setupPreProcessing(%d... | false | false | false | false | false | 0 |
adt7316_store_DAC(struct adt7316_chip_info *chip,
int channel, const char *buf, size_t len)
{
u8 msb, lsb, offset;
u16 data;
int ret;
if (channel >= ADT7316_DA_MSB_DATA_REGS ||
(channel == 0 &&
(chip->config3 & ADT7316_EN_IN_TEMP_PROP_DACA)) ||
(channel == 1 &&
(chip->config3 & ADT7316_EN_EX_TEMP_PROP_DA... | false | false | false | false | false | 0 |
apol_bst_destroy(apol_bst_t ** b)
{
if (!b || !(*b))
return;
bst_node_free((*b)->head, (*b)->fr);
(*b)->head = NULL;
free(*b);
*b = NULL;
} | false | false | false | false | false | 0 |
asn1constraint_range_free(asn1cnst_range_t *cr) {
if(cr) {
int i;
if(cr->elements) {
for(i = 0; i < cr->el_count; i++)
asn1constraint_range_free(cr->elements[i]);
free(cr->elements);
}
free(cr);
}
} | false | false | false | false | false | 0 |
joystickEvent(JoystickEventType jet, int number, int value) {
switch(jstate) {
case 0:
case 2:
if (jet==JOY_AXIS) {
jsval[jstate] = number & 0xfffe;
jstate++;
formatJoystickDescription();
}
break;
case 1:
case 3:
case 4:
if (jet==JOY_BUTTON && value==1) {
jsval[j... | false | false | false | false | false | 0 |
getCachedEntry(SPtr<TDUID> clntDuid, TAddrIA::TIAType type) {
if (!this->CacheMaxSize)
return 0;
SPtr<TSrvCacheEntry> entry;
this->Cache.first();
while (entry = this->Cache.get()) {
if (!entry->Duid)
continue; // something is wrong. VERY wrong. But shut up and contin... | false | false | false | false | false | 0 |
iwlagn_rx_spectrum_measure_notif(struct iwl_priv *priv,
struct iwl_rx_cmd_buffer *rxb)
{
struct iwl_rx_packet *pkt = rxb_addr(rxb);
struct iwl_spectrum_notification *report = (void *)pkt->data;
if (!report->state) {
IWL_DEBUG_11H(priv,
"Spectrum Measure Notification: Start\n");
return;
}
memcpy(... | false | false | false | false | false | 0 |
local_clock_us(unsigned *cpu)
{
unsigned long t;
/* Cheaply and approximately convert from nanoseconds to microseconds.
* The result and subsequent calculations are also defined in the same
* approximate microseconds units. The principal source of timing
* error here is from the simple truncation.
*
* Note... | false | false | false | false | false | 0 |
ath5k_setup_rate_powertable(struct ath5k_hw *ah, u16 max_pwr,
struct ath5k_rate_pcal_info *rate_info,
u8 ee_mode)
{
unsigned int i;
u16 *rates;
/* max_pwr is power level we got from driver/user in 0.5dB
* units, switch to 0.25dB units so we can compare */
max_pwr *= 2;
max_pwr = min(max_pwr, (u16) ah->ah_... | false | false | false | false | false | 0 |
uninstallDerivations(Globals & globals, Strings & selectors,
Path & profile)
{
while (true) {
string lockToken = optimisticLockProfile(profile);
DrvInfos installedElems = queryInstalled(globals.state, profile);
DrvInfos newElems;
foreach (DrvInfos::iterator, i, installedElems) ... | false | false | false | false | false | 0 |
gd_madd_linterp(DIRFILE* D, const char* parent,
const char* field_code, const char* in_field, const char* table) gd_nothrow
{
gd_entry_t L;
int error;
dtrace("%p, \"%s\", \"%s\", \"%s\", \"%s\"", D, field_code, parent, in_field,
table);
if (D->flags & GD_INVALID) {/* don't crash */
_GD_SetError(... | false | false | false | false | false | 0 |
receive_byte() {
_assert_(true);
SocketCore* core = (SocketCore*)opq_;
if (core->fd < 1) {
sockseterrmsg(core, "not opened");
return false;
}
return sockgetc(core);
} | false | false | false | false | false | 0 |
CDB___qam_mvptr_read(recbuf, argpp)
void *recbuf;
__qam_mvptr_args **argpp;
{
__qam_mvptr_args *argp;
u_int8_t *bp;
int ret;
ret = CDB___os_malloc(sizeof(__qam_mvptr_args) +
sizeof(DB_TXN), NULL, &argp);
if (ret != 0)
return (ret);
argp->txnid = (DB_TXN *)&argp[1];
bp = recbuf;
memcpy(&argp->type, bp,... | false | false | false | false | false | 0 |
break_in_goal(int color_to_move, int owner, signed char goal[BOARDMAX],
struct influence_data *q, int store, int info_pos)
{
struct connection_data conn;
int k;
int intruder = OTHER_COLOR(owner);
signed char used[BOARDMAX];
int non_territory[BOARDMAX];
int num_non_territory = 0;
int candidate_s... | true | true | false | false | false | 1 |
ario_source_manager_remove (ArioSource *source)
{
ARIO_LOG_FUNCTION_START;
GSList *tmp;
ArioSourceData *data;
/* Shutdown source */
ario_source_shutdown (source);
if (instance->priv->source == source)
instance->priv->source = NULL;
/* For each s... | false | false | false | false | false | 0 |
platform_device_register_full(
const struct platform_device_info *pdevinfo)
{
int ret = -ENOMEM;
struct platform_device *pdev;
pdev = platform_device_alloc(pdevinfo->name, pdevinfo->id);
if (!pdev)
goto err_alloc;
pdev->dev.parent = pdevinfo->parent;
pdev->dev.fwnode = pdevinfo->fwnode;
if (pdevinfo->dma_... | false | false | false | false | false | 0 |
gun_damage(bool with_ammo)
{
if (!is_gun())
return 0;
it_gun* gun = dynamic_cast<it_gun*>(type);
int ret = gun->dmg_bonus;
if (with_ammo && curammo != NULL)
ret += curammo->damage;
for (int i = 0; i < contents.size(); i++) {
if (contents[i].is_gunmod())
ret += (dynamic_cast<it_gunmod*>(contents[i].type))-... | false | false | false | false | false | 0 |
lx_pipe_state(struct lx6464es *chip, u32 pipe, int is_capture, u16 *rstate)
{
int err;
u32 pipe_cmd = PIPE_INFO_TO_CMD(is_capture, pipe);
mutex_lock(&chip->msg_lock);
lx_message_init(&chip->rmh, CMD_0A_GET_PIPE_SPL_COUNT);
chip->rmh.cmd[0] |= pipe_cmd;
err = lx_message_send_atomic(chip, &chip->rmh);
if (err ... | false | false | false | false | false | 0 |
readString()
{
QByteArray result;
if ( !waitForMoreData( m_data.length() == 0 ) ) {
throw ImapParserException( "Unable to read more data" );
}
stripLeadingSpaces();
if ( !waitForMoreData( m_position >= m_data.length() ) ) {
throw ImapParserException( "Unable to read more data" );
}
// literal str... | false | false | false | false | false | 0 |
create_and_fill_models (GtkSatSelector *selector)
{
GtkListStore *store; /* the list store data structure */
GtkTreeIter node; /* new top level node added to the tree store */
GDir *dir;
gchar *dirname;
sat_t sat;
gint catnum;
gchar **buffv;
... | false | false | false | false | false | 0 |
es_fputc (int c, estream_t stream)
{
int ret;
ESTREAM_LOCK (stream);
ret = es_putc_unlocked (c, stream);
ESTREAM_UNLOCK (stream);
return ret;
} | false | false | false | false | false | 0 |
sha1_file_exists (iTunesDB *itdb, gchar *file, gboolean silent)
{
ExtraiTunesDBData *eitdb;
Track *track = NULL;
g_return_val_if_fail (file, NULL);
g_return_val_if_fail (itdb, NULL);
eitdb = itdb->userdata;
g_return_val_if_fail (eitdb, NULL);
if (prefs_get_int("sha1") && eitdb->sha1hash)
... | false | false | false | false | false | 0 |
H5Zget_filter_info(H5Z_filter_t filter, unsigned int *filter_config_flags)
{
herr_t ret_value = SUCCEED;
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "Zf*Iu", filter, filter_config_flags);
/* Get the filter info */
if(H5Z_get_filter_info(filter, filter_config_flags) < 0)
HGOTO_ERROR(H5E_PLINE, H5E_C... | false | false | false | false | false | 0 |
plConeIsect() : fCapped(0), fRadAngle(0.0f), fLength(0.0f) {
for (size_t i=0; i<5; i++)
fDists[i] = 0.0f;
} | false | false | false | false | false | 0 |
gap_player_cache_decompress(GapPlayerCacheData *cdata)
{
guchar *th_data;
th_data = NULL;
if (cdata->compression == GAP_PLAYER_CACHE_COMPRESSION_NONE)
{
th_data = g_new ( guchar, cdata->th_data_size );
memcpy(th_data, cdata->th_data, cdata->th_data_size);
if(gap_debug)
{
printf("gap_playe... | false | true | false | false | false | 1 |
expr(Home home, const SetExpr& e) {
if (!home.failed())
return e.post(home);
SetVar x(home,IntSet::empty,IntSet::empty);
return x;
} | false | false | false | false | false | 0 |
AcpiHwClearGpeBlock (
ACPI_GPE_XRUPT_INFO *GpeXruptInfo,
ACPI_GPE_BLOCK_INFO *GpeBlock,
void *Context)
{
UINT32 i;
ACPI_STATUS Status;
/* Examine each GPE Register within the block */
for (i = 0; i < GpeBlock->RegisterCount; i++)
... | false | false | false | false | false | 0 |
pixOpenCompBrickExtendDwa(PIX *pixd,
PIX *pixs,
l_int32 hsize,
l_int32 vsize)
{
PIX *pixt;
PROCNAME("pixOpenCompBrickExtendDwa");
if (!pixs)
return (PIX *)ERROR_PTR("pixs not defined", procName, pixd);
if (... | false | false | false | false | false | 0 |
OnConfig( wxCommandEvent& WXUNUSED( event ) )
{
/* if we have already opened a dialog, just raise it */
if (config_displayed) {
config_dialog->Raise();
return;
}
/* otherwise, open a dialog */
config_displayed = true;
config_dialog = new wxtConfigDialog(this);
config_dialog->Show(true);
} | false | false | false | false | false | 0 |
GetSaveFactsDeftemplateNames(
void *theEnv,
struct expr *theList,
int saveCode,
int *count,
int *error)
{
struct expr *tempList;
DATA_OBJECT_PTR theDOArray;
int i, tempCount;
struct deftemplate *theDeftemplate = NULL;
/*=============================*/
/* Initialize the error state. */
... | false | false | false | false | false | 0 |
reset_view(struct view *view)
{
int i;
for (i = 0; i < view->lines; i++)
free(view->line[i].data);
free(view->line);
view->line = NULL;
view->offset = 0;
view->lines = 0;
view->lineno = 0;
view->line_size = 0;
view->line_alloc = 0;
view->vid[0] = 0;
} | false | false | false | false | false | 0 |
listmem_count_from_abe(AdrBk_Entry *abe)
{
char **p;
if(abe->tag != List)
return 0;
for(p = abe->addr.list; p != NULL && *p != NULL; p++)
;/* do nothing */
return((adrbk_cntr_t)(p - abe->addr.list));
} | false | false | false | false | false | 0 |
_become_slurm_user(void)
{
gid_t slurm_user_gid;
/* Determine SlurmUser gid */
slurm_user_gid = gid_from_uid(slurmdbd_conf->slurm_user_id);
if (slurm_user_gid == (gid_t) -1) {
fatal("Failed to determine gid of SlurmUser(%u)",
slurmdbd_conf->slurm_user_id);
}
/* Initialize supplementary groups ID list ... | false | false | false | false | false | 0 |
check_cookie(struct ath9k_htc_priv *priv,
struct sk_buff *skb,
u8 cookie, u8 epid)
{
u8 fcookie = 0;
if (epid == priv->mgmt_ep) {
struct tx_mgmt_hdr *hdr;
hdr = (struct tx_mgmt_hdr *) skb->data;
fcookie = hdr->cookie;
} else if ((epid == priv->data_bk_ep) ||
(epid == priv->data_be_ep) ||
(ep... | false | false | false | false | false | 0 |
boxaIsFull(BOXA *boxa,
l_int32 *pfull)
{
l_int32 i, n, full;
BOX *box;
PROCNAME("boxaIsFull");
if (!pfull)
return ERROR_INT("&full not defined", procName, 1);
*pfull = 0;
if (!boxa)
return ERROR_INT("boxa not defined", procName, 1);
n = boxaGetCount(boxa);
... | false | false | false | false | false | 0 |
afs_vnode_symlink(struct afs_vnode *vnode, struct key *key,
const char *name, const char *content,
struct afs_fid *newfid,
struct afs_file_status *newstatus,
struct afs_server **_server)
{
struct afs_server *server;
int ret;
_enter("%s{%x:%u.%u},%x,%s,%s,,,",
vnode->volume->v... | false | false | false | false | false | 0 |
add_extra_option(struct extra_opts *extra, char *s)
{
int len = strlen(s);
int newlen = extra->used_size + len;
if (extra->str)
len++; /* +1 for ',' */
if (newlen >= extra->alloc_size) {
char *new;
new = realloc(extra->str, newlen + 1); /* +1 for NUL */
if (!new)
return;
extra->str = new;
extra-... | false | true | false | false | false | 1 |
on_icon_file_located (GObject *source_object,
GAsyncResult *res,
gpointer user_data)
{
GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (user_data);
GFile *icon_file;
GError *error;
error = NULL;
icon_file = _g_find_file_insensitive_finish (G_FILE (so... | false | false | false | false | false | 0 |
setLayerName(const char * name, dimeMemHandler * const memhandler)
{
if (this->layerName && memhandler == NULL) {
delete this->layerName;
}
DXF_STRCPY(memhandler, this->layerName, name);
} | false | false | false | false | false | 0 |
comm_server_register_player(Comm_server *serv, char *name) {
if (serv->nrplayers == serv->registered_players) {
INFO("Couldn't register %s, server full",name);
return -1;
}
serv->players[serv->registered_players] = strdup(name);
serv->registered_players++;
INFO("registered player %s (%d)",name, serv->... | false | false | false | false | false | 0 |
etrn_getrange(int sock, struct query *ctl, const char *id,
int *countp, int *newp, int *bytes)
/* send ETRN and interpret the response */
{
int ok, opts;
char buf [MSGBUFSIZE+1];
struct idlist *qnp; /* pointer to Q names */
(void)id;
if ((ok = SMTP_ehlo(sock, SMTP_MODE, fetchmailhost,
ctl-... | false | false | false | false | false | 0 |
modarr(x,n,a)
word2 *x;
int n;
unsigned a;
{
register word4 u;
if(n == 0 || a <= 1)
return(0);
x += n;
u = 0;
while(--n >= 0) {
u <<= 16;
u += *--x;
u %= a;
}
return(u);
} | false | false | false | false | false | 0 |
firstRunAt(RenderObject *renderNode, int y, NodeImpl *&startNode, long &startOffset)
{
for (RenderObject *n = renderNode; n; n = n->nextSibling()) {
if (n->isText()) {
RenderText *textRenderer = static_cast<khtml::RenderText *>(n);
for (InlineTextBox *box = textRenderer->firstTextBox... | false | false | false | false | false | 0 |
operator==(const plUuid& other) const {
if (fData1 != other.fData1 || fData2 != other.fData2 || fData3 != other.fData3)
return false;
return (memcmp(fData4, other.fData4, sizeof(fData4)) == 0);
} | false | false | false | false | false | 0 |
print_objv(interp,objc,objv)
Tcl_Interp *interp;
int objc;
Tcl_Obj *objv[];
{
char **argv;
int argc;
int len;
argv = (char **)ckalloc(objc+1 * sizeof(char *));
for (argc=0 ; argc<objc ; argc++) {
argv[argc] = Tcl_GetStringFromObj(objv[argc],&len);
}
argv[argc] = NULL;
return(print_argv(... | false | false | false | false | false | 0 |
CreateDefaultColorMap()
{
default_ = new GRA_colorMap( wxT("DEFAULT") );
for( int i=0; i<6; ++i )
{
for( int j=0; j<6; ++j )
{
for( int k=0; k<6; ++k )
default_->AddColor( new GRA_color(i*0x33,j*0x33,k*0x33) );
}
}
} | false | false | false | false | false | 0 |
expand2x(char **layout, int xsize, int ysize) {
int i, j;
int nxsize = xsize*2-1;
int nysize = ysize*2-1;
/* Allocate new layout */
char **newlayout = (char **)calloc(sizeof(char *), nxsize);
for (i = 0; i < nxsize; i++) {
newlayout[i] = (char *)calloc(sizeof(char), nysize);
}
... | false | false | false | false | false | 0 |
fromXml(const QDomElement& e)
{
setJid(e.attribute("jid"));
setName(e.attribute("name"));
if (e.attribute("action") == "delete") {
setAction(Delete);
}
else if (e.attribute("action") == "modify") {
setAction(Modify);
}
else {
setAction(Add);
}
QDomNodeList nl = e.childNodes();
for(int n = 0; n < nl.coun... | false | false | false | false | false | 0 |
at_insert_recv_function(int type, at_recv_function_type func, struct gn_statemachine *state)
{
at_driver_instance *drvinst = AT_DRVINST(state);
at_recv_function_type oldfunc;
int i;
if (type >= GN_OP_AT_Max) {
return (at_recv_function_type) -1;
}
if (drvinst->if_pos == 0) {
drvinst->incoming_functions[0].mes... | false | false | false | false | false | 0 |
sbp2_reconnect(struct work_struct *work)
{
struct sbp2_logical_unit *lu =
container_of(work, struct sbp2_logical_unit, work.work);
struct sbp2_target *tgt = lu->tgt;
struct fw_device *device = target_parent_device(tgt);
int generation, node_id, local_node_id;
if (fw_device_is_shutdown(device))
return;
gener... | false | false | false | false | false | 0 |
mwifiex_alloc_dma_align_buf(int rx_len, gfp_t flags)
{
struct sk_buff *skb;
int buf_len, pad;
buf_len = rx_len + MWIFIEX_RX_HEADROOM + MWIFIEX_DMA_ALIGN_SZ;
skb = __dev_alloc_skb(buf_len, flags);
if (!skb)
return NULL;
skb_reserve(skb, MWIFIEX_RX_HEADROOM);
pad = MWIFIEX_ALIGN_ADDR(skb->data, MWIFIEX_DMA_... | false | false | false | false | false | 0 |
SockList_Ensure(const SockList *sl, size_t size) {
if (sl->len+size > sizeof(sl->buf)) {
fatal(OUT_OF_MEMORY);
}
} | false | false | false | false | false | 0 |
prtbnfttype (bnfttype_enum ttype)
/*
This routine returns a pointer to the string representation of the terminal
type.
Parameter:
ttype: a terminal type
Returns: string representation.
*/
{ static char badtype[40] ;
int fldsze ;
switch (ttype)
{ case bnfttNIL:
return ("NIL") ;
case bnft... | false | false | false | false | false | 0 |
command_mon_aggr(object *op, const char *params) {
if (op->enemy || !QUERY_FLAG(op, FLAG_UNAGGRESSIVE)) {
object_set_enemy(op, NULL);
SET_FLAG(op, FLAG_UNAGGRESSIVE);
draw_ext_info(NDI_UNIQUE, 0, op, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM,
"Aggression turned OFF");
}... | false | false | false | false | false | 0 |
print_class_perms(FILE * fp, const qpol_class_t * class_datum, const apol_policy_t * policydb, const int expand)
{
int retval = -1;
const char *class_name = NULL, *perm_name = NULL;
qpol_iterator_t *iter = NULL;
const qpol_common_t *common_datum = NULL;
qpol_policy_t *q = apol_policy_get_qpol(policydb);
if (!cla... | false | false | false | false | false | 0 |
update_workspace_names (MatewnckScreen *screen)
{
char **names;
int i;
GList *tmp;
GList *copy;
if (!screen->priv->need_update_workspace_names)
return;
screen->priv->need_update_workspace_names = FALSE;
names = _matewnck_get_utf8_list (screen->priv->xroot,
_matewnck... | false | false | false | false | false | 0 |
dbinom_raw(gnm_float x, gnm_float n, gnm_float p, gnm_float q, gboolean give_log)
{
gnm_float f, lc;
if (p == 0) return((x == 0) ? R_D__1 : R_D__0);
if (q == 0) return((x == n) ? R_D__1 : R_D__0);
if (x == 0) {
if(n == 0) return R_D__1;
lc = (p < 0.1) ? -bd0(n,n*q) - n*p : n*gnm_log(q);
return( R_D... | false | false | false | false | false | 0 |
ParseStatString(char *str, int16_t *StatType, int *flow_record_stat, uint16_t *order_proto) {
char *s, *p, *q, *r;
int i=0;
print_order_bits = 0;
if ( NumStats >= MaxStats )
return 0;
s = strdup(str);
q = strchr(s, '/');
if ( q )
*q = 0;
*order_proto = 0;
p = strchr(s, ':');
if ( p ) {
*p = 0;
*orde... | false | false | false | false | false | 0 |
action_camera_set_port (GPParams *params, const char *port)
{
int p, r;
GPPortInfo info;
char *path;
char verified_port[1024];
verified_port[sizeof (verified_port) - 1] = '\0';
if (!strchr (port, ':')) {
gp_log (GP_LOG_DEBUG, "main", _("Ports must look like "
"'serial:/dev/ttyS0' or 'usb:', but '%s' is "
... | true | true | false | false | false | 1 |
entry_is_addkey(long int lineno)
{
register AddrScrn_Disp *dl;
if((dl = dlist(lineno)) && (dl->type == AddFirstPers ||
dl->type == AddFirstGlob ||
dl->type == AskServer))
return 1;
return 0;
} | false | false | false | false | false | 0 |
uip_new_word (const sc_char *word)
{
sc_int required;
/*
* Unless the pool is empty, search forwards from the next cursor position
* until an unused slot is found, or until the index wraps to the cursor.
*/
required = strlen (word) + 1;
if (uip_word_pool_available > 0 && required <= UIP_SHORT_WORD_SIZ... | false | false | false | false | false | 0 |
wsp_unit_shutdown(void) {
gw_assert(run_status == running);
run_status = terminating;
gwlist_remove_producer(queue);
gwthread_join_every(main_thread);
gwlist_destroy(queue, wap_event_destroy_item);
wsp_strings_shutdown();
} | false | false | false | false | false | 0 |
c_type_promotes_to (type)
tree type;
{
if (TYPE_MAIN_VARIANT (type) == float_type_node)
return double_type_node;
if (c_promoting_integer_type_p (type))
{
/* Preserve unsignedness if not really getting any wider. */
if (TREE_UNSIGNED (type)
&& (TYPE_PRECISION (type) == TYPE_PRECI... | false | false | false | false | false | 0 |
G_ls(const char *dir, FILE * stream)
{
int i, n;
char **dir_listing = G__ls(dir, &n);
G_ls_format(dir_listing, n, 0, stream);
for (i = 0; i < n; i++)
G_free(dir_listing[i]);
G_free(dir_listing);
return;
} | false | false | false | false | false | 0 |
on_result (struct session *sess, ikspak *pak)
{
iks *x;
if (sess->set_roster == 0) {
x = iks_make_iq (IKS_TYPE_GET, IKS_NS_ROSTER);
iks_insert_attrib (x, "id", "roster");
iks_send (sess->prs, x);
iks_delete (x);
} else {
iks_insert_attrib (my_roster, "type", "set");
iks_send (sess->prs, my_roster);
}
... | false | false | false | false | false | 0 |
printStatistics( uint64_t time ) {
map<uint32_t,ProcessStats>::const_iterator it= processes.begin();
map<uint32_t,ProcessStats>::const_iterator itend= processes.end();
for ( ; it != itend; ++it ) {
it->second.printStatistics( it->first, time, false == usefunctiongroups ?
NULL : &functiongroups, false == u... | false | false | false | false | false | 0 |
close_tiff(bgav_stream_t * s)
{
tiff_t * priv;
priv = s->data.video.decoder->priv;
if (priv->raster) _TIFFfree(priv->raster);
free(priv);
} | false | false | false | false | false | 0 |
auxsort (lua_State *L, int l, int u) {
while (l < u) { /* for tail recursion */
int i, j;
/* sort elements a[l], a[(l+u)/2] and a[u] */
lua_rawgeti(L, 1, l);
lua_rawgeti(L, 1, u);
if (sort_comp(L, -1, -2)) /* a[u] < a[l]? */
set2(L, l, u); /* swap a[l] - a[u] */
else
lua_pop(L, ... | 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.