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 |
|---|---|---|---|---|---|---|
_e_fm2_uri_parse(const char *val)
{
E_Fm2_Uri *uri;
const char *p;
char hostname[PATH_MAX], path[PATH_MAX];
int i = 0;
/* if value is a raw path: /path/to/blah just return it */
if (val[0] == '/')
{
uri = E_NEW(E_Fm2_Uri, 1);
uri->hostname = NULL;
uri->path = eina_strings... | false | false | false | false | false | 0 |
_host(K a) //lfop
{
I t=a->t;
if(4==t)
{
struct addrinfo b,*c;
memset(&b,0,sizeof b);
b.ai_family = AF_INET; //AF_INET - IPv4 ; AF_UNSPEC - unspecified ; AF_INET6 - force IPv6
b.ai_socktype = SOCK_STREAM;
if(!getaddrinfo(*kS(a),0,&b,&c))
{
I q = ntohl(((struct sockaddr_in *)c->ai_a... | false | false | false | false | false | 0 |
rv3029c2_i2c_get_sr(struct i2c_client *client, u8 *buf)
{
int ret = rv3029c2_i2c_read_regs(client, RV3029C2_STATUS, buf, 1);
if (ret < 0)
return -EIO;
dev_dbg(&client->dev, "status = 0x%.2x (%d)\n", buf[0], buf[0]);
return 0;
} | false | false | false | false | false | 0 |
b43_gphy_init_tssi2dbm_table(struct b43_wldev *dev)
{
struct b43_phy *phy = &dev->phy;
struct b43_phy_g *gphy = phy->g;
s16 pab0, pab1, pab2;
pab0 = (s16) (dev->dev->bus_sprom->pa0b0);
pab1 = (s16) (dev->dev->bus_sprom->pa0b1);
pab2 = (s16) (dev->dev->bus_sprom->pa0b2);
B43_WARN_ON((dev->dev->chip_id == 0x4301... | false | false | false | false | false | 0 |
spse_inplacenextLimdfsstate(const Limdfsconstinfo *mt,
DECLAREPTRDFSSTATE(aliascol),
unsigned long currentdepth,
GtUchar currentchar)
{
SpseLimdfsstate *col = (SpseLimdfsstate *) aliascol;
const S... | false | false | false | false | false | 0 |
ExpandOp_BIT_CONVERT(SDNode *N) {
DebugLoc dl = N->getDebugLoc();
if (N->getValueType(0).isVector()) {
// An illegal expanding type is being converted to a legal vector type.
// Make a two element vector out of the expanded parts and convert that
// instead, but only if the new vector type is legal (oth... | false | false | false | false | false | 0 |
gkrellm_add_chartdata(GkrellmChart *cp, GdkPixmap **src_pixmap,
GdkPixmap *grid_pixmap, gchar *label)
{
GtkWidget *top_win = gkrellm_get_top_window();
GList *list;
GkrellmChartdata *cd;
if (!cp || !src_pixmap || !grid_pixmap || !label)
return NULL;
/* To handle theme and vert size changes without loosin... | false | false | false | false | false | 0 |
blkid_reset_probe(blkid_probe pr)
{
int i;
if (!pr)
return;
blkid_probe_reset_values(pr);
blkid_probe_set_wiper(pr, 0, 0);
pr->cur_chain = NULL;
for (i = 0; i < BLKID_NCHAINS; i++)
blkid_probe_chain_reset_position(&pr->chains[i]);
} | false | false | false | false | false | 0 |
_eglModeQualifies(const _EGLMode *c, const _EGLMode *min)
{
if (min->Handle != EGL_DONT_CARE && c->Handle != min->Handle)
return EGL_FALSE;
if (min->Width != EGL_DONT_CARE && c->Width < min->Width)
return EGL_FALSE;
if (min->Height != EGL_DONT_CARE && c->Height < min->Height)
return EGL_FALSE... | false | false | false | false | false | 0 |
static_raw_x1 (int cell_x, int cell_y, int cell_z,
int shell, static_polytope *polytope)
{
int n, n_x, n_y, n_z;
int i, j;
n = polytope->n_cells;
/****************************************
* find neighbours in cells in +x faces *
****************************************/
n_x = shell + cell_x;
if (n_x < 0 || n_x > n... | false | false | false | false | false | 0 |
readHexCodeUnit(const char **string, UErrorCode *status)
{
UChar result = 0;
int32_t value = 0;
char c;
int32_t noDigits = 0;
while((c = **string) != 0 && noDigits < 4) {
if( c >= '0' && c <= '9') {
value = c - '0';
} else if ( c >= 'a' && c <= 'f') {
value = ... | false | false | false | false | false | 0 |
elm_entry_context_menu_disabled_set(Evas_Object *obj, Eina_Bool disabled)
{
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
if (wd->context_menu == !disabled) return;
wd->context_menu = !disabled;
} | false | false | false | false | false | 0 |
S_inherit_utf8_flag(PerlIO *f)
{
PerlIO *g = PerlIONext(f);
if (PerlIOValid(g)) {
if (PerlIOBase(g)->flags & PERLIO_F_UTF8) {
PerlIOBase(f)->flags |= PERLIO_F_UTF8;
}
}
} | false | false | false | false | false | 0 |
complete_it(void)
{
int i;
size_t len;
static USTRING dequote_str = { 0, 0 }, dequote_dir = { 0, 0 };
/* C_PANEL_SIZE = AUTO */
if (config_num(CFG_C_SIZE) == 0) {
/*
* substract extra lines and leave the bottom
* line empty to show there is no need to scroll
*/
cc_max = display.panlines + panel_compl... | false | false | false | false | false | 0 |
GetMessageSummary()
{
stringstream summary;
if (_messageCount[obError] > 0)
summary << _messageCount[obError] << " errors ";
if (_messageCount[obWarning] > 0)
summary << _messageCount[obWarning] << " warnings ";
if (_messageCount[obInfo] > 0)
summary << _messageCount[obInfo] << " inf... | false | false | false | false | false | 0 |
getpathtop(s, drvp, typep)
CONST char *s;
int *drvp, *typep;
{
int n, drv, type;
n = drv = 0;
type = PT_NONE;
if (!s) /*EMPTY*/;
#ifdef DEP_DOSPATH
else if ((drv = _dospath(s))) {
n = 2;
type = PT_DOS;
}
#endif
#ifdef DOUBLESLASH
else if ((n = isdslash(s))) type = PT_DSLASH;
#endif
#ifdef DEP_URLPATH
else... | false | false | false | false | false | 0 |
directive(void)
{
int res;
eel_symbol_t *sym = eel_current.lval->value.sym;
if(!sym->data.value.parse)
{
eel_error("INTERNAL ERROR: Directive callback missing!");
return -1;
}
res = sym->data.value.parse();
return res;
} | false | false | false | false | false | 0 |
convert_hline_v308 (paintinfo * p, int y)
{
int i;
guint8 *Y = p->yp + y * p->ystride;
guint8 *U = p->up + y * p->ustride;
guint8 *V = p->vp + y * p->vstride;
guint8 *ayuv = p->tmpline;
for (i = 0; i < p->width; i++) {
Y[i * 3] = ayuv[4 * i + 1];
U[i * 3] = ayuv[4 * i + 2];
V[i * 3] = ayuv[4 * ... | false | false | false | false | false | 0 |
Handle_DelBeacon(struct host_if_drv *hif_drv)
{
s32 result = 0;
struct wid wid;
u8 *pu8CurrByte;
wid.id = (u16)WID_DEL_BEACON;
wid.type = WID_CHAR;
wid.size = sizeof(char);
wid.val = &del_beacon;
if (!wid.val)
return;
pu8CurrByte = wid.val;
PRINT_D(HOSTINF_DBG, "Deleting BEACON\n");
result = send_conf... | false | false | false | false | false | 0 |
ARTparsedist(const char *p, int size, LISTBUFFER *list)
{
int i;
char *q, **dp;
/* setup buffer */
SetupListBuffer(size, list);
/* loop over text and copy */
for (i = 0, q = list->Data, dp = list->List ; *p ; p++, *q++ = '\0') {
/* skip leading separators. */
for (; *p && ((*p == ',') || ISWHITE... | false | false | false | false | false | 0 |
evloop_create_timer(int timeout)
{
int fd;
int ret;
struct itimerspec timing;
fd = timerfd_create(CLOCK_MONOTONIC, 0);
if (fd < 0)
{
logmsg(LOG_ERR, "Could not create timer: %s", strerror(errno));
return -1;
}
timing.it_interval.tv_sec = (timeout >= 1000) ? timeout / 1000 : 0;
timi... | false | false | false | false | false | 0 |
__lldpctl_atom_set_str_config(struct _lldpctl_atom_config_t *c,
char **local, char **global,
const char *value) {
if (value) {
char *aval = NULL;
size_t len = strlen(value) + 1;
aval = _lldpctl_alloc_in_atom((lldpctl_atom_t *)c, len);
if (!aval) return NULL;
memcpy(aval, value, len);
*local = aval;... | false | false | false | false | false | 0 |
read_long_string (LexState *ls, SemInfo *seminfo, int sep) {
int cont = 0;
(void)(cont); /* avoid warnings when `cont' is not used */
save_and_next(ls); /* skip 2nd `[' */
if (currIsNewline(ls)) /* string starts with a newline? */
inclinenumber(ls); /* skip it */
for (;;) {
switch (ls->current) {
... | false | false | false | false | false | 0 |
isClosed() const
{
if (isEmpty()) {
return false;
}
return getCoordinateN(0).equals2D(getCoordinateN(getNumPoints()-1));
} | false | false | false | false | false | 0 |
gst_ximage_buffer_pool_new (GstXImageSink * ximagesink)
{
GstXImageBufferPool *pool;
g_return_val_if_fail (GST_IS_XIMAGESINK (ximagesink), NULL);
pool = g_object_new (GST_TYPE_XIMAGE_BUFFER_POOL, NULL);
pool->sink = gst_object_ref (ximagesink);
pool->allocator = g_object_new (GST_TYPE_XIMAGE_MEMORY_ALLOCATO... | false | false | false | false | false | 0 |
updateUrl( const KUrl& _newUrl )
{
Q_ASSERT(d->m_items.count() == 1);
kDebug(250) << "KPropertiesDialog::updateUrl (pre)" << _newUrl.url();
KUrl newUrl = _newUrl;
emit saveAs(d->m_singleUrl, newUrl);
kDebug(250) << "KPropertiesDialog::updateUrl (post)" << newUrl.url();
d->m_singleUrl = newUrl;
... | false | false | false | false | false | 0 |
visual_2d_texture_path_text(GF_VisualManager *visual, DrawableContext *txt_ctx, GF_Path *path, GF_Rect *object_bounds, GF_TextureHandler *txh, GF_TraverseState *tr_state)
{
GF_STENCIL stencil;
Fixed sS, sT;
GF_Matrix2D gf_mx2d_txt;
GF_Rect orig_rc;
u8 alpha, r, g, b;
GF_ColorMatrix cmat;
GF_Raster2D *raster;
i... | false | false | false | false | false | 0 |
GetNodeKey(Node* node)
{
for (iterator it = _map.begin(); it != _map.end(); ++it)
{
if (it->second == node)
return it->first;
}
return "";
} | false | false | false | false | false | 0 |
close()
{
getLogLog().debug(LOG4CPLUS_TEXT("Entering SocketAppender::close()..."));
#if ! defined (LOG4CPLUS_SINGLE_THREADED)
connector->terminate ();
#endif
socket.close();
closed = true;
} | false | false | false | false | false | 0 |
goo_canvas_rect_finalize (GObject *object)
{
GooCanvasItemSimple *simple = (GooCanvasItemSimple*) object;
GooCanvasRect *rect = (GooCanvasRect*) object;
/* Free our data if we didn't have a model. (If we had a model it would
have been reset in dispose() and simple_data will be NULL.) */
if (simple->simple... | false | false | false | false | false | 0 |
getDefaultHeight(){
FXint th=0,h;
if(!label.empty()){
th=labelHeight(label);
}
if(!(options&(ICON_ABOVE_TEXT|ICON_BELOW_TEXT))) h=FXMAX(th,13); else h=th+13;
return padtop+padbottom+h+(border<<1);
} | false | false | false | false | false | 0 |
base_uri_is_groupware (const gchar *base_uri)
{
/* Well-known scheme names from various groupware packages. */
/* We use a limited string comparsion here because the
* base_uri string may be 'scheme://' or just 'scheme'. */
g_return_val_if_fail (base_uri != NULL, FALSE);
if (g_ascii_strncasecmp (base_uri, "ews... | false | false | false | false | false | 0 |
lookup_bdev(const char *pathname, int mask)
{
struct block_device *bdev;
struct inode *inode;
struct path path;
int error;
if (!pathname || !*pathname)
return ERR_PTR(-EINVAL);
error = kern_path(pathname, LOOKUP_FOLLOW, &path);
if (error)
return ERR_PTR(error);
inode = d_backing_inode(path.dentry);
if (... | false | false | false | false | false | 0 |
is_gray(struct color c)
{
return c.red == c.green && c.red == c.blue;
} | false | false | false | false | false | 0 |
getforce()
{
float d;
int i;
int j;
for (i=0; i<gridX; i++)
for ( j=0;j<gridY; j++)
{
force[i][j] =0.0;
}
// add (low amplitude) noise to avoid denormalisation.
// this noise does propagate thrus the all structure.
force[2][2]= 2e-20 * (double)random2() *... | false | false | false | false | false | 0 |
tads_get_story_file_metadata_extent(void *story_file, int32 extent)
{
valinfo *vals;
int32 ret;
int ver;
/*
* First, make sure we have a GameInfo record. If we don't, simply
* indicate that there's no metadata to fetch.
*/
if ((vals = parse_sf_game_info(story_file, extent,... | false | false | false | false | false | 0 |
compat_from_pda(struct wlan_info *wlan)
{
int i;
for (i = 0; i < wlan->pda.pdr_count; i++) {
switch (wlan->pda.pdrs[i].pdr) {
case PDR_RF_MODE_SUPP_RANGE:
if (wlan->pda.pdrs[i].len ==
sizeof(struct pdr_supplier_range))
pdr_range_to_info(&wlan->mfi_pri_sup,
wlan->pda.pdrs[i].data);
break;... | false | false | false | false | false | 0 |
ff_init_elbg(int *points, int dim, int numpoints, int *codebook,
int numCB, int max_steps, int *closest_cb,
AVRandomState *rand_state)
{
int i, k;
if (numpoints > 24*numCB) {
/* ELBG is very costly for a big number of points. So if we have a lot
of them, g... | false | true | false | false | false | 1 |
typhoon_wakeup(struct typhoon *tp, int wait_type)
{
struct pci_dev *pdev = tp->pdev;
void __iomem *ioaddr = tp->ioaddr;
pci_set_power_state(pdev, PCI_D0);
pci_restore_state(pdev);
/* Post 2.x.x versions of the Sleep Image require a reset before
* we can download the Runtime Image. But let's not make users of
... | false | false | false | false | false | 0 |
genEditDistance_mod(wchar_t *a, wchar_t *b, int aLen, int bLen, short isPrefix, short isSuffix){
double prefix[bLen];
double suffix[bLen];
double* prefix_ptr = NULL;
double* suffix_ptr = NULL;
int i;
if (!isPrefix){
for (i = 0; i < bLen; i++) prefix[i] = 0.0;
prefix_ptr = prefix;
... | false | false | false | false | false | 0 |
mpc_delete(mpc_parser_t *p) {
if (p->retained) {
if (p->type != MPC_TYPE_UNDEFINED) {
mpc_undefine_unretained(p, 0);
}
free(p->name);
free(p);
} else {
mpc_undefine_unretained(p, 0);
}
} | false | false | false | false | false | 0 |
PyErr_CheckSignals(void)
{
int i;
PyObject *f;
if (!is_tripped)
return 0;
#ifdef WITH_THREAD
if (PyThread_get_thread_ident() != main_thread)
return 0;
#endif
/*
* The is_tripped variable is meant to speed up the calls to
* PyErr_CheckSignals (both directly or via pending... | false | false | false | false | false | 0 |
zl10036_attach(struct dvb_frontend *fe,
const struct zl10036_config *config,
struct i2c_adapter *i2c)
{
struct zl10036_state *state;
int ret;
if (!config) {
printk(KERN_ERR "%s: no config specified", __func__);
return NULL;
}
state = kzalloc(sizeof(struct zl10036_state), GFP_KERNEL);
if (!st... | false | false | false | false | false | 0 |
IBuildOverviews( const char *pszResampling,
int nOverviews, int *panOverviewList,
int nListBands, int *panBandList,
GDALProgressFunc pfnProgress,
void * pProgressData )
{
/... | false | false | false | false | false | 0 |
linked_list_free(struct linked_list *l)
{
struct linked_list *ptr;
ptr = l;
while (l)
{
ptr = l;
l = l->next;
linked_list_value_free(ptr->value);
free(ptr);
}
} | false | false | false | false | false | 0 |
text(const char* txt, boolean update) {
// delete text in editor
text_editor_->Select(0);
text_editor_->DeleteText(te_buffer_->characters());
// load new text
te_buffer_->Insert(0, txt, strlen(txt));
text_editor_->Edit(te_buffer_, 0);
text_editor_->BeginningOfText();
// update line information
... | false | false | false | false | false | 0 |
try_parse_named(const wcstring &str)
{
bzero(&data, sizeof data);
size_t max = sizeof named_colors / sizeof *named_colors;
for (size_t idx=0; idx < max; idx++)
{
if (0 == wcscasecmp(str.c_str(), named_colors[idx].name))
{
data.name_idx = named_colors[idx].idx;
thi... | false | false | false | false | false | 0 |
update_callback(struct diff_queue_struct *q,
struct diff_options *opt, void *cbdata)
{
int i, verbose;
verbose = *((int *)cbdata);
for (i = 0; i < q->nr; i++) {
struct diff_filepair *p = q->queue[i];
const char *path = p->one->path;
switch (p->status) {
default:
die("unexpacted diff status %c", p-... | false | false | false | false | false | 0 |
setColor(video::SColor source, video::SColor dest)
{
Color[0] = source;
Color[1] = dest;
if (Action == EFA_FADE_OUT)
{
FullColor = Color[1];
TransColor = Color[0];
}
else
if (Action == EFA_FADE_IN)
{
FullColor = Color[0];
TransColor = Color[1];
}
} | false | false | false | false | false | 0 |
pecalc_l(III_psy_ratio const *mr, FLOAT masking_lower)
{
FLOAT pe_l;
static const FLOAT regcoef_l[] = {
6.8, /* these values are tuned only for 44.1kHz... */
5.8,
5.8,
6.4,
6.5,
9.9,
12.1,
14.4,
15,
18.9,
21.6,
... | false | false | false | false | false | 0 |
Get(const LookupKey& key, std::string* value, Status* s) {
Slice memkey = key.memtable_key();
Table::Iterator iter(&table_);
iter.Seek(memkey.data());
if (iter.Valid()) {
// entry format is:
// klength varint32
// userkey char[klength]
// tag uint64
// vlength varint32
... | false | false | false | false | false | 0 |
bridge_make_compatible(struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel)
{
struct ast_format formats[2];
ast_format_copy(&formats[0], ast_channel_readformat(bridge_channel->chan));
ast_format_copy(&formats[1], ast_channel_writeformat(bridge_channel->chan));
/* Are the formats currently in use s... | true | true | false | false | false | 1 |
ndmca_robot_check_ready (struct ndm_session *sess)
{
struct smc_ctrl_block * smc = &sess->control_acb.smc_cb;
unsigned first_dte_addr;
unsigned n_dte_addr;
int rc;
unsigned int i;
int errcnt = 0;
struct smc_element_descriptor * edp;
rc = ndmca_robot_obtain_info (sess);
if (rc) return rc;
if (se... | false | false | false | false | false | 0 |
Oct6100ApiValidateTsst(
IN OUT tPOCT6100_INSTANCE_API f_pApiInstance,
IN UINT32 f_ulNumTssts,
IN UINT32 f_ulTimeslot,
IN UINT32 f_ulStream,
IN UINT32 f_ulDirection )
{
tPOCT6100_SHARED_INFO pSharedInfo;
tPOCT6100_API_CHIP_CONFIG pChipConfig;
/* Obtain local pointer t... | false | false | false | false | false | 0 |
isTransparent(size_t i) {
for (size_t iVertex = 0;iVertex<m_VerticesPerPoly;iVertex++) {
if (m_Data.m_colors[m_Data.m_COLIndices[i+iVertex]].w < m_fTransTreshhold)
return true;
}
return false;
} | false | false | false | false | false | 0 |
sdecoder_msg_end_handler(struct lwpb_decoder *decoder,
const struct lwpb_msg_desc *msg_desc,
void *arg)
{
struct lwpb_struct_decoder *sdecoder = arg;
struct lwpb_struct_decoder_stack_frame *frame;
LWPB_DIAG_PRINTF("msg end\n");
... | false | false | false | false | false | 0 |
impl_manager_activate_connection (NMManager *self,
const char *connection_path,
const char *device_path,
const char *specific_object_path,
DBusGMethodInvocation *context)
{
NMManagerP... | false | false | false | false | false | 0 |
cpl_propertylist_set_double_complex(cpl_propertylist *self, const char *name,
double complex value)
{
cpl_property *property;
if (self == NULL || name == NULL) {
return cpl_error_set_(CPL_ERROR_NULL_INPUT);
}
property = _cpl_propertylist_get(self, name);
... | false | false | false | false | false | 0 |
IntersectsBox(int regionId, double x0, double x1,
double y0, double y1, double z0, double z1)
{
REGIONIDCHECK_RETURNERR(regionId, 0);
vtkKdNode *node = this->RegionList[regionId];
return node->IntersectsBox(x0, x1, y0, y1, z0, z1,
this->ComputeIntersectionsUsingD... | false | false | false | false | false | 0 |
ht_search(hashtab_t * hashtable, void *key, size_t keylen)
{
int index = ht_hash(key, keylen, hashtable->size);
if (hashtable->arr[index] == NULL)
return NULL;
hashtab_node_t *last_node = hashtable->arr[index];
while (last_node != NULL) {
/* only compare matching keylens */
if (last_node->keylen ==... | false | false | false | false | false | 0 |
mmask_row_count (const gretl_matrix *mask,
const DATASET *dset)
{
int t, m = 0;
for (t=dset->t1; t<=dset->t2; t++) {
if (mask->val[t] != 0) {
m++;
}
}
return m;
} | false | false | false | false | false | 0 |
makedirs(std::string &name) {
/* to make it faster - just check if it exists */
struct stat st;
if(stat(name.c_str(),&st) == 0) {
if(S_ISDIR(st.st_mode)) return 0;
return 1;
};
std::string::size_type n=1;
for(;;) {
if(n >= name.length()) break;
n=name.find('/',n); if(n==std::string::npos) n=... | false | false | false | false | false | 0 |
read_skip_forward (PJDEC_INST g, UINT n)
{
if (n > MAX_MARKER_LEN)
longjmp (g->syntax_error, BAD_MARKER_DATA);
rd_sync (g);
g->rd_inbuf_next += n;
} | false | false | false | false | false | 0 |
print_addr(tcp, addr, ifr)
struct tcb *tcp;
long addr;
struct ifreq *ifr;
{
if (ifr->ifr_addr.sa_family == AF_INET) {
struct sockaddr_in *sinp;
sinp = (struct sockaddr_in *) &ifr->ifr_addr;
tprintf("inet_addr(\"%s\")", inet_ntoa(sinp->sin_addr));
} else
printstr(tcp, addr, sizeof(ifr->ifr_addr.sa_data));
} | false | false | false | false | false | 0 |
jack_midi_event_write(void *port_buffer,
jack_nframes_t time,
const jack_midi_data_t *data,
size_t data_size)
{
jack_midi_data_t *retbuf =
jack_midi_event_reserve(port_buffer, time, data_size);
if (retbuf)... | false | false | false | false | false | 0 |
HDF4EOSGetObject( char **papszAttrList, char **ppszAttrName,
char **ppszAttrValue )
{
int iCount, i, j;
*ppszAttrName = NULL;
*ppszAttrValue = NULL;
iCount = CSLCount( papszAttrList );
for ( i = 0; i < iCount - 2; i++ )
{
if ( EQUAL( papszAttrList[i], ... | false | false | false | false | false | 0 |
cx24120_send_diseqc_msg(struct dvb_frontend *fe,
struct dvb_diseqc_master_cmd *d)
{
struct cx24120_state *state = fe->demodulator_priv;
struct cx24120_cmd cmd;
int back_count;
dev_dbg(&state->i2c->dev, "\n");
cmd.id = CMD_DISEQC_MSG1;
cmd.len = 11;
cmd.arg[0] = 0x00;
cmd.arg[1] = 0x00;
cmd.arg[2] = 0x... | false | true | false | false | false | 1 |
rw_rewrite_tokenize(const char *address)
{
struct rfc822t *tokens=rfc822t_alloc_new(address, NULL, NULL);
int i;
if (!tokens) clog_msg_errno();
for (i=1; i<tokens->ntokens; i++)
tokens->tokens[i-1].next=tokens->tokens+i;
return (tokens);
} | false | false | false | true | false | 1 |
process_org(astnode *org, void *arg, astnode **next)
{
if (!xasm_args.pure_binary) {
err(org->loc, "org directive can only be used when output format is pure 6502 binary");
} else {
astnode *addr = astnode_get_child(org, 0);
addr = reduce_expression_complete(addr);
if (astnode_is... | false | false | false | false | false | 0 |
mtr_diag(A) VARIABLE *A;
{
VARIABLE *C;
double *a = MATR(A), *c;
int nrowa = NROW(A), ncola = NCOL(A);
int ncolc;
int i;
if (nrowa == 1 || ncola == 1)
{
nrowa = max(nrowa, ncola); ncolc = nrowa;
C = var_temp_new(TYPE_DOUBLE, nrowa, nrowa); c = MATR(C);
for(i = 0; i < nrowa; i++) ... | false | false | false | false | false | 0 |
setNotchSpacing(FXint spacing){
if(spacing<1) spacing=1;
if(spacing>3600) spacing=3600;
while(3600%spacing) spacing--; // Should be a divisor of 3600
if(notchspacing!=spacing){
notchspacing=spacing;
update();
}
} | false | false | false | false | false | 0 |
fluid_synth_activate_octave_tuning(fluid_synth_t* synth, int bank, int prog,
const char* name, const double* pitch, int apply)
{
fluid_tuning_t* tuning;
int retval = FLUID_OK;
fluid_return_val_if_fail (synth != NULL, FLUID_FAILED);
fluid_return_val_if_fail (bank >= 0 && bank < 12... | false | false | false | false | false | 0 |
unzGetLocalExtrafield(unzFile file, voidp buf, unsigned len)
{
unz64_s* s;
file_in_zip64_read_info_s* pfile_in_zip_read_info;
uInt read_now;
ZPOS64_T size_to_read;
if (file == NULL)
return UNZ_PARAMERROR;
s = (unz64_s*)file;
pfile_in_zip_read_info = s->pfile_in_zip_read;
if (pf... | false | false | false | false | false | 0 |
getAddrModeUPBits(unsigned Mode) {
unsigned Binary = 0;
// Set addressing mode by modifying bits U(23) and P(24)
// IA - Increment after - bit U = 1 and bit P = 0
// IB - Increment before - bit U = 1 and bit P = 1
// DA - Decrement after - bit U = 0 and bit P = 0
// DB - Decrement before - bit U = 0 and ... | false | false | false | false | false | 0 |
wm8776_set_bias_level(struct snd_soc_codec *codec,
enum snd_soc_bias_level level)
{
struct wm8776_priv *wm8776 = snd_soc_codec_get_drvdata(codec);
switch (level) {
case SND_SOC_BIAS_ON:
break;
case SND_SOC_BIAS_PREPARE:
break;
case SND_SOC_BIAS_STANDBY:
if (snd_soc_codec_get_bias_level(codec) == SND_SO... | false | false | false | false | false | 0 |
ex_copen(eap)
exarg_T *eap;
{
qf_info_T *qi = &ql_info;
int height;
win_T *win;
tabpage_T *prevtab = curtab;
buf_T *qf_buf;
win_T *oldwin = curwin;
if (eap->cmdidx == CMD_lopen || eap->cmdidx == CMD_lwindow)
{
qi = GET_LOC_LIST(curwin);
if (qi == NULL)
{
EMSG(_(e_loclist));... | false | false | false | false | false | 0 |
write_cb(evutil_socket_t fd, short event, void *arg)
{
const char *test = "test string";
int len;
len = send(fd, test, (int)strlen(test) + 1, 0);
printf("%s: write %d%s\n", __func__,
len, len ? "" : " - means EOF");
if (len > 0) {
if (!called)
event_add(arg, NULL);
evutil_closesocket(pair[0]);
} el... | false | false | false | false | false | 0 |
unwind_dynamic_extent(void)
{
if (NULLP(l_current_dynamic_extent))
PLAIN_ERR("corrupted dynamic extent");
l_current_dynamic_extent = CDR(l_current_dynamic_extent);
} | false | false | false | false | false | 0 |
feedback_timer_expired (GstClock *clock, GstClockTime time, GstClockID id,
gpointer user_data)
{
struct TimerData *td = user_data;
struct TrackedSource *src;
guint64 now;
if (time == GST_CLOCK_TIME_NONE)
return FALSE;
GST_OBJECT_LOCK (td->self);
src = g_hash_table_lookup (td->self->tfrc_sources,
... | false | false | false | false | false | 0 |
gx_ciedefg_to_icc(gs_color_space **ppcs_icc, gs_color_space *pcs, gs_memory_t *memory)
{
int code = 0;
gs_color_space *palt_cs = pcs->base_space;
gx_cie_vector_cache *abc_caches = &(pcs->params.abc->caches.DecodeABC.caches[0]);
gx_cie_scalar_cache *lmn_caches = &(pcs->params.abc->common.caches.Decode... | false | false | false | false | false | 0 |
demand_type(class_id type)
{
type_index_t::iterator p = type_position(type);
if (p != type_index().end() && tuples::get<ksrc_static_t>(*p) == type)
return p;
vertex_t v = add_vertex(full_graph().topology());
vertex_t v2 = add_vertex(up_graph().topology());
unused_variable(v2)... | false | false | false | false | false | 0 |
CloneBasicBlock(const BasicBlock *BB,
ValueToValueMapTy &VMap,
const Twine &NameSuffix, Function *F,
ClonedCodeInfo *CodeInfo) {
BasicBlock *NewBB = BasicBlock::Create(BB->getContext(), "", F);
if (BB->hasName()) N... | false | false | false | false | false | 0 |
split_edge_bb_loc (edge edge_in)
{
basic_block dest = edge_in->dest;
basic_block dest_prev = dest->prev_bb;
if (dest_prev)
{
edge e = find_edge (dest_prev, dest);
if (e && !(e->flags & EDGE_COMPLEX))
return edge_in->src;
}
return dest_prev;
} | false | false | false | false | false | 0 |
shape_button_release(gpaint_tool *tool, int x, int y)
{
gpaint_shape *shape = GPAINT_SHAPE(tool);
if (shape->anchor.defined)
{
if (shape->drag.defined)
{
(*shape->draw)(shape, FALSE);
}
shape_stop_banding(shape);
set_point(&shape->drag, x ,y);
... | false | false | false | false | false | 0 |
squash_spaces(char *s)
{
char *r = s; /* reading point */
char *w = s; /* writing point */
TBOOLEAN space = FALSE; /* TRUE if we've already copied a space */
for (w = r = s; *r != NUL; r++) {
if (isspace((unsigned char) *r)) {
/* white space; only copy if we haven't just copied a space */
if... | false | false | false | false | false | 0 |
zend_objects_clone_members(zend_object *new_object, zend_object_value new_obj_val, zend_object *old_object, zend_object_handle handle TSRMLS_DC)
{
int i;
if (old_object->properties_table) {
if (!new_object->properties_table) {
new_object->properties_table = emalloc(sizeof(zval*) * old_object->ce->default_proper... | false | false | false | false | false | 0 |
host_addr_lookup(const char *hostname, struct sockaddr *addr)
{
struct host *h = host_lookup(hostname);
#if 0
struct gfarm_hash_iterator it;
struct sockaddr_in *addr_in;
struct hostent *hp;
int i;
#endif
if (h != NULL)
return (h);
if (addr->sa_family != AF_INET)
return (NULL);
#if 0
/*
* skip the follow... | false | false | false | false | false | 0 |
sjlj_assign_call_site_values (void)
{
htab_t ar_hash;
int i, disp_index;
eh_landing_pad lp;
vec_alloc (crtl->eh.action_record_data, 64);
ar_hash = htab_create (31, action_record_hash, action_record_eq, free);
disp_index = 0;
call_site_base = 1;
for (i = 1; vec_safe_iterate (cfun->eh->lp_array, i, &lp)... | false | false | false | false | false | 0 |
OutputBestHypo(const Moses::TrellisPath &path, long /*translationId*/, bool reportSegmentation, bool reportAllFactors, std::ostream &out)
{
const std::vector<const Hypothesis *> &edges = path.GetEdges();
for (int currEdge = (int)edges.size() - 1 ; currEdge >= 0 ; currEdge--) {
const Hypothesis &edge = *edges[c... | false | false | false | false | false | 0 |
acpi_bus_scan(acpi_handle handle)
{
void *device = NULL;
if (ACPI_SUCCESS(acpi_bus_check_add(handle, 0, NULL, &device)))
acpi_walk_namespace(ACPI_TYPE_ANY, handle, ACPI_UINT32_MAX,
acpi_bus_check_add, NULL, NULL, &device);
if (device) {
acpi_bus_attach(device);
return 0;
}
return -ENODEV;
} | false | false | false | false | false | 0 |
upap_input(unit, inpacket, l)
int unit;
u_char *inpacket;
int l;
{
upap_state *u = &upap[unit];
u_char *inp;
u_char code, id;
int len;
/*
* Parse header (code, id and length).
* If packet too short, drop it.
*/
inp = inpacket;
if (l < UPAP_HEADERLEN) {
UPAPDEBUG(... | false | false | false | false | false | 0 |
CheckConstraintFetch(Relation relation)
{
ConstrCheck *check = relation->rd_att->constr->check;
int ncheck = relation->rd_att->constr->num_check;
Relation conrel;
SysScanDesc conscan;
ScanKeyData skey[1];
HeapTuple htup;
Datum val;
bool isnull;
int found = 0;
ScanKeyInit(&skey[0],
Anum_pg_constrain... | false | false | false | false | true | 1 |
netsnmp_enable_filelog(netsnmp_log_handler *logh, int dont_zero_log)
{
FILE *logfile;
if (!logh)
return;
if (!logh->magic) {
logfile = fopen(logh->token, dont_zero_log ? "a" : "w");
if (!logfile) {
snmp_log_perror(logh->token);
return;
}
logh->magic = (voi... | false | false | false | false | true | 1 |
initGcThreads (nat from USED_IF_THREADS, nat to USED_IF_THREADS)
{
#if defined(THREADED_RTS)
nat i;
if (from > 0) {
gc_threads = stgReallocBytes (gc_threads, to * sizeof(gc_thread*),
"initGcThreads");
} else {
gc_threads = stgMallocBytes (to * sizeof(gc... | false | false | false | false | false | 0 |
mono_image_close_finish (MonoImage *image)
{
int i;
if (image->references && !image->dynamic) {
for (i = 0; i < image->nreferences; i++) {
if (image->references [i] && image->references [i] != REFERENCE_MISSING)
mono_assembly_close_finish (image->references [i]);
}
g_free (image->references);
image->... | false | false | false | false | false | 0 |
formatint(char *buf, size_t buflen, int flags,
int prec, int type, PyObject *v)
{
/* fmt = '%#.' + `prec` + 'l' + `type`
worst case length = 3 + 19 (worst len of INT_MAX on 64-bit machine)
+ 1 + 1 = 24 */
char fmt[64]; /* plenty big enough! */
char *sign;
long x;
x = P... | false | false | false | false | false | 0 |
rs_tpc_perform(struct iwl_mvm *mvm,
struct ieee80211_sta *sta,
struct iwl_lq_sta *lq_sta,
struct iwl_scale_tbl_info *tbl)
{
struct iwl_mvm_sta *mvm_sta = iwl_mvm_sta_from_mac80211(sta);
struct ieee80211_vif *vif = mvm_sta->vif;
struct ieee80211_chanctx_conf *chanctx_conf;
enum ieee80211_band band;... | false | false | false | false | false | 0 |
fetch_rgrps(struct gfs2_sbd *sdp)
{
enum rgindex_trust_level trust_lvl;
int rgcount, sane = 1;
const char *level_desc[] = {
_("Checking if all rgrp and rindex values are good"),
_("Checking if rindex values may be easily repaired"),
_("Calculating where the rgrps should be if evenly spaced"),
_("Trying to r... | false | false | false | false | false | 0 |
countLatticePaths(unsigned xLen,unsigned yLen){
uint64_t** matrix = alloc2dMatrix(xLen+1,yLen+1,sizeof(**matrix));
uint64_t count = 0;
if(!matrix){
return 0;
}
for(int y = 0; y <= yLen; y++){
matrix[xLen][y] = 1;
}
for(int x = 0; x <= xLen; x++){
matrix[x][yLen] = 1;
}
for(int y = yLen-1; y >= 0 ; y--... | false | false | false | false | false | 0 |
xmlSerializeHexCharRef(unsigned char *out, int val) {
unsigned char *ptr;
*out++ = '&';
*out++ = '#';
*out++ = 'x';
if (val < 0x10) ptr = out;
else if (val < 0x100) ptr = out + 1;
else if (val < 0x1000) ptr = out + 2;
else if (val < 0x10000) ptr = out + 3;
else if (val < 0x100000) p... | 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.