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 |
|---|---|---|---|---|---|---|
initialize(ErrorHandler *errh)
{
struct sockaddr_in sin;
// open socket, set options, bind to address
_fd = socket(PF_INET, SOCK_RAW, _protocol);
if (_fd < 0)
return initialize_socket_error(errh, "socket");
if (_port) {
memset(&sin, 0, sizeof(sin));
sin.sin_family = PF_INET;
sin.sin_port = h... | false | false | false | false | false | 0 |
w4_str(int fd, char *str)
{
char buf[40];
unsigned len = 0;
int r;
while (1) {
r = read(fd, buf + len, sizeof(buf) - len - 1);
if (r < 0) {
if (errno == EINTR || errno == EAGAIN)
continue;
break;
}
if (!r)
break;
len += r;
if (len < strlen(str))
continue;
buf[len] = 0;
if (strstr... | true | true | false | false | true | 1 |
usbpn_set_mtu(struct net_device *dev, int new_mtu)
{
if ((new_mtu < PHONET_MIN_MTU) || (new_mtu > PHONET_MAX_MTU))
return -EINVAL;
dev->mtu = new_mtu;
return 0;
} | false | false | false | false | false | 0 |
gl_view_object_create_mode (glView *view,
glLabelObjectType type)
{
GdkWindow *window;
GdkCursor *cursor = NULL;
gl_debug (DEBUG_VIEW, "START");
g_return_if_fail (view && GL_IS_VIEW (view));
window = gtk_widget_get_window (view->canvas);
switch (type)
{
case GL_LABEL_... | false | false | false | false | false | 0 |
new_url_t(const char *url_str)
{
struct url_t *url = NULL;
char *pre = NULL,*post = NULL;
char *server_part = NULL;
char *path_part = NULL;
char *user_pass = NULL;
char *host_port = NULL;
if(!strstr(url_str,"://")) {
return NULL; /* invalid url*/
}
url = (struct url_t *)xmalloc(si... | false | false | false | false | false | 0 |
ContinuePipe () {
char RealCommand[2048];
size_t space;
if (!OnFilesPos) {
// At the end of all files, terminate
ClosePipe ();
return 0;
} else if (Running) {
// Already running, close the pipe and continue
ReturnCode=gui->ClosePipe (PipeId);
} else {
... | false | false | false | false | false | 0 |
uih_command(struct uih_context *uih, const char *command)
{
errstring = NULL;
uih->playpos = 0;
uih->playstring = command;
uih_processcommand(uih, (uih->play ? MENUFLAG_NOMENU : 0));
uih->playstring = NULL;
if (errstring != NULL) {
uih_error(uih, errstring);
}
} | false | false | false | false | false | 0 |
select_kernel(CHAR16 *buffer, INTN size)
{
#define CHAR_CTRL_C L'\003' /* Unicode CTRL-C */
#define CHAR_CTRL_D L'\004' /* Unicode CTRL-D */
#define CHAR_CTRL_U L'\025' /* Unicode CTRL-U */
//#define CHAR_TAB L'\t'
SIMPLE_INPUT_INTERFACE *ip = systab->ConIn;
EFI_INPUT_KEY key;
EFI_STATUS status;
INTN pos = 0, ret;
... | false | false | false | false | false | 0 |
get_text_align_max_fill_size (int align_pow,
bfd_boolean use_nops,
bfd_boolean use_no_density)
{
if (!use_nops)
return (1 << align_pow);
if (use_no_density)
return 3 * (1 << align_pow);
return 1 + (1 << align_pow);
} | false | false | false | false | false | 0 |
Sop_alut44_SKto_Dacc( GenefxState *gfxs )
{
int w = gfxs->length;
int i = gfxs->Xphase;
int SperD = gfxs->SperD;
GenefxAccumulator *D = gfxs->Dacc;
u8 *S = gfxs->Sop[0];
u32 Skey = gfxs->Skey;
DFBColor *entries = gfxs->Slut->entries;
... | false | false | false | false | false | 0 |
pushutfchar (lua_State *L, int arg) {
lua_Integer code = luaL_checkinteger(L, arg);
luaL_argcheck(L, 0 <= code && code <= MAXUNICODE, arg, "value out of range");
lua_pushfstring(L, "%U", (long)code);
} | false | false | false | false | false | 0 |
matchPair(MachineBasicBlock::const_succ_iterator i,
const MachineBasicBlock *a, const MachineBasicBlock *b) {
if (*i == a)
return *++i == b;
if (*i == b)
return *++i == a;
return false;
} | false | false | false | false | false | 0 |
cyttsp_report_tchdata(struct cyttsp *ts)
{
struct cyttsp_xydata *xy_data = &ts->xy_data;
struct input_dev *input = ts->input;
int num_tch = GET_NUM_TOUCHES(xy_data->tt_stat);
const struct cyttsp_tch *tch;
int ids[CY_MAX_ID];
int i;
DECLARE_BITMAP(used, CY_MAX_ID);
if (IS_LARGE_AREA(xy_data->tt_stat) == 1) {
... | false | false | false | false | false | 0 |
processevent(evdev_t *evdev, fd_set *permset) {
struct input_event event;
char message[1000];
int len;
client_t *client, *prev, *next;
if(read(evdev->fd, &event, sizeof event) != sizeof event) {
syslog(LOG_ERR, "Error processing event from %s: %s\n", evdev->name, strerror(errno));
FD_CLR(evdev->fd, permset);
... | false | false | false | false | false | 0 |
setTimeout(int t)
{
if (m_timeout != t)
{
log_debug("set timeout " << t << ", fd=" << getFd() << ", previous=" << m_timeout);
if (getFd() >= 0 && ((t >= 0 && m_timeout < 0) || (t < 0 && m_timeout >= 0)))
{
long a = t >= 0 ? O_NONBLOCK : 0;
log_debug("fcntl(" << getFd() << ",... | false | false | false | false | false | 0 |
xsh_verify_2dmap_poly_input(cpl_frame* order_tab_edges_frame,
cpl_frame* spectralformat_frame,
cpl_frame* theo_tab_frame)
{
cpl_table* tab_edges=NULL;
cpl_table* tab_spectral_format=NULL;
cpl_table* theo_tab=NULL;
const char* name=NULL;
int ord_min_ref=0;
... | false | false | false | false | false | 0 |
crypto_init_spawn2(struct crypto_spawn *spawn, struct crypto_alg *alg,
struct crypto_instance *inst,
const struct crypto_type *frontend)
{
int err = -EINVAL;
if ((alg->cra_flags ^ frontend->type) & frontend->maskset)
goto out;
spawn->frontend = frontend;
err = crypto_init_spawn(spawn, alg, ins... | false | false | false | false | false | 0 |
makeInvoke (const std::string &method,
std::vector<std::string> args)
{
std::stringstream ss;
std::vector<std::string>::iterator it;
ss << "<invoke name=\"" << method << "\" returntype=\"xml\">";
ss << "<arguments>";
for (it=args.begin(); it != args.end(); ++it) {
... | false | false | false | false | false | 0 |
SendAIEventAround(AIEventType eventType, Unit* pInvoker, uint32 uiDelay, float fRadius, uint32 miscValue /*=0*/) const
{
if (fRadius > 0)
{
std::list<Creature*> receiverList;
// Allow sending custom AI events to all units in range
if (eventType == AI_EVENT_CUSTOM_EVENTAI_A || eventType ... | false | false | false | false | false | 0 |
DSA_sign(int type, const unsigned char *dgst, int dlen, unsigned char *sig,
unsigned int *siglen, DSA *dsa)
{
DSA_SIG *s;
RAND_seed(dgst, dlen);
s=DSA_do_sign(dgst,dlen,dsa);
if (s == NULL)
{
*siglen=0;
return(0);
}
*siglen=i2d_DSA_SIG(s,&sig);
DSA_SIG_free(s);
return(1);
} | false | false | false | false | false | 0 |
rule_top (GtkWidget *widget,
ERuleEditor *editor)
{
gint pos;
update_selected_rule (editor);
pos = e_rule_context_get_rank_rule (
editor->context, editor->current, editor->source);
if (pos > 0)
rule_move (editor, pos, 0);
} | false | false | false | false | false | 0 |
makeBranchSubNode(int32_t start, int32_t limit, int32_t unitIndex,
int32_t length, UErrorCode &errorCode) {
if(U_FAILURE(errorCode)) {
return NULL;
}
UChar middleUnits[kMaxSplitBranchLevels];
Node *lessThan[kMaxSplitBranchLevels];
int32_t ltLength=0;
wh... | false | false | false | false | false | 0 |
doelectricity (void)
{
int leftelectrax;
int rightelectrax;
int temp;
int n;
if (levelinfo.electrasflag && levelinfo.electraoffset == 0) // When electra enemies ride over the main lightning...
{
for (n = 0; n < MAX_ENEMIES; n++)
{
if (enemy[n].exists && enemy[n].type == ELE... | false | false | false | false | false | 0 |
ReadGifComment(GifComment, MemGif2)
GIFCOMMENT *GifComment; /* Pointer to GIF Comment Extension structure */
BYTE **MemGif2; /* GIF image file input FILE stream */
{
/* Read in the Plain Text data sub-blocks */
if (!(GifComment->CommentData = ReadDataSubBlocks(MemGif2 , &(GifComment->Data... | false | false | false | false | false | 0 |
select_earliest_finish_slot(Task *task, List *slotlist)
{
int pgno = task->TaskexePro[task->SelectTask];
int i;
List *li;
IntSet assigned;
int bmax = get_max_block_no(task->block[1]);
construct_IntSet(assigned, bmax + 1);
for (i = 0; i < task->assigns[pgno]; i++) {
add1_IntSet(assi... | false | false | false | false | false | 0 |
initCopyDict()
//
////////////////////////////////////////////////////////////////////////
{
if (copyDictList == NULL)
copyDictList = new SbPList;
SbDict *copyDict = new SbDict;
// Insert the new dictionary at the beginning. Since most copies
// are non-recursive, having to make room in the list won'... | false | false | false | false | false | 0 |
tvp7002_s_stream(struct v4l2_subdev *sd, int enable)
{
struct tvp7002 *device = to_tvp7002(sd);
int error;
if (device->streaming == enable)
return 0;
/* low impedance: on, high impedance: off */
error = tvp7002_write(sd, TVP7002_MISC_CTL_2, enable ? 0x00 : 0x03);
if (error) {
v4l2_dbg(1, debug, sd, "Fail to... | false | false | false | false | false | 0 |
typeToString(const int type) const
{
switch (type) {
case Calendar::People::PeopleAttendee: return tkTr(Trans::Constants::ATTENDEE);
case Calendar::People::PeopleOwner: return tkTr(Trans::Constants::OWNER);
case Calendar::People::PeopleUser: return tkTr(Trans::Constants::USER);
case Calendar::People... | false | false | false | false | false | 0 |
_bdf_set_glyph_names(FILE *in, bdf_font_t *font, bdf_callback_t callback,
int adobe)
#else
_bdf_set_glyph_names(in, font, callback, adobe)
FILE *in;
bdf_font_t *font;
bdf_callback_t callback;
int adobe;
#endif
{
int changed;
long i, size, len;
bdf_glyph_t *gp;
bdf_callback_struct_t ... | false | false | false | false | false | 0 |
cont_scroll(Widget gw,
XEvent *event,
String *params,
Cardinal *no_params)
{
ScrBarWidget w = (ScrBarWidget)gw;
int x, y, dc, length;
if (w->scrbar.mode != ScrBarModeContinuous)
return;
if (!get_event_xy(event, &x, &y)) {
XBell(XtDisplay(w), 0);
return;
}
length = w->scrbar.... | false | false | false | false | false | 0 |
__ecereMethod___ecereNameSpace__ecere__gui__controls__Button_OnLeftDoubleClick(struct __ecereNameSpace__ecere__com__Instance * this, int x, int y, unsigned int mods)
{
struct __ecereNameSpace__ecere__gui__controls__Button * __ecerePointer___ecereNameSpace__ecere__gui__controls__Button = (struct __ecereNameSpace__ecere_... | false | false | false | false | false | 0 |
GC_delete_thread(pthread_t id)
{
int hv = ((word)id) % THREAD_TABLE_SZ;
register GC_thread p = GC_threads[hv];
register GC_thread prev = 0;
while (!pthread_equal(p -> id, id)) {
prev = p;
p = p -> next;
}
if (prev == 0) {
GC_threads[hv] = p -> next;
} else {
... | false | false | false | false | false | 0 |
DataCompare(DATE left, DATE right)
{
if (left[YEAR] > right[YEAR])
return 0;
else if (left[YEAR] < right[YEAR])
return 2;
else if (left[YEAR] == right[YEAR])
{
if (left[MONTH] > right[MONTH])
return 0;
else if (left[MONTH] < right[MONTH])
return 2;
else if (left[MONTH] == right[... | false | false | false | false | false | 0 |
test_generate_key_pair (Test *test, gconstpointer unused)
{
GckMechanism mech = { CKM_MOCK_GENERATE, (guchar *)"generate", 9 };
GckBuilder builder = GCK_BUILDER_INIT;
GckAttributes *pub_attrs, *prv_attrs;
GError *error = NULL;
GAsyncResult *result = NULL;
GckObject *pub_key, *prv_key;
gboolean ret;
gck_builder... | false | false | false | false | false | 0 |
gnumeric_isblank (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
{
return value_new_bool (VALUE_IS_EMPTY (argv[0]));
} | false | false | false | false | false | 0 |
previousCodePoint(UErrorCode &errorCode) {
UChar32 c;
for(;;) {
if(state == CHECK_BWD) {
if(pos == 0) {
return U_SENTINEL;
}
if((c = u8[pos - 1]) < 0x80) {
--pos;
return c;
}
U8_PREV_OR_FFFD(u8, 0... | false | false | false | false | false | 0 |
gamgi_engine_link_object_plane (gamgi_object *object, gamgi_plane *plane)
{
/*******************************
* bonds have no plane parents *
*******************************/
switch (object->class)
{
case GAMGI_ENGINE_TEXT:
gamgi_engine_link_text_plane (GAMGI_CAST_TEXT object, plane);
break;
case GAMGI_ENG... | false | false | false | false | false | 0 |
tcl_modules STDVAR
{
int i;
char *p, s[24], s2[24];
EGG_CONST char *list[100], *list2[2];
dependancy *dep;
module_entry *current;
BADARGS(1, 1, "");
for (current = module_list; current; current = current->next) {
list[0] = current->name;
egg_snprintf(s, sizeof s, "%d.%d", current->major, current... | false | false | false | false | false | 0 |
getUnmatchedGlobalSuppressions(bool unusedFunctionChecking) const
{
std::list<SuppressionEntry> r;
for (std::map<std::string, FileMatcher>::const_iterator i = _suppressions.begin(); i != _suppressions.end(); ++i) {
if (!unusedFunctionChecking && i->first == "unusedFunction")
continue;
... | false | false | false | false | false | 0 |
GetGlyphMetric(utf16 wGlyphID, GlyphMetric gmet, GdlObject * pgdlobj)
{
Assert(m_pFile);
Assert(m_pLoca);
Assert(m_pGlyf);
Assert(m_pOs2);
Assert(m_pHmtx);
Assert(m_pHhea);
switch(gmet)
{
case kgmetAscent:
return TtfUtil::FontAscent(m_pOs2);
case kgmetDescent:
return TtfUtil::FontDescent(m_pOs2);
case k... | false | false | false | false | false | 0 |
do_info(const char *file, int FAST_FUNC (*proc)(char *))
{
int lnr;
FILE *procinfo;
char *buffer;
/* _stdin is just to save "r" param */
procinfo = fopen_or_warn_stdin(file);
if (procinfo == NULL) {
return;
}
lnr = 0;
/* Why xmalloc_fgets_str? because it doesn't stop on NULs */
while ((buffer = xmalloc_fge... | false | false | false | false | false | 0 |
_create_agent(void)
{
/* this needs to be set because the agent thread will do
nothing if the connection was closed and then opened again */
agent_shutdown = 0;
if (agent_list == NULL) {
agent_list = list_create(slurmdbd_free_buffer);
_load_dbd_state();
}
if (agent_tid == 0) {
pthread_attr_t agent_attr... | false | false | false | false | false | 0 |
gridfs_store_file(gridfs *gfs, const char *filename, const char *remotename, const char *contenttype, int flags ) {
char buffer[DEFAULT_CHUNK_SIZE];
FILE *fd;
gridfs_offset chunkLen;
gridfile gfile;
gridfs_offset bytes_written = 0;
/* Open the file and the correct stream */
if (strcmp(filename, "-") ... | false | false | false | false | true | 1 |
hash_find_entry (Hash_table *table, const void *entry,
struct hash_entry **bucket_head, bool delete)
{
struct hash_entry *bucket
= table->bucket + table->hasher (entry, table->n_buckets);
struct hash_entry *cursor;
assert (bucket < table->bucket_limit);
*bucket_head = bucket;
/* Test for empty bucket... | false | false | false | false | false | 0 |
_dxfgetdictalias(struct dict *d, int alias, int *value)
{
struct dinfo *di;
/* this is hashed on string value, so to look up an alias number
* it has to be a linear search.
*/
if (!DXInitGetNextHashElement(d->dicttab))
return ERROR;
while ((di = (struct dinfo *)DXGetNextHashElemen... | false | false | false | false | false | 0 |
try_parse_special(const wcstring &special)
{
bzero(&data, sizeof data);
const wchar_t *name = special.c_str();
if (! wcscasecmp(name, L"normal"))
{
this->type = type_normal;
}
else if (! wcscasecmp(name, L"reset"))
{
this->type = type_reset;
}
else if (! wcscasecmp(na... | false | false | false | false | false | 0 |
thread_name (MonoProfiler *prof, uintptr_t tid, const char *name)
{
int len = strlen (name) + 1;
uint64_t now;
LogBuffer *logbuffer;
logbuffer = ensure_logbuf (
EVENT_SIZE /* event */ +
LEB128_SIZE /* time */ +
EVENT_SIZE /* type */ +
LEB128_SIZE /* tid */ +
LEB128_SIZE /* flags */ +
len /* name */
);
... | false | true | false | false | false | 1 |
registerDragType(const FXString& name) const {
if(initialized){
#ifndef WIN32
return (FXDragType)XInternAtom((Display*)display,name.text(),0);
#else
return RegisterClipboardFormatA(name.text());
#endif
}
return 0;
} | false | false | false | false | false | 0 |
XGIfb_set_par(struct fb_info *info)
{
int err;
err = XGIfb_do_set_var(&info->var, 1, info);
if (err)
return err;
XGIfb_get_fix(&info->fix, -1, info);
return 0;
} | false | false | false | false | false | 0 |
handlePRERET(FlowInstruction *pre)
{
BasicBlock *bbE = pre->bb;
BasicBlock *bbT = pre->target.bb;
pre->subOp = NV50_IR_SUBOP_EMU_PRERET + 0;
bbE->remove(pre);
bbE->insertHead(pre);
Instruction *skip = new_FlowInstruction(func, OP_PRERET, bbT);
Instruction *call = new_FlowInstruction(func, OP_PRER... | false | false | false | true | false | 1 |
chip_ti_1520_cwrite1(
void *_cpssp,
uint32_t addr,
unsigned int bs,
uint32_t val
)
{
struct cpssp *cpssp = (struct cpssp *) _cpssp;
unsigned int bus;
unsigned int dev;
bus = (addr >> 16) & 0xff;
if (bus == CB_BUS(cpssp, 0)) {
dev = (addr >> 11) & 0x1f;
addr &= 0x7fc;
if (! cpssp->powered[0]) {
retur... | false | false | false | false | false | 0 |
intel_runtime_pm_enable(struct drm_i915_private *dev_priv)
{
struct drm_device *dev = dev_priv->dev;
struct device *device = &dev->pdev->dev;
if (!HAS_RUNTIME_PM(dev))
return;
/*
* RPM depends on RC6 to save restore the GT HW context, so make RC6 a
* requirement.
*/
if (!intel_enable_rc6(dev)) {
DRM_IN... | false | false | false | false | false | 0 |
numaNormalizeHistogram(NUMA *nas,
l_float32 area)
{
l_int32 i, ns;
l_float32 sum, factor, fval;
NUMA *nad;
PROCNAME("numaNormalizeHistogram");
if (!nas)
return (NUMA *)ERROR_PTR("nas not defined", procName, NULL);
if (area <= 0.0)
return (NUMA *)ERROR_... | false | false | false | false | false | 0 |
test_create (void)
{
static double test[sizeof (double) * test_pixels * 4];
int i;
static int done = 0;
if (done)
return test;
srandom (20050728);
for (i = 0; i < test_pixels * 4; i++)
test [i] = (double) random () / RAND_MAX;
done = 1;
return test;
} | false | false | false | false | false | 0 |
collect_reloc(Elf32_Rel *rel, Elf32_Sym *sym)
{
/* Remember the address that needs to be adjusted. */
if (ELF32_R_TYPE(rel->r_info) == R_386_16)
relocs16[reloc16_idx++] = rel->r_offset;
else
relocs[reloc_idx++] = rel->r_offset;
} | false | false | false | false | false | 0 |
cmor_convert_value(char *units,char *ctmp,double *tmp){
ut_unit *user_units=NULL, *cmor_units=NULL;
cv_converter *ut_cmor_converter=NULL;
double value;
char msg[CMOR_MAX_STRING];
cmor_add_traceback("cmor_convert_value");
value = *tmp;
if (units[0]!='\0') {
cmor_prep_units(ctmp,units,&cmor_units,&us... | false | false | false | false | false | 0 |
EmitSignal (SignalId Signal)
{
Object *obj = NULL;
Object *ancestor = this;
while (ancestor && !ancestor->IsLocked () && ancestor->OnSignal (Signal, obj)) {
obj = ancestor;
ancestor = obj->m_Parent;
}
} | false | false | false | false | false | 0 |
rs_allocmatDBL(double ***v, const int m, const int n)
{
int i;
*v = reinterpret_cast<double **> (calloc (m, sizeof(double *)));
if (*v == NULL) {
printf("###ERROR: DOUBLE matrix allocation failed\n");
exit(1);
}
for(i=0; i<m; i++) {
(*v)[i] = reinterpret_cast<double *> (calloc (n, sizeof(double)... | false | false | false | false | false | 0 |
makeSubObject(DcmObject *&subObject,
const DcmTag &newTag,
const Uint32 newLength)
{
OFCondition l_error = EC_Normal;
DcmItem *subItem = NULL;
switch (newTag.getEVR())
{
case EVR_na:
if (newT... | false | false | false | false | false | 0 |
hash_result(struct mdfour *md)
{
unsigned char sum[16];
char *ret;
int i;
ret = x_malloc(53);
hash_result_as_bytes(md, sum);
for (i=0;i<16;i++) {
sprintf(&ret[i*2], "%02x", (unsigned)sum[i]);
}
sprintf(&ret[i*2], "-%u", (unsigned)md->totalN);
return ret;
} | false | false | false | false | false | 0 |
get_icon_from_irda_hints( guint8 hints[2] )
{
gchar *icon_name;
if(hints[0] & HINT_PDA)
icon_name = g_strdup("pda");
else if(hints[0] & HINT_COMPUTER)
icon_name = g_strdup("computer");
else if(hints[0] & HINT_PRINTER)
icon_name = g_strdup("printer");
else if(hints[1] & HI... | false | false | false | false | false | 0 |
param_is_printable(int i)const
{
if (has_common()) {
return common()->param_is_printable(i);
}else{
switch (COMPONENT::param_count() - 1 - i) {
case 0: return value().has_hard_value();
case 1: return _mfactor.has_hard_value();
default: return CARD::param_is_printable(i);
}
}
} | false | false | false | false | false | 0 |
i7core_pci_lastbus(void)
{
int last_bus = 0, bus;
struct pci_bus *b = NULL;
while ((b = pci_find_next_bus(b)) != NULL) {
bus = b->number;
edac_dbg(0, "Found bus %d\n", bus);
if (bus > last_bus)
last_bus = bus;
}
edac_dbg(0, "Last bus %d\n", last_bus);
return last_bus;
} | false | false | false | false | false | 0 |
xfs_mru_cache_create(
struct xfs_mru_cache **mrup,
unsigned int lifetime_ms,
unsigned int grp_count,
xfs_mru_cache_free_func_t free_func)
{
struct xfs_mru_cache *mru = NULL;
int err = 0, grp;
unsigned int grp_time;
if (mrup)
*mrup = NULL;
if (!mrup || !grp_count || !lifetime_ms || !free_func)
return... | false | false | false | false | false | 0 |
pixScaleToGray3(PIX *pixs)
{
l_uint8 *valtab;
l_int32 ws, hs, wd, hd;
l_int32 wpld, wpls;
l_uint32 *sumtab;
l_uint32 *datas, *datad;
PIX *pixd;
PROCNAME("pixScaleToGray3");
if (!pixs)
return (PIX *)ERROR_PTR("pixs not defined", procName, NULL);
if (pixGetDepth(pixs) != 1)
... | false | false | false | false | false | 0 |
knh_PtrMap_rmS(CTX ctx, kPtrMap *pm, kString *s)
{
knh_hmap_t *hmap = (knh_hmap_t*)pm->mapptr;
kbytes_t t = S_tobytes(s);
khashcode_t hcode = knh_hash(0, t.text, t.len);
knh_hentry_t *e = hmap_getentry(hmap, hcode);
DBG_ASSERT(IS_bString(s));
while(e != NULL) {
if(e->hcode == hcode && e->pvalue == (void*)s) {
... | false | false | false | false | false | 0 |
termattrs(void)
{
chtype attrs = A_NORMAL;
T((T_CALLED("termattrs()")));
if (enter_alt_charset_mode)
attrs |= A_ALTCHARSET;
if (enter_blink_mode)
attrs |= A_BLINK;
if (enter_bold_mode)
attrs |= A_BOLD;
if (enter_dim_mode)
attrs |= A_DIM;
if (enter_reverse_mode)
attrs |= A_REVERSE;
... | false | false | false | false | false | 0 |
normal_thumb(Glyph* g) {
SliderImpl& s = *impl_;
Resource::ref(g);
Resource::unref(s.normal_thumb_);
s.normal_thumb_ = g;
Resource::unref(s.thumb_patch_);
s.thumb_patch_ = new Patch(g);
Resource::ref(s.thumb_patch_);
} | false | false | false | false | false | 0 |
save_pbm(const char* name, uchar* im, int height, int width )
{
std::ofstream file(name, std::ios::out | std::ios::binary);
file << "P4\n" << width << " " << height << "\n";
for (int i = 0; i < height; i++)
write_packed(im+(width*i), width, file);
} | false | false | false | false | false | 0 |
check_modification_callback (GFile *source,
GAsyncResult *res,
AsyncData *async)
{
GeditDocumentSaver *saver;
GError *error = NULL;
GFileInfo *info;
gedit_debug (DEBUG_SAVER);
/* manually check cancelled state */
if (g_cancellable_is_cancelled (async->cancellable))
{
async_data_free... | false | false | false | false | false | 0 |
gas_fire (edict_t * ent)
{
vec3_t offset;
vec3_t forward, right;
vec3_t start;
int damage = GRENADE_DAMRAD;
float timer;
int speed;
/* int held = false;*/
// Reset Grenade Damage to 1.52 when requested:
if (use_classic->value)
damage = 170;
else
damage = GRENADE_DAMRAD;
if(is_quad)
damage *= 1... | false | false | false | false | false | 0 |
_wapi_handle_check_share (struct _WapiFileShare *share_info, int fd)
{
gboolean found = FALSE, proc_fds = FALSE;
pid_t self = _wapi_getpid ();
int pid;
int thr_ret, i;
/* Prevents entries from expiring under us if we remove this
* one
*/
thr_ret = _wapi_handle_lock_shared_handles ();
g_assert (thr_ret == 0... | true | true | true | false | true | 1 |
NumericValue(RefAST ast, bool * pfM)
{
Assert(ast->getType() == LIT_INT || ast->getType() == LIT_UHEX);
std::string str = ast->getText();
int nRet = 0;
unsigned int ich = 0;
int nBase = 10;
if (ast->getType() == LIT_UHEX)
{
if (str[0] == 'U' && str[1] == '+')
ich = 2;
nBase = 16;
}
else if (str[0] =... | false | false | false | false | false | 0 |
setIdColAcol() {
// Flavours and colours are trivial.
int idX1 = 10* (abs(idA) / 10) + 9900000;
if (idA < 0) idX1 = -idX1;
int idX2 = 10* (abs(idB) / 10) + 9900000;
if (idB < 0) idX2 = -idX2;
setId( idA, idB, idX1, idX2);
setColAcol( 0, 0, 0, 0, 0, 0, 0, 0);
} | false | false | false | false | false | 0 |
gt_samfile_iterator_reset(GtSamfileIterator *s_iter,
GtError *err)
{
gt_assert(s_iter != NULL);
samclose(s_iter->samfile);
s_iter->samfile = samopen(s_iter->filename, s_iter->mode, s_iter->aux);
if (s_iter->samfile == NULL) {
gt_error_set(err, "could not reopen sam/bam file: %s... | false | false | false | false | false | 0 |
ao_hex_record_set_checksum(struct ao_hex_record *record)
{
uint8_t cksum = 0;
int i;
cksum += record->length;
cksum += record->address >> 8;
cksum += record->address;
cksum += record->type;
for (i = 0; i < record->length; i++)
cksum += record->data[i];
record->checksum = -cksum;
} | false | true | false | false | false | 1 |
search_object_integer(struct alisp_instance *instance, long in)
{
struct list_head * pos;
struct alisp_object * p;
list_for_each(pos, &instance->used_objs_list[in & ALISP_OBJ_PAIR_HASH_MASK][ALISP_OBJ_INTEGER]) {
p = list_entry(pos, struct alisp_object, list);
if (p->value.i == in) {
if (alisp_get_refs(p) > ... | false | false | false | false | false | 0 |
defragmentPage(Btree *pBt, MemPage *pPage){
int pc, i, n;
FreeBlk *pFBlk;
char newPage[SQLITE_USABLE_SIZE];
assert( sqlitepager_iswriteable(pPage) );
assert( pPage->isInit );
pc = sizeof(PageHdr);
pPage->u.hdr.firstCell = SWAB16(pBt, pc);
memcpy(newPage, pPage->u.aDisk, pc);
for(i=0; i<pPage->nCell; ... | true | true | false | false | false | 1 |
run_script(const char *name, const char *pattern, uint32_t job_id,
int max_wait, char **env, uid_t uid)
{
int rc = 0;
List l;
ListIterator i;
char *s;
if (pattern == NULL || pattern[0] == '\0')
return 0;
l = _script_list_create (pattern);
if (l == NULL)
return error ("Unable to run %s [%s]", name, ... | false | false | false | false | false | 0 |
DAC960_GEM_QueueCommand(DAC960_Command_T *Command)
{
DAC960_Controller_T *Controller = Command->Controller;
void __iomem *ControllerBaseAddress = Controller->BaseAddress;
DAC960_V2_CommandMailbox_T *CommandMailbox = &Command->V2.CommandMailbox;
DAC960_V2_CommandMailbox_T *NextCommandMailbox =
Controller->... | false | false | false | false | false | 0 |
gt_sortbench_option_parser_new(void *tool_arguments)
{
QSortBenchArguments *arguments = tool_arguments;
GtOptionParser *op;
GtOption *option;
gt_assert(arguments);
/* init */
op = gt_option_parser_new("[option ...]",
"Benchmarks quicksort implementations.");
option = gt_opti... | false | false | false | false | false | 0 |
crc32_le_80211(unsigned int *crc32_table, const unsigned char *buf,
int len) {
int i;
unsigned int crc = 0xFFFFFFFF;
for (i = 0; i < len; ++i) {
crc = (crc >> 8) ^ crc32_table[(crc ^ buf[i]) & 0xFF];
}
crc ^= 0xFFFFFFFF;
return crc;
} | false | false | false | false | false | 0 |
bl_set_status(struct backlight_device *bd)
{
int bright = bd->props.brightness;
if (bright >= ARRAY_SIZE(backlight_map) || bright < 0)
return -EINVAL;
/* Instance 0 is "set backlight" */
return msi_wmi_set_block(0, backlight_map[bright]);
} | false | false | false | false | false | 0 |
gt_twobitenc_editor_new(const GtEncseq *encseq,
const char* indexname, GtError *err)
{
GtTwobitencEditor *twobitenc_editor;
size_t t_offset;
size_t c_offset;
GtStr *encseqfilename;
int had_err = 0;
twobitenc_editor = gt_malloc(sizeof (GtTwobitencEditor));
had_err = gt_twobitenc_editor_check(encseq, e... | false | false | false | false | false | 0 |
lvalue_error (location_t loc, enum lvalue_use use)
{
switch (use)
{
case lv_assign:
error_at (loc, "lvalue required as left operand of assignment");
break;
case lv_increment:
error_at (loc, "lvalue required as increment operand");
break;
case lv_decrement:
error_at (loc, ... | false | false | false | false | false | 0 |
fc_lport_recv_req(struct fc_lport *lport,
struct fc_frame *fp)
{
struct fc_frame_header *fh = fc_frame_header_get(fp);
struct fc_seq *sp = fr_seq(fp);
struct fc4_prov *prov;
/*
* Use RCU read lock and module_lock to be sure module doesn't
* deregister and get unloaded while we're calling it.
* try_m... | false | false | false | false | false | 0 |
git_repository_open_bare(
git_repository **repo_ptr,
const char *bare_path)
{
int error;
git_buf path = GIT_BUF_INIT;
git_repository *repo = NULL;
if ((error = git_path_prettify_dir(&path, bare_path, NULL)) < 0)
return error;
if (!valid_repository_path(&path)) {
git_buf_free(&path);
giterr_set(GITERR_REP... | false | false | false | false | false | 0 |
_wrap_goo_canvas_item_model_find_child_property (PyObject *cls,
PyObject *args,
PyObject *kwargs)
{
static char *kwlist[] = { "property", NULL };
GObjectClass *klass;
GType itype;
... | false | false | false | false | false | 0 |
get_port(const char *service)
{
struct servent *serv = getservbyname(service, "udp");
if (serv == NULL)
exit(1);
return serv->s_port;
} | false | false | false | false | false | 0 |
record_start_time()
{
struct tm *tm_now;
start_sec = time(NULL);
tm_now = localtime(&start_sec);
year = tm_now->tm_year + 1900;
month = tm_now->tm_mon + 1;
day_of_month = tm_now->tm_mday;
day_now = day_num(year, month, day_of_month);
if (day_now == -1) die("Invalid date (this is really ... | false | false | false | false | false | 0 |
tvp7002_log_status(struct v4l2_subdev *sd)
{
struct tvp7002 *device = to_tvp7002(sd);
const struct v4l2_bt_timings *bt;
int detected;
/* Find my current timings */
tvp7002_query_dv(sd, &detected);
bt = &device->current_timings->timings.bt;
v4l2_info(sd, "Selected DV Timings: %ux%u\n", bt->width, bt->height);
... | false | false | false | false | false | 0 |
add_label(void)
{
int i;
if (token[strlen(token)-1]==':')
token[strlen(token)-1]=0;
if (lindex>=MAX_LABELS)
{
printf("Too many labels.\n");
exit(0);
}
for (i=0;i<lindex;i++)
{
if (!strcasecmp(token,labels[i]))
{
printf("Warning: label '%s' already exists.\n",token);
return;
}
}
... | false | false | false | false | false | 0 |
clear_c(obj)
CcWnnObject obj;
{
switch (obj->ccWnn.state)
{
case selection_s_state:
case selection_l_state:
endSelection(obj, False);
cancel(obj);
break;
case symbol_state:
clear_buffer(obj);
break;
default:
if (jcIsConverted(JCBUF(obj), JCBUF(obj)->curClause))
cancel(obj);
else
... | false | false | false | false | false | 0 |
operator==(const QualifiedName& other) const
{
/*kDebug() << m_prefix.id() << other.prefixId().id() << ((m_prefix == other.prefixId())) << endl;
kDebug() << (m_prefix == other.prefixId()) << (m_localName == other.localNameId()) << (m_namespace == other.namespaceNameId()) << endl;*/
return (m_prefix == other... | false | false | false | false | false | 0 |
ops_run_compute5(struct stripe_head *sh, struct raid5_percpu *percpu)
{
int disks = sh->disks;
struct page **xor_srcs = to_addr_page(percpu, 0);
int target = sh->ops.target;
struct r5dev *tgt = &sh->dev[target];
struct page *xor_dest = tgt->page;
int count = 0;
struct dma_async_tx_descriptor *tx;
struct async_s... | false | false | false | false | false | 0 |
RFCNB_Recv(void *con_Handle, struct RFCNB_Pkt *Data, int Length)
{ struct RFCNB_Pkt *pkt;
/* struct RFCNB_Hdr *hdr; */
int ret_len;
if (con_Handle == NULL){
RFCNB_errno = RFCNBE_BadHandle;
RFCNB_saved_errno = errno;
return(RFCNBE_Bad);
}
/* Now get a packet from below. We allocate a header fir... | false | false | false | false | false | 0 |
_e_mod_menu_populate_filter(void *data __UNUSED__, Eio_File *handler __UNUSED__, const Eina_File_Direct_Info *info)
{
struct stat st;
/* don't show .dotfiles */
if (fileman_config->view.menu_shows_files)
return (info->path[info->name_start] != '.');
if (lstat(info->path, &st)) return EINA_FALSE;
/* ... | false | false | false | false | false | 0 |
utf8_idpb(char *utf8_text,uint32 ch) {
/* Increment and deposit character */
if ( ch<0 || ch>=17*65536 )
return( utf8_text );
if ( ch<=127 )
*utf8_text++ = ch;
else if ( ch<=0x7ff ) {
*utf8_text++ = 0xc0 | (ch>>6);
*utf8_text++ = 0x80 | (ch&0x3f);
} else if ( ch<=0xffff ) {
*utf8_text++ = 0xe0 ... | false | false | false | false | false | 0 |
set_db_type(const char *name)
{
if (catalog_db != NULL) {
free(catalog_db);
}
catalog_db = bstrdup(name);
} | false | false | false | false | false | 0 |
setBeforeClosingText(const QString & filename, QMessageBox & messageBox)
{
QString basename = QFileInfo(filename).fileName();
messageBox.setWindowTitle(tr("Save \"%1\"").arg(basename));
messageBox.setText(tr("Do you want to save the changes you made in the document \"%1\"?").arg(basename));
messageBox.setI... | 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.