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
CloseSocket(void) { { ACE_GUARD(LockType, Guard, m_OutBufferLock); if (closing_) return; closing_ = true; peer().close_writer(); } { ACE_GUARD(LockType, Guard, m_SessionLock); m_Session = NULL; } }
false
false
false
false
false
0
on_changed_checkbutton(string id, CheckButton* cbox) { if(cbox->get_active()) { m_pConfig->setValue(this->category, id, m_pConfig->getChecked(this->category, id).c_str()); } else { m_pConfig->setValue(this->category, ...
false
false
false
false
false
0
_set_hidden(GtkToggleAction *action) { char *tmp; if (action) working_sview_config.show_hidden = gtk_toggle_action_get_active(action); if (!working_sview_config.show_hidden) tmp = g_strdup_printf( "Hidden partitions and their jobs are now hidden"); else tmp = g_strdup_printf( "Hidden partitions and t...
false
false
false
false
false
0
setValue(XAP_String_Id id, const gchar * szString) { bool bFoundMultiByte = false; gchar * szDup = NULL; int length; const void* ptr; if (szString && *szString) { UT_GrowBuf gb; UT_decodeUTF8string(szString,strlen(szString),&gb); // TODO The strings that we use (for dialogs and etc) are currently // TO...
false
false
false
true
false
1
AddParticipantOnServer(const RakString &key, const RakNetGUID &guid) { ConnectionState cs = rakPeerInterface->GetConnectionState(guid); if (cs!=IS_CONNECTED) return RPE_ADD_CLIENT_TARGET_NOT_CONNECTED; if (strToGuidHash.HasData(key)==true) return RPE_ADD_CLIENT_NAME_ALREADY_IN_USE; // Name already in use...
false
false
false
false
false
0
FCEUI_SelectState(int w, int show) { FCEUSS_CheckStates(); int oldstate=CurrentState; if(w == -1) { StateShow = 0; return 0; } //mbg merge 7/17/06 had to make return a value CurrentState=w; if(show) { StateShow=180; FCEU_DispMessage("-select state-",0); } return oldstate; }
false
false
false
false
false
0
dri2Flush(struct dri2_screen *psc, __DRIcontext *ctx, struct dri2_drawable *draw, unsigned flags, enum __DRI2throttleReason throttle_reason) { if (ctx && psc->f && psc->f->base.version >= 4) { psc->f->flush_with_flags(ctx, draw->driDrawable, flags, throttle_reason); }...
false
false
false
false
false
0
FreeImage_GetInfoHeader(FIBITMAP *dib) { if(!dib) return NULL; size_t lp = (size_t)dib->data + sizeof(FREEIMAGEHEADER); lp += (lp % FIBITMAP_ALIGNMENT ? FIBITMAP_ALIGNMENT - lp % FIBITMAP_ALIGNMENT : 0); lp += FIBITMAP_ALIGNMENT - sizeof(BITMAPINFOHEADER) % FIBITMAP_ALIGNMENT; return (BITMAPINFOHEADER *)lp; ...
false
false
false
false
false
0
wm8350_bat_get_charge_type(struct wm8350 *wm8350) { int state; state = wm8350_reg_read(wm8350, WM8350_BATTERY_CHARGER_CONTROL_2) & WM8350_CHG_STS_MASK; switch (state) { case WM8350_CHG_STS_OFF: return POWER_SUPPLY_CHARGE_TYPE_NONE; case WM8350_CHG_STS_TRICKLE: return POWER_SUPPLY_CHARGE_TYPE_TRICKLE; ca...
false
false
false
false
false
0
NewIterationContext(char *scopeid,struct Rlist *namelist) { struct Rlist *this,*rp,*rps,*deref_listoflists = NULL; char rtype; void *returnval; enum cfdatatype dtype; struct Scope *ptr = NULL; struct CfAssoc *new; struct Rval newret; Debug("\n*\nNewIterationContext(from %s)\n*\n",scopeid); CopyScope("thi...
false
false
false
false
false
0
mask_irq(struct irq_desc *desc) { if (desc->irq_data.chip->irq_mask) { desc->irq_data.chip->irq_mask(&desc->irq_data); irq_state_set_masked(desc); } }
false
false
false
false
false
0
send_packet(const gearman_packet_st& packet_arg, const bool flush_buffer) { if (options.server_options_sent == false) { for (gearman_server_options_st* head= universal.server_options_list; head; head= head->next) { gearman_packet_st message; const void *args[]= { (void*)(head->...
false
false
false
false
false
0
dc1394_avt_read_shading_img(dc1394camera_t *camera, unsigned char *buf, uint32_t size) { dc1394error_t err; dc1394bool_t en_write; uint32_t addr; /* Enable read at address 0 */ err = dc1394_avt_get_shading_mem_ctrl(camera, &en_write, NULL, NULL); DC1394_ERR_RTN(err,"...
false
false
false
false
false
0
new_pixbuf_from_widget (GtkWidget *widget) { GtkWidget *window; GdkPixbuf *pixbuf; GtkRequisition requisition; GtkAllocation allocation; GdkPixmap *pixmap; gint icon_width; gint icon_height; #define DEFAULT_ICON_HEIGHT 20 #define DEFAULT_ICON_WIDTH 0 icon_width = DEFAULT_ICON_WIDTH; if (!gtk_icon_s...
false
false
false
false
false
0
btrfs_alloc_dev_extent(struct btrfs_trans_handle *trans, struct btrfs_device *device, u64 chunk_tree, u64 chunk_objectid, u64 chunk_offset, u64 start, u64 num_bytes) { int ret; struct btrfs_path *path; struct btrfs_root *root = device->dev_root; struct btrfs_dev_extent *extent; struct extent_buff...
false
false
false
false
false
0
boolDefaultNo(const char *prompt) { cout << prompt << "\n"; cout << _("The default here is No.\n" "Any response that does not begin with 'y' will mean No: "); char answer[10]; char *res = fgets( answer, sizeof(answer), stdin ); cout << "\n"; if(res != 0 && tolower(answer[0]) == '...
false
false
false
false
false
0
SetScalarBarActor(vtkScalarBarActor* actor) { if (this->ScalarBarActor != actor) { vtkSmartPointer<vtkScalarBarActor> oldActor = this->ScalarBarActor; vtkSetObjectBodyMacro(ScalarBarActor, vtkScalarBarActor, actor); if (actor && oldActor) { actor->SetOrientation(oldActor->GetOrientation())...
false
false
false
false
false
0
gt_ppt_hit_cmp(const void *h1, const void *h2) { GtPPTHit* ph1 = *(GtPPTHit**) h1; GtPPTHit* ph2 = *(GtPPTHit**) h2; gt_assert(h1 && h2); return gt_double_compare(ph2->score, ph1->score); }
false
false
false
false
false
0
xmms_playlist_insert_entry (xmms_playlist_t *playlist, const gchar *plname, guint32 pos, xmms_medialib_entry_t file, xmms_error_t *err) { GTree *dict; gint currpos; gint len; xmmsv_coll_t *plcoll; g_mutex_lock (playlist->mutex); plcoll = xmms_playlist_get_...
false
false
false
false
false
0
_Pickler_SetOutputStream(PicklerObject *self, PyObject *file) { _Py_IDENTIFIER(write); assert(file != NULL); self->write = _PyObject_GetAttrId(file, &PyId_write); if (self->write == NULL) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) PyErr_SetString(PyExc_TypeError, ...
false
false
false
false
false
0
builtin_raw_input(PyObject *self, PyObject *args) { PyObject *v = NULL; PyObject *fin = PySys_GetObject("stdin"); PyObject *fout = PySys_GetObject("stdout"); if (!PyArg_UnpackTuple(args, "[raw_]input", 0, 1, &v)) return NULL; if (fin == NULL) { PyErr_SetString(PyExc_RuntimeError, "...
false
false
false
false
false
0
add_weapon_skill(int n) /* number of slots to gain; normally one */ { int i, before, after; for (i = 0, before = 0; i < P_NUM_SKILLS; i++) if (can_advance(i, false)) before++; u.weapon_slots += n; for (i = 0, after = 0; i < P_NUM_SKILLS; i++) if (can_advance(i, false)) after++; ...
false
false
false
false
false
0
luaX_token2str (LexState *ls, int token) { if (token < FIRST_RESERVED) { /* single-byte symbols? */ lua_assert(token == cast_uchar(token)); return luaO_pushfstring(ls->L, "'%c'", token); } else { const char *s = luaX_tokens[token - FIRST_RESERVED]; if (token < TK_EOS) /* fixed format (symbols an...
false
false
false
false
false
0
sgen_client_init (void) { int dummy; MonoThreadInfoCallbacks cb; cb.thread_register = sgen_thread_register; cb.thread_detach = sgen_thread_detach; cb.thread_unregister = sgen_thread_unregister; cb.thread_attach = sgen_thread_attach; cb.mono_method_is_critical = (gboolean (*)(void *))is_critical_method; cb.mono...
false
false
false
false
false
0
canRemovePiece( int x, int y ) { int index = y * PWC + x; int color = m_pieces[index]->m_color; int leftX = x - 1; int rightX = x + 1; int upY = y - 1; int downY = y + 1; return ( leftX >= 0 && m_pieces[y*PWC+leftX]->m_color == color && m_pieces[y*PWC+leftX]->isEnabled() ) || ( righ...
false
false
false
false
false
0
test_gnc_account_foreach_descendant_until (Fixture *fixture, gconstpointer pData) { Account *root = gnc_account_get_root (fixture->acct); Account *first = gnc_account_lookup_by_code (root, "2000"); Account *second = gnc_account_lookup_by_code (root, "4000"); Account *expected = gnc_account_lookup_by_cod...
false
false
false
false
false
0
isValid() const { // We also need to check that this is a 'master' archive here. if((verMajor>=TRPG_NOMERGE_VERSION_MAJOR) && (verMinor>=TRPG_NOMERGE_VERSION_MINOR)) { return true; } else { if (numLods <= 0) { strcpy(errMess, "Number of LOD <= 0"); re...
false
false
false
false
false
0
ath_paprd_calibrate(struct work_struct *work) { struct ath_softc *sc = container_of(work, struct ath_softc, paprd_work); struct ieee80211_hw *hw = sc->hw; struct ath_hw *ah = sc->sc_ah; struct ieee80211_hdr *hdr; struct sk_buff *skb = NULL; struct ath9k_hw_cal_data *caldata = ah->caldata; struct ath_common *comm...
false
false
false
false
false
0
skein384Ctx(void* ctx, unsigned char* dataChunks[], unsigned int dataChunkLength[]) { SkeinCtx_t* hd = reinterpret_cast<SkeinCtx_t*>(ctx); while (*dataChunks) { skeinUpdate(hd, *dataChunks, *dataChunkLength); dataChunks++; dataChunkLength++; } }
false
false
false
false
false
0
sub_integer(int num) { if (stack != 0) { return -1; } fprintf(out, " sub.w #%d, r%d\n", num, REG_STACK(reg-1)); return 0; }
false
false
false
false
false
0
GetDefaultStateFlags(FactionEntry const* factionEntry) const { if (!factionEntry) return 0; uint32 raceMask = m_player->getRaceMask(); uint32 classMask = m_player->getClassMask(); int idx = factionEntry->GetIndexFitTo(raceMask, classMask); return idx >= 0 ? factionEntry->ReputationFlags[i...
false
false
false
false
false
0
ScanForMinMaxZ() { float *pafRowVals = (float *)VSIMalloc2( nRasterXSize, 4 ); if( pafRowVals == NULL ) { CPLError( CE_Failure, CPLE_OutOfMemory, "Unable to allocate row buffer to scan grid file.\n" ); return CE_Failure; } double dfNewMinZ = DBL_MAX; double dfNewMaxZ = -DBL_MAX; int...
false
false
false
false
false
0
flash(gpointer data) { if (!point) return TRUE; if (e_map_point_get_color_rgba (point) == 0xf010d0ff) e_map_point_set_color_rgba (map, point, 0x000000ff); else e_map_point_set_color_rgba (map, point, 0xf010d0ff); return(TRUE); }
false
false
false
false
false
0
check_posix_syntax(const pcre_uchar *ptr, const pcre_uchar **endptr) { pcre_uchar terminator; /* Don't combine these lines; the Solaris cc */ terminator = *(++ptr); /* compiler warns about "non-constant" initializer. */ for (++ptr; *ptr != CHAR_NULL; ptr++) { if (*ptr == CHAR_BACKSLASH && ptr[1] == CHAR_...
false
false
false
false
false
0
main (int argc VL_UNUSED, char *argv[] VL_UNUSED) { int i ; vl_uint32 init [4] = {0x123, 0x234, 0x345, 0x456} ; VlRand rand ; vl_rand_init (&rand) ; vl_rand_seed_by_array (&rand, init, sizeof(init)/sizeof(init[0])) ; printf("1000 outputs of vl_rand_uint32()\n"); for (i=0; i<1000; i++) { printf("%10"...
false
false
false
false
false
0
iom_getxmleleprimUTF8(IOM_OBJECT object,int index) { static char *value=0; if(value){ XMLString::release(&value); } int tag=object->getXmleleAttrName(index); int val_index=object->getXmleleValueIdx(index); const XMLCh *ret=object->getAttrPrim(tag,val_index); if(!ret)return 0; value=iom_toUTF8(ret); return va...
false
false
false
false
false
0
RequestData( vtkInformation *vtkNotUsed(request), vtkInformationVector **vtkNotUsed(inputVector), vtkInformationVector *outputVector) { // get the info object vtkInformation *outInfo = outputVector->GetInformationObject(0); // get the ouptut vtkPolyData *output = vtkPolyData::SafeDownCast( outInfo->G...
false
false
false
false
false
0
NextSideAngle(UsedAreaSide side, float &angle ) { // next possible angle m_stepAngle[side] += (m_searcherHalfSize + 0.01); // prevent jump to another side if (m_stepAngle[side] > M_PI_F) return false; // update angle at attempt jump after next used area while (m_stepAngle[side] <= M_PI...
false
false
false
false
false
0
filebrowser_backend_rename_file(FilebrowserBackend *filebackend,gchar *filename, gchar *current_name, gchar *new_name){ if (g_strcmp0(new_name,current_name)!=0){ filename_rename(filename,new_name); } }
false
false
false
false
false
0
_unpack_trigger_msg(trigger_info_msg_t ** msg_ptr , Buf buffer, uint16_t protocol_version) { int i; uint32_t uint32_tmp; trigger_info_msg_t *msg = xmalloc(sizeof(trigger_info_msg_t)); if (protocol_version >= SLURM_2_5_PROTOCOL_VERSION) { safe_unpack32 (&msg->record_count, buffer); msg->trigger_array = xma...
false
false
false
false
false
0
max_triangle() const { //returns a vector pointing from the vertex to the triangle centroid, scaled by the triangle area vector<float> Areas; int ind=0; Vec vA,temp; for (list<Triangle*>::const_iterator i=_triangles.begin(); i!=_triangles.end(); i++) { temp=(*i)->area(this); Areas.push_b...
false
false
false
false
false
0
gee_array_queue_real_offer_head (GeeDeque* base, gconstpointer element) { GeeArrayQueue * self; gboolean result = FALSE; gpointer* _tmp0_ = NULL; gint _tmp0__length1 = 0; gint _tmp1_ = 0; gpointer* _tmp2_ = NULL; gint _tmp2__length1 = 0; gint _tmp3_ = 0; gpointer* _tmp4_ = NULL; gint _tmp4__length1 = 0; gint...
false
false
false
false
false
0
getMapCategory() { if (strcasecmp(myMapCategory.c_str(), MAP_CATEGORY_2D_MULTI_SOURCES) == 0) { if (myScanTypeList.size() == 1) { const char *scanType = myScanTypeList.front().c_str(); // Override the scan type only if it is the sick laser. Other sensors // must have their scan type specifie...
false
false
false
false
false
0
allocate_struct_function (tree fndecl, bool abstract_p) { tree fntype = fndecl ? TREE_TYPE (fndecl) : NULL_TREE; cfun = ggc_alloc_cleared_function (); init_eh_for_function (); if (init_machine_status) cfun->machine = (*init_machine_status) (); #ifdef OVERRIDE_ABI_FORMAT OVERRIDE_ABI_FORMAT (fndecl); #...
false
false
false
false
false
0
lwrt_C(double a, double b) #endif { char *ba, *bb, bufa[LEFBL], bufb[LEFBL]; int al, bl; al = l_g(bufa, a); for(ba = bufa; *ba == ' '; ba++) --al; bl = l_g(bufb, b) + 1; /* intentionally high by 1 */ for(bb = bufb; *bb == ' '; bb++) --bl; if(f__recpos + al + bl + 3 >= L_len) donewrec(); #ifdef OMIT_BLANK_...
false
false
false
false
false
0
cr_additional_sel_append (CRAdditionalSel * a_this, CRAdditionalSel * a_sel) { CRAdditionalSel *cur_sel = NULL; g_return_val_if_fail (a_sel, NULL); if (a_this == NULL) { return a_sel; } if (a_sel == NULL) return NULL; for (cur_sel = a_t...
false
false
false
false
false
0
makeDecision() { DebugAssert(d_inCheckSat, "Should only be used as a call-back"); Lit litDecision; set<LitPriorityPair>::const_iterator i, iend; Lit lit; for (i = d_prioritySetStart, iend = d_prioritySet.end(); i != iend; ++i) { lit = (*i).getLit(); if (findSplitterRec(lit, getValue(lit), &litDecisio...
false
false
false
false
false
0
find_key(char *map, size_t size, const char *key, size_t len, int icase) { char *ptr = map; size_t ptrlen = size; while (ptrlen > len + 1) { int cmp = (icase) ? strncasecmp(ptr, key, len) : strncmp(ptr, key, len); if (cmp == 0) { if (ptr == map) return ptr; if ((*(ptr - 1) == '\r' || *(ptr - 1) == '\...
false
false
false
false
false
0
defaults() { ModuleList list = allModules; ModuleList::iterator it; for ( it = list.begin() ; it !=list.end() ; ++it ) { (*it)->defaults(); } emit changed( true ); }
false
false
false
false
false
0
__c2port_show_rev_id(struct c2port_device *dev, char *buf) { u8 data; int ret; /* Select REVID register for C2 data register accesses */ c2port_write_ar(dev, C2PORT_REVID); /* Read and return the revision ID register */ ret = c2port_read_dr(dev, &data); if (ret < 0) return ret; return sprintf(buf, "%d\n", ...
false
false
false
false
false
0
contains(std::string segname) { for(std::vector<seginfo>::const_iterator i = begin(); i!=end(); i++){ if(i->name == segname) return true; } return false; }
false
false
false
false
false
0
get_frequency(byte pin, float *fr) { // This function measures the frequency of an external 0 to 5V PULSE on digital inputs, by calling multi_r2rtime(). float ti; if( multi_r2rtime(pin, 0, &ti)) return COMERR; *fr = 1.0e6 / ti; if(ti < 10000) // increase accuracy by averaging { if(multi_r2rtime(pin,9, &ti))...
false
false
false
false
false
0
Load(const char* chrIn) { if (!chrIn) { OUT_LOAD_INST_DATA_FAIL; return; } OUT_LOAD_INST_DATA(chrIn); std::istringstream loadStream(chrIn); loadStream >> m_auiEncounter[0]; for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) { if (m_auiEncounter[i] == IN_PROGRESS) ...
false
false
false
false
false
0
pkix_ProcessingParams_Destroy( PKIX_PL_Object *object, void *plContext) { PKIX_ProcessingParams *params = NULL; PKIX_ENTER(PROCESSINGPARAMS, "pkix_ProcessingParams_Destroy"); PKIX_NULLCHECK_ONE(object); /* Check that this object is a processing params object */ ...
false
false
false
false
false
0
p7_omx_Destroy(P7_OMX *ox) { if (ox == NULL) return; if (ox->x_mem != NULL) free(ox->x_mem); if (ox->dp_mem != NULL) free(ox->dp_mem); if (ox->dpf != NULL) free(ox->dpf); if (ox->dpw != NULL) free(ox->dpw); if (ox->dpb != NULL) free(ox->dpb); free(ox); return; }
false
false
false
false
false
0
selected() const { // make sure our parent select is up-to-date, since that may update our selected bit if (HTMLSelectElementImpl* select = getSelect()) (void)select->listItems(); return m_selected; }
false
false
false
false
false
0
hash (const char * s, long int size) { long int hashval; if (s == NULL) return 0; for(hashval=0; *s!='\0'; s++) hashval = (*s + (hashval << 5) - hashval) % size; return hashval; }
false
false
false
false
false
0
add_sources (FttCell * cell, SourcePar * p) { GSList * i = GTS_SLIST_CONTAINER (p->v->sources)->items; gdouble sum = 0; while (i) { GfsSourceGeneric * s = i->data; if (s->centered_value) sum += (* s->centered_value) (s, cell, p->v); i = i->next; } GFS_VALUE (cell, p->sv) += p->dt*sum; }
false
false
false
false
false
0
hidinput_find_field(struct hid_device *hid, unsigned int type, unsigned int code, struct hid_field **field) { struct hid_report *report; int i, j; list_for_each_entry(report, &hid->report_enum[HID_OUTPUT_REPORT].report_list, list) { for (i = 0; i < report->maxfield; i++) { *field = report->field[i]; for (j ...
false
false
false
false
false
0
parse_merge(unsigned int *count) { struct hash_list *list = NULL, *n, *e = e; const char *from; struct branch *s; *count = 0; while (!prefixcmp(command_buf.buf, "merge ")) { from = strchr(command_buf.buf, ' ') + 1; n = xmalloc(sizeof(*n)); s = lookup_branch(from); if (s) hashcpy(n->sha1, s->sha1); el...
false
false
false
false
true
1
virtscsi_pick_vq(struct virtio_scsi *vscsi, struct virtio_scsi_target_state *tgt) { struct virtio_scsi_vq *vq; unsigned long flags; u32 queue_num; local_irq_save(flags); if (atomic_inc_return(&tgt->reqs) > 1) { unsigned long seq; do { seq = read_seqcount_begin(&tgt->tgt_seq); vq = tgt->req_...
false
false
false
false
false
0
create(int nof_points, GcPoint** points) { if (nof_points != 4 ) return; for (int i = 0; i < 4; i++ ) { data.corners[i] = points[i]; } boundbox = calcBoundBox(); }
false
false
false
false
false
0
pl_reserve_setlk (xlator_t *this, pl_inode_t *pl_inode, posix_lock_t *lock, int can_block) { int ret = -EINVAL; pthread_mutex_lock (&pl_inode->mutex); { ret = __lock_reservelk (this, pl_inode, lock, can_block); if (ret < 0) ...
false
false
false
false
false
0
OnMoveDown(wxCommandEvent& WXUNUSED(event)) { wxListBox* list = XRCCTRL(*this, "lstItems", wxListBox); int sel = list->GetSelection(); if (sel < (int)list->GetCount() - 1) { wxString tmp = list->GetString(sel); list->Delete(sel); list->InsertItems(1, &tmp, sel + 1); list...
false
false
false
false
false
0
test_attr_bug6(hid_t fcpl, hid_t fapl) { hid_t fid; /* File ID */ hid_t gid; /* Group ID */ hid_t aid1, aid2; /* Attribute IDs */ hid_t sid; /* Dataspace ID */ hsize_t dims[ATTR1_RANK] = {ATTR1_DIM1}; /* Attribute dimensions */ int intar[ATTR1_DI...
false
false
false
false
false
0
me2(const int,const Particle & inpart, const ParticleVector & decay, MEOption meopt) const { // check for photons bool photon(_outgoingV[imode()]==ParticleID::gamma); // stuff for incoming particle if(meopt==Initialize) { _rho = RhoDMatrix(PDT::Spin2); TensorWaveFunction:: calcul...
false
false
false
false
false
0
handle_sma_message(struct work_struct *work) { struct hfi1_pportdata *ppd = container_of(work, struct hfi1_pportdata, sma_message_work); struct hfi1_devdata *dd = ppd->dd; u64 msg; int ret; /* msg is bytes 1-4 of the 40-bit idle message - the command code is stripped off */ ret = read_idle_sma(dd, &ms...
false
false
false
false
false
0
mono_string_builder_to_utf8 (MonoStringBuilder *sb) { GError *error = NULL; gchar *tmp, *res = NULL; if (!sb) return NULL; if ((sb->str == sb->cached_str) && (sb->str->length == 0)) { /* * The sb could have been allocated with the default capacity and be empty. * we need to alloc a buffer of the defaul...
false
false
false
false
false
0
dht_node_timed_out(knode_t *kn) { knode_check(kn); /* * If we're no longer connected, do not change any node status: we do * not want to lose all our nodes in case the Internet link is severed. */ if (!GNET_PROPERTY(is_inet_connected)) { if (GNET_PROPERTY(dht_debug)) { g_debug("DHT not connected to Inte...
false
false
false
false
false
0
saveDownloadData() { Log::dbg("saveDownloadData was called for "+this->displayName); if (downloadDataOutputStream.is_open()) { downloadDataOutputStream.close(); if (!deviceDownloadList.empty()) { Log::dbg("Removing file to download from list"); DeviceDownloadData fileElement...
false
false
false
false
false
0
lastCEWithPrimaryBefore(uint32_t p) const { if(p == 0) { return 0; } U_ASSERT(p > elements[elements[IX_FIRST_PRIMARY_INDEX]]); int32_t index = findP(p); uint32_t q = elements[index]; uint32_t secTer; if(p == (q & 0xffffff00)) { // p == elements[index] is a root primary. Find the CE befor...
false
false
false
false
false
0
flush_buffer( int flag ) { /* Terminate the line */ line[line_pos] = '\0'; /* Send the line buffer to the printer */ script_string( line ); flush_script( ); /* Send the line buffer to the screen */ output_string( line ); /* Reset the character count only if a carriage return is e...
false
false
false
false
false
0
commit_split( GncSqlBackend* be, QofInstance* inst ) { gint op; gboolean is_infant; gboolean is_ok; g_return_val_if_fail( inst != NULL, FALSE ); g_return_val_if_fail( be != NULL, FALSE ); is_infant = qof_instance_get_infant( inst ); if ( qof_instance_get_destroying( inst ) ) { ...
false
false
false
false
false
0
bnxt_set_max_func_cp_rings(struct bnxt *bp, unsigned int max) { #if defined(CONFIG_BNXT_BPO_SRIOV) if (BNXT_VF(bp)) bp->vf.max_cp_rings = max; else #endif bp->pf.max_cp_rings = max; }
false
false
false
false
false
0
cos_dict_move_all(cos_dict_t *pcdto, cos_dict_t *pcdfrom) { cos_dict_element_t *pcde = pcdfrom->elements; cos_dict_element_t *head = pcdto->elements; while (pcde) { cos_dict_element_t *next = pcde->next; if (cos_dict_find(pcdto, pcde->key.data, pcde->key.size)) { /* Free the el...
false
false
false
false
false
0
get_shift_symbol(int lhs_symbol) { int item_no, rule_no, symbol; BOOLEAN end_node; struct node *p; if (! symbol_seen[lhs_symbol]) { symbol_seen[lhs_symbol] = TRUE; for (end_node = ((p = clitems[lhs_symbol]) == NULL); ! end_node; end_node = (p == clite...
false
false
false
false
false
0
intro(void) { char *tmpname; srand((unsigned) (time(0L) + getpid())); /* Kick the random number generator */ CATCHALL(uninitgame); if ((tmpname = getlogin()) != 0) { (void) strcpy(name, tmpname); name[0] = toupper(UChar(name[0])); } else (void) strcpy(name, dftname); (void) initscr(); ...
false
true
false
false
true
1
PopulateRadiiMenu () { const GcuAtomicRadius **radius = m_Radii; int i = m_RadiiIndex.size () - 2, j = 1, selected = 0; g_signal_handler_block (RadiusMenu, m_RadiiSignalID); for (int j = 0; j <= i; j++) gtk_combo_box_text_remove (RadiusMenu, 1); m_RadiiIndex.clear (); string str; m_RadiiIndex.push_back (-1); ...
false
false
false
false
false
0
es_str2num_hex(es_str_t *s, int *bSuccess) { long long num; unsigned char *c; unsigned i; i = 0; num = 0; c = es_getBufAddr(s); while(i < s->lenStr && isxdigit(c[i])) { if(isdigit(c[i])) num = num * 16 + c[i] - '0'; else num = num * 16 + tolower(c[i]) - 'a'; ++i; } if(bSuccess != NULL) *bSuccess...
false
false
false
false
false
0
__ecereProp___ecereNameSpace__ecere__sys__GlobalSettings_Set_driver(struct __ecereNameSpace__ecere__com__Instance * this, char * value) { struct __ecereNameSpace__ecere__sys__GlobalSettings * __ecerePointer___ecereNameSpace__ecere__sys__GlobalSettings = (struct __ecereNameSpace__ecere__sys__GlobalSettings *)(this ? (((...
false
true
false
true
false
1
create_feature_nodes(GtTypeCheckerOBO *tco, const char *obo_file_path, GtError *err) { GtOBOParseTree *obo_parse_tree; unsigned long i; gt_error_check(err); gt_assert(tco && obo_file_path); if ((obo_parse_tree = gt_obo_parse_tree_new(obo_file_path, err))) { for (i = 0; i < ...
false
false
false
false
false
0
_elm_mapbuf_smart_sub_object_del(Evas_Object *obj, Evas_Object *sobj) { ELM_MAPBUF_DATA_GET(obj, sd); if (!ELM_WIDGET_CLASS(_elm_mapbuf_parent_sc)->sub_object_del(obj, sobj)) return EINA_FALSE; if (sobj == sd->content) { evas_object_data_del(sobj, "_elm_leav...
false
false
false
false
false
0
find_tag_local (TABLE_T * table, int a, char *name) { if (table != NO_TABLE) { TAG_T *s = NO_TAG; if (a == OP_SYMBOL) { s = OPERATORS (table); } else if (a == PRIO_SYMBOL) { s = PRIO (table); } else if (a == IDENTIFIER) { s = IDENTIFIERS (table); } else if (a == INDICANT) { ...
false
false
false
false
false
0
rssyl_strreplace(const gchar *source, gchar *pattern, gchar *replacement) { gchar *new, *w_new; const gchar *c; guint count = 0, final_length; size_t len_pattern, len_replacement; /* debug_print("RSSyl: ======= strreplace: '%s': '%s'->'%s'\n", source, pattern, replacement); */ if( source == NULL || patter...
false
false
false
false
false
0
resetSequenceEtc(int numberColumns, const int * originalColumns) { int i; for (i=0;i<numberColumns;i++) { if (originalColumns[i]==columnNumber_) break; } if (i<numberColumns) columnNumber_=i; else abort(); // should never happen }
false
false
false
false
false
0
ena_com_init_interrupt_moderation_table(struct ena_com_dev *ena_dev) { size_t size; size = sizeof(struct ena_intr_moder_entry) * ENA_INTR_MAX_NUM_OF_LEVELS; ena_dev->intr_moder_tbl = devm_kzalloc(ena_dev->dmadev, size, GFP_KERNEL); if (!ena_dev->intr_moder_tbl) return -ENOMEM; ena_com_config_default_interru...
false
false
false
false
false
0
add_groups_from_document(Document* document) { Glib::RefPtr<Gnome::Gda::Connection> gda_connection = get_connection(); if(!gda_connection) { std::cerr << G_STRFUNC << ": add_standard_groups(): No connection yet." << std::endl; } // If the connection doesn't support users we can skip this step if(!(gda_...
false
false
false
false
false
0
doCommand() { QModelIndex parent = findIndex(m_rowNumbers); m_model->beginInsertRows(parent, m_startRow, m_endRow); qint64 parentId = parent.internalId(); for (int row = m_startRow; row <= m_endRow; row++) { for(int col = 0; col < m_numCols; col++ ) { if (m_model->m_childItems[parentId].size() <...
false
false
false
false
false
0
ArgusPrintSrcAddr (char *buf, struct ArgusRecord *argus) { void *addr = NULL; struct ArgusFlow *flow; if (argus->ahdr.type & ARGUS_MAR) { ArgusThisProto = ETHERTYPE_IP; addr = &argus->argus_mar.argusid; } else { flow = &argus->argus_far.flow; ArgusThisProto = argus->ahdr.status & 0...
false
false
false
false
false
0
read_file_tgt_tx_stats(struct file *file, char __user *user_buf, size_t count, loff_t *ppos) { struct ath9k_htc_priv *priv = file->private_data; struct ath9k_htc_target_tx_stats cmd_rsp; char buf[512]; unsigned int len = 0; int ret = 0; memset(&cmd_rsp, 0, sizeof(cmd_rsp)); ath9k_htc_ps_wakeup(priv);...
true
true
false
false
false
1
workbench_create(size_t n_workers) { size_t running = 0; struct workbench_t* wb = k_calloc(1, sizeof(struct workbench_t)); if (!wb) return 0; wb->n_workers = n_workers ? n_workers : get_online_cpu_count(); wb->workers = k_calloc(wb->n_workers, sizeof(struct worker_t)); if (!wb->workers) { k_free(wb); retur...
false
false
false
false
false
0
uv_getaddrinfo(uv_loop_t* loop, uv_getaddrinfo_t* req, uv_getaddrinfo_cb cb, const char* hostname, const char* service, const struct addrinfo* hints) { size_t hostname_len; size_t service_len; size_t hints_len; size_t...
false
false
false
false
false
0
f_exists(argvars, rettv) typval_T *argvars; typval_T *rettv; { char_u *p; char_u *name; int n = FALSE; int len = 0; no_autoload = TRUE; p = get_tv_string(&argvars[0]); if (*p == '$') /* environment variable */ { /* first try "normal" environment variables (fast) */ if (mc...
false
false
false
false
false
0
ajListstrPop(AjPList list, AjPStr* Pstr) { if(!list) return ajFalse; if(Pstr) { ajStrDel(Pstr); *Pstr = (AjPStr) listNodeItem(list->First); } if(!listNodeDel(&list->First)) return ajFalse; list->First->Prev = NULL; list->Count--; return ajTrue; }
false
false
false
false
false
0
tcp_dd_recv_response(struct network_client *client) { ssize_t rdlen; struct tcp_dd_package pkg; rdlen = client->recv(client, &pkg, sizeof(pkg)); if (rdlen < (ssize_t) sizeof(pkg.type)) { pr_red_info("inet_recv"); return -EFAULT; } if (pkg.type != TCP_DD_RESPONSE) { pr_red_info("pkg.type = %d", pkg.type)...
false
false
false
false
false
0
sms_log(sms_t * h, char status) { int o; if (*h->oa == '\0' && *h->da == '\0') { return; } o = open(log_file, O_CREAT | O_APPEND | O_WRONLY, AST_FILE_MODE); if (o >= 0) { char line[1000], mrs[3] = "", *p; char buf[30]; unsigned char n; if (h->mr >= 0) { snprintf(mrs, sizeof(mrs), "%02X", h->mr); }...
true
true
false
false
true
1
sysfs_get_uint64(char *id, char *subsys, char *param, uint64_t *value) { char *sysfs_value; *value = -1; sysfs_value = sysfs_get_value(id, subsys, param); if (!sysfs_value) return EIO; if (sscanf(sysfs_value, "%" PRIu64 "\n", value) != 1) return EINVAL; return 0; }
false
false
false
false
false
0
nfs_pseudoflavour_to_name(rpc_authflavor_t flavour) { static const struct { rpc_authflavor_t flavour; const char *str; } sec_flavours[NFS_AUTH_INFO_MAX_FLAVORS] = { /* update NFS_AUTH_INFO_MAX_FLAVORS when this list changes! */ { RPC_AUTH_NULL, "null" }, { RPC_AUTH_UNIX, "sys" }, { RPC_AUTH_GSS_KRB5, "krb...
false
false
false
false
false
0
dyn_array_int_merge (DynIntArray *dst, DynIntArray *src) { int i, j; dyn_array_int_ensure_capacity (&merge_array, dyn_array_int_size (dst) + dyn_array_int_size (src)); dyn_array_int_set_size (&merge_array, 0); for (i = j = 0; i < dyn_array_int_size (dst) || j < dyn_array_int_size (src); ) { if (i < dyn_array_in...
false
false
false
false
false
0
luaM_realloc_ (lua_State *L, void *block, size_t osize, size_t nsize) { global_State *g = G(L); lua_assert((osize == 0) == (block == NULL)); block = (*g->frealloc)(g->ud, block, osize, nsize); if (block == NULL && nsize > 0) luaD_throw(L, LUA_ERRMEM); lua_assert((nsize == 0) == (block == NULL)); g->tota...
false
false
false
false
false
0