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 |
|---|---|---|---|---|---|---|
gk_dialog_for_gconf ( gchar *key, gchar *format, ... )
{
GtkWidget *libgnome_alert_dialog;
GtkWidget *dialog_vbox_libgnome_alert;
GtkWidget *vbox_libgnome_alert;
GtkWidget *message;
GtkWidget *show_message_again;
GtkWidget *dialog_action_area_libgnome_alert;
GtkWidget *closebutton_libgnome_alert;
GdkPi... | false | false | false | false | false | 0 |
acpi_memory_free_device_resources(struct acpi_memory_device *mem_device)
{
struct acpi_memory_info *info, *n;
list_for_each_entry_safe(info, n, &mem_device->res_list, list)
kfree(info);
INIT_LIST_HEAD(&mem_device->res_list);
} | false | false | false | false | false | 0 |
get_fixed_heap_space (size_t s)
{
BYTE_T *z;
if (heap_is_fluid) {
z = HEAP_ADDRESS (fixed_heap_pointer);
fixed_heap_pointer += A68_ALIGN ((int) s);
/* Allow for extra storage for diagnostics etcetera */
ABEND (fixed_heap_pointer >= (heap_size - MIN_MEM_SIZE), ERROR_OUT_OF_CORE, NO_TEXT);
ABEND (((... | false | false | false | false | false | 0 |
filter_get_operator_case (xmmsv_coll_t *coll, gboolean *val)
{
gchar *attr;
if (xmmsv_coll_attribute_get (coll, "case-sensitive", &attr)) {
*val = (strcmp (attr, "true") == 0);
}
else {
*val = FALSE;
}
return TRUE;
} | false | false | false | false | false | 0 |
mp_irqdomain_create(int ioapic)
{
struct irq_alloc_info info;
struct irq_domain *parent;
int hwirqs = mp_ioapic_pin_count(ioapic);
struct ioapic *ip = &ioapics[ioapic];
struct ioapic_domain_cfg *cfg = &ip->irqdomain_cfg;
struct mp_ioapic_gsi *gsi_cfg = mp_ioapic_gsi_routing(ioapic);
if (cfg->type == IOAPIC_DOMA... | false | false | false | false | false | 0 |
open_device (int unitnum, const TCHAR *ident, int flags)
{
int result = 0;
struct scsidevdata *sdd = &drives[unitnum];
DEBUG_LOG ("SCSIDEV: unit = %d: open_device %s\n", unitnum, ident);
DEBUG_LOG ("SCSIDEV: unit = %d, name = %s, fd = %d\n", unitnum, ident, sdd->fd);
if (sdd->fd == -1) {
... | false | false | false | false | false | 0 |
__ecereMethod___ecereNameSpace__ecere__sys__File_GetString(struct __ecereNameSpace__ecere__com__Instance * this, char * string, int max)
{
struct __ecereNameSpace__ecere__sys__File * __ecerePointer___ecereNameSpace__ecere__sys__File = (struct __ecereNameSpace__ecere__sys__File *)(this ? (((char *)this) + __ecereClass__... | false | false | false | true | true | 1 |
test_rebase_setup__orphan_branch(void)
{
git_rebase *rebase;
git_reference *branch_ref, *upstream_ref;
git_annotated_commit *branch_head, *upstream_head;
git_reference *head;
git_commit *head_commit;
git_oid head_id;
cl_assert_equal_i(GIT_REPOSITORY_STATE_NONE, git_repository_state(repo));
cl_git_pass(git_ref... | false | false | false | false | false | 0 |
setup_modpack_list(const char *name, const char *URL,
const char *version, const char *license,
enum modpack_type type)
{
GtkTreeIter iter;
const char *type_str;
const char *lic_str;
if (modpack_type_is_valid(type)) {
type_str = _(modpack_type_n... | false | false | false | false | false | 0 |
hv_pcifront_write_config(struct pci_bus *bus, unsigned int devfn,
int where, int size, u32 val)
{
struct hv_pcibus_device *hbus =
container_of(bus->sysdata, struct hv_pcibus_device, sysdata);
struct hv_pci_dev *hpdev;
hpdev = get_pcichild_wslot(hbus, devfn_to_wslot(devfn));
if (!hpdev)
return PCIBIO... | false | false | false | false | false | 0 |
MakeAdtsHeader(int *dataSize, NeAACDecFrameInfo *hInfo, int old_format)
{
unsigned char *data;
int profile = (hInfo->object_type - 1) & 0x3;
int sr_index = ((hInfo->sbr == SBR_UPSAMPLED) || (hInfo->sbr == NO_SBR_UPSAMPLED)) ?
FindAdtsSRIndex(hInfo->samplerate / 2) : FindAdtsSRIndex(hInfo->samplerate... | false | false | false | false | false | 0 |
i40e_fdir_teardown(struct i40e_pf *pf)
{
int i;
i40e_fdir_filter_exit(pf);
for (i = 0; i < pf->num_alloc_vsi; i++) {
if (pf->vsi[i] && pf->vsi[i]->type == I40E_VSI_FDIR) {
i40e_vsi_release(pf->vsi[i]);
break;
}
}
} | false | false | false | false | false | 0 |
offset_of_next_item(const char *begin, size_t mmap_length, history_file_type_t mmap_type, size_t *inout_cursor, time_t cutoff_timestamp)
{
size_t result;
switch (mmap_type)
{
case history_type_fish_2_0:
result = offset_of_next_item_fish_2_0(begin, mmap_length, inout_cursor, cutoff_timest... | false | false | false | false | false | 0 |
setup(PROJ *P) { /* general initialization */
double t;
if (fabs((t = fabs(P->phi0)) - HALFPI) < EPS10)
P->mode = P->phi0 < 0. ? S_POLE : N_POLE;
else
P->mode = t > EPS10 ? OBLIQ : EQUIT;
P->phits = fabs(P->phits);
if (P->es) {
switch (P->mode) {
case N_POLE:
case S_POLE:
if (fabs(P... | false | false | false | false | false | 0 |
create_transport(struct web_session *session)
{
int err;
err = connect_session_transport(session);
if (err < 0)
return err;
debug(session->web, "creating session %s:%u",
session->address, session->port);
return 0;
} | false | false | false | false | false | 0 |
acpi_bus_attach(struct acpi_device *device)
{
struct acpi_device *child;
acpi_handle ejd;
int ret;
if (ACPI_SUCCESS(acpi_bus_get_ejd(device->handle, &ejd)))
register_dock_dependent_device(device, ejd);
acpi_bus_get_status(device);
/* Skip devices that are not present. */
if (!acpi_device_is_present(device)) ... | false | false | false | false | false | 0 |
locate_document(const string& docname) {
// search for 'docname' or 'docname.gz' in various helpfile locations
string located = locate_helpfile(docname);
if (located.empty()) {
located = locate_helpfile(docname+".gz");
}
return located;
} | false | false | false | false | false | 0 |
save_last_dlg_path (const gchar *file)
{
gchar *tmp;
tmp = g_path_get_dirname (file);
if (last_dlg_path != NULL)
g_free (last_dlg_path);
last_dlg_path = g_strconcat (tmp, "/", NULL);
g_free (tmp);
} | false | false | false | false | false | 0 |
dump_isakmp_vendorid(packet_t * pkt)
{
isakmpgeneric_t hdr;
u_int8_t * vendorid;
int len;
/* get the generic header */
if (get_packet_bytes((u_int8_t *) &hdr, pkt, sizeof(hdr)) == 0)
return;
/* conversions */
hdr.length = ntohs(hdr.length);
if (my_args->m)
{
/* nothing ... | false | false | false | false | false | 0 |
MyCPUUsage() {
{
mutex_lock l(&cputimens_mutex);
static bool use_cputime_ns = true;
if (use_cputime_ns) {
double value;
if (MyCPUUsageCPUTimeNsLocked(&value)) {
return value;
}
// Once MyCPUUsageCPUTimeNsLocked fails once fall back to getrusage().
std::cout << "Readin... | false | false | false | false | false | 0 |
sync_config_widget_unmap (GtkWidget *widget)
{
SyncConfigWidget *self = SYNC_CONFIG_WIDGET (widget);
GTK_WIDGET_CLASS (sync_config_widget_parent_class)->unmap (widget);
if (self->label_box) {
gtk_widget_unmap (self->label_box);
}
if (self->expando_box) {
gtk_widget_unmap (self->exp... | false | false | false | false | false | 0 |
calcDelay(const Instruction *insn, int cycle) const
{
int delay = 0, ready = cycle;
for (int s = 0; insn->srcExists(s); ++s)
checkRd(insn->getSrc(s), cycle, delay);
// WAR & WAW don't seem to matter
// for (int s = 0; insn->srcExists(s); ++s)
// recordRd(insn->getSrc(s), cycle);
switch (Targ... | false | false | false | false | false | 0 |
applyProperties(quicktime_t*file, int track, lqt_codec_info_t*codec,
gem::Properties&props) {
if(NULL==file || NULL==codec)return;
std::vector<std::string>keys=props.keys();
std::map<std::string, lqt_parameter_type_t>proptypes;
int i=0;
for(i=0; i<codec->num_encoding_parameters; i++) {
proptypes... | false | false | false | false | false | 0 |
c_setpat(EditLine *el)
{
if (el->el_state.lastcmd != ED_SEARCH_PREV_HISTORY &&
el->el_state.lastcmd != ED_SEARCH_NEXT_HISTORY) {
el->el_search.patlen = EL_CURSOR(el) - el->el_line.buffer;
if (el->el_search.patlen >= EL_BUFSIZ)
el->el_search.patlen = EL_BUFSIZ - 1;
if (el->el_search.patlen != 0) {
(voi... | false | false | false | false | false | 0 |
runTextIO ( PropertyContainer& pc )
{
for ( int i = 0; i< gameparameternum; ++i ) {
if ( !gameParameterSettings[i].legacy ) {
pc.addInteger( gameParameterSettings[i].name, values[i], values[i] );
if ( pc.isReading() ) {
if ( ! (values[i] >= gameParameterSettings[i].minValue && ... | false | false | false | false | false | 0 |
findText(const UnicodeString& str,
const UnicodeString& key,
int32_t startingAt,
int32_t* length) const
{
#if !UCONFIG_NO_COLLATION
// if lenient parsing is turned off, this is easy: just call
// String.indexOf() and we're done
if (!formatter->isLenient()) ... | false | false | false | false | false | 0 |
lookup_close_lookup(struct autofs_point *ap)
{
struct map_source *map;
map = ap->entry->maps;
if (!map)
return;
while (map) {
lookup_close_lookup_instances(map);
map = map->next;
}
return;
} | false | false | false | false | false | 0 |
krb5_principal_set_realm(krb5_context context,
krb5_principal principal,
krb5_const_realm realm)
{
if (princ_realm(principal))
free(princ_realm(principal));
if (realm == NULL)
princ_realm(principal) = NULL;
else if ((princ_realm(principal) = strdup(realm)) == NULL)
return krb5_enomem(context);
... | false | false | false | false | false | 0 |
FindItem(long start, const wxString& str, bool partial )
{
if (str.empty())
return wxNOT_FOUND;
long pos = start;
wxString str_upper = str.Upper();
if (pos < 0)
pos = 0;
size_t count = GetItemCount();
for ( size_t i = (size_t)pos; i < count; i++ )
{
wxListLineData *... | false | false | false | false | false | 0 |
OnInit()
{
#ifdef __WXMAC__
ProcessSerialNumber PSN;
GetCurrentProcess(&PSN);
TransformProcessType(&PSN, kProcessTransformToForegroundApplication);
#endif
/* Usually wxWidgets apps create their main window here.
* However, in the context of multiple plot windows, the same code is written in wxt_init().
* So, t... | false | false | false | false | false | 0 |
ref2ibm(double *pref, int kbits)
{
/*
Purpose:
--------
Code and check reference value in IBM format
Input Parameters:
-----------------
pref - Reference value
kbits - Number of bits per computer word.
Output Parameters:
------------------
pref - Referenc... | false | false | false | false | false | 0 |
tm_project_dump(const TMProject *p)
{
if (p)
{
tm_work_object_dump(TM_WORK_OBJECT(p));
if (p->file_list)
{
guint i;
for (i=0; i < p->file_list->len; ++i)
{
fprintf(stderr, "->\t");
tm_work_object_dump(TM_WORK_OBJECT(p->file_list->pdata[i]));
}
}
fprintf(stderr, "-------------------------... | false | false | false | false | false | 0 |
deflatePrime (strm, bits, value)
z_streamp strm;
int bits;
int value;
{
deflate_state *s;
int put;
if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
s = strm->state;
if ((Bytef *)(s->d_buf) < s->pending_out + ((Buf_size + 7) >> 3))
return Z_BUF_ERROR;
do {
... | false | false | false | false | false | 0 |
call_virtual_method(struct vm_method *vmm, struct vm_object *o,
struct vm_object *args_array)
{
unsigned long args[vmm->args_count];
union jvalue result;
args[0] = (unsigned long) o;
if (marshall_call_arguments(vmm, args + 1, args_array))
return NULL;
vm_call_method_this_a(vmm, o, args, &result);
return... | false | false | false | false | false | 0 |
SendSessionRequest(const std::string& host,
int port) {
// Initiate an HTTP request to create a session through the chosen host.
talk_base::AsyncHttpRequest* request =
new talk_base::AsyncHttpRequest(user_agent());
request->SignalWorkDone.connect(this,
... | false | false | false | false | false | 0 |
termios_c_cc_set(ScmSysTermios* t, ScmObj val)
{
if (!SCM_U8VECTORP(val)) {
Scm_Error("cc type must be a u8vector, but got %S", val);
}
if (SCM_U8VECTOR_SIZE(val) != NCCS) {
Scm_Error("size of cc must be %u, but got %u",
NCCS, SCM_U8VECTOR_SIZE(val));
}
memcpy(t->te... | false | false | false | false | false | 0 |
sh_veu_configure(struct sh_veu_dev *veu)
{
u32 src_width, src_stride, src_height;
u32 dst_width, dst_stride, dst_height;
u32 real_w, real_h;
/* reset VEU */
sh_veu_reg_write(veu, VEU_BSRR, 0x100);
src_width = veu->vfmt_in.frame.width;
src_height = veu->vfmt_in.frame.height;
src_stride = ALIGN(veu->vfmt_in.fra... | false | false | false | false | false | 0 |
cli_backend_list(struct cli *cli, const char * const *av, void *priv)
{
int hdr = 0;
(void)av;
(void)priv;
ASSERT_CLI();
(void)backend_find(cli, av[2], do_list, &hdr);
} | false | false | false | false | false | 0 |
shared_data_find_room (int size)
{
unsigned char *p = (unsigned char *)shared_area + shared_area->data_start;
unsigned char *end = (unsigned char *)shared_area + shared_area->size;
size += 7;
size &= ~7;
while (p < end) {
unsigned short *next;
if (*p == FTYPE_END) {
if (size < (end - p))
return p;
r... | false | false | false | false | false | 0 |
store_sensor(struct device *dev, struct device_attribute *da,
const char *buf, size_t count)
{
struct sensor_device_attribute *attr = to_sensor_dev_attr(da);
struct w83781d_data *data = dev_get_drvdata(dev);
int nr = attr->index;
unsigned long val;
u32 tmp;
int err;
err = kstrtoul(buf, 10, &val);
if (err)
... | false | false | false | false | false | 0 |
MBAnalyzeBestIntra4Mode(VP8EncIterator* const it,
int best_alpha) {
uint8_t modes[16];
const int max_mode =
(it->enc_->method_ >= FAST_ANALYSIS_METHOD) ? MAX_INTRA4_MODE
: NUM_BMODES;
int i4_alpha;
VP8Histogram total_hist... | false | false | false | false | false | 0 |
ftpCloseControlConnection()
{
m_extControl = 0;
delete m_control;
m_control = NULL;
m_cDataMode = 0;
m_bLoggedOn = false; // logon needs control connction
m_bTextMode = false;
m_bBusy = false;
} | false | false | false | false | false | 0 |
request_and_observe_channel_async (TpAccountChannelRequest *self,
const gchar *preferred_handler,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data,
gboolean ensure)
{
TpChannelDispatcher *cd;
g_return_if_fail (!self->priv->requested);
self->priv->requested = TRUE;
... | false | false | false | false | false | 0 |
SortGeneralizedSchur_Real(TMatrix SS, TMatrix TT, TMatrix QQ, TMatrix ZZ, TMatrix S, TMatrix T, TMatrix Q,
TMatrix Z, TVector alpha_r, TVector alpha_i, TVector beta, int descend)
{
int n, err;
if (!SS || !TT || !S || !T || !alpha_r || !alpha_i || !beta)
{
dw_Error(NULL_ERR);
return ... | false | false | false | false | false | 0 |
repaint( Priority p, bool markForRepaint )
{
if (markForRepaint && m_markedForRepaint)
return;
for (RenderLayer* child = firstChild(); child; child = child->nextSibling())
child->repaint( p, markForRepaint );
QRect layerBounds, damageRect, fgrect;
calculateRects(renderer()->canvas()->lay... | false | false | false | false | false | 0 |
next_packet_wav(bgav_demuxer_context_t * ctx)
{
bgav_packet_t * p;
bgav_stream_t * s;
wav_priv_t * priv;
int bytes_to_read;
priv = ctx->priv;
s = bgav_track_find_stream(ctx, STREAM_ID);
if(!s)
return 1;
bytes_to_read = priv->packet_size;
if(ctx->input->position + bytes_to_read >=
... | false | false | false | false | false | 0 |
bf_isa(Var arglist, Byte next, void *vdata, Objid progr)
{ /* (what, parent) */
Objid oid = arglist.v.list[1].v.obj;
if (!valid(oid)) {
free_var(arglist);
return make_error_pack(E_INVARG);
}
Var ancestors = db_ancestors(oid, true);
if (ismember(arglist.v.list[2], ancestors, 1)) {
free_var(a... | false | false | false | false | false | 0 |
MGD77_Read_File_asc (char *file, struct MGD77_CONTROL *F, struct MGD77_DATASET *S) /* Will read all MGD77 records in current file */
{
int err;
err = MGD77_Open_File (file, F, MGD77_READ_MODE);
if (err) return (err);
err = MGD77_Read_Header_Record (file, F, &S->H); /* Will read the entire 24-section header stru... | false | false | false | false | false | 0 |
pop()
{
void * ret = NULL;
if( mCount > 0 ) {
ret = mEntries[ mHead++ ];
mHead = mHead % mMaxCount;
mCount--;
}
return ret;
} | false | false | false | false | false | 0 |
cgiCookieString(
char *name,
char *value,
int space)
{
char *p = cgiCookie;
while (*p) {
char *n = name;
/* 2.02: if cgiCookie is exactly equal to name, this
can cause an overrun. The server probably wouldn't
allow it, since a name without values makes no sense
-- but then again it might not check, s... | false | false | false | false | false | 0 |
poly_in(PG_FUNCTION_ARGS)
{
char *str = PG_GETARG_CSTRING(0);
POLYGON *poly;
int npts;
int size;
int isopen;
char *s;
if ((npts = pair_count(str, ',')) <= 0)
ereport(ERROR,
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
errmsg("invalid input syntax for type polygon: \"%s\"", str)));
... | false | false | false | false | false | 0 |
getTable(ModeInfo * mi, int i)
{
antfarmstruct *ap = &antfarms[MI_SCREEN(mi)];
int j, total;
unsigned char *patptr;
patptr = &tables[i][0];
ap->ncolors = *patptr++;
ap->nstates = *patptr++;
total = ap->ncolors * ap->nstates;
if (MI_IS_VERBOSE(mi))
(void) fprintf(stdout,
"ants %d, neighbors ... | false | false | false | false | false | 0 |
gst_rtsp_session_class_init (GstRTSPSessionClass * klass)
{
GObjectClass *gobject_class;
gobject_class = G_OBJECT_CLASS (klass);
gobject_class->get_property = gst_rtsp_session_get_property;
gobject_class->set_property = gst_rtsp_session_set_property;
gobject_class->finalize = gst_rtsp_session_finalize;
g... | false | false | false | false | false | 0 |
shiftTab(void)
{
const MSUnsignedLongVector& aVector=fields();
MSWidget *w=inputFocus();
unsigned i=fields().indexOf((unsigned long)w);
int len=fields().length();
if (i < len )
{
for(int j=1; j<len; j++)
{
int fld=i-j;
if(fld<0) fld=len+fld;
if( MSFalse==((MSWidget *)aVector(fld))->isProt... | false | false | false | false | false | 0 |
releasePrinterGraphicsContext(GR_Graphics * pGraphics)
{
UT_return_if_fail(pGraphics == m_pPrintGraphics);
DELETEP(m_pPrintGraphics);
} | false | false | false | false | false | 0 |
verify_redraw (Data *data, int expected_paint_count)
{
GMainLoop *main_loop = g_main_loop_new (NULL, TRUE);
guint paint_handler;
paint_handler = g_signal_connect_data (data->stage,
"paint",
G_CALLBACK (g_main_loop_quit),
... | false | false | false | false | false | 0 |
bin_dump_l(unsigned long value, char space_flag)
{
int i,j;
if (T1_CheckEndian()){
for (i=24;i<=31;i++){
if ((j=((value)>>i)&0x01))
printf("X");
else
printf(".");
}
for (i=16;i<=23;i++){
if ((j=((value)>>i)&0x01))
printf("X");
else
printf(".");
}
for (i=8;i<=15;i++... | false | true | false | false | false | 1 |
bulk_w(struct gspca_dev *gspca_dev,
u8 tag,
const u8 *data,
int length)
{
struct usb_device *dev = gspca_dev->dev;
int count, actual_count, ret;
if (gspca_dev->usb_err < 0)
return;
for (;;) {
count = length > BULK_OUT_SIZE - 1
? BULK_OUT_SIZE - 1 : length;
gspca_dev->usb_buf[0] = tag;
memcp... | false | false | false | false | false | 0 |
intel_dp_mode_valid(struct drm_connector *connector,
struct drm_display_mode *mode)
{
struct intel_dp *intel_dp = intel_attached_dp(connector);
struct intel_connector *intel_connector = to_intel_connector(connector);
struct drm_display_mode *fixed_mode = intel_connector->panel.fixed_mode;
int target_clock = m... | false | false | false | false | false | 0 |
list_tree(unsigned char *sha1)
{
struct tree *tree;
if (nr_trees >= MAX_UNPACK_TREES)
die("I cannot read more than %d trees", MAX_UNPACK_TREES);
tree = parse_tree_indirect(sha1);
if (!tree)
return -1;
trees[nr_trees++] = tree;
return 0;
} | false | false | false | false | false | 0 |
DebugCycle()
{
uint8 opcode[3] = {0};
uint16 A = 0;
int size;
#ifdef WIN32
// since this function is called once for every instruction, we can use it for keeping statistics
IncrementInstructionsCounters();
#endif
if (scanline == 240)
{
vblankScanLines = (PAL?int((double)timestamp / ((double)341 ... | false | false | false | false | false | 0 |
copy_vehicle_2 (int x)
{
int y;
int dx = 248;
if (x >= 320)
dx -= x - 320;
if (x < 248) {
dx = x;
for (y = 31; y >= 0; y--)
memcpy (intro_buffer + (110 + y) * xbuf,
intro_img.buffer + (110 + y) * 320 + 262 - dx, dx);
} else
for (y = 31; y >= 0; y--)
memcpy (intro_buffer + (1... | false | false | false | false | false | 0 |
main(int argc, char **argv)
{
ares_channel channel;
int status, nfds, c, addr_family = AF_INET;
fd_set read_fds, write_fds;
struct timeval *tvp, tv;
struct in_addr addr4;
struct ares_in6_addr addr6;
#ifdef USE_WINSOCK
WORD wVersionRequested = MAKEWORD(USE_WINSOCK,USE_WINSOCK);
WSADATA wsaData;
WSASta... | false | false | false | false | false | 0 |
GetImageSize(trpg2iPoint &outSize) const
{
if (mode != Local && mode != Template)
return false;
outSize.x = sizeX;
outSize.y = sizeY;
return true;
} | false | false | false | false | false | 0 |
header_hrdisk(struct variable *vp,
oid * name,
size_t * length,
int exact, size_t * var_len, WriteMethod ** write_method)
{
#define HRDISK_ENTRY_NAME_LENGTH 11
oid newname[MAX_OID_LEN];
int disk_idx, LowIndex = -1;
int result;
... | false | false | false | false | false | 0 |
usbip_header_correct_endian(struct usbip_header *pdu, int send)
{
__u32 cmd = 0;
if (send)
cmd = pdu->base.command;
correct_endian_basic(&pdu->base, send);
if (!send)
cmd = pdu->base.command;
switch (cmd) {
case USBIP_CMD_SUBMIT:
correct_endian_cmd_submit(&pdu->u.cmd_submit, send);
break;
case USBIP_... | false | false | false | false | false | 0 |
ds_diction_destroy (ds_diction_t diction)
{
ds_term_t term, next;
ds_cursor_t cur;
if (!diction) return;
cur = ds_diction_cursor(diction);
if (!cur) {
perror("ds_diction_destroy: ds_diction_cursor() failed");
return;
}
term = ds_diction_next(cur);
while(term)
{
next = ds_diction_next(c... | false | false | false | false | false | 0 |
entry_changed (GtkEditable * editable, gpointer user_data)
{
GSTPPipelineEditor *editor = (GSTPPipelineEditor *) (user_data);
const gchar *new_text = gtk_entry_get_text (GTK_ENTRY (editable));
if (new_text == NULL || *new_text == '\0') {
/* disable test button */
gtk_widget_set_sensitive (GTK_WIDGET (edi... | false | false | false | false | false | 0 |
createLineString(CoordinateSequence::AutoPtr newCoords)
const
{
return Geometry::AutoPtr(new LineString(newCoords, this));
} | false | false | false | false | false | 0 |
calibAngle(float *v1, float *v2) {
float32_t v1b[3];
float32_t v2b[3];
float32_t t;
int i;
t = 0.0f;
for (i = 0; i < 3; i++) {
v1b[i] = v1[i] + calibData.bias[i];
v2b[i] = v2[i] + calibData.bias[i];
t += (v1b[i]*v2b[i]);
}
t /= __sqrtf(v1b[0]*v1b[0] + v1b[1]*v1b[1] + v1b[2]*v1b[2]);
t /= __sqrtf(v2b[0... | false | false | false | false | false | 0 |
xfer_open_socket ( struct xfer_interface *xfer, int semantics,
struct sockaddr *peer, struct sockaddr *local ) {
struct socket_opener *opener;
DBGC ( xfer, "XFER %p opening (%s,%s) socket\n", xfer,
socket_semantics_name ( semantics ),
socket_family_name ( peer->sa_family ) );
for_each_tabl... | false | false | false | false | false | 0 |
stripspace(FILE *in, FILE *out)
{
int empties = -1;
int incomplete = 0;
char line[1024];
while (fgets(line, sizeof(line), in)) {
incomplete = cleanup(line);
/* Not just an empty line? */
if (line[0] != '\n') {
if (empties > 0)
fputc('\n', out);
empties = 0;
fputs(line, out);
continue;
}
... | true | true | false | false | false | 1 |
SHA1_End(SHA1Context *ctx, unsigned char *hashout,
unsigned int *pDigestLen, unsigned int maxDigestLen)
{
register PRUint64 size;
register PRUint32 lenB;
PRUint32 tmpbuf[5];
static const unsigned char bulk_pad[64] = { 0x80,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,... | true | true | false | false | false | 1 |
nvkm_notify_init(struct nvkm_object *object, struct nvkm_event *event,
int (*func)(struct nvkm_notify *), bool work,
void *data, u32 size, u32 reply,
struct nvkm_notify *notify)
{
unsigned long flags;
int ret = -ENODEV;
if ((notify->event = event), event->refs) {
ret = event->func->ctor(object, data, size... | false | false | false | false | false | 0 |
animationDone()
{
m_busyAnimating = false;
if ( m_newGameRequested )
{
startNewGame();
}
else if ( m_engine->isHeroDead() )
{
m_scene->forgetHero();
m_engine->endGame();
}
else if ( m_engine->isRoundComplete() )
{
m_repeatedAction = NoAction;
m_queuedAction = NoAction;
m_engine->startNewRound();
... | false | false | false | false | false | 0 |
ncp_search_for_fileset(struct ncp_server *server,
struct nw_search_sequence *seq,
int* more,
int* cnt,
char* buffer,
size_t bufsize,
char** rbuf,
size_t* rsize)
{
int result;
ncp_init_request(server);
ncp_add_byte(server, 20);
ncp_add_byte(server, server->name_space[seq->v... | false | true | false | false | false | 1 |
restore_default_location (GeditFileBrowserPlugin *plugin)
{
GeditFileBrowserPluginPrivate *priv = plugin->priv;
gchar *root;
gchar *virtual_root;
gboolean bookmarks;
gboolean remote;
bookmarks = !g_settings_get_boolean (priv->settings,
FILEBROWSER_TREE_VIEW);
if (bookmarks)
{
gedit_file_browser_wi... | false | false | false | false | false | 0 |
__socket_read_accepted_reply (rpc_transport_t *this)
{
socket_private_t *priv = NULL;
int ret = -1;
char *buf = NULL;
uint32_t verflen = 0, len = 0;
uint32_t remaining_size = 0;
struct gf_s... | false | false | false | false | false | 0 |
_dxfClosestPointOnEdge(Vertex X, Vertex XP, Vertex A, Vertex B,
float *t)/* barycentric coordinates: t, 1-t */
{
float d;
Vertex BA,BX;
float BA_BX,BA_2;
MakeVec(B,A,BA);
MakeVec(B,X,BX);
EdgeBarycentricCoordinates(BA,BX,BA_BX,BA_2);
if (BA_BX <= 0.)
{
*t = 0.;
d = NORM3(BX);
... | false | false | false | false | false | 0 |
e_table_group_get_cell_geometry (ETableGroup *table_group,
gint *row,
gint *col,
gint *x,
gint *y,
gint *width,
gint *heig... | false | false | false | false | false | 0 |
dev_rcv_special(struct dev_info *hw_priv)
{
int next;
union desc_stat status;
struct ksz_hw *hw = &hw_priv->hw;
struct net_device *dev = hw->port_info[0].pdev;
struct ksz_desc_info *info = &hw->rx_desc_info;
int left = info->alloc;
struct ksz_desc *desc;
int received = 0;
next = info->next;
while (left--) {
... | false | false | false | false | false | 0 |
StartQueryAll( QueryType queryType ) // start querying the advanced info of each of the servers in our list
{
Sort(KEY_SCORE);
sn_Requesting = GetFirstServer();
while (sn_Polling.Len())
sn_Polling.Remove(sn_Polling(0), sn_Polling(0)->pollID);
nServerInfo *run = GetF... | false | false | false | false | false | 0 |
ok (struct web *target, struct web *source)
{
struct conflict_link *wl;
int i;
int color = source->color;
int size;
/* Normally one would think, the next test wouldn't be needed.
We try to coalesce S and T, and S has already a color, and we checked
when processing the insns, that both have the same... | false | false | false | false | false | 0 |
gretl_VAR_get_roots (GRETL_VAR *var, int *err)
{
if (var == NULL) {
fprintf(stderr, "gretl_VAR_get_roots: VAR is NULL\n");
*err = E_DATA;
return NULL;
}
if (var->L == NULL) {
/* roots not computed yet */
*err = VAR_add_roots(var);
}
return var->L;
} | false | false | false | false | false | 0 |
PEM_read_bio_PrivateKey(BIO *bp, EVP_PKEY **x, pem_password_cb *cb, void *u)
{
char *nm=NULL;
const unsigned char *p=NULL;
unsigned char *data=NULL;
long len;
int slen;
EVP_PKEY *ret=NULL;
if (!PEM_bytes_read_bio(&data, &len, &nm, PEM_STRING_EVP_PKEY, bp, cb, u))
return NULL;
p = data;
if (strcmp(nm,PEM_S... | false | false | false | false | false | 0 |
putenv (string)
char *string;
{
const char *const name_end = strchr (string, '=');
if (name_end != NULL)
{
char *name;
#ifdef _LIBC
int use_malloc = !__libc_use_alloca (name_end - string + 1);
if (__builtin_expect (use_malloc, 0))
{
name = strndup (string, name_end - string);
if (... | false | false | false | false | false | 0 |
yin_compute(yin_susp_type susp, float *pitch, float *harmonicity)
// samples is a buffer of samples
// n is the number of samples, equals twice longest period, must be even
// m is the shortest period in samples
// results is an array of size n/2 - m + 1, the number of different lags
{
float *sampl... | false | false | false | false | false | 0 |
update_link_visibility (NautilusDesktopLinkMonitor *monitor,
NautilusDesktopLink **link_ref,
NautilusDesktopLinkType link_type,
const char *preference_key)
{
if (g_settings_get_boolean (nautilus_desktop_preferences, preference_key)) {
if (*link_ref == NULL) {
*link_ref = nautilu... | false | false | false | false | false | 0 |
getCharType(unsigned int keyCode)
{
if (keyCode > 255)
return (IsoToVnLexi(keyCode) == vnl_nonVnChar) ? ukcNonVn : ukcVn;
return UkcMap[keyCode];
} | false | false | false | false | false | 0 |
__memp_get_flags(dbmfp, flagsp)
DB_MPOOLFILE *dbmfp;
u_int32_t *flagsp;
{
MPOOLFILE *mfp;
mfp = dbmfp->mfp;
*flagsp = 0;
if (mfp == NULL)
*flagsp = FLD_ISSET(dbmfp->config_flags,
DB_MPOOL_NOFILE | DB_MPOOL_UNLINK);
else {
if (mfp->no_backing_file)
FLD_SET(*flagsp, DB_MPOOL_NOFILE);
if (mfp->un... | false | false | false | false | false | 0 |
AVI_set_audio_position(avi_t *AVI, long byte)
{
long n0, n1, n;
if(AVI->mode==AVI_MODE_WRITE) { AVI_errno = AVI_ERR_NOT_PERM; return -1; }
if(!AVI->audio_index) { AVI_errno = AVI_ERR_NO_IDX; return -1; }
if(byte < 0) byte = 0;
/* Binary search in the audio chunks */
n0 = 0;
n1 = AVI->... | false | false | false | false | false | 0 |
searchFile(string const& name, string const& suffix /* = "" */) const
{
if (name.empty())
return name;
gOut.dbg("searching " + name + suffix);
glob_t g;
memset(&g, 0, sizeof(g));
string file, pat[2] = { "*/*/" + name + suffix,
"*/*/" + name + "-[0-9]*" + suffix };
for (uint i = 0; i < 2; ++i) {
f... | false | false | false | false | false | 0 |
Lex() {
const AsmToken *tok = &Lexer.Lex();
if (tok->is(AsmToken::Eof)) {
// If this is the end of an included file, pop the parent file off the
// include stack.
SMLoc ParentIncludeLoc = SrcMgr.getParentIncludeLoc(CurBuffer);
if (ParentIncludeLoc != SMLoc()) {
JumpToLoc(ParentIncludeLoc);
... | false | false | false | false | false | 0 |
curl_form(HashStringValue *value_hash, Request& r){
struct curl_httppost *f_last=0;
for(HashStringValue::Iterator i(*value_hash); i; i.next() ){
const char *key = curl_transcode(String(i.key().cstr()), r);
if(const String* svalue = i.value()->get_string()){
// string
f_curl_formadd(&options().f_post, &f_l... | false | false | false | false | false | 0 |
get_target_file_list (GList *original_files)
{
GList *ret;
GList *l;
ret = NULL;
for (l = original_files; l != NULL; l = l->next) {
NautilusFile *target;
target = get_target_file_for_original_file (NAUTILUS_FILE (l->data));
ret = g_list_prepend (ret, target);
}
ret = g_list_reverse (ret);
retur... | false | false | false | false | false | 0 |
zprintb(ZVALUE z, long width)
{
register HALF *hp; /* current word to print */
int len; /* number of halfwords to type */
HALF val; /* current value */
HALF mask; /* current mask */
int didprint; /* nonzero if printed some digits */
int ch; /* current char */
char *str;
if (width) {
math_divertio();
... | false | false | false | false | false | 0 |
kvp_value_get_gdate(const KvpValue * value)
{
GDate date;
g_date_clear(&date, 1);
if (!value) return date;
if (value->type == KVP_TYPE_GDATE)
return value->value.gdate;
else
return date;
} | false | false | false | false | false | 0 |
gom_gomii_refival_set(enum gom_info_types std_verb, int interval, RefProcFunc refproc)
{
struct itimerval real_timer;
int err;
int oldinterval = gom_gomii_refival();
if ((interval >= GOM_GOMII_REFIVAL_MIN)
&& (interval <= GOM_GOMII_REFIVAL_MAX))
{
/* set the new interval */
gom_gomii_refival_var = interval... | false | false | false | false | false | 0 |
OnEventReceived(
const std::string &Sid,
int EventKey,
IXML_Document *ChangedVariablesDoc)
{
std::ostringstream msg;
msg << "UPNP_EVENT_RECEIVED:" <<
"\n SID: " << Sid <<
"\n Key: " << EventKey <<
"\n Property list:";
IXML_Element *root =
m_upnpLib.Element_GetRootElement(ChangedVariablesDoc);
... | false | false | false | false | false | 0 |
Jim_GetAssocData(Jim_Interp *interp, const char *key)
{
Jim_HashEntry *entryPtr = Jim_FindHashEntry(&interp->assocData, key);
if (entryPtr != NULL) {
AssocDataValue *assocEntryPtr = (AssocDataValue *) entryPtr->u.val;
return assocEntryPtr->data;
}
return NULL;
} | 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.