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 |
|---|---|---|---|---|---|---|
Perl_sys_init3(int* argc, char*** argv, char*** env)
{
dVAR;
PERL_ARGS_ASSERT_SYS_INIT3;
PERL_UNUSED_ARG(argc); /* may not be used depending on _BODY macro */
PERL_UNUSED_ARG(argv);
PERL_UNUSED_ARG(env);
PERL_SYS_INIT3_BODY(argc, argv, env);
} | false | false | false | false | false | 0 |
ixgbe_alloc_mapped_page(struct ixgbe_ring *rx_ring,
struct ixgbe_rx_buffer *bi)
{
struct page *page = bi->page;
dma_addr_t dma;
/* since we are recycling buffers we should seldom need to alloc */
if (likely(page))
return true;
/* alloc new page for storage */
page = dev_alloc_pages(ixgbe_rx_pg_order(r... | false | false | false | false | false | 0 |
seahorse_context_new (guint flags)
{
SeahorseContext *sctx = g_object_new (SEAHORSE_TYPE_CONTEXT, NULL);
if (flags & SEAHORSE_CONTEXT_DAEMON)
sctx->is_daemon = TRUE;
if (flags & SEAHORSE_CONTEXT_APP) {
if (app_context)
g_object_unref (app_context);
g_object_ref (sctx);
g_object_... | false | false | false | false | false | 0 |
toggleColumn( bool toggled )
{
int index = d->columnActions.indexOf( qobject_cast< QAction* >( sender() ) );
if( index != -1 )
{
if( toggled )
d->fileView->showColumn( index );
else
d->fileView->hideColumn( index );
}
} | false | false | false | false | false | 0 |
clutter_list_model_insert_row (ClutterModel *model,
gint index_)
{
ClutterListModel *model_default = CLUTTER_LIST_MODEL (model);
GSequence *sequence = model_default->priv->sequence;
ClutterListModelIter *retval;
guint n_columns, i, pos;
GValue *values;
GSequenceIter *... | false | false | false | false | false | 0 |
BuildTree(const char* input_buffer,
const char* input_buffer_end) {
set_state(TS_EMPTY);
parse_state_.bufstart = input_buffer;
parse_state_.bufend = input_buffer_end;
parse_state_.phase = ParseState::GETTING_TEXT;
parse_state_.current_delimiters = Template::MarkerDelimiters();
// As... | false | false | false | false | false | 0 |
e_color_dialog_new(E_Container *con, const E_Color *color, Eina_Bool alpha_enabled)
{
E_Color_Dialog *dia;
Evas_Object *o;
Evas_Coord mw, mh;
dia = E_OBJECT_ALLOC(E_Color_Dialog, E_COLOR_DIALOG_TYPE, _e_color_dialog_free);
if (!dia) return NULL;
dia->dia = e_dialog_new(con, "E", "_color_dialog");
... | false | false | false | false | false | 0 |
fm_dir_tree_view_dispose(GObject *object)
{
FmDirTreeView *view;
g_return_if_fail(object != NULL);
g_return_if_fail(FM_IS_DIR_TREE_VIEW(object));
view = (FmDirTreeView*)object;
if(G_UNLIKELY(view->paths_to_expand))
{
GtkTreeModel* model = gtk_tree_view_get_model(GTK_TREE_VIEW(view));
... | false | false | false | false | false | 0 |
__midgard_view_derived_add_fields_to_select_statement (MidgardDBObjectClass *klass, MidgardConnection *mgd, GdaSqlStatementSelect *select, const gchar *table_name)
{
guint n_prop;
guint i;
GdaSqlSelectField *select_field;
GdaSqlExpr *expr;
GValue *val;
gchar *table_field;
GdaConnection *cnc = mgd->priv->connecti... | false | false | false | false | false | 0 |
object_head(string bucket,string path,const s3headers *extra_headers)
{
return request("HEAD",bucket + "/" + path,"",0,0,0,extra_headers);
} | false | false | false | false | false | 0 |
parseCommentDecl()
{
if (startMarkup(inInstance()
? eventsWanted().wantCommentDecls()
: eventsWanted().wantPrologMarkup(),
currentLocation()))
currentMarkup()->addDelim(Syntax::dMDO);
if (!parseComment(comMode))
return 0;
for (;;) {
Token token = getToken(mdMode);
switch (token) {
... | false | false | false | false | false | 0 |
recv_pma_get_portcounters_ext(struct ib_pma_mad *pmp,
struct ib_device *ibdev, u8 port)
{
struct ib_pma_portcounters_ext *p =
(struct ib_pma_portcounters_ext *)pmp->data;
struct ipath_ibdev *dev = to_idev(ibdev);
u64 swords, rwords, spkts, rpkts, xwait;
u8 port_select = p->port_select;
ipath_snapshot_coun... | false | false | false | false | false | 0 |
mo_set(struct Client *client_p, struct Client *source_p,
int parc, char *parv[])
{
int n;
int newval;
const char *arg = NULL;
const char *intarg = NULL;
const struct SetStruct *tab = set_cmd_table;
if (parc > 1)
{
/*
* Go through all the commands in set_cmd_table, until one is
* m... | false | false | true | false | true | 1 |
bin_handle_async_start (GstBin * bin, gboolean new_base_time)
{
GstState old_state, new_state;
gboolean toplevel;
GstMessage *amessage = NULL;
if (GST_STATE_RETURN (bin) == GST_STATE_CHANGE_FAILURE)
goto had_error;
/* get our toplevel state */
toplevel = BIN_IS_TOPLEVEL (bin);
/* prepare an ASYNC_S... | false | false | false | false | false | 0 |
convertDirectLUT(int *imDepth, uchar **outbuf, uchar CLUT[][256])
{
uchar *p, *q, *end;
dbgprintf("Applying CLUT directly to internal 8 bit buffer\n");
if (imspp == 1) {
dbgprintf("Expected number of samples: 1\n");
*imDepth = 3;
*outbuf = new uchar[3*(long)currImgWidth*(long)currIm... | false | false | false | false | false | 0 |
free_KRB_ERROR(KRB_ERROR *data)
{
free_krb5int32(&(data)->pvno);
free_MESSAGE_TYPE(&(data)->msg_type);
if((data)->ctime) {
free_KerberosTime((data)->ctime);
free((data)->ctime);
(data)->ctime = NULL;
}
if((data)->cusec) {
free_krb5int32((data)->cusec);
free((data)->cusec);
(data)->cusec = NULL;
}
free_KerberosTime(&(da... | false | false | false | false | false | 0 |
skl_ddb_entry_write(struct drm_i915_private *dev_priv, uint32_t reg,
const struct skl_ddb_entry *entry)
{
if (entry->end)
I915_WRITE(reg, (entry->end - 1) << 16 | entry->start);
else
I915_WRITE(reg, 0);
} | false | false | false | false | false | 0 |
setPose( const mrpt::math::TPose3D &o )
{
m_pose = mrpt::poses::CPose3D(o);
return *this;
} | false | false | false | false | false | 0 |
_cb_files_files_deleted(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
E_Config_Dialog_Data *cfdata;
Eina_List *sel, *all, *n;
E_Fm2_Icon_Info *ici, *ic;
cfdata = data;
if ((!cfdata->theme) || (!cfdata->o_fm)) return;
if (!(all = e_widget_flist_all_list_get(cfdata->o_fm))) r... | false | false | false | false | false | 0 |
video_push_border_special()
{
Kimage *kimage_ptr;
int width, height;
int src_x, src_y;
int dest_x, dest_y;
kimage_ptr = &g_kimage_border_special;
width = g_video_act_width;
g_refresh_bytes_xfer += width * (BASE_MARGIN_TOP + BASE_MARGIN_BOTTOM);
// First do bottom border: dest_x from 0 to 640+MARGIN_LEFT+MARGI... | false | false | false | false | false | 0 |
play_and_wait(struct ast_channel *chan, char *file, char *digits)
{
int res = -1;
if (!ast_streamfile(chan, file, ast_channel_language(chan))) {
res = ast_waitstream(chan, digits);
}
return res;
} | false | false | false | false | false | 0 |
secondary_pixbuf_toggled (GtkWidget *widget,
GladeEntryEditor *entry_editor)
{
if (entry_editor->loading || !entry_editor->loaded_widget)
return;
if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (entry_editor->secondary_pixbuf_radio)))
return;
entry_editor->modifying = TRUE;
glade_command_push_... | false | false | false | false | false | 0 |
cancelReplicationHandshake(void) {
if (server.repl_state == REDIS_REPL_TRANSFER) {
replicationAbortSyncTransfer();
} else if (server.repl_state == REDIS_REPL_CONNECTING ||
slaveIsInHandshakeState())
{
undoConnectWithMaster();
} else {
return 0;
}
return 1;
... | false | false | false | false | false | 0 |
mwifiex_remove_card(struct mwifiex_adapter *adapter, struct semaphore *sem)
{
struct mwifiex_private *priv = NULL;
int i;
if (down_interruptible(sem))
goto exit_sem_err;
if (!adapter)
goto exit_remove;
/* We can no longer handle interrupts once we start doing the teardown
* below. */
if (adapter->if_ops.... | false | false | false | false | true | 1 |
luaA_indexAcceptable (lua_State *L, int idx) {
if (idx > 0) {
TObject *o = L->base+(idx-1);
api_check(L, idx <= L->stack_last - L->base);
if (o >= L->top) return NULL;
else return o;
}
else
return negindex(L, idx);
} | false | false | false | false | false | 0 |
cache_set(struct cache *c, const char *key, void *value)
{
pthread_rwlock_wrlock(&c->lock);
struct entry *e = entry_for_key(c, key);
if (e->in_use == IN_USE)
free(e->key);
e->in_use = IN_USE;
e->key = strdup(key);
e->value = value;
pthread_rwlock_unlock(&c->lock);
return true;
} | false | false | false | false | false | 0 |
helpGame()
{
if (m_dealer && m_dealer_map.contains(m_dealer->gameId()))
{
const DealerInfo * di = m_dealer_map.value(m_dealer->gameId());
QString anchor = QString::fromUtf8( di->untranslatedBaseName() );
anchor = anchor.toLower();
anchor = anchor.remove('\'').replace('&', "and").... | false | false | false | false | false | 0 |
Snumval(symb)
truc symb;
{
truc obj;
char *str;
unsigned len;
int argn, count, tok;
obj = eval(ARG1PTR(evalStkPtr));
if(Tflag(obj) != fSTRING) {
error(symb,err_str,obj);
return(brkerr());
}
len = STRlen(obj);
if(len >= strbufSize-3) {
error(symb,err_2long,mkf... | false | false | false | false | false | 0 |
lookup_app(int id) {
for (int i=0; i<napps; i++) {
if (apps[i].id == id) return &apps[i];
}
return NULL;
} | false | false | false | false | false | 0 |
applySubtable(const LookupSubtable *lookupSubtable, le_uint16 lookupType,
GlyphIterator *glyphIterator,
const LEFontInstance *fontInstance,
LEErrorCode& su... | false | false | false | false | false | 0 |
array_slice(arrayobject *a, Py_ssize_t ilow, Py_ssize_t ihigh)
{
arrayobject *np;
if (ilow < 0)
ilow = 0;
else if (ilow > Py_SIZE(a))
ilow = Py_SIZE(a);
if (ihigh < 0)
ihigh = 0;
if (ihigh < ilow)
ihigh = ilow;
else if (ihigh > Py_SIZE(a))
ihigh = Py_SIZE(... | false | false | false | false | false | 0 |
config_setting_remove(config_setting_t *parent, const char *name)
{
unsigned int idx;
config_setting_t *setting;
if(! parent)
return(CONFIG_FALSE);
if(parent->type != CONFIG_TYPE_GROUP)
return(CONFIG_FALSE);
if(! (setting = __config_list_search(parent->value.list, name, &idx)))
return(CONFIG_FA... | false | false | false | false | false | 0 |
gda_sql_statement_trans_copy (gpointer src)
{
GdaSqlStatementTransaction *dest;
GdaSqlStatementTransaction *trans = (GdaSqlStatementTransaction *) src;
dest = g_new0 (GdaSqlStatementTransaction, 1);
if (trans->trans_mode)
dest->trans_mode = g_strdup (trans->trans_mode);
if (trans->trans_name)
dest->trans_name... | false | false | false | false | false | 0 |
instrument_edges (el)
struct edge_list *el;
{
int num_instr_edges = 0;
int num_edges = NUM_EDGES (el);
basic_block bb;
remove_fake_edges ();
FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR, NULL, next_bb)
{
edge e = bb->succ;
while (e)
{
struct edge_info *inf = EDGE_INFO (e);
if (!inf->ignore... | false | false | false | false | false | 0 |
Java_ncsa_hdf_hdf5lib_H5_H5Sencode
(JNIEnv *env, jclass cls, jint obj_id)
{
herr_t status = -1;
unsigned char *bufPtr;
size_t buf_size = 0;
jbyteArray returnedArray = NULL;
if (obj_id < 0) {
h5badArgument(env, "H5Sencode: invalid argument");
ret... | false | false | false | false | false | 0 |
writeString(const std::string §ion,const std::string &name, const std::string &str, const int name_padding_width, const int value_padding_width, const std::string &comment)
{
if (name_padding_width<1 && value_padding_width<1 && comment.empty())
this->writeString(section,name,str); // Default (old) behavior.
s... | false | false | false | false | false | 0 |
DoDeferredStackCheck(LStackCheck* instr) {
PushSafepointRegistersScope scope(this);
__ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset));
__ CallRuntimeSaveDoubles(Runtime::kStackGuard);
RecordSafepointWithLazyDeopt(instr, RECORD_SAFEPOINT_WITH_REGISTERS, 0);
ASSERT(instr->HasEnvironment());
L... | false | false | false | false | false | 0 |
Perl_reg_numbered_buff_length(pTHX_ REGEXP * const r, const SV * const sv,
const I32 paren)
{
struct regexp *const rx = ReANY(r);
I32 i;
I32 s1, t1;
PERL_ARGS_ASSERT_REG_NUMBERED_BUFF_LENGTH;
if ( paren == RX_BUFF_IDX_CARET_PREMATCH
|| paren == RX_BUFF_IDX_C... | false | false | false | false | false | 0 |
get_param_str(char *buffer, const struct kernel_param *kp)
{
action_fn fn = (action_fn) kp->arg;
int rv;
rv = fn(NULL, buffer);
if (rv)
return rv;
return strlen(buffer);
} | false | false | false | false | false | 0 |
mx_image_cancel_in_progress (MxImage *image)
{
MxImagePrivate *priv = image->priv;
/* Cancel any asynchronous image load */
if (priv->async_load_data)
{
priv->async_load_data->cancelled = TRUE;
priv->async_load_data = NULL;
}
} | false | false | false | false | false | 0 |
tracker_needle_construct (GType object_type) {
TrackerNeedle* self = NULL;
TrackerHistory* _tmp0_ = NULL;
self = (TrackerNeedle*) g_type_create_instance (object_type);
tracker_needle_create_models (self);
_tmp0_ = tracker_history_new ();
_tracker_history_unref0 (self->priv->history);
self->priv->history = _tmp0_... | false | false | false | false | false | 0 |
__connman_service_ipconfig_indicate_state(struct connman_service *service,
enum connman_service_state new_state,
enum connman_ipconfig_type type)
{
struct connman_ipconfig *ipconfig = NULL;
enum connman_service_state old_state;
int ret;
if (service == NULL)
return -EINVAL;
if (type == CONNMAN_IPCONFI... | false | false | false | false | false | 0 |
color_chunk(ra_chunk *c, sel_chan color) {
vvec vv = c->values;
for (vvec::iterator I = vv.begin(), E = vv.end(); I != E;
++I) {
value *v = *I;
if (v->is_reg_pinned() && v->pin_gpr.sel() != color.sel()) {
detach_value(v);
continue;
}
if (v->is_chan_pinned() && v->pin_gpr.chan() != color.chan()) {... | false | false | false | false | false | 0 |
find_command(const char *unprec_name,const char * const *names,
const char **res)
{
const char *match=0;
for( ; *names; names++)
{
const char *s,*u;
for(s=*names,u=unprec_name; *s && !charcasecmp(*u,*s); s++,u++)
;
if(*s && !*u)
{
if(match)
{
*res=0;
return 1;
... | false | false | false | false | false | 0 |
hda_codec_driver_shutdown(struct device *dev)
{
struct hda_codec *codec = dev_to_hda_codec(dev);
if (!pm_runtime_suspended(dev) && codec->patch_ops.reboot_notify)
codec->patch_ops.reboot_notify(codec);
} | false | false | false | false | false | 0 |
get_line( void )
{
char line[255];
f_line* formated_line = new f_line();
bool found_interpretable_line = false; // Found line that is neither a comment nor empty
while ( !feof( _param_file ) && !found_interpretable_line )
{
if ( !fgets( line, 255, _param_file ) )
{
delete formated_line;
... | false | false | false | false | false | 0 |
tx_link_write_error(txdrv_t *tx, const char *func)
{
struct attr *attr = tx->opaque;
if (is_temporary_error(errno) || ENOBUFS == errno)
return 0;
switch (errno) {
/*
* The following are probably due to bugs in the libc, but this is in
* the same vein as write() failing with -1 whereas errno == 0! Be more
... | false | false | false | false | false | 0 |
firewall_update_zone (NMPolicy *policy, NMConnection *connection)
{
NMPolicyPrivate *priv = NM_POLICY_GET_PRIVATE (policy);
NMSettingConnection *s_con = nm_connection_get_setting_connection (connection);
GSList *iter, *devices;
devices = nm_manager_get_devices (priv->manager);
/* find dev with passed connection a... | false | false | false | false | false | 0 |
top_parse_file (const char *fname, FILE *fp)
{
char *section_name = NULL; /* Name of the current section or NULL
if not in a section. */
macro_t m;
while (macrolist)
{
macro_t next = macrolist->next;
free (macrolist->value);
free (macrolist);
macroli... | false | false | false | false | false | 0 |
FCEUI_SetPaletteArray(uint8 *pal)
{
if(!pal)
palpoint[0]=palette;
else
{
int x;
palpoint[0]=palettec;
for(x=0;x<64;x++)
{
palpoint[0][x].r=*((uint8 *)pal+x+x+x);
palpoint[0][x].g=*((uint8 *)pal+x+x+x+1);
palpoint[0][x].b=*((uint8 *)pal+x+x+x+2);
}
}
FCEU_ResetPalette();
} | false | false | false | false | false | 0 |
e1000e_configure_tx ( struct e1000_adapter *adapter )
{
struct e1000_hw *hw = &adapter->hw;
u32 tctl, tipg, tarc;
u32 ipgr1, ipgr2;
DBGP ( "e1000_configure_tx\n" );
/* disable transmits while setting up the descriptors */
tctl = E1000_READ_REG ( hw, E1000_TCTL );
E1000_WRITE_REG ( hw, E1000_TCTL, tctl & ~E1000... | false | false | false | false | false | 0 |
ocfs2_control_message(struct file *file,
const char __user *buf,
size_t count)
{
ssize_t ret;
union ocfs2_control_message msg;
/* Try to catch padding issues */
WARN_ON(offsetof(struct ocfs2_control_message_down, uuid) !=
(sizeof(msg.u_down.tag) + sizeof(msg.u_down.space1)));
memset(&msg, 0, ... | false | false | false | false | false | 0 |
cpor_tag_new(void)
{
pdp_cpor_tag_t *tag = NULL;
if ((tag = malloc(sizeof(pdp_cpor_tag_t))) == NULL) return NULL;
memset(tag, 0, sizeof(pdp_cpor_tag_t));
if ((tag->sigma = BN_new()) == NULL) goto cleanup;
tag->index = 0;
return tag;
cleanup:
cpor_tag_free(tag);
return NULL;
} | false | false | false | false | false | 0 |
main(int argc, char **argv) {
// Print a stack trace if we signal out.
sys::PrintStackTraceOnErrorSignal();
PrettyStackTraceProgram X(argc, argv);
LLVMContext &Context = getGlobalContext();
llvm_shutdown_obj Y; // Call llvm_shutdown() on exit.
cl::ParseCommandLineOptions(argc, argv, "llvm .bc -> .ll dis... | false | false | false | false | false | 0 |
submit (Ekiga::FormBuilder &builder)
{
GtkTreeModel *model = NULL;
GtkTreeIter iter;
gboolean active = FALSE;
std::set<std::string> values;
model = gtk_tree_view_get_model (GTK_TREE_VIEW (tree_view));
if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (model), &iter)) {
do {
gchar *... | false | false | false | false | false | 0 |
NormalizePath( CPLString &oPath )
{
int i, nSize = oPath.size();
for( i = 0; i < nSize; i++ )
{
if( oPath[i] == '\\' )
oPath[i] = '/';
}
} | false | false | false | false | false | 0 |
add_to_type_list(ibnd_node_t * node, ibnd_fabric_t * fabric)
{
switch (node->type) {
case IB_NODE_CA:
node->type_next = fabric->ch_adapters;
fabric->ch_adapters = node;
break;
case IB_NODE_SWITCH:
node->type_next = fabric->switches;
fabric->switches = node;
break;
case IB_NODE_ROUTER:
node->type_next ... | false | false | false | false | false | 0 |
vm_vec_dist_to_line(vec3d *p, vec3d *l0, vec3d *l1, vec3d *nearest, float *dist)
{
vec3d a, b, c;
float b_mag, comp;
#ifndef NDEBUG
if(vm_vec_same(l0, l1)){
*nearest = vmd_zero_vector;
return -1;
}
#endif
// compb_a == a dot b / len(b)
vm_vec_sub(&a, p, l0);
vm_vec_sub(&b, l1, l0);
b_mag = vm_vec_copy_n... | false | false | false | false | false | 0 |
augl_init_lexer(struct state *state, yyscan_t *scanner) {
FILE *f;
struct string *name = state->info->filename;
f = fopen(name->str, "r");
if (f == NULL)
return -1;
if (augl_lex_init(scanner) != 0) {
fclose(f);
return -1;
}
augl_set_extra(state, *scanner);
augl_set_in(f, *scanner);
retur... | false | false | false | false | true | 1 |
lis3l02dq_write_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
int val,
int val2,
long mask)
{
int ret = -EINVAL, reg;
u8 uval;
s8 sval;
switch (mask) {
case IIO_CHAN_INFO_CALIBBIAS:
if (val > 255 || val < -256)
return -EINVAL;
sval = val;
reg = l... | false | false | false | false | false | 0 |
asus_backlight_init(struct asus_laptop *asus)
{
struct backlight_device *bd;
struct backlight_properties props;
if (acpi_check_handle(asus->handle, METHOD_BRIGHTNESS_GET, NULL) ||
acpi_check_handle(asus->handle, METHOD_BRIGHTNESS_SET, NULL))
return 0;
memset(&props, 0, sizeof(struct backlight_properties));... | false | false | false | false | false | 0 |
HandleMucPresence(buzz::Muc* muc,
const Jid& from,
const XmlElement* stanza) {
if (from == muc->local_jid()) {
if (!stanza->HasAttr(QN_TYPE)) {
// We joined the MUC.
const XmlElement* elem = stanza->FirstNamed(QN_MUC_USE... | false | false | false | false | false | 0 |
ensDatabaseentryDel(EnsPDatabaseentry *Pdbe)
{
EnsPOntologylinkage ol = NULL;
EnsPDatabaseentry pthis = NULL;
if (!Pdbe)
return;
#if defined(AJ_DEBUG) && AJ_DEBUG >= 1
if (ajDebugTest("ensDatabaseentryDel"))
{
ajDebug("ensDatabaseentryDel\n"
" *Pdbe %p\n",
... | false | false | false | false | false | 0 |
GetDesiredRect() {
// Before any size allocated pretend its 100 wide so not scrolled
PRectangle rc(0, 0, 100, 100);
if (wid) {
int rows = Length();
if ((rows == 0) || (rows > desiredVisibleRows))
rows = desiredVisibleRows;
GtkRequisition req;
#if GTK_CHECK_VERSION(3,0,0)
// This, apparently unnecessary c... | false | false | false | false | false | 0 |
glade_widget_adaptor_action_add (GladeWidgetAdaptor *adaptor,
const gchar *action_path,
const gchar *label,
const gchar *stock,
gboolean important)
{
g_return_val_if_fail (GLADE_IS_WIDGE... | false | false | false | false | false | 0 |
startStreaming(const char *address, int port)
{
struct sockaddr_in addr;
int sockfd, tmp;
STREAMING_SERVER *server;
sockfd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (sockfd == -1)
{
RTMP_Log(RTMP_LOGERROR, "%s, couldn't create socket", __FUNCTION__);
return 0;
}
tmp = 1;
setsoc... | false | false | false | false | false | 0 |
gst_channel_mix_passthrough (AudioConvertCtx * this)
{
gint i;
guint64 in_mask, out_mask;
/* only NxN matrices can be identities */
if (this->in.channels != this->out.channels)
return FALSE;
/* passthrough if both channel masks are the same */
in_mask = out_mask = 0;
for (i = 0; i < this->in.channel... | false | false | false | false | false | 0 |
Apply(SuffixTree *tree, int(*Applyfn)(void *,void *),void *arg)
{
if (tree == NULL || Applyfn == NULL) {
if (tree)
tree->RaiseError("SuffixTree.Aply",CONTAINER_ERROR_BADARG);
else
iError.RaiseError("SuffixTree.Apply",CONTAINER_ERROR_BADARG);
return CONTAINER_ERROR_BAD... | false | false | false | false | false | 0 |
lba_to_chs(const struct driveinfo *drive_info, const int lba,
unsigned int *cylinder, unsigned int *head,
unsigned int *sector)
{
unsigned int track;
/* Use EDD, if valid */
if (drive_info->edd_params.sectors_per_track > 0 &&
drive_info->edd_params.heads > 0) {
*cylinder = (lba % drive_info->edd_para... | false | false | false | false | false | 0 |
cpio_set_field ( char *field, unsigned long value ) {
char buf[9];
snprintf ( buf, sizeof ( buf ), "%08lx", value );
memcpy ( field, buf, 8 );
} | false | false | false | false | false | 0 |
stbl_AppendPadding(GF_SampleTableBox *stbl, u8 padding)
{
u32 i;
u8 *pad_bits;
if (!stbl->PaddingBits) stbl->PaddingBits = (GF_PaddingBitsBox *) gf_isom_box_new(GF_ISOM_BOX_TYPE_PADB);
pad_bits = (u8*)gf_malloc(sizeof(u8) * stbl->SampleSize->sampleCount);
if (!pad_bits) return;
memset(pad_bits, 0, sizeof(pad_bit... | false | true | false | false | true | 1 |
pool_unusable(struct pool *pool)
{
if (pool->idle)
return true;
if (pool->enabled != POOL_ENABLED)
return true;
if (pool->has_stratum && (!pool->stratum_active || !pool->stratum_notify))
return true;
return false;
} | false | false | false | false | false | 0 |
print_fields_char_list(print_field_t *field, List value, int last)
{
int abs_len = abs(field->len);
ListIterator itr = NULL;
char *print_this = NULL;
char *object = NULL;
if (!value || !list_count(value)) {
if (print_fields_parsable_print)
print_this = xstrdup("");
else
print_this = xstrdup(" ");
} els... | false | false | false | false | false | 0 |
D_CheckRecordFrom(void)
{
int p;
char *filename;
//!
// @vanilla
// @category demo
// @arg <savenum> <demofile>
//
// Record a demo, loading from the given filename. Equivalent
// to -loadgame <savenum> -record <demofile>.
p = M_CheckParmWithArgs("-recordfrom", 2);
if (!p)
... | false | false | false | false | false | 0 |
infd_session_proxy_handle_user_join(InfdSessionProxy* proxy,
InfXmlConnection* connection,
xmlNodePtr xml,
GError** error)
{
InfdSessionProxyPrivate* priv;
InfSessionClass* session_class;
GArray* array;
I... | false | false | false | false | false | 0 |
u_save_line(lnum)
linenr_T lnum;
{
char_u *src;
char_u *dst;
unsigned len;
src = ml_get(lnum);
len = (unsigned)STRLEN(src);
if ((dst = U_ALLOC_LINE(len)) != NULL)
mch_memmove(dst, src, (size_t)(len + 1));
return (dst);
} | false | false | false | false | false | 0 |
sub_set_georeferencing (const gGraphImagePtr dst, const gGraphImagePtr src,
int upper_left_x, int upper_left_y)
{
/* adjusting georeferencing infos between two images [ImageSubSet] */
int len;
char *SrsName = NULL;
char *Proj4Text = NULL;
if (src->is_georeferenced)
{
if (src->srs_name)
... | false | false | false | false | false | 0 |
GetFileDetails(ProjectBuildTarget* target)
{
pfDetails* pfd = m_PFDMap[target];
if (!pfd)
{
DoUpdateFileDetails(target);
pfd = m_PFDMap[target];
}
return *pfd;
} | false | false | false | false | false | 0 |
fl_strdup( const char * s )
{
char *p = malloc( 1 + strlen( s ) );
return p ? strcpy( p, s ) : p;
} | false | true | false | false | false | 1 |
update( int dT ) {
move( dT );
if ( !fireByFormation ) {
shootPrimary( dT );
shootSecondary( dT );
}
} | false | false | false | false | false | 0 |
btrfs_qgroup_rescan_resume(struct btrfs_fs_info *fs_info)
{
if (fs_info->qgroup_flags & BTRFS_QGROUP_STATUS_FLAG_RESCAN)
btrfs_queue_work(fs_info->qgroup_rescan_workers,
&fs_info->qgroup_rescan_work);
} | false | false | false | false | false | 0 |
get_db_opt(const char *input, char **opt_out, char **val_out)
{
const char *pos;
char *opt, *val = NULL;
size_t len;
*opt_out = *val_out = NULL;
pos = strchr(input, '=');
if (pos == NULL) {
opt = strdup(input);
if (opt == NULL)
return ENOMEM;
} else {
len... | false | false | false | false | false | 0 |
__indirect_glVertexAttrib1s(GLuint index, GLshort x)
{
struct glx_context * const gc = __glXGetCurrentContext();
const GLuint cmdlen = 12;
emit_header(gc->pc, X_GLrop_VertexAttrib1sv, cmdlen);
(void) memcpy((void *)(gc->pc + 4), (void *)(&index), 4);
(void) memcpy((void *)(gc->pc + 8), (void *)(&x), 2);
gc->pc ... | false | true | false | false | false | 1 |
string_rm_chars (char *s, int i)
{
int j;
for (j=0; j<(strlen(s)-i+1); j++) {
s[j] = s[j+i];
}
} | false | false | false | false | false | 0 |
cachefiles_object_init_once(void *_object)
{
struct cachefiles_object *object = _object;
memset(object, 0, sizeof(*object));
spin_lock_init(&object->work_lock);
} | false | false | false | false | false | 0 |
DoUnaryMathOperation(LUnaryMathOperation* instr) {
switch (instr->op()) {
case kMathAbs:
DoMathAbs(instr);
break;
case kMathFloor:
DoMathFloor(instr);
break;
case kMathRound:
DoMathRound(instr);
break;
case kMathSqrt:
DoMathSqrt(instr);
break;
case k... | false | false | false | false | false | 0 |
_add_dict_to_prdict (dict_t *this, char *key, data_t *value, void *data)
{
glusterd_dict_ctx_t *ctx = NULL;
char optkey[512] = {0,};
int ret = -1;
ctx = data;
snprintf (optkey, sizeof (optkey), "%s.%s%d", ctx->prefix,
... | false | false | false | false | false | 0 |
hci_dflagstostr(uint32_t flags)
{
char *str = bt_malloc(50);
char *ptr = str;
hci_map *m = dev_flags_map;
if (!str)
return NULL;
*ptr = 0;
if (!hci_test_bit(HCI_UP, &flags))
ptr += sprintf(ptr, "DOWN ");
while (m->str) {
if (hci_test_bit(m->val, &flags))
ptr += sprintf(ptr, "%s ", m->str);
m++;
}... | false | false | false | false | false | 0 |
con_put_char(struct tty_struct *tty, unsigned char ch)
{
if (in_interrupt())
return 0; /* n_r3964 calls put_char() from interrupt context */
return do_con_write(tty, &ch, 1);
} | false | false | false | false | false | 0 |
dir_split_resource_into_fingerprints(const char *resource,
smartlist_t *fp_out, int *compressed_out,
int flags)
{
const int decode_hex = flags & DSR_HEX;
const int decode_base64 = flags & DSR_BASE64;
const int digests_are_256 = flags & DSR_... | false | false | false | false | false | 0 |
getRayForwardIntersect(const Vector3& anchor, const Vector3 *dir, Real planeOffset) const
{
vector<Vector4>::type res;
if(!dir)
return res;
int infpt[4] = {0, 0, 0, 0}; // 0=finite, 1=infinite, 2=straddles infinity
Vector3 vec[4];
// find how much the anchor po... | false | false | false | false | false | 0 |
read_string_first_word(const std::string §ion, const std::string &name, const std::string &defaultValue, bool failIfNotFound ) const
{
string s = readString(section, name, defaultValue,failIfNotFound );
vector_string auxStrs;
mrpt::system::tokenize(s,"[], \t", auxStrs);
if (auxStrs.empty())
{
if (failIfNotF... | false | false | false | false | false | 0 |
_StartBlobs(ArchiveHandle *AH, TocEntry *te)
{
lclContext *ctx = (lclContext *) AH->formatData;
char *fname;
fname = prependDirectory(AH, "blobs.toc");
/* The blob TOC file is never compressed */
ctx->blobsTocFH = cfopen_write(fname, "ab", 0);
if (ctx->blobsTocFH == NULL)
die_horribly(AH, modulename, "coul... | false | false | false | false | false | 0 |
InitializeEdges()
{
BackwardsEdgeSet::iterator iter = m_edges.begin();
BackwardsEdgeSet::iterator iterEnd = m_edges.end();
while (iter != iterEnd) {
BackwardsEdge *edge = *iter;
edge->Initialize();
++iter;
}
} | false | false | false | false | false | 0 |
cs4398_write_cached(struct oxygen *chip, u8 reg, u8 value)
{
struct xonar_cs43xx *data = chip->model_data;
if (value != data->cs4398_regs[reg])
cs4398_write(chip, reg, value);
} | false | false | false | false | false | 0 |
kill_screenhack (saver_screen_info *ssi)
{
saver_info *si = ssi->global;
if (ssi->pid)
kill_job (si, ssi->pid, SIGTERM);
ssi->pid = 0;
} | false | false | false | false | false | 0 |
blk_mq_init_hctx(struct request_queue *q,
struct blk_mq_tag_set *set,
struct blk_mq_hw_ctx *hctx, unsigned hctx_idx)
{
int node;
unsigned flush_start_tag = set->queue_depth;
node = hctx->numa_node;
if (node == NUMA_NO_NODE)
node = hctx->numa_node = set->numa_node;
INIT_DELAYED_WORK(&hctx->run_work, blk_mq_... | false | false | false | false | false | 0 |
json_lex_number(JsonLexContext *lex, char *s, bool *num_err)
{
bool error = false;
char *p;
int len;
len = s - lex->input;
/* Part (1): leading sign indicator. */
/* Caller already did this for us; so do nothing. */
/* Part (2): parse main digit string. */
if (*s == '0')
{
s++;
len++;
}
else if (... | false | false | false | false | false | 0 |
lldpd_pi_cleanup(struct lldpd_port *port)
{
struct lldpd_pi *pi, *pi_next;
for (pi = TAILQ_FIRST(&port->p_pids);
pi != NULL;
pi = pi_next) {
free(pi->p_pi);
pi_next = TAILQ_NEXT(pi, p_entries);
free(pi);
}
TAILQ_INIT(&port->p_pids);
} | false | false | false | false | false | 0 |
g_vfs_ftp_dir_cache_new (const GVfsFtpDirFuncs *funcs)
{
GVfsFtpDirCache *cache;
g_return_val_if_fail (funcs != NULL, NULL);
cache = g_slice_new0 (GVfsFtpDirCache);
cache->directories = g_hash_table_new_full (g_vfs_ftp_file_hash,
g_vfs_ftp_file_equal,
... | 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.