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 |
|---|---|---|---|---|---|---|
grab_string(
void *theEnv,
FILE *fp,
char *buf,
int bufsize)
{
if (fgets(buf,bufsize,fp) == NULL)
{
GenClose(theEnv,fp);
return(NULL);
}
if ((buf[0] == LIT_DELIM) && (buf[1] == LIT_DELIM))
{
buf[0] = BLANK;
buf[1] = BLANK;
}
else if (findstr(buf,EDELIM) >= ... | false | false | false | false | false | 0 |
p_setenv(li_object *args) {
assert_nargs(2, args);
assert_string(li_car(args));
assert_string(li_cadr(args));
setenv(li_to_string(li_car(args)), li_to_string(li_cadr(args)), 1);
return li_null;
} | false | false | false | false | false | 0 |
httpHeaderGetStr(const HttpHeader * hdr, http_hdr_type id)
{
HttpHeaderEntry *e;
assert_eid(id);
assert(Headers[id].type == ftStr); /* must be of an appropriate type */
if ((e = httpHeaderFindEntry(hdr, id))) {
httpHeaderNoteParsedEntry(e->id, e->value, 0); /* no errors are possible */
return strBuf(e... | false | false | false | false | false | 0 |
w5100_read16_indirect(struct w5100_priv *priv, u16 addr)
{
unsigned long flags;
u16 data;
spin_lock_irqsave(&priv->reg_lock, flags);
w5100_write16_direct(priv, W5100_IDM_AR, addr);
mmiowb();
data = w5100_read_direct(priv, W5100_IDM_DR) << 8;
data |= w5100_read_direct(priv, W5100_IDM_DR);
spin_unlock_irqrestor... | false | false | false | false | false | 0 |
mirror(int insock)
{
char ibuf[4097];
char condata[] = {0x00, 0x20}; // Actually 4096 as a LE word
int readnum;
dnet_accept(insock, 0, condata, 2);
while ( (readnum=read(insock,ibuf,sizeof(ibuf))) > 0)
{
ibuf[0]=0x01;
if (write(insock,ibuf,readnum) < 0)
{
DNETLOG((LOG_WARNING, "mirror,... | true | true | false | false | true | 1 |
nv50_bo_move_init(struct nouveau_channel *chan, u32 handle)
{
int ret = RING_SPACE(chan, 6);
if (ret == 0) {
BEGIN_NV04(chan, NvSubCopy, 0x0000, 1);
OUT_RING (chan, handle);
BEGIN_NV04(chan, NvSubCopy, 0x0180, 3);
OUT_RING (chan, chan->drm->ntfy.handle);
OUT_RING (chan, chan->vram.handle);
OUT_RING (c... | false | false | false | false | false | 0 |
_tls_read (void *sd, char *data, size_t size, size_t * nbytes)
{
int rc = gnutls_record_recv (sd, data, size);
if (rc >= 0)
{
if (nbytes)
*nbytes = rc;
return 0;
}
return rc;
} | false | false | false | false | false | 0 |
operator==(const StringC &s, const char *p)
{
for (size_t i = 0; i < s.size(); i++)
if (p[i] == '\0' || (unsigned char)p[i] != s[i])
return 0;
return p[s.size()] == '\0';
} | false | false | false | false | false | 0 |
acpi_ns_dump_object_paths(acpi_object_type type,
u8 display_type,
u32 max_depth,
acpi_owner_id owner_id, acpi_handle start_handle)
{
acpi_status status;
u32 max_level = 0;
ACPI_FUNCTION_ENTRY();
/*
* Just lock the entire namespace for the duration of the dump.
* We don't want any changes to the... | false | false | false | false | false | 0 |
mng_delta_addition(adv_mng* mng, unsigned pos_x, unsigned pos_y, unsigned width, unsigned height)
{
unsigned i, j;
unsigned bytes_per_run = width * mng->pixel;
unsigned delta_bytes_per_scanline = bytes_per_run + 1;
unsigned char* p0 = mng->dat_ptr + pos_y * mng->dat_line + pos_x * mng->pixel + 1;
unsigned char* p1... | false | false | false | false | false | 0 |
get_list (DBusHashTable *hash,
unsigned long key)
{
DBusList **list;
list = _dbus_hash_table_lookup_uintptr (hash, key);
if (list == NULL)
{
list = dbus_new0 (DBusList*, 1);
if (list == NULL)
return NULL;
if (!_dbus_hash_table_insert_uintptr (hash, key, list))
{... | false | false | false | false | false | 0 |
OnEditorDwellEnd(wxScintillaEvent& event)
{
NotifyPlugins(cbEVT_EDITOR_TOOLTIP_CANCEL);
OnScintillaEvent(event);
} | false | false | false | false | false | 0 |
displayflaglegend(struct featurebit * fbp, unsigned long reg)
{
unsigned char j;
j = 0;
while (fbp[j].bitnum < 64) {
outputatlvl(1, " * (%02d) %-40s: %s\n",
fbp[j].bitnum,
fbp[j].description,
(reg & (1 << fbp[j].bitnum)) ? "Yes" : "No ");
j++;
}
} | false | false | false | false | false | 0 |
pulse_clocks_to_clock_divider(u64 count)
{
do_div(count, (FIFO_RXTX << 2) | 0x3);
/* net result needs to be rounded down and decremented by 1 */
if (count > RXCLK_RCD + 1)
count = RXCLK_RCD;
else if (count < 2)
count = 1;
else
count--;
return (u16) count;
} | false | false | false | false | false | 0 |
cavan_vfat_read_file_base(struct cavan_vfat_file *fp, size_t skip, size_t size, int (*handler)(const char *buff, size_t size, void *date), void *data)
{
bool complete;
size_t remain;
struct cavan_vfat_fs *fs = fp->fs;
size_t file_remain = fp->entry.file_size;
u32 cluster = VFAT_BUILD_START_CLUSTER(&fp->entry);
i... | true | true | false | false | false | 1 |
mo_privs(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
{
struct Client *acptr;
char *name;
char *p = 0;
int i;
if (parc < 2)
return client_report_privs(sptr, sptr);
for (i = 1; i < parc; i++) {
for (name = ircd_strtok(&p, parv[i], " "); name;
name = ircd_strtok(&p, 0, " ")) {... | false | false | false | false | false | 0 |
get_kwm_win_icon (Window xwindow,
Pixmap *pixmap,
Pixmap *mask)
{
Atom type;
int format;
gulong nitems;
gulong bytes_after;
Pixmap *icons;
int err, result;
*pixmap = None;
*mask = None;
_matewnck_error_trap_push ();
icons = NULL;
result = XGetWindowProperty... | false | false | false | false | false | 0 |
open_output(audio_output_t *ao)
{
if(param.usebuffer) return 0;
if(ao == NULL)
{
error("ao should not be NULL here!");
exit(110);
}
switch(param.outmode)
{
case DECODE_AUDIO:
case DECODE_WAV:
case DECODE_AU:
case DECODE_CDR:
case DECODE_FILE:
debug("opening normal audio/file");
ao->is_open =... | false | false | false | false | false | 0 |
dfs2 (HashEntry *entry)
{
int i;
g_assert (dyn_array_ptr_size (&dfs_stack) == 0);
dyn_array_ptr_push (&dfs_stack, entry);
do {
entry = (HashEntry *)dyn_array_ptr_pop (&dfs_stack);
++dfs2_passes;
if (entry->v.dfs2.scc_index >= 0) {
if (entry->v.dfs2.scc_index != current_scc->index)
scc_add_xref (dyn... | false | false | false | false | false | 0 |
us_daemon_daemonize(
bool real_daemon,
const char * identity,
const char * home_dir,
const char * pid_file,
const char * new_uid
)
{
(void)identity;
if( pid_file ) {
/* remember the pid file name */
us_strncpy( us_daemon_pid_file_name, pid_file, 1024 );
} else {
*... | true | true | false | false | true | 1 |
add(DocMatch *dm)
{
String t;
t << dm->GetId();
Add(t, dm);
} | false | false | false | false | false | 0 |
gf_dash_del(GF_DashClient *dash)
{
gf_dash_close(dash);
gf_th_del(dash->dash_thread);
gf_mx_del(dash->dl_mutex);
if (dash->mimeTypeForM3U8Segments) gf_free(dash->mimeTypeForM3U8Segments);
if (dash->base_url) gf_free(dash->base_url);
gf_free(dash);
} | false | false | false | false | false | 0 |
generateRaft(SliceDataStorage& storage, int distance)
{
for(unsigned int volumeIdx = 0; volumeIdx < storage.volumes.size(); volumeIdx++)
{
if (storage.volumes[volumeIdx].layers.size() < 1) continue;
SliceLayer* layer = &storage.volumes[volumeIdx].layers[0];
for(unsigned int i=0; i<... | false | false | false | false | false | 0 |
bpf_perf_event_read(u64 r1, u64 index, u64 r3, u64 r4, u64 r5)
{
struct bpf_map *map = (struct bpf_map *) (unsigned long) r1;
struct bpf_array *array = container_of(map, struct bpf_array, map);
struct perf_event *event;
if (unlikely(index >= array->map.max_entries))
return -E2BIG;
event = (struct perf_event *)... | false | false | false | false | false | 0 |
isPaletteGreyscale(const unsigned char* palette, size_t palettesize)
{
size_t i;
for(i = 0; i < palettesize; i++)
{
if(palette[4 * i + 0] != palette[4 * i + 1] || palette[4 * i + 0] != palette[4 * i + 2]) return 0;
}
return 1;
} | false | false | false | false | false | 0 |
imPaletteBlue(void)
{
long* palette = (long*)malloc(sizeof(long)*256);
long* ct = palette;
for (int lIndex = 0; lIndex < 256; lIndex++)
{
/* From (0, 0, 0) to (0, 0, 255)*/
/* From Black to Blue */
*(ct++) = imColorEncode(0, 0, (imbyte)lIndex);
}
return palette;
} | false | false | false | false | false | 0 |
overlap_test_conservative(const btTriangleShapeEx& other)
{
btScalar total_margin = getMargin() + other.getMargin();
btVector4 plane0;
buildTriPlane(plane0);
btVector4 plane1;
other.buildTriPlane(plane1);
// classify points on other triangle
btScalar dis0 = bt_distance_point_plane(plane0,o... | false | false | false | false | false | 0 |
sort_in_relation(struct alignment* aln,char* sort)
{
int i,j,c;
int target = -1;
int id = 0;
int positions = 0;
int posa = 0;
int posb = 0;
for (i = 0; i < numseq;i++){
if (byg_start(sort,aln->sn[i]) != -1){
target = i;
aln->sip[i][0] = 1000;
break;
}
}
if(target == -1){
target = 0;
aln->sip[0... | false | false | false | false | true | 1 |
pmt_prog_leave_pid(struct program_s *prog, uint16_t pid) {
GList *cbcl=g_list_first(prog->pidtable[pid].cb);
while(cbcl) {
void *cbc=cbcl->data;
dvr_del_pcb(prog->adapter, pid, cbc);
cbcl=g_list_next(cbcl);
}
g_list_free(prog->pidtable[pid].cb);
prog->pidtable[pid].cb=NULL;
} | false | false | false | false | false | 0 |
peer_fdpair_externalize_current(struct peer *peer)
{
if (peer->fd_current == -1) {
gflog_debug(GFARM_MSG_1001587,
"bad file descriptor");
return (GFARM_ERR_BAD_FILE_DESCRIPTOR);
}
peer->flags |= PEER_FLAGS_FD_CURRENT_EXTERNALIZED;
if (peer->fd_current == peer->fd_saved)
peer->flags |= PEER_FLAGS_FD_SAVED_E... | false | false | false | false | false | 0 |
draw_gs (Canvas* c, Graphic31* gs) {
Transformer* tx = gs->transformer();
if (tx != nil) {
c->push_transform();
c->transform(*tx);
}
if (_ctrlpts == 0) {
Requisition req;
request(req);
}
Allocation b(_a);
Allotment& bx = b.x_allotment();
Allotment& by = b.... | false | false | false | false | false | 0 |
popStackAndReturnValueToCaller(Type *RetTy,
GenericValue Result) {
// Pop the current stack frame.
ECStack.pop_back();
if (ECStack.empty()) { // Finished main. Put result into exit code...
if (RetTy && !RetTy->isVoidTy()) { // Nonvoid return type?
... | false | false | false | false | false | 0 |
gnc_quote_source_add_new (const char *source_name, gboolean supported)
{
gnc_quote_source *new_source;
DEBUG("Creating new source %s", (source_name == NULL ? "(null)" : source_name));
new_source = malloc(sizeof(gnc_quote_source));
new_source->supported = supported;
new_source->type = SOURCE_UNKNOWN... | false | false | false | false | false | 0 |
mdensity (header *hd)
/***** mcontour
density plot with matrix input.
*****/
{ header *st=hd,*result;
double *m,x,deltax,deltay;
int r,c,i,j;
hd=getvalue(hd); if (error) return;
if (hd->type!=s_matrix || dimsof(hd)->c<2 || dimsof(hd)->r<2)
{ output("Density needs a real matrix!\n"); error=81; return;
}
getmatri... | false | false | false | false | false | 0 |
CopyDataSource( OGRDataSource *poSrcDS,
const char *pszNewName,
char **papszOptions )
{
if( !TestCapability( ODrCCreateDataSource ) )
{
CPLError( CE_Failure, CPLE_NotSupported,
"%s driver does no... | false | false | false | false | false | 0 |
scannerPath()
{
// Defined in the tests so we use the recently built scanner for testing
const QString overridePath = qApp->property( "overrideUtilitiesPath" ).toString();
QString path;
if( overridePath.isEmpty() ) // Not running a test
{
path = KStandardDirs::locate( "exe", "amarokcollectio... | false | false | false | false | false | 0 |
j_strchr(char *data, char d) {
char *q = data;
if(!q) {
return NULL;
}
if(q[0] == d) {
return q;
}
while(q[0]) {
if((q[0] == d) && (q[-1] != '\\')) {
return q;
}
q++;
}
return NULL;
} | false | false | false | false | false | 0 |
view_writec_destroy(void)
{
if(g_view_write){
if(g_view_write->line && g_view_write->index)
view_writec('\n'); /* flush pending output! */
while(g_view_write->screen_line < g_view_write->last_screen_line)
ClearLine(g_view_write->screen_line++);
view_writec_killbuf();
fs_give((void **) &g_view_write);
... | false | false | false | false | false | 0 |
connection_ap_expire_beginning(void)
{
edge_connection_t *conn;
entry_connection_t *entry_conn;
circuit_t *circ;
time_t now = time(NULL);
const or_options_t *options = get_options();
int severity;
int cutoff;
int seconds_idle, seconds_since_born;
smartlist_t *conns = get_connection_array();
SMARTLI... | false | false | false | false | false | 0 |
dwarf_get_arange_cu_header_offset(Dwarf_Arange arange,
Dwarf_Off * cu_header_offset_returned,
Dwarf_Error * error)
{
Dwarf_Debug dbg = 0;
if (arange == NULL) {
_dwarf_error(NULL, error, DW_DLE_ARANGE_NULL);
return (DW_DLV_ERROR);
}
dbg = arange->ar_dbg;
/* This applies to deb... | false | false | false | false | false | 0 |
qmonUserFilterSet(Widget w, XtPointer cld, XtPointer cad)
{
DENTER(GUI_LAYER, "qmonUserFilterSet");
UpdateXmListFromCull(misc_filter_user_sp, XmFONTLIST_DEFAULT_TAG,
queue_filter_user, ST_name);
DEXIT;
} | false | false | false | false | false | 0 |
Lookup(byte* pc) {
// may be called during initialization (disassembler!)
if (initialized_) {
for (int i = 0; i < builtin_count; i++) {
Code* entry = Code::cast(builtins_[i]);
if (entry->contains(pc)) {
return names_[i];
}
}
}
return NULL;
} | false | false | false | false | false | 0 |
edit_deep_directories(struct archive_write_disk *a)
{
int ret;
char *tail = a->name;
a->restore_pwd = -1;
/* If path is short, avoid the open() below. */
if (strlen(tail) <= PATH_MAX)
return;
/* Try to record our starting dir. */
a->restore_pwd = open(".", O_RDONLY | O_BINARY);
... | false | false | false | false | true | 1 |
do_fopen(parameters *param, char *fname, file_descr *fd /*out*/, int flags)
{
int ret_code = SUCCESS, mrc;
herr_t hrc;
hid_t acc_tpl = -1; /* file access templates */
hbool_t use_gpfs = FALSE; /* use GPFS hints */
switch (param->io_type) {
case POSIXIO:
if (flags & (PIO... | false | false | false | false | false | 0 |
get_nr_page(struct word_dic *h)
{
int i;
for (i = 1; anthy_dic_ntohl(h->page_index[i]); i++);
return i;
} | false | false | false | false | false | 0 |
parse_v4_algo_bits (const guchar **at,
const guchar *end,
guint8 algo,
guint16 *bits)
{
switch (algo) {
case GCR_OPENPGP_ALGO_RSA:
case GCR_OPENPGP_ALGO_RSA_E:
case GCR_OPENPGP_ALGO_RSA_S:
if (!read_mpi (at, end, bits, NULL) ||
!read_mpi (at, end, ... | false | false | false | false | false | 0 |
takeover() throw (FileException) { takeover(getpid()); } | false | false | false | false | false | 0 |
slope_output_type_cb(GtkToggleButton *button,
SlopeControls *controls)
{
SlopeOutput otype;
if (!gtk_toggle_button_get_active(button))
return;
otype = gwy_radio_buttons_get_current(controls->output_type_group);
gtk_widget_set_sensitive(controls->logscale, otype == SLOPE_DI... | false | false | false | false | false | 0 |
MG_save_cb(AW_window *aww)
{
char *name = aww->get_root()->awar(AWAR_MAIN_DB"/file_name")->read_string();
char *type = aww->get_root()->awar(AWAR_MAIN_DB"/type")->read_string();
aw_openstatus("Saving database");
GB_begin_transaction(GLOBAL_gb_dest);
GBT_check_data(GLOBAL_gb_dest,0);
GB_commit_tr... | false | false | false | false | false | 0 |
__ecereMethod_OutputView_ShowClearSelectTab(struct __ecereNameSpace__ecere__com__Instance * this, int tab)
{
struct OutputView * __ecerePointer_OutputView = (struct OutputView *)(this ? (((char *)this) + __ecereClass_OutputView->offset) : 0);
__ecereMethod_OutputView_Show(this);
if(tab == 0)
__ecereMethod___ecereNameS... | false | false | false | true | false | 1 |
candidate_panel_update (CandidatePanel* self) {
gboolean _tmp0_ = FALSE;
gboolean _tmp1_ = FALSE;
CandidateArea* _tmp2_ = NULL;
gboolean _tmp3_ = FALSE;
gboolean _tmp6_ = FALSE;
gboolean _tmp9_ = FALSE;
gboolean _tmp12_ = FALSE;
GtkLabel* _tmp13_ = NULL;
gboolean _tmp14_ = FALSE;
gboolean _tmp21_ = FALSE;
g_... | false | false | false | false | false | 0 |
sch56xx_send_cmd(u16 addr, u8 cmd, u16 reg, u8 v)
{
u8 val;
int i;
/*
* According to SMSC for the commands we use the maximum time for
* the EM to respond is 15 ms, but testing shows in practice it
* responds within 15-32 reads, so we first busy poll, and if
* that fails sleep a bit and try again until we ar... | false | false | false | false | false | 0 |
on_ipclient_search_ready (GObject *source_object,
GAsyncResult *res,
gpointer user_data)
{
GClueIpclient *ipclient = GCLUE_IPCLIENT (source_object);
GClueLocator *locator = GCLUE_LOCATOR (user_data);
GeocodeLocation *location;
... | false | false | false | false | false | 0 |
banz(void)
{
if (R.AR[ARP] & 0x01ff)
R.PC = M_RDOP_ARG(R.PC);
else
R.PC++ ;
R.ALU.w.l = R.AR[ARP];
R.ALU.w.l-- ;
R.AR[ARP] = (R.AR[ARP] & 0xfe00) | (R.ALU.w.l & 0x01ff);
} | false | false | false | false | false | 0 |
mma9551_update_config_bits(struct i2c_client *client, u8 app_id,
u16 reg, u8 mask, u8 val)
{
int ret;
u8 tmp, orig;
ret = mma9551_read_config_byte(client, app_id, reg, &orig);
if (ret < 0)
return ret;
tmp = orig & ~mask;
tmp |= val & mask;
if (tmp == orig)
return 0;
return mma9551_write_config... | false | false | false | false | false | 0 |
pine_rfc822_output(METAENV *header, struct mail_bodystruct *body, soutr_t f, void *s)
{
int we_cancel = 0;
long retval;
dprint((4, "-- pine_rfc822_output\n"));
we_cancel = busy_cue(NULL, NULL, 1);
pine_encode_body(body); /* encode body as necessary */
/* build and output RFC822 header, output... | false | false | false | false | false | 0 |
set_usage_bits (group_info_t group, HOST_WIDE_INT offset, HOST_WIDE_INT width)
{
HOST_WIDE_INT i;
if (offset > -MAX_OFFSET && offset + width < MAX_OFFSET)
for (i=offset; i<offset+width; i++)
{
bitmap store1;
bitmap store2;
int ai;
if (i < 0)
{
store1 = group->store1_n;
store2 = group->st... | false | false | false | false | false | 0 |
ReadBoolFromTextContent()
{
const char* cur = GetTextContent();
return (!ASSIMP_strincmp(cur,"true",4) || '0' != *cur);
} | false | false | false | false | false | 0 |
add(const char* c)
{
if (!c)
return 0;
if (!*c)
return DOMStringImpl::empty();
init();
std::pair<HashSet<DOMStringImpl*>::iterator, bool> addResult = stringTable->add<const char*, CStringTranslator>(c);
if (!addResult.second)
return *addResult.first;
return *addResult.fir... | false | false | false | false | false | 0 |
startsWith(const mstring &s) const {
if (length() < s.length())
return false;
if (memcmp(data(), s.data(), s.length()) == 0)
return true;
return false;
} | false | false | false | false | false | 0 |
ct_callback(CS_CONTEXT * ctx, CS_CONNECTION * con, CS_INT action, CS_INT type, CS_VOID * func)
{
int (*funcptr) (void *, void *, void *) = (int (*)(void *, void *, void *)) func;
tdsdump_log(TDS_DBG_FUNC, "ct_callback(%p, %p, %d, %d, %p)\n", ctx, con, action, type, func);
tdsdump_log(TDS_DBG_FUNC, "ct_callback() a... | false | false | false | false | false | 0 |
ftchash_first(struct ftchash *ftch)
{
struct ftchash_chunk *chunk;
if (ftch->sort_flags & FT_CHASH_SORTED) {
if (ftch->sort_flags & FT_CHASH_SORT_ASCENDING)
ftch->traverse_srec = ftch->entries;
else
ftch->traverse_srec = 0;
} else {
chunk = FT_SLIST_FIRST(&ftch->chunk_list);
if (chu... | false | false | false | false | false | 0 |
db_direntry_arg_alloc(
gfarm_ino_t dir_inum, const char *entry_name, int entry_len,
gfarm_ino_t entry_inum)
{
struct db_direntry_arg *arg;
size_t sz;
int overflow = 0;
sz = gfarm_size_add(&overflow, sizeof(*arg), entry_len + 1);
if (!overflow)
arg = malloc(sz);
if (overflow || arg == NULL) {
gflog_debug(GF... | false | false | false | false | false | 0 |
tenSizeNormalize(Nrrd *nout, const Nrrd *nin, double _weight[3],
double amount, double target) {
static const char me[]="tenSizeNormalize";
funcParm parm;
ELL_3V_COPY(parm.weight, _weight);
parm.amount = amount;
parm.target = target;
if (theFunc(nout, nin, funcSizeNormalize, &parm)) {
... | false | false | false | false | false | 0 |
DrawBlockCaret(Surface *surface, ViewStyle &vsDraw, LineLayout *ll, int subLine,
int xStart, int offset, int posCaret, PRectangle rcCaret, ColourDesired caretColour) {
int lineStart = ll->LineStart(subLine);
int posBefore = posCaret;
int posAfter = MovePositionOutsideChar(posCaret + 1, 1);
int numCharsToDra... | false | false | false | false | false | 0 |
qr_inodectx_dump (xlator_t *this, inode_t *inode)
{
qr_inode_t *qr_inode = NULL;
int32_t ret = -1;
char key_prefix[GF_DUMP_MAX_BUF_LEN] = {0, };
char buf[256] = {0, };
qr_inode = qr_inode_ctx_get (this, inode);
if (!qr_inode)... | false | false | false | false | false | 0 |
gnc_xml_be_remove_old_files(FileBackend *be)
{
const gchar *dent;
GDir *dir;
struct stat lockstatbuf, statbuf;
time64 now;
if (g_stat (be->lockfile, &lockstatbuf) != 0)
return;
dir = g_dir_open (be->dirname, 0, NULL);
if (!dir)
return;
now = gnc_time(NULL);
while (... | false | false | false | false | false | 0 |
exif_log_free (ExifLog *log)
{
ExifMem *mem = log ? log->mem : NULL;
if (!log) return;
exif_mem_free (mem, log);
exif_mem_unref (mem);
} | false | false | false | false | false | 0 |
egcd32(dstptr x, dstptr y, dstptr a, dstptr b) {
unsigned an, bn = 32, qn, i;
for (i = 0; i < 32; i++)
x[i] = y[i] = 0;
x[0] = 1;
if (!(an = numsize(a, 32)))
return y; /* division by zero */
while (42) {
qn = bn - an + 1;
divmod(y+32, b, bn, a, an);
if (!(bn = numsize(b, bn)))
return x;
mula32(y, x,... | false | false | false | false | false | 0 |
startPresampling() {
thePresampling = true;
theXCombBackup = lastHeadXCombPtr();
lastXCombPtr()->head(thePresamplingXCombs[theXCombBackup]);
ME2byDipoles::setXComb(lastXCombPtr());
projectionDipole()->setXComb(lastXCombPtr());
thePresamplingXCombs[theXCombBackup]->prepare(theXCombBackup->lastParticles());
} | false | false | false | false | false | 0 |
IsOnHeightfield2 ( const HeightFieldVertex * const CellCorner,
const dReal * const pos, const bool isABC) const
{
// WARNING!!!
// This function must be written in the way to make sure that every point on
// XZ plane falls in one and only one triangle. Keep that in mind if you
// intend to change... | false | false | false | false | false | 0 |
LoadGroupFromDB(Field* fields)
{
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
// result = CharacterDatabase.Query("SELECT mainTank, mainAssistant, lootMethod, looterGuid,... | false | false | false | false | false | 0 |
st_entry_set_input_purpose (StEntry *entry,
GtkInputPurpose purpose)
{
StIMText *imtext;
g_return_if_fail (ST_IS_ENTRY (entry));
imtext = ST_IM_TEXT (entry->priv->entry);
if (st_im_text_get_input_purpose (imtext) != purpose)
{
st_im_text_set_input_purpose (imtext,... | false | false | false | false | false | 0 |
globexp1(const Char *pattern, glob_t *pglob)
{
const Char* ptr = pattern;
int rv;
/* Protect a single {}, for find(1), like csh */
if (pattern[0] == BG_LBRACE && pattern[1] == BG_RBRACE && pattern[2] == BG_EOS)
return glob0(pattern, pglob);
while ((ptr = (const Char *) g_strchr((Char *) ptr, BG_LBRACE)) != NUL... | false | false | false | false | false | 0 |
multi_join_blit_game_status(active_game *game, int y)
{
int draw,str_w;
char status_text[25];
// blit the proper icon
draw = 0;
switch( game->flags & AG_FLAG_TYPE_MASK ){
// coop game
case AG_FLAG_COOP:
if(Multi_common_icons[MICON_COOP] != -1){
gr_set_bitmap(Multi_common_icons[MICON_COOP]);
draw = 1;... | false | false | false | false | false | 0 |
binascii_crc32(PyObject *self, PyObject *args)
{ /* By Jim Ahlstrom; All rights transferred to CNRI */
Py_buffer pbin;
unsigned char *bin_data;
unsigned int crc = 0U; /* initial value of CRC */
Py_ssize_t len;
int result;
if ( !PyArg_ParseTuple(args, "s*|I:crc32", &pbin, &crc) )
re... | false | false | false | false | false | 0 |
MergeXResources(Display *dpy, XrmDatabase *pdb, Bool override)
{
if (!*pdb)
/* create new database */
XrmPutStringResource(pdb, "", "");
DoMergeString(XResourceManagerString(dpy), pdb, override);
DoMergeString(XScreenResourceString(DefaultScreenOfDisplay(dpy)), pdb,
override);
} | false | false | false | false | false | 0 |
threadCreationLockUnlock()
{
int saved_errno = errno;
if (WorkerState::currentState() != WorkerState::RUNNING) {
fprintf(stderr, "DMTCP INTERNAL ERROR: %s:%d %s:\n"
" This process is not in RUNNING state and yet this thread\n"
" managed to acquire the threadCreationLock.\n"
... | false | false | false | false | false | 0 |
film_read_packet(AVFormatContext *s,
AVPacket *pkt)
{
FilmDemuxContext *film = s->priv_data;
ByteIOContext *pb = s->pb;
film_sample *sample;
int ret = 0;
int i;
int left, right;
if (film->current_sample >= film->sample_count)
return AVERROR(EIO);
sam... | false | false | false | false | false | 0 |
cut_utils_inspect_memory (const void *memory, size_t size)
{
const guchar *binary = memory;
GString *buffer;
size_t i, n_printable_characters;
size_t max_size = 1024;
if (memory == NULL || size == 0)
return g_strdup("(null)");
buffer = g_string_sized_new(size * strlen("0xXX") +
... | false | false | false | false | false | 0 |
setup_params(const CL_Rectf &src,
const CL_Rectf &dest,
CL_Surface_DrawParams1 ¶ms1,
bool sub_pixel_accuracy)
{
static CL_Surface_DrawParams2 params2;
params2.srcX = int(src.left);
params2.srcY = int(src.top);
params2.srcWidth = int(src.get_width());
params2.srcHeight = int(src.get_height(... | false | false | false | false | false | 0 |
HandleModCastingSpeedNotStackAuraProc(Unit* /*pVictim*/, uint32 /*damage*/, Aura* /*triggeredByAura*/, SpellEntry const* procSpell, uint32 /*procFlag*/, uint32 /*procEx*/, uint32 /*cooldown*/)
{
// Skip melee hits or instant cast spells
return !(procSpell == NULL || GetSpellCastTime(procSpell) == 0) ? SPELL_AUR... | false | false | false | false | false | 0 |
popdown_worklist(struct global_worklist *pgwl)
{
GtkWidget *shell;
if ((shell = get_worklist(global_worklist_id(pgwl)))) {
GtkWidget *parent;
parent = gtk_widget_get_toplevel(shell);
gtk_widget_destroy(parent);
}
} | false | false | false | false | false | 0 |
mklocal(char *name)
{
struct localvar *lvp;
struct var **vpp;
struct var *vp;
INTOFF;
lvp = ckmalloc(sizeof (struct localvar));
if (name[0] == '-' && name[1] == '\0') {
char *p;
p = ckmalloc(sizeof(optlist));
lvp->text = memcpy(p, optlist, sizeof(optlist));
vp = NULL;
} else {
char *eq;
vpp = hashv... | false | true | false | false | false | 1 |
readBoxHdr(Guint *boxType, Guint *boxLen, Guint *dataLen) {
Guint len, lenH;
if (!readULong(&len) ||
!readULong(boxType)) {
return gFalse;
}
if (len == 1) {
if (!readULong(&lenH) || !readULong(&len)) {
return gFalse;
}
if (lenH) {
error(getPos(), "JPX stream contains a box lar... | false | false | false | false | false | 0 |
__serial_write(struct file_info *fp, const void *buf, size_t count)
{
com32sys_t ireg;
const char *bufp = buf;
size_t n = 0;
(void)fp;
if (!syslinux_serial_console_info()->iobase)
return count; /* Nothing to do */
memset(&ireg, 0, sizeof ireg);
ireg.eax.b[1] = 0x04;
while (count--)... | false | false | false | false | false | 0 |
operator=(JarFileReader const& rhs)
{
if (&rhs == this)
return *this;
_jarfile = rhs._jarfile;
_state = rhs._state;
return *this;
} | false | false | false | false | false | 0 |
Get(int list_offset) const
{
const_iterator i = begin();
for( ; i != end() && list_offset; ++i, list_offset-- )
;
return i;
} | false | false | false | false | false | 0 |
make_x(GwyDataField *dfield)
{
GwyDataField *result;
gdouble dx, xoff;
guint xres, yres, i, j;
gdouble *data;
result = gwy_data_field_new_alike(dfield, FALSE);
xres = gwy_data_field_get_xres(dfield);
yres = gwy_data_field_get_yres(dfield);
dx = gwy_data_field_get_xmeasure(dfield);
x... | false | true | false | false | false | 1 |
ivtv_s_std(struct file *file, void *fh, v4l2_std_id std)
{
struct ivtv *itv = fh2id(fh)->itv;
if ((std & V4L2_STD_ALL) == 0)
return -EINVAL;
if (std == itv->std)
return 0;
if (test_bit(IVTV_F_I_RADIO_USER, &itv->i_flags) ||
atomic_read(&itv->capturing) > 0 ||
atomic_read(&itv->decoding) > 0) {
/*... | false | false | false | false | false | 0 |
zend_do_case_before_statement(const znode *case_list, znode *case_token, const znode *case_expr TSRMLS_DC) /* {{{ */
{
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
int next_op_number;
zend_switch_entry *switch_entry_ptr;
znode result;
zend_stack_top(&CG(switch_cond_stack), (void **) &switch_entry... | false | false | false | false | false | 0 |
panel_widget_applet_move_to_cursor (PanelWidget *panel)
{
int movement;
GtkWidget *applet;
AppletData *ad;
g_return_if_fail(PANEL_IS_WIDGET(panel));
if (panel->currently_dragged_applet == NULL)
return;
ad = panel->currently_dragged_applet;
applet = ad->applet;
g_assert(GTK_IS_WIDGET(applet));
if(!panel_... | false | false | false | false | false | 0 |
adjust_best_info_with_junk_predicate (CutSequenceMatcher *matcher,
gboolean should_junk,
CutSequenceMatchInfo *best_info,
guint from_begin, guint from_end,
guint to_beg... | false | false | false | false | false | 0 |
gm_mcp_icecrew_playerdb_add_player(GmMcpIcecrewPlayerdb *package, gint id) {
GmPlayerdbPlayerInfo *ppi = g_new(GmPlayerdbPlayerInfo, 1);
ppi->values = g_hash_table_new_full(g_str_hash, g_str_equal,
g_free, g_free);
ppi->id = id;
package->priv->db = g_list_append(package->priv->db, ppi);
gm_debug_msg(DEBUG_... | false | false | false | false | false | 0 |
construct_cvspass_filename (void)
{
char *homedir;
char *passfile;
/* Environment should override file. */
if ((passfile = getenv ("CVS_PASSFILE")) != NULL)
return xstrdup (passfile);
/* Construct absolute pathname to user's password file. */
/* todo: does this work under OS/2 ? */
homedi... | false | false | false | false | false | 0 |
gth_filter_match (GthTest *test,
GthFileData *file)
{
GthFilter *filter = GTH_FILTER (test);
GthMatch match = GTH_MATCH_NO;
if (filter->priv->test != NULL)
match = gth_test_match (GTH_TEST (filter->priv->test), file);
else
match = GTH_MATCH_YES;
if (match == GTH_MATCH_YES) {
filter->priv->... | false | false | false | false | false | 0 |
remove_all_files(const gchar *dir)
{
GDir *dp;
const gchar *dir_name;
gchar *prev_dir;
prev_dir = g_get_current_dir();
if (g_chdir(dir) < 0) {
FILE_OP_ERROR(dir, "chdir");
g_free(prev_dir);
return -1;
}
if ((dp = g_dir_open(".", 0, NULL)) == NULL) {
g_warning("failed to open directory: %s\n", dir);
... | false | false | false | false | false | 0 |
fwtty_write_xchar(struct fwtty_port *port, char ch)
{
struct fwtty_peer *peer;
++port->stats.xchars;
fwtty_dbg(port, "%02x\n", ch);
rcu_read_lock();
peer = rcu_dereference(port->peer);
if (peer) {
fwtty_send_data_async(peer, TCODE_WRITE_BLOCK_REQUEST,
peer->fifo_addr, &ch, sizeof(ch),
NUL... | false | false | false | false | false | 0 |
saveToTextFile(const string &file) const
{
FILE *f=os::fopen(file.c_str(),"wt");
if (!f) return;
os::fprintf(f,"%e %e %e %e %e %e\n", mean.x(), mean.y(), mean.z(), mean.yaw(), mean.pitch(), mean.roll() );
for (unsigned int i=0;i<6;i++)
os::fprintf(f,"%e %e %e %e %e %e\n", cov_inv(i,0),cov_inv(i,1),cov_inv(i,2),... | false | false | false | false | false | 0 |
nes_post_cqp_request(struct nes_device *nesdev,
struct nes_cqp_request *cqp_request)
{
struct nes_hw_cqp_wqe *cqp_wqe;
unsigned long flags;
u32 cqp_head;
u64 u64temp;
u32 opcode;
int ctx_index = NES_CQP_WQE_COMP_CTX_LOW_IDX;
spin_lock_irqsave(&nesdev->cqp.lock, flags);
if (((((nesdev->cqp.sq_tail+(nesdev... | 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.