BOOL DialogGlobalDataName::OnInitDialog() { CDialog::OnInitDialog(); char *selectString = NULL; // TODO: この位置に初期化の補足処理を追加してください SendDlgItemMessage(IDC_GLOBALDATA_NAME, CB_RESETCONTENT, (WPARAM)0, (LPARAM)0L); for (AnchorNode *info = GetWorld()->getGlobalDataNodes(); info; info=info->next()) { CGlobalData gdata(info); SendDlgItemMessage(IDC_GLOBALDATA_NAME, CB_ADDSTRING, 0, (LONG)(LPSTR)gdata.getName()); if (!selectString) selectString = gdata.getName(); } Node *node = getNode(); if (node && node->isAnchorNode()) { if (GetWorld()->isGlobalData((AnchorNode *)node)) { CGlobalData gdata((AnchorNode *)node); SendDlgItemMessage(IDC_GLOBALDATA_NAME, CB_SELECTSTRING,(WPARAM)-1, (LPARAM)(LPCSTR)gdata.getName()); } else if (selectString) SendDlgItemMessage(IDC_GLOBALDATA_NAME, CB_SELECTSTRING,(WPARAM)-1, (LPARAM)(LPCSTR)selectString); } else if (selectString) SendDlgItemMessage(IDC_GLOBALDATA_NAME, CB_SELECTSTRING,(WPARAM)-1, (LPARAM)(LPCSTR)selectString); return TRUE; // コントロールにフォーカスを設定しないとき、戻り値は TRUE となります // 例外: OCX プロパティ ページの戻り値は FALSE となります }
DWORD WINAPI fsUploadsMgr::_threadDeleteUploads(LPVOID lp) { UPLS_LIST *pv = (UPLS_LIST*) lp; UINT msg = RegisterWindowMessage (_pszUploadsDeletedNotifyMsg); UINT nMemId = InterlockedIncrement (_UplsMgr.m_pnNextSharedMemId); CString str; str.Format (_pszSharedMemoryName, nMemId); vmsSharedDataT <UINT> gdata (str, FALSE, pv->size ()); int cUplds = 0; for (size_t i = 0; i < pv->size (); i++) { vmsUploadSmartPtr upl = pv->at (i); if ((upl->dwFlags & UF_READONLY) == 0) { upl->pMgr->StopUploading (TRUE); upl->pMgr->DeleteZipFile (); } if ((upl->dwFlags & UF_DONTNOTIFYABOUTDELETE) == 0) gdata [cUplds++] = upl->nID; } DWORD dw; if (cUplds) SendMessageTimeout (HWND_BROADCAST, msg, cUplds, nMemId, 0, 5000, &dw); delete pv; return 0; }
void CUploadsWnd::OnDeleteUploads(int cUploads, UINT nIdMem) { CString str; str.Format (_pszSharedMemoryName, nIdMem); vmsSharedDataT <UINT> gdata (str, TRUE, cUploads); UPLS_LIST v; for (int i = 0; i < cUploads; i++) { vmsUploadSmartPtr upl = _UplsMgr.FindUploadById (gdata [i]); if (upl == NULL) continue; upl->dwFlags |= UF_DONTNOTIFYABOUTDELETE; v.push_back (upl); } if (v.size ()) _UplsMgr.DeleteUploads (v); }
/* * dump all static variables */ void dumpglbs (void) { long i = 1; int dim, list_size, line_count; int j; FILE *save = output; if (!data) data = fmemopen(data_buf, DATABUFSIZE, "w"); if (!rodata) rodata = fmemopen(rodata_buf, DATABUFSIZE, "w"); /* This is done in several passes: Pass 0: Dump initialization data into const bank. Pass 1: Define space for uninitialized data. Pass 2: Define space for initialized data. */ if (glbflag) { int pass = 0; next: i = 1; for (cptr = rglbptr; cptr < glbptr; cptr++) { if (cptr->ident != FUNCTION) { // ppubext(cptr); if ((cptr->storage & WRITTEN) == 0 && /* Not yet written to file */ cptr->storage != EXTERN) { dim = cptr->offset; if (find_symbol_initials(cptr->name)) { // has initials /* dump initialization data */ if (pass == 1) /* initialized data not handled in pass 1 */ continue; else if (pass == 2) { /* define space for initialized data */ output = data; if (cptr->storage != LSTATIC) prefix(); outstr(cptr->name); outstr(":\t"); defstorage(); outdec(cptr->size); nl(); cptr->storage |= WRITTEN; output = save; continue; } /* output initialization data into const bank */ output = rodata; have_init_data = 1; list_size = 0; line_count = 0; list_size = get_size(cptr->name); if (cptr->type == CSTRUCT) list_size /= tag_table[cptr->tagidx].number_of_members; if (dim == -1) dim = list_size; int item; /* dim is an item count for non-compound types and a byte size for compound types; dump_struct() wants an item number, so we have to count both to get the right members out. */ for (j = item = 0; j < dim; j++, item++) { if (cptr->type == CSTRUCT) j += dump_struct(cptr, item) - 1; else { if (line_count % 10 == 0) { nl(); if (cptr->type == CCHAR || cptr->type == CUCHAR) defbyte(); else defword(); } if (j < list_size) { // dump data int value = get_item_at(cptr->name, j, &tag_table[cptr->tagidx]); outdec(value); } else { // dump zero, no more data available outdec(0); } line_count++; if (line_count % 10 == 0) line_count = 0; else { if (j < dim - 1) outbyte(','); } } } nl(); output = save; } else { if (pass == 0) continue; /* define space in bss */ if (i) { i = 0; nl(); gdata(); } if (cptr->storage != LSTATIC) prefix(); outstr(cptr->name); outstr(":\t"); defstorage(); outdec(cptr->size); nl(); cptr->storage |= WRITTEN; } } } else { // fpubext(cptr); } } if (++pass < 3) goto next; } if (i) { nl(); gdata(); } output = save; }
int gen_as_init(Node *n) { Node *nr, *nl; Node nam, nod1; if(n->dodata == 0) goto no; nr = n->right; nl = n->left; if(nr == N) { if(!stataddr(&nam, nl)) goto no; if(nam.class != PEXTERN) goto no; goto yes; } if(nr->type == T || !eqtype(nl->type, nr->type)) goto no; if(!stataddr(&nam, nl)) goto no; if(nam.class != PEXTERN) goto no; switch(nr->op) { default: goto no; case OCONVNOP: nr = nr->left; if(nr == N || nr->op != OSLICEARR) goto no; // fall through case OSLICEARR: if(nr->right->op == OKEY && nr->right->left == N && nr->right->right == N) { nr = nr->left; goto slice; } goto no; case OLITERAL: break; } switch(nr->type->etype) { default: goto no; case TBOOL: case TINT8: case TUINT8: case TINT16: case TUINT16: case TINT32: case TUINT32: case TINT64: case TUINT64: case TINT: case TUINT: case TUINTPTR: case TPTR32: case TPTR64: case TFLOAT32: case TFLOAT64: gused(N); // in case the data is the dest of a goto gdata(&nam, nr, nr->type->width); break; case TCOMPLEX64: case TCOMPLEX128: gused(N); // in case the data is the dest of a goto gdatacomplex(&nam, nr->val.u.cval); break; case TSTRING: gused(N); // in case the data is the dest of a goto gdatastring(&nam, nr->val.u.sval); break; } yes: return 1; slice: gused(N); // in case the data is the dest of a goto nl = nr; if(nr == N || nr->op != OADDR) goto no; nr = nr->left; if(nr == N || nr->op != ONAME) goto no; // nr is the array being converted to a slice if(nr->type == T || nr->type->etype != TARRAY || nr->type->bound < 0) goto no; nam.xoffset += Array_array; gdata(&nam, nl, types[tptr]->width); nam.xoffset += Array_nel-Array_array; nodconst(&nod1, types[TINT32], nr->type->bound); gdata(&nam, &nod1, types[TINT32]->width); nam.xoffset += Array_cap-Array_nel; gdata(&nam, &nod1, types[TINT32]->width); goto yes; no: if(n->dodata == 2) { dump("\ngen_as_init", n); fatal("gen_as_init couldnt make data statement"); } return 0; }