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
WriteStyleSheet(FILE * pf, const htmlexportcss hecss) { int i; if (hecss == HTML_EXPORT_CSS_HEAD) fputs("<style type=\"text/css\">\n", pf); else if (hecss == HTML_EXPORT_CSS_EXTERNAL) /* write come comments in the file */ fputs("\n" "/* CSS Stylesheet for " VERSION_S...
true
true
false
false
false
1
check_dict (gpointer read) { g_return_val_if_fail (read != NULL, FALSE); GIOStatus status; gchar *line; gsize len; gboolean ret; status = g_io_channel_read_line ((GIOChannel *) read, &line, &len, NULL, NULL); if (status == G_IO_STATUS_ERROR) { if (len) g_free (line); return FALSE...
false
false
false
false
false
0
_packetout(ogg_stream_state *os,ogg_packet *op,int adv){ /* The last part of decode. We have the stream broken into packet segments. Now we need to group them into packets (or return the out of sync markers) */ int ptr=os->lacing_returned; if(os->lacing_packet<=ptr)return(0); if(os->lacing_vals[p...
false
false
false
false
false
0
finish() { if (outer_reg) outer_ptr = enclosing_reg; }
false
false
false
false
false
0
recalcAngle() { // // calculate the angle corresponding to the value // if ( maxValue() == minValue() ) { d_data->angle = 0; d_data->nTurns = 0; } else { d_data->angle = ( value() - 0.5 * ( minValue() + maxValue() ) ) / ( maxValue() - minValue() ) * d_...
false
false
false
false
false
0
get_var(const char *id, size_t idlen, struct interface_defn_t *ifd) { int i; if (strncmpz(id, "iface", idlen) == 0) { // ubuntu's ifup doesn't do this: //static char *label_buf; //char *result; //free(label_buf); //label_buf = xstrdup(ifd->iface); // Remove virtual iface suffix //result = strchrnul(lab...
false
false
false
false
false
0
Java_org_gdal_ogr_ogrJNI_Feature_1SetFromWithMap(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jint jarg3, jintArray jarg4) { jint jresult = 0 ; OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ; OGRFeatureShadow *arg2 = (OGRFeatureShadow *) 0 ; int arg3 ; int arg4 ; in...
false
false
false
false
false
0
file2anlist( AttributeName *an, const char *fname, const char *brkstr ) { FILE *fp; char *line = NULL; char *lcur = NULL; char *c; size_t lmax = LBUFSIZ; fp = fopen( fname, "r" ); if ( fp == NULL ) { Debug( LDAP_DEBUG_ANY, "get_attrs_from_file: failed to open attribute list file " "\"%s\": %s\n", fname,...
false
false
false
false
true
1
png_do_read_swap_alpha(png_row_infop row_info, png_bytep row) { png_debug(1, "in png_do_read_swap_alpha"); #ifdef PNG_USELESS_TESTS_SUPPORTED if (row != NULL && row_info != NULL) #endif { png_uint_32 row_width = row_info->width; if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA) { ...
false
false
false
false
false
0
_dbus_g_hash_free_from_gtype (GType gtype) { GDestroyNotify func; gboolean ret; ret = hash_simple_free_from_gtype (gtype, &func); /* if the value doesn't have a simple free function, we cannot define a * meaningful free function here. instead, this hash table must be freed * using g_boxed_free so that t...
false
false
false
false
false
0
SetGradientConvergenceTolerance(double f) { if ( Math::ExactlyEquals(f, m_GradientConvergenceTolerance) ) { return; } m_GradientConvergenceTolerance = f; if ( m_OptimizerInitialized ) { m_VnlOptimizer->set_g_tolerance(m_GradientConvergenceTolerance); } this->Modified(); }
false
false
false
false
false
0
read_floats (istream& in, void* addr1, void* addr2, void* addr3, void* addr4) { int bufsiz = 1024; int n = 0; float* nums = new float[bufsiz]; char ch; do { if (n >= bufsiz) { float* newnums = new float[bufsiz*2]; for (int i=0; i<bufsiz; i++) newnums[i] = nums[i]; delete nums; ...
false
false
false
false
false
0
alloc_mat_packed(A,pB) struct blockmatrix A; struct blockmatrix *pB; { int blk,n; /* * First put up the number of blocks. */ pB->nblocks=A.nblocks; /* * Then allocate space for the block records. */ pB->blocks=(struct blockrec *)malloc(sizeof(struct blockrec)*(A.nblocks+1)); if (pB-...
false
true
false
false
false
1
OnUpButton(wxCommandEvent &/*event*/) { wxFileName loc(m_root); loc.RemoveLastDir(); SetRootFolder(loc.GetFullPath()); //TODO: Check if this is always the root folder }
false
false
false
false
false
0
setDenominator( std::vector<StkFloat> &aCoefficients, bool clearState ) { // Check the argument. if ( aCoefficients.size() == 0 ) { errorString_ << "Filter::setDenominator: coefficient vector must have size > 0!"; handleError( StkError::FUNCTION_ARGUMENT ); } if ( aCoefficients[0] == 0.0 ) { errorS...
false
false
false
false
false
0
file_read_all(const char *pathname, size_t extra, size_t *size) { int fd; void *mem; ssize_t rdlen; off_t last; fd = open(pathname, O_RDONLY); if (fd < 0) { pr_error_info("open file `%s' failed", pathname); return NULL; } last = lseek(fd, 0, SEEK_END); if (last == (off_t) -1) { last = KB(100); } el...
false
false
false
false
false
0
Perl_pv_pretty( pTHX_ SV *dsv, char const * const str, const STRLEN count, const STRLEN max, char const * const start_color, char const * const end_color, const U32 flags ) { const U8 dq = (flags & PERL_PV_PRETTY_QUOTE) ? '"' : '%'; STRLEN escaped; PERL_ARGS_ASSERT_PV_PRETTY; if (!(flags & ...
false
false
false
false
false
0
list_free(ListNode **list,int freeData) #else list_free(list,freeData) ListNode **list; int freeData; #endif { ListNode *p; ListNode *next; if (list == NULL) return; if (*list == NULL) return; for (p=*list; p != NULL; p=next) { next=p->next; if (freeData && p->elem != NULL) { ...
false
false
false
false
false
0
sprintbwt(char *out, const char *str, const int *bwt, int len) { // Prints the bwt into a string; bwt is assumed to be the return // value of histsort, and out should be at least len+1 bytes long. // Note that len is the length of the bwt, not str. int i; for (i = 0; i != len; ++i) out[i] = bwt[i] ? ('0' ...
false
false
false
false
false
0
is_block_in_journal(struct super_block *s, unsigned int bmap, int off, int *next) { b_blocknr_t tmp; if (reiserfs_in_journal(s, bmap, off, 1, &tmp)) { if (tmp) { /* hint supplied */ *next = tmp; PROC_INFO_INC(s, scan_bitmap.in_journal_hint); } else { (*next) = off + 1; /* inc offset to avoid ...
false
false
false
false
false
0
conv_sjistoeuc(gchar *outbuf, gint outlen, const gchar *inbuf) { const guchar *in = inbuf; guchar *out = outbuf; while (*in != '\0') { if (IS_ASCII(*in)) { *out++ = *in++; } else if (issjiskanji1(*in)) { if (issjiskanji2(*(in + 1))) { guchar out1 = *in; guchar out2 = *(in + 1); guchar row; ...
false
false
false
false
false
0
polite_directory_format (name) char *name; { char *home; int l; home = get_string_value ("HOME"); l = home ? strlen (home) : 0; if (l > 1 && strncmp (home, name, l) == 0 && (!name[l] || name[l] == '/')) { strncpy (tdir + 1, name + l, sizeof(tdir) - 2); tdir[0] = '~'; tdir[sizeof(td...
false
false
false
false
false
0
_compare_dir_src_ents_by_authority_id(const void **_a, const void **_b) { const dir_src_ent_t *a = *_a, *b = *_b; const networkstatus_voter_info_t *a_v = get_voter(a->v), *b_v = get_voter(b->v); const char *a_id, *b_id; a_id = a->is_legacy ? a_v->legacy_id_digest : a_v->identity_digest; b_id = b->is_legac...
false
false
false
false
false
0
TidyMemory(void) { if(first) { Heap h=first,n; do { n=h->next; Free(h->mem); Free(h); h=n; } while(h); } first=NULL; heap_left=0; }
false
false
false
false
false
0
atom_stsc_init (AtomSTSC * stsc) { guint8 flags[3] = { 0, 0, 0 }; atom_full_init (&stsc->header, FOURCC_stsc, 0, 0, 0, flags); atom_array_init (&stsc->entries, 128); }
false
false
false
false
false
0
test_file_double_group_open(void) { hid_t file1_id, file2_id; hid_t grp1_id, grp2_id; herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing double non-root group open\n")); file1_id = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P...
false
false
false
false
false
0
Cursor_displace(short delta_x, short delta_y) { short x=Input_new_mouse_X; short y=Input_new_mouse_Y; if(Main_magnifier_mode && Input_new_mouse_Y < Menu_Y && Input_new_mouse_X > Main_separator_position) { // Cursor in zoomed area if (delta_x<0) Input_new_mouse_X = Max(Main_separator_positi...
false
false
false
false
false
0
plugin_manager_ui_toggle_active (GtkTreeIter *iter, GtkTreeModel *model) { gboolean active; gtk_tree_model_get (model, iter, ACTIVE_COLUMN, &active, -1); active ^= 1; if (!plugin_manager_ui_set_active (iter, model, active)) return; }
false
false
false
false
false
0
get_dr31_drotx(ROT_MATRIX_TYPE type) { if(m_rot_matrix_type == Rotation_matrix::math) { return cos(m_angle_math_rotX) * sin(m_angle_math_rotZ) + sin(m_angle_math_rotX) * sin(m_angle_math_rotY) * cos(m_angle_math_rotZ); } if(m_rot_matrix_type == Rotation_matrix::geodetic) { return 0.0...
false
false
false
false
false
0
cli_print_volume_status_inode (dict_t *dict, gf_boolean_t notbrick) { int ret = -1; char *volname = NULL; int brick_index_max = -1; int other_count = 0; int index_max = 0; char *hostname = NULL; ...
false
false
false
false
false
0
lex_initialize(void) { typedef struct keyword_ty keyword_ty; struct keyword_ty { char *k_name; int k_token; }; static keyword_ty parse_keyword[] = { { "+=", PLUS_EQUALS }, { ":", COLON }, { "::", COLON2 }, { ";", SEMICOLON }...
false
false
false
false
false
0
get8(vorb *z) { if (USE_MEMORY(z)) { if (z->stream >= z->stream_end) { z->eof = TRUE; return 0; } return *z->stream++; } #ifndef STB_VORBIS_NO_STDIO { int c = fgetc(z->f); if (c == EOF) { z->eof = TRUE; return 0; } return c; } #endif }
false
false
false
false
false
0
hn_gen_tree(struct dentry *dentry) { int err, i, j, ndentry; struct au_dcsub_pages dpages; struct au_dpage *dpage; struct dentry **dentries; err = au_dpages_init(&dpages, GFP_NOFS); if (unlikely(err)) goto out; err = au_dcsub_pages(&dpages, dentry, NULL, NULL); if (unlikely(err)) goto out_dpages; for (i ...
false
false
false
false
false
0
eap_method_nag_init (EAPMethod *method, const char *ca_cert_chooser, NMConnection *connection) { GtkWidget *dialog, *widget; NagDialogResponseInfo *info; GError *error = NULL; char *text; g_return_val_if_fail (method != NULL, FALSE); g_return_val_if_fail (ca_cert_chooser...
false
false
false
false
false
0
shm_mq_get_sender(shm_mq *mq) { volatile shm_mq *vmq = mq; PGPROC *sender; SpinLockAcquire(&mq->mq_mutex); sender = vmq->mq_sender; SpinLockRelease(&mq->mq_mutex); return sender; }
false
false
false
false
false
0
select_random_value_part(request_rec *r, char *value) { char *p = value; unsigned n = 1; /* count number of distinct values */ while ((p = ap_strchr(p, '|')) != NULL) { ++n; ++p; } if (n > 1) { n = ap_random_pick(1, n); /* extract it from the whole string */ ...
false
false
false
false
false
0
CreateStretchPixmap( Display *dpy, Pixmap src, int src_width, int src_height, int src_depth, int dest_width, int dest_height, GC gc) { Pixmap pixmap = None; Pixmap temp_pixmap; GC my_gc = None; if (src_width < 0 || src_height < 0 || src_depth < 0 || dest_width < 0) { return None; } if (gc == None) { my_g...
false
false
false
false
false
0
mem_new(BIO *bi) { BUF_MEM *b; if ((b=BUF_MEM_new()) == NULL) return(0); bi->shutdown=1; bi->init=1; bi->num= -1; bi->ptr=(char *)b; return(1); }
false
false
false
false
false
0
socktype(int fd) { struct sockaddr_in remote_sin, local_sin; socklen_t len; int code; /* Try to get the local socket adress and port number */ len = sizeof(local_sin); code = getsockname(fd, (struct sockaddr *) &local_sin, &len); if (code < 0) { if (errno == ENOTSOCK || errno == EINVA...
false
false
false
false
false
0
vm_jni_lookup_symbol(const char *symbol_name) { struct hash_map_entry *this; hash_map_for_each_entry(this, jni_objects) { struct jni_object *object; void *addr; object = this->value; addr = dlsym(object->handle, symbol_name); if (addr) return addr; } return NULL; }
false
false
false
false
false
0
print_patch_file( const git_diff_delta *delta, float progress, void *data) { diff_print_info *pi = data; const char *oldpfx = pi->diff->opts.old_prefix; const char *oldpath = delta->old_file.path; const char *newpfx = pi->diff->opts.new_prefix; const char *newpath = delta->new_file.path; GIT_UNUSED(progress); ...
false
false
false
false
false
0
gcrp_grab_on_window (GdkWindow *window, guint32 activate_time) { if ((gdk_pointer_grab (window, TRUE, GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK, NULL, NULL, activate_time) == 0)) { if (gdk_keyboard_grab (window, TRUE, activat...
false
false
false
false
false
0
LookupNodesSQLite( ) { unsigned int iCur; unsigned int i; CPLAssert(nUnsortedReqIds <= MAX_ACCUMULATED_NODES); nReqIds = 0; for(i = 0; i < nUnsortedReqIds; i++) { GIntBig id = panUnsortedReqIds[i]; panReqIds[nReqIds++] = id; } std::sort(panReqIds, panReqIds + nReqIds);...
false
false
false
false
false
0
range1(DCEparsestate* state, Object rangenumber) { int range = -1; sscanf((char*)rangenumber,"%u",&range); if(range < 0) { dceerror(state,"Illegal range index"); } return rangenumber; }
false
false
false
false
false
0
dib0700_change_protocol(struct rc_dev *rc, u64 *rc_type) { struct dvb_usb_device *d = rc->priv; struct dib0700_state *st = d->priv; int new_proto, ret; if (mutex_lock_interruptible(&d->usb_mutex) < 0) { err("could not acquire lock"); return -EINTR; } st->buf[0] = REQUEST_SET_RC; st->buf[1] = 0; st->buf[2]...
false
false
false
false
true
1
GetPDA(JSContext *cx, uintN argc, jsval *vp) { JSObject *vobj, *aobj, *pdobj; JSBool ok; JSPropertyDescArray pda; JSPropertyDesc *pd; uint32 i; jsval v; if (!JS_ValueToObject(cx, argc == 0 ? JSVAL_VOID : vp[2], &vobj)) return JS_FALSE; if (!vobj) { *vp = JSVAL_VOID; ...
false
false
false
false
false
0
element_setattro(ElementObject* self, PyObject* nameobj, PyObject* value) { char *name = ""; if (PyUnicode_Check(nameobj)) name = _PyUnicode_AsString(nameobj); if (name == NULL) return -1; if (strcmp(name, "tag") == 0) { Py_DECREF(self->tag); self->tag = value; P...
false
false
true
false
true
1
align_end( const int alignment ) { if( alignment > 1 && size_ > 0 ) { const long long new_end = end() - ( end() % alignment ); if( pos_ < new_end ) size_ = new_end - pos_; } }
false
false
false
false
false
0
start(const QVideoSurfaceFormat &format) { if (isActive()) m_painter->stop(); if (!m_painter) createPainter(); if (format.frameSize().isEmpty()) { setError(UnsupportedFormatError); } else { QAbstractVideoSurface::Error error = m_painter->start(format); if (erro...
false
false
false
false
false
0
StartStroke (tdmInteractor I, int x, int y, int btn, int s) { DEFDATA(I, tdmZoomData) ; DEFPORT(I_PORT_HANDLE) ; int dx, dy, ax, ay ; ENTRY(("StartStroke(0x%x, %d, %d, %d)", I, x, y, btn)); PDATA(px) = x ; PDATA(py) = y ; y = YFLIP(y) ; x = x<0 ? 0 : (x>CDATA(w) ? CDATA(w) : x) ; y = y<0 ? 0 : (y...
false
false
false
false
false
0
write(dimeOutput * const file) { // sim_trace("Writing section: CLASSES\n"); file->writeGroupCode(2); file->writeString(sectionName); int i, n = this->classes.count(); for (i = 0; i < n; i++) { if (!this->classes[i]->write(file)) break; } if (i == n) { file->writeGroupCode(0); file->writeStr...
false
false
false
false
false
0
point_in ( GdkPoint *point, GpSelBox *box) { if ( point->x >= box->p0.x && point->x <= box->p1.x && point->y >= box->p0.y && point->y <= box->p1.y ) { return TRUE; } else { return FALSE; } }
false
false
false
false
false
0
basler_sff_registry_find_by_id (dc1394basler_sff_feature_t feature_id) { if (feature_id < DC1394_BASLER_SFF_FEATURE_MIN || feature_id >= DC1394_BASLER_SFF_FEATURE_MAX || feature_id >= sff_feature_registry_size) return NULL; return &(sff_feature_registry[feature_id]); }
false
false
false
false
false
0
DoLoadHistoryOnEntry(int &/*argc*/, char **argv) { if (HistoryFileName[0] == 0) { #ifdef UNIX ExpandPath("~/.fte-history", HistoryFileName, sizeof(HistoryFileName)); #else JustDirectory(argv[0], HistoryFileName, sizeof(HistoryFileName)); strlcat(HistoryFileName, "fte.his", sizeof(HistoryFile...
false
false
false
false
false
0
dJointGetPUPositionRate( dJointID j ) { dxJointPU* joint = ( dxJointPU* ) j; dUASSERT( joint, "bad joint argument" ); checktype( joint, PU ); if ( joint->node[0].body ) { // We want to find the rate of change of the prismatic part of the joint // We can find it by looking at the spe...
false
false
false
false
false
0
createRestrictedModelForXMLIDs( const std::set< std::string >& xmlids ) { std::string writeID = ""; if( !xmlids.empty() ) writeID = *(xmlids.begin()); return createRestrictedModelForXMLIDs( writeID, xmlids ); }
false
false
false
false
false
0
clocks_world_item_deserialize (GVariant* location_variant) { ClocksWorldItem* result = NULL; GWeatherLocation* location = NULL; GWeatherLocation* world = NULL; GWeatherLocation* _tmp0_ = NULL; GWeatherLocation* _tmp1_ = NULL; ClocksWorldItem* _tmp21_ = NULL; GWeatherLocation* _tmp22_ = NULL; g_return_val_if_fai...
false
false
false
false
false
0
checkaddrs(struct name *np) { struct name *n = np; while (n != NULL) { if (mime_name_invalid(n->n_name, 1)) { if (n->n_blink) n->n_blink->n_flink = n->n_flink; if (n->n_flink) n->n_flink->n_blink = n->n_blink; if (n == np) np = n->n_flink; } n = n->n_flink; } return np; }
false
false
false
false
false
0
lins_ln ( LISTID lid, LNODEID lnid, void * data_ptr ) { LIST * l; LISTNODE * ln; LISTNODE * ln_ptr; l = (LIST *)lid; ln = (LISTNODE *)lnid; CKLMAGIC(l); CKMAGIC(ln); /*----------------------------------------- | validate that ln is indeed in the list -----------------------------------------*/...
false
false
false
false
false
0
print_if_c(__isl_take isl_printer *p, __isl_keep isl_ast_node *node, __isl_keep isl_ast_print_options *options, int new_line) { if (new_line) p = isl_printer_start_line(p); p = isl_printer_print_str(p, "if ("); p = isl_printer_print_ast_expr(p, node->u.i.guard); p = isl_printer_print_str(p, ")"); p = print_bod...
false
false
false
false
false
0
controls_exit (JSContext *cx, uintN argc, jsval *vp) { gchar *fname; se_log_fncall_checkinit ("controls.exit"); player_stop (); if (gtk_main_level() < 1) { settings_clear (); exit (2); } mm_save (); playlist_save (NULL); save_key_bindings (); save_startup_script (); logprintf ("script...
false
false
false
false
false
0
gvir_config_storage_permissions_set_group(GVirConfigStoragePermissions *perms, guint group) { g_return_if_fail(GVIR_CONFIG_IS_STORAGE_PERMISSIONS(perms)); gvir_config_object_set_node_content_uint64(GVIR_CONFIG_OBJECT(perms), ...
false
false
false
false
false
0
ustrftime(const wchar_t *wfmt, const struct tm *timespec) { rdstring rs = { 0, 0, NULL }; if (!wfmt) wfmt = L"%c"; while (*wfmt) { if (wfmt[0] == L'%' && wfmt[1] == L'%') { rdadd(&rs, L'%'); wfmt += 2; } else if (wfmt[0] == L'%' && wfmt[1]) { ustrftime_internal(&rs, wfmt[1], timespec); ...
false
false
false
false
true
1
add(const string& field, const string& content) { gi_assert(!field.empty()); gi_assert(!content.empty()); stringMapIter existing = entries.find(field); if (existing != entries.end()) { throw GBS_global_string("Duplicated reference entry for '%s'", field.c_str()); } entries[field] = ...
false
false
false
false
false
0
i40evf_napi_poll(struct napi_struct *napi, int budget) { struct i40e_q_vector *q_vector = container_of(napi, struct i40e_q_vector, napi); struct i40e_vsi *vsi = q_vector->vsi; struct i40e_ring *ring; bool clean_complete = true; bool arm_wb = false; int budget_per_ring; int work_done = 0; if (test_bit...
false
false
false
false
false
0
issueBefore (IFNode *n, CodeGenerator *cg) { next = n ; prev = n->prev ; n->prev = this ; if (n->prev == NULL) { cg->code = this ; if (cg->lastInstruction == n) { cg->lastInstruction = this ; } } else { n->prev->next = this ; } }
false
false
false
false
false
0
panel_lockdown_is_applet_disabled (PanelLockdown *lockdown, const char *iid) { int i; g_return_val_if_fail (PANEL_IS_LOCKDOWN (lockdown), TRUE); for (i = 0; lockdown->priv->disabled_applets[i] != NULL; i++) if (g_strcmp0 (lockdown->priv->di...
false
false
false
false
false
0
stopTimer() { if (!isStopped()) { // stop the virtual timer LastVirtualTime = getTime(); } --VirtualTimerStopCounter; }
false
false
false
false
false
0
print_status (char *dev, int desc) { struct mtget status; if (rmtioctl (desc, MTIOCGET, (char*)&status) == -1) error (MT_EXIT_FAILURE, errno, _("%s: rmtioctl failed"), dev); printf ("drive type = %d\n", (int) status.mt_type); #if defined(hpux) || defined(__hpux) printf ("drive status (high) = %d\n", (int)...
false
false
false
false
false
0
PyvtkLookupTable_SetTableValue_s2(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "SetTableValue"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkLookupTable *op = static_cast<vtkLookupTable *>(vp); vtkIdType temp0; double temp1; double temp2; double temp3; double temp4 = 1.0; ...
false
false
false
false
false
0
fits_get_atom_size(tfits_type type) { int atomsize = -1; switch (type) { case TFITS_BIN_TYPE_A: case TFITS_BIN_TYPE_X: case TFITS_BIN_TYPE_L: case TFITS_BIN_TYPE_B: atomsize = 1; break; case TFITS_BIN_TYPE_I: atomsize = 2; break; case TFITS_BIN_TYPE_J: case TFITS_BIN_TYPE_E: atomsize = 4; break; c...
false
false
false
false
false
0
globus_priority_q_modify( globus_priority_q_t * priority_q, void * datum, void * new_priority) { globus_l_priority_q_entry_t ** heap; globus_l_priority_q_entry_t * entry; int hole; ...
false
false
false
false
false
0
uwbd_evt_handle_rc_bp_slot_change(struct uwb_event *evt) { struct uwb_rc *rc = evt->rc; struct device *dev = &rc->uwb_dev.dev; struct uwb_rc_evt_bp_slot_change *bpsc; if (evt->notif.size < sizeof(*bpsc)) { dev_err(dev, "BP SLOT CHANGE event: Not enough data\n"); return -EINVAL; } bpsc = container_of(evt->not...
false
false
false
false
false
0
setup_ri_pointers(TRemoteInfo &ri) { unsigned int u; for (u = 0; u < sizeof(FlashList)/sizeof(TFlash)-1; ++u) { if (ri.flash_id == FlashList[u].id && ri.flash_mfg == FlashList[u].mfg) break; } ri.flash = &FlashList[u]; ri.arch = (ri.architecture < sizeof(ArchList)/sizeof(TArchInfo)) ? &ArchList[ri.a...
false
false
false
false
false
0
jpeg_new_colormap (j_decompress_ptr cinfo) { my_master_ptr master = (my_master_ptr) cinfo->master; /* Prevent application from calling me at wrong times */ if (cinfo->global_state != DSTATE_BUFIMAGE) ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); if (cinfo->quantize_colors && cinfo->enable_external...
false
false
false
false
false
0
delete_command( ) { /* Deletes entire commands from the beginning of the command buffer */ int loop; /* Keep moving the characters in the command buffer one space to the left * until a '\n' is found... */ do { for ( loop = 0; loop < end_ptr; loop++ ) { commands[loop] = c...
false
false
false
false
false
0
stream_eos (GMimeStream *stream) { GMimeStreamGIO *gio = (GMimeStreamGIO *) stream; if (gio->file == NULL) return TRUE; return gio->eos; }
false
false
false
false
false
0
getIntRange() { IntRange ir1 = e1->getIntRange(); IntRange ir2 = e2->getIntRange(); // Should we ignore the possibility of div-by-0??? if (ir2.containsZero()) return Expression::getIntRange() DUMP; // [a,b] / [c,d] = [min (a/c, a/d, b/c, b/d), max (a/c, a/d, b/c, b/d)] SignExtendedNumb...
false
false
false
false
false
0
Perl_bytes_cmp_utf8(pTHX_ const U8 *b, STRLEN blen, const U8 *u, STRLEN ulen) { const U8 *const bend = b + blen; const U8 *const uend = u + ulen; PERL_ARGS_ASSERT_BYTES_CMP_UTF8; PERL_UNUSED_CONTEXT; while (b < bend && u < uend) { U8 c = *u++; if (!UTF8_IS_INVARIANT(c)) { if (UTF8_I...
false
false
false
false
false
0
RootIndex(HeapObject* heap_object) { for (int i = 0; i < Heap::kRootListLength; i++) { Object* root = HEAP->roots_address()[i]; if (root == heap_object) return i; } return kInvalidRootIndex; }
false
false
false
false
false
0
is_draw() { const Board & board = tree.get_board(); /* 50 move rule */ if (board.get_movecnt50() >= 100) { return true; } /* Draw due to insufficient material */ if (board.is_material_draw()) { return true; } /* Look for repetitions in the tree */ int rep = 1; for (int ply=tree.get_current_ply()-1; ...
false
false
false
false
false
0
ChoiceNextAvail( ChewingData *pgdata ) { if (pgdata->choiceInfo.isSymbol) return 0; if ( --( pgdata->availInfo.currentAvail ) < 0 ) pgdata->availInfo.currentAvail = pgdata->availInfo.nAvail - 1; SetChoiceInfo( pgdata ); return 0; }
false
false
false
false
false
0
prepare_input_range (GSList **input_range, group_by_t group_by) { GSList *input_by_units = NULL; switch (group_by) { case GROUPED_BY_ROW: g_slist_foreach (*input_range, cb_cut_into_rows, &input_by_units); g_slist_free (*input_range); *input_range = g_slist_reverse (input_by_units); return; case GROUPED_BY_...
false
false
false
false
false
0
KBOSum() const { OBBond *bond; unsigned int bosum; OBBondIterator i; bosum = GetImplicitValence(); for (bond = ((OBAtom*)this)->BeginBond(i);bond;bond = ((OBAtom*)this)->NextBond(i)) { if (bond->IsKDouble()) bosum++; else if (bond->IsKTriple()) bosum += ...
false
false
false
false
false
0
sqlite2_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquotedlen, char **quoted, int *quotedlen, enum pdo_param_type paramtype TSRMLS_DC) { char *ret; if (unquotedlen && (unquoted[0] == '\x01' || memchr(unquoted, '\0', unquotedlen) != NULL)) { /* binary string */ int len; ret = safe_emalloc(1 + unq...
false
false
false
false
false
0
conn_reply_virus(const client_conn_t *conn, const char *file, const char *virname) { if (conn->id) { return mdprintf(conn->sd, "%u: %s: %s FOUND%c", conn->id, file, virname, conn->term); } return mdprintf(conn->sd, "%s: %s FOUND%c", file, virname, conn->term); }
false
false
false
false
false
0
setup_per_zone_inactive_ratio(void) { struct zone *zone; for_each_zone(zone) calculate_zone_inactive_ratio(zone); }
false
false
false
false
false
0
handle_vector_type_attribute (tree *node, tree name, tree ARG_UNUSED (args), int ARG_UNUSED (flags), bool *no_add_attrs) { /* Vector representative type and size. */ tree rep_type = *node; tree rep_size = TYPE_SIZE_UNIT (rep_type); tree rep_name; /* Vector size in bytes and number of units...
false
false
false
false
false
0
DUL_DumpParams(OFString& ret_str, DUL_ASSOCIATESERVICEPARAMETERS * params) { OFOStringStream str; OFString temp_str; str << "APP CTX NAME:" << params->applicationContextName << OFendl; str << dump_uid(params->applicationContextName, "%13s"); str << "AP TITLE: " << params->callingAPTitle << OFen...
false
false
false
false
false
0
drm_stub_open(struct inode *inode, struct file *filp) { const struct file_operations *new_fops; struct drm_minor *minor; int err; DRM_DEBUG("\n"); mutex_lock(&drm_global_mutex); minor = drm_minor_acquire(iminor(inode)); if (IS_ERR(minor)) { err = PTR_ERR(minor); goto out_unlock; } new_fops = fops_get(mi...
false
false
false
false
true
1
Update () { if (_needs_resize) return; OverlaySelection* s = (OverlaySelection*)GetSelection(); OverlayView* view = GetOverlayView(); Component* viewComp = view->GetOverlayComp(); OverlayComp* edComp = (OverlayComp*)_editor->GetComponent(); boolean glyph_repair = _damage->Incurred(); ...
false
false
false
false
false
0
set_file_aliases(const DjVuFile * file) { DEBUG_MSG("DjVuDocument::set_file_aliases(): setting global aliases for file '" << file->get_url() << "'\n"); DEBUG_MAKE_INDENT(3); DjVuPortcaster * pcaster=DjVuPort::get_portcaster(); GMonitorLock lock(&((DjVuFile *) file)->get_safe_flags()); pcaster-...
false
false
false
false
false
0
group_selection (struct Bond **list, int *num_sel) { struct Bond *current, *new, *last, *last_sel; LLINT xmin, xmax, ymin, ymax; if (*list == NULL) return; new = g_new (struct Bond, 1); bounds_of_selection (*list, &xmin, &xmax, &ymin, &ymax); new->x1 = xmin; new->y1 = ymin; new->x2 = xmax; new->...
false
false
false
false
false
0
get_list_types(DataConvFrame* data) { GtkTreeIter iter; GtkTreeStore *store; GtkTreeModel *model; GtkWidget *combobox; GtkCellRenderer *renderer; gint i; store = gtk_tree_store_new (1,G_TYPE_STRING); for(i=0;i<data->n;i++) { gtk_tree_store_append (store, &iter, NULL); gtk_tree...
false
false
false
false
false
0
hw_block_intr(struct ksz_hw *hw) { uint interrupt = 0; if (!hw->intr_blocked) { hw_dis_intr(hw); interrupt = hw->intr_blocked; } return interrupt; }
false
false
false
false
false
0
itosradix(int64 value, int radix) { char numBuf[32]; char *cp; char digits[] = "0123456789ABCDEF"; int negative; if (radix != 10 && radix != 16) { return 0; } cp = &numBuf[sizeof(numBuf)]; *--cp = '\0'; if (value < 0) { negative = 1; value = -va...
false
false
false
false
false
0
ai_do_build_city(struct player *pplayer, struct unit *punit) { struct tile *ptile = unit_tile(punit); struct city *pcity; fc_assert_ret_val(pplayer == unit_owner(punit), FALSE); unit_activity_handling(punit, ACTIVITY_IDLE); /* Free city reservations */ ai_unit_new_task(punit, AIUNIT_NONE, NULL); pcity ...
false
false
false
false
false
0
log_close(int log_id) { if (log_id < 0 || log_id >= LOG_MAXLOGS) return; _lock_logger(); if (loglist[log_id].in_use == 0) { _unlock_logger(); return; } loglist[log_id].in_use = 0; loglist[log_id].level = 2; if (loglist[log_id].filename) free(loglist[log_id].filename); ...
false
false
false
false
false
0
network_sockaddr_equal(const struct sockaddr *a, const struct sockaddr *b) { const struct sockaddr_in *a4; const struct sockaddr_in *b4; #ifdef HAVE_INET6 const struct sockaddr_in6 *a6; const struct sockaddr_in6 *b6; const struct sockaddr *tmp; #endif a4 = (const struct sockaddr_in *) (const vo...
false
false
false
false
false
0
rc_addpair(struct rateclass *rc, fu16_t group, fu16_t type) { struct snacpair *sp, *sp2; if (!(sp = malloc(sizeof(struct snacpair)))) return; memset(sp, 0, sizeof(struct snacpair)); sp->group = group; sp->subtype = type; sp->next = NULL; for (sp2 = rc->members; sp2 && sp2->next; sp2 = sp2->next) ; if (!sp...
false
false
false
false
false
0