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 |
|---|---|---|---|---|---|---|
VSM_Seq(struct VSM_data *vd)
{
CHECK_OBJ_NOTNULL(vd, VSM_MAGIC);
return (vd->VSM_head->alloc_seq);
} | false | false | false | true | false | 1 |
gst_soup_http_src_check_seekable (GstSoupHTTPSrc * src)
{
GstFlowReturn ret = GST_FLOW_OK;
/* Special case to check if the server allows range requests
* before really starting to get data in the buffer creation
* loops.
*/
if (!src->got_headers && GST_STATE (src) >= GST_STATE_PAUSED) {
g_mutex_lock... | false | false | false | false | false | 0 |
xmlSecKeyReqDebugDump(xmlSecKeyReqPtr keyReq, FILE* output) {
xmlSecAssert(keyReq != NULL);
xmlSecAssert(output != NULL);
fprintf(output, "=== KeyReq:\n");
fprintf(output, "==== keyId: %s\n",
(xmlSecKeyDataKlassGetName(keyReq->keyId)) ?
xmlSecKeyDataKlassGetName(keyReq->keyId) :
BAD_CAST "N... | false | false | false | false | false | 0 |
set_DAC_volt(double volt)
{
DAC_voltage = volt;
if ((value.get() & (CPSON|CPSRM)) == (CPSON|CPSRM))
calculate_freq();
} | false | false | false | false | false | 0 |
_render_rle(GRAPHICS_CONTROLLER *gc,
int64_t pts,
BD_PG_RLE_ELEM *img,
uint16_t x, uint16_t y,
uint16_t width, uint16_t height,
BD_PG_PALETTE_ENTRY *palette)
{
if (gc->overlay_proc) {
BD_O... | false | false | false | false | false | 0 |
key_unit_diplomat_actions(void)
{
struct city *pcity; /* need pcity->id */
unit_list_iterate(get_units_in_focus(), punit) {
if (is_diplomat_unit(punit)
&& (pcity = tile_city(unit_tile(punit)))
&& diplomat_can_do_action(punit, DIPLOMAT_ANY_ACTION,
unit_tile(punit))) {
process_diplomat_arrival(puni... | false | false | false | false | false | 0 |
port_mdr_in( void )
{
libspectrum_byte ret = 0xff;
int m;
for( m = 0; m < 8; m++ ) {
microdrive_t *mdr = µdrive[ m ];
if( mdr->motor_on && mdr->inserted ) {
if( mdr->transfered < mdr->max_bytes ) {
mdr->last = libspectrum_microdrive_data( mdr->cartridge,
mdr->head_pos );
incremen... | false | false | false | false | false | 0 |
symbol_bd_cobol_get_symbols_matches (Symbolizable *self, const gchar *symbol_prefix, gint flags)
{
gphpedit_debug (DEBUG_SYMBOLIZABLE);
SymbolBdCOBOLDetails *symbolbddet;
symbolbddet = SYMBOL_BD_COBOL_GET_PRIVATE(self);
symbolbddet->completion_prefix = (gchar *) symbol_prefix;
symbolbddet->completion_string = ... | false | false | false | false | false | 0 |
sendf(const char* msg)
{
ACE_GUARD_RETURN(ACE_Thread_Mutex, Guard, outBufferLock, -1);
if (closing_)
return -1;
int msgLen = strlen(msg);
if (msgLen + outputBufferLen > RA_BUFF_SIZE)
return -1;
ACE_OS::memcpy(outputBuffer + outputBufferLen, msg, msgLen);
outputBufferLen += ms... | false | false | false | false | false | 0 |
mlx4_en_get_ringparam(struct net_device *dev,
struct ethtool_ringparam *param)
{
struct mlx4_en_priv *priv = netdev_priv(dev);
memset(param, 0, sizeof(*param));
param->rx_max_pending = MLX4_EN_MAX_RX_SIZE;
param->tx_max_pending = MLX4_EN_MAX_TX_SIZE;
param->rx_pending = priv->port_up ?
priv->rx_ring[0]->a... | false | false | false | false | false | 0 |
translate_nested_gpa(struct kvm_vcpu *vcpu, gpa_t gpa, u32 access,
struct x86_exception *exception)
{
gpa_t t_gpa;
BUG_ON(!mmu_is_nested(vcpu));
/* NPT walks are always user-walks */
access |= PFERR_USER_MASK;
t_gpa = vcpu->arch.mmu.gva_to_gpa(vcpu, gpa, access, exception);
return t_gpa;
} | false | false | false | false | false | 0 |
g_vfs_afp_connection_close_sync (GVfsAfpConnection *afp_connection,
GCancellable *cancellable,
GError **error)
{
GVfsAfpConnectionPrivate *priv = afp_connection->priv;
SyncData close_data;
/* Take lock */
g_mutex_lock (&priv->mu... | false | false | false | false | false | 0 |
no(FXint num){
register FXint old=*((FXint*)(ptr-1));
if(old!=num){
if(0<num){
if(ptr==EMPTY){
ptr=1+((FXObject**)malloc(ROUNDUP(num)*sizeof(FXObject*)+sizeof(FXObject*)));
}
else{
ptr=1+((FXObject**)realloc(ptr-1,ROUNDUP(num)*sizeof(FXObject*)+sizeof(FXObject*)));
}
... | false | false | false | false | false | 0 |
on_time_entry_key_release (GtkWidget *widget,
GdkEvent *key_event,
EDateEdit *dedit)
{
guint event_keyval = 0;
gdk_event_get_keyval (key_event, &event_keyval);
if (event_keyval == GDK_KEY_Up || event_keyval == GDK_KEY_Down) {
g_signal_stop_emission_by_name (w... | false | false | false | false | false | 0 |
Transport_CreateWrapKey(TSS_HCONTEXT tspContext, /* in */
TCS_KEY_HANDLE hWrappingKey, /* in */
TPM_ENCAUTH *KeyUsageAuth, /* in */
TPM_ENCAUTH *KeyMigrationAuth, /* in */
UINT32 keyInfoSize, /* in */
BYTE * keyInfo, /* in */
UINT32 * keyDataSize, /* out */
BYTE ** keyData, /* out */
TPM_AU... | false | false | false | false | false | 0 |
construct_packet(Ssh ssh, int pkttype, va_list ap)
{
int argtype;
Bignum bn;
struct Packet *pkt;
pkt = ssh1_pkt_init(pkttype);
while ((argtype = va_arg(ap, int)) != PKT_END) {
unsigned char *argp, argchar;
char *sargp;
unsigned long argint;
int arglen;
switch (argtype) {
/* Actual fields i... | false | false | false | false | false | 0 |
BuildLoadNamedGeneric(HValue* obj,
Property* expr) {
ASSERT(expr->key()->IsPropertyName());
Handle<Object> name = expr->key()->AsLiteral()->handle();
HValue* context = environment()->LookupContext();
return new(zone()) HLoadNamedGeneric(context, obj, name);
} | false | false | false | false | false | 0 |
crush_adjust_straw_bucket_item_weight(struct crush_bucket_straw *bucket, int item, int weight)
{
unsigned idx;
int diff;
int r;
for (idx = 0; idx < bucket->h.size; idx++)
if (bucket->h.items[idx] == item)
break;
if (idx == bucket->h.size)
return 0;
diff = weight - bucket->item_weights[idx];
bucke... | false | false | false | false | false | 0 |
brigade_peek(apr_bucket_brigade *bbIn,
char *buff, apr_size_t bufflen)
{
apr_bucket *b;
apr_size_t readbytes = 0;
if (bufflen--)
/* compensate for NULL */
*buff = '\0';
else
return APR_EGENERAL;
if (APR_BRIGADE_EMPTY(bbIn))
return AP... | false | true | false | false | false | 1 |
monitor_id_show(struct device *dev,
struct device_attribute *dev_attr, char *buf)
{
struct hv_device *hv_dev = device_to_hv_device(dev);
if (!hv_dev->channel)
return -ENODEV;
return sprintf(buf, "%d\n", hv_dev->channel->offermsg.monitorid);
} | false | false | false | false | false | 0 |
ide_tape_probe(ide_drive_t *drive)
{
idetape_tape_t *tape;
struct gendisk *g;
int minor;
ide_debug_log(IDE_DBG_FUNC, "enter");
if (!strstr(DRV_NAME, drive->driver_req))
goto failed;
if (drive->media != ide_tape)
goto failed;
if ((drive->dev_flags & IDE_DFLAG_ID_READ) &&
ide_check_atapi_device(drive,... | false | false | false | false | false | 0 |
find_token(char *token)
{
struct lexer_token *tok;
if (!ntokens)
init_ntokens();
tok = bsearch(&token, tokens, ntokens, sizeof(tokens[0]), token_compare);
return tok ? tok->value : 0;
} | false | false | false | false | false | 0 |
print_with_colorv (CutConsoleUI *console, const gchar *color,
gchar const *format, va_list args)
{
if (console->use_color) {
gchar *message;
message = g_strdup_vprintf(format, args);
g_print("%s%s%s", color, message, CUT_CONSOLE_COLOR_NORMAL);
g_free(message);
}... | false | false | false | false | false | 0 |
list_common_cmds_help(void)
{
int i, longest = 0;
for (i = 0; i < ARRAY_SIZE(common_cmds); i++) {
if (longest < strlen(common_cmds[i].name))
longest = strlen(common_cmds[i].name);
}
puts("The most commonly used git commands are:");
for (i = 0; i < ARRAY_SIZE(common_cmds); i++) {
printf(" %s ", common_... | false | false | false | false | false | 0 |
init(GtkWidget *widget)
{
if (gtk_gl_area_make_current(GTK_GL_AREA(widget))) {
GdkFont *font;
/* set viewport */
glViewport(0,0, widget->allocation.width, widget->allocation.height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0,widget->allocation.width, 0,widget->allocation.height... | false | false | false | true | false | 1 |
has_permission(permission_enum which) const
{
switch (which) {
case perm_print:
return d->doc->okToPrint();
case perm_change:
return d->doc->okToChange();
case perm_copy:
return d->doc->okToCopy();
case perm_add_notes:
return d->doc->okToAddNotes();
case perm_fill... | false | false | false | false | false | 0 |
gee_concurrent_set_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GCompareDataFunc compare_func, void* compare_func_target, GDestroyNotify compare_func_target_destroy_notify) {
GeeConcurrentSet * self = NULL;
GCompareDataFunc _tmp0_ = NULL;
void* _tmp0__target =... | false | false | false | false | false | 0 |
rtp_source_class_init (RTPSourceClass * klass)
{
GObjectClass *gobject_class;
gobject_class = (GObjectClass *) klass;
gobject_class->finalize = rtp_source_finalize;
gobject_class->set_property = rtp_source_set_property;
gobject_class->get_property = rtp_source_get_property;
g_object_class_install_proper... | false | false | false | false | false | 0 |
setContext(XML_Parser parser, const XML_Char *context)
{
DTD * const dtd = _dtd; /* save one level of indirection */
const XML_Char *s = context;
while (*context != XML_T('\0')) {
if (*s == CONTEXT_SEP || *s == XML_T('\0')) {
ENTITY *e;
if (!poolAppendChar(&tempPool, XML_T('\0')))
return... | false | false | false | false | false | 0 |
rescan_shortcut_cb (GtkMenuItem *item,
NemoPlacesSidebar *sidebar)
{
GtkTreeIter iter;
GDrive *drive;
if (!get_selected_iter (sidebar, &iter)) {
return;
}
gtk_tree_model_get (GTK_TREE_MODEL (sidebar->store), &iter,
PLACES_SIDEBAR_COLUMN_DRIVE, &drive,
-1);
if (drive != NULL) {
... | false | false | false | false | false | 0 |
ExpandResponseFile(const char *FName, StringSaver &Saver,
TokenizerCallback Tokenizer,
SmallVectorImpl<const char *> &NewArgv,
bool MarkEOLs = false) {
ErrorOr<std::unique_ptr<MemoryBuffer>> MemBufOrErr =
MemoryBuffer::... | false | false | false | false | false | 0 |
cl_thread_cleanup(cl_thread_settings_t* thread_config) {
/* free all malloc()'ed pointers in cl_thread_settings_t structure */
int ret_val;
/* on CL_RETVAL_MUTEX_CLEANUP_ERROR or CL_RETVAL_CONDITION_CLEANUP_ERROR
the struct is NOT freed !!! */
if (thread_config == NULL) {
return CL_RETVAL... | false | false | false | false | false | 0 |
bufferevent_get_options_(struct bufferevent *bev)
{
struct bufferevent_private *bev_p =
EVUTIL_UPCAST(bev, struct bufferevent_private, bev);
enum bufferevent_options options;
BEV_LOCK(bev);
options = bev_p->options;
BEV_UNLOCK(bev);
return options;
} | false | false | false | false | false | 0 |
SimplifyPHINode(PHINode *PN, const DominatorTree *DT) {
// If all of the PHI's incoming values are the same then replace the PHI node
// with the common value.
Value *CommonValue = 0;
bool HasUndefInput = false;
for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i) {
Value *Incoming = PN->getI... | false | false | false | false | false | 0 |
_releaseListener(void)
{
if (!m_pViewListener)
return;
DELETEP(m_pViewListener);
m_pViewListener = 0;
m_lid = 0;
} | false | false | false | false | false | 0 |
onListClicked(FXObject*,FXSelector sel,void* ptr){
button->handle(this,FXSEL(SEL_COMMAND,ID_UNPOST),NULL);
if(FXSELTYPE(sel)==SEL_COMMAND){
field->setText(list->getItemText((FXint)(FXival)ptr));
if(!(options&COMBOBOX_STATIC)) field->selectAll(); // Select if editable
if(target) target->tryHandl... | false | false | false | false | false | 0 |
tbm_union(TIDBitmap *a, const TIDBitmap *b)
{
Assert(!a->iterating);
/* Nothing to do if b is empty */
if (b->nentries == 0)
return;
/* Scan through chunks and pages in b, merge into a */
if (b->status == TBM_ONE_PAGE)
tbm_union_page(a, &b->entry1);
else
{
HASH_SEQ_STATUS status;
PagetableEntry *bpage;
... | false | false | false | false | false | 0 |
impFileIsExpImp(
IF_FileHdl * pFileHdl,
FLMBOOL * pbFileIsBinaryRV)
{
RCODE rc = FERR_OK;
FLMUINT64 ui64CurrPos;
FLMBYTE byHeader[ BINARY_GED_HEADER_LEN];
FLMUINT uiBytesRead;
*pbFileIsBinaryRV = FALSE;
// Save current position so we can return to it.
if (RC_BAD( rc = pFileHdl->seek( 0, FLM_IO_SEEK... | false | false | false | false | false | 0 |
iwl_set_hw_rfkill_state(struct iwl_op_mode *op_mode, bool state)
{
struct iwl_priv *priv = IWL_OP_MODE_GET_DVM(op_mode);
if (state)
set_bit(STATUS_RF_KILL_HW, &priv->status);
else
clear_bit(STATUS_RF_KILL_HW, &priv->status);
wiphy_rfkill_set_hw_state(priv->hw->wiphy, state);
return false;
} | false | false | false | false | false | 0 |
msn_buddy_allow_response(MsnAccount *ma, int error, void *cbdata)
{
/* TODO Check for validity of response */
char *url = strdup("https://contacts.msn.com/abservice/abservice.asmx");
char *soap_action =
"http://www.msn.com/webservices/AddressBook/ABContactAdd";
MsnBuddy *bud = cbdata;
char passport_tag[512];
... | false | false | false | false | false | 0 |
cq_periodic_trampoline(cqueue_t *cq, void *data)
{
cperiodic_t *cp = data;
bool reschedule;
cqueue_check(cq);
cperiodic_check(cp);
cp->ev = NULL;
/*
* As long as the periodic event returns TRUE, keep scheduling it.
*
* To handle synchronous calls to cq_periodic_remove(), freeing of the
* periodic event... | false | false | false | false | false | 0 |
dm_config_get_uint64(const struct dm_config_node *cn, const char *path,
uint64_t *result)
{
const struct dm_config_node *n;
n = _find_config_node(cn, path);
if (!n || !n->v || n->v->type != DM_CFG_INT)
return 0;
if (result)
*result = (uint64_t) n->v->v.i;
return 1;
} | false | false | false | false | false | 0 |
wakeup_graph_entry(struct ftrace_graph_ent *trace)
{
struct trace_array *tr = wakeup_trace;
struct trace_array_cpu *data;
unsigned long flags;
int pc, ret = 0;
if (!func_prolog_preempt_disable(tr, &data, &pc))
return 0;
local_save_flags(flags);
ret = __trace_graph_entry(tr, trace, flags, pc);
atomic_dec(&da... | false | false | false | false | false | 0 |
Remove(Address code_address) {
HashMap::Entry* entry = FindEntry(code_address);
if (entry != NULL) {
DeleteArray(static_cast<char*>(entry->value));
RemoveEntry(entry);
}
} | false | false | false | false | false | 0 |
p_radio_flip_both_callback(GtkWidget *widget, GapStbPropWidget *pw)
{
if(GTK_TOGGLE_BUTTON (widget)->active)
{
p_radio_flip_update(pw, GAP_STB_FLIP_BOTH);
}
} | false | false | false | false | false | 0 |
connection_destroy(DBusConnection *conn, void *user_data)
{
struct network_conn *nc = user_data;
if (nc->state == CONNECTED) {
bnep_if_down(nc->dev);
bnep_kill_connection(&nc->peer->dst);
} else if (nc->io)
cancel_connection(nc, NULL);
} | false | false | false | false | false | 0 |
gvrender_ptf_A(GVJ_t * job, pointf * af, pointf * AF, int n)
{
int i;
double t;
pointf translation, scale;
translation = job->translation;
scale.x = job->zoom * job->devscale.x;
scale.y = job->zoom * job->devscale.y;
if (job->rotation) {
for (i = 0; i < n; i++) {
t = -(af[i].y + tran... | false | false | false | false | false | 0 |
connection_mark_all_noncontrol_connections(void)
{
SMARTLIST_FOREACH_BEGIN(get_connection_array(), connection_t *, conn) {
if (conn->marked_for_close)
continue;
switch (conn->type) {
case CONN_TYPE_CPUWORKER:
case CONN_TYPE_CONTROL_LISTENER:
case CONN_TYPE_CONTROL:
break;
... | false | false | false | false | false | 0 |
svq1_decode_block_intra (GetBitContext *bitbuf, uint8_t *pixels, int pitch ) {
uint32_t bit_cache;
uint8_t *list[63];
uint32_t *dst;
const uint32_t *codebook;
int entries[6];
int i, j, m, n;
int mean, stages;
unsigned x, y, width, height, level;
uint32_t n1, n2, n... | false | false | false | false | false | 0 |
atom_getfloatarg(int which, int argc, t_atom *argv)
{
if (argc <= which) return (0);
argv += which;
if (argv->a_type == A_FLOAT) return (argv->a_w.w_float);
else return (0);
} | false | false | false | false | false | 0 |
reopen (res_state statp, int *terrno, int ns)
{
if (EXT(statp).nssocks[ns] == -1) {
struct sockaddr *nsap
= (struct sockaddr *) EXT(statp).nsaddrs[ns];
socklen_t slen;
/* only try IPv6 if IPv6 NS and if not failed before */
if (nsap->sa_family == AF_INET6 && !statp->ipv6_unavail) {
#ifdef SOCK_NONBLOCK
... | false | false | false | false | false | 0 |
li_allocate(void *ptr, size_t count, size_t size) {
if (ptr)
ptr = realloc(ptr, count*size);
else
ptr = calloc(count, size);
if (!ptr)
li_error("out of memory", li_null);
return ptr;
} | false | false | false | false | true | 1 |
gst_mpeg2dec_close (GstVideoDecoder * decoder)
{
GstMpeg2dec *mpeg2dec = GST_MPEG2DEC (decoder);
if (mpeg2dec->decoder) {
mpeg2_close (mpeg2dec->decoder);
mpeg2dec->decoder = NULL;
mpeg2dec->info = NULL;
}
gst_mpeg2dec_clear_buffers (mpeg2dec);
return TRUE;
} | false | false | false | false | false | 0 |
gm_world_text_view_update_tags(GmWorldTextView *view) {
gint i;
for (i = 0; i < (int)(sizeof(ansi_colors) / sizeof(ansinamepair)); i++) {
gm_world_text_view_update_color_tag(view, ansi_colors[i].name, NULL);
}
/*
tag = gtk_text_tag_table_lookup(gtk_text_buffer_get_tag_table(
GM_WORLD_TEXT_VIEW_BUFFER(view)... | false | false | false | false | false | 0 |
verify_node_count(const char *arg, int *min_nodes, int *max_nodes)
{
char *ptr, *min_str, *max_str;
char *leftover;
/* Does the string contain a "-" character? If so, treat as a range.
* otherwise treat as an absolute node count. */
if ((ptr = index(arg, '-')) != NULL) {
min_str = xstrndup(arg, ptr-arg);
*m... | false | false | false | false | false | 0 |
gathershadings(int page, pdf_obj *pageref, pdf_obj *pageobj, pdf_obj *dict)
{
int i, n;
n = pdf_dict_len(dict);
for (i = 0; i < n; i++)
{
pdf_obj *shade;
pdf_obj *type;
int k;
shade = pdf_dict_get_val(dict, i);
if (!pdf_is_dict(shade))
{
fz_warn(ctx, "not a shading dict (%d %d R)", pdf_to_num(shade... | false | false | false | false | false | 0 |
zend_find_alias_name(zend_class_entry *ce, const char *name, zend_uint len) /* {{{ */
{
zend_trait_alias *alias, **alias_ptr;
alias_ptr = ce->trait_aliases;
alias = *alias_ptr;
while (alias) {
if (alias->alias_len == len &&
!strncasecmp(name, alias->alias, alias->alias_len)) {
return alias->alias;
}
... | false | false | false | false | false | 0 |
markChange(int pos)
{
if (pos < m_changePos) {
m_backs += getSeqSteps(pos, m_changePos-1);
m_changePos = pos;
}
} | false | false | false | false | false | 0 |
ntfs_mkfs(cdico *d, char *partition, char *fsoptions)
{
char command[2048];
char buffer[2048];
char options[2048];
int exitst;
u64 temp64;
u32 temp32;
u16 temp16;
// there is no option that just displays the version and return 0 in mkfs.ntfs
if (exec_command(command, sizeof(comm... | true | true | false | false | false | 1 |
ParseUnixCommandLine(FILE *in, int acmax, char **av)
{
register int c;
register char *p = commandline;
register int n = 1;
char *limit = p + MAX_PARAM_CHAR;
limit[1] = 0;
av[1] = p;
*p = 0;
do c = fgetc(in); while(MagickIsBlank(c));
while (c != EOF)
{
switch (c)
... | false | true | false | false | true | 1 |
visu_surfaces_createFromScalarField(VisuSurfaces **surf,
VisuScalarField *field,
double isoValue, int id,
const gchar *name)
{
/* Local variables*/
gboolean status;
/* Routine code*... | false | false | false | false | false | 0 |
change_listen_mode(int new_mode)
{
log1("Entering listen mode: %s",
new_mode != LISTEN_NONE
? (new_mode == LISTEN_KERNEL ? "kernel" : "raw")
: "none"
);
listen_mode = new_mode;
if (sockfd >= 0) {
close(sockfd);
sockfd = -1;
}
if (new_mode == LISTEN_KERNEL)
sockfd = udhcp_listen_socket(/*INADDR_ANY,... | false | false | false | false | false | 0 |
gf_term_play_from_time(GF_Terminal *term, u64 from_time, u32 pause_at_first_frame)
{
if (!term || !term->root_scene || !term->root_scene->root_od) return 0;
if (term->root_scene->root_od->flags & GF_ODM_NO_TIME_CTRL) return 1;
if (pause_at_first_frame==2) {
if (gf_term_get_option(term, GF_OPT_PLAY_STATE) != GF_ST... | false | false | false | false | false | 0 |
AlterTable(AlterTableStmt *stmt)
{
Relation rel;
LOCKMODE lockmode = AlterTableGetLockLevel(stmt->cmds);
/*
* Acquire same level of lock as already acquired during parsing.
*/
rel = relation_openrv(stmt->relation, lockmode);
CheckTableNotInUse(rel, "ALTER TABLE");
/* Check relation type against typ... | false | false | false | false | false | 0 |
gfire_clan_get_name(const gfire_clan *p_clan)
{
if(!p_clan)
return NULL;
if(p_clan->short_name)
return g_strdup_printf("%s [%s]", p_clan->long_name, p_clan->short_name);
else
return g_strdup(p_clan->long_name);
} | false | false | false | false | false | 0 |
_deleteFmtMarkWithNotify(PT_DocPosition dpos, pf_Frag_FmtMark * pffm,
pf_Frag_Strux * pfs,
pf_Frag ** ppfEnd, UT_uint32 * pfragOffsetEnd)
{
UT_return_val_if_fail (m_pts==PTS_Editing,false);
UT_return_val_if_fail (pfs,false);
PT_BlockOffset blockOffset = _computeBlockOffset(pfs,pffm);
PX_Ch... | false | false | false | false | false | 0 |
strnrchr(const char * stop, char c, unsigned int size)
{
const char * i = stop + size - 1;
--stop;
while (i != stop) {
if (*i == c)
return i;
--i;
}
return 0;
} | false | false | false | false | false | 0 |
SearchCollection(default_collection_t *collection, char *name)
{
int i;
for (i=0; i<collection->numdefaults; ++i)
{
if (!strcmp(name, collection->defaults[i].name))
{
return &collection->defaults[i];
}
}
return NULL;
} | false | false | false | false | false | 0 |
etpan_mailbox_write(FILE * f, int * col,
struct mailimf_mailbox * mb)
{
int r;
if (* col > 1) {
if (* col + strlen(mb->mb_addr_spec) >= MAX_MAIL_COL) {
r = mailimf_string_write(f, col, "\r\n ", 3);
if (r != MAILIMF_NO_ERROR)
return ERROR_FILE;
* col = 1;
}
}
if (mb->mb_di... | false | false | false | false | false | 0 |
isl_compute_flow_schedule_data_clear(
struct isl_compute_flow_schedule_data *data)
{
int i;
for (i = 0; i < data->n_sink; ++i) {
isl_map_free(data->sink[i].access);
isl_schedule_node_free(data->sink[i].node);
}
for (i = 0; i < data->n_source; ++i) {
isl_map_free(data->source[i].access);
isl_schedule_node... | false | false | false | false | true | 1 |
FormatStr(std::ostream &os, const char *name, const std::string &str)
{
ios_format_state state(os);
if( str.size() ) {
os << " " << setw(20) << name;
os << ": " << str << "\n";
}
} | false | false | false | false | false | 0 |
rv6xx_set_sw_voltage_to_low(struct radeon_device *rdev,
struct radeon_ps *old_ps)
{
struct rv6xx_ps *old_state = rv6xx_get_ps(old_ps);
rv6xx_program_voltage_stepping_entry(rdev, R600_POWER_LEVEL_CTXSW,
old_state->low.vddc);
WREG32_P(GENERAL_PWRMGT, SW_GPIO_INDEX(R600_POWER_LEVEL_CTXSW),
~SW_GPIO_I... | false | false | false | false | false | 0 |
__add_alarm(struct alarm_block *alarm)
{
struct rb_node **new = &(alarm_root.rb_node);
struct rb_node *parent = NULL;
while (*new) {
struct alarm_block *this;
this = container_of(*new, struct alarm_block, node);
parent = *new;
if (timercmp(&alarm->tv, &this->tv, <))
new = &((*new)->rb_left);
else
... | false | false | false | false | false | 0 |
get_exons(GtArray *exon_ranges, const void *sa)
{
GtSSplicedAlignment *alignment = *(GtSSplicedAlignment**) sa;
GtRange exon;
unsigned long i;
gt_assert(alignment);
for (i = 0; i < gt_sspliced_alignment_num_of_exons(alignment); i++) {
exon = gt_sspliced_alignment_get_exon(alignment, i);
gt_array_add(e... | false | false | false | false | false | 0 |
book_view_objects_removed_cb (EBookClientView *client_view,
const GSList *slist,
EBookView *book_view)
{
GList *list = NULL;
/* XXX Never use GSList in a public API. */
for (; slist != NULL; slist = g_slist_next (slist))
list = g_list_prepend (list, slis... | false | false | false | false | false | 0 |
affix_data_type (const char *param)
{
char *const type_or_decl = ASTRDUP (param);
char *p = type_or_decl;
char *qualifiers_then_data_type;
char saved;
/* Skip as many leading const's or volatile's as there are. */
for (;;)
{
if (!strncmp (p, "volatile ", 9))
{
p += 9;
continue;
}
... | false | false | false | false | false | 0 |
memory_set_bankhandler_r(int bank, offs_t offset, mem_read_handler handler)
{
/* determine the new offset */
if (HANDLER_IS_RAM(handler) || HANDLER_IS_ROM(handler))
rmemhandler8[bank].offset = 0 - offset, handler = (mem_read_handler)STATIC_RAM;
else if (HANDLER_IS_BANK(handler))
rmemhandler8[bank].offset =... | false | false | false | false | false | 0 |
_cdb_make_write(struct cdb_make *cdbmp, const unsigned char *ptr, unsigned len)
{
unsigned l = sizeof(cdbmp->cdb_buf) - (cdbmp->cdb_bpos - cdbmp->cdb_buf);
cdbmp->cdb_dpos += len;
if (len > l) {
memcpy(cdbmp->cdb_bpos, ptr, l);
cdbmp->cdb_bpos += l;
if (_cdb_make_flush(cdbmp) < 0)
return -1;
... | false | false | false | false | false | 0 |
K054157_reset_tilemaps(void)
{
int i;
// To avoid crashes in K054157_reset_linescroll()
for(i=0; i<4; i++)
K054157_tilemap[i] = K054157_tilemaps[i];
for(i=0; i<4; i++)
K054157_change_tilemap(i);
} | false | false | false | false | false | 0 |
modssl_dispatch_ocsp_request(const apr_uri_t *uri,
apr_interval_time_t timeout,
OCSP_REQUEST *request,
conn_rec *c, apr_pool_t *p)
{
OCSP_RESPONSE *response = NULL;
apr_socket_t *s... | false | false | false | false | false | 0 |
FactPNConstant2(
void *theEnv,
void *theValue,
DATA_OBJECT_PTR returnValue)
{
#if MAC_MCW || IBM_MCW || MAC_XCD
#pragma unused(returnValue)
#endif
struct factConstantPN2Call *hack;
struct field *fieldPtr;
struct expr *theConstant;
struct multifield *segmentPtr;
/*================================... | false | false | false | false | false | 0 |
free() {
if (isAllocated()) {
unsigned long pixel = m_pixel;
Display *disp = App::instance()->display();
XFreeColors(disp, DefaultColormap(disp, m_screen), &pixel, 1, 0);
setPixel(0);
setRGB(0, 0, 0);
setAllocated(false);
}
} | false | false | false | false | false | 0 |
getMean(CPose2D &est) const
{
est = CPose2D(0,0,0);
CPose2D p;
size_t i,n = m_particles.size();
double phi,w,W=0;
double W_phi_R=0,W_phi_L=0;
double phi_R=0,phi_L=0;
if (!n) return;
// First: XY
// -----------------------------------
for (i=0;i<n;i++)
{
p = m_particles[i].d->pose;
w = ex... | false | false | false | false | false | 0 |
write_output ()
{
STRINGDEF *next_string;
U_CHAR *cur_buf_loc;
int line_directive_len = 80;
char *line_directive = xmalloc (line_directive_len);
int len;
/* In each run through the loop, either cur_buf_loc ==
next_string_loc, in which case we print a series of strings, or
it is less than next_str... | false | true | false | false | true | 1 |
o_printstring(FUNC UNUSED *fp, long index)
{
STRING *s;
char *cp;
s = findstring(index);
cp = s->s_str;
math_str(cp);
if (conf->traceflags & TRACE_OPCODES)
printf("\n");
math_flush();
} | false | false | false | false | false | 0 |
GetComponents(Interactor** c, int nc, Interactor**& a, int& n) {
register BoxElement* e;
register Interactor** ap;
n = nelements;
a = (n <= nc) ? c : new Interactor*[n];
ap = a;
for (e = head; e != nil; e = e->next) {
*ap++ = e->child;
}
} | false | false | false | false | false | 0 |
createTemplate()
{
if (m_CurrentDrugModel->rowCount() == 0)
return false;
// get the template content
QString content = drugsIo().prescriptionToXml(m_CurrentDrugModel, "");
// create a new template with it
Templates::TemplatesCreationDialog dlg(this);
dlg.setTemplateContent(content);
... | false | false | false | false | false | 0 |
gmm_free(Recog *recog)
{
if (recog->gc) {
free(recog->gc->OP_calced_score);
free(recog->gc->OP_calced_id);
free(recog->gc->is_voice);
#ifdef GMM_VAD
free(recog->gc->rates);
#endif
free(recog->gc->gmm_score);
free(recog->gc);
recog->gc = NULL;
}
} | false | false | false | false | false | 0 |
alloc_l2_table_index(struct mlx5_l2_table *l2_table, u32 *ix)
{
int err = 0;
*ix = find_first_zero_bit(l2_table->bitmap, l2_table->size);
if (*ix >= l2_table->size)
err = -ENOSPC;
else
__set_bit(*ix, l2_table->bitmap);
return err;
} | false | false | false | false | false | 0 |
input( const Trigger &trigger, const bool &isDown)
{
XTRACE();
Trigger t = trigger;
if( isDown)
{
switch( trigger.type)
{
case eKeyTrigger:
switch( trigger.data1)
{
case SDLK_ESCAPE:
case SDLK_RETURN:
turnOff();
break;
case SDLK_DELETE:
case SDLK_B... | false | false | false | false | false | 0 |
option_set_command(int argc, const char *argv[])
{
if (argc != 3) {
config_msg = "Wrong number of arguments given to set command";
return ERR;
}
if (strcmp(argv[1], "=")) {
config_msg = "No value assigned";
return ERR;
}
if (!strcmp(argv[0], "show-author"))
return parse_enum(&opt_author, argv[2], autho... | false | false | false | false | false | 0 |
hub_plugins_load(struct hub_info* hub)
{
if (!hub->config->file_plugins || !*hub->config->file_plugins)
return 0;
hub->plugins = hub_malloc_zero(sizeof(struct uhub_plugins));
if (!hub->plugins)
return -1;
if (plugin_initialize(hub->config, hub) < 0)
{
hub_free(hub->plugins);
hub->plugins = 0;
return -1... | false | false | false | false | false | 0 |
evmap_signal_active(struct event_base *base, int sig, int ncalls)
{
struct event_signal_map *map = &base->sigmap;
struct evmap_signal *ctx;
struct event *ev;
EVUTIL_ASSERT(sig < map->nentries);
GET_SIGNAL_SLOT(ctx, map, sig, evmap_signal);
TAILQ_FOREACH(ev, &ctx->events, ev_signal_next)
event_active_nolock(ev... | false | false | false | false | false | 0 |
number(double x)
{
QString tmp=QString::number(x, 'f', CUSTOM_DOUBLE_PRECISION);
//remove trailing zeroes AFTER decimal points
if(tmp.contains('.')){
int n=tmp.length()-1;
int del=0;
while(tmp.at(n)=='0'){
n--;
del++;
}
if(tmp.at(n)=='.'){
n--;
del++;
}
tmp.chop(del);
}
return tmp;
} | false | false | false | false | false | 0 |
_assuan_bytetohex (int nr, char *str)
{
static char hexdigits[] = "0123456789abcdef";
int i;
#define NROFHEXDIGITS 2
for (i = 0; i < NROFHEXDIGITS; i++)
{
int digit = (nr >> (i << 2)) & 0xf;
*(str++) = hexdigits[digit];
}
return str;
} | false | false | false | false | false | 0 |
sound_create(
snd_susp_type susp,
time_type t0,
rate_type sr,
promoted_sample_type scale)
{
sound_type sound;
falloc_sound(sound, "sound_create");
if (((long) sound) & 3) errputstr("sound not word aligned\n");
last_sound = sound; /* debug */
if (t0 < 0) xlerror("attempt to create a sound wit... | false | false | false | false | false | 0 |
xl_xml_style_start (GsfXMLIn *xin, xmlChar const **attrs)
{
ExcelXMLReadState *state = (ExcelXMLReadState *)xin->user_state;
char const *id = NULL;
for (; attrs != NULL && attrs[0] && attrs[1] ; attrs += 2)
if (gsf_xml_in_namecmp (xin, attrs[0], XL_NS_SS, "ID"))
id = attrs[1];
else if (gsf_xml_in_namecmp (xin... | false | false | false | false | false | 0 |
needsQuotes(const std::string& s) {
if (! isLetter(s[0]) && (s[0] != '_')) {
return true;
}
for (int i = 0; i < (int)s.length(); ++i) {
char c = s[i];
// peek character
char p = (i == (int)s.length() - 1) ? '_' : s[i + 1];
// Identify separators
if ... | false | false | false | false | false | 0 |
rtl2832_read_status(struct dvb_frontend *fe, enum fe_status *status)
{
struct rtl2832_dev *dev = fe->demodulator_priv;
struct i2c_client *client = dev->client;
int ret;
u32 uninitialized_var(tmp);
dev_dbg(&client->dev, "\n");
*status = 0;
if (dev->sleeping)
return 0;
ret = rtl2832_rd_demod_reg(dev, DVBT_FS... | false | false | false | false | false | 0 |
idset_count(IDSET *idset)
{
unsigned int id, count = 0;
for (id = idset_first(idset); id != END_OF_ID; id = idset_next(idset))
count++;
return count;
} | 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.