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 |
|---|---|---|---|---|---|---|
getFixupOffset(const MCAsmLayout &Layout,
const MCFragment *Fragment,
const MCFixup &Fixup) {
uint32_t FixupOffset = Layout.getFragmentOffset(Fragment) + Fixup.getOffset();
// On Mach-O, ppc_fixup_half16 relocations must refer to the
// start of the in... | false | false | false | false | false | 0 |
circuit_try_clearing_isolation_state(origin_circuit_t *circ)
{
if (/* The circuit may have become non-open if it was cannibalized.*/
circ->_base.state == CIRCUIT_STATE_OPEN &&
/* If !isolation_values_set, there is nothing to clear. */
circ->isolation_values_set &&
/* It's not legal to clear a ... | false | false | false | false | false | 0 |
rtpm_children_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
return sprintf(buf, "%d\n", dev->power.ignore_children ?
0 : atomic_read(&dev->power.child_count));
} | false | false | false | false | false | 0 |
mgag200_modeset_init(struct mga_device *mdev)
{
struct drm_encoder *encoder;
struct drm_connector *connector;
int ret;
mdev->mode_info.mode_config_initialized = true;
mdev->dev->mode_config.max_width = MGAG200_MAX_FB_WIDTH;
mdev->dev->mode_config.max_height = MGAG200_MAX_FB_HEIGHT;
mdev->dev->mode_config.fb_b... | false | false | false | false | false | 0 |
update_saturation_from_rgb(unsigned short *rgb,
const unsigned short *brightness_lookup,
double adjust, double isat, int do_usermap)
{
double h, s, l;
calc_rgb_to_hsl(rgb, &h, &s, &l);
if (do_usermap)
{
unsigned short ub = (unsigned short) (l * 65535);
unsigned short val = brightness_l... | false | false | false | false | false | 0 |
single_arg_report_root (MonoObject **obj, void *gc_data)
{
if (*obj)
add_profile_gc_root (root_report, *obj, MONO_PROFILE_GC_ROOT_OTHER, 0);
} | false | false | false | false | false | 0 |
sort_keyword_list_and_remove_duplicates (GList *keywords)
{
GList *p;
GList *duplicate_link;
if (keywords != NULL) {
keywords = eel_g_str_list_alphabetize (keywords);
p = keywords;
while (p->next != NULL) {
if (strcmp ((const char *) p->data, (const char *) p->next->data) == 0) {
duplicate_link = p->... | false | false | false | false | false | 0 |
recompute_size_for_slice (GList *elements,
guint width,
guint height,
guint total_width,
guint total_height,
guint offset_x,
... | false | false | false | false | false | 0 |
msp430_fetch_integer (unsigned int loc)
{
char *m = &alu.mem[0xffff & loc];
short res;
if (wpr[0xffff & loc])
alu.signal = SIGTRAP;
res = (0xff & (*m)) | (short) (*(m + 1)) << 8;
return res;
} | false | false | false | false | false | 0 |
tidyup(__maybe_unused void *arg)
{
mutex_lock(&quit_restart_lock);
SOCKETTYPE *apisock = (SOCKETTYPE *)arg;
bye = true;
if (*apisock != INVSOCK) {
shutdown(*apisock, SHUT_RDWR);
CLOSESOCKET(*apisock);
*apisock = INVSOCK;
}
if (ipaccess != NULL) {
free(ipaccess);
ipaccess = NULL;
}
io_free();
mu... | false | false | false | false | false | 0 |
gt_shell_init (GTShell *shell)
{
g_return_if_fail(gt_shell == NULL);
gt_shell = shell;
g_object_add_weak_pointer(G_OBJECT(gt_shell), >_shell);
shell->priv = G_TYPE_INSTANCE_GET_PRIVATE(shell, GT_TYPE_SHELL, GTShellPrivate);
shell->priv->translate_session = translate_session_new(NULL);
shell->priv->client... | false | false | false | false | false | 0 |
askCompletion(QString stem, QStringList completions)
{
CompView *view = new CompView(stem, completions, e);
int selected = view->exec(e->cursorRect().bottomRight());
delete view;
return selected;
} | false | false | false | false | false | 0 |
GMT_read_grd_info (char *file, struct GRD_HEADER *header)
{ /* file: File name
* header: grid structure header
*/
GMT_LONG err;
double scale, offset, nan_value;
/* Initialize grid information */
GMT_grd_init (header, 0, (char **)VNULL, FALSE);
/* Save parameters on file name suffix before issuing GMT_io_rea... | false | false | false | false | false | 0 |
catchsignal(int signum, void(*handler)()))()
{
struct sigaction new_sa;
struct sigaction old_sa;
#ifdef DONT_CATCH_SIGNALS
fprintf (stderr, "Not catching any signals.\n");
return ((void (*)()) -1);
#endif
new_sa.sa_handler = handler;
sigemptyset(&new_sa.sa_mask);
new_sa.sa_flags = 0;
if (sigaction(sig... | false | false | false | false | false | 0 |
InitEmptyCeosRecord(CeosRecord_t *record, int32 sequence, CeosTypeCode_t typecode, int32 length)
{
if(record)
{
if((record->Buffer = HMalloc(length)) == NULL)
{
return;
}
/* First we zero fill the buffer */
memset(record->Buffer,0,length);
/* Setup values inside the CeosRecord_t header */
record->S... | false | false | false | false | false | 0 |
chasen_standalone(char **argv, FILE * output)
{
/*
* standalone
*/
if (chasen_getopt_argv(argv, stderr))
return 1;
argv += Cha_optind;
if (*argv == NULL)
do_chasen_standalone(stdin, output);
else
for (; *argv; argv++)
do_chasen_standalone(cha_fopen(*argv, "r", 1), output);
r... | false | false | false | false | false | 0 |
CacheInvalidateRelcacheByTuple(HeapTuple classTuple)
{
Form_pg_class classtup = (Form_pg_class) GETSTRUCT(classTuple);
Oid databaseId;
Oid relationId;
RelFileNode rnode;
relationId = HeapTupleGetOid(classTuple);
if (classtup->relisshared)
databaseId = InvalidOid;
else
databaseId = MyDatabaseId;
if (cla... | false | false | false | true | false | 1 |
expand_end_all_catch ()
{
struct eh_region *try_region;
if (! doing_eh (0))
return;
try_region = cfun->eh->try_region;
cfun->eh->try_region = try_region->u.try.prev_try;
emit_label (try_region->u.try.continue_label);
} | false | false | false | false | false | 0 |
MaxCutRandomized(SDPCone sdpcone,int nnodes){
int i,j,derror,info;
double dd,scal=RAND_MAX,*vv,*tt,*cc,ymin=0;
vv=(double*)malloc(nnodes*sizeof(double));
tt=(double*)malloc(nnodes*sizeof(double));
cc=(double*)malloc((nnodes+2)*sizeof(double));
info=SDPConeComputeXV(sdpcone,0,&derror);
for (i=0;i<nnodes;i... | false | true | false | false | false | 1 |
Initialize()
{
if (!m_overwriteNpcEntry)
m_overwriteNpcEntry = m_owner->GetEntry();
// Loading passengers (rough version only!)
SQLMultiStorage::SQLMSIteratorBounds<VehicleAccessory> bounds = sVehicleAccessoryStorage.getBounds<VehicleAccessory>(m_overwriteNpcEntry);
for (SQLMultiStorage::SQLMul... | false | false | false | false | false | 0 |
operator>>(std::istream& in, level& l)
{
std::string tk;
in >> tk;
if (!in.bad()) {
if (tk == "single") {
l = single;
} else if (tk == "funneled") {
l = funneled;
} else if (tk == "serialized") {
l = serialized;
} else if (tk == "multiple") {
l = multiple;
} else {
... | false | false | false | false | false | 0 |
pin_down_extent(struct btrfs_root *root,
struct btrfs_block_group_cache *cache,
u64 bytenr, u64 num_bytes, int reserved)
{
spin_lock(&cache->space_info->lock);
spin_lock(&cache->lock);
cache->pinned += num_bytes;
cache->space_info->bytes_pinned += num_bytes;
if (reserved) {
cache->reserved -= num_byt... | false | false | false | false | false | 0 |
static_measure_face_vertices (double *min, double *max,
double *average, double *deviation, gamgi_voronoi *voronoi)
{
gamgi_polyhedron *polyhedron;
gamgi_face *face;
gamgi_vertex *vertex;
gamgi_slist *slist_v, *slist_f;
int n_seeds, n_faces, n_vertices, i;
*min = DBL_MAX;
*max = -DBL_MAX;
*average = 0.0;
*deviation =... | false | false | false | false | false | 0 |
ipc_create_pmc_devices(void)
{
int ret;
ret = ipc_create_tco_device();
if (ret) {
dev_err(ipcdev.dev, "Failed to add tco platform device\n");
return ret;
}
ret = ipc_create_punit_device();
if (ret) {
dev_err(ipcdev.dev, "Failed to add punit platform device\n");
platform_device_unregister(ipcdev.tco_dev);... | false | false | false | false | false | 0 |
dpm_get_reqs_by_u_desc(dbfd, bol, u_token, uid, dpm_req, endlist, dblistptr)
struct dpm_dbfd *dbfd;
int bol;
char *u_token;
uid_t uid;
struct dpm_req *dpm_req;
int endlist;
DBLISTPTR *dblistptr;
{
char func[23];
static char queryo[] =
"SELECT \
R_ORDINAL, R_TOKEN, R_UID, \
R_GID, CLIENT_DN, CLIENTHOST, \
... | false | false | false | false | false | 0 |
FFTHiPassFilter( double fc, wxPlotData::FFTFilter_Type filter, double n )
{
wxCHECK_MSG( Ok() && (n>0), wxPlotData(), wxT("Invalid wxPlotData") );
wxPlotData xform( FFT(true) );
int i, count = xform.GetCount();
double f, x;
double *ydata = xform.GetYData(),
*yidata = xform.GetYiData();
... | false | false | false | false | false | 0 |
tinf_getbit(TINF_DATA *d)
{
unsigned int bit;
/* check if tag is empty */
if (!d->bitcount--)
{
/* load next tag */
if((d->sourceLen + 1) > d->sourceSize) return 0; // better than ignoring it
d->tag = *d->source++;
d->sourceLen++;
d->bitcount = 7;
}
/* shift bit out of ... | false | false | false | false | false | 0 |
inzcont(register char **const fields, const int nfields)
{
if (nfields < ZONEC_MINFIELDS || nfields > ZONEC_MAXFIELDS) {
error(_("wrong number of fields on Zone continuation line"));
return FALSE;
}
return inzsub(fields, nfields, TRUE);
} | false | false | false | false | false | 0 |
tpm_check_resource(struct acpi_resource *ares, void *data)
{
struct tpm_info *tpm_info = (struct tpm_info *) data;
struct resource res;
if (acpi_dev_resource_interrupt(ares, 0, &res))
tpm_info->irq = res.start;
else if (acpi_dev_resource_memory(ares, &res)) {
tpm_info->res = res;
tpm_info->res.name = NULL;
... | false | false | false | false | false | 0 |
get_pgm_tx_tilemap_tile_info(int tile_index)
{
/* 0x904000 - 0x90ffff is the Text Overlay Ram (pgm_tx_videoram)
each tile uses 4 bytes, the tilemap is 64x128?
the layer uses 4bpp 8x8 tiles from the 'T' roms
colours from 0xA01000 - 0xA017FF
scroll registers are at 0xB05000 (Y) and 0xB06000 (X)
... | false | false | false | false | false | 0 |
champlain_network_tile_source_dispose (GObject *object)
{
ChamplainNetworkTileSourcePrivate *priv = CHAMPLAIN_NETWORK_TILE_SOURCE (object)->priv;
if (priv->soup_session)
{
soup_session_abort (priv->soup_session);
g_object_unref (priv->soup_session);
priv->soup_session = NULL;
}
G_OBJEC... | false | false | false | false | false | 0 |
getline_r210 (ColorspaceConvert * convert, guint8 * dest, const guint8 * src,
int j)
{
int i;
const guint8 *srcline = FRAME_GET_LINE (src, 0, j);
for (i = 0; i < convert->width; i++) {
guint8 x;
dest[i * 4 + 0] = 0xff;
x = GST_READ_UINT32_BE (srcline + i * 4);
dest[i * 4 + 1] = (x >> 22) & 0xf... | false | false | false | false | false | 0 |
qlcnic_82xx_get_mac_address(struct qlcnic_adapter *adapter, u8 *mac,
u8 function)
{
int err, i;
struct qlcnic_cmd_args cmd;
u32 mac_low, mac_high;
err = qlcnic_alloc_mbx_args(&cmd, adapter, QLCNIC_CMD_MAC_ADDRESS);
if (err)
return err;
cmd.req.arg[1] = function | BIT_8;
err = qlcnic_issue_cmd(adapter, &c... | false | false | false | false | false | 0 |
hasChildren( const QModelIndex &parent ) const
{
if( !parent.isValid() )
return true;
if( isGroup( parent ) )
return !m_groupHash.value( parent.row() ).isEmpty();
return sourceModel()->hasChildren( mapToSource( parent ) );
} | false | false | false | false | false | 0 |
cc_background_item_get_frame_thumbnail (CcBackgroundItem *item,
GnomeDesktopThumbnailFactory *thumbs,
int width,
int height,
... | false | false | false | false | false | 0 |
sLadTlg_create(List *block_list)
{
sLadTlg *tlg;
tlg = (sLadTlg *)malloc(sizeof(sLadTlg));
if (tlg == NULL)
fatal("alloc failed\n");
tlg->lad_list = dir2lad(block_list);
return tlg;
} | false | false | false | false | false | 0 |
outswoffset (offset)
offset_T offset;
{
#ifdef FRAMEPOINTER
outoffset(offset - softsp - framep);
#else
outoffset(offset - softsp - sp);
#endif
outplus();
outswstacklab();
#ifdef I8088
bumplc();
#ifdef I80386
if (i386_32)
bumplc2();
#endif
#endif
} | false | false | false | false | false | 0 |
draw_vline (GtkStyle * style,
GdkWindow * window,
GtkStateType state_type,
GdkRectangle * area,
GtkWidget * widget,
const gchar * detail, gint y1, gint y2, gint x) {
if (DETAIL ("handlebox") || DETAIL ("dockitem")) {
real_draw_line (style, window, GTK_ORIENTATION_VERTICAL,
area, GTK_SHADOW_O... | false | false | false | false | false | 0 |
series_2(double r, gsl_sf_result * result)
{
static const int kmax = 100;
double rk = r;
double sum = 0.5 * r;
int k;
for(k=2; k<10; k++)
{
double ds;
rk *= r;
ds = rk/(k*k*(k+1.0));
sum += ds;
}
for(; k<kmax; k++)
{
double ds;
rk *= r;
ds = rk/(k*k*(k+1.0));
sum += ds;... | false | false | false | false | false | 0 |
init_context_stack()
{
static bool did_init = false;
if ( !did_init ) {
did_init = true;
context_stack[0] = current_alloc_context = 0;
}
} | false | false | false | false | false | 0 |
SetMagnification (float m) {
register Perspective* p = perspective;
float factor;
Coord cx, cy, halfw, halfh;
if (_zooming == Binary) {
m = NearestPow2(m);
}
factor = LimitMagnification(m)/_mag;
if (_graphic != nil && factor != 1.0) {
halfw = p->curwidth/2;
halfh = p->curheight/2;
cx =... | false | false | false | false | false | 0 |
patestCallback( const void *inputBuffer, void *outputBuffer,
unsigned long framesPerBuffer,
const PaStreamCallbackTimeInfo* timeInfo,
PaStreamCallbackFlags statusFlags,
void *userData )
{
paTestData *data... | false | false | false | false | false | 0 |
intel_pstate_setup(char *str)
{
if (!str)
return -EINVAL;
if (!strcmp(str, "disable"))
no_load = 1;
if (!strcmp(str, "no_hwp")) {
pr_info("intel_pstate: HWP disabled\n");
no_hwp = 1;
}
if (!strcmp(str, "force"))
force_load = 1;
if (!strcmp(str, "hwp_only"))
hwp_only = 1;
return 0;
} | false | false | false | false | false | 0 |
cb_search_keypress (GtkWidget *widget, GdkEventKey *event, gpointer data)
{
gint index;
gchar text[20];
strcpy (text, gtk_entry_get_text (GTK_ENTRY(search_entry)));
if ( (strlen (text)) <= 1 )
{
gimmix_update_library_with_dir ("/");
return;
}
index = gtk_combo_box_get_active (GTK_COMBO_BOX(search_combo))... | false | true | false | false | false | 1 |
data_address_ok(const sockaddr_u *dp,bool verify_address,bool verify_port)
{
sockaddr_u d;
sockaddr_u c;
socklen_t len;
len=sizeof(d);
if(dp)
d=*dp;
else if(getpeername(data_sock,&d.sa,&len)==-1)
{
LogError(0,"getpeername(data_sock): %s\n",strerror(errno));
return !verify_address ... | false | false | false | false | false | 0 |
setbitCommand(redisClient *c) {
robj *o;
char *err = "bit is not an integer or out of range";
size_t bitoffset;
int byte, bit;
int byteval, bitval;
long on;
if (getBitOffsetFromArgument(c,c->argv[2],&bitoffset) != REDIS_OK)
return;
if (getLongFromObjectOrReply(c,c->argv[3],&on,... | false | false | false | false | false | 0 |
flickcurl_error_varargs(flickcurl* fc, const char *message,
va_list arguments)
{
if(fc && fc->error_handler) {
char *buffer = my_vsnprintf(message, arguments);
if(!buffer) {
fprintf(stderr, "flickcurl: Out of memory\n");
return;
}
fc->error_handler(fc->error_data, ... | false | false | false | false | true | 1 |
handleGetLimit(UCalendarDateFields field, ELimitType limitType) const
{
switch(field) {
case UCAL_ERA:
if (limitType == UCAL_LIMIT_MINIMUM || limitType == UCAL_LIMIT_GREATEST_MINIMUM) {
return 0;
}
return kCurrentEra;
case UCAL_YEAR:
{
switch (limitTyp... | false | false | false | false | false | 0 |
string_tolower2(struct ast_channel *chan, const char *cmd, char *data, struct ast_str **buf, ssize_t buflen)
{
char *bufptr, *dataptr = data;
if (buflen > -1) {
ast_str_make_space(buf, buflen > 0 ? buflen : strlen(data) + 1);
}
bufptr = ast_str_buffer(*buf);
while ((bufptr < ast_str_buffer(*buf) + ast_str_size(... | false | false | false | false | false | 0 |
out_byte(struct rubin_state *rs, unsigned char byte)
{
int i, ret;
struct rubin_state rs_copy;
rs_copy = *rs;
for (i=0; i<8; i++) {
ret = encode(rs, rs->bit_divider-rs->bits[i],
rs->bits[i], byte & 1);
if (ret) {
/* Failed. Restore old state */
*rs = rs_copy;
return ret;
}
byte >>= 1 ;
}
... | false | false | false | false | false | 0 |
srv_header(int argc, char **argv)
{
vaheader_t header;
int fd;
char *msgname;
if ((!client_spool) || (!client_user) || (!(client_access & VBOXD_ACC_READ)))
{
message("%s Access denied (no read access).\r\n", VBOXD_VAL_ACCESSDENIED);
return;
}
if (argc != 2)
{
message("%s usage: %s <messa... | false | false | false | false | true | 1 |
GetAttrib(const string& inName)
{
map<std::string, string>::const_iterator p = TopAttrib().find(inName);
if (p != TopAttrib().end())
{
return MushcoreScalar(p->second);
}
else
{
return MushcoreScalar("");
}
} | false | false | false | false | false | 0 |
nutscan_scan_nut(const char* startIP, const char* stopIP, const char* port,long usec_timeout)
{
nutscan_ip_iter_t ip;
char * ip_str = NULL;
char * ip_dest = NULL;
char buf[SMALLBUF];
struct sigaction oldact;
int change_action_handler = 0;
int i;
struct scan_nut_arg *nut_arg;
#ifdef HAVE_PTHREAD
pthread_t threa... | false | false | false | false | false | 0 |
generaConjunts(int tipusTangram){
//eliminam les peces actuals
sceneFiguresPrograma->clear();
sceneFiguresNoves->clear();
sceneComparacio->clear();
conjuntMostraPrograma=new ConjuntPeces(tipusTangram,ESCALA_MOSTRA);
conjuntMostraPrograma->conjuntDeMostra();
conju... | false | false | false | false | false | 0 |
ClientUserinfoChanged(edict_t * ent, char *userinfo)
{
char *s, *r, tnick[16];
qboolean nickChanged = false;
// check for malformed or illegal info strings
if (!Info_Validate(userinfo)) {
strcpy(userinfo, "\\name\\badinfo\\skin\\male/grunt");
}
// set name
s = Info_ValueForKey(userinfo, "name");
Q_strncpyz(t... | true | true | true | false | true | 1 |
modeNumber(bool & cc, tcPDPtr parent,
const tPDVector & children) const {
vector<long> id;
id.push_back(parent->id());
for(unsigned int ix=0;ix<children.size();++ix) id.push_back(children[ix]->id());
return modeNumber(cc,id);
} | false | false | false | false | false | 0 |
more_args() const
{
return next_alias_arg != alias_args.begin() || argc > 0;
} | false | false | false | false | false | 0 |
cmp_mean_interarriv_tim(word64 *timvalp, struct q_hdr_t *q_p)
{
register int32 qi, i;
word64 avgtim, arrdif, quot, rem;
/* for one or less size q mean always 0 */
if (q_p->q_size <= 1) { *timvalp = 0ULL; return; }
avgtim = 0ULL;
if (q_p->q_fifo)
{
for (qi = q_p->q_hdr, i = 0; i < q_p->q_size; i++)
{
... | false | false | false | false | false | 0 |
SetDeviceStatus(const cec_bus_device_status newStatus, cec_version libCECSpecVersion /* = CEC_VERSION_1_4 */)
{
if (m_iLogicalAddress == CECDEVICE_UNREGISTERED)
return;
{
CLockObject lock(m_mutex);
switch (newStatus)
{
case CEC_DEVICE_STATUS_HANDLED_BY_LIBCEC:
if (m_deviceStatus != newSta... | false | false | false | false | false | 0 |
set_pwm(struct device *dev, struct device_attribute *devattr,
const char *buf, size_t count)
{
struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
struct adt7462_data *data = dev_get_drvdata(dev);
struct i2c_client *client = data->client;
long temp;
if (kstrtol(buf, 10, &temp))
return -EINVAL... | false | false | false | false | false | 0 |
lt_lang_db_ref(lt_lang_db_t *langdb)
{
lt_return_val_if_fail (langdb != NULL, NULL);
return lt_mem_ref((lt_mem_t *)langdb);
} | false | false | false | false | false | 0 |
skipLock(skipList list, UINT32 key, skipItem *save, INT32 top) {
INT32 i;
skipItem x, y;
if(list->threaded)
readLock(list);
x = list->header; /* header contains all levels */
for(i = top; /* loop from top level down to level 0 */
i >= 0;
i-... | false | false | false | false | false | 0 |
style_symbol_type_draw(struct style *style, cairo_t *cairoctx, enum key_action_type type, gdouble w, gdouble h)
{
START_FUNC
GSList *item=style->type_symbols;
while (item && (type!=((struct symbol *)item->data)->id.type)) {
item=g_slist_next(item);
}
if (item) {
if (((struct symbol *)item->data)->label) {
s... | false | false | false | false | false | 0 |
x509_self_test( int verbose )
{
#if defined(POLARSSL_CERTS_C) && defined(POLARSSL_MD5_C)
int ret;
int flags;
size_t i, j;
x509_cert cacert;
x509_cert clicert;
rsa_context rsa;
#if defined(POLARSSL_DHM_C)
dhm_context dhm;
#endif
if( verbose != 0 )
printf( " X.509 certificate loa... | false | false | false | false | false | 0 |
uptime(void)
{
#ifdef __FreeBSD__
struct timeval boottime;
time_t now;
int mib[2];
size_t size;
time_t u;
static char buf[1025];
(void)time(&now);
mib[0] = CTL_KERN;
mib[1] = KERN_BOOTTIME;
size = sizeof(boottime);
if (sysctl(mib, 2, &boottime, &size, NULL, 0) != -1 &&
... | false | false | false | false | false | 0 |
shell_interaction_close()
{
if(has_terminal)
set_term_mod(initial);
if(input >= 0)
{
close(input);
input = -1;
}
} | false | false | false | false | false | 0 |
eina_stringshare_del(Eina_Stringshare *str)
{
int slen;
if (!str)
return;
/* special cases */
if (str[0] == '\0')
slen = 0;
else if (str[1] == '\0')
slen = 1;
else if (str[2] == '\0')
slen = 2;
else if (str[3] == '\0')
slen = 3;
else
slen = 4; /* handled later */... | false | false | false | false | true | 1 |
enable() {
data->old_pbuffer = glXGetCurrentDrawable();
data->old_context = glXGetCurrentContext();
if(!glXMakeCurrent(data->display,data->pbuffer,data->context)) {
error("PBuffer::enable(): glXMakeCurrent() failed");
}
} | false | false | false | false | false | 0 |
_parse_cookie (CGI *cgi)
{
NEOERR *err;
char *cookie;
char *k, *v, *l;
HDF *obj;
err = hdf_get_copy (cgi->hdf, "HTTP.Cookie", &cookie, NULL);
if (err != STATUS_OK) return nerr_pass(err);
if (cookie == NULL) return STATUS_OK;
err = hdf_set_value (cgi->hdf, "Cookie", cookie);
if (err != STATUS_OK)
{... | false | false | false | false | false | 0 |
closeio(Posn p)
{
close(io);
io = 0;
if(p >= 0)
dprint("#%lud\n", p);
} | false | false | false | false | false | 0 |
PyLong_FromLong(long ival)
{
PyLongObject *v;
unsigned long abs_ival;
unsigned long t; /* unsigned so >> doesn't propagate sign bit */
int ndigits = 0;
int negative = 0;
if (ival < 0) {
/* if LONG_MIN == -LONG_MAX-1 (true on most platforms) then
ANSI C says that the result o... | false | false | false | false | true | 1 |
persistent_ram_init_ecc(struct persistent_ram_zone *prz,
struct persistent_ram_ecc_info *ecc_info)
{
int numerr;
struct persistent_ram_buffer *buffer = prz->buffer;
int ecc_blocks;
size_t ecc_total;
if (!ecc_info || !ecc_info->ecc_size)
return 0;
prz->ecc_info.block_size = ecc_info->block_size ?: 128;
... | false | false | false | false | false | 0 |
_doSetFixedOutputState(ArchiveHandle *AH)
{
/* Select the correct character set encoding */
ahprintf(AH, "SET client_encoding = '%s';\n",
pg_encoding_to_char(AH->public.encoding));
/* Select the correct string literal syntax */
ahprintf(AH, "SET standard_conforming_strings = %s;\n",
AH->public.std_strings ... | false | false | false | false | false | 0 |
load_data(struct dict_radix **dictp)
{
clock_t t1, t2;
if(hspell_debug){
fprintf(stderr,"Loading data files... ");
t1=clock();
}
*dictp = new_dict_radix();
if(!read_dict(*dictp, hspell_dictionary)){
delete_dict_radix(*dictp);
return -1;
}
if(hspell_debug){
t2=clock();
fprintf(stderr,"done (%d ms).\... | false | false | false | false | false | 0 |
set_rows_count(gulong rows_count_min, gulong rows_count_max)
{
m_rows_count_min = rows_count_min;
m_rows_count_max = rows_count_max;
//Keep the values sane:
if(m_rows_count_max < m_rows_count_min)
m_rows_count_max = m_rows_count_min;
} | false | false | false | false | false | 0 |
mxf_metadata_generic_sound_essence_descriptor_handle_tag (MXFMetadataBase *
metadata, MXFPrimerPack * primer, guint16 tag, const guint8 * tag_data,
guint tag_size)
{
MXFMetadataGenericSoundEssenceDescriptor *self =
MXF_METADATA_GENERIC_SOUND_ESSENCE_DESCRIPTOR (metadata);
gboolean ret = TRUE;
#ifndef ... | false | false | false | false | false | 0 |
QuoteString(const string &Str, const char *Bad)
{
string Res;
for (string::const_iterator I = Str.begin(); I != Str.end(); ++I)
{
if (strchr(Bad,*I) != 0 || isprint(*I) == 0 ||
*I == 0x25 || // percent '%' char
*I <= 0x20 || *I >= 0x7F) // control chars
{
char Buf[10];
sprintf(Buf,"%%%02... | false | false | false | false | false | 0 |
ixgbe_get_vf_reta(struct ixgbe_adapter *adapter, u32 *msgbuf, u32 vf)
{
u32 i, j;
u32 *out_buf = &msgbuf[1];
const u8 *reta = adapter->rss_indir_tbl;
u32 reta_size = ixgbe_rss_indir_tbl_entries(adapter);
/* Check if operation is permitted */
if (!adapter->vfinfo[vf].rss_query_enabled)
return -EPERM;
/* verif... | false | false | false | false | false | 0 |
stp_request_udma_await_tc_event(struct isci_request *ireq,
u32 completion_code)
{
enum sci_status status = SCI_SUCCESS;
switch (SCU_GET_COMPLETION_TL_STATUS(completion_code)) {
case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_GOOD):
ireq->scu_status = SCU_TASK_DONE_GOOD;
ireq->sci_status = SCI_SUCCESS... | false | false | false | false | false | 0 |
state_init(SRE_STATE* state, PatternObject* pattern, PyObject* string,
Py_ssize_t start, Py_ssize_t end)
{
/* prepare state object */
Py_ssize_t length;
int logical_charsize, charsize;
void* ptr;
memset(state, 0, sizeof(SRE_STATE));
state->lastmark = -1;
state->lastindex = -1;
... | false | false | false | false | false | 0 |
cfg_layout_delete_block (basic_block bb)
{
rtx insn, next, prev = PREV_INSN (BB_HEAD (bb)), *to, remaints;
if (bb->il.rtl->header)
{
next = BB_HEAD (bb);
if (prev)
NEXT_INSN (prev) = bb->il.rtl->header;
else
set_first_insn (bb->il.rtl->header);
PREV_INSN (bb->il.rtl->header) = prev;
... | false | false | false | false | false | 0 |
FindTokensInFile(const wxString& filename, TokenIdxSet& result, short int kindMask)
{
result.clear();
size_t tokens_found = 0;
TRACE(_T("Parser::FindTokensInFile() : Searching for file '%s' in tokens tree..."), filename.wx_str());
CC_LOCKER_TRACK_TT_MTX_LOCK(s_TokenTreeMutex)
TokenIdxSet tmpresul... | false | false | false | false | false | 0 |
print_end_redirection (PRN *prn)
{
int err = 0;
if (prn != NULL) {
if (prn->fixed) {
prn->fixed = 0;
} else if (prn->fp != NULL) {
if (prn->fp != stdout && prn->fp != stderr) {
fclose(prn->fp);
}
prn->fp = prn->fpaux;
prn->fpaux = NULL;
}
} else {
err = 1;
}
retu... | false | false | false | false | false | 0 |
is_allowed_whitespace(unsigned c) {
return c == ' ' || Allowed_Whitespace[c & 0xff];
} | false | false | false | false | false | 0 |
clar_print_error(int num, const struct clar_error *error)
{
(void)num;
printf(" ---\n");
printf(" message : %s\n", error->error_msg);
printf(" severity: fail\n");
printf(" suite : %s\n", error->suite);
printf(" test : %s\n", error->test);
printf(" file : %s\n", error->file);
printf(" line : %... | false | false | false | false | false | 0 |
rehash (Hash *t)
{
int i;
int nold = nhash(t);
Node *vold = nodevector(t);
nhash(t) = luaI_redimension(nhash(t));
nodevector(t) = hashnodecreate(nhash(t));
for (i=0; i<nold; i++)
{
Node *n = vold+i;
if (tag(ref(n)) != LUA_T_NIL && tag(val(n)) != LUA_T_NIL)
*node(t, present(t, ref(n))) = *n; /* copy old... | false | false | false | false | false | 0 |
get_function_name(xp, idx)
expand_T *xp;
int idx;
{
static int intidx = -1;
char_u *name;
if (idx == 0)
intidx = -1;
if (intidx < 0)
{
name = get_user_func_name(xp, idx);
if (name != NULL)
return name;
}
if (++intidx < (int)(sizeof(functions) / sizeof(struct fst)))
{
S... | false | false | false | false | false | 0 |
audioresample_buffer_new_subbuffer (AudioresampleBuffer * buffer, int offset,
int length)
{
AudioresampleBuffer *subbuffer = audioresample_buffer_new ();
if (buffer->parent) {
audioresample_buffer_ref (buffer->parent);
subbuffer->parent = buffer->parent;
} else {
audioresample_buffer_ref (buffer)... | false | false | false | false | false | 0 |
kc_ht_free_single_elements
#ifdef KC_USE_PROTOTYPES
(kc_hashtable_t kc_a_hashtable_t, int kc_i, int kc_m)
#else
(kc_a_hashtable_t, kc_i, kc_m) kc_hashtable_t kc_a_hashtable_t; int kc_i; int kc_m;
#endif
{ int kc_j;
if ((int)kc_m == (int)kc_ht_store_static) {
for (kc_j=0; kc_j < kc_a_hashtable_t->hashtable[kc_i][kc_m... | false | false | false | false | false | 0 |
free_entry(UResourceDataEntry *entry) {
UResourceDataEntry *alias;
res_unload(&(entry->fData));
if(entry->fName != NULL && entry->fName != entry->fNameBuffer) {
uprv_free(entry->fName);
}
if(entry->fPath != NULL) {
uprv_free(entry->fPath);
}
if(entry->fPool != NULL) {
... | false | false | false | false | false | 0 |
reportException(ExecState *exec, JSValue *exceptionVal)
{
if (!hasHandledException(exec, exceptionVal))
exception(exec, exec->currentBody() ? exec->currentBody()->sourceId() : lastSourceParsed, lastLineRan, exceptionVal);
} | false | false | false | false | false | 0 |
hdrl_set_masks_on_imagelist(cpl_imagelist * list, cpl_mask ** masks)
{
cpl_ensure_code(list, CPL_ERROR_NULL_INPUT);
cpl_ensure_code(masks, CPL_ERROR_NULL_INPUT);
for (size_t i = 0; i < (size_t)cpl_imagelist_get_size(list); i++) {
cpl_image * img = cpl_imagelist_get(list, i);
cpl_mask * img_... | false | false | false | false | false | 0 |
real_get_obj_matrix (void *p, GretlObjType type, int idx, int *err)
{
gretl_matrix *M = NULL;
if (idx <= 0) {
*err = 1;
return M;
}
if (type == GRETL_OBJ_EQN) {
MODEL *pmod = (MODEL *) p;
M = gretl_model_get_matrix(pmod, idx, err);
} else if (type == GRETL_OBJ_SYS) {
equation_system *sys... | false | false | false | false | false | 0 |
pull(int)
{
Packet *p = input(0).pull();
if (!p)
return 0;
ErrorHandler *errh = ErrorHandler::default_handler();
ContextErrorHandler cerrh(errh, "While executing %<%{element}%>:", this);
// This is slow, but it probably doesn't need to be fast.
int i = find_variable(String::make_stable("input... | false | false | false | false | false | 0 |
device_cancel_authentication(struct btd_device *device, gboolean aborted)
{
struct authentication_req *auth = device->authr;
char addr[18];
if (!auth)
return;
ba2str(&device->bdaddr, addr);
DBG("Canceling authentication request for %s", addr);
if (auth->agent)
agent_cancel(auth->agent);
if (!aborted)
c... | false | false | false | false | false | 0 |
goodix_process_events(struct goodix_ts_data *ts)
{
u8 point_data[1 + GOODIX_CONTACT_SIZE * GOODIX_MAX_CONTACTS];
int touch_num;
int i;
touch_num = goodix_ts_read_input_report(ts, point_data);
if (touch_num < 0)
return;
for (i = 0; i < touch_num; i++)
goodix_ts_report_touch(ts,
&point_data[1 + GOODIX_CO... | false | false | false | false | false | 0 |
gx_device_copy_color_procs(gx_device *dev, const gx_device *target)
{
dev_proc_map_cmyk_color((*from_cmyk)) =
dev_proc(dev, map_cmyk_color);
dev_proc_map_rgb_color((*from_rgb)) =
dev_proc(dev, map_rgb_color);
dev_proc_map_color_rgb((*to_rgb)) =
dev_proc(dev, map_color_rgb);
/* T... | false | false | false | false | false | 0 |
process_frame(int curX, int curY)
{
//---- restore the screen area overwritten by the last frame ---//
if( frame_shown )
{
vga_front.fast_put_bitmap( frame_x1, frame_y1, frame_top_save_scr );
vga_front.fast_put_bitmap( frame_x1, frame_y2, frame_bottom_save_scr );
vga_front.fast_put_bitmap( frame_x1, frame_... | false | false | false | false | false | 0 |
USBD_SetConfig(USB_OTG_CORE_HANDLE *pdev,
USB_SETUP_REQ *req) {
static uint8_t cfgidx;
cfgidx = (uint8_t)(req->wValue);
if (cfgidx > USBD_CFG_MAX_NUM ) {
USBD_CtlError(pdev , req);
} else {
switch (pdev->dev.device_status) {
case USB_OTG_ADDRESSED:
if (cfgidx) {
pdev->dev.device_config... | false | false | false | false | false | 0 |
shape_func_bottom (gdouble x)
{
gdouble y1 = 0.2/4.;
gdouble y2 = 1e-6/4.;
if (x <= -0.25)
return y1;
if (x < 0.25)
return y2 + 0.5*(y1 - y2)*(1. + cos (2.*M_PI*(x + 0.25)));
return y2;
} | 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.