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
writeSourceLine (FILE *const fp, const char *const line) { size_t length = 0; const char *p; /* Write everything up to, but not including, a line end character. */ for (p = line ; *p != '\0' ; ++p) { const int next = *(p + 1); const int c = *p; if (c == CRETURN || c == NEWLINE) break; /* If...
false
false
false
false
false
0
init_clocks(void) { char filename[MAX_BUF]; FILE *fp; static int has_been_done = 0; if (has_been_done) return; else has_been_done = 1; snprintf(filename, sizeof(filename), "%s/clockdata", settings.localdir); LOG(llevDebug, "Reading clockdata from %s...\n", filename); fp...
true
true
false
false
true
1
add_opt_common(char **opts, const char *opt, int esc) { unsigned oldlen = *opts ? strlen(*opts) : 0; char *d = realloc(*opts, oldlen + 1 + strlen(opt) * 2 + 1); if (!d) return alloc_failed(); *opts = d; if (oldlen) { d += oldlen; *d++ = ','; } for (; *opt; opt++) { if (esc && (*opt == ',' || *opt == '...
false
false
false
false
false
0
read_data_file ( void ) { char buffer[BUFFER_SIZE]; char * files[NUM_DATA_FILES] = { GJAY_FILE_DATA, GJAY_DAEMON_DATA }; FILE * f; gint k; for (k = 0; k < NUM_DATA_FILES; k++) { snprintf(buffer, BUFFER_SIZE, "%s/%s/%s", getenv("HOME"), GJAY_DIR, files[k]); if (verb...
true
true
false
false
true
1
e_name_western_extract_last (ENameWestern *name, ENameWesternIdxs *idxs) { gchar *word; gint idx = -1; gchar *last; idx = e_name_western_last_get_max_idx (name, idxs); /* * In the case where there is no preceding name element, the * name is either just a first name ("Nat", "Joh...
false
true
false
false
false
1
command_booklist(argument_count, arguments) int argument_count; char *arguments[]; { Book *book; char message[MAX_BOOK_NAME_LENGTH + MAX_BOOK_TITLE_LENGTH + 8]; syslog(LOG_INFO, "%s: cmd=BOOKLIST, host=%s(%s)", "ok", client_host_name, client_address); if (write_string_all(accepted_out_file, i...
false
false
false
false
false
0
alloc_track(list track_list, vector_t *strvec) { interface_t *ifp = NULL; tracked_if_t *tip = NULL; int weight = 0; char *tracked = vector_slot(strvec, 0); ifp = if_get_by_ifname(tracked); /* Ignoring if no interface found */ if (!ifp) { log_message(LOG_INFO, " %s no match, ignoring...", tracked); retu...
false
false
false
false
false
0
path_offline (struct path * pp) { struct sysfs_device * parent; char buff[SCSI_STATE_SIZE]; pp->sysdev = sysfs_device_from_path(pp); if (!pp->sysdev) { condlog(1, "%s: failed to get sysfs information", pp->dev); return PATH_WILD; } parent = sysfs_device_get_parent(pp->sysdev); if (!parent) parent = pp->s...
false
false
false
false
false
0
drm_fb_helper_release_fbi(struct drm_fb_helper *fb_helper) { if (fb_helper) { struct fb_info *info = fb_helper->fbdev; if (info) { if (info->cmap.len) fb_dealloc_cmap(&info->cmap); framebuffer_release(info); } fb_helper->fbdev = NULL; } }
false
false
false
false
false
0
unchanged(buf, ff) buf_T *buf; int ff; /* also reset 'fileformat' */ { if (buf->b_changed || (ff && file_ff_differs(buf))) { buf->b_changed = 0; ml_setflags(buf); if (ff) save_file_ff(buf); #ifdef FEAT_WINDOWS check_status(buf); redraw_tabline = TRUE; #endif #ifdef FEAT_TITLE need_maketitle ...
false
false
false
false
false
0
igb_update_mc_addr_list(struct e1000_hw *hw, u8 *mc_addr_list, u32 mc_addr_count) { u32 hash_value, hash_bit, hash_reg; int i; /* clear mta_shadow */ memset(&hw->mac.mta_shadow, 0, sizeof(hw->mac.mta_shadow)); /* update mta_shadow from mc_addr_list */ for (i = 0; (u32) i < mc_addr_count; i++) { hash_v...
false
false
false
false
false
0
DropCast(DropCastStmt *stmt) { Oid sourcetypeid; Oid targettypeid; ObjectAddress object; /* when dropping a cast, the types must exist even if you use IF EXISTS */ sourcetypeid = typenameTypeId(NULL, stmt->sourcetype); targettypeid = typenameTypeId(NULL, stmt->targettype); object.classId = CastRelationId; ...
false
false
false
false
false
0
xml_write_bar (FILE * f, char type, char signs) { const char *str; str = xml_bar_to_str (type); fprintf (f, "<type>%s</type>", str); switch (signs) { case _V_EPISEMUS: fprintf(f, "<signs>vertical-episemus</signs>"); break; case _V_EPISEMUS_ICTUS_A: fprintf(f, "<signs>vertical-epise...
false
false
false
false
false
0
cpu_cycle_map(char *antic_cycles_orig, int *cpu_cycles, int *actual_cycles) { int i; char antic_cycles[CYCLE_MAP_SIZE]; int antic_xpos; int cpu_xpos = 0; for (i = 0; i <= 113; i++) antic_cycles[i] = antic_cycles_orig[i]; for (i = 114; i < CYCLE_MAP_SIZE; i++) antic_cycles[i] = '.'; for (i = 0; i < CYCLE_MAP_...
true
true
false
false
false
1
ddf_TableauEntry(myfloat *x,ddf_rowrange m_size, ddf_colrange d_size, ddf_Amatrix X, ddf_Bmatrix T, ddf_rowrange r, ddf_colrange s) /* Compute the (r,s) entry of X.T */ { ddf_colrange j; myfloat temp; ddf_init(temp); ddf_set(*x,ddf_purezero); for (j=0; j< d_size; j++) { ddf_mul(temp,X[r-1][j], T[j]...
false
false
false
false
false
0
sel_write_access(struct file *file, char *buf, size_t size) { char *scon = NULL, *tcon = NULL; u32 ssid, tsid; u16 tclass; struct av_decision avd; ssize_t length; length = task_has_security(current, SECURITY__COMPUTE_AV); if (length) goto out; length = -ENOMEM; scon = kzalloc(size + 1, GFP_KERNEL); if (!s...
false
true
false
false
true
1
count_tid_in_list(void) { unsigned int p, tid, pid = 0; for (p = 0; p < pid_array_nr; p++) { tid = count_tid(pid_array[p]); if (!tid) { /* PID no longer exists */ pid_array[p] = 0; } else { /* <tid_value> TIDs + 1 TGID */ pid += tid + 1; } } return pid; }
false
false
false
false
false
0
test_status_submodules__1(void) { status_entry_counts counts; g_repo = setup_fixture_submodules(); cl_assert(git_path_isdir("submodules/.git")); cl_assert(git_path_isdir("submodules/testrepo/.git")); cl_assert(git_path_isfile("submodules/.gitmodules")); status_counts_init(counts, expected_files, expected_statu...
false
false
false
false
false
0
tiffsep_close_comp_file(tiffsep_device *tfdev, const char *fn) { int code; if (tfdev->tiff_comp) { TIFFCleanup(tfdev->tiff_comp); tfdev->tiff_comp = NULL; } code = gx_device_close_output_file((gx_device *)tfdev, fn, ...
false
false
false
false
false
0
win_linetabsize(wp, p, len) win_T *wp; char_u *p; colnr_T len; { colnr_T col = 0; char_u *s; for (s = p; *s != NUL && (len == MAXCOL || s < p + len); mb_ptr_adv(s)) col += win_lbr_chartabsize(wp, s, col, NULL); return (int)col; }
false
false
false
false
false
0
Read_Config (void) { gchar *file_path = NULL; FILE *file; gchar buffer[MAX_STRING_LEN]; /* The file to read */ file_path = g_build_filename (g_get_user_config_dir (), PACKAGE_TARNAME, CONFIG_FILE, NULL); if ((file = fopen (file_path,"r")) == 0) { L...
false
false
false
false
false
0
pnmSkipCommentLines(FILE *fp) { l_int32 c; PROCNAME("pnmSkipCommentLines"); if (!fp) return ERROR_INT("stream not open", procName, 1); if ((c = fgetc(fp)) == EOF) return 1; if (c == '#') { do { /* each line starting with '#' */ do { /* this entire line */ ...
false
false
false
false
false
0
tx_deflate_flush(txdrv_t *tx) { struct attr *attr = tx->opaque; if (attr->flags & DF_NAGLE) { g_assert(NULL != attr->tm_ev); cq_expire(attr->tm_ev); } else if (!(attr->flags & DF_FLOWC)) deflate_flush_send(tx); }
false
false
false
false
false
0
get_gateway_cb(const char *gateway, int index, void *user_data) { struct gateway_config *config; struct gateway_data *data; struct get_gateway_params *params = user_data; int family; if (index < 0) goto out; DBG("phy index %d phy gw %s vpn index %d vpn gw %s", index, gateway, params->vpn_index, params->vpn_...
false
false
false
false
false
0
FixReference(struct Expression * e, unsigned int wantReference) { if(e->expType && e->type != 2) { struct Type * type = e->expType; unsigned int isPointer = 0x0; if(type->kind == 8) { struct __ecereNameSpace__ecere__com__Class * _class = type->_class ? type->_class->registered : (((void *)0)); if(_class && ((_class->...
false
false
false
false
false
0
gkm_manager_find_related (GkmManager *self, GkmSession *session, CK_OBJECT_CLASS klass, GkmObject *related_to) { CK_ATTRIBUTE attrs[2]; GkmObject *object; guchar *id; gsize n_id; g_return_val_if_fail (GKM_IS_MANAGER (self), NULL); g_return_val_if_fail (GKM_IS_OBJECT (related_to), NULL);...
false
false
false
false
false
0
mkdigest(std::list<std::string> &msglist, int tmpfile_fd, afxopipestream &tfile) { int pipefd1[2], pipefd0[2]; pid_t p; std::string buf; if (pipe(pipefd1)) { perror("pipe"); return (EX_TEMPFAIL); } if (pipe(pipefd0)) { perror("pipe"); close(pipefd1[0]); close(pipefd1[1]); return (EX_TEMPFAIL...
false
false
false
false
false
0
multi_team_host_assign_default_teams() { int player_count,idx; int team0_count; // first determine how many players there are in the game player_count = 0; for(idx=0;idx<MAX_PLAYERS;idx++){ // count anyone except the standalone server (if applicable) if(MULTI_CONNECTED(Net_players[idx]) && !MULTI_STANDALONE(...
false
false
false
false
false
0
add_pin_exception_info( const char* label, const unsigned depth, const candidate_alignment& cal, const candidate_alignment& start_cal, const pos_t ref_start_pos, const pos_t read_start_pos, const indel_key& cindel, const indel_set_t& current_indels) { log_os << "\nException caught wh...
false
false
false
false
false
0
cpl_matrix_add(cpl_matrix *matrix1, const cpl_matrix *matrix2) { cpl_size size; double *m1; double *m2; if (matrix1 == NULL || matrix2 == NULL) return cpl_error_set_(CPL_ERROR_NULL_INPUT); if (matrix1->nr != matrix2->nr || matrix1->nc != matrix2->nc) return cpl_err...
false
false
false
false
false
0
on_privs_privileges_cache_timeout(const Glib::ustring& table_name) { //std::cout << "debug: " << G_STRFUNC << ": table=" << table_name << std::endl; //Forget the cached privileges after a few seconds: type_map_privileges::iterator iter = m_privileges_cache.find(table_name); if(iter != m_privileges_cache.end())...
false
false
false
false
false
0
Ns_CacheFlush(Ns_Cache *cache) { Ns_CacheSearch search; Ns_Entry *entry; entry = Ns_CacheFirstEntry(cache, &search); while (entry != NULL) { Ns_CacheFlushEntry(entry); entry = Ns_CacheNextEntry(&search); } }
false
false
false
false
false
0
register_thread(cl_raw_list_t *log_list, THREAD_HANDLE *thread, const char *thread_name) { int ret; ret = cl_thread_setup(thread, log_list, thread_name, 0, NULL, NULL, NULL, CL_TT_IJS_REGISTER); if (ret == CL_RET...
false
false
false
false
false
0
cleanup() { my_free(pass); my_free(database); my_free(host); my_free(user); my_free(dirname_for_local_load); delete glob_description_event; if (mysql) mysql_close(mysql); }
false
false
false
false
false
0
xml() { std::string ret(""); ret.append(xml_start_tag("PackPallet")); ret.append(xml_make_tag("PalletNumber", itoa(pallet_number).c_str())); ret.append(xml_make_tag("BruttoWeight", itoa(brutto_weight).c_str())); ret.append(xml_make_tag("NumberofPackages", itoa(n_package()).c_str())); ret.append(xml_make_tag("Desc...
false
false
false
false
false
0
invext ( int32_t& u, const int32_t a, const int32_t b ) const { long u3; long v1,v3; u = 1; u3 = a; v1 = 0; v3 = b; while (v3 != 0) { long q, t1, t3; q = u3 / v3; t1 = u - q * v1; t3 = u3 - q * v3; u = int32_t(v1); u3 = v3; v1 = t1; v3 = t3; } return (u3<0?u=-u:u); }
false
false
false
false
false
0
operator=(const OFConfigFileCursor &source) { if (this != &source) { delete[] array_; maxLevel_ = source.maxLevel_; array_ = new OFConfigFileNodePtr[maxLevel_ + 1]; for (unsigned int i = 0; i <= maxLevel_; i++) array_[i] = source.array_[i]; } return *this; }
false
false
false
false
false
0
loop_change_fd(struct loop_device *lo, struct block_device *bdev, unsigned int arg) { struct file *file, *old_file; struct file *f, *virt_file = NULL, *old_virt_file; struct inode *inode; int error; error = -ENXIO; if (lo->lo_state != Lo_bound) goto out; /* the loop device has to be read-only */ error...
false
false
false
false
false
0
cd_util_get_sensor_reading (CdUtilPrivate *priv, gchar **values, GError **error) { CdColorXYZ *xyz; CdSensorCap cap; CdSensor *sensor; gboolean ret = TRUE; GError *error_local = NULL; GPtrArray *array = NULL; guint i; guint j; if (g_strv_length (values) < 1) { ret = FALSE; g_set_error_literal (error, ...
false
true
false
false
true
1
read(dap_connection &c) { attmenu.read(c); if (attmenu.get_bit(0) && !datatype.read(c)) return false; if (attmenu.get_bit(1) && !org.read(c)) return false; if (attmenu.get_bit(2) && !rfm.read(c)) return false; if (attmenu.get_bit(3) && !rat.read(c)) return false; if (attmenu.get_bit(4) ...
false
false
false
false
false
0
WriteSquashedLine4x(byte *dest, byte *src) { int x; int c; byte *dest2, *dest3, *dest4; dest2 = dest + dest_pitch; dest3 = dest + dest_pitch * 2; dest4 = dest + dest_pitch * 3; for (x=0; x<SCREENWIDTH; ) { // Draw in blocks of 5 // 100% pixel 0 x3 c = src[0];...
false
false
false
false
false
0
mdiobus_alloc_size(size_t size) { struct mii_bus *bus; size_t aligned_size = ALIGN(sizeof(*bus), NETDEV_ALIGN); size_t alloc_size; /* If we alloc extra space, it should be aligned */ if (size) alloc_size = aligned_size + size; else alloc_size = sizeof(*bus); bus = kzalloc(alloc_size, GFP_KERNEL); if (bus)...
false
false
false
false
false
0
utf2eucj(ScmConvInfo *cinfo, const char *inptr, size_t inroom, char *outptr, size_t outroom, size_t *outchars) { unsigned char u0; u0 = (unsigned char)inptr[0]; if (u0 <= 0x7f) { *outptr = u0; *outchars = 1; return 1; } if (u0 <= 0xbf) { /* inv...
false
false
false
false
false
0
reset_capa (char *name) { int i; for (i = 0; mta_capa[i]; i++) if (strcmp (mta_capa[i], name) == 0) { mta_capa[i] = NULL; break; } }
false
false
false
false
true
1
libbfio_file_set_name( libbfio_handle_t *handle, const char *name, size_t name_length, libcerror_error_t **error ) { libbfio_internal_handle_t *internal_handle = NULL; char *full_name = NULL; static char *function = "libbfio_file_set_name"; size_t ...
false
false
false
false
false
0
OnChar(wxKeyEvent& evt) { // On (some?) non-US PC keyboards the AltGr key is required to enter some // common characters. It comes to us as both Alt and Ctrl down so we need // to let the char through in that case, otherwise if only ctrl or only // alt let's skip it. bool ctrl = evt.ControlDown(); ...
false
false
false
false
false
0
print_image(const Image* const i, const int chars, FILE *f) { int x, y; #ifdef WIN32 char *line = (char*) malloc(i->width + 1); #else char line[i->width + 1]; #endif line[i->width] = 0; for ( y=0; y < i->height; ++y ) { for ( x=0; x < i->width; ++x ) { const float lum = i->pixel[x + (flipy? i->height ...
true
true
false
false
true
1
RemoveColors( const char * c, bool darkonly ) { // st_Breakpoint(); tString ret; int len = strlen(c); bool removed = false; // walk through string while (*c!='\0'){ // skip color codes if (*c=='0' && len >= 2 && c[1]=='x') { if( len >= 8 && darkonly ) ...
false
false
false
false
false
0
start() { time_t now; time( &now ); QString time = QString::number( now ); //QString time = QString::number( 1186743888 ); // Concatenate pw hash with time QString auth = passwordMd5() + time; QString authLower = passwordMd5Lower() + time; // Hash the concatenated string to create auth c...
false
false
false
false
false
0
ews_handle_root_item_id_param (ESoapParameter *subparam, EwsAsyncData *async_data) { /* http://msdn.microsoft.com/en-us/library/aa580782%28v=EXCHG.80%29.aspx */ ESoapParameter *attspara; attspara = e_soap_parameter_get_first_child_by_name ( subparam, "RootItemId"); if (attspara ==...
false
false
false
false
false
0
setTreeWidgets( const QList<QTreeWidget *> &treeWidgets ) { foreach ( QTreeWidget* treeWidget, d->treeWidgets ) disconnectTreeWidget( treeWidget ); d->treeWidgets = treeWidgets; foreach ( QTreeWidget* treeWidget, d->treeWidgets ) connectTreeWidget( treeWidget ); d->checkColumns(); setEnabled( !d->...
false
false
false
false
false
0
allowed_enctypes(OM_uint32 *minor_status, krb5_context context, gss_cred_id_t *cred_handle, const gss_buffer_t value) { OM_uint32 major_stat; krb5_error_code ret; size_t len, i; krb5_enctype *enctypes = NULL; krb5_storage *sp = NULL; gsskrb5_cred cred; if (cred_handle == NULL || *c...
false
false
false
false
false
0
qlcnic_82xx_napi_del(struct qlcnic_adapter *adapter) { int ring; struct qlcnic_host_sds_ring *sds_ring; struct qlcnic_recv_context *recv_ctx = adapter->recv_ctx; struct qlcnic_host_tx_ring *tx_ring; for (ring = 0; ring < adapter->drv_sds_rings; ring++) { sds_ring = &recv_ctx->sds_rings[ring]; netif_napi_del(&...
false
false
false
false
false
0
GetOption(const wxString& name, float *v1, float *v2, float *v3, const wxString& delims) const { double nums[3]; if (GetOption(name, nums, 3, delims)) return false; if (v1) *v1 = (float)nums[0]; if (v2) *v2 = (float)nums[1]; if (v3) *v3 = (float)nums[2]; re...
false
false
false
false
false
0
skipws (string, start) char *string; int start; { register int i; int pass_next, backslash_quoted_word; unsigned char peekc; /* skip quoted strings, in ' or ", and words in which a character is quoted with a `\'. */ i = backslash_quoted_word = pass_next = 0; /* Skip leading whitespace (or s...
false
false
false
false
false
0
scanVal(const char **pbp, const char *endptr, char *valBuf, int valBufSize) { const char *bp; char *valBufp; int vallen = 0; PRBool isQuoted; PORT_Assert(valBufSize > 0); /* skip optional leading space */ skipSpace(pbp, endptr); if(*pbp == endptr) { /* nothing left */ retur...
false
false
false
false
false
0
__connman_manager_get_services(connman_manager_get_services_cb_f cb) { DBusMessage *message; if (manager == NULL) return -EINVAL; manager->get_services_cb = NULL; if (manager->get_services_call != NULL) { dbus_pending_call_cancel(manager->get_services_call); dbus_pending_call_unref(manager->get_services_ca...
false
false
false
false
false
0
max77693_resume(struct device *dev) { struct i2c_client *i2c = container_of(dev, struct i2c_client, dev); struct max77693_dev *max77693 = i2c_get_clientdata(i2c); if (device_may_wakeup(dev)) { disable_irq_wake(max77693->irq); enable_irq(max77693->irq); } return 0; }
false
false
false
false
false
0
gridmapdir_newlease(char * encodedglobusidp, char * usernameprefix) { int ret; char *userfilename, *encodedfilename, *gridmapdir; struct dirent *gridmapdirentry; DIR *gridmapdirstream; struct stat statbuf; gridmapdir = g...
false
false
false
false
false
0
radeon_cp_discard_buffer(struct drm_device *dev, struct drm_master *master, struct drm_buf *buf) { drm_radeon_private_t *dev_priv = dev->dev_private; struct drm_radeon_master_private *master_priv = master->driver_priv; drm_radeon_buf_priv_t *buf_priv = buf->dev_private; RING_LOCALS; buf_priv->age = ++master_priv-...
false
false
false
false
false
0
FileIsDirectory(const char* name) { size_t length = strlen(name); if (length == 0) { return false; } // Remove any trailing slash from the name except in a root component. char local_buffer[KWSYS_SYSTEMTOOLS_MAXPATH]; std::string string_buffer; size_t last = length-1; if(last > 0 && (name[las...
false
false
false
false
false
0
efs_bmap(struct inode *inode, efs_block_t block) { if (block < 0) { pr_warn("%s(): block < 0\n", __func__); return 0; } /* are we about to read past the end of a file ? */ if (!(block < inode->i_blocks)) { #ifdef DEBUG /* * i have no idea why this happens as often as it does */ pr_warn("%s(): block ...
false
false
false
false
false
0
getPsPrefsHash() { ostringstream osm; if (userprefsWindow != NULL) { // a CSV string osm << pathToGsInput->value() << ',' << renderInput->value() << ',' << renderInput->value() << ',' << renderInput->value() << ',' << greyCheck->va...
false
false
false
false
false
0
MET_ReadForm(METAIO_STREAM::istream &_fp) { METAIO_STL::streampos pos = _fp.tellg(); METAIO_STL::vector<MET_FieldRecordType *> fields; MET_FieldRecordType* mF = new MET_FieldRecordType; MET_InitReadField(mF, "FormTypeName", MET_STRING, false); mF->required = false; mF->terminateRead = true; fields.push_...
false
false
false
false
false
0
I_get_group_camera(char *group, char *camera) { char buf[200]; FILE *fd; G_suppress_warnings(1); fd = I_fopen_group_camera_old(group); G_suppress_warnings(0); if (!fd) { sprintf(buf, _("Unable to open camera file for group <%s> in mapset <%s>"), group, G_mapset()); G_warning(buf); return...
true
true
false
false
true
1
redraw_block(row, end, wp) int row; int end; win_T *wp; { int col; int width; # ifdef FEAT_CLIPBOARD clip_may_clear_selection(row, end - 1); # endif if (wp == NULL) { col = 0; width = Columns; } else { col = wp->w_wincol; width = wp->w_width; } screen_draw_r...
false
false
false
false
false
0
get_deadlock_weight() const { return (m_lock->key.mdl_namespace() == MDL_key::GLOBAL || m_type >= MDL_SHARED_NO_WRITE ? DEADLOCK_WEIGHT_DDL : DEADLOCK_WEIGHT_DML); }
false
false
false
false
false
0
powil(long double x, int nn) { long double ww, y; long double s; int n, e, sign, asign, lx; if( x == 0.0L ) { if( nn == 0 ) return( 1.0L ); else if( nn < 0 ) return( LDBL_MAX ); else return( 0.0L ); } if( nn == 0 ) return( 1.0L ); if( x < 0.0L ) { asign = -1; x = -x; } else asign = 0; if( nn < 0 ...
false
false
false
false
false
0
HTC_Read(struct worker *w, struct http_conn *htc, void *d, size_t len) { size_t l; unsigned char *p; ssize_t i; CHECK_OBJ_NOTNULL(w, WORKER_MAGIC); CHECK_OBJ_NOTNULL(htc, HTTP_CONN_MAGIC); l = 0; p = d; if (htc->pipeline.b) { l = Tlen(htc->pipeline); if (l > len) l = len; memcpy(p, htc->pipeline.b, l)...
false
true
false
true
true
1
gxhnew (gadouble xsiz, gadouble ysiz, gaint hbufsz) { buffsz = hbufsz; xrsize = xsiz; yrsize = ysiz; hflag = 0; herr = 0; hferr = 0; hpflg = 0; dbmode = 0; if (bopt) bflag = 1; else { hbuff = (short *)malloc(sizeof(short)*buffsz); if (hbuff==NULL) { printf ("Unable to allocate memory ...
false
true
false
false
false
1
oc_satd16_halfpel(const oc_enc_ctx *_enc, const ptrdiff_t *_frag_buf_offs,const ptrdiff_t _fragis[4], int _mvoffset0,int _mvoffset1,const unsigned char *_src, const unsigned char *_ref,int _ystride,unsigned _best_err){ unsigned err; int bi; err=0; for(bi=0;bi<4;bi++){ ptrdiff_t frag_offs; frag_o...
true
true
false
false
false
1
snd_ca0106_mixer(struct snd_ca0106 *emu) { int err; struct snd_card *card = emu->card; char **c; struct snd_kcontrol *vmaster; static char *ca0106_remove_ctls[] = { "Master Mono Playback Switch", "Master Mono Playback Volume", "3D Control - Switch", "3D Control Sigmatel - Depth", "PCM Playback Swi...
false
true
false
false
false
1
nemo_window_add_bookmark_for_current_location (NemoWindow *window) { NemoBookmark *bookmark; NemoWindowSlot *slot; NemoBookmarkList *list; slot = nemo_window_get_active_slot (window); bookmark = slot->current_location_bookmark; list = window->details->bookmark_list; if (!nemo_bookmark_list_contains (list, book...
false
false
false
false
false
0
explode(const std::string& str, size_t begin) { std::vector<std::string> res; std::string temp; enum STATE { INIT, SIMPLE_STRING, QUOTED_STRING, SIMPLE_ESCAPE, QUOTED_ESCAPE } state = INIT; for(size_t idx=begin; idx<str.size(); ++idx) { char c = str[idx]; switch(state) { case INIT: if(c==' ...
false
false
false
false
false
0
dump_row_pbm(int w, byte **data, FILE *dump_file) { byte *r = data[0]; if (dump_file == NULL) return; w = (w+7)>>3; while (w--) { fputc(*r++, dump_file); } }
false
false
false
false
false
0
validate(const CertificateCollection &trusted, const CertificateCollection &untrusted, UsageMode u, ValidateFlags vf) const { QList<Certificate> issuers = trusted.certificates() + untrusted.certificates(); CertificateChain chain; chain += *this; Validity result; chain = chain.complete(issuers, &result); if(result...
false
false
false
false
false
0
init_arrays (void) { int i; for (i=0; i< NUM_SPINES; i++) { kern_list[i] = NOTKERN; delta_list[i] = quarter; path_list[i] = NOTHING; chan_list[i] = 1; note_list[i].next = NULL; } }
false
false
false
false
false
0
substitute_binary (const gchar *commands, const gchar *binary) { gchar **result; gchar **s, **t; gchar *tmp; /* split the commands */ result = g_strsplit (commands, ";", -1); /* (pre-)process the result */ for (s = t = result; *s != NULL; ++s) { if (**s == '\0') { ...
false
false
false
false
false
0
get_lags_param (CMD *cmd, char **ps) { int k = gretl_charpos(';', *ps); int ret = 0; if (k > 0) { char *tmp = gretl_strndup(*ps, k-1); int lag = positive_int_from_string(tmp); if (lag < 0 && gretl_is_scalar(tmp)) { lag = gretl_scalar_get_value(tmp, NULL); free(tmp); tmp = g_strdup_printf...
false
false
false
false
false
0
__db_dlbytes(env, msg, gbytes, mbytes, bytes) ENV *env; const char *msg; u_long gbytes, mbytes, bytes; { DB_MSGBUF mb; const char *sep; DB_MSGBUF_INIT(&mb); /* Normalize the values. */ while (bytes >= MEGABYTE) { ++mbytes; bytes -= MEGABYTE; } while (mbytes >= GIGABYTE / MEGABYTE) { ++gbytes; mbytes...
false
false
false
false
false
0
stcp_wait_for_event(mysocket_t sd, unsigned int flags, const struct timespec *abstime) { unsigned int rc = 0; mysock_context_t *ctx = _mysock_get_context(sd); PTHREAD_CALL(pthread_mutex_lock(&ctx->data_ready_lock)); ...
false
false
false
false
false
0
ssb_pcmcia_write32(struct ssb_device *dev, u16 offset, u32 value) { struct ssb_bus *bus = dev->bus; unsigned long flags; int err; spin_lock_irqsave(&bus->bar_lock, flags); err = select_core_and_segment(dev, &offset); if (likely(!err)) { writew((value & 0x0000FFFF), bus->mmio + offset); writew(((value & 0xFFF...
false
false
false
false
false
0
FinishEditContext(struct edit_context *ec,struct Attributes a,struct Promise *pp) { struct Item *ip; EDIT_MODEL = false; if (DONTDO || a.transaction.action == cfa_warn) { if (ec && !CompareToFile(ec->file_start,ec->filename,a,pp) && ec->num_edits > 0) { cfPS(cf_error,CF_WARN,"",pp,a," -> Should...
false
false
false
false
false
0
kvm_hv_hypercall(struct kvm_vcpu *vcpu) { u64 param, ingpa, outgpa, ret; uint16_t code, rep_idx, rep_cnt, res = HV_STATUS_SUCCESS, rep_done = 0; bool fast, longmode; /* * hypercall generates UD from non zero cpl and real mode * per HYPER-V spec */ if (kvm_x86_ops->get_cpl(vcpu) != 0 || !is_protmode(vcpu)) {...
false
false
false
false
false
0
__db_salvage_markdone(vdp, pgno) VRFY_DBINFO *vdp; db_pgno_t pgno; { DB *dbp; DBT key, data; int pgtype, ret; u_int32_t currtype; pgtype = SALVAGE_IGNORE; dbp = vdp->salvage_pages; memset(&key, 0, sizeof(DBT)); memset(&data, 0, sizeof(DBT)); currtype = SALVAGE_INVALID; data.data = &currtype; data.ulen =...
false
false
false
false
false
0
gplp_service_load (GOPluginLoader *l, GOPluginService *s, GOErrorInfo **err) { if (IS_GNM_PLUGIN_SERVICE_FUNCTION_GROUP (s)) gplp_load_service_function_group (l, s, err); else return FALSE; return TRUE; }
false
false
false
false
false
0
r100FillRectangle3D( void *drv, void *dev, DFBRectangle *rect ) { RadeonDriverData *rdrv = (RadeonDriverData*) drv; RadeonDeviceData *rdev = (RadeonDeviceData*) dev; float x1, y1; float x2, y2; u32 *v; if (rect->w == 1 && rect->h == 1) { ...
false
false
false
false
false
0
e1000_io_write ( struct e1000_hw *hw __unused, unsigned long port, uint32_t value ) { outl ( value, port ); }
false
false
false
false
false
0
unity_webapps_resource_db_lookup_path (const gchar *name_hash) { sqlite3_stmt *lookup_statement; gchar *resource_path; int rc; resource_path = NULL; lookup_statement = db_lookup_prepare_statement (name_hash); UNITY_WEBAPPS_NOTE (RESOURCE, "Resource DB looking up entry: %s", name_hash); if (loo...
false
false
false
false
false
0
put_css_set(struct css_set *cset) { /* * Ensure that the refcount doesn't hit zero while any readers * can see it. Similar to atomic_dec_and_lock(), but for an * rwlock */ if (atomic_add_unless(&cset->refcount, -1, 1)) return; spin_lock_bh(&css_set_lock); put_css_set_locked(cset); spin_unlock_bh(&css_se...
false
false
false
false
false
0
OffsetPoint(vtkIdType ptId, vtkPoints *inPts, double n[3], vtkPoints *newPts, double offset, double *range, double v) { double x[3], xNew[3]; int i; double median = (range[0] + range[1])/2.0; double denom = range[1] - range[0]; inPts->GetPoi...
false
false
false
false
false
0
append_char (const gchar * str, const gchar * c) { gchar buf[10]; gunichar uc = g_utf8_get_char (c); int i; /* Special characters for PostScript */ if (uc == g_utf8_get_char ("(")) return g_strdup_printf ("%s\\(", str); if (uc == g_utf8_get_char (")")) return g_strdup_printf ("%s\\)", str); for (i...
false
false
false
false
false
0
query_status (pixma_t * s) { mp750_t *mp = (mp750_t *) s->subdriver; uint8_t *data; int error; data = pixma_newcmd (&mp->cb, cmd_status, 0, 12); error = pixma_exec (s, &mp->cb); if (error >= 0) { memcpy (mp->current_status, data, 12); PDBG (pixma_dbg (3, "Current status: paper=%u cal=%u lam...
false
false
false
false
false
0
loop_89 (ats_ptr_type arg0, ats_int_type arg1, ats_ptr_type arg2) { /* local vardec */ ATSlocal (anairiats_rec_11, tmp374) ; ATSlocal (anairiats_rec_1, tmp375) ; ATSlocal (ats_ptr_type, tmp376) ; ATSlocal (ats_int_type, tmp377) ; ATSlocal (ats_int_type, tmp378) ; ATSlocal (ats_char_type, tmp379) ; ATSlocal (ats_int_typ...
false
false
false
false
false
0
sdl_open(int w, int h, int fs) { video_init(w, h, fs); center_x = 0; center_y = 0; offset_x = 0; offset_y = 0; scrollbuffer = evbuffer_new(); for (int i = 0; i < 20; i++) evbuffer_add(scrollbuffer, " ", 10); evbuffer_add(scrollbuffer, (char*)infon->version, strl...
false
false
false
false
false
0
get_pindicator_str(char *buf, int max_len) { Address *addr; if (analy && getCurrentAddress(&addr)) { std::auto_ptr<Address> blub(addr); FileOfs o; global_analyser_address_string_format = ADDRESS_STRING_FORMAT_COMPACT; if (get_current_offset(&o)) { return ht_snprintf(buf, max_len, " %y/@%08qx%s ", addr, o, ...
false
false
false
false
false
0
dusolve ( ldm, ncol, M, rhs ) int ldm; /* in */ int ncol; /* in */ double *M; /* in */ double *rhs; /* modified */ { double xj; int jcol, j, irow; jcol = ncol - 1; for (j = 0; j < ncol; j++) { xj = rhs[jcol] / M[jcol + jcol*ldm]; /* M(jcol, jcol) */ rhs[jcol] = xj; for (irow = 0; irow < jcol; ...
false
false
false
false
false
0
type2_infoblock(struct net_device *dev, u_char count, u_char *p) { struct de4x5_private *lp = netdev_priv(dev); u_char len = (*p & BLOCK_LEN)+1; /* Recursively figure out the info blocks */ if (--count > lp->tcount) { if (*(p+len) < 128) { return dc_infoblock[COMPACT](dev, count, p+len); } else ...
false
false
false
false
false
0
utils_font_choose ( GtkWidget *button, gchar **fontname ) { gchar *new_fontname; GtkWidget *dialog; GCallback (*hook) (gchar *, gpointer); dialog = gtk_font_selection_dialog_new (_("Choosing font")); if (*fontname) gtk_font_selection_dialog_set_font_name (GTK_FONT_SELECTION_DIALOG(dialog)...
false
false
false
false
false
0
buffer_lcm (size_t a, size_t b, size_t lcm_max) { size_t size; /* Use reasonable values if buffer sizes are zero. */ if (!a) size = b ? b : 8 * 1024; else { if (b) { /* Return lcm (A, B) if it is in range; otherwise, fall back on A. */ size_t lcm, m, n,...
false
false
false
false
false
0