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 |
|---|---|---|---|---|---|---|
add_child(struct cross_elem *word, struct strie_pair *new_child)
{
struct strie_pair *cur_child = NULL;
if (!word)
return 1;
if (!word->firstchild)
{
word->firstchild = new_child;
return 0;
}
cur_child = word->firstchild;
while (cur_child->brother)
{
cu... | false | false | false | false | false | 0 |
main(int argc, char ** argv) {
if (argc < 2 || strcmp(argv[1], "--help") == 0) {
printHelp();
return 0;
}
rollYourOwn(argc-1, argv+1);
return 0;
} | false | false | false | false | false | 0 |
psb_lid_timer_func(unsigned long data)
{
struct drm_psb_private * dev_priv = (struct drm_psb_private *)data;
struct drm_device *dev = (struct drm_device *)dev_priv->dev;
struct timer_list *lid_timer = &dev_priv->lid_timer;
unsigned long irq_flags;
u32 __iomem *lid_state = dev_priv->opregion.lid_state;
u32 pp_stat... | false | false | false | false | false | 0 |
setCfCaption(const char * s)
{
mutexLock(M_STATE);
if (_state.cf.caption == NULL) {
_state.cf.caption = stringNew(s);
} else {
stringAssign(_state.cf.caption,s);
}
mutexUnlock(M_STATE);
} | false | false | false | false | false | 0 |
utf8_len(char *s)
{
int l=0;
while(*s)
if ((*s++&0xc0)!=0x80)
l++;
return l;
} | false | false | false | false | false | 0 |
note_off(long cycles, int channel, int note)
{
uint8_t event[3];
//event[0] = 0x80 | channel;
event[0] = 0x80;
event[1] = note;
event[2] = 0;
if (midi_write_event(cycles, event, 3))
return 1;
return 0;
} | false | false | false | false | false | 0 |
handlemenu(int value)
{
switch (value) {
case MENU_QUIT:
exit(0);
break;
case MENU_RAND:
NewFractals();
Rebuild = 1;
glutPostRedisplay();
break;
case MENU_AXES:
DrawAxes = !DrawAxes;
glutPostRedisplay();
break;
}
} | false | false | false | false | false | 0 |
createmultipartmime(struct mimestruct *m)
{
const char *b=mkboundary(m, m->inputfp1);
struct arg_list *a;
int c;
if (m->mimeencoding == 0)
m->mimeencoding="8bit";
for (a=m->a_first; a; a=a->next)
fprintf(m->outputfp, "%s\n", a->arg);
fprintf(m->outputfp, "Content-Type: %s; boundary=\"%s\"\n"
"Content-Transf... | false | false | false | false | false | 0 |
uwb_drp_process_owner(struct uwb_rc *rc, struct uwb_rsv *rsv,
struct uwb_dev *src, struct uwb_ie_drp *drp_ie,
struct uwb_rc_evt_drp *drp_evt)
{
struct device *dev = &rc->uwb_dev.dev;
int status;
enum uwb_drp_reason reason_code;
struct uwb_mas_bm mas;
status = uwb_ie_drp_status(drp_ie);
reason_code = ... | false | false | false | false | false | 0 |
ReplaceAt(Dlist *l,size_t position,const void *data)
{
DlistElement *rvp;
if (l == NULL || data == NULL) {
if (l)
l->RaiseError("iDlist.ReplaceAt",CONTAINER_ERROR_BADARG);
else
iError.NullPtrError("iDlist.ReplaceAt");
return CONTAINER_ERROR_BADARG;
}
/* Error checking */
... | false | false | false | false | false | 0 |
luaQ_call(lua_State *L, int na, int nr, QObject *obj)
{
int base = lua_gettop(L) - na;
Q_ASSERT(base > 0);
lua_pushcfunction(L, lua_error_handler);
lua_insert(L, base);
int status = luaQ_pcall(L, na, nr, base, obj);
lua_remove(L, base);
if (status)
lua_error(L);
} | false | false | false | false | false | 0 |
r_realloc(void *dp, size_t size)
{
void *result;
if (size > BIG)
{
errno = EINVAL;
return 0;
}
errno = 0;
result = realloc(dp, (unsigned int) size);
if (!result && !errno)
errno = ENOMEM;
return result;
} | false | false | false | false | false | 0 |
cavan_net_bridge_deinit(struct cavan_net_bridge *bridge)
{
struct cavan_net_bridge_port *port, *head;
head = bridge->head;
if (head)
{
port = head;
while (1)
{
struct cavan_net_bridge_port *next = port->next;
free(port);
if (next == head)
{
break;
}
port = next;
}
}
cavan_threa... | false | false | false | false | false | 0 |
explosion (CONST int x, CONST int y, CONST int type, CONST int letter, CONST int n)
{
float i;
int speed;
int color1;
int radius1 = radius (type);
#ifdef NETSUPPORT
if (server)
{
Explosion (x, y, type, letter, n);
return;
}
#endif
for (i = 0;... | false | false | false | false | false | 0 |
gretl_VAR_plot_impulse_response (GRETL_VAR *var,
int targ, int shock,
int periods, double alpha,
const DATASET *dset,
gretlopt opt)
{
int use_fill = !(opt & OPT_E);
gretl_matrix *resp;
int err = 0;
if (alpha != 0 && (alpha < 0.01 || alpha > 0.5)) {
return E_DATA;
}
resp =... | false | false | false | false | false | 0 |
set_sample_rate_( long sample_rate )
{
blip_eq_t eq( -32, 8000, sample_rate );
apu.treble_eq( eq );
dac_synth.treble_eq( eq );
apu.volume( 0.135 * fm_gain * gain() );
dac_synth.volume( 0.125 / 256 * fm_gain * gain() );
double factor = Dual_Resampler::setup( oversample_factor, 0.990, fm_gain * gain() );
fm_sample... | false | false | false | false | false | 0 |
bug20080721 (void)
{
mpfr_t x, y, z, t[2];
int inex;
int rnd;
int err = 0;
/* Note: input values have been chosen in a way to select the
* general case. If mpfr_pow is modified, in particular line
* if (y_is_integer && (MPFR_GET_EXP (y) <= 256))
* make sure that this test still does what we want... | false | false | false | false | false | 0 |
mca_coll_basic_alltoallw_inter(void *sbuf, int *scounts, int *sdisps,
struct ompi_datatype_t **sdtypes,
void *rbuf, int *rcounts, int *rdisps,
struct ompi_datatype_t **rdtypes,
struct ompi_communi... | false | false | false | false | false | 0 |
copystr(s)
const char *s;
{
char *str;
str = malloc((size_t) (strlen(s) + 1));
if (str == NULL) {
fprintf(stderr, "recover: cannot malloc for copystr.\n");
exit(-1);
}
strcpy(str, s);
return str;
} | false | false | false | false | false | 0 |
rtl8139_set_mac_address(struct net_device *dev, void *p)
{
struct rtl8139_private *tp = netdev_priv(dev);
void __iomem *ioaddr = tp->mmio_addr;
struct sockaddr *addr = p;
if (!is_valid_ether_addr(addr->sa_data))
return -EADDRNOTAVAIL;
memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
spin_lock_irq(&tp->lo... | false | true | false | false | false | 1 |
DumpHist( fname )
char *fname;
{
FILE *fp;
if( (fp = fopen( fname, "w" )) == NULL )
{
lprintf( stderr, "can not open file '%s'\n", fname );
return;
}
if( WriteHistHeader( fp ) )
{
lprintf( stderr, "can't write to file '%s'\n", fname );
(void) fclose( fp );
return;
}
... | false | false | false | false | false | 0 |
generate_session_for_leader (CkManager *manager,
CkSessionLeader *leader,
DBusGMethodInvocation *context)
{
gboolean res;
res = ck_session_leader_collect_parameters (leader,
c... | false | false | false | false | false | 0 |
_mesa_ast_to_hir(exec_list *instructions, struct _mesa_glsl_parse_state *state)
{
_mesa_glsl_initialize_variables(instructions, state);
_mesa_glsl_initialize_functions(state);
state->symbols->language_version = state->language_version;
state->current_function = NULL;
state->toplevel_ir = instructions;... | false | false | false | false | false | 0 |
tpdu_read_header(STREAM* s, uint8* code)
{
uint8 li;
stream_read_uint8(s, li); /* LI */
stream_read_uint8(s, *code); /* Code */
if (*code == X224_TPDU_DATA)
{
/* EOT (1 byte) */
stream_seek(s, 1);
}
else
{
/* DST-REF (2 bytes) */
/* SRC-REF (2 bytes) */
/* Class 0 (1 byte) */
stream_seek(s, 5);
}... | false | false | false | false | false | 0 |
gdk_pixbuf_loader_init (GdkPixbufLoader *loader)
{
GdkPixbufLoaderPrivate *priv;
priv = g_new0 (GdkPixbufLoaderPrivate, 1);
priv->width = -1;
priv->height = -1;
loader->priv = priv;
} | false | false | false | false | false | 0 |
test_secret_for_path_sync (Test *test,
gconstpointer used)
{
SecretValue *value;
GError *error = NULL;
const gchar *path;
const gchar *password;
gsize length;
path = "/org/freedesktop/secrets/collection/english/1";
value = secret_service_get_secret_for_dbus_path_sync (test->service, p... | false | false | false | false | false | 0 |
drawText(const FbDrawable &w, int screen, GC gc,
const char* text, size_t len, int x, int y,
Orientation orient) const {
if (!text || !*text || len == 0)
return;
// draw "effects" first
if (m_shadow) {
FbTk::GContext shadow_gc(w);
shadow_gc.s... | false | false | false | false | false | 0 |
ssdv_out_headers(ssdv_t *s)
{
uint8_t *b = &s->stbls[s->stbl_len];
ssdv_write_marker(s, J_SOI, 0, 0);
ssdv_write_marker(s, J_APP0, 14, app0);
ssdv_write_marker(s, J_DQT, 65, std_dqt0); /* DQT Luminance */
ssdv_write_marker(s, J_DQT, 65, std_dqt1); /* DQT Chrominance */
/* Build SOF0 header... | false | false | false | false | false | 0 |
xstrappend(char *src, const char *newd)
#endif
{
size_t newsz;
if (!src) {
return xxstrdup(newd, file, line);
}
if (!newd) {
return xxstrdup(src, file, line);
}
newsz = strlen(src) + strlen(newd) + 1;
src = (char *) xxrealloc(src, newsz, file, line);
strcat(src, newd);
return src;
} | false | false | false | false | false | 0 |
glusterd_op_ac_rcvd_commit_op_acc (glusterd_op_sm_event_t *event, void *ctx)
{
dict_t *dict = NULL;
int ret = 0;
gf_boolean_t commit_ack_inject = _gf_true;
glusterd_op_t op = GD_OP_NONE;
... | false | false | false | false | false | 0 |
Remove(unsigned int pos)
{
plist_array_remove_item(_node, pos);
std::vector<Node*>::iterator it = _array.begin();
it += pos;
delete _array.at(pos);
_array.erase(it);
} | false | false | false | false | false | 0 |
operator<<(ostream &o, const ACE_Time_Value &v)
{
char oldFiller = o.fill ();
o.fill ('0');
const timeval *tv = v;
if (tv->tv_sec)
{
o << tv->tv_sec;
if (tv->tv_usec)
o << '.' << std::setw (6) << ACE_STD_NAMESPACE::abs (tv->tv_usec);
}
else if (tv->tv_usec < 0)
o << "-0." << st... | false | false | false | false | false | 0 |
_wrap_svn_client_get_changelists(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
char *arg1 = (char *) 0 ;
apr_array_header_t *arg2 = (apr_array_header_t *) 0 ;
svn_depth_t arg3 ;
svn_changelist_receiver_t arg4 = (svn_changelist_receiver_t) 0 ;
void *arg5 = (void *) 0 ;
svn_clie... | false | false | false | false | false | 0 |
process_line (char *line,
gpointer data)
{
FileData *fdata;
FrCommand *comm = FR_COMMAND (data);
char **fields;
int date_idx;
char *field_month, *field_day, *field_time, *field_year;
char *field_size, *field_name;
g_return_if_fail (line != NULL);
fdata = file_data... | false | false | false | false | false | 0 |
ptrarray_remove_index()
{
GPtrArray *array;
guint i;
array = ptrarray_alloc_and_fill(&i);
g_ptr_array_remove_index(array, 0);
if(array->pdata[0] != items[1]) {
return FAILED("First item is not %s, it is %s", items[1],
array->pdata[0]);
}
g_ptr_array_remove_index(array, array->len - 1);
if(array->pda... | false | false | false | false | false | 0 |
generate_15(DSRDocument *doc)
{
doc->createNewDocument(DSRTypes::DT_BasicTextSR);
doc->createNewSeriesInStudy("1.3.12.2.1107.5.8.1.123456789.199507271758050705910");
doc->setStudyDescription("OFFIS Structured Reporting Samples");
doc->setSeriesDescription("RSNA '95, Siemens, MR");
doc->setPatientNa... | false | false | false | false | false | 0 |
bmc150_magn_compensate_y(struct bmc150_magn_trim_regs *tregs, s16 y,
u16 rhall)
{
s16 val;
u16 xyz1 = le16_to_cpu(tregs->xyz1);
if (y == BMC150_MAGN_XY_OVERFLOW_VAL)
return S32_MIN;
if (!rhall)
rhall = xyz1;
val = ((s16)(((u16)((((s32)xyz1) << 14) / rhall)) - ((u16)0x4000)));
val = ((s16)((((s32)y)... | false | false | false | false | false | 0 |
H5FD_flush(H5FD_t *file, hid_t dxpl_id, unsigned closing)
{
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
HDassert(file && file->cls);
if(file->cls->flush && (file->cls->flush)(file, dxpl_id, closing) < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver flu... | false | false | false | false | false | 0 |
it821x_passthru_bmdma_stop(struct ata_queued_cmd *qc)
{
struct ata_port *ap = qc->ap;
struct ata_device *adev = qc->dev;
struct it821x_dev *itdev = ap->private_data;
int unit = adev->devno;
ata_bmdma_stop(qc);
if (itdev->mwdma[unit] != MWDMA_OFF)
it821x_program(ap, adev, itdev->pio[unit]);
} | false | false | false | false | false | 0 |
deleteNextChar() {
int textLen = fText.length();
if (curPos < textLen) {
markPos = curPos + 1;
deleteSelection();
return true;
}
return false;
} | false | false | false | false | false | 0 |
Retrieve(int lineNumber, int lineCaret, int maxChars, int styleClock_,
int linesOnScreen, int linesInDoc) {
AllocateForLevel(linesOnScreen, linesInDoc);
if (styleClock != styleClock_) {
Invalidate(LineLayout::llCheckTextAndStyle);
styleClock = styleClock_;
}
allInvalidated ... | false | false | false | false | false | 0 |
_get_config_disk_area(struct cmd_context *cmd,
const struct dm_config_node *cn, struct dm_list *raw_list)
{
struct device_area dev_area;
const char *id_str;
struct id id;
if (!(cn = cn->child)) {
log_error("Empty metadata disk_area section of config file");
return 0;
}
if (!dm_config_get_uint64(cn, "st... | true | true | false | false | false | 1 |
blk_rq_count_integrity_sg(struct request_queue *q, struct bio *bio)
{
struct bio_vec iv, ivprv = { NULL };
unsigned int segments = 0;
unsigned int seg_size = 0;
struct bvec_iter iter;
int prev = 0;
bio_for_each_integrity_vec(iv, bio, iter) {
if (prev) {
if (!BIOVEC_PHYS_MERGEABLE(&ivprv, &iv))
goto new... | false | false | false | false | false | 0 |
cobc_malloc (const size_t size)
{
void *mptr;
mptr = calloc (1, size);
if (!mptr) {
fprintf (stderr, "Cannot allocate %d bytes of memory - Aborting\n", (int)size);
fflush (stderr);
(void)longjmp (cob_jmpbuf, 1);
}
return mptr;
} | false | false | false | false | false | 0 |
kvm_vcpu_yield_to(struct kvm_vcpu *target)
{
struct pid *pid;
struct task_struct *task = NULL;
int ret = 0;
rcu_read_lock();
pid = rcu_dereference(target->pid);
if (pid)
task = get_pid_task(pid, PIDTYPE_PID);
rcu_read_unlock();
if (!task)
return ret;
ret = yield_to(task, 1);
put_task_struct(task);
retu... | false | false | false | false | false | 0 |
process_all_all_constraints (vec<ce_s> lhsc,
vec<ce_s> rhsc)
{
struct constraint_expr *lhsp, *rhsp;
unsigned i, j;
if (lhsc.length () <= 1 || rhsc.length () <= 1)
{
FOR_EACH_VEC_ELT (lhsc, i, lhsp)
FOR_EACH_VEC_ELT (rhsc, j, rhsp)
process_constraint (new_constraint (*lhsp, *rhsp));
}
... | false | false | false | false | false | 0 |
genRedisInfoString(void) {
sds info;
time_t uptime = time(NULL)-server.stat_starttime;
int j;
info = sdscatprintf(sdsempty(),
"redis_version:%s\r\n"
"arch_bits:%s\r\n"
"multiplexing_api:%s\r\n"
"uptime_in_seconds:%ld\r\n"
"uptime_in_days:%ld\r\n"
"con... | false | false | false | false | false | 0 |
vac_truncate_clog(TransactionId frozenXID)
{
TransactionId myXID = GetCurrentTransactionId();
Relation relation;
HeapScanDesc scan;
HeapTuple tuple;
NameData oldest_datname;
bool frozenAlreadyWrapped = false;
/* init oldest_datname to sync with my frozenXID */
namestrcpy(&oldest_datname, get_database_name(MyD... | false | false | false | false | false | 0 |
findDefsUsedOutsideOfLoop(Loop *L) {
SmallVector<Instruction *, 8> UsedOutside;
for (auto *Block : L->getBlocks())
// FIXME: I believe that this could use copy_if if the Inst reference could
// be adapted into a pointer.
for (auto &Inst : *Block) {
auto Users = Inst.users();
if (std::any_of... | false | false | false | false | false | 0 |
mxf_primer_pack_add_mapping (MXFPrimerPack * primer, guint16 local_tag,
const MXFUL * ul)
{
MXFUL *uid;
#ifndef GST_DISABLE_GST_DEBUG
gchar str[48];
#endif
guint ltag_tmp = local_tag;
if (primer->mappings == NULL) {
primer->mappings = g_hash_table_new_full (g_direct_hash, g_direct_equal,
(GDest... | false | true | false | false | false | 1 |
laggenr (int v, int lag, DATASET *dset)
{
int lno;
if (lag > dset->n || -lag > dset->n) {
gretl_errmsg_sprintf(_("Invalid lag order %d"), lag);
lno = -1;
} else if (lag == 0) {
lno = v;
} else {
lno = get_transform(LAGS, v, lag, 0.0, dset,
VNAMELEN - 3, dset->v);
}
return lno;
} | false | false | false | false | false | 0 |
rndis_reset_response(struct rndis_params *params,
rndis_reset_msg_type *buf)
{
rndis_reset_cmplt_type *resp;
rndis_resp_t *r;
r = rndis_add_response(params, sizeof(rndis_reset_cmplt_type));
if (!r)
return -ENOMEM;
resp = (rndis_reset_cmplt_type *)r->buf;
resp->MessageType = cpu_to_le32(RNDIS_MSG_RESET_C);... | false | false | false | false | false | 0 |
hexium_set_input(struct hexium *hexium, int input)
{
union i2c_smbus_data data;
int i = 0;
DEB_D("\n");
for (i = 0; i < 8; i++) {
int adr = hexium_input_select[input].data[i].adr;
data.byte = hexium_input_select[input].data[i].byte;
if (0 != i2c_smbus_xfer(&hexium->i2c_adapter, 0x4e, 0, I2C_SMBUS_WRITE, adr... | false | false | false | false | false | 0 |
volgen_graph_add_as (volgen_graph_t *graph, const char *type,
const char *format, ...)
{
va_list arg;
xlator_t *xl = NULL;
va_start (arg, format);
xl = xlator_instantiate_va (type, format, arg);
va_end (arg);
if (!xl)
return NULL;
... | false | false | false | false | false | 0 |
walk_references (GCObject *start, size_t size, void *data)
{
HeapWalkInfo *hwi = (HeapWalkInfo *)data;
hwi->called = 0;
hwi->count = 0;
collect_references (hwi, start, size);
if (hwi->count || !hwi->called)
hwi->callback (start, mono_object_class (start), hwi->called? 0: size, hwi->count, hwi->refs, hwi->offsets... | false | false | false | false | false | 0 |
hard_to_d() const {
switch (u_.x.type) {
case j_array:
case j_object:
return size();
case j_bool:
case j_int:
return u_.i.x;
case j_unsigned:
return u_.u.x;
case j_double:
return u_.d.x;
case j_null:
case j_string:
default:
if (!u_.x.x)
... | false | false | false | false | false | 0 |
nemo_file_is_launchable (NemoFile *file)
{
gboolean type_can_be_executable;
type_can_be_executable = FALSE;
if (file->details->mime_type != NULL) {
type_can_be_executable =
g_content_type_can_be_executable (eel_ref_str_peek (file->details->mime_type));
}
return type_can_be_executable &&
nemo_file_can_ge... | false | false | false | false | false | 0 |
dock_startup(gboolean reconfig)
{
XSetWindowAttributes attrib;
if (reconfig) {
GList *it;
XSetWindowBorder(obt_display, dock->frame,
RrColorPixel(ob_rr_theme->osd_border_color));
XSetWindowBorderWidth(obt_display, dock->frame, ob_rr_theme->obwidth);
Rr... | false | false | false | false | false | 0 |
show_pack_info(struct packed_git *p)
{
uint32_t nr_objects, i, chain_histogram[MAX_CHAIN+1];
nr_objects = p->num_objects;
memset(chain_histogram, 0, sizeof(chain_histogram));
for (i = 0; i < nr_objects; i++) {
const unsigned char *sha1;
unsigned char base_sha1[20];
const char *type;
unsigned long size;
u... | false | false | false | false | false | 0 |
stickynotes_applet_update_icon(StickyNotesApplet *applet)
{
GdkPixbuf *pixbuf1, *pixbuf2;
gint size = applet->panel_size;
if (size > 3)
size = size -3;
/* Choose appropriate icon and size it */
if (applet->prelighted)
pixbuf1 = gdk_pixbuf_scale_simple(stickynotes->icon_prelight, size, si... | false | false | false | false | false | 0 |
write_authority_file (XServerLocal *server)
{
XAuthority *authority;
GError *error = NULL;
authority = x_server_get_authority (X_SERVER (server));
if (!authority)
return;
/* Get file to write to if have authority */
if (!server->priv->authority_file)
{
gchar *run_dir, *dir;... | false | false | false | false | false | 0 |
wait_connectable(int fd)
{
int sockerr;
socklen_t sockerrlen;
int revents;
int ret;
for (;;) {
/*
* Stevens book says, succuessful finish turn on RB_WAITFD_OUT and
* failure finish turn on both RB_WAITFD_IN and RB_WAITFD_OUT.
*/
revents = rb_wait_for_single_fd(fd, RB_WAITFD_IN|RB_WAITFD_OUT... | false | false | false | false | false | 0 |
hslider_size(t_hslider *x, t_symbol *s, int ac, t_atom *av)
{
hslider_check_width(x, (int)atom_getintarg(0, ac, av));
if(ac > 1)
x->x_gui.x_h = iemgui_clip_size((int)atom_getintarg(1, ac, av));
iemgui_size((void *)x, &x->x_gui);
} | false | false | false | false | false | 0 |
bld_stmt_evxlst(struct st_t *stp)
{
switch ((byte) stp->stmttyp) {
case S_NULL: case S_STNONE: break;
case S_PROCA: case S_FORASSGN: case S_RHSDEPROCA: case S_NBPROCA:
/* know if lhs IS form bit or array select - will be split */
bld_lhs_impl_evxlst(stp->st.spra.lhsx);
bld_rhs_impl_evxlst(stp->st.spra.rhs... | false | false | false | false | false | 0 |
InitializeGUCOptionsFromEnvironment(void)
{
char *env;
long stack_rlimit;
env = getenv("PGPORT");
if (env != NULL)
SetConfigOption("port", env, PGC_POSTMASTER, PGC_S_ENV_VAR);
env = getenv("PGDATESTYLE");
if (env != NULL)
SetConfigOption("datestyle", env, PGC_POSTMASTER, PGC_S_ENV_VAR);
env = getenv("... | true | true | false | false | true | 1 |
glf3_view(glfFile fp)
{
glf3_header_t *h;
char *name;
glf3_t *g3;
int len;
h = glf3_header_read(fp);
g3 = glf3_init1();
while ((name = glf3_ref_read(fp, &len)) != 0) {
int pos = 0;
while (glf3_read1(fp, g3) && g3->rtype != GLF3_RTYPE_END) {
pos += g3->offset;
glf3_view1(name, g3, pos);
}
free(name)... | false | false | false | false | false | 0 |
_narrow(CORBA::Object_ptr obj)
{
if( !obj || obj->_NP_is_nil() ) return _nil();
if( obj->_NP_is_pseudo() ) {
_ptr_type e = (_ptr_type) obj->_ptrToObjRef(_PD_repoId);
if (e) {
e->_NP_incrRefCount();
return e;
}
else {
return _nil();
}
}
else {
_ptr_type e = (_ptr_type) o... | false | false | false | false | false | 0 |
wait_block_group_cache_done(struct btrfs_block_group_cache *cache)
{
struct btrfs_caching_control *caching_ctl;
int ret = 0;
caching_ctl = get_caching_control(cache);
if (!caching_ctl)
return (cache->cached == BTRFS_CACHE_ERROR) ? -EIO : 0;
wait_event(caching_ctl->wait, block_group_cache_done(cache));
if (cac... | false | false | false | false | false | 0 |
globus_gss_assist_will_handle_restrictions(
OM_uint32 * minor_status,
gss_ctx_id_t * context_handle)
{
OM_uint32 maj_stat;
gss_buffer_desc oid_buffer;
gss_OID_set_desc oid_set;
static ch... | false | false | false | false | false | 0 |
gwy_data_field_duplicate_real(GObject *object)
{
GwyDataField *data_field, *duplicate;
g_return_val_if_fail(GWY_IS_DATA_FIELD(object), NULL);
data_field = GWY_DATA_FIELD(object);
duplicate = gwy_data_field_new_alike(data_field, FALSE);
memcpy(duplicate->data, data_field->data,
data_field... | false | true | false | false | false | 1 |
dpm_sysfs_add(struct device *dev)
{
int rc;
rc = sysfs_create_group(&dev->kobj, &pm_attr_group);
if (rc)
return rc;
if (pm_runtime_callbacks_present(dev)) {
rc = sysfs_merge_group(&dev->kobj, &pm_runtime_attr_group);
if (rc)
goto err_out;
}
if (device_can_wakeup(dev)) {
rc = sysfs_merge_group(&dev->k... | false | false | false | false | false | 0 |
image_loader_delay_area_ready(ImageLoader *il, gboolean enable)
{
g_mutex_lock(il->data_mutex);
il->delay_area_ready = enable;
if (!enable)
{
/* send delayed */
GList *list, *work;
list = g_list_reverse(il->area_param_delayed_list);
il->area_param_delayed_list = NULL;
g_mutex_unlock(il->data_mutex);
w... | false | false | false | false | false | 0 |
FetchDuff(uint32 P, uint32 envelope) {
uint32 duff;
duff = IRAM[((IRAM[0x46 + (P << 3)] + (PlayIndex[P] >> TOINDEX)) & 0xFF) >> 1];
if ((IRAM[0x46 + (P << 3)] + (PlayIndex[P] >> TOINDEX)) & 1)
duff >>= 4;
duff &= 0xF;
duff = (duff * envelope) >> 16;
return(duff);
} | false | false | false | false | false | 0 |
bgx_get_rx_stats(int node, int bgx_idx, int lmac, int idx)
{
struct bgx *bgx;
bgx = bgx_vnic[(node * MAX_BGX_PER_CN88XX) + bgx_idx];
if (!bgx)
return 0;
if (idx > 8)
lmac = 0;
return bgx_reg_read(bgx, lmac, BGX_CMRX_RX_STAT0 + (idx * 8));
} | false | false | false | false | false | 0 |
main(int argc, char *argv[])
{
string name = argv[0];
if(argc != 4)
{
cout << "Try to type :"<< endl
<< " ./decypher <cypherText> <key> <mode>" << endl
<< " Mode = ('-sub') | ('-tran') | ('-all')"<<endl;
exit(-1);
}
Decryption decryption;
string cypherText, key, plainText;
cypherText = read... | false | false | false | false | false | 0 |
get_ticks(__u32 *ticks, const char *str)
{
unsigned t;
if(get_time(&t, str))
return -1;
if (tc_core_time2big(t)) {
fprintf(stderr, "Illegal %u time (too large)\n", t);
return -1;
}
*ticks = tc_core_time2tick(t);
return 0;
} | false | false | false | false | false | 0 |
max77802_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
{
struct max77802_rtc_info *info = dev_get_drvdata(dev);
u8 data[RTC_NR_TIME];
unsigned int val;
int ret;
mutex_lock(&info->lock);
ret = max77802_rtc_update(info, MAX77802_RTC_READ);
if (ret < 0)
goto out;
ret = regmap_bulk_read(info->max... | false | false | false | false | false | 0 |
genie_int_case_unit (NODE_T * p, int k, int *count)
{
if (p == NO_NODE) {
return (A68_FALSE);
} else {
if (IS (p, UNIT)) {
if (k == *count) {
EXECUTE_UNIT_TRACE (p);
return (A68_TRUE);
} else {
(*count)++;
return (A68_FALSE);
}
} else {
if (genie_i... | false | false | false | false | false | 0 |
acdInFileSave(const AjPStr infname, const AjPStr objname,
AjBool reset)
{
static AjBool usefile = AJFALSE;
static ajint called = 0;
AjBool useobj = ajTrue;
if(!called)
{
if(ajNamGetValueC("acdfilename", &acdTmpStr))
ajStrToBool(acdTmpStr, &usefile);
... | false | false | false | false | false | 0 |
distribute_remainder(sLad *lad, SymRegion *lr_region_head)
{
int order;
SemTree *div_order;
SemTree *tmp;
SymRegion *region;
SemTree *rem;
SemTree *n1;
SemTree *alpha;
SemTree *beta;
SemTree *db;
SemTree *de;
const SemTree *const_one = lad->sym_const_one;
SemTree *new_... | false | false | false | false | false | 0 |
weather_source_find_location_by_coords (GWeatherLocation *start,
gdouble latitude,
gdouble longitude)
{
GWeatherLocation *location, **children;
gint ii;
if (!start)
return NULL;
location = start;
if (gweather_location_has_coords (l... | false | false | false | false | false | 0 |
s2b(const char *s, int nd0, int nd, ULong y9)
{
Bigint *b;
int i, k;
Long x, y;
x = (nd + 8) / 9;
for(k = 0, y = 1; x > y; y <<= 1, k++) ;
b = Balloc(k);
if (b == NULL)
return NULL;
b->x[0] = y9;
b->wds = 1;
if (nd <= 9)
return b;
s += 9;
for (i = 9; i < ... | false | false | false | false | false | 0 |
check_options(diff_opt_t* options)
{
/*--------------------------------------------------------------
* check for mutually exclusive options
*--------------------------------------------------------------*/
/* check between -d , -p, --use-system-epsilon.
* These options are mutually exclusive.
... | false | false | false | false | false | 0 |
projid_m_show(struct seq_file *seq, void *v)
{
struct user_namespace *ns = seq->private;
struct uid_gid_extent *extent = v;
struct user_namespace *lower_ns;
projid_t lower;
lower_ns = seq_user_ns(seq);
if ((lower_ns == ns) && lower_ns->parent)
lower_ns = lower_ns->parent;
lower = from_kprojid(lower_ns, KPROJ... | false | false | false | false | false | 0 |
format(std::string& result, const std::string& fmt, const Any& value1, const Any& value2)
{
std::vector<Any> args;
args.push_back(value1);
args.push_back(value2);
format(result, fmt, args);
} | false | false | false | false | false | 0 |
vector_linear_float (float* v,const float* v1,const float alpha,const float* v2,size_t n)
{
size_t i;
for (i=0;i<n;i++)
v[i] = v1[i]+alpha*v2[i];
} | false | false | false | false | false | 0 |
agp_amd64_mod_init(void)
{
#ifndef MODULE
if (gart_iommu_aperture)
return agp_bridges_found ? 0 : -ENODEV;
#endif
return agp_amd64_init();
} | false | false | false | false | false | 0 |
SendArrayInfoRequests()
{
for(int i=fileset_for_info->curr_index(); i<fileset_for_info->count(); i++)
{
FileInfo *fi=(*fileset_for_info)[i];
bool sent=false;
if((fi->need&fi->DATE) && conn->mdtm_supported && use_mdtm)
{
conn->SendCmd2("MDTM",ExpandTildeStatic(fi->name));
expect->Push(E... | false | false | false | false | false | 0 |
db_load_from_stream(dns_db_t *db, FILE *fp) {
isc_result_t result;
dns_rdatacallbacks_t callbacks;
dns_rdatacallbacks_init(&callbacks);
result = dns_db_beginload(db, &callbacks);
if (result != ISC_R_SUCCESS)
fatal("dns_db_beginload failed: %s", isc_result_totext(result));
result = dns_master_loadstream(fp, na... | false | false | false | false | false | 0 |
tp_tests_backend_remove_account (TpTestsBackend *self,
gpointer handle)
{
TpTestsBackendPrivate *priv = self->priv;
AccountData *data;
if (g_list_find (priv->accounts, handle) == NULL)
{
return;
}
/* Remove the account from the list of accounts */
priv->accounts = g_list_remove (priv->acco... | false | false | false | false | false | 0 |
image_load_done_cb(ImageLoader *il, gpointer data)
{
ImageWindow *imd = data;
DEBUG_1("%s image done", get_exec_time());
if (options->image.enable_read_ahead && imd->image_fd && !imd->image_fd->pixbuf && image_loader_get_pixbuf(imd->il))
{
imd->image_fd->pixbuf = g_object_ref(image_loader_get_pixbuf(imd->il));... | false | false | false | false | false | 0 |
v9fs_get_acl(struct inode *inode, struct p9_fid *fid)
{
int retval = 0;
struct posix_acl *pacl, *dacl;
struct v9fs_session_info *v9ses;
v9ses = v9fs_inode2v9ses(inode);
if (((v9ses->flags & V9FS_ACCESS_MASK) != V9FS_ACCESS_CLIENT) ||
((v9ses->flags & V9FS_ACL_MASK) != V9FS_POSIX_ACL)) {
set_cached_acl(inode,... | false | false | false | false | false | 0 |
isNullAction(char *s)
#else
int isNullAction(s)
char *s;
#endif
{
char *p;
for (p=s; *p != '\0' ; p++) {
if (*p != ';' && *p !=' ') return 0;
};
return 1;
} | false | false | false | false | false | 0 |
GetCalling() {
if (IsDeadCheck("v8::Context::GetCalling()")) return Local<Context>();
i::Handle<i::Object> calling = i::Top::GetCallingGlobalContext();
if (calling.is_null()) return Local<Context>();
i::Handle<i::Context> context = i::Handle<i::Context>::cast(calling);
return Utils::ToLocal(context);
} | false | false | false | false | false | 0 |
saved_date(char *date, char *header)
{
char *d, *p, c;
MESSAGECACHE elt;
*date = '\0';
if((toupper((unsigned char)(*(d = header)))
== 'D' && !strncmp(d, "date:", 5))
|| (d = srchstr(header, "\015\012date:"))){
for(d += 7; *d == ' '; d++)
; /* skip white space */
if((p = strstr(d, "\... | false | false | false | false | true | 1 |
ext2fs_alloc_generic_bmap(ext2_filsys fs, errcode_t magic,
int type, __u64 start, __u64 end,
__u64 real_end,
const char *descr,
ext2fs_generic_bitmap *ret)
{
ext2fs_generic_bitmap bitmap;
struct ext2_bitmap_ops *ops;
ext2_ino_t num_dirs;
errcode_t retval;
if (!type)
type = EXT2FS... | false | false | false | false | false | 0 |
load_actions_file(const gchar * filename)
{
FILE *file;
gchar *line = NULL;
size_t nb = 0;
if (filename == NULL)
return;
file = fopen(filename, "r");
if (file == NULL) {
perror(filename);
return;
}
/* Search the actions separator. */
while (getdelim(&line, ... | false | false | false | false | true | 1 |
pixCloseBrick(PIX *pixd,
PIX *pixs,
l_int32 hsize,
l_int32 vsize)
{
PIX *pixt;
SEL *sel, *selh, *selv;
PROCNAME("pixCloseBrick");
if (!pixs)
return (PIX *)ERROR_PTR("pixs not defined", procName, pixd);
if (pixGetDepth(pixs) != 1)
return... | false | false | false | false | false | 0 |
Java_ncsa_hdf_hdf5lib_H5_H5Eget_1class_1name
(JNIEnv *env, jclass cls, jint cls_id)
{
char *namePtr;
jstring str;
ssize_t buf_size;
if (cls_id < 0) {
h5badArgument(env, "H5Eget_class_name: invalid argument");
return NULL;
}
/* get the le... | false | false | false | false | false | 0 |
Scan_Process_Fields_Keep_One_Space (gchar *string)
{
gchar *tmp, *tmp1;
tmp = tmp1 = string;
// Remove multiple consecutive underscores and spaces.
while (*tmp1)
{
while (*tmp1 && *tmp1 != ' ' && *tmp1 != '_')
*(tmp++) = *(tmp1++);
if (!*tmp1)
break;
... | 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.