示例#1
0
void RingDockSite::Free()
{
	if(m_Background.bNeedDelete)
   	DeleteObject(m_Background.hBrush);

	LPRINGBARLINEINFO pre,tmp = m_First;
	RingDockBar* dockbar,*save;
	
	while(tmp)
	{
		dockbar = tmp->m_first;
		pre = tmp;
		tmp = tmp->m_nextline;
		while(dockbar)
		{
			save = dockbar->m_next;
			delete dockbar;
			dockbar = save;
		}		
		Del(pre);
	}
	tmp = m_EmptyLine;
	m_EmptyLine = NULL;
	while(tmp)
	{
		pre = tmp;
		tmp = tmp->m_nextline;
		Del(pre);
	}
}
示例#2
0
void cParser::Parse(unsigned char *data, int datasize, bool pusi)
{
  // get available data
  int length = 0;
  uint8_t* buffer = Get(length);

  // do we have a sync ?
  int framesize = 0;
  if(length > m_headersize && buffer != NULL && CheckAlignmentHeader(buffer, framesize))
  {
    if(framesize > 0 && length >= framesize)
    {
      ParsePayload(buffer, framesize);
      SendPayload(buffer, framesize);

      m_curPTS = PtsAdd(m_curPTS, m_duration);
      m_curDTS = PtsAdd(m_curDTS, m_duration);

      Del(framesize);
    }

    PutData(data, datasize, pusi);
    return;
  }

  // try to find sync
  int offset = FindAlignmentOffset(buffer, length, 0, framesize);
  if(offset != -1)
  {
    INFOLOG("sync found at offset %i (streamtype: %s / %i bytes in buffer / framesize: %i bytes)", offset, m_demuxer->TypeName(), Available(), framesize);
    Del(offset);
  }

  PutData(data, datasize, pusi);
}
示例#3
0
文件: global.cpp 项目: radtek/andy-im
BOOL SaveGrayBmp(HDC   hDC,HBITMAP hBitmap,LPCTSTR szFilename)
{
	andyFile rf = szFilename;
	BITMAP   Bm;   
	BITMAPINFO   BitInfo;   
	ZeroMemory(&BitInfo,   sizeof(BITMAPINFO));   
	BitInfo.bmiHeader.biSize   =   sizeof(BITMAPINFOHEADER);   
	BitInfo.bmiHeader.biBitCount   =   0;   

	if(!::GetDIBits(hDC,   hBitmap,   0,   0,   NULL,   &BitInfo,   DIB_RGB_COLORS))   
		return   FALSE;   

	Bm.bmHeight   =   BitInfo.bmiHeader.biHeight;   
	Bm.bmWidth     =   BitInfo.bmiHeader.biWidth;   

	BITMAPFILEHEADER         BmHdr;   

	BmHdr.bfType                 =   0x4d42;       //   'BM'   WINDOWS_BITMAP_SIGNATURE   
	BmHdr.bfSize                 =   (((3   *   Bm.bmWidth   +   3)   &   ~3)   *   Bm.bmHeight)     
		+   sizeof(BITMAPFILEHEADER)     
		+   sizeof(BITMAPINFOHEADER);   
	BmHdr.bfReserved1         =   BmHdr.bfReserved2   =   0;   
	BmHdr.bfOffBits             =   (DWORD)   sizeof(BITMAPFILEHEADER)     
		+   sizeof(BITMAPINFOHEADER);   

	BitInfo.bmiHeader.biCompression   =   0;   
	//   Writing   Bitmap   File   Header   ////   
	if(!rf.Create(RF_NEW))
		return FALSE;

	if(!rf.Write(&BmHdr,sizeof(BITMAPFILEHEADER),TRUE))
	{
		rf.Close();
		return FALSE;
	}
	if(!rf.Write(&BitInfo.bmiHeader,sizeof(BITMAPINFOHEADER),TRUE))	
	{
		rf.Close();
		return FALSE;
	}
	BYTE   *pData   =   new   BYTE[BitInfo.bmiHeader.biSizeImage   +   5];   
	if(!::GetDIBits(hDC,   hBitmap,   0,   Bm.bmHeight,     
		pData,   &BitInfo,   DIB_RGB_COLORS))   
		return   FALSE;   
	if(pData   !=   NULL)    
	{
		ChangeGray(pData,Bm.bmWidth,Bm.bmHeight);
		if(!rf.Write(pData,BitInfo.bmiHeader.biSizeImage,TRUE))
		{
			Del(pData);
			rf.Close();
			return FALSE;
		}
	}
	Del(pData);
	rf.Close();
	return TRUE;

}
示例#4
0
 __m128 Del4(int i, int j) const
 {
     __m128 res = _mm_setr_ps(Del(i + 0, j),
                              Del(i + 1, j),
                              Del(i + 2, j),
                              Del(i + 3, j));
     return res;
 }
示例#5
0
eOSState cMenuEpgTimers::Delete(void)
{
  // Check if this timer is active:
  cTimer *ti = CurrentTimer();
  if (ti) {
     if (Interface->Confirm(tr("Delete timer?"))) {
        if (ti->Recording()) {
           if (Interface->Confirm(tr("Timer still recording - really delete?"))) {
              ti->Skip();
              cRecordControls::Process(time(NULL));
              }
           else
              return osContinue;
           }
        isyslog("deleting timer %s", *ti->ToDescr());
        if(!Timers.Del(ti))
            Skins.Message(mtError, trVDR("Could not delete timer"));
        //cOsdMenu::Del(Current());
        Timers.SetModified();
        //Display();
        }
  } else {
      cMenuSwitchTimerItem *item = dynamic_cast<cMenuSwitchTimerItem*> (Get(Current()));
      if (item && item->switchTimer &&
              Interface->Confirm(tr("Delete switchtimer?"))) {
          cMutexLock SwitchTimersLock(&SwitchTimers);
          SwitchTimers.Del(item->switchTimer);
          SwitchTimers.Save();
          Del(Current());
      }
  }
  return osContinue;
}
示例#6
0
文件: Map.cpp 项目: Elfhir/minecraft
	void Map::DelByPixel(GLfloat x,GLfloat y,GLfloat z){
		GLfloat cubeSize=Cube::m_size;
		x+=cubeSize*0.5;
		y+=cubeSize*0.5;
		z+=cubeSize*0.5;
		Del((size_t)(x/Cube::m_size),(size_t)(y/Cube::m_size),(size_t)(z/Cube::m_size));
	}
示例#7
0
文件: Vcont.hpp 项目: pedia/raidget
void Array<T>::SetCountR(int n, const T& init) {
	ASSERT(n >= 0);
	int  lc = vector.GetCount();
	Del(vector.Begin() + n, vector.End());
	vector.SetCountR(n);
	Init(vector.Begin() + lc, vector.Begin() + n, init);
}
示例#8
0
void cStreamdevFilters::CarbageCollect(void) {
	LOCK_THREAD;
	for (cStreamdevFilter *fi = First(); fi;) {
		if (fi->IsClosed()) {
			if (errno == ECONNREFUSED ||
					errno == ECONNRESET ||
					errno == EPIPE) {
				ClientSocket.SetFilter(fi->Pid(), fi->Tid(), fi->Mask(), false);
				Dprintf("cStreamdevFilters::CarbageCollector: filter closed: Pid %4d, Tid %3d, Mask %2x (%d filters left)",
						(int)fi->Pid(), (int)fi->Tid(), fi->Mask(), Count()-1);

				cStreamdevFilter *next = Prev(fi);
				Del(fi);
				fi = next ? Next(next) : First();
			} else {
				esyslog("cStreamdevFilters::CarbageCollector() error: "
						"Pid %4d, Tid %3d, Mask %2x (%d filters left) failed",
						(int)fi->Pid(), (int)fi->Tid(), fi->Mask(), Count()-1);
				LOG_ERROR;
				fi = Next(fi);
			}
		} else {
			fi = Next(fi);
		}
	}
}
示例#9
0
文件: commands.c 项目: suborb/reelvdr
void cCMDMove::Build(char *dir)
{
  MYDEBUG("Verzeichnis: Move: Erstelle Verzeichnisliste: %s", dir);
  if(!dir)
    dir = CurrentDir();

  Clear();

  cDirHandling *DirHand = new cDirHandling(this, this);
  SetCurrent(Get(DirHand->Build(dir, true)));
  delete(DirHand);

  if(Count())
  {
    cMainMenuItem *item = (cMainMenuItem*)First();
    while(item)
    {
      if(!strcasecmp(item->FileName(), File))
      {
        Del(item->Index());
        break;
      }
      item = (cMainMenuItem*)Next(item);
    }
  }

  Display();
  SetHelp();
}
示例#10
0
void PCFPipesMgr::CombinationPipe(AcGePoint3d &Pt1,AcGePoint3d &Pt2)
{
	PCFPipe *pPipe = NULL;
	PCFPipe *pPipe1 = NULL;
	PCFPipe *pPipe2 = NULL;
	IteratorPtr<PCFPipe> PipeitPtr(CreateIt());
	for(PipeitPtr->Fist();!PipeitPtr->IsDone();PipeitPtr->Next())
	{
		pPipe = &PipeitPtr->CurrentItem();
		ASSERT(pPipe != NULL);
		if(IsEqual(pPipe->EndPt(),Pt1))
		{
			pPipe1 = pPipe;
		}
		if(IsEqual(pPipe->StartPt(),Pt2))
		{
			pPipe2 = pPipe;
		}
	}
	if(pPipe1!=NULL&&pPipe2!=NULL)
	{
		pPipe1->EndPt(pPipe2->EndPt());
		Del(pPipe2->GetKey());
	}
}
示例#11
0
//返回清除的记录数,写log
ssize_t MemKeyCache::CleanNode(DUMP_MATCH_FUNC fMatchFunc,void* pArg)
{
	char szKey[MAX_KEY_LEN];

	ssize_t iCnt = 0;
	for (ssize_t iBucketIdx=0; iBucketIdx<m_pMemCacheHead->m_iBucketNum; iBucketIdx++)
	{
		ssize_t iNodeIdx = m_piBucket[iBucketIdx];
		while( iNodeIdx >= 0 )
		{
			ssize_t iKeyLen = GetKeyByIdx(iNodeIdx,szKey,MAX_KEY_LEN);
			ssize_t iDataFlag = GetFlag(iNodeIdx);

			//先指向下一个,然后删除
			iNodeIdx = m_NodeObjMng.GetDsIdx(iNodeIdx,m_pMemCacheHead->m_iDSSuffix);

			//符合条件的
			if(fMatchFunc(szKey,iKeyLen,iDataFlag,pArg) == 0)
			{
				Del(szKey,iKeyLen);
				iCnt++;
			}
		}
	}

	return iCnt;
}
示例#12
0
文件: Vcont.hpp 项目: pedia/raidget
void Array<T>::SetCount(int n) {
	ASSERT(n >= 0);
	int  lc = vector.GetCount();
	Del(vector.Begin() + n, vector.End());
	vector.SetCount(n);
	Init(vector.Begin() + lc, vector.Begin() + n);
}
示例#13
0
void BFS(int dirBack,Queue *Q) {
	int x,y,degree,color;
	if(IsEmpty(*Q)) {}
	else {
		Del(Q,&x);
		switch(dirBack) {
			case right:
				y=(x==straight)?right:straight;
				break;
			case straight:
				y=(x==right)?left:right;
				break;
			case left:
				y=(x==straight)?left:straight;
				break;
			default:
				y=x; //first
		}
		if(y!=straight) {
			stepAhead(220);
			degree=(y==right)?85:-80;
			turn(y,degree);
		}
		color = searchSpot();
		if(color==green) {
			Add(Q,x);
			cekSimpang(Q);
		}
		turn(-1,-180);
		BFS(x,Q);
	}
}
示例#14
0
void ChangeTurn(Queue *Q)
{
	//kamus
	infotype X;
	//algoritma
	Del(&(*Q), &X);
	Add(&(*Q), X);
}
示例#15
0
void ChangeTurn(Queue *Q)
/* I.S : Queue berisi minimal 2 elemen */
/* F.S : Head(Q) diganti menjadi pemain yang berada di antrian selanjutnya */
/*       Sedangkan untuk Head(Q) di awal dipindah ke antrian paling belakang / Tail(Q) */
{
	Pemain P;
	Del(&(*Q),&P);
	Add(&(*Q),P);
}
示例#16
0
文件: ZGGZ.c 项目: driverCzn/code_git
int main()
{
	ZGGZ   gz[N];//60个职工
	FILE   *fp;
	int    select;
	char   choice;
	int    count=0;
	fp=fopen("db","ab+");

  //判断文件是否打开成功
	if(fp==NULL) {
		printf("\n----------cannot open file");
		exit(0);
	}

	while(!feof(fp)) {
		if(fread( &gz[count], sizeof(ZGGZ),1,fp )==1)
			count++;
	}

	fclose(fp);
	menu();
	while(1) {
    printf("please enter your choice(0-9)\n");
    scanf("%d",&select);
    if(select==0) {
      if(saveflag==1) {
        printf("file has changed,do you save it?(y/n)");
        getchar();
        scanf("%c",&choice);
        if(choice=='y'||choice=='Y') {
          Save(gz,count);
          printf("thank you for your useness\n");
        } else
          printf("thank you for your useness\n");
        break;
      } else {
        printf("thank you for your useness\n");
        break;
      }
    }
    switch(select)
    {
      case 1:count=Add(gz,count);break;
      case 2:count=Del(gz,count);break;
      case 3:Qur(gz,count);break;
      case 4:Modify(gz,count);break;
      case 5:Insert(gz,count);break;
      case 6:Count(gz,count);break;
      case 7:Sort(gz,count);break;
      case 8:Save(gz,count);break;
      case 9:Disp(gz,count);break;
      default :Wrong();break;
    }
  }
  return 0;
}
示例#17
0
int SessionMgr::Del( Session *pSession )
{
	if (!pSession)
	{
		logerr("pSession NULL\n");
	}
	logdbg("session delete[%s:%d]\n",pSession->OnGetIPAddr().c_str(), pSession->OnGetPort());
	Del((pSession->GetKey()));
	return 0;
}
示例#18
0
文件: flx.cpp 项目: Accio/snap
void TFile::DelWc(const TStr& WcStr, const bool& RecurseDirP){
  // collect file-names
  TStrV FNmV;
  TFFile FFile(WcStr, RecurseDirP); TStr FNm;
  while (FFile.Next(FNm)){
    FNmV.Add(FNm);}
  // delete files
  for (int FNmN=0; FNmN<FNmV.Len(); FNmN++){
    Del(FNmV[FNmN], false);}
}
示例#19
0
void cSetup::Store(const char *Name, const char *Value, const char *Plugin, bool AllowMultiple)
{
  if (Name && *Name) {
     cSetupLine *l = Get(Name, Plugin);
     if (l && !AllowMultiple)
        Del(l);
     if (Value)
        Add(new cSetupLine(Name, Value, Plugin));
     }
}
示例#20
0
文件: MyTree.cpp 项目: styxschip/Note
void MyTree::RemoveAll()
{
    MyStack ss;
    TreeNode *pCurNode = m_pRoot;
    TreeNode *pLastNode = NULL;

    while (true)
    {
        while (pCurNode != NULL)
        {
            ss.push(pCurNode);
            pCurNode = pCurNode->m_pLeft;
        }
        if (ss.IsEmpty())
        {
            break;
        }
        pCurNode = ss.pop();
        if (pCurNode->m_pLeft == NULL && pCurNode->m_pRight == NULL)
        {
            pLastNode = pCurNode;
        }
        else if (pCurNode->m_pRight == NULL ||
            pCurNode->m_pRight == pLastNode)
        {
            pLastNode = pCurNode;
            Del(pCurNode);
            pCurNode = NULL;
            continue;
        }
        else
        {
            ss.push(pCurNode);
            pCurNode = pCurNode->m_pRight;
            continue;
        }
        
        TreeNode *pDelNode = pCurNode;
        pCurNode = pCurNode->m_pRight;
        Del(pDelNode);
    }
}
示例#21
0
/* q_get returns a pointer to the buffer where data is read or NULL if
 * buffer is empty.
 */
static Byte *q_get(int sockfd, QTYPE *queue) {
	int emptySpace = EmptySpace(*queue);

	if (emptySpace < RXQSIZE) {
		/*
		Retrieve data from buffer
		If the number of characters in the receive buffer is below certain
		level, then send XON.
		Increment front index and check for wraparound.
		*/
		if ( ( emptySpace >= maxLowerLimit ) && ( x == 0 ) ) {
			char state[1];

			printf("Buffer < maximum lowerlimit. Mengirim XON.\n");
			sprintf(state, "%c",(char) XON);
			if (sendto(sockfd, state, 1, 0, (struct sockaddr *)&targetAddr, addrLen)==-1) {
				perror("sendto");
			}
			x = 1;

			sleep(5);

			return NULL;

		} else {

			consumed[0] = Del(queue);
			
			while ( !(consumed[0] >= 32 || consumed[0] == 13 || consumed[0] == 10) && EmptySpace(*queue) > 0 ) {
				consumed[0] = Del(queue);
			}

			return consumed;

		}
	} else {
		/* Nothing in the queue */
		return NULL;
	}

}
示例#22
0
// 解关联
void ringFile::Destroy()
{
	Close();

	memset(m_szFilename,0,MAX_PATH);
	if(m_lpszPath)
		m_lpszPath = (LPTSTR)Del(m_lpszPath);
	m_lpszFilename = NULL;
	if(m_lpszTitlename)
		m_lpszTitlename = (LPTSTR)Del(m_lpszTitlename);
	m_lpszExtname = NULL;
	memset(m_szDrive,0,4);

	m_dwFileAttr	= 0xffffffff;
	m_dwFileSize	= 0;
	m_aAttrib		= RFA_VOID;

	if(m_lpFilebuf)
		m_lpFilebuf = Del(m_lpFilebuf);
	m_bufSize = 0;
}
示例#23
0
	void HandleDel(const CString& sLine) {
		CString sMsg  = sLine.Token(1, true);
		bool bNegated = sMsg.TrimPrefix("!");
		CString sChan = sMsg.Token(0);
		CString sHost = sMsg.Token(1);

		if (Del(bNegated, sChan, sHost)) {
			PutModule("Removed " + sChan + " from list");
		} else {
			PutModule("Usage: Del [!]<#chan> <host>");
		}
	}
示例#24
0
文件: data.c 项目: 3PO/vdr-plugin-sc
void cStructLoader::Purge(void)
{
  if(!SL_TSTFLAG(SL_DISABLED) && !SL_TSTFLAG(SL_NOPURGE)) {
    ListLock(true);
    for(cStructItem *it=First(); it;) {
      cStructItem *n=Next(it);
      if(it->Deleted()) Del(it);
      it=n;
      }
    ListUnlock();
    }
}
void GetPostureScore(HandSegment leftHands,HandSegment rightHands,HandSegment bothHands,double* score)
{
	hand[0]=leftHands;
	hand[1]=rightHands;
	hand[2]=bothHands;
	DealProbeData();   //构造好Probe数据需要的数据结构
	Get_Image_HOG();//将Probe中的数据写入建好的数据结构中
	Get_matrix();//获得最终的归一化向量
	for(int i=0;i<WordsNum;i++)
		score[i]=result_matrix[i];
	Del();
}
示例#26
0
AndyDataGuardEx::~AndyDataGuardEx()
{
	CloseHandle(m_hEvent);
	
   if(m_hFileMap == NULL)
	   Del(m_info);
   else
	{
      UnmapViewOfFile(m_info);
      CloseHandle(m_hFileMap);
   }
}
示例#27
0
/*****************************************************************************
 * Add:
 *****************************************************************************/
static sout_stream_id_sys_t * Add( sout_stream_t *p_stream, es_format_t *p_fmt )
{
    sout_stream_sys_t *p_sys = p_stream->p_sys;
    sout_stream_id_sys_t  *id;
    int i_stream, i_valid_streams = 0;

    id = malloc( sizeof( sout_stream_id_sys_t ) );
    if( !id )
        return NULL;

    TAB_INIT( id->i_nb_ids, id->pp_ids );

    msg_Dbg( p_stream, "duplicated a new stream codec=%4.4s (es=%d group=%d)",
             (char*)&p_fmt->i_codec, p_fmt->i_id, p_fmt->i_group );

    for( i_stream = 0; i_stream < p_sys->i_nb_streams; i_stream++ )
    {
        void *id_new = NULL;

        if( ESSelected( p_fmt, p_sys->ppsz_select[i_stream] ) )
        {
            sout_stream_t *out = p_sys->pp_streams[i_stream];

            id_new = (void*)sout_StreamIdAdd( out, p_fmt );
            if( id_new )
            {
                msg_Dbg( p_stream, "    - added for output %d", i_stream );
                i_valid_streams++;
            }
            else
            {
                msg_Dbg( p_stream, "    - failed for output %d", i_stream );
            }
        }
        else
        {
            msg_Dbg( p_stream, "    - ignored for output %d", i_stream );
        }

        /* Append failed attempts as well to keep track of which pp_id
         * belongs to which duplicated stream */
        TAB_APPEND( id->i_nb_ids, id->pp_ids, id_new );
    }

    if( i_valid_streams <= 0 )
    {
        Del( p_stream, id );
        return NULL;
    }

    return id;
}
示例#28
0
eOSState cAlbumList::ProcessKey(eKeys Key) {
        eOSState state = cOsdMenu::ProcessKey(Key);
        if (state != osUnknown ) 
                return state;

        cPlayList *List;
        cPlayListItem *Item;
        switch (Key) {
                case kOk:
                        MENUDEB("Current %d GetItem %p\n",Current(),playList->GetItem(Current()));
                        Item=playList->GetItem(Current());
                        List=dynamic_cast<cPlayList*>(Item);
                        MENUDEB("Item %p\n",Item);

                        if (List) {
                                cAlbumList *Menu=new cAlbumList(List);
                                return AddSubMenu(Menu);
                        }  else {
                                // skip to current track
                                playList->SetCurrIdx(
                                                playList->GetIndexByItem(Item));
                                state = PLAY_CURR_FILE;
                        };
                        break;
                case kBack:
                        state= osBack;
                        break;
                case kBlue:
                        state= osEnd;
                        break;
                case kRed:
                        return AddSubMenu(new cPlOptionsMenu(playList));
                        break;
                case kYellow:
                        MENUDEB("Del current %d: %s\n",
                                        Current(),
                                        playList->GetItem(Current())->GetName() );
                        playList->RemoveItem(
                                        playList->GetItem(Current()));
                        MENUDEB("Remove finished\n");
                        Del(Current());
                        Display();
                        state=osContinue;
                        break;

                default:    
                        break;
        }

        return state;
}
示例#29
0
文件: list.c 项目: LeoMirots/Lists
void pop(list l, size_t element_n)
{
	if (element_n == 0)														//This function cannot delete the first element because it doesn't have return, so we would lost all the list;
		DelFirst(l);

	if (element_n > llenght(l)) {
		fprintf(stderr, "Tryng to delete an element outside the list!");
		abort();
	}
	for (size_t i = 0; i < element_n - 1; i++)
		l = tail(l);															//The l pointer is incremented untill it points to the item before the item to delete;		
	list cancellable = tail(l);												//the pointer to the next item of list l, the item to delete, is saved in "cancellable" variable;
	l->next = tail(cancellable);												//The pointer to the next element of list l, is set to the next item of cancellable; the list l is now not linked to the item to delete;
	Del(l, cancellable);													//The element to delete is deleted;
}
示例#30
0
bool CharsetDlg1::Command(int id, int subId, Win *win, void *data)
{
	if (id == CMD_ITEM_CLICK && win == &list)
		EndModal(CMD_OK);
	else
	switch (id) {
	case CMD_OTHER: 
			EndModal(CMD_OTHER);
			return true;
	case CMD_ADD: Add(); return true;
	case CMD_DEL: Del(); return true;
	}

	return NCDialog::Command(id, subId, win, data);
}