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
object_file_name(char *name, size_t n, char *dir, const git_oid *id) { size_t len = strlen(dir); /* check length: 43 = 40 hex sha1 chars + 2 * '/' + '\0' */ if (len+43 > n) return len+43; /* the object dir: eg $GIT_DIR/objects */ strcpy(name, dir); if (name[len-1] != '/') name[len++] = '/'; /* loose objec...
false
false
false
false
false
0
nups (StkId f) { switch (ttype(f)) { case LUA_TFUNCTION: return clvalue(f)->nupvalues; case LUA_TMARK: return infovalue(f)->func->nupvalues; default: return 0; } }
false
false
false
false
false
0
reuse_test_authenticate (SoupSession *session, SoupMessage *msg, SoupAuth *auth, gboolean retrying) { /* Get it wrong the first time, then succeed */ if (!retrying) soup_auth_authenticate (auth, "user", "wrong password"); else soup_auth_authenticate (auth, "user", "password"); }
false
false
false
false
false
0
parseCrashLog_noemit( const QString & filename, bool del ) { static const int g_lineLimit = 16*1024; QFile f( filename ); ViewMap views; if ( !f.open( QIODevice::ReadOnly ) ) return views; QByteArray s( g_lineLimit, 0 ); QTextCodec * codec = QTextCodec::codecForName( "UTF-8" ); Q...
false
false
false
false
false
0
xmlFreeID(xmlIDPtr id) { xmlDictPtr dict = NULL; if (id == NULL) return; if (id->doc != NULL) dict = id->doc->dict; if (id->value != NULL) DICT_FREE(id->value) xmlFree(id); }
false
false
false
false
false
0
libexcwith_error_handler(ScmObj *SCM_FP, int SCM_ARGCNT, void *data_) { ScmObj handler_scm; ScmObj handler; ScmObj thunk_scm; ScmObj thunk; ScmObj rewind_before_scm = SCM_FALSE; int rewind_before; ScmObj SCM_SUBRARGS[2]; ScmObj SCM_OPTARGS = SCM_ARGREF(SCM_ARGCNT-1); int SCM_i; SCM_ENTER_SUBR("with-...
false
false
false
false
false
0
bh1770_psadjusted_to_raw(struct bh1770_chip *chip, u8 ps) { u16 raw; raw = (((u32)ps * BH1770_COEF_SCALER) / chip->prox_coef); if (raw > chip->prox_const) raw = raw - chip->prox_const; else raw = 0; return raw; }
false
false
false
false
false
0
iwl_mvm_rx_tx_cmd(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb) { struct iwl_rx_packet *pkt = rxb_addr(rxb); struct iwl_mvm_tx_resp *tx_resp = (void *)pkt->data; if (tx_resp->frame_count == 1) iwl_mvm_rx_tx_cmd_single(mvm, pkt); else iwl_mvm_rx_tx_cmd_agg(mvm, pkt); }
false
false
false
false
false
0
hud_cargo_scan_update(object *targetp, float frametime) { // update cargo inspection status Cargo_string[0] = 0; if ( targetp->type == OBJ_SHIP ) { Target_display_cargo = player_inspect_cargo(frametime, Cargo_string); if ( Target_display_cargo ) { if ( Player->cargo_inspect_time > 0 ) { hud_targetbox_star...
false
false
false
false
false
0
sendAcctCreateFromKeyRequest(const plString& acctName, const plString& password, const plUuid& key, uint32_t billingType) { const pnNetMsg* desc = GET_Cli2Auth(kCli2Auth_AcctCreateFromKeyRequest); msgparm_t* msg = NCAllocMessage(desc); uint32_t transId = nextTransId(); msg[0].fUint = tra...
false
false
false
false
false
0
ev_view_marshal_BOOLEAN__ENUM_INT_BOOLEAN (GClosure *closure, GValue *return_value G_GNUC_UNUSED, guint n_param_values, const GValue *param_values, ...
false
false
false
false
false
0
get_groups () const { std::set<std::string> result; for (LmMessageNode* node = item->children; node != NULL; node = node->next) { if (g_strcmp0 (node->name, "group") == 0) { if (node->value) { result.insert (node->value); } } } return result; }
false
false
false
false
false
0
translate_trifan_uint2ushort( const void * _in, unsigned start, unsigned nr, void *_out ) { const uint*in = (const uint*)_in; ushort *out = (ushort*)_out; unsigned i, j; (void)j; for (i = start, j = 0; j < nr; j+=6, i++) { (out+j)[0] = (ushort)in[0]; (out+j)[1] = (ushort)in[i+1]; ...
false
false
false
false
false
0
VirtualChannelEntry(PCHANNEL_ENTRY_POINTS pEntryPoints) { railPlugin* rail; DEBUG_RAIL("RAIL plugin VirtualChannelEntry started."); rail = (railPlugin*)xmalloc(sizeof(railPlugin)); memset(rail, 0, sizeof(railPlugin)); rail->plugin.channel_def.options = CHANNEL_OPTION_INITIALIZED | CHANNEL_OPTION_ENCRYPT_RDP |...
false
true
false
false
false
1
cg_window_validate_py (CgWindow *window) { CgWindowPrivate *priv; priv = CG_WINDOW_PRIVATE (window); if (priv->validator != NULL) g_object_unref (G_OBJECT (priv->validator)); priv->validator = cg_validator_new ( GTK_WIDGET (gtk_builder_get_object (priv->bxml, "create_button")), GTK_ENTRY (gtk_builder_get_obje...
false
false
false
false
false
0
carm_handle_scan_chan(struct carm_host *host, struct carm_request *crq, u8 *mem, int error) { u8 *msg_data = mem + IOC_SCAN_CHAN_OFFSET; unsigned int i, dev_count = 0; int new_state = HST_DEV_SCAN_START; DPRINTK("ENTER\n"); carm_end_rq(host, crq, error); if (error) { new_state = HST_ERROR; goto...
false
false
false
false
false
0
gwy_brick_get_val(GwyBrick *brick, gint col, gint row, gint lev) { g_return_val_if_fail(col >= 0 && col < (brick->xres) && row>=0 && row < (brick->yres) && lev>=0 && lev < (brick->zres), 0.0); return brick->...
false
false
false
false
false
0
_bid_to_dpd32 (_Decimal32 *pres, _Decimal32 *px) { unsigned int sign, coefficient_x, exp, dcoeff; unsigned int b2, b1, b0, b01, res; _Decimal32 x = *px; sign = (x & 0x80000000); if ((x & 0x60000000ul) == 0x60000000ul) { /* special encodings */ if ((x & 0x78000000ul) == 0x78000000ul) { *pres = x...
false
false
false
false
false
0
ipr_lock_and_done(struct ipr_cmnd *ipr_cmd) { unsigned long lock_flags; struct ipr_ioa_cfg *ioa_cfg = ipr_cmd->ioa_cfg; spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags); ipr_cmd->done(ipr_cmd); spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags); }
false
false
false
false
false
0
knh_InputStream_parseStmt(CTX ctx, kInputStream *in, kline_t *ul) { BEGIN_LOCAL(ctx, lsfp, 2); DBG_ASSERT(ul[0] != 0); ctx->gma->uline = ul[0]; kStmtExpr *rVALUE = new_Stmt2(ctx, STT_BLOCK, NULL); kTerm *tk = new_Term(ctx, TT_BRACE); KNH_SETv(ctx, lsfp[0].o, rVALUE); KNH_SETv(ctx, lsfp[1].o, tk); InputStream_pa...
false
false
false
false
false
0
contains_white_space(change::pointer cp, string_ty *fn) { pconf_ty *pconf_data = change_pconf_get(cp, 0); if (pconf_data->allow_white_space_in_filenames) return false; return (0 != strpbrk(fn->str_text, "\b\t\n\v\f\r ")); }
false
false
false
false
false
0
gnumeric_linsolve (GnmFuncEvalInfo *ei, GnmValue const * const *argv) { GnmMatrix *A = NULL; GnmMatrix *B = NULL; GnmValue *res = NULL; GORegressionResult regres; A = gnm_matrix_from_value (argv[0], &res, ei->pos); if (!A) goto out; B = gnm_matrix_from_value (argv[1], &res, ei->pos); if (!B) goto out; if (A...
false
false
false
false
false
0
maybe_complain_about_improper_underscores (const char *id) { // Underscores are not allowed at the start, the end, and immediatly // following another underscore. bool underscore_allowed = false; for (const char *cp = id; *cp; cp++) { if (*cp == '_') { if (!underscore_allowed || *(cp+1) == '\0') ...
false
false
false
false
false
0
copyRGBToRGB(Layer& layer, uint i, uint j, int k, int l, QImage& image, int m, int n) { QRgb src = layer.image_tiles[j][i].pixel(k, l); uchar src_a = layer.opacity; if (layer.type == RGBA_GIMAGE) src_a = INT_MULT(src_a, qAlpha(src)); // Apply the mask (if any) if (layer.apply_mask == 1 && layer.mask_tiles.s...
false
false
false
false
false
0
activate_and_exit_units_orders_city_dlg_callback(struct widget *pButton) { if (Main.event.button.button == SDL_BUTTON_LEFT) { struct unit *pUnit = pButton->data.unit; if(pUnit) { popdown_window_group_dialog(pCityDlg->pBeginCityMenuWidgetList, pCityDlg->pEndCit...
false
false
false
false
false
0
interface_gtk_start(Playlist *playlist, int argc, char **argv) { char path[256]; char *home; the_coreplayer = playlist->GetCorePlayer(); g_thread_init(NULL); if (!g_thread_supported()) { alsaplayer_error("Sorry - this interface requires working threads.\n"); return 1; } gdk_threads_init(); // Scope func...
false
false
false
false
false
0
check_ident_usermap(const char *usermap_name, const char *pg_role, const char *ident_user) { bool found_entry = false, error = false; if (usermap_name == NULL || usermap_name[0] == '\0') { ereport(LOG, (errcode(ERRCODE_CONFIG_FILE_ERROR), errmsg("cannot use Ident authentication without use...
false
false
false
false
false
0
ghes_probe(struct platform_device *ghes_dev) { struct acpi_hest_generic *generic; struct ghes *ghes = NULL; int rc = -EINVAL; generic = *(struct acpi_hest_generic **)ghes_dev->dev.platform_data; if (!generic->enabled) return -ENODEV; switch (generic->notify.type) { case ACPI_HEST_NOTIFY_POLLED: case ACPI_H...
false
false
false
false
false
0
dbi_result_get_string_idx(dbi_result Result, unsigned int fieldidx) { const char *my_ERROR = "ERROR"; fieldidx--; _reset_conn_error(RESULT->conn); if (fieldidx >= RESULT->numfields) { _error_handler(RESULT->conn, DBI_ERROR_BADIDX); return my_ERROR; } if (RESULT->field_types[fieldidx] != DBI_TYP...
false
false
false
false
false
0
pres(const Jid &to, const Status &s) { pres(s); tag.setAttribute("to", to.full()); }
false
false
false
false
false
0
recv_wait( int sock, time_t timeout_ms, uint8_t *chunk, size_t chunk_len, struct sockaddr *peer, socklen_t *peerlen, struct sctp_sndrcvinfo *info, int *flags ) { fd_set fds; struct timeval tv; int ret; FD_ZERO( &fds ); FD_SET( sock, &fds ); ...
false
false
false
false
false
0
wdt_set_time(unsigned int timeout) { int ret; ret = superio_enter(); if (ret) return ret; superio_select(W83627HF_LD_WDT); superio_outb(cr_wdt_timeout, timeout); superio_exit(); return 0; }
false
false
false
false
false
0
bounds_check_datadir (DataDirectory *dir, guint32 offset, guint32 size) { if (dir->translated_offset > offset) return FALSE; if (dir->size < size) return FALSE; return offset + size <= dir->translated_offset + dir->size; }
false
false
false
false
false
0
add(GroveImpl &grove, const DataEvent &event) { size_t dataLen = event.dataLength(); if (dataLen) { DataChunk *chunk = grove.pendingData(); if (chunk && event.location().origin().pointer() == grove.currentLocOrigin() && event.location().index() == chunk->locIndex + chunk->size && grove.tr...
false
false
false
false
false
0
n_frac_digits( double v) { int d = 0; double dummy; while ( fabs( modf( v, &dummy)) > 1e-6 ) { v *= 10.; ++d; } return d; } }
false
false
false
false
false
0
set_decl_origin_self (decl) tree decl; { if (DECL_ABSTRACT_ORIGIN (decl) == NULL_TREE) { DECL_ABSTRACT_ORIGIN (decl) = decl; if (TREE_CODE (decl) == FUNCTION_DECL) { tree arg; for (arg = DECL_ARGUMENTS (decl); arg; arg = TREE_CHAIN (arg)) DECL_ABSTRACT_ORIGIN (arg) = arg; if (DECL...
false
false
false
false
false
0
DPXRowOctets(const unsigned long rows, const unsigned int samples_per_row, const unsigned int bits_per_sample, const ImageComponentPackingMethod packing_method) { size_t octets = 0; switch(bits_per_sample) { case 1: ...
false
false
false
false
false
0
calc_hmm_state_emission_logp(int n_windows, char sex, unsigned char *window_chr, double **cn_emission_logp, double **hmm_state_emission_logp) { int i, j; for (i = 0; i < n_wind...
false
false
false
false
false
0
apply(ast_sent* sent) { if(sent->get_nodetype() != AST_ASSIGN) return true; ast_assign* assign = (ast_assign*) sent; ast_expr* rhs = assign->get_rhs(); if(!rhs->is_mapaccess()) return true; ast_expr_mapaccess* expr_map_access = (ast_expr_mapaccess*) rhs; ast_mapaccess* ...
false
false
false
false
false
0
clutter_x11_texture_pixmap_sync_window_internal (ClutterX11TexturePixmap *texture, int x, int y, int width, ...
false
false
false
false
false
0
H5R_get_region(H5F_t *file, hid_t dxpl_id, const void *_ref) { H5O_loc_t oloc; /* Object location */ const uint8_t *p; /* Pointer to OID to store */ H5HG_t hobjid; /* Heap object ID */ uint8_t *buf = NULL; /* Buffer to store serialized selection in */ H5S_t ...
false
false
false
false
false
0
FixSignedValues(unsigned char *data, int size, unsigned step, unsigned endian) { if(endian != MSBEndian) { data += step - 1; /* LSB has most signifficant byte at the end */ } /* MSB has most signifficant byte first */ while(size-->0) { *data ^= 0x80; data += step; } }
true
true
false
false
false
1
DatumIsReadWriteExpandedObject(Datum d, bool isnull, int16 typlen) { /* Reject if it's NULL or not a varlena type */ if (isnull || typlen != -1) return false; /* Reject if not a read-write expanded-object pointer */ if (!VARATT_IS_EXTERNAL_EXPANDED_RW(DatumGetPointer(d))) return false; return true; }
false
false
false
false
false
0
FractionalToCartesian(vector3 frac) const { return _mOrient * _mOrtho * frac + _offset; }
false
false
false
false
false
0
deleteGlobalRef(jobject obj, int id) { if (obj) { if (id) /* zero when obj is weak global ref */ { lock locked; for (std::multimap<int, countedRef>::iterator iter = refs.find(id); iter != refs.end(); iter++) { if (iter->...
false
false
false
false
false
0
checkWebPort(char* buf, int capacity) { //logger(L_DBG,"[DS]: checkWebPort"); if (queueExists(Q_WEB) != RC_OK) { return 0; } //logger(L_DBG,"[WS]: checkWebPort queueExists"); int l = 0; // Verify commands from queue (timeout about 1/2 sec) wMessage* wm = (wMessage*) queuePop(Q_WE...
true
true
false
false
false
1
isLoadTypeLegal(Type *Ty, MVT &VT) { if (isTypeLegal(Ty, VT)) return true; // If this is a type than can be sign or zero-extended to a basic operation // go ahead and accept it now. if (VT == MVT::i1 || VT == MVT::i8 || VT == MVT::i16) return true; return false; }
false
false
false
false
false
0
calcWidth(bool calledFromInit) { // Check that above threshold. if (ps == 0.) return; // Widths to quark pairs. if (id1Abs > 9) return; if (calledFromInit) { widNow = preFac * ps * (pow2(eDgv[min(id1Abs, 9)]) * (1. + 2.*mr1) + pow2(eDga[min(id1Abs, 9)]) * (1. - 4.*mr1) ); } else { // Relati...
false
false
false
false
false
0
getrule() { // return canonical rule string static char canonrule[MAXRULESIZE]; sprintf(canonrule, "%s", RULE_STRINGS[current_rule]); if (gridwd > 0 || gridht > 0) { // setgridsize() was successfully called above, so append suffix int len = (int)strlen(canonrule); const char* bounds = cano...
false
false
false
false
false
0
createRemoteLogFile(struct addrinfo *logHost, BYTE protocolLog) { uint32_t port; createSignalingLogChannel(protocolLog); switch(protocolLog) { case L4_PROTO_UDP : logSock = socket(logHost->ai_family, SOCK_DGRAM, 0); if (logSock < 0) ReportErrorAndExit("createRemoteLogFile","socket DATA...
false
false
false
false
false
0
iwl_power_set_mode(struct iwl_priv *priv, struct iwl_powertable_cmd *cmd, bool force) { int ret; bool update_chains; lockdep_assert_held(&priv->mutex); /* Don't update the RX chain when chain noise calibration is running */ update_chains = priv->chain_noise_data.state == IWL_CHAIN_NOISE_DONE || priv-...
false
true
false
false
false
1
decodeVarWidthCharString (OOCTXT* pctxt, const char** pvalue) { int stat; ASN1OCTET* tmpstr; ASN1UINT len; /* note: need to save size constraint for use in alignCharStr */ /* because it will be cleared in decodeLength from the context.. */ Asn1SizeCnst* psize = pctxt->pSizeConstra...
false
false
false
false
false
0
GetPacketSizeFromHeader(const byte* rawHeader) { Header_Struct* header = (Header_Struct*)rawHeader; uint32 size = ENDIAN_SWAP_32(header->packetlength); if (size < 1 || size >= 0x7ffffff0u) return 0; return size - 1; }
false
false
false
false
false
0
efreet_desktop_changes_cb(void *data __UNUSED__, Ecore_File_Monitor *em __UNUSED__, Ecore_File_Event event, const char *path) { const char *ext; /* TODO: If we get a stale symlink, we need to rerun cache creation */ /* TODO: Check for desktop*.cache, as this will be created...
false
false
false
false
false
0
presentity_view_set_property (GObject* obj, guint prop_id, const GValue* value, GParamSpec* spec) { PresentityView* self = NULL; Ekiga::Presentity* presentity = NULL; self = (PresentityView* )obj; switch (prop_id) { case PRESENTITY_VIEW_PROP_PRESENTITY: presentity = (Ekiga::P...
false
false
false
false
false
0
default_valid_pointer_mode (enum machine_mode mode) { return (mode == ptr_mode || mode == Pmode); }
false
false
false
false
false
0
lb_tx_method_set(struct team *team, struct team_gsetter_ctx *ctx) { struct lb_priv *lb_priv = get_lb_priv(team); lb_select_tx_port_func_t *func; func = lb_select_tx_port_get_func(ctx->data.str_val); if (!func) return -EINVAL; rcu_assign_pointer(lb_priv->select_tx_port_func, func); return 0; }
false
false
false
false
false
0
gcrypt_set_key(void **ctx, void *arg1, void *arg2 __unused, const u_int8_t *key, int keybits __unused) { gcry_cipher_hd_t *cipher_hd = (gcry_cipher_hd_t *)ctx; int cipher = *((int *)arg1); gcry_error_t gcry_err; gcry_err = gcry_cipher_open( cipher_hd, cipher, GCRY_CIPHER_MODE_ECB, 0); if ...
false
false
false
false
false
0
dns_zone_allocate (ptr, file, line) struct dns_zone **ptr; const char *file; int line; { struct dns_zone *d; if (!ptr) { log_error ("%s(%d): null pointer", file, line); #if defined (POINTER_DEBUG) abort (); #else return 0; #endif } if (*ptr) { log_error ("%s(%d): non-null pointer", file, line); #if defi...
false
false
false
false
false
0
sendto_monitor(struct monitor *monptr, const char *pattern, ...) { va_list args; buf_head_t linebuf; struct Client *target_p; rb_dlink_node *ptr; rb_dlink_node *next_ptr; rb_linebuf_newbuf(&linebuf); va_start(args, pattern); rb_linebuf_putmsg(&linebuf, pattern, &args, NULL); va_end(args); RB_DLINK_FOREA...
false
false
false
false
false
0
rfc2732(AtomPtr name) { char buf[38]; int rc; AtomPtr a = NULL; if(name->length < 38 && name->string[0] == '[' && name->string[name->length - 1] == ']') { struct in6_addr in6a; memcpy(buf, name->string + 1, name->length - 2); buf[name->length - 2] = '\0'; rc = in...
true
true
false
false
true
1
proc_register(const char *progname, const char *clienthost, const char *userid, const char *mailbox) { unsigned pid; int pos; if (!procfname) { pid = getpid(); if (config_getstring(IMAPOPT_PROC_PATH)) { const char *procpath = config_getstring(IMAPOPT_PROC_PATH); int len = strlen(procpath);...
false
true
false
false
true
1
m_Direction(Object *in, Object *out) { Vector v; float az, el, r; if(in[0]) { if(!DXExtractFloat(in[0], &az)) { DXSetError(ERROR_BAD_PARAMETER, "#10080", "azimuth"); return ERROR; } } else az = 0.0; if(in[1]) { if(!DXExtractFloat(in[1], &el)) { DXSetError(ERROR_BAD_PARAMETER...
false
false
false
false
false
0
print_flag(FILE *out, const sid &it) { if (it.valid()) it.print(out); else fputs("none", out); }
false
false
false
false
false
0
log_add_targets(LOG_REC *log, const char *targets, const char *tag) { char **tmp, **items; g_return_if_fail(log != NULL); g_return_if_fail(targets != NULL); items = g_strsplit(targets, " ", -1); for (tmp = items; *tmp != NULL; tmp++) log_item_add(log, LOG_ITEM_TARGET, *tmp, tag); g_strfreev(it...
false
false
false
false
false
0
vcv_slopes (panelmod_t *pan, const MODEL *pmod, int op) { int idx, i, j; int mj, mi = 0; int sj, si = 0; double x; for (i=0; i<pan->nbeta; i++) { if (vcv_skip(pmod, mi, pan, op)) { i--; mi++; continue; } mj = mi; sj = si; for (j=i; j<pan->nbeta; j++) { if (vcv_skip(pmod, mj...
false
false
false
false
false
0
gst_camerabin_preview_send_event (GstCameraBinPreviewPipelineData * data, GstEvent * evt) { GstElement *src; src = gst_bin_get_by_name (GST_BIN (data->pipeline), "prev_src"); if (!src) { GST_WARNING ("Preview pipeline doesn't have src element, can't push event"); gst_event_unref (evt); return FAL...
false
false
false
false
false
0
writeAndReadData(int fd, unsigned char socketID, const unsigned char *cmd, int cmd_len, int eoj, unsigned char *buf, int len, int *sndSz, int *rcvSz, int (*test)(const unsigned char *buf)) { int ret; int retry = 5; int credit = askForCredit(fd, socketID, sndSz, rcvSz); if (credit < 0) ...
false
false
false
false
true
1
txc_analog_lane_power(struct efx_nic *efx, int mmd) { int txpd = (1 << TXC_ATXCTL_TXPD3_LBN) | (1 << TXC_ATXCTL_TXPD2_LBN) | (1 << TXC_ATXCTL_TXPD1_LBN) | (1 << TXC_ATXCTL_TXPD0_LBN); int rxpd = (1 << TXC_ARXCTL_RXPD3_LBN) | (1 << TXC_ARXCTL_RXPD2_LBN) | (1 << TXC_ARXCTL_RXPD1_LBN) | (1 << TXC_ARXCTL_RXPD0_LBN); ...
false
false
false
false
false
0
isert_release_work(struct work_struct *work) { struct isert_conn *isert_conn = container_of(work, struct isert_conn, release_work); isert_info("Starting release conn %p\n", isert_conn); wait_for_completion(&isert_conn->wait); mutex_lock(&isert_conn->mutex); isert_conn->state = ISER_CONN_DO...
false
false
false
false
false
0
getQualifiedName(Node *n) { String *name = Copy(Getattr(n, "name")); n = parentNode(n); while (n != NIL) { const String *type = nodeType(n); if ((Strcmp(type, "class") == 0) || (Strcmp(type, "struct") == 0) || (Strcmp(type, "namespace") == 0)) { String *newname = NewStringf("%s::%s", Getattr(n,...
false
false
false
false
false
0
getPlaneEquationsFromVertices(btAlignedObjectArray<btVector3>& vertices, btAlignedObjectArray<btVector3>& planeEquationsOut ) { const int numvertices = vertices.size(); // brute force: for (int i=0;i<numvertices;i++) { const btVector3& N1 = vertices[i]; for (int j=i+1;j<numvertices;j++) { const btVect...
false
false
false
false
false
0
converters_init(PyObject* dict) { converters = PyDict_New(); if (!converters) { return; } PyDict_SetItemString(dict, "converters", converters); }
false
false
false
false
false
0
addremove_cmd(void){ Blob path; const char *zCleanFlag = find_option("clean",0,1); const char *zIgnoreFlag = find_option("ignore",0,1); unsigned scanFlags = find_option("dotfiles",0,0)!=0 ? SCAN_ALL : 0; int dryRunFlag = find_option("dry-run","n",0)!=0; int n; Stmt q; int vid; int nAdd = 0; int nDel...
false
false
false
false
false
0
on_wvdial_out (GIOChannel *source, GIOCondition condition, gpointer data) { gchar *line; GIOStatus status; status = g_io_channel_read_line (source, &line, NULL, NULL, NULL); if (status != G_IO_STATUS_NORMAL) return FALSE; g_print ("GNOME PPP: STDOUT: %s", line); g_free (line); return TRUE; }
false
false
false
false
false
0
param_set_invbool(const char *val, const struct kernel_param *kp) { int ret; bool boolval; struct kernel_param dummy; dummy.arg = &boolval; ret = param_set_bool(val, &dummy); if (ret == 0) *(bool *)kp->arg = !boolval; return ret; }
false
false
false
false
false
0
fread32 (FILE *f, unsigned long int *y) { enum SIZE {SZ = 4}; int i; unsigned long int x; unsigned char p[SZ]; bool_t ok; ok = (SZ == fread (p, sizeof(unsigned char), SZ, f)); if (ok) { for (x = 0, i = 0; i < SZ; i++) { x |= (unsigned long int)p[i] << (i*8); } *y = x; } return ok; }
false
false
false
false
false
0
should_filter_query(ns_msg msg, struct in_addr dns_addr) { ns_rr rr; int rrnum, rrmax; void *r; // TODO cache result for each dns server int dns_is_chn = 0; int dns_is_foreign = 0; if (chnroute_file && (dns_servers_len > 1)) { dns_is_chn = test_ip_in_list(dns_addr, &chnroute_list); dns_is_foreign ...
false
false
false
false
false
0
http_get_strbuf(const char *url, struct strbuf *result, int options) { int http_ret = http_request(url, result, HTTP_REQUEST_STRBUF, options); if (http_ret == HTTP_REAUTH) { http_ret = http_request(url, result, HTTP_REQUEST_STRBUF, options); } return http_ret; }
false
false
false
false
false
0
isBlockOnlyReachableByFallthrough(const MachineBasicBlock *MBB) const { // If this is a landing pad, it isn't a fall through. If it has no preds, // then nothing falls through to it. if (MBB->isLandingPad() || MBB->pred_empty()) return false; // If there isn't exactly one predecessor, it can't be a fall t...
false
false
false
false
false
0
rot_nodal_plane(struct nodal_plane PLAN,struct nodal_plane PREF,struct nodal_plane *PLANR) /* Calcule l'azimut, le pendage, le glissement relatifs d'un mecanisme par rapport a un plan de reference PREF defini par son azimut et son pendage. On regarde la demi-sphere derriere le plan. Les angles sont en de...
false
false
false
false
false
0
gnome_online_accounts_config_smtp (EGnomeOnlineAccounts *extension, ESource *source, GoaObject *goa_object) { GoaMail *goa_mail; ESourceCamel *camel_extension; ESourceBackend *backend_extension; GSocketConnectable *network_address; CamelSettings...
false
false
false
false
false
0
go_color_selector_set_color (GOSelector *selector, GOColor color) { GOColorSelectorState *state; int index; g_return_val_if_fail (GO_IS_SELECTOR (selector), FALSE); state = go_selector_get_user_data (selector); g_return_val_if_fail (state != NULL, FALSE); index = get_index (state->n_swatches, state->color_gro...
false
false
false
false
false
0
clear_secrets_tries (NMDevice *device) { NMActRequest *req; NMConnection *connection; req = nm_device_get_act_request (device); if (req) { connection = nm_act_request_get_connection (req); /* Clear wired secrets tries on success, failure, or when deactivating */ g_object_set_data (G_OBJECT (connection), WIRE...
false
false
false
false
false
0
fixquota_fixroot(struct mailbox *mailbox, const char *root) { int r; printf("%s: quota root %s --> %s\n", mailbox->name, mailbox->quotaroot ? mailbox->quotaroot : "(none)", root ? root : "(none)"); r = mailbox_set_quotaroot(mailbox, root); if (r) errmsg("failed writing header for mailbo...
false
false
false
false
false
0
gnc_prefs_bind (const gchar *group, /*@ null @*/ const gchar *pref_name, gpointer object, const gchar *property) { if (prefsbackend && prefsbackend->bind) (prefsbackend->bind) (group, pref_name, object, property); }
false
false
false
false
false
0
OnScriptMoveDown(cb_unused wxSpinEvent& event) { wxListBox* ctrl = XRCCTRL(*this, "lstPreScripts", wxListBox); if (!ctrl || ctrl->GetSelection() == (int)(ctrl->GetCount()) - 1) return; wxTreeCtrl* tc = XRCCTRL(*this, "tcOverview", wxTreeCtrl); wxTreeItemId sel = tc->GetSelection(); CompileO...
false
false
false
false
false
0
serpent_setkey_internal (serpent_context_t *context, const byte *key, unsigned int key_length) { serpent_key_t key_prepared; serpent_key_prepare (key, key_length, key_prepared); serpent_subkeys_generate (key_prepared, context->keys); #ifdef USE_AVX2 context->use_avx2 = 0; if ((_gcry_get_hw_features () &...
false
false
false
false
false
0
addLocations( PD_RDFLocations& ret, bool isGeo84, const std::string sparql, PD_RDFModelHandle /*alternateModel*/ ) { PD_DocumentRDFHandle rdf = getDocument()->getDocumentRDF(); PD_RDFQuery q( rdf, rdf ); PD_ResultBindi...
false
false
false
false
false
0
errmsg_internal(const char *fmt,...) { ErrorData *edata = &errordata[errordata_stack_depth]; MemoryContext oldcontext; recursion_depth++; CHECK_STACK_DEPTH(); oldcontext = MemoryContextSwitchTo(ErrorContext); EVALUATE_MESSAGE(message, false, false); MemoryContextSwitchTo(oldcontext); recursion_depth--; ret...
false
false
false
false
false
0
__erst_write_to_storage(u64 offset) { struct apei_exec_context ctx; u64 timeout = FIRMWARE_TIMEOUT; u64 val; int rc; erst_exec_ctx_init(&ctx); rc = apei_exec_run_optional(&ctx, ACPI_ERST_BEGIN_WRITE); if (rc) return rc; apei_exec_ctx_set_input(&ctx, offset); rc = apei_exec_run(&ctx, ACPI_ERST_SET_RECORD_OFF...
false
false
false
false
false
0
on_view_refresh (GtkAction *action, GitgWindow *window) { if (window->priv->repository && gitg_repository_exists (window->priv->repository)) { gitg_repository_reload (window->priv->repository); } }
false
false
false
false
false
0
animateRemove( const QList<BallItem*>& list ) { m_moveTimeLine.stop(); m_removeTimeLine.stop(); if(list.isEmpty()) { emit removeFinished(); return; } m_removedBalls = list; // called here (not in constructor), to stay in sync in case theme's reloaded m_removeTimeLine.s...
false
false
false
false
false
0
udf_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) { struct inode *inode = file_inode(filp); long old_block, new_block; int result = -EINVAL; if (inode_permission(inode, MAY_READ) != 0) { udf_debug("no permission to access inode %lu\n", inode->i_ino); result = -EPERM; goto out; } if (!arg) ...
false
false
false
false
false
0
nm_vpn_plugin_set_config (NMVPNPlugin *plugin, GHashTable *config) { NMVPNPluginPrivate *priv = NM_VPN_PLUGIN_GET_PRIVATE (plugin); GValue *val; g_return_if_fail (NM_IS_VPN_PLUGIN (plugin)); g_return_if_fail (config != NULL); priv->got_config = TRUE; val = g_hash_table_lookup (config,...
false
false
false
false
false
0
read_prop(char *dev, char *prop, long *value) { char fname[IFNAMSIZ+25], buf[80], *endp; ssize_t len; int fd; long result; sprintf(fname, "/sys/class/net/%s/%s", dev, prop); fd = open(fname, O_RDONLY); if (fd < 0) { if (strcmp(prop, "tun_flags")) fprintf(stderr, "open %s: %s\n", fname, strerror(errno))...
true
true
false
false
true
1
snd_hdac_bus_queue_event(struct hdac_bus *bus, u32 res, u32 res_ex) { unsigned int wp; if (!bus) return; trace_hda_unsol_event(bus, res, res_ex); wp = (bus->unsol_wp + 1) % HDA_UNSOL_QUEUE_SIZE; bus->unsol_wp = wp; wp <<= 1; bus->unsol_queue[wp] = res; bus->unsol_queue[wp + 1] = res_ex; schedule_work(&bu...
false
false
false
false
false
0
ci_request_link_speed_change_before_state_change(struct amdgpu_device *adev, struct amdgpu_ps *amdgpu_new_state, struct amdgpu_ps *amdgpu_current_state) { struct ci_power_info *pi = ci_get_pi(adev); enum amdgpu_pcie_gen target_link_speed = ci_get_maximum_link_speed(adev, amdgpu_new_state); ...
false
false
false
false
false
0
go_font_sel_set_font (GOFontSel *fs, GOFont const *font) { g_return_if_fail (GO_IS_FONT_SEL (fs)); go_font_sel_set_font_desc (fs, font->desc); go_font_sel_set_strikethrough (fs, font->strikethrough); go_font_sel_set_uline (fs, font->underline); go_font_sel_set_color (fs, font->color, FALSE); }
false
false
false
false
false
0
approxlog2(unsigned x) { int ret = 31*8; /* * Binary-search to get the top bit of x up to bit 31. */ if (x < 0x00010000U) x <<= 16, ret -= 16*8; if (x < 0x01000000U) x <<= 8, ret -= 8*8; if (x < 0x10000000U) x <<= 4, ret -= 4*8; if (x < 0x40000000U) x <<= 2, ret -= 2*8; if (...
false
false
false
false
false
0