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 |
|---|---|---|---|---|---|---|
pyTimerCallBack(){
PyObject* result;
if(pyTimerCallBackFunc==NULL) return;
/* Build arguments */
result = PyObject_CallObject(pyTimerCallBackFunc, NULL);
if(result==NULL){
PyErr_Print();
} else {
Py_DECREF(result);
}
} | false | false | false | false | false | 0 |
fetch_pack(struct alt_base *repo, unsigned char *sha1)
{
char *url;
struct packed_git *target;
struct packed_git **lst;
FILE *packfile;
char *filename;
char tmpfile[PATH_MAX];
int ret;
long prev_posn = 0;
char range[RANGE_HEADER_SIZE];
struct curl_slist *range_header = NULL;
struct active_request_slot *slot... | true | true | false | false | true | 1 |
ldap_back_init_cf( BackendInfo *bi )
{
int rc;
AttributeDescription *ad = NULL;
const char *text;
/* Make sure we don't exceed the bits reserved for userland */
config_check_userland( LDAP_BACK_CFG_LAST );
bi->bi_cf_ocs = ldapocs;
rc = config_register_schema( ldapcfg, ldapocs );
if ( rc ) {
return rc;
... | false | false | false | false | false | 0 |
APar_atom_Binary_Put(AtomicInfo* target_atom, const char* binary_data, uint32_t bytecount, uint32_t atomic_data_offset) {
if (target_atom == NULL) return;
if (atomic_data_offset + bytecount + target_atom->AtomicLength <= MAXDATA_PAYLOAD) {
memcpy(target_atom->AtomicData + atomic_data_offset, binary_data, bytecoun... | false | false | false | false | false | 0 |
is_loop_terminator(ir_if *ir)
{
if (!ir->else_instructions.is_empty())
return false;
ir_instruction *const inst =
(ir_instruction *) ir->then_instructions.get_head();
if (inst == NULL)
return false;
if (inst->ir_type != ir_type_loop_jump)
return false;
ir_loop_jump *const jump ... | false | false | false | false | false | 0 |
sd_init_controls(struct gspca_dev *gspca_dev)
{
struct sd *sd = (struct sd *)gspca_dev;
struct v4l2_ctrl_handler *hdl = &gspca_dev->ctrl_handler;
gspca_dev->vdev.ctrl_handler = hdl;
v4l2_ctrl_handler_init(hdl, 3);
switch (sd->webcam) {
case P35u:
gspca_dev->autogain = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
V4... | false | false | false | false | false | 0 |
evolve(u8 * state)
{
int i, j;
for(i = 0; i < 256; i++)
{
for(j = 0; j < 256; j++)
{
if(state[(j + 1) % 256] > state[(j + 3) % 256])
state[j % 256] ^= state[(j + 1) % 256];
else
state[j % 256] ^= ~state[(j + 1) % 256];
if(state[(j + 2) % 256] > state[(j + 3) % 256])
state[j % 256] ^... | false | false | false | false | false | 0 |
find_temporary_mirror(const struct logical_volume *lv)
{
struct lv_segment *seg;
if (!(lv->status & MIRRORED))
return NULL;
seg = first_seg(lv);
/* Temporary mirror is always area_num == 0 */
if (seg_type(seg, 0) == AREA_LV &&
is_temporary_mirror_layer(seg_lv(seg, 0)))
return seg_lv(seg, 0);
return N... | false | false | false | false | false | 0 |
amd_get_mmconfig_range(struct resource *res)
{
u32 address;
u64 base, msr;
unsigned segn_busn_bits;
if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD)
return NULL;
/* assume all cpus from fam10h have mmconfig */
if (boot_cpu_data.x86 < 0x10)
return NULL;
address = MSR_FAM10H_MMIO_CONF_BASE;
rdmsrl(ad... | false | false | false | false | false | 0 |
draw_fans(gboolean draw_name)
{
GList *list;
SensorMon *smon;
Sensor *sensor;
gchar *name;
gfloat f;
if (!pFan)
return;
for (list = fan_list; list; list = list->next)
{
smon = (SensorMon *) list->data;
sensor = smon->sensor;
if (draw_name && smon->name_decal)
{
name = name_text_fit(sensor,... | false | false | false | false | false | 0 |
DeleteField( DDFField *poTarget )
{
int iTarget, i;
/* -------------------------------------------------------------------- */
/* Find which field we are to delete. */
/* -------------------------------------------------------------------- */
for( iTarget = 0; iTarget... | false | false | false | false | false | 0 |
ff_read_sp_yscale( FL_OBJECT * obj FL_UNUSED_ARG,
SuperSPEC * sp )
{
int r;
char *p;
int yscale;
if ( ( r = ff_read( "%s%f", &p, &sp->ybase ) ) < 0 )
return ff_err( "Can't read expected object yscale values" );
if ( r == 0 )
return ff_err( "\"yscale\" key with n... | false | false | false | false | false | 0 |
hdrvc_init(void)
{
key_t k;
static struct ifreq ifr;
#ifdef HDRVC_KERNEL
if (kernel_mode) {
strcpy(ifr_h.ifr_name, if_name);
/* first try to use AF_PACKET */
if ((fd = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_AX25))) < 0
|| ioctl(fd, SIOCGIFINDEX, &ifr_h) < 0) {
if (fd >= 0)
close(fd);
afpacket... | false | true | false | false | false | 1 |
sat_add(unsigned int a, unsigned int b) {
if (b > (UINT_MAX - a))
return UINT_MAX;
return a + b;
} | false | false | false | false | false | 0 |
find_wl_entry(win, lnum)
win_T *win;
linenr_T lnum;
{
int i;
for (i = 0; i < win->w_lines_valid; ++i)
if (win->w_lines[i].wl_valid)
{
if (lnum < win->w_lines[i].wl_lnum)
return -1;
if (lnum <= win->w_lines[i].wl_lastlnum)
return i;
}
return -1;
} | false | false | false | false | false | 0 |
alloc_inlining_context(struct vm_method *method)
{
struct inlining_context *ctx;
int size;
ctx = malloc(sizeof(*ctx));
if (!ctx)
return NULL;
ctx->method = method;
INIT_LIST_HEAD(&ctx->subroutine_list);
if (code_state_init(&ctx->code, method->code_attribute.code,
method->code_attribute.code_length))... | false | false | false | false | false | 0 |
find_temp_slot_from_address (rtx x)
{
struct temp_slot *p;
struct temp_slot_address_entry tmp, *t;
/* First try the easy way:
See if X exists in the address -> temp slot mapping. */
tmp.address = x;
tmp.temp_slot = NULL;
tmp.hash = temp_slot_address_compute_hash (&tmp);
t = (struct temp_slot_addres... | false | false | false | false | false | 0 |
nvmem_device_cell_read(struct nvmem_device *nvmem,
struct nvmem_cell_info *info, void *buf)
{
struct nvmem_cell cell;
int rc;
ssize_t len;
if (!nvmem || !nvmem->regmap)
return -EINVAL;
rc = nvmem_cell_info_to_nvmem_cell(nvmem, info, &cell);
if (IS_ERR_VALUE(rc))
return rc;
rc = __nvmem_cell_read(nvm... | false | false | false | false | false | 0 |
main(int argc, char ** argv)
{
dxml_element * tmp ;
printf("<?xml version=\"1.0\"?>\n");
tmp = dxml_read_xml(stdin);
if (tmp)
recurse_element (tmp, 0);
else
{
printf ("Something wicked happened!\n");
return 1;
}
return 0;
} | false | false | false | false | false | 0 |
vboxd_test_response(char *response)
{
if (strlen(vboxd_message) > (strlen(response) + 1))
{
if (strncmp(response, vboxd_message, strlen(response)) == 0)
{
if (vboxd_message[strlen(response)] == ' ') returnok();
}
}
returnerror();
} | false | false | false | false | false | 0 |
snd_pcm_ladspa_add_default_controls(snd_pcm_ladspa_plugin_t *lplug,
snd_pcm_ladspa_plugin_io_t *io)
{
unsigned int count = 0;
LADSPA_Data *array;
unsigned char *initialized;
unsigned long idx;
for (idx = 0; idx < lplug->desc->PortCount; idx++)
if ((lplug->desc->PortDescriptors[idx] & (io->pdesc | L... | false | false | false | false | false | 0 |
match_prefix (const struct sockaddr_in6 *in6,
const struct prefixentry *list, int default_val)
{
int idx;
struct sockaddr_in6 in6_mem;
if (in6->sin6_family == PF_INET)
{
const struct sockaddr_in *in = (const struct sockaddr_in *) in6;
/* Construct a V4-to-6 mapped address. */
in6_m... | false | false | false | false | false | 0 |
disqualify_candidate (tree decl, const char *reason)
{
if (bitmap_clear_bit (candidate_bitmap, DECL_UID (decl)))
htab_clear_slot (candidates,
htab_find_slot_with_hash (candidates, decl,
DECL_UID (decl), NO_INSERT));
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file,... | false | false | false | false | false | 0 |
CreateLogOp(OpRcPtrVec & ops,
const float * k,
const float * m,
const float * b,
const float * base,
const float * kb,
TransformDirection direction)
{
ops.push_back( LogOpRcPtr(new L... | false | false | false | false | false | 0 |
sync_or_update_playlist(Playlist *playlist) {
g_return_if_fail (repository_view);
g_return_if_fail (playlist);
gint itdb_index = repository_view->itdb_index;
if (playlist->is_spl) {
itdb_spl_update(playlist);
if (gtkpod_get_current_playlist() == playlist) { /* redisplay */
... | false | false | false | false | false | 0 |
do_print_string (char *str, PRN *prn)
{
size_t len;
if (*str == '"') str++;
len = strlen(str);
if (str[len-1] == '"') {
str[len-1] = 0;
}
pputs(prn, str);
pputc(prn, '\n');
} | false | false | false | false | false | 0 |
xcgroup_set_uint32_param(xcgroup_t* cg, char* param, uint32_t value)
{
int fstatus = XCGROUP_ERROR;
char file_path[PATH_MAX];
char* cpath = cg->path;
if (snprintf(file_path, PATH_MAX, "%s/%s", cpath, param) >= PATH_MAX) {
debug2("unable to build filepath for '%s' and"
" parameter '%s' : %m", cpath, para... | false | false | false | false | false | 0 |
theora_parse_set_streamheader (GstTheoraParse * parse)
{
GstCaps *caps;
gint i;
guint32 bitstream_version;
th_setup_info *setup = NULL;
g_assert (!parse->streamheader_received);
caps = gst_caps_make_writable (gst_pad_query_caps (parse->srcpad, NULL));
theora_parse_set_header_on_caps (parse, caps);
GST... | false | false | false | false | false | 0 |
XTR_DH(const Integer &p, const Integer &q, const GFP2Element &g)
: m_p(p), m_q(q), m_g(g)
{
} | false | false | false | false | false | 0 |
bd_free(BAND *A)
#endif
{
if ( A == (BAND *)NULL || A->lb < 0 || A->ub < 0 )
/* don't trust it */
return (-1);
if (A->mat) m_free(A->mat);
if (mem_info_is_on()) {
mem_bytes(TYPE_BAND,sizeof(BAND),0);
mem_numvar(TYPE_BAND,-1);
}
free((char *)A);
return 0;
} | false | false | false | false | false | 0 |
get_update_array_region_data(Array_region_data *src_head,
Array_region_data *dest)
{
Array_region_data *ard;
int line_elm = PREFETCH_LINE_SIZE / dest->size;
for (ard = src_head; ard != NULL; ard = ard->next) {
Sub_express *s_sub_exp, *d_sub_exp;
Boolean first_dim_flag = TRUE,
update_1st_... | false | false | false | false | false | 0 |
Curl_disconnect(struct connectdata *conn)
{
struct SessionHandle *data;
if(!conn)
return CURLE_OK; /* this is closed and fine already */
data = conn->data;
if(!data) {
DEBUGF(infof(data, "DISCONNECT without easy handle, ignoring\n"));
return CURLE_OK;
}
#if defined(CURLDEBUG) && defined(AGGRESIV... | false | false | false | false | false | 0 |
incrblobOutput(
ClientData instanceData,
CONST char *buf,
int toWrite,
int *errorCodePtr
){
IncrblobChannel *p = (IncrblobChannel *)instanceData;
int nWrite = toWrite; /* Number of bytes to write */
int nBlob; /* Total size of the blob */
int rc; /* sqlite... | false | false | false | false | false | 0 |
b43legacy_set_original_gains(struct b43legacy_wldev *dev)
{
struct b43legacy_phy *phy = &dev->phy;
u16 i;
u16 tmp;
u16 offset = 0x0400;
u16 start = 0x0008;
u16 end = 0x0018;
if (phy->rev <= 1) {
offset = 0x5000;
start = 0x0010;
end = 0x0020;
}
for (i = 0; i < 4; i++) {
tmp = (i & 0xFFFC);
tmp |= (i... | false | false | false | false | false | 0 |
authCondition(HttpConn *conn, HttpRoute *route, HttpRouteOp *op)
{
mprAssert(conn);
mprAssert(route);
if (route->auth == 0 || route->auth->type == 0) {
return HTTP_ROUTE_OK;
}
return httpCheckAuth(conn);
} | false | false | false | false | false | 0 |
update_showing_desktop (WnckScreen *screen)
{
int showing_desktop;
if (!screen->priv->need_update_showing_desktop)
return;
screen->priv->need_update_showing_desktop = FALSE;
showing_desktop = FALSE;
_wnck_get_cardinal (screen->priv->xscreen,
screen->priv->xroot,
... | false | false | false | false | false | 0 |
enqueue(struct most_interface *most_iface,
int ch_idx, struct mbo *mbo)
{
struct hdm_i2c *dev = to_hdm(most_iface);
int ret;
BUG_ON(ch_idx < 0 || ch_idx >= NUM_CHANNELS);
BUG_ON(!dev->is_open[ch_idx]);
if (ch_idx == CH_RX) {
/* RX */
mutex_lock(&dev->rx.list_mutex);
list_add_tail(&mbo->list, &dev->rx.... | false | false | false | false | false | 0 |
php_userstreamop_seek(php_stream *stream, off_t offset, int whence, off_t *newoffs TSRMLS_DC)
{
zval func_name;
zval *retval = NULL;
int call_result, ret;
php_userstream_data_t *us = (php_userstream_data_t *)stream->abstract;
zval **args[2];
zval *zoffs, *zwhence;
assert(us != NULL);
ZVAL_STRINGL(&func_name, ... | false | false | false | false | false | 0 |
parse_plumbing_options (const char** key_name, const char** key_file, int argc, const char** argv)
{
Options_list options;
options.push_back(Option_def("-k", key_name));
options.push_back(Option_def("--key-name", key_name));
options.push_back(Option_def("--key-file", key_file));
return parse_options(options, argc... | false | false | false | false | false | 0 |
compute_deviatoric()
{
double* h = domain->h;
// [ 0 5 4 ] [ 0 5 4 ] [ 0 5 4 ]
// [ 5 1 3 ] = [ - 1 3 ] [ 5 1 3 ]
// [ 4 3 2 ] [ - - 2 ] [ 4 3 2 ]
if (dimension == 3) {
fdev[0] = pv2e*(h[0]*sigma[0]+h[5]*sigma[5]+h[4]*sigma[4]);
fdev[1] = pv2e*(h[1]*sigma[1]+h[3]*sigma[3]);
fdev[2] = pv2e*(h... | false | false | false | false | false | 0 |
lGetElemUlongFirst(const lList *lp, int nm, lUlong val,
const void **iterator)
{
lListElem *ep = NULL;
int pos;
DENTER(CULL_LAYER, "lGetElemUlongFirst");
/* empty list ? */
if (!lp) {
DEXIT;
return NULL;
}
/* get position of nm in sdp */
pos = lGetPo... | false | false | false | false | false | 0 |
afr_do_writev (call_frame_t *frame, xlator_t *this)
{
call_frame_t *transaction_frame = NULL;
afr_local_t *local = NULL;
int op_ret = -1;
int op_errno = 0;
local = frame->local;
transaction_frame = copy_frame (frame);
... | false | false | false | false | false | 0 |
handle_string (void *ctx, /* {{{ */
const unsigned char *string, unsigned int string_length)
{
yajl_value_t *v;
yajl_value_string_t *s;
v = value_alloc (YAJL_TYPE_STRING);
if (v == NULL)
return (STATUS_ABORT);
s = YAJL_TO_STRING (v);
s->value = malloc (string_length + 1);
if (s->value == NULL)
... | false | false | false | false | false | 0 |
fromDomElement(const QDomElement &element)
{
AlertTiming *timing = new AlertTiming;
if (element.tagName().compare(::XML_TIMING_ELEMENTTAG, Qt::CaseInsensitive)!=0)
return *timing;
if (!element.attribute("id").isEmpty())
timing->setId(element.attribute("id").toInt());
timing->setValid(ele... | false | false | false | false | false | 0 |
_dxf_SetType(Group g, Object o)
{
Type type;
Category category;
int rank, shape[100];
if (!DXGetType(o, &type, &category, &rank, shape)) {
DXResetError();
return OK;
}
RANKTEST(ERROR);
DXlock(&g->lock, 0);
if (!g->typed)
if (!DXSetGroupTypeV(g, type, category, rank, shape)) {
D... | false | false | false | false | false | 0 |
mime_patmatch(const char *s, /* I - String to match against */
const char *pat) /* I - Pattern to match against */
{
/*
* Range check the input...
*/
if (s == NULL || pat == NULL)
return (0);
/*
* Loop through the pattern and match strings, and stop if we come to a
* point where the st... | false | false | false | false | false | 0 |
create_proxy(DBusConnection *conn,
DBusMessage *msg, void *data)
{
struct serial_adapter *adapter = data;
struct serial_proxy *proxy;
const char *pattern, *address;
char *uuid_str;
int err;
if (!dbus_message_get_args(msg, NULL,
DBUS_TYPE_STRING, &pattern,
DBUS_TYPE_STRING, &address,
DBUS_TYPE_INV... | false | false | false | false | false | 0 |
wordpress_delete_post (Wordpress* self, gint id) {
SoupMessage* message;
SoupSessionAsync* session;
guint return_code;
g_return_if_fail (self != NULL);
message = _g_object_ref0 (soup_xmlrpc_request_new (self->server, "metaWeblog.deletePost", G_TYPE_INT, 1, G_TYPE_INT, id, G_TYPE_STRING, self->priv->_username, G_TY... | false | false | false | false | false | 0 |
get_pkcs7_from_part(long msgno,const char *section)
{
STORE_S *store = NULL;
PKCS7 *p7 = NULL;
BIO *in = NULL;
store = get_part_contents(msgno, section);
if(store){
if(store->src == CharStar){
int len;
/*
* We're reaching inside the STORE_S structure. We should
* proba... | false | false | false | false | false | 0 |
parse_url_value(Octstr *value, simple_binary_t **slbxml)
{
size_t i;
long pos;
Octstr *urlos,
*first_part,
*last_part;
size_t first_part_len;
i = 0;
first_part_len = 0;
first_part = NULL;
last_part = NULL;
while (i < NUMBER_OF_URL_VALUES) {
pos = octstr_search... | false | false | false | false | false | 0 |
get_gnome_document_font_description()
{
try {
Glib::RefPtr<Gio::Settings> desktop_settings = Preferences::obj()
.get_schema_settings(Preferences::SCHEMA_DESKTOP_GNOME_INTERFACE);
if(desktop_settings) {
std::string doc_font_string =
desktop_settings->get_string(Preferences::DE... | false | false | false | false | false | 0 |
SetFlags(int flags)
{
if (m_pSocketThread)
m_pSocketThread->m_sync.Lock();
if (m_fd != -1)
DoSetFlags(m_fd, flags, flags ^ m_flags);
m_flags = flags;
if (m_pSocketThread)
m_pSocketThread->m_sync.Unlock();
} | false | false | false | false | false | 0 |
xfs_dev_read(ExtFile *fp, memptr buffer, uint32 count)
{
uint8 fBuff[ FRDWR_BUFFER_LENGTH ];
memptr destBuff = buffer;
ssize_t readCount = 0;
ssize_t toRead = count;
ssize_t toReadNow;
D(bug("HOSTFS: dev_read (fd = %d, %d)", fp->hostFd, count));
while ( toRead > 0 ) {
toReadNow = ( toRead > FRDWR_BUFFER_LEN... | false | false | false | false | false | 0 |
_json_stringify_array(Str** dst, const Json_value* v)
{
str_append_char(dst, '[');
int first = 1;
Json_iterator* i = json_iterator_create(v);
for (; json_iterator_is_valid(i); json_iterator_advance(i)) {
if (first) {
first = 0;
} else {
str_append_cstr(dst, ", ");... | false | false | false | false | false | 0 |
_edit_jobs(GtkTreeModel *model, GtkTreeIter *iter,
char *type, GtkTreeView *treeview)
{
jobs_foreach_common_t job_foreach_common;
global_error_code = SLURM_SUCCESS;
/* setup params that applies to ALL selections */
memset(&job_foreach_common, 0, sizeof(jobs_foreach_common_t));
job_foreach_common.type = ty... | false | false | false | false | false | 0 |
channel_sync(CHANNEL_REC *channel)
{
g_return_if_fail(channel != NULL);
printformat(channel->server, channel->visible_name,
MSGLEVEL_CLIENTNOTICE|MSGLEVEL_NO_ACT,
IRCTXT_CHANNEL_SYNCED, channel->visible_name,
(long) (time(NULL)-channel->createtime));
} | false | false | false | false | false | 0 |
load_legacy (uint32_t arg_version, std::istream& in)
{
version = arg_version;
// First comes the AES key
in.read(reinterpret_cast<char*>(aes_key), AES_KEY_LEN);
if (in.gcount() != AES_KEY_LEN) {
throw Malformed();
}
// Then the HMAC key
in.read(reinterpret_cast<char*>(hmac_key), HMAC_KEY_LEN);
if (in.gcount... | false | false | false | false | false | 0 |
editor_draw_selrect(void)
{
if (!editor) {
return;
}
if (editor->selrect_active && editor->selrect_width > 0
&& editor->selrect_height > 0) {
draw_selection_rectangle(editor->selrect_x,
editor->selrect_y,
editor->selrect_width,
... | false | false | false | false | false | 0 |
create_model_exit_path(object *pl_objp, object *mobjp, int path_num, int count)
{
ship *shipp = &Ships[pl_objp->instance];
ai_info *aip = &Ai_info[shipp->ai_index];
polymodel *pm = model_get(Ship_info[Ships[mobjp->instance].ship_info_index].model_num);
int num_points;
model_path *mp;
pnode *ppfp_start = ... | false | false | false | false | false | 0 |
seqReadGcg(AjPSeq thys, AjPSeqin seqin)
{
AjBool ok;
ajuint len = 0;
AjBool incomment = ajFalse;
AjPFilebuff buff;
buff = seqin->Input->Filebuff;
ok = ajTextinStoreReadline(seqin->Input, &seqReadLine, &thys->TextPtr);
while (ok && ajStrIsWhite(seqReadLine))
{
ajTextinSto... | false | false | false | false | false | 0 |
parse_header_mpeg4(bgav_video_parser_t * parser)
{
mpeg4_priv_t * priv = parser->priv;
const uint8_t * pos = parser->s->ext_data;
int len;
while(1)
{
pos = bgav_mpv_find_startcode(pos, parser->s->ext_data +
parser->s->ext_size);
if(!pos)
return priv->have_vo... | false | false | false | false | false | 0 |
isl_map_local_affine_hull(__isl_take isl_map *map)
{
int i;
map = isl_map_cow(map);
if (!map)
return NULL;
for (i = 0; i < map->n; ++i) {
map->p[i] = isl_basic_map_affine_hull(map->p[i]);
map->p[i] = isl_basic_map_gauss(map->p[i], NULL);
map->p[i] = isl_basic_map_make_strides_explicit(map->p[i]);
if (!m... | false | false | false | false | true | 1 |
_e_wid_disable_hook(Evas_Object *obj)
{
E_Widget_Data *wd;
wd = e_widget_data_get(obj);
if (e_widget_disabled_get(obj))
edje_object_signal_emit(wd->o_button, "e,state,disabled", "e");
else
edje_object_signal_emit(wd->o_button, "e,state,enabled", "e");
} | false | false | false | false | false | 0 |
type() const {
if (code>=100 && code<200)
return HTTP_RESPONSE_INFORMATIONAL;
else if (code>=200 && code<300)
return HTTP_RESPONSE_SUCCESS;
else if (code>=300 && code<400)
return HTTP_RESPONSE_REDIRECT;
else if (code>=400 && code<500)
return HTTP_RESPONSE_CLIENT_ERROR;
else if (code>=500 && co... | false | false | false | false | false | 0 |
afs_proc_cell_servers_start(struct seq_file *m, loff_t *_pos)
__acquires(m->private->servers_lock)
{
struct afs_cell *cell = m->private;
_enter("cell=%p pos=%Ld", cell, *_pos);
/* lock the list against modification */
read_lock(&cell->servers_lock);
return seq_list_start_head(&cell->servers, *_pos);
} | false | false | false | false | false | 0 |
H5P_object_verify(hid_t plist_id, hid_t pclass_id)
{
H5P_genplist_t *ret_value; /* return value */
FUNC_ENTER_NOAPI(H5P_object_verify, NULL)
/* Compare the property list's class against the other class */
if(H5P_isa_class(plist_id, pclass_id) != TRUE)
HGOTO_ERROR(H5E_PLIST, H... | false | false | false | false | false | 0 |
event_silence_list(IRC_SERVER_REC *server, const char *data)
{
char *params, *nick, *mask;
g_return_if_fail(data != NULL);
params = event_get_params(data, 3, NULL, &nick, &mask);
printformat(server, NULL, MSGLEVEL_CRAP,
IRCTXT_SILENCE_LINE, nick, mask);
g_free(params);
} | false | false | false | false | false | 0 |
gst_frei0r_mixer_src_query_latency (GstFrei0rMixer * self, GstQuery * query)
{
GstClockTime min, max;
gboolean live;
gboolean res;
GstIterator *it;
gboolean done;
res = TRUE;
done = FALSE;
live = FALSE;
min = 0;
max = GST_CLOCK_TIME_NONE;
/* Take maximum of all latency values */
it = gst_elem... | false | false | false | false | false | 0 |
post_request(const FXString & url,const FXString & message,FXString & output) {
FXTRACE((60,"post_request %s - %s\n",url.text(),message.text()));
HttpClient client;
if (client.basic("POST",url,
"Content-Type: application/x-www-form-urlencoded\r\n"
"Connection: close\r\n... | false | false | false | false | false | 0 |
update_apcupsd(void) {
int i;
APCUPSD_S apc;
int sock;
for (i = 0; i < _APCUPSD_COUNT; ++i)
memcpy(apc.items[i], "N/A", 4); // including \0
do {
struct hostent* he = 0;
struct sockaddr_in addr;
short sz = 0;
#ifdef HAVE_GETHOSTBYNAME_R
struct hostent he_mem;
int he_errno;
char hostbuff[2048];
#end... | true | true | false | false | false | 1 |
ssl_sock_crt2der(X509 *crt, struct chunk *out)
{
int len;
unsigned char *p = (unsigned char *)out->str;;
len =i2d_X509(crt, NULL);
if (len <= 0)
return 1;
if (out->size < len)
return -1;
i2d_X509(crt,&p);
out->len = len;
return 1;
} | false | false | false | false | false | 0 |
get_sockstat_line(char *line, struct sockstat *s)
{
char id[256], rem[256];
if (sscanf(line, "%[^ ] %[^\n]\n", id, rem) != 2)
return;
if (strcmp(id, "sockets:") == 0)
sscanf(rem, "%*s%d", &s->socks);
else if (strcmp(id, "UDP:") == 0)
sscanf(rem, "%*s%d", &s->udp4);
else if (strcmp(id, "UDP6:") == 0)
ssca... | true | true | false | false | false | 1 |
btree_write_alias(struct super_block *sb, struct logfs_block *block,
write_alias_t *write_one_alias)
{
struct object_alias_item *item;
int err;
list_for_each_entry(item, &block->item_list, list) {
err = write_alias_journal(sb, block->ino, block->bix,
block->level, item->child_no, item->val);
if (err)
r... | false | false | false | false | false | 0 |
cib_remote_new(const char *server, const char *user, const char *passwd, int port,
gboolean encrypted)
{
cib_remote_opaque_t *private = NULL;
cib_t *cib = cib_new_variant();
private = calloc(1, sizeof(cib_remote_opaque_t));
cib->variant = cib_remote;
cib->variant_opaque = private;
... | false | false | false | false | false | 0 |
leakless_equals_char (const unsigned char* a, const unsigned char* b, std::size_t len)
{
volatile int diff = 0;
while (len > 0) {
diff |= *a++ ^ *b++;
--len;
}
return diff == 0;
} | false | false | false | false | false | 0 |
transmit_notify_request (void *cls, size_t size, void *buf)
{
struct GNUNET_PEERINFO_NotifyContext *nc = cls;
struct GNUNET_MessageHeader hdr;
nc->init = NULL;
if (buf == NULL)
{
GNUNET_CLIENT_disconnect (nc->client);
nc->client = GNUNET_CLIENT_connect ("peerinfo", nc->cfg);
request_notifications... | false | false | false | false | false | 0 |
copy()
{
if ( m_extensionProxy )
{
callExtensionProxyMethod( "copy" );
return;
}
if ( !m_editableFormWidget )
{
// get selected text and paste to the clipboard
QString text = m_part->selectedText();
text.replace( QChar( 0xa0 ), ' ' );
//kDebug(6050) <... | false | false | false | false | false | 0 |
boundaryToPdfRectangle(const QRectF &r, int flags) const
{
Q_ASSERT ( pdfPage );
const int pageRotate = pdfPage->getRotate();
double MTX[6];
fillNormalizationMTX( MTX, pageRotate );
double tl_x, tl_y, br_x, br_y, swp;
XPDFReader::invTransform( MTX, r.topLeft(), tl_x, tl_y );
XPDFReader::i... | false | false | false | true | false | 1 |
ED4_remove_faligner_entries(AW_window *, AW_CL, AW_CL) {
GB_ERROR error = GB_begin_transaction(GLOBAL_gb_main);
if (!error) error = ED4_with_all_loaded_species(ED4_delete_temp_entries, (void**)ED4_ROOT->alignment_name);
GB_end_transaction_show_error(GLOBAL_gb_main, error, aw_message);
} | false | false | false | false | false | 0 |
mark_thread_hot(ARTICLE *art, Pixmap pixmap)
{
long n = 0;
while (art) {
if (art->from && art->pixmap == None) {
art->pixmap = pixmap;
if (!art->read)
n++;
}
art = next_in_thread_preorder(art);
}
return n;
} | false | true | false | false | true | 1 |
dir_file(const char *dir,const char *file)
{
if(dir==0 || dir[0]==0)
return file?file:dir;
if(file && file[0]=='.' && file[1]=='/')
file+=2;
if(file==0 || file[0]==0)
return dir;
if(file[0]=='/')
return file;
xstring& buf=xstring::get_tmp();
size_t len=strlen(dir);
if(len==... | false | false | false | false | false | 0 |
insertNoop(MachineBasicBlock &MBB,
MachineBasicBlock::iterator MI) const {
// This function is used for scheduling, and the nop wanted here is the type
// that terminates dispatch groups on the POWER cores.
unsigned Directive = Subtarget.getDarwinDirective();
unsigned Opcode;
swi... | false | false | false | false | false | 0 |
js_pg_get_jobs_cond(pgsql_conn_t *pg_conn, uid_t uid,
slurmdb_job_cond_t *job_cond)
{
int is_admin = 1, only_pending = 0;
slurmdb_user_rec_t user;
List job_list = list_create(slurmdb_destroy_job_rec);
char *cond = NULL, *extra_table = NULL;
if(check_db_connection(pg_conn) != SLURM_SUCCESS)
return NULL;
... | false | false | false | false | true | 1 |
operator%(const SignExtendedNumber& a) const
{
if (a.value == 0)
return !a.negative ? a : isMinimum() ? SignExtendedNumber(0) : *this;
uinteger_t aAbs = copySign(a.value, a.negative);
uinteger_t rvVal;
// a % b == sgn(a) * abs(a) % abs(b).
if (!isMinimum())
rvVal = copySign(value, ... | false | false | false | false | false | 0 |
get_key_value(const TreeModel::iterator& iter) const
{
if(check_treeiter_validity(iter))
{
type_datamodel_row_index datamodel_row = get_datamodel_row_index_from_tree_row_iter(iter);
type_map_rows::iterator iterFind = m_map_rows.find(datamodel_row);
if(iterFind != m_map_rows.end())
return iterFind-... | false | false | false | false | false | 0 |
GetVLDSTAlign(SDValue Align, unsigned NumVecs,
bool is64BitVector) {
unsigned NumRegs = NumVecs;
if (!is64BitVector && NumVecs < 3)
NumRegs *= 2;
unsigned Alignment = cast<ConstantSDNode>(Align)->getZExtValue();
if (Alignment >= 32 && NumRegs == 4)
Alignment = 32;... | false | false | false | false | false | 0 |
addToHistogram(unsigned int* histogram,
unsigned char* array, int narray) {
while (narray>0) {
++histogram[*array];
++array;
--narray;
}
} | false | false | false | false | false | 0 |
cgraph_materialize_clone (struct cgraph_node *node)
{
bitmap_obstack_initialize (NULL);
node->former_clone_of = node->clone_of->decl;
if (node->clone_of->former_clone_of)
node->former_clone_of = node->clone_of->former_clone_of;
/* Copy the OLD_VERSION_NODE function tree to the new version. */
tree_functi... | false | false | false | false | false | 0 |
DXQueryPickCount(Field p, int poke, int *nPicks)
{
Array pokes;
Array picks;
int nPokes, thisStart, nextStart;
if (DXEmptyField(p))
{
DXSetError(ERROR_BAD_PARAMETER, "non-existent poke");
return ERROR;
}
pokes = (Array)DXGetComponentValue(p, "pokes");
picks = (Array)DXGetComponentV... | false | false | false | false | false | 0 |
cso_hash_take(struct cso_hash *hash,
unsigned akey)
{
struct cso_node **node = cso_hash_find_node(hash, akey);
if (*node != hash->data.e) {
void *t = (*node)->value;
struct cso_node *next = (*node)->next;
cso_free_node(*node);
*node = next;
--hash->data.d->size;... | false | false | false | false | false | 0 |
_zd_iowrite32v_async_locked(struct zd_chip *chip,
const struct zd_ioreq32 *ioreqs,
unsigned int count)
{
int i, j, r;
struct zd_ioreq16 ioreqs16[USB_MAX_IOWRITE32_COUNT * 2];
unsigned int count16;
/* Use stack for values and addresses. */
ZD_ASSERT(mutex_is_locked(&chip->mutex));
if (coun... | false | false | false | false | false | 0 |
FTPParseResponse(fi)
FTPInfo *fi;
{
char *cp;
char *b = (char *)fi->cb;
size_t len = fi->cblen;
if (b[len - 1] == '\n')
{
if (*(b + 3) == ' ') return(atoi(b));
for (cp = b + len - 2; cp >= b; cp--)
{
if (*cp == '\n' && *(cp + 4) == ' ') return(atoi(cp + 1));
}
}
return(-1);
} | false | false | false | false | false | 0 |
__inode_link (inode_t *inode, inode_t *parent, const char *name,
struct iatt *iatt)
{
dentry_t *dentry = NULL;
dentry_t *old_dentry = NULL;
inode_t *old_inode = NULL;
inode_table_t *table = NULL;
inode_t *link_inode = NULL;
if (!inode)... | false | false | false | false | false | 0 |
_ibus_get_active_engines (BusIBusImpl *ibus,
GDBusConnection *connection,
GError **error)
{
GVariantBuilder builder;
GList *p;
if (error) {
*error = NULL;
}
g_variant_builder_init (&builder, G_VARIANT_TYPE ("av"));
for (p... | false | false | false | false | false | 0 |
on_system_prompt_open_for_initial_sign_in (GcrSystemPrompt *system_prompt,
GAsyncResult *result,
GSimpleAsyncResult *operation_result)
{
GCancellable *cancellable;
GcrPrompt *prompt;
GError *error;
cancel... | false | false | false | false | false | 0 |
pg_fe_getauthname(PQExpBuffer errorMessage)
{
const char *name = NULL;
char *authn;
#ifdef WIN32
char username[128];
DWORD namesize = sizeof(username) - 1;
#else
char pwdbuf[BUFSIZ];
struct passwd pwdstr;
struct passwd *pw = NULL;
#endif
/*
* Some users are using configure --enable-thread-safety-force... | false | false | false | false | false | 0 |
spl_ptr_llist_shift(spl_ptr_llist *llist TSRMLS_DC) /* {{{ */
{
void *data;
spl_ptr_llist_element *head = llist->head;
if (head == NULL) {
return NULL;
}
if (head->next) {
head->next->prev = NULL;
} else {
llist->tail = NULL;
}
llist->head = head->next;
llist->count--;
data = hea... | false | false | false | false | false | 0 |
gst_timed_value_control_source_unset_all (GstTimedValueControlSource * self)
{
g_return_if_fail (GST_IS_TIMED_VALUE_CONTROL_SOURCE (self));
g_mutex_lock (&self->lock);
/* free GstControlPoint structures */
if (self->values) {
g_sequence_free (self->values);
self->values = NULL;
}
self->nvalues = 0;... | false | false | false | false | false | 0 |
queueSlot()
{
QMutexLocker locker(&mutex);
bool stateChanged = false;
if (!lockCount && !lockThread && !hopEvent && !pauseLoop)
stateChanged = ready_sub(this, locker);
locker.unlock();
if (stateChanged)
emit q->stateChanged(QtLuaEngine::Ready);
} | false | false | false | false | false | 0 |
jpu_stop_streaming(struct vb2_queue *vq)
{
struct jpu_ctx *ctx = vb2_get_drv_priv(vq);
struct vb2_v4l2_buffer *vb;
unsigned long flags;
for (;;) {
if (V4L2_TYPE_IS_OUTPUT(vq->type))
vb = v4l2_m2m_src_buf_remove(ctx->fh.m2m_ctx);
else
vb = v4l2_m2m_dst_buf_remove(ctx->fh.m2m_ctx);
if (vb == NULL)
ret... | 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.