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 |
|---|---|---|---|---|---|---|
push_machine_destroy(void *p)
{
WSPPushMachine *m = NULL;
if (p == NULL)
return;
m = p;
debug("wap.wsp", 0, "Destroying WSPPushMachine %ld",
m->transaction_id);
#define INTEGER(name)
#define ADDRTUPLE(name) wap_addr_tuple_destroy(m->name);
#define HTTPH... | false | false | false | false | false | 0 |
polarTrackToggle(bool state)
{
snaps[PolarTrack] = state;
if (state == true)
snaps[PolarSnap] = true;
update();
} | false | false | false | false | false | 0 |
handleAreaChangedWidth(PG_ScrollArea* area, Uint16 w) {
CalcScrollbarVisibility();
Sint32 max_x = my_scrollarea->GetAreaWidth() - my_scrollarea->GetScrollPosX();
if(max_x < my_scrollarea->my_width) {
max_x = my_scrollarea->GetAreaWidth() - my_scrollarea->my_width;
if(max_x < 0) {
max_x = 0;
}
my_scrollar... | false | false | false | false | false | 0 |
mousePressEvent(QMouseEvent *event) {
m_dragStartPos = event->pos();
QListWidget::mousePressEvent(event);
QListWidgetItem * current = currentItem();
if (current == NULL) {
m_hoverItem = NULL;
if (m_infoView != NULL) m_infoView->viewItemInfo(NULL, NULL, false);
return;
}
showInfo(current);
if (m_inf... | false | false | false | false | false | 0 |
c_pleop(void)
{
if (plsc->level < 1) {
plabort("pleop: Please call plinit first");
return;
}
plsc->cursub = plsc->nsubx * plsc->nsuby;
plP_eop();
} | false | false | false | false | false | 0 |
idle_async_error_reply_cb (gpointer user_data)
{
struct idle_async_error_reply_data *data = user_data;
g_return_val_if_fail (data != NULL, FALSE);
g_return_val_if_fail (data->ecal != NULL, FALSE);
async_open_report_result (data->ecal, data->error);
g_object_unref (data->ecal);
if (data->error)
g_error_free (... | false | false | false | false | false | 0 |
bind_iptux_port()
{
struct sockaddr_in addr;
int tcpsock, udpsock;
tcpsock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
socket_enable_reuse(tcpsock);
udpsock = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP);
socket_enable_reuse(udpsock);
socket_enable_broadcast(udpsock... | false | false | false | false | false | 0 |
set_sock_lock(int i, SMutex *m)
{
sockets *ss = get_sockets(i);
if (ss)
{
ss->lock = m;
LOG("%s: sock_id %d locks also mutex %p", __FUNCTION__, i, m);
}
} | false | false | false | false | false | 0 |
gst_encoding_profile_get_input_caps (GstEncodingProfile * profile)
{
GstCaps *out, *tmp;
GList *ltmp;
GstStructure *st, *outst;
GQuark out_name;
guint i, len;
GstCaps *fcaps;
if (GST_IS_ENCODING_CONTAINER_PROFILE (profile)) {
GstCaps *res = gst_caps_new_empty ();
for (ltmp = GST_ENCODING_CONTAIN... | false | false | false | true | false | 1 |
blob_read (GsfInput *input, size_t num_bytes, guint8 *optional_buffer)
{
GsfStructuredBlob *blob = (GsfStructuredBlob *) input;
guchar const *src = blob->data->buf;
if (src == NULL)
return NULL;
if (optional_buffer) {
memcpy (optional_buffer, src + input->cur_offset, num_bytes);
return optional_buffer;
} el... | false | false | false | false | false | 0 |
dofopen(Void)
{
register expptr p;
if( (p = V(IOSUNIT)) && ISINT(p->headblock.vtype) )
ioset(TYIOINT, XUNIT, cpexpr(p) );
else
err("bad unit in open");
if( (p = V(IOSFILE)) )
if(p->headblock.vtype == TYCHAR)
ioset(TYIOINT, XFNAMELEN, cpexpr(p->headblock.vleng) );
else
err("bad file in open");
ioset... | false | false | false | false | false | 0 |
label_border(const Color& col)
{
length len(the_label_style().label_border().width());
the_label_style().label_border(pen_data(col, len));
} | false | false | false | false | false | 0 |
CDB___dbenv_close(dbenv, flags)
DB_ENV *dbenv;
u_int32_t flags;
{
int ret;
COMPQUIET(flags, 0);
PANIC_CHECK(dbenv);
ret = CDB___dbenv_refresh(dbenv);
/* Discard the structure if we allocated it. */
if (!F_ISSET(dbenv, DB_ENV_USER_ALLOC)) {
memset(dbenv, CLEAR_BYTE, sizeof(DB_ENV));
CDB___os_free(dbenv, ... | false | false | false | false | false | 0 |
CheckForEvents(PLStream *pls)
{
XwDev *dev = (XwDev *) pls->dev;
if (dev->is_main &&
! pls->plbuf_read &&
++dev->instr % dev->max_instr == 0) {
dev->instr = 0;
HandleEvents(pls);
}
} | false | false | false | false | false | 0 |
rport_fast_io_fail_timedout(struct work_struct *work)
{
struct srp_rport *rport = container_of(to_delayed_work(work),
struct srp_rport, fast_io_fail_work);
struct Scsi_Host *shost = rport_to_shost(rport);
pr_info("fast_io_fail_tmo expired for SRP %s / %s.\n",
dev_name(&rport->dev), dev_name(&shost->shost_gen... | false | false | false | false | false | 0 |
au_debug_init(void)
{
aufs_bindex_t bindex;
struct au_vdir_destr destr;
bindex = -1;
AuDebugOn(bindex >= 0);
destr.len = -1;
AuDebugOn(destr.len < NAME_MAX);
#ifdef CONFIG_4KSTACKS
pr_warn("CONFIG_4KSTACKS is defined.\n");
#endif
return 0;
} | false | false | false | false | false | 0 |
cb_complete_run (CutRunContext *run_context, gboolean success,
CutConsoleUI *console)
{
CutVerboseLevel verbose_level;
notify(console, run_context, success);
verbose_level = console->verbose_level;
if (verbose_level < CUT_VERBOSE_LEVEL_NORMAL)
return;
if (verbose_level ==... | false | false | false | false | false | 0 |
supported_platform(struct s3_info_platform *nicid,
struct srec_data *srec, int dl_mode)
{
int i;
if (dl_mode == MODE_GENESIS &&
(skip_pda_read ||
(ignore_incompatible_interface &&
srec->component.component == HFA384X_COMP_ID_PRI))) {
/* No PRI f/w - NIC/PRI/STA versions were not read */
... | false | false | false | false | false | 0 |
time_str2secs(const char *string)
{
uint16_t has_dash;
uint16_t num_colon;
char days[24] = {0};
char hours[24] = {0};
char minutes[24] = {0};
char seconds[24] = {0};
char *timestr;
char *p;
int d;
int h;
int m;
int s;
int n;
int cc;
if ((string == NULL) || (string[0] == '\0'))
return NO_VAL; /* invali... | false | false | false | false | false | 0 |
setTriangleData(ITerrainSceneNode* node, s32 LOD)
{
core::triangle3df tri;
core::array<u32> indices;
// Get pointer to the GeoMipMaps vertices
video::S3DVertex2TCoords* vertices = static_cast<video::S3DVertex2TCoords*>(node->getRenderBuffer()->getVertices());
// Clear current data
const s32 count = (st... | false | false | false | false | false | 0 |
composePluginKey(string libraryName, string identifier)
{
string basename = libraryName;
string::size_type li = basename.rfind('/');
if (li != string::npos) basename = basename.substr(li + 1);
li = basename.find('.');
if (li != string::npos) basename = basename.substr(0, li);
for (size_t i = ... | false | false | false | false | false | 0 |
tesc_enq_wq (chn_t *ch, msg_t *m)
{
int fd = ch->fd;
struct fdio *fdio;
if (fd < 0 || fd >= FDMAPSIZ) {
/* illegal fd */
return -1;
}
#ifdef DEBUG
if (! (ch->flags & CHN_F_WR)) {
/* not open for writing */
return -1;
}
#endif
if (! schdat.fdio[fd]) {
/* allocate fdio structure */
schdat.fdi... | false | false | false | false | false | 0 |
icalproperty_new_clone(icalproperty* prop)
{
struct icalproperty_impl *old = (struct icalproperty_impl*)prop;
struct icalproperty_impl *new = icalproperty_new_impl(old->kind);
pvl_elem p;
icalerror_check_arg_rz((prop!=0),"Prop");
icalerror_check_arg_rz((old!=0),"old");
icalerror_check_arg_rz((n... | false | false | false | false | false | 0 |
update_preferences_portnumber(GtkWidget * wid)
{
GtkWidget *vbox = (GtkWidget *) gtk_builder_get_object(connection_pref_xml, "connection-vbox");
gulong *a = g_object_get_data(G_OBJECT(vbox), "profile-signal-handler");
GtkComboBox *combo = (GtkComboBox *) gtk_builder_get_object(connection_pref_xml, "cb_profiles");
G... | false | false | false | false | false | 0 |
brasero_io_new_file_info_job (const gchar *uri,
const BraseroIOJobBase *base,
BraseroIOFlags options,
BraseroIOResultCallbackData *callback_data)
{
BraseroIOJob *job;
job = g_new0 (BraseroIOJob, 1);
brasero_io_set_job (job,
base,
uri,
options,
callback_data);
... | false | false | false | false | false | 0 |
SetNumberOfLevels(unsigned int numLevels)
{
this->Superclass::SetNumberOfChildren(numLevels);
// Initialize each level with a vtkMultiPieceDataSet.
// vtkMultiPieceDataSet is an overkill here, since the datasets with in a
// level cannot be composite datasets themselves.
// This will make is possible for t... | false | false | false | false | false | 0 |
endProgressOperation( QObject *owner )
{
QMutexLocker locker( &m_mutex );
if( !m_progressMap.contains( owner ) )
return ;
childBarComplete( m_progressMap.value( owner ) );
} | false | false | false | false | false | 0 |
mbfl_ja_jp_hantozen(
mbfl_string *string,
mbfl_string *result,
int mode)
{
int n;
unsigned char *p;
const mbfl_encoding *encoding;
mbfl_memory_device device;
struct collector_hantozen_data pc;
mbfl_convert_filter *decoder;
mbfl_convert_filter *encoder;
/* initialize */
if (string == NULL || result... | false | false | false | false | false | 0 |
mark_phosts_unavailable_support(const void *name, unsigned len, void *value) {
struct host_decl *h;
struct iaddrcidrnetlist *l;
struct in6_addr pref;
struct ipv6_pool *p;
h = (struct host_decl *)value;
/*
* If the host has no prefix, we don't need to mark anything.
*/
if (h->fixed_prefix == NULL) {
retur... | false | false | false | false | false | 0 |
ssl_set_hostname( ssl_context *ssl, const char *hostname )
{
if( hostname == NULL )
return( POLARSSL_ERR_SSL_BAD_INPUT_DATA );
ssl->hostname_len = strlen( hostname );
ssl->hostname = (unsigned char *) malloc( ssl->hostname_len + 1 );
memcpy( ssl->hostname, (unsigned char *) hostname,
... | false | true | false | false | false | 1 |
apprvalue(VALUE *v1, VALUE *v2, VALUE *v3, VALUE *vres)
{
NUMBER *e;
long R = 0;
NUMBER *q1, *q2;
COMPLEX *c;
vres->v_type = v1->v_type;
vres->v_subtype = V_NOSUBTYPE;
if (v1->v_type <= 0)
return;
e = NULL;
switch(v2->v_type) {
case V_NUM: e = v2->v_num;
break;
case V_NULL: e = conf->epsilon;
break... | false | false | false | false | false | 0 |
__quotestrfmt(int runesin, Fmt *f)
{
int nin, outlen;
Rune *r;
char *s;
Quoteinfo q;
nin = -1;
if(f->flags&FmtPrec)
nin = f->prec;
if(runesin){
r = va_arg(f->args, Rune *);
s = nil;
}else{
s = va_arg(f->args, char *);
r = nil;
}
if(!s && !r)
return __fmtcpy(f, (void*)"<nil>", 5, 5);
if(f->flush... | false | false | false | false | false | 0 |
beginXMLPlug( QWidget* w )
{
actionCollection()->addAssociatedWidget( w );
foreach (KXMLGUIClient* client, d->m_children)
client->beginXMLPlug( w );
} | false | false | false | false | false | 0 |
gf_dash_set_group_udta(GF_DashClient *dash, u32 idx, void *udta)
{
GF_DASH_Group *group = gf_list_get(dash->groups, idx);
if (!group) return GF_BAD_PARAM;
group->udta = udta;
return GF_OK;
} | false | false | false | false | false | 0 |
test_qof_object_compliance( Fixture *fixture, gconstpointer pData )
{
g_assert( qof_object_register( fixture->qofobject ) );
g_test_message( "Test when neither create nor foreach set" );
g_assert( qof_object_compliance( fixture->qofobject->e_type, FALSE ) == FALSE );
g_assert( qof_object_compliance( fi... | false | false | false | false | false | 0 |
gst_deinterleave_set_process_function (GstDeinterleave * self)
{
switch (GST_AUDIO_INFO_WIDTH (&self->audio_info)) {
case 8:
self->func = (GstDeinterleaveFunc) deinterleave_8;
break;
case 16:
self->func = (GstDeinterleaveFunc) deinterleave_16;
break;
case 24:
self->func = (Gs... | false | false | false | false | false | 0 |
_clutter_threads_dispatch (gpointer data)
{
ClutterThreadsDispatch *dispatch = data;
gboolean ret = FALSE;
_clutter_threads_acquire_lock ();
if (!g_source_is_destroyed (g_main_current_source ()))
ret = dispatch->func (dispatch->data);
_clutter_threads_release_lock ();
return ret;
} | false | false | false | false | false | 0 |
omapi_waiter_signal_handler (omapi_object_t *h,
const char *name, va_list ap)
{
omapi_waiter_object_t *waiter;
if (h -> type != omapi_type_waiter)
return DHCP_R_INVALIDARG;
if (!strcmp (name, "ready")) {
waiter = (omapi_waiter_object_t *)h;
waiter -> ready = 1;
waiter -> waitstatus = ISC_R_SUCCESS;... | false | false | false | false | false | 0 |
ion_sync_for_device(struct ion_client *client, int fd)
{
struct dma_buf *dmabuf;
struct ion_buffer *buffer;
dmabuf = dma_buf_get(fd);
if (IS_ERR(dmabuf))
return PTR_ERR(dmabuf);
/* if this memory came from ion */
if (dmabuf->ops != &dma_buf_ops) {
pr_err("%s: can not sync dmabuf from another exporter\n",
... | false | false | false | false | false | 0 |
live_track_live_p (live_track_p ptr, tree var)
{
int p, root;
p = var_to_partition (ptr->map, var);
if (p != NO_PARTITION)
{
root = basevar_index (ptr->map, p);
if (bitmap_bit_p (ptr->live_base_var, root))
return bitmap_bit_p (ptr->live_base_partitions[root], p);
}
return false;
} | false | false | false | false | false | 0 |
addbut_clicked_cb (GtkButton *button, GtkSatSelector *selector)
{
GtkListStore *store;
gint catnum = 0;
gchar *name;
gdouble epoch;
/* get the selected row in the treeview */
gtk_sat_selector_get_selected (selector, &catnum, &name, &epoch);
if (catnum) {
/* Ad... | false | false | false | false | false | 0 |
iommu_domain_window_enable(struct iommu_domain *domain, u32 wnd_nr,
phys_addr_t paddr, u64 size, int prot)
{
if (unlikely(domain->ops->domain_window_enable == NULL))
return -ENODEV;
return domain->ops->domain_window_enable(domain, wnd_nr, paddr, size,
prot);
} | false | false | false | false | false | 0 |
ldm_get_disk_objid (const struct ldmdb *ldb)
{
struct list_head *item;
BUG_ON (!ldb);
list_for_each (item, &ldb->v_disk) {
struct vblk *v = list_entry (item, struct vblk, list);
if (!memcmp (v->vblk.disk.disk_id, ldb->ph.disk_id, GUID_SIZE))
return v;
}
return NULL;
} | false | false | false | false | false | 0 |
cpp_packages_load (CppPackages* packages, gboolean force)
{
CppJavaPlugin* plugin = ANJUTA_PLUGIN_CPP_JAVA(packages->plugin);
if (g_settings_get_boolean (plugin->settings,
PREF_PROJECT_PACKAGES))
{
IAnjutaProjectManager* pm =
anjuta_shell_get_interface (packages->plugin->shell, IAn... | false | false | false | false | false | 0 |
mca_base_component_to_string(const mca_base_component_t *a) {
char * str = NULL;
if(0 > asprintf(&str, "%s.%s.%d.%d", a->mca_type_name,
a->mca_component_name, a->mca_component_major_version,
a->mca_component_minor_version)) {
return NULL;
}
return str;
} | false | false | false | false | false | 0 |
fatal_error_task(struct work_struct *work)
{
struct adapter *adapter = container_of(work, struct adapter,
fatal_error_handler_task);
int err = 0;
rtnl_lock();
err = t3_adapter_error(adapter, 1, 1);
if (!err)
err = t3_reenable_adapter(adapter);
if (!err)
t3_resume_ports(adapter);
CH_ALERT(adapte... | false | false | false | false | false | 0 |
find_split(JSContext *cx, JSString *str, JSRegExp *re, jsint *ip,
JSSubString *sep)
{
jsint i, j, k;
size_t length;
jschar *chars;
/*
* Stop if past end of string. If at end of string, we will compare the
* null char stored there (by js_NewString*) to sep->chars[j] in the while
... | false | false | false | false | false | 0 |
resizeWindow(int width, int height)
{
// log_debug("GtkGui: Window resize request received");
if (!_xid) {
// This sets the *minimum* size for the drawing area and thus will
// also resize the window if needed.
// Advantage: The window is sized correctly, no matter what other
... | false | false | false | false | false | 0 |
dump_ring(Ring *ring)
{
char *buf = malloc(256*ring->n);
int i;
buf[0] = '\0';
for (i=0; i<ring->n; i++)
{
if (i) strcat(buf, ",");
sprintf(buf+strlen(buf), "%g %g",
ring->list[i].x,
ring->list[i].y);
}
return buf;
} | false | false | false | false | false | 0 |
DestroyChild( int iChild )
{
if( iChild < 0 || iChild >= nChildren )
return;
delete papoChildNodes[iChild];
while( iChild < nChildren-1 )
{
papoChildNodes[iChild] = papoChildNodes[iChild+1];
iChild++;
}
nChildren--;
} | false | false | false | false | false | 0 |
frame_get_level(struct jq_state* jq, int level) {
stack_ptr fr = jq->curr_frame;
for (int i=0; i<level; i++) {
struct frame* fp = stack_block(&jq->stk, fr);
fr = fp->env;
}
return fr;
} | false | false | false | false | false | 0 |
tasklet_action(struct softirq_action *a)
{
struct tasklet_struct *list;
local_irq_disable();
list = __this_cpu_read(tasklet_vec.head);
__this_cpu_write(tasklet_vec.head, NULL);
__this_cpu_write(tasklet_vec.tail, this_cpu_ptr(&tasklet_vec.head));
local_irq_enable();
while (list) {
struct tasklet_struct *t = l... | false | false | false | false | false | 0 |
entry_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
GObject * obj;
GObjectClass * parent_class;
Entry * self;
FriendsGtkEntry* _tmp0_;
FriendsGtkEntry* entry;
FriendsGtkEntry* _tmp1_;
parent_class = G_OBJECT_CLASS (entry_parent_class);
obj = parent_class-... | false | false | false | false | false | 0 |
jj_consume_token(const int32_t kind)
{
QueryToken* oldToken = token;
if (token->next != NULL)
token = token->next;
else
token = token->next = token_source->getNextToken();
jj_ntk = -1;
if (token->kind == kind) {
jj_gen++;
if (++jj_gc > 100) {
jj_gc = 0;
JJCalls* c = jj_2_rtns;
... | false | false | false | false | false | 0 |
sf_int_compare(void *index, Hit *hit1, Hit *hit2)
{
long val1 = ((long *)index)[hit1->doc];
long val2 = ((long *)index)[hit2->doc];
if (val1 > val2) return 1;
else if (val1 < val2) return -1;
else return 0;
} | false | false | false | false | false | 0 |
UtExpandLineBuffers (
void)
{
UINT32 NewSize;
/* Attempt to double the size of all line buffers */
NewSize = Gbl_LineBufferSize * 2;
if (Gbl_CurrentLineBuffer)
{
DbgPrint (ASL_DEBUG_OUTPUT,"Increasing line buffer size from %u to %u\n",
Gbl_LineBufferSize, ... | false | false | false | false | false | 0 |
hdm_poison_channel(struct most_interface *iface, int channel)
{
struct most_dev *mdev;
mdev = to_mdev(iface);
if (unlikely(!iface)) {
dev_warn(&mdev->usb_device->dev, "Poison: Bad interface.\n");
return -EIO;
}
if (unlikely((channel < 0) || (channel >= iface->num_channels))) {
dev_warn(&mdev->usb_device->de... | false | false | false | false | false | 0 |
drawColumn( QPainter *painter,
const QwtColumnRect &rect, const QwtIntervalSample &sample ) const
{
Q_UNUSED( sample );
if ( d_data->symbol &&
( d_data->symbol->style() != QwtColumnSymbol::NoStyle ) )
{
d_data->symbol->draw( painter, rect );
}
else
{
QRectF r = rect.... | false | false | false | false | false | 0 |
get_text_tile_info(int tile_index)
{
int color, tile_number, attrib;
attrib = toaplan2_txvideoram16[tile_index];
tile_number = attrib & 0x3ff;
color = ((attrib >> 10) | 0x40) & 0x7f;
SET_TILE_INFO(
2,
tile_number,
color,
0)
tile_info.priority = 0;
} | false | false | false | false | false | 0 |
vopen()
{
int msg, oyclam;
switch(object) {
case CLAM:
case OYSTER:
oyclam = (object == OYSTER ? 1 : 0);
if (verb == LOCK)
msg = 61;
else if (!toting(TRIDENT))
msg = 122+oyclam;
else if (toting(object))
msg = 120+oyclam;
else {
msg = 124+oyclam;
dstroy(CLAM);
drop(OYSTER,loc);
drop(P... | false | false | false | false | false | 0 |
boxaConvertToPta(BOXA *boxa,
l_int32 ncorners)
{
l_int32 i, n, x, y, w, h;
PTA *pta;
PROCNAME("boxaConvertToPta");
if (!boxa)
return (PTA *)ERROR_PTR("boxa not defined", procName, NULL);
if (ncorners != 2 && ncorners != 4)
return (PTA *)ERROR_PTR("ncorners not 2 o... | false | false | false | false | false | 0 |
Run_HMT_SLAM()
{
CHMTSLAM mapping;
CConfigFile cfgFile( configFile );
std::string rawlogFileName;
// wait for threads init. (Just to do not mix debug strings on console)
sleep(100);
// The rawlog file:
// ----------------------------------------
rawlogFileName = cfgFile.read_string("HMT-SLAM","rawlog_f... | false | false | false | false | false | 0 |
dae_cb_source(DaeGlobalData *global, DaeLocalData *local)
{
gchar *id;
id = dae_xml_get_attr(local->node, "id");
if(id) {
dae_library_add(global->lib, "source", id, local->node);
g_free(id);
return TRUE;
}
return FALSE;
} | false | false | false | false | false | 0 |
gm_audio_profile_choose_get_active (GtkWidget *choose)
{
/* We cannot simply wrap gm_audio_profile_choose_get_active_profile() here,
* since this function can be (and in case of sound-juicer is) called from
* GtkComboBox::changed signal handler. In this situation, code would return
* invalid profile, since w... | false | false | false | false | false | 0 |
strscan_get_byte(VALUE self)
{
struct strscanner *p;
GET_SCANNER(self, p);
CLEAR_MATCH_STATUS(p);
if (EOS_P(p))
return Qnil;
p->prev = p->curr;
p->curr++;
MATCHED(p);
adjust_registers_to_matched(p);
return extract_range(p, p->prev + p->regs.beg[0],
... | false | false | false | false | false | 0 |
r852_read_buf(struct mtd_info *mtd, uint8_t *buf, int len)
{
struct r852_device *dev = r852_get_dev(mtd);
uint32_t reg;
if (dev->card_unstable) {
/* since we can't signal error here, at least, return
predictable buffer */
memset(buf, 0, len);
return;
}
/* special case for whole sector read */
if (len =... | false | false | false | false | false | 0 |
ipw_prom_open(struct net_device *dev)
{
struct ipw_prom_priv *prom_priv = libipw_priv(dev);
struct ipw_priv *priv = prom_priv->priv;
IPW_DEBUG_INFO("prom dev->open\n");
netif_carrier_off(dev);
if (priv->ieee->iw_mode != IW_MODE_MONITOR) {
priv->sys_config.accept_all_data_frames = 1;
priv->sys_config.accept_n... | false | false | false | false | false | 0 |
saveFeaturesToTextFile( const std::string &filename )
{
CFileOutputStream file( filename );
vector<TStereoImageFeatures>::iterator it;
for( it = theFeatures.begin(); it != theFeatures.end(); ++it )
file << format("%u %.2f %.2f %.2f %.2f\n", it->ID, it->pixels.first.x, it->pixels.first.y, it->pixels.second.x, it->... | false | false | false | false | false | 0 |
file_new_window_callback (GtkAction *action,
TerminalWindow *window)
{
TerminalWindowPrivate *priv = window->priv;
TerminalApp *app;
TerminalWindow *new_window;
TerminalProfile *profile;
char *new_working_directory;
app = terminal_app_get ();
profile = g_object_get_data (G_OBJE... | false | false | false | false | false | 0 |
vee_folder_is_unmatched (CamelVeeFolder *vfolder)
{
g_return_val_if_fail (vfolder != NULL, FALSE);
return vfolder->priv->parent_vee_store &&
vfolder == camel_vee_store_get_unmatched_folder (vfolder->priv->parent_vee_store);
} | false | false | false | false | false | 0 |
objlayout_read_pagelist(struct nfs_pgio_header *hdr)
{
struct inode *inode = hdr->inode;
loff_t offset = hdr->args.offset;
size_t count = hdr->args.count;
int err;
loff_t eof;
eof = i_size_read(inode);
if (unlikely(offset + count > eof)) {
if (offset >= eof) {
err = 0;
hdr->res.count = 0;
hdr->res.eo... | false | false | false | false | false | 0 |
pdf_reset_graphics(gx_device_pdf * pdev)
{
if (pdev->vg_initial_set)
pdf_load_viewer_state(pdev, &pdev->vg_initial);
else
pdf_reset_graphics_old(pdev);
pdf_reset_text(pdev);
} | false | false | false | false | false | 0 |
set_state(GList * item)
{
if (item != NULL && item->data != NULL) {
node = item;
matrix_cpy(NULL, item->data);
refresh(REFRESH_IMAGE | REFRESH_STATUS);
}
} | false | false | false | false | false | 0 |
parseMac(char* mac, u_int8_t addr[])
{
int i;
for (i = 0; i < 6; i++) {
long b = strtol(mac+(3*i), (char **) NULL, 16);
addr[i] = (char)b;
}
return 0;
} | false | false | false | false | false | 0 |
qpol_avrule_get_rule_type(const qpol_policy_t * policy, const qpol_avrule_t * rule, uint32_t * rule_type)
{
policydb_t *db = NULL;
avtab_ptr_t avrule = NULL;
if (rule_type) {
*rule_type = 0;
}
if (!policy || !rule || !rule_type) {
ERR(policy, "%s", strerror(EINVAL));
errno = EINVAL;
return STATUS_ERR;
}... | false | false | false | false | false | 0 |
my_mb_wc_big5(CHARSET_INFO *cs __attribute__((unused)),
my_wc_t *pwc,const uchar *s,const uchar *e)
{
int hi;
if (s >= e)
return MY_CS_TOOSMALL;
if ((hi= s[0]) < 0x80)
{
pwc[0]=hi;
return 1;
}
if (s+2>e)
return MY_CS_TOOSMALL2;
if (!(pwc[0]=func_big5_uni_onechar((hi<<8)+s... | false | false | false | false | false | 0 |
MainWindow()
{
m_main = new MainArea();
QGraphicsView* view = new QGraphicsView(m_main, this);
view->setOptimizationFlags( QGraphicsView::DontClipPainter |
QGraphicsView::DontSavePainterState |
QGraphicsView::DontAdjustForAntialiasing );
// ... | false | false | false | false | false | 0 |
Rivet_ChildHandlers(server_rec *s, int init)
{
server_rec *sr;
rivet_server_conf *rsc;
rivet_server_conf *top;
void *function;
void *parentfunction;
char *errmsg;
top = RIVET_SERVER_CONF(s->module_config);
if (init == 1) {
parentfunction = top->rivet_child_init_script;
e... | false | false | false | false | false | 0 |
osinfo_product_add_related(OsinfoProduct *product, OsinfoProductRelationship relshp, OsinfoProduct *otherproduct)
{
g_return_if_fail(OSINFO_IS_PRODUCT(product));
g_return_if_fail(OSINFO_IS_PRODUCT(otherproduct));
struct _OsinfoProductProductLink *productLink = g_new0(struct _OsinfoProductProductLink, 1);
... | false | false | false | false | false | 0 |
lcrt_connect_on_selection_changed(GtkWidget *widget, gpointer user_data)
{
struct lcrt_connect *lconnect = (struct lcrt_connect *)user_data;
struct lcrt_window *lwindow = lconnect->parent;
struct lcrtc_user *user;
debug_where();
GtkTreeIter iter;
GtkTreeModel *model;
GtkTreeView *treeview =... | false | false | false | true | false | 1 |
ossl_pkcs7_sym2typeid(VALUE sym)
{
int i, ret = Qnil;
const char *s;
static struct {
const char *name;
int nid;
} p7_type_tab[] = {
{ "signed", NID_pkcs7_signed },
{ "data", NID_pkcs7_data },
{ "signedAndEnveloped", NID_pkcs7_signedAndEn... | false | false | false | false | false | 0 |
sal_sem_give(sal_sem_t b)
{
sem_ctrl_t *s = (sem_ctrl_t *) b;
up(&s->sem);
if (s->binary) {
s->cnt++;
wake_up_interruptible(&s->wq);
}
return 0;
} | false | false | false | false | false | 0 |
_image_array_count(GiImage **img_array)
{
cxint count = 0;
if (img_array == NULL) {
return 0;
}
while (img_array[count] != NULL) {
count++;
}
return count;
} | false | false | false | false | false | 0 |
bwrite(fd,loc,num)
register int fd;
register genericptr_t loc;
register unsigned num;
{
boolean failed;
#ifdef MFLOPPY
bytes_counted += num;
if (count_only) return;
#endif
#ifdef UNIX
if (buffering) {
if(fd != bw_fd)
panic("unbuffered write to fd %d (!= %d)", fd, bw_fd);
failed = (fwrite(loc, (int)nu... | false | false | false | false | false | 0 |
do_content_length_framing_test (void)
{
SoupSession *session;
SoupMessage *msg;
SoupURI *request_uri;
goffset declared_length;
debug_printf (1, "\nInvalid Content-Length framing tests\n");
session = soup_test_session_new (SOUP_TYPE_SESSION_ASYNC, NULL);
debug_printf (1, " Content-Length larger than message b... | false | false | false | false | false | 0 |
addGlobalName(StringRef Name, DIE &Die,
const DIScope *Context) {
if (includeMinimalInlineScopes())
return;
std::string FullName = getParentContextString(Context) + Name.str();
GlobalNames[FullName] = &Die;
} | false | false | false | false | false | 0 |
btreeIdentDupInsert(AjPBtcache cache, const AjPBtId newid,
AjPBtId curid)
{
AjPBtpage page;
AjPBtpage rpage;
ajulong secrootpage = 0UL;
unsigned char *buf;
ajulong right = 0UL;
ajulong refoffsets[1000];
AjPBtNumId num = NULL;
AjOBtNumId numobj = {0UL, refo... | false | false | false | false | false | 0 |
fs_configure (GnomeScanPlugin *plugin,
GnomeScanSettings *settings)
{
FlegitaSink *sink = FLEGITA_SINK (plugin);
FlegitaSinkPrivate *priv = GET_PRIVATE (sink);
#if 0
priv->action = gnome_scan_settings_get_enum (settings,
"flegita-action",
FLEGITA_TYPE_ACTION);
#else
priv->action... | false | false | false | false | false | 0 |
parse_from_encoding(std::string const &locale_name)
{
size_t end = locale_name.find_first_of("@");
std::string tmp = locale_name.substr(0,end);
if(tmp.empty())
return;
for(unsigned i=0;i<tmp.size();i++) {
if('A' <= tmp[i] && tmp[i]<='Z')
tmp[i... | false | false | false | false | false | 0 |
get_binary_object_header(obj_hdr *hdr, gitfo_buf *obj)
{
unsigned char c;
unsigned char *data = obj->data;
size_t shift, size, used = 0;
if (obj->len == 0)
return 0;
c = data[used++];
hdr->type = (c >> 4) & 7;
size = c & 15;
shift = 4;
while (c & 0x80) {
if (obj->len <= used)
return 0;
if (sizeof(s... | false | false | false | false | false | 0 |
tpacpi_check_quirks(
const struct tpacpi_quirk *qlist,
unsigned int qlist_size)
{
while (qlist_size) {
if ((qlist->vendor == thinkpad_id.vendor ||
qlist->vendor == TPACPI_MATCH_ANY) &&
(qlist->bios == thinkpad_id.bios_model ||
qlist->bios == TPACPI_MATCH_ANY) &&
(qlist->ec == thinkpad_id.ec... | false | false | false | false | false | 0 |
jackctl_add_parameter(
JSList ** parameters_list_ptr_ptr,
char id,
const char * name,
const char * short_description,
const char * long_description,
jackctl_param_type_t type,
union jackctl_parameter_value * value_ptr,
union jackctl_parameter_value * default_value_ptr,
union jackctl_... | false | false | false | false | false | 0 |
perform_single_test(InfTextChunk* initial,
InfTextChunk* final,
GSList* users,
GSList* requests,
gdouble* time)
{
InfTextBuffer* buffer;
InfCommunicationManager* manager;
InfIo* io;
InfTextSession* session;
InfUserTable* user_tab... | false | false | false | false | false | 0 |
InadequacyList__delete (InadequacyList *self)
{
while (self)
{
InadequacyList *node = self;
self = self->next;
bitset_free (node->inadequacy.conflict.actions);
free (node);
}
} | false | false | false | false | false | 0 |
cli_regexec(const regex_t *preg, const char *string, size_t nmatch,
regmatch_t pmatch[], int eflags)
{
struct re_guts *g = preg->re_g;
#ifdef REDEBUG
# define GOODFLAGS(f) (f)
#else
# define GOODFLAGS(f) ((f)&(REG_NOTBOL|REG_NOTEOL|REG_STARTEND))
#endif
if (preg->re_magic != MAGIC1 || g->magic != MAGIC2)
retur... | false | false | false | false | false | 0 |
locks_copy_conflock(struct file_lock *new, struct file_lock *fl)
{
new->fl_owner = fl->fl_owner;
new->fl_pid = fl->fl_pid;
new->fl_file = NULL;
new->fl_flags = fl->fl_flags;
new->fl_type = fl->fl_type;
new->fl_start = fl->fl_start;
new->fl_end = fl->fl_end;
new->fl_lmops = fl->fl_lmops;
new->fl_ops = NULL;
i... | false | false | false | false | false | 0 |
mxuport_set_mcr(struct usb_serial_port *port, u8 mcr_state)
{
struct usb_serial *serial = port->serial;
int err;
dev_dbg(&port->dev, "%s - %02x\n", __func__, mcr_state);
err = mxuport_send_ctrl_urb(serial, RQ_VENDOR_SET_MCR,
mcr_state, port->port_number);
if (err)
dev_err(&port->dev, "%s - failed to ch... | false | false | false | false | false | 0 |
AMF_Dump(AMFObject * obj)
{
int n;
Log(LOGDEBUG, "(object begin)");
for (n = 0; n < obj->o_num; n++)
{
AMFProp_Dump(&obj->o_props[n]);
}
Log(LOGDEBUG, "(object end)");
} | false | false | false | false | false | 0 |
I_ReadMouse(void)
{
int x, y;
event_t ev;
#if SDL_VERSION_ATLEAST(1, 3, 0)
SDL_GetRelativeMouseState(0, &x, &y);
#else
SDL_GetRelativeMouseState(&x, &y);
#endif
if (x != 0 || y != 0)
{
ev.type = ev_mouse;
ev.data1 = mouse_button_state;
ev.data2 = AccelerateMouse(x);
... | false | false | false | false | false | 0 |
pkix_pl_CollectionCertStore_GetCert(
PKIX_CertStore *certStore,
PKIX_CertSelector *selector,
PKIX_VerifyNode *verifyNode,
void **pNBIOContext,
PKIX_List **pCerts,
void *plContext)
{
PKIX_PL_CollectionCertStoreContext *colCertStoreContext = NULL;
PKIX_List ... | 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.