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 |
|---|---|---|---|---|---|---|
http_server_error(struct session *t, struct stream_interface *si,
int err, int finst, int status, const struct chunk *msg)
{
buffer_auto_read(si->ob);
buffer_abort(si->ob);
buffer_auto_close(si->ob);
buffer_erase(si->ob);
buffer_auto_close(si->ib);
buffer_auto_read(si->ib);
if (status > 0 && msg) {
t-... | false | false | false | false | false | 0 |
request(Requisition& requisition) const {
Coord height = ascent_ + descent_;
float alignment = (height == 0) ? 0 : descent_ / height;
Requirement rx(width_, 0, 0, 0);
Requirement ry(height, 0, 0, alignment);
requisition.require(Dimension_X, rx);
requisition.require(Dimension_Y, ry);
} | false | false | false | false | false | 0 |
createPatches()
{
TerrainData.PatchCount = (TerrainData.Size - 1) / (TerrainData.CalcPatchSize);
if (TerrainData.Patches)
delete [] TerrainData.Patches;
TerrainData.Patches = new SPatch[TerrainData.PatchCount * TerrainData.PatchCount];
} | false | false | false | false | false | 0 |
constructor (GType type,
guint n_construct_params,
GObjectConstructParam *construct_params)
{
GObject *object;
NMDevice *dev;
NMDevicePrivate *priv;
object = G_OBJECT_CLASS (nm_device_parent_class)->constructor (type,
n_construct_params,
... | false | false | false | false | false | 0 |
getAlphanumeric(int num)
{
// convert the number from base ten to base 26, that is the
// alphanumeric range A-Z
const int numAscii = 26;
const int startAscii = 65;
if (num == 0)
return "A";
string res;
// perform the conversion and build the string
while (num > 0)
{
res += static_cast... | false | false | false | false | false | 0 |
get_stack_local_alignment (tree type, enum machine_mode mode)
{
unsigned int alignment;
if (mode == BLKmode)
alignment = BIGGEST_ALIGNMENT;
else
alignment = GET_MODE_ALIGNMENT (mode);
/* Allow the frond-end to (possibly) increase the alignment of this
stack slot. */
if (! type)
type = lang... | false | false | false | false | false | 0 |
term_ident(Term t1, Term t2)
{
if (t1->private_symbol != t2->private_symbol)
return 0;
else {
int i;
for (i = 0; i < ARITY(t1); i++)
if (!term_ident(ARG(t1,i), ARG(t2,i)))
return 0;
return 1;
}
} | false | false | false | false | false | 0 |
build_loop_info(struct radeon_compiler * c, struct loop_info * loop,
struct rc_instruction * inst)
{
struct rc_instruction * ptr;
if(inst->U.I.Opcode != RC_OPCODE_BGNLOOP){
rc_error(c, "%s: expected BGNLOOP", __FUNCTION__);
return 0;
}
memset(loop, 0, sizeof(struct loop_info));
loop->BeginLoop = inst;... | false | false | false | false | false | 0 |
grl_operation_options_obey_caps (GrlOperationOptions *options,
GrlCaps *caps,
GrlOperationOptions **supported_options,
GrlOperationOptions **unsupported_options)
{
gboolean ret = TRUE;
GHashTableIter table_iter;
gpo... | false | false | false | false | false | 0 |
summary_sort_by_column_click(SummaryView *summaryview,
FolderSortKey sort_key)
{
GtkCMCTreeNode *node = NULL;
START_TIMING("");
if (summaryview->sort_key == sort_key)
summary_sort(summaryview, sort_key,
summaryview->sort_type == SORT_ASCENDING
? SORT_DESCENDING : SORT_ASCENDING);
else
summ... | false | false | false | false | false | 0 |
_da_free_content (struct darray * arr, da_map_func_t free_func)
{
size_t i;
if (free_func)
for (i = 0 ; i < arr->len ; i++)
(*free_func) (arr->content [i]);
arr->len = 0;
} | false | false | false | false | false | 0 |
wf_gspset (xorder, yorder, xterms, coeff)
int xorder;
int yorder;
int xterms;
double *coeff;
{
struct IRAFsurface *sf; /* surface descriptor */
int surface_type, order, i;
double xmin, xmax;
double ymin, ymax;
surface_type = TNX_POLYNOMIAL;
xmin = 0.0;
xmax = 0.0;
ymin = 0.0;
ymax ... | false | true | false | false | false | 1 |
reset_gui() {
line_numbers(_conf.get("linenumbers", false));
std::string df = Utils::katoob_get_default_font();
if (_conf.get("default_font", true)) {
Pango::FontDescription fd(df);
_text_view.modify_font(fd);
}
else {
std::string font = _conf.get("font", df);
Pango::FontDescription fd(font);... | false | false | false | false | false | 0 |
snd_cmipci_clear_bit_b(struct cmipci *cm, unsigned int cmd, unsigned char flag)
{
unsigned char val, oval;
val = oval = inb(cm->iobase + cmd);
val &= ~flag;
if (val == oval)
return 0;
outb(val, cm->iobase + cmd);
return 1;
} | false | false | false | false | false | 0 |
make_bounded_heap(Tuplesortstate *state)
{
int tupcount = state->memtupcount;
int i;
Assert(state->status == TSS_INITIAL);
Assert(state->bounded);
Assert(tupcount >= state->bound);
/* Reverse sort direction so largest entry will be at root */
REVERSEDIRECTION(state);
state->memtupcount = 0; /* make the ... | false | false | false | false | false | 0 |
prompt_empty_trash (GtkWindow *parent_window)
{
gint result;
GtkWidget *dialog;
GdkScreen *screen;
screen = NULL;
if (parent_window != NULL) {
screen = gtk_widget_get_screen (GTK_WIDGET (parent_window));
}
/* Do we need to be modal ? */
dialog = gtk_message_dia... | false | false | false | false | false | 0 |
drct_set_volume_balance (int balance)
{
int left, right;
drct_get_volume_main (& left);
if (balance < 0)
right = left * (100 + balance) / 100;
else
{
right = left;
left = right * (100 - balance) / 100;
}
drct_set_volume (left, right);
} | false | false | false | false | false | 0 |
lola_enable_clock_events(struct lola *chip)
{
unsigned int res;
int err;
err = lola_codec_read(chip, chip->clock.nid,
LOLA_VERB_SET_UNSOLICITED_ENABLE,
LOLA_UNSOLICITED_ENABLE | LOLA_UNSOLICITED_TAG,
0, &res, NULL);
if (err < 0)
return err;
if (res) {
dev_warn(chip->card->dev, "erro... | false | false | false | false | false | 0 |
xtensa_colocate_literals (reloc_deps_graph *deps,
lang_statement_union_type *statement)
{
/* Keep a stack of pointers to control iteration through the contours. */
xtensa_ld_iter_stack *stack = NULL;
xtensa_ld_iter_stack **stack_p = &stack;
xtensa_ld_iter front; /* Location where new insertion should oc... | false | false | false | false | false | 0 |
PyModule_NewObject(PyObject *name)
{
PyModuleObject *m;
m = PyObject_GC_New(PyModuleObject, &PyModule_Type);
if (m == NULL)
return NULL;
m->md_def = NULL;
m->md_state = NULL;
m->md_dict = PyDict_New();
if (m->md_dict == NULL)
goto fail;
if (PyDict_SetItemString(m->md_dict... | false | false | false | false | false | 0 |
phone_read(struct ast_channel *ast)
{
int res;
struct phone_pvt *p = ast_channel_tech_pvt(ast);
/* Some nice norms */
p->fr.datalen = 0;
p->fr.samples = 0;
p->fr.data.ptr = NULL;
p->fr.src = "Phone";
p->fr.offset = 0;
p->fr.mallocd=0;
p->fr.delivery = ast_tv(0,0);
/* Try to read some data... */
CHECK_B... | false | false | false | false | false | 0 |
connected_local_accounts(void)
{
int n = 0;
LList *node = NULL;
for (node = accounts; node; node = node->next) {
eb_local_account *ela = node->data;
if (ela->connected || ela->connecting) {
n++;
eb_debug(DBG_CORE, "%s: connected=%d, connecting=%d\n",
ela->handle, ela->connected, ela->connecting);
}
... | false | false | false | false | false | 0 |
print_mtg_id_for_layer_ctrl(Ctrl_task *c)
{
Block_info *b_info = ctrl_task_get_b_info(c);
Block *block = block_info_get_block(b_info);
int mtg_id = -1;
if (block->hmdf != NULL) mtg_id = block->hmdf->mtg_id;
if (mtg_id != -1) fprintf(info_fp, "##### mtg_id : %d #####\n", mtg_id);
} | false | false | false | false | false | 0 |
hi8435_get_sensing_mode(struct iio_dev *idev,
const struct iio_chan_spec *chan)
{
struct hi8435_priv *priv = iio_priv(idev);
int ret;
u8 reg;
ret = hi8435_readb(priv, HI8435_PSEN_REG, ®);
if (ret < 0)
return ret;
return !!(reg & BIT(chan->channel / 8));
} | false | false | false | false | false | 0 |
dom_node_local_name_read(dom_object *obj, zval **retval TSRMLS_DC)
{
xmlNode *nodep;
nodep = dom_object_get_node(obj);
if (nodep == NULL) {
php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
return FAILURE;
}
ALLOC_ZVAL(*retval);
if (nodep->type == XML_ELEMENT_NODE || nodep->type == XML_ATTRIBUTE_NODE |... | false | false | false | false | false | 0 |
listen_for_address_events(QofInstance *entity, QofEventId event_type,
gpointer user_data, gpointer event_data)
{
GncCustomer* cust;
if ((event_type & QOF_EVENT_MODIFY) == 0)
{
return;
}
if (!GNC_IS_ADDRESS(entity))
{
return;
}
if (!GNC_IS_CUSTOM... | false | false | false | false | false | 0 |
tz_load_db (void)
{
gchar *tz_data_file;
TzDB *tz_db;
FILE *tzfile;
char buf[4096];
tz_data_file = tz_data_file_get ();
if (!tz_data_file) {
g_warning ("Could not get the TimeZone data file name");
return NULL;
}
tzfile = fopen (tz_data_file, "r");
if (!tzfile) {
g_warning ("Could not open *%s*\n", tz_d... | false | false | false | false | false | 0 |
rotate_right(erbtree_t *tree, rbnode_t *node)
{
rbnode_t *p = node;
rbnode_t *q = node->left; /* can't be NULL */
rbnode_t *parent = get_parent(p);
g_assert(q != NULL);
if (!is_root(p)) {
if (parent->left == p)
parent->left = q;
else
parent->right = q;
} else
tree->root = q;
set_parent(q, parent);
... | false | false | false | false | false | 0 |
set_parent(struct patricia_node *pn, struct patricia_node *parent)
{
patricia_node_check(pn);
if (pn->has_embedded_data) {
g_assert(!pn->leaf);
pn->p.ext->parent = parent;
} else {
pn->p.parent = parent;
}
g_assert(parent_node(pn) == parent);
} | false | false | false | false | false | 0 |
general_stack_init_fd(struct general_stack *stack, int count)
{
int ret;
ret = general_stack_init(stack, count);
if (ret < 0)
{
return ret;
}
stack->top = count;
return 0;
} | false | false | false | false | false | 0 |
upnp_dscv_next_ctrl(struct upnp_ctrl_context *ucd_ctx)
{
struct upnp_dscv_ctrl *dc;
struct upnp_mcb *mcb;
g_assert(size_is_non_negative(ucd_ctx->probe_idx));
g_assert(ucd_ctx->probe_idx <= G_N_ELEMENTS(upnp_dscv_probes));
mcb = ucd_ctx->mcb;
upnp_mcb_check(mcb);
/*
* The index of the next command to launch ... | false | false | false | false | false | 0 |
ini_comment_create(struct ini_comment **ic)
{
int error = EOK;
struct ref_array *ra = NULL;
struct ini_comment *ic_new = NULL;
TRACE_FLOW_ENTRY();
error = ref_array_create(&ra,
sizeof(struct simplebuffer *),
INI_COMMENT_BLOCK,
... | false | false | false | false | false | 0 |
ns_name_ntop(const u_char *src, char *dst, size_t dstsiz)
{
const u_char *cp;
char *dn, *eom;
u_char c;
u_int n;
int l;
cp = src;
dn = dst;
eom = dst + dstsiz;
while ((n = *cp++) != 0) {
if ((n & NS_CMPRSFLGS) == NS_CMPRSFLGS) {
/* Some kind of compression pointer. */
__set_errno (EMSGSIZE);
retur... | false | false | false | false | false | 0 |
EvaluateToIndex(const InputType & input) const
{
IndexType index = GetStart();
// Iterate through the chaincode, summing the offsets as we go.
for ( InputType i = 0; i < input; i++ )
{
index += DecodeOffset(m_Chain2D[i]);
}
return index;
} | false | false | false | false | false | 0 |
png_handle_oFFs(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
{
png_byte buf[9];
png_int_32 offset_x, offset_y;
int unit_type;
png_debug(1, "in png_handle_oFFs");
if (!(png_ptr->mode & PNG_HAVE_IHDR))
png_error(png_ptr, "Missing IHDR before oFFs");
else if (png_ptr->mode & PNG_... | false | false | false | false | false | 0 |
realParseTable(struct SResource *table, char *tag, uint32_t startline, UErrorCode *status)
{
struct SResource *member = NULL;
struct UString *tokenValue=NULL;
struct UString comment;
enum ETokenType token;
char subtag[1024];
uint32_t line;
UBool rea... | false | false | false | false | false | 0 |
xmms_xform_metadata_get_int (xmms_xform_t *xform, const char *key,
gint32 *val)
{
const xmmsv_t *obj;
gboolean ret = FALSE;
obj = xmms_xform_metadata_get_val (xform, key);
if (obj && xmmsv_get_type (obj) == XMMSV_TYPE_INT32) {
xmmsv_get_int (obj, val);
ret = TRUE;
}
return ret;
... | false | false | false | false | false | 0 |
print_err_status(struct cx231xx *dev, int packet, int status)
{
char *errmsg = "Unknown";
switch (status) {
case -ENOENT:
errmsg = "unlinked synchronuously";
break;
case -ECONNRESET:
errmsg = "unlinked asynchronuously";
break;
case -ENOSR:
errmsg = "Buffer error (overrun)";
break;
case -EPIPE:
errm... | false | false | false | false | false | 0 |
calculate_entity_id_counts (pstdout_state_t pstate,
ipmi_sdr_cache_ctx_t sdr_cache_ctx,
ipmi_sdr_parse_ctx_t sdr_parse_ctx,
struct sensor_entity_id_counts *entity_id_counts)
{
uint8_t sdr_record[IPMI_SDR_CACHE_MAX_SDR_RECORD_LENGTH];
... | false | false | false | false | false | 0 |
is_immediate_win() const {
// The position is an immediate win if it is white to move and the white
// pawn can be promoted without getting captured:
return
sideToMove == WHITE &&
square_rank(pawnSquare) == RANK_7 &&
(square_distance(blackKingSquare, pawnSquare+DELTA_N) > 1 ||
bit_i... | false | false | false | false | false | 0 |
icq_offline_message(session_t *s, unsigned char *buf, int len, private_data_t **info) {
/*
* SNAC(15,03)/0041 SRV_OFFLINE_MESSAGE Offline message response
*
* This is the server response to CLI_OFFLINE_MSGS_REQ SNAC(15,02)/003C.
* This snac contain single offline message that was sent by another user
* and b... | false | false | false | false | false | 0 |
wma_decode_frame(WMADecodeContext *s, int32_t *samples)
{
int ret, i, n, ch, incr;
int32_t *ptr;
fixed32 *iptr;
/* read each block */
s->block_num = 0;
s->block_pos = 0;
for(;;)
{
ret = wma_decode_block(s, samples);
if (ret < 0)
{
DEBUGF("wma_decod... | false | false | false | false | false | 0 |
SetDownloader(unsigned piece,unsigned block,const TorrentPeer *o,const TorrentPeer *n)
{
const TorrentPeer*& downloader=piece_info[piece]->downloader[block];
if(downloader==o)
downloader=n;
} | false | false | false | false | false | 0 |
av7110_vbi_reset(struct file *file)
{
struct saa7146_fh *fh = file->private_data;
struct saa7146_dev *dev = fh->dev;
struct av7110 *av7110 = (struct av7110*) dev->ext_priv;
dprintk(2, "%s\n", __func__);
av7110->wssMode = 0;
av7110->wssData = 0;
if (FW_VERSION(av7110->arm_app) < 0x2623)
return 0;
else
retur... | false | false | false | false | false | 0 |
CL_RunDLights (void)
{
int i;
cdlight_t *dl;
dl = cl_dlights;
for (i=0 ; i<MAX_DLIGHTS ; i++, dl++)
{
if (!dl->radius)
continue;
if (dl->die < cl.time)
{
dl->radius = 0;
return;
}
dl->radius -= cls.frametime*dl->decay;
if (dl->radius < 0)
dl->radius = 0;
}
} | false | false | false | false | false | 0 |
gerbv_drill_stats_new(void) {
gerbv_drill_stats_t *stats;
gerbv_drill_list_t *drill_list;
gerbv_error_list_t *error_list;
/* Malloc space for new stats struct. Return NULL if error. */
if ((stats = (gerbv_drill_stats_t *)g_malloc(sizeof(gerbv_drill_stats_t))) == NULL) {
return NULL;
}... | false | false | false | false | false | 0 |
visitTriangles(TriangleVisitor *triVisitor, bool includeFrame)
{
QuadEdgeStack edgeStack;
edgeStack.push(startingEdges[0]);
QuadEdgeSet visitedEdges;
while (!edgeStack.empty()) {
QuadEdge *edge = edgeStack.top();
edgeStack.pop();
if (visitedEdges.find(edge) == visitedEdges.end()) {
QuadEdge **triEdges =... | false | false | false | false | false | 0 |
hash_deinit(struct node *a) /* I - Hash table */
{
unsigned h; /* Looping var */
for (h = 0; h < HASH_M; h ++)
if (a[h].name)
{
free(a[h].name);
memset(a, 0, sizeof(struct node));
}
} | false | false | false | false | false | 0 |
giggle_git_config_get_field (GiggleGitConfig *config,
GiggleGitConfigField field)
{
GiggleGitConfigPriv *priv;
g_return_val_if_fail (GIGGLE_IS_GIT_CONFIG (config), NULL);
g_return_val_if_fail (field < G_N_ELEMENTS (fields), NULL);
priv = GET_PRIV (config);
return g_hash_table_lookup (priv->config,... | false | false | false | false | false | 0 |
aim_mpmsg_addascii(aim_session_t *sess, aim_mpmsg_t *mpm,
const char *ascii)
{
fu8_t *dup;
if (!(dup = strdup(ascii)))
return -1;
if (mpmsg_addsection(sess, mpm, 0x0000, 0x0000, dup,
strlen(ascii)) == -1) {
free(dup);
return -1;
}
return 0;
} | false | false | false | false | false | 0 |
handleCopyOut(PGconn *conn, FILE *copystream)
{
bool OK = true;
char *buf;
int ret;
PGresult *res;
for (;;)
{
ret = PQgetCopyData(conn, &buf, 0);
if (ret < 0)
break; /* done or error */
if (buf)
{
if (fwrite(buf, 1, ret, copystream) != ret)
{
if (OK) /* complain only once, kee... | false | false | false | false | false | 0 |
read_metadata_block_data_cuesheet_cb_(FLAC__IOHandle handle, FLAC__IOCallback_Read read_cb, FLAC__StreamMetadata_CueSheet *block)
{
unsigned i, len;
FLAC__Metadata_SimpleIteratorStatus status;
FLAC__byte buffer[1024]; /* MSVC needs a constant expression so we put a magic number and assert */
FLAC__ASSERT((FLAC__ST... | false | false | false | false | false | 0 |
appendStringIfHaveRoom(char* dest, const char* src, size_t destMaxLen,
size_t destCharsAlreadyUsed, int maxSrcLen)
{
size_t srcLen;
if(maxSrcLen == -1)
srcLen = strlen(src);
else
srcLen = maxSrcLen;
if(destCharsAlreadyUsed + srcLen > destMaxLen)
... | false | false | false | false | false | 0 |
logOptions (void) const
{
ArLog::log (ArLog::Terse, "Options for ArLCDConnector:");
ArLog::log(ArLog::Terse, "-lcdLogPacketsReceived");
ArLog::log(ArLog::Terse, "-lcdlpr");
ArLog::log(ArLog::Terse, "-lcdLogPacketsSent");
ArLog::log(ArLog::Terse, "-lcdlps");
ArLog::log (ArLog::Terse, "\nOptions shown are for c... | false | false | false | false | false | 0 |
allocate_itemsets()
{
register short *itemp;
register short *item_end;
register int symbol;
register int i;
register int count;
register int max;
register short *symbol_count;
count = 0;
symbol_count = NEW2(nsyms, short);
item_end = ritem + nitems;
for (itemp = ritem; itemp... | false | false | false | false | false | 0 |
dump_results(POOLMEM **buf)
{
int len;
POOLMEM *tmp;
if (!items) {
**buf = 0;
return 0;
}
len = Mmsg(buf, "# Plugin configuration file\n# Version %d\n", version);
tmp = get_pool_memory(PM_MESSAGE);
for (int i=0; items[i].name ; i++) {
if (items[i].found) {
items[i].hand... | false | false | false | false | false | 0 |
Create( void )
{
wxPanel * poPnl1;
// Create the overall panel and controls
poPnl1 = new wxPanel( this );
m_oPnlAmplitude.bCreate( poPnl1, ID_PNL_AMPLITUDE, 95 );
m_oPnlOffset .bCreate( poPnl1, ID_PNL_OFFSET, 95 );
m_oPnlAmplitude.bSetName( wxT("Amplitude") );
m_oPnlOffset .bSetName( wxT("DC Off... | false | false | false | false | false | 0 |
GTabSetDistributePixels(GTabSet *gts,int r, int widthdiff) {
int diff, off, i;
diff = widthdiff/(gts->rowstarts[r+1]-gts->rowstarts[r]);
off = widthdiff-diff*(gts->rowstarts[r+1]-gts->rowstarts[r]);
for ( i=gts->rowstarts[r]; i<gts->rowstarts[r+1]; ++i ) {
gts->tabs[i].width += diff;
if ( off ) {
... | false | false | false | false | false | 0 |
git_ignore__check_pathspec_for_exact_ignores(
git_repository *repo,
git_vector *vspec,
bool no_fnmatch)
{
int error = 0;
size_t i;
git_attr_fnmatch *match;
int ignored;
git_buf path = GIT_BUF_INIT;
const char *wd, *filename;
git_index *idx;
if ((error = git_repository__ensure_not_bare(
repo, "validate pa... | false | false | false | false | false | 0 |
mpw_make_same_type(mpw_ptr op1,mpw_ptr op2)
{
MAKE_COPY(op1->r);
MAKE_COPY(op2->r);
mpwl_make_same_type(op1->r,op2->r);
if (MPW_IS_COMPLEX (op1) || MPW_IS_COMPLEX (op2)) {
MAKE_COPY(op1->i);
MAKE_COPY(op2->i);
mpwl_make_same_type(op1->i,op2->i);
}
} | false | false | false | false | false | 0 |
H5FS_sect_unlink_rest(H5FS_t *fspace, const H5FS_section_class_t *cls,
H5FS_section_info_t *sect)
{
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT(H5FS_sect_unlink_rest)
/* Check arguments. */
HDassert(fspace);
HDassert(fspace->sinfo);
HDassert(cls);
HDa... | false | false | false | false | false | 0 |
bwGCs(Window win)
{
int len;
int n = 0;
struct data_set *p;
XGCValues v;
GC x;
v.function = GXcopy;
v.foreground = normPixel;
for (p = datasets; p != 0; p = p->next) {
len = dash[n++];
if (len < 0) {
n = 0;
len = dash[n++];
}
if (len == 0)
v.line_style = LineSolid;
else
v.line_style = Lin... | false | false | false | false | false | 0 |
save()
{
if (dd->name.isEmpty()) {
return UserShareNameInvalid;
} else if (dd->path.isEmpty()) {
return UserSharePathInvalid;
} else {
return KSambaShare::instance()->d_func()->add(*this);
}
} | false | false | false | false | false | 0 |
Dvd(x, y)
long x, y;
{
long z;
if (y == 0)
return x;
z = x / y;
if (((x >= 0) == (y >= 0)) || x-z*y == 0)
return z;
return z - 1;
} | false | false | false | false | false | 0 |
UnlockBlock( bool mark_dirty )
{
if( last_block_mutex == NULL )
return;
last_block_dirty |= mark_dirty;
last_block_mutex->Release();
} | false | false | false | false | false | 0 |
nextScanline()
{
// check if there are scanlines left at all, eventually write one
JSAMPLE * band = pimpl->bands.data();
if ( pimpl->info.next_scanline < pimpl->info.image_height ) {
if (setjmp(pimpl->err.buf))
vigra_fail( "error in jpeg_write_scanlines()" );
... | false | false | false | false | false | 0 |
fs_weekly_handler( xmlNodePtr node, gpointer data )
{
fsParseData *fspd = data;
GDate offset_date;
gboolean successful;
successful = dom_tree_generic_parse( node,
fs_union_dom_handlers,
fspd );
if ( !successful ... | false | false | false | false | false | 0 |
SeekToFirst() {
direction_ = kForward;
ClearSavedValue();
iter_->SeekToFirst();
if (iter_->Valid()) {
FindNextUserEntry(false, &saved_key_ /* temporary storage */);
} else {
valid_ = false;
}
} | false | false | false | false | false | 0 |
convert_arg_to_utf8 (const gunichar2 *arg, const gchar *arg_name)
{
gchar *utf8_ret;
if (arg == NULL) {
DEBUG ("%s: %s is NULL", __func__, arg_name);
SetLastError (ERROR_INVALID_NAME);
return NULL;
}
utf8_ret = mono_unicode_to_external (arg);
if (utf8_ret == NULL) {
DEBUG ("%s: unicode conversion of %s r... | false | false | false | false | false | 0 |
duplosig(losig_ptr, BKSIG_ptr, sigsize)
losig_list *losig_ptr;
ptype_list **BKSIG_ptr;
int sigsize;
{
ptype_list *ptype_ptr = NULL;
ptype_list *pt = NULL;
long index = losig_ptr->INDEX;
int i;
int low, high;
losig_list *ptsig = NULL;
losig_list *pthead = NULL;
ptype_ptr = *BKSIG_ptr;
low = (index %... | false | false | false | false | false | 0 |
gdImageGd (gdImagePtr im, FILE * outFile)
{
gdIOCtx *out = gdNewFileCtx (outFile);
if (out == NULL) return;
_gdImageGd (im, out);
out->gd_free (out);
} | false | false | false | false | false | 0 |
snd_hdac_override_parm(struct hdac_device *codec, hda_nid_t nid,
unsigned int parm, unsigned int val)
{
unsigned int verb = (AC_VERB_PARAMETERS << 8) | (nid << 20) | parm;
int err;
if (!codec->regmap)
return -EINVAL;
codec->caps_overwriting = true;
err = snd_hdac_regmap_write_raw(codec, verb, val);
code... | false | false | false | false | false | 0 |
check_corruption(struct ubi_device *ubi, struct ubi_vid_hdr *vid_hdr,
int pnum)
{
int err;
mutex_lock(&ubi->buf_mutex);
memset(ubi->peb_buf, 0x00, ubi->leb_size);
err = ubi_io_read(ubi, ubi->peb_buf, pnum, ubi->leb_start,
ubi->leb_size);
if (err == UBI_IO_BITFLIPS || mtd_is_eccerr(err)) {
/*
* B... | false | false | false | false | false | 0 |
count_all_subentries (rRCOEntry * entry)
{
uint32_t entries = entry->numSubentries;
rRCOEntry *rcoNode;
for (rcoNode = entry->firstChild; rcoNode; rcoNode = rcoNode->next)
entries += count_all_subentries (rcoNode);
return entries;
} | false | false | false | false | false | 0 |
dae_cb_scale(DaeGlobalData *global, DaeLocalData *local)
{
G3DObject *object = local->user_data;
G3DTransformation *transform;
gfloat x = 0.0, y = 0.0, z = 0.0;
gchar *next = NULL;
g_return_val_if_fail(object != NULL, FALSE);
transform = object->transformation;
if(transform == NULL) {
transform = g_new0(G3DT... | false | false | false | false | false | 0 |
Empty() const {
for (size_t i=0; i<ranges.size(); i++) {
if (!ranges[i].Empty())
return false;
}
return true;
} | false | false | false | false | false | 0 |
CopyStructureInternal(vtkMolecule *m, bool deep)
{
// Call superclass
if (deep)
{
this->Superclass::DeepCopy(m);
}
else
{
this->Superclass::ShallowCopy(m);
}
} | false | false | false | false | false | 0 |
findEmptySpaceLeft(){
// found the first left space symbol
int pos = text().rfind(' ', (m_start_pos + m_cursor_pos) > 0 ?
m_start_pos + m_cursor_pos - 1 : 0);
// do we have one more space symbol near?
int next_pos = -1;
while (pos > 0 && (next_pos = text().rfind('... | false | false | false | false | false | 0 |
prev_line_id(LINE_ID *line_id, int n)
{
int r;
if (line_id->id2 != uid) return 0;
ID i1 = line_id->id1;
if (i1 < (uint32)n) {
r = i1;
i1 = 0;
} else {
r = n;
i1 -= n;
}
if (r) line_id->id1 = i1;
return r;
} | false | false | false | false | false | 0 |
log_close(void)
{
size_t i;
for (i = 0; i < G_N_ELEMENTS(logfile); i++) {
struct logfile *lf = &logfile[i];
if (lf->path_is_atom)
atom_str_free_null(&lf->path);
}
log_inited = FALSE;
} | false | false | false | false | false | 0 |
matroska_execute_seekhead(MatroskaDemuxContext *matroska)
{
EbmlList *seekhead_list = &matroska->seekhead;
MatroskaSeekhead *seekhead = seekhead_list->elem;
uint32_t level_up = matroska->level_up;
int64_t before_pos = url_ftell(matroska->ctx->pb);
MatroskaLevel level;
int i;
for (i=0; i<see... | false | false | false | false | false | 0 |
histogram_selectivity(VariableStatData *vardata, FmgrInfo *opproc,
Datum constval, bool varonleft,
int min_hist_size, int n_skip)
{
double result;
Datum *values;
int nvalues;
/* check sanity of parameters */
Assert(n_skip >= 0);
Assert(min_hist_size > 2 * n_skip);
if (HeapTupleIsValid(varda... | false | false | false | false | false | 0 |
LLVMGetDiagInfoSeverity(LLVMDiagnosticInfoRef DI){
LLVMDiagnosticSeverity severity;
switch(unwrap(DI)->getSeverity()) {
default:
severity = LLVMDSError;
break;
case DS_Warning:
severity = LLVMDSWarning;
break;
case DS_Remark:
severity = LLVMDSRemark;
break;
c... | false | false | false | false | false | 0 |
jp_vlogf (int level, const char *format, va_list val) {
char real_buf[WRITE_MAX_BUF+32];
char *buf, *local_buf;
int size;
int len;
int r;
static FILE *fp=NULL;
static int err_count=0;
char ... | false | false | false | false | false | 0 |
cipher_setiv( CIPHER_HANDLE c, const byte *iv, unsigned ivlen )
{
memset( c->u_iv.iv, 0, c->blocksize );
if( iv ) {
if( ivlen != c->blocksize )
log_info("WARNING: cipher_setiv: ivlen=%u blklen=%u\n",
ivlen, (unsigned)c->blocksize );
if( ivlen > c->blocksize )
ivlen = c->blocksize;
memcpy(... | false | true | false | false | false | 1 |
SetBlocks(u32 _blocknumber,
u32 _blockcount,
vector<DataBlock>::iterator _sourceblocks,
vector<DataBlock>::iterator _targetblocks,
u64 blocksize)
{
firstblocknum... | false | false | false | false | false | 0 |
modbus_set_bits_from_byte(uint8_t *dest, int idx, const uint8_t value)
{
int i;
for (i=0; i < 8; i++) {
dest[idx+i] = (value & (1 << i)) ? 1 : 0;
}
} | false | false | false | false | false | 0 |
serverResponse(const char *msg)
{
goodDisconnect=true;
if (!myserver->socketEndEncryption())
{
myserver->socketDisconnect();
success("Ok");
}
} | false | false | false | false | false | 0 |
mono_class_from_typeref (MonoImage *image, guint32 type_token)
{
MonoError error;
MonoClass *klass = mono_class_from_typeref_checked (image, type_token, &error);
g_assert (mono_error_ok (&error)); /*FIXME proper error handling*/
return klass;
} | false | false | false | false | false | 0 |
get_prop_name_from_tree_model (GtkTreeModel *model, const gchar *path)
{
GtkTreeIter iter;
gchar *prop_name = NULL;
/* TODO: don't assume column 0 to contain the prop name */
if (gtk_tree_model_get_iter_from_string (model, &iter, path))
gtk_tree_model_get (model, &iter, 0, &prop_name, -1);
... | false | false | false | false | false | 0 |
m_emit_conc_stat (pIIR_ConcurrentGenerateStatement gs, int l)
{
printf ("generate ");
if (gs->is(IR_CONCURRENT_GENERATE_IF_STATEMENT))
{
printf ("if ");
emit (pIIR_ConcurrentGenerateIfStatement(gs)->condition);
}
else if (gs->is(IR_CONCURRENT_GENERATE_FOR_STATEMENT))
{
pIIR_Concurren... | false | false | false | false | false | 0 |
getWindow(const uint32_t offsets[8], uint32_t c) {
int i;
for(i=0; i<8; ++i) {
if((uint32_t)(c-offsets[i])<=0x7f) {
return (int8_t)(i);
}
}
return -1;
} | false | false | false | false | false | 0 |
sys_decodedialog(t_symbol *s)
{
char buf[MAXPDSTRING], *sp = s->s_name;
int i;
if (*sp != '+')
bug("sys_decodedialog: %s", sp);
else sp++;
for (i = 0; i < MAXPDSTRING-1; i++, sp++)
{
if (!sp[0])
break;
if (sp[0] == '+')
{
if (sp[1] == '_')
... | false | false | false | false | false | 0 |
codePointToUTF8(unsigned int cp)
{
std::string result;
// based on description from http://en.wikipedia.org/wiki/UTF-8
if (cp <= 0x7f)
{
result.resize(1);
result[0] = static_cast<char>(cp);
}
else if (cp <= 0x7FF)
{
result.resize(2);
result[1] = static_cast<char>(0x8... | false | false | false | false | false | 0 |
cli_cmd_tokens_destroy (char **tokens)
{
char **tokenp = NULL;
if (!tokens)
return;
tokenp = tokens;
while (*tokenp) {
free (*tokenp);
tokenp++;
}
free (tokens);
} | false | false | false | false | false | 0 |
write_array(pid_t target, void *addr, const void *data, int len)
{
int i,j;
long peek_value;
if (attach(target) == false) {
return false;
}
for (i = 0; i + sizeof(long) < len; i += sizeof(long))
{
if (ptrace(PTRACE_POKEDATA, target, addr + i, *(long *)(data + i)) == -1L) {
... | false | false | false | false | false | 0 |
parseLocaltimeLine(char *line)
{
char *value = next_field(&line);
if (!value) {
_output->setError(RESPONSE_CODE_INVALID_HEADER, "Header Localtime: missing value");
return;
}
time_t their_time = atoi(value);
time_t our_time = time(0);
// compute offset to be *added* each time we ... | false | false | false | false | false | 0 |
isEndpointNotSupported(const Endpoint& endpoint) const {
const std::string::size_type pos = endpoint.URLString.find("://");
return pos != std::string::npos && lower(endpoint.URLString.substr(0, pos)) != "ldap";
} | false | false | false | false | false | 0 |
ippCopyAttributes(
ipp_t *dst, /* I - Destination IPP message */
ipp_t *src, /* I - Source IPP message */
int quickcopy, /* I - 1 for a referenced copy, 0 for normal */
ipp_copycb_t cb, /* I - Copy callback or @code NULL@ for none */
void *context) /* I - Conte... | false | false | false | false | false | 0 |
run()
{
PRINTLN("aFunction() of object \"" << id << '"');
::sleep(1);
PRINTLN("aFunction() of object \"" << id << "\" ends");
} | 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.